49 Q_PROPERTY(QString title READ getTitle WRITE setTitle)
50 Q_PROPERTY(Qt::Alignment alignment READ getAlignment WRITE setAlignment)
80 explicit QUIWidget(QWidget *parent = 0,
bool bQuitOnClose =
false);
85 static void setStyle(
const QString &qssFile);
86 static void setStyle(QUIWidget::Style style);
89 static void setFormInCenter(QWidget *frm);
92 static void getQssColor(
const QString &qss,
96 QString &normalColorStart,
97 QString &normalColorEnd,
98 QString &darkColorStart,
99 QString &darkColorEnd,
103 static void setTranslator(
const QString &qmFile);
105 static void setCode();
108 static void showMessageBoxInfo(
const QString &info,
int closeSec = 0);
110 static void showMessageBoxError(
const QString &info,
int closeSec = 0);
112 static int showMessageBoxQuestion(
const QString &info);
115 static QString showInputBox(
bool &ok,
const QString &title,
int type = 0,
int closeSec = 0,
116 QString defaultValue = QString(),
bool pwd =
false);
119 bool eventFilter(QObject *obj, QEvent *evt)
override;
122 QVBoxLayout *verticalLayout1;
124 QVBoxLayout *verticalLayout2;
125 QWidget *widget_title;
126 QHBoxLayout *horizontalLayout4;
129 QWidget *widget_menu;
130 QHBoxLayout *horizontalLayout;
131 QToolButton *btnMenu;
132 QPushButton *btnMenu_Min;
133 QPushButton *btnMenu_Max;
134 QPushButton *btnMenu_Close;
136 QVBoxLayout *verticalLayout3;
144 Qt::Alignment alignment;
147 QLabel *getLabIco()
const;
148 QLabel *getLabTitle()
const;
149 QToolButton *getBtnMenu()
const;
150 QPushButton *getBtnMenuMin()
const;
151 QPushButton *getBtnMenuMax()
const;
152 QPushButton *getBtnMenuMClose()
const;
154 Style getStyle()
const;
155 QString getTitle()
const;
156 Qt::Alignment getAlignment()
const;
158 QSize sizeHint()
const override;
159 QSize minimumSizeHint()
const override;
167 void on_btnMenu_Min_clicked();
168 void on_btnMenu_Max_clicked();
169 void on_btnMenu_Close_clicked();
173 void setIcon(QUIWidget::Widget widget, QChar str, quint32 size = 9);
175 void setPixmap(QUIWidget::Widget widget,
const QString &file,
const QSize &size = QSize(16, 16));
177 void setVisible(QUIWidget::Widget widget,
bool visible =
true);
179 void setOnlyCloseBtn();
182 void setTitleHeight(
int height);
184 void setBtnWidth(
int width);
187 void setTitle(
const QString &title);
188 void setAlignment(Qt::Alignment alignment);
192 void setMainWidget(QWidget *mainWidget,
bool bUsed =
true);
195 void sigChangeStyle(
const QString &qssFile);
198 virtual void resizeEvent(QResizeEvent *event)
override;
199 virtual void showEvent(QShowEvent *event)
override;
216 QMutexLocker locker(&mutex);
227 void closeEvent(QCloseEvent *);
228 bool eventFilter(QObject *obj, QEvent *evt);
233 QVBoxLayout *verticalLayout1;
234 QWidget *widget_title;
235 QHBoxLayout *horizontalLayout3;
239 QWidget *widget_menu;
240 QHBoxLayout *horizontalLayout4;
241 QPushButton *btnMenu_Close;
243 QVBoxLayout *verticalLayout2;
245 QVBoxLayout *verticalLayout4;
246 QHBoxLayout *horizontalLayout1;
248 QSpacerItem *horizontalSpacer1;
250 QHBoxLayout *horizontalLayout2;
251 QSpacerItem *horizontalSpacer2;
253 QPushButton *btnCancel;
265 void on_btnOk_clicked();
266 void on_btnMenu_Close_clicked();
269 void setMessage(
const QString &msg,
int type,
int closeSec = 0);
286 QMutexLocker locker(&mutex);
297 void closeEvent(QCloseEvent *);
298 bool eventFilter(QObject *obj, QEvent *evt);
303 QVBoxLayout *verticalLayout1;
304 QWidget *widget_title;
305 QHBoxLayout *horizontalLayout1;
309 QWidget *widget_menu;
310 QHBoxLayout *horizontalLayout2;
311 QPushButton *btnMenu_Close;
313 QVBoxLayout *verticalLayout2;
315 QVBoxLayout *verticalLayout3;
318 QComboBox *cboxValue;
320 QSpacerItem *horizontalSpacer;
322 QPushButton *btnCancel;
335 void on_btnOk_clicked();
336 void on_btnMenu_Close_clicked();
339 void setParameter(
const QString &title,
int type = 0,
int closeSec = 0,
340 QString defaultValue = QString(),
bool pwd =
false);
342 QString getValue()
const;