ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvUIManager.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #ifdef Q_OS_WIN
11 #define NEWLINE "\r\n"
12 #else
13 #define NEWLINE "\n"
14 #endif
15 
32 #include <QPainterPath>
33 #include <QSystemTrayIcon>
34 
35 #include "ecvHead.h"
36 
37 class MainWindow;
38 
39 #ifdef quc
40 #if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0))
41 #include <QtDesigner/QDesignerExportWidget>
42 #else
43 #include <QtUiPlugin/QDesignerExportWidget>
44 #endif
45 
46 class QDESIGNER_WIDGET_EXPORT QUIWidget : public QDialog
47 #else
48 class QUIWidget : public QDialog
49 #endif
50 
51 {
52  Q_OBJECT
53  Q_ENUMS(Style)
54  Q_PROPERTY(QString title READ getTitle WRITE setTitle)
55  Q_PROPERTY(Qt::Alignment alignment READ getAlignment WRITE setAlignment)
56 
57 public:
58  // Expose some objects as enum values to external
59  enum Widget {
60  Lab_Ico = 0, // Top-left icon
61  BtnMenu = 1, // Dropdown menu button
62  BtnMenu_Min = 2, // Minimize button
63  BtnMenu_Max = 3, // Maximize button
64  BtnMenu_Normal = 4, // Restore button
65  BtnMenu_Close = 5 // Close button
66  };
67 
68  // Style enumeration
69  enum Style {
70  Style_Silvery = 0, // Silvery style
71  Style_Blue = 1, // Blue style
72  Style_LightBlue = 2, // Light blue style
73  Style_DarkBlue = 3, // Dark blue style
74  Style_Gray = 4, // Gray style
75  Style_LightGray = 5, // Light gray style
76  Style_DarkGray = 6, // Dark gray style
77  Style_Black = 7, // Black style
78  Style_LightBlack = 8, // Light black style
79  Style_DarkBlack = 9, // Dark black style
80  Style_PSBlack = 10, // PS black style
81  Style_FlatBlack = 11, // Flat black style
82  Style_FlatWhite = 12 // Flat white style
83  };
84 
85  // Global static methods collection start--------------------------------
86 public:
87  // Desktop width and height
88  static int deskWidth();
89  static int deskHeight();
90 
91  // Application file name
92  static QString appName();
93  // Application current path
94  static QString appPath();
95 
96  // Create new directory
97  static void newDir(const QString &dirName);
98 
99  // Write message to additional log file
100  static void writeInfo(const QString &info, const QString &filePath = "log");
101 
102  // Set global style
103  static void setStyle(QUIWidget::Style style);
104  static void setStyle(QString &qssFile);
105  static void setStyle(const QString &qssFile,
106  QString &paletteColor,
107  QString &textColor);
108  static void setStyle(const QString &qssFile,
109  QString &textColor,
110  QString &panelColor,
111  QString &borderColor,
112  QString &normalColorStart,
113  QString &normalColorEnd,
114  QString &darkColorStart,
115  QString &darkColorEnd,
116  QString &highColor);
117 
118  // Get corresponding color values from QSS style
119  static void getQssColor(const QString &qss,
120  QString &textColor,
121  QString &panelColor,
122  QString &borderColor,
123  QString &normalColorStart,
124  QString &normalColorEnd,
125  QString &darkColorStart,
126  QString &darkColorEnd,
127  QString &highColor);
128 
129  // Set form to center display
130  static void setFormInCenter(QWidget *frm);
131  // Set translation file
132  static void setTranslator(const QString &qmFile = ":/image/qt_zh_CN.qm");
133  // Set encoding
134  static void setCode();
135  // Set delay
136  static void sleep(int sec);
137  // Set system time
138  static void setSystemDateTime(const QString &year,
139  const QString &month,
140  const QString &day,
141  const QString &hour,
142  const QString &min,
143  const QString &sec);
144  // Set auto-start on boot
145  static void runWithSystem(const QString &strName,
146  const QString &strPath,
147  bool autoRun = true);
148 
149  // Check if it's an IP address
150  static bool isIP(const QString &ip);
151 
152  // Check if it's a MAC address
153  static bool isMac(const QString &mac);
154 
155  // Check if it's a valid phone number
156  static bool isTel(const QString &tel);
157 
158  // Check if it's a valid email address
159  static bool isEmail(const QString &email);
160 
161  // Convert hex string to decimal
162  static int strHexToDecimal(const QString &strHex);
163 
164  // Convert decimal string to decimal
165  static int strDecimalToDecimal(const QString &strDecimal);
166 
167  // Convert binary string to decimal
168  static int strBinToDecimal(const QString &strBin);
169 
170  // Convert hex string to binary string
171  static QString strHexToStrBin(const QString &strHex);
172 
173  // Convert decimal to binary string (one byte)
174  static QString decimalToStrBin1(int decimal);
175 
176  // Convert decimal to binary string (two bytes)
177  static QString decimalToStrBin2(int decimal);
178 
179  // Convert decimal to hex string, zero-padded
180  static QString decimalToStrHex(int decimal);
181 
182  // Convert int to byte array
183  static QByteArray intToByte(int i);
184 
185  // Convert byte array to int
186  static int byteToInt(const QByteArray &data);
187 
188  // Convert ushort to byte array
189  static QByteArray ushortToByte(ushort i);
190 
191  // Convert byte array to ushort
192  static int byteToUShort(const QByteArray &data);
193 
194  // XOR encryption algorithm
195  static QString getXorEncryptDecrypt(const QString &str, char key);
196 
197  // XOR checksum
198  static uchar getOrCode(const QByteArray &data);
199 
200  // Calculate checksum
201  static uchar getCheckCode(const QByteArray &data);
202 
203  // Convert byte array to ASCII string
204  static QString byteArrayToAsciiStr(const QByteArray &data);
205 
206  // Convert hex string to byte array
207  static QByteArray hexStrToByteArray(const QString &str);
208  static char convertHexChar(char ch);
209 
210  // Convert ASCII string to byte array
211  static QByteArray asciiStrToByteArray(const QString &str);
212 
213  // Convert byte array to hex string
214  static QString byteArrayToHexStr(const QByteArray &data);
215 
216  // Get selected file
217  static QString getFileName(
218  const QString &filter,
219  QString defaultDir = QCoreApplication::applicationDirPath());
220 
221  // Get selected file collection
222  static QStringList getFileNames(
223  const QString &filter,
224  QString defaultDir = QCoreApplication::applicationDirPath());
225 
226  // Get selected directory
227  static QString getFolderName();
228 
229  // Get file name with extension
230  static QString getFileNameWithExtension(const QString &strFilePath);
231 
232  // Get files in selected folder
233  static QStringList getFolderFileNames(const QStringList &filter);
234 
235  // Check if folder exists
236  static bool folderIsExist(const QString &strFolder);
237 
238  // Check if file exists
239  static bool fileIsExist(const QString &strFile);
240 
241  // Copy file
242  static bool copyFile(const QString &sourceFile, const QString &targetFile);
243 
244  // Delete all files in folder
245  static void deleteDirectory(const QString &path);
246 
247  // Check if IP address and port are online
248  static bool ipLive(const QString &ip, int port, int timeout = 1000);
249 
250  // Get all source code of web page
251  static QString getHtml(const QString &url);
252 
253  // Get local public IP address
254  static QString getNetIP(const QString &webCode);
255 
256  // Get local IP
257  static QString getLocalIP();
258 
259  // Convert URL address to IP address
260  static QString urlToIP(const QString &url);
261 
262  // Check if internet access is available
263  static bool isWebOk();
264 
265  // Show message box
266  static void showMessageBoxInfo(const QString &info, int closeSec = 0);
267  // Show error box
268  static void showMessageBoxError(const QString &info, int closeSec = 0);
269  // Show question box
270  static int showMessageBoxQuestion(const QString &info);
271 
272  // Show input box
273  static QString showInputBox(bool &ok,
274  const QString &title,
275  int type = 0,
276  int closeSec = 0,
277  QString defaultValue = QString(),
278  bool pwd = false);
279 
280  // Global static methods collection end--------------------------------
281 
282 public:
283  explicit QUIWidget(QWidget *parent = 0);
284  ~QUIWidget();
285 
286  void createTrayMenu();
287 
288 protected:
289  // bool eventFilter(QObject *obj, QEvent *evt);
290 
291 private:
292  QVBoxLayout *verticalLayout1;
293  QWidget *widgetMain;
294  QVBoxLayout *verticalLayout2;
295  QWidget *widgetTitle;
296  QHBoxLayout *horizontalLayout4;
297  QLabel *labIco;
298  QLabel *labTitle;
299  QWidget *widgetMenu;
300  QHBoxLayout *horizontalLayout;
301  QToolButton *btnMenu;
302  QPushButton *btnMenu_Min;
303  QPushButton *btnMenu_Max;
304  QPushButton *btnMenu_Close;
305  QWidget *widget;
306  QVBoxLayout *verticalLayout3;
307 
308  QSystemTrayIcon *m_systemTray;
309  QMenu *trayMenu;
310  QAction *quitAction;
311  QAction *restoreWinAction;
312 
313 private:
314  bool max; // Whether in maximized state
315  QRect location; // Coordinate position after moving window with mouse
316 
317  QString title; // Title
318  Qt::Alignment alignment; // Title text alignment
319  bool minHide; // Minimize and hide
320  MainWindow *mainWidget; // Main window object
321 
322 public:
323  QLabel *getLabIco() const;
324  QLabel *getLabTitle() const;
325  QToolButton *getBtnMenu() const;
326  QPushButton *getBtnMenuMin() const;
327  QPushButton *getBtnMenuMax() const;
328  QPushButton *getBtnMenuMClose() const;
329 
330  Style getStyle() const;
331  QString getTitle() const;
332  Qt::Alignment getAlignment() const;
333 
334  QSize sizeHint() const;
335  QSize minimumSizeHint() const;
336 
337 private:
338  void closeEvent(QCloseEvent *event) override;
339  void showEvent(QShowEvent *event) override;
340  void moveEvent(QMoveEvent *event) override;
341  void resizeEvent(QResizeEvent *event) override;
342  bool eventFilter(QObject *obj, QEvent *event) override;
343  void keyPressEvent(QKeyEvent *event) override;
344 
345 private slots:
346  void initControl(); // Initialize controls
347  void initForm(); // Initialize form
348  void changeStyle(); // Change style
349 
350  void on_btnMenu_Min_clicked();
351  void on_btnMenu_Max_clicked();
352  void on_btnMenu_Close_clicked();
353 
354  // Restore application window
355  void showWindow() {
356  // this->widget->show();
357  this->setWindowState((this->windowState() & ~Qt::WindowMinimized) |
358  Qt::WindowActive);
359  };
360 
361  void activeTray(QSystemTrayIcon::ActivationReason reason);
362 
363 public slots:
365  void toggleFullScreen(bool state);
366 
367 public Q_SLOTS:
368  // Set widget icon
369  void setIcon(QUIWidget::Widget widget, QChar str, quint32 size = 9);
370  void setIconMain(QChar str, quint32 size = 9);
371  // Set widget image
372  void setPixmap(QUIWidget::Widget widget,
373  const QString &file,
374  const QSize &size = QSize(32, 32));
375  void setWindowLogo(const QString &icon);
376  // Set widget visibility
377  void setVisible(QUIWidget::Widget widget, bool visible = true);
378  // Set only close button
379  void setOnlyCloseBtn();
380 
381  // Set title bar height
382  void setTitleHeight(int height);
383  // Set unified button width
384  void setBtnWidth(int width);
385 
386  // Set title and text style
387  void setTitle(const QString &title);
388  void setAlignment(Qt::Alignment alignment);
389 
390  // Set minimize and hide
391  void setMinHide(bool minHide);
392 
393  // Set main window
394  void setMainWidget(MainWindow *mainWidget);
395 
396 Q_SIGNALS:
397  void changeStyle(const QString &qssFile);
398  void closing();
399 };
400 
401 // Message box class
402 class QUIMessageBox : public QDialog {
403  Q_OBJECT
404 
405 public:
406  explicit QUIMessageBox(QWidget *parent = 0);
407  ~QUIMessageBox();
408 
410  static QMutex mutex;
411 
412  if (!self) {
413  QMutexLocker locker(&mutex);
414 
415  if (!self) {
416  self = new QUIMessageBox;
417  }
418  }
419 
420  return self;
421  }
422 
423 protected:
424  void closeEvent(QCloseEvent *);
425  bool eventFilter(QObject *obj, QEvent *evt);
426 
427 private:
428  static QUIMessageBox *self;
429 
430  QVBoxLayout *verticalLayout1;
431  QWidget *widgetTitle;
432  QHBoxLayout *horizontalLayout3;
433  QLabel *labIco;
434  QLabel *labTitle;
435  QLabel *labTime;
436  QWidget *widgetMenu;
437  QHBoxLayout *horizontalLayout4;
438  QPushButton *btnMenu_Close;
439  QWidget *widgetMain;
440  QVBoxLayout *verticalLayout2;
441  QFrame *frame;
442  QVBoxLayout *verticalLayout4;
443  QHBoxLayout *horizontalLayout1;
444  QLabel *labIcoMain;
445  QSpacerItem *horizontalSpacer1;
446  QLabel *labInfo;
447  QHBoxLayout *horizontalLayout2;
448  QSpacerItem *horizontalSpacer2;
449  QPushButton *btnOk;
450  QPushButton *btnCancel;
451 
452 private:
453  int closeSec; // Total display time
454  int currentSec; // Current displayed time
455 
456 private slots:
457  void initControl(); // Initialize controls
458  void initForm(); // Initialize form
459  void checkSec(); // Check countdown
460 
461 private slots:
462  void on_btnOk_clicked();
463  void on_btnMenu_Close_clicked();
464 
465 public Q_SLOTS:
466  void setIconMain(QChar str, quint32 size = 9);
467  void setMessage(const QString &msg, int type, int closeSec = 0);
468 };
469 
470 // Input box class
471 class QUIInputBox : public QDialog {
472  Q_OBJECT
473 
474 public:
475  explicit QUIInputBox(QWidget *parent = 0);
476  ~QUIInputBox();
477 
478  static QUIInputBox *Instance() {
479  static QMutex mutex;
480 
481  if (!self) {
482  QMutexLocker locker(&mutex);
483 
484  if (!self) {
485  self = new QUIInputBox;
486  }
487  }
488 
489  return self;
490  }
491 
492 protected:
493  void closeEvent(QCloseEvent *);
494  bool eventFilter(QObject *obj, QEvent *evt);
495 
496 private:
497  static QUIInputBox *self;
498 
499  QVBoxLayout *verticalLayout1;
500  QWidget *widgetTitle;
501  QHBoxLayout *horizontalLayout1;
502  QLabel *labIco;
503  QLabel *labTitle;
504  QLabel *labTime;
505  QWidget *widgetMenu;
506  QHBoxLayout *horizontalLayout2;
507  QPushButton *btnMenu_Close;
508  QWidget *widgetMain;
509  QVBoxLayout *verticalLayout2;
510  QFrame *frame;
511  QVBoxLayout *verticalLayout3;
512  QLabel *labInfo;
513  QLineEdit *txtValue;
514  QComboBox *cboxValue;
515  QHBoxLayout *lay;
516  QSpacerItem *horizontalSpacer;
517  QPushButton *btnOk;
518  QPushButton *btnCancel;
519 
520 private:
521  int closeSec; // Total display time
522  int currentSec; // Current displayed time
523  QString value; // Current value
524 
525 private slots:
526  void initControl(); // Initialize controls
527  void initForm(); // Initialize form
528  void checkSec(); // Check countdown
529 
530 private slots:
531  void on_btnOk_clicked();
532  void on_btnMenu_Close_clicked();
533 
534 public:
535  QString getValue() const;
536 
537 public Q_SLOTS:
538  void setIconMain(QChar str, quint32 size = 9);
539  void setParameter(const QString &title,
540  int type = 0,
541  int closeSec = 0,
542  QString defaultValue = QString(),
543  bool pwd = false);
544 };
545 
546 // Icon font processing class
547 class IconHelper : public QObject {
548  Q_OBJECT
549 
550 public:
551  explicit IconHelper(QObject *parent = 0);
552  static IconHelper *Instance() {
553  static QMutex mutex;
554 
555  if (!self) {
556  QMutexLocker locker(&mutex);
557 
558  if (!self) {
559  self = new IconHelper;
560  }
561  }
562 
563  return self;
564  }
565 
566  void setIcon(QLabel *lab, QChar c, quint32 size = 9);
567  void setIcon(QAbstractButton *btn, QChar c, quint32 size = 9);
568  QPixmap getPixmap(const QString &color,
569  QChar c,
570  quint32 size = 9,
571  quint32 pixWidth = 10,
572  quint32 pixHeight = 10);
573 
574  // Get corresponding icon for button
575  QPixmap getPixmap(QToolButton *btn, bool normal);
576 
577  // Set navigation panel style without icons
578  static void setStyle(QWidget *widget,
579  const QString &type = "left",
580  int borderWidth = 3,
581  const QString &borderColor = "#029FEA",
582  const QString &normalBgColor = "#292F38",
583  const QString &darkBgColor = "#1D2025",
584  const QString &normalTextColor = "#54626F",
585  const QString &darkTextColor = "#FDFDFD");
586 
587  // Set navigation panel style with icons and effect switching
588  void setStyle(QWidget *widget,
589  QList<QToolButton *> btns,
590  QList<int> pixChar,
591  quint32 iconSize = 9,
592  quint32 iconWidth = 10,
593  quint32 iconHeight = 10,
594  const QString &type = "left",
595  int borderWidth = 3,
596  const QString &borderColor = "#029FEA",
597  const QString &normalBgColor = "#292F38",
598  const QString &darkBgColor = "#1D2025",
599  const QString &normalTextColor = "#54626F",
600  const QString &darkTextColor = "#FDFDFD");
601 
602  // Set navigation button style with icons and effect switching
603  void setStyle(QFrame *frame,
604  QList<QToolButton *> btns,
605  QList<int> pixChar,
606  quint32 iconSize = 9,
607  quint32 iconWidth = 10,
608  quint32 iconHeight = 10,
609  const QString &normalBgColor = "#2FC5A2",
610  const QString &darkBgColor = "#3EA7E9",
611  const QString &normalTextColor = "#EEEEEE",
612  const QString &darkTextColor = "#FFFFFF");
613 
614 protected:
615  bool eventFilter(QObject *watched, QEvent *event);
616 
617 private:
618  static IconHelper *self; // Object itself
619  QFont iconFont; // Icon font
620  QList<QToolButton *> btns; // Button queue
621  QList<QPixmap> pixNormal; // Normal image queue
622  QList<QPixmap> pixDark; // Darkened image queue
623 };
624 
625 // Global variable control
626 class QUIConfig {
627 public:
628  // Global icons
629  static QChar IconMain; // Top-left icon in title bar
630  static QChar IconMenu; // Dropdown menu icon
631  static QChar IconMin; // Minimize icon
632  static QChar IconMax; // Maximize icon
633  static QChar IconNormal; // Restore icon
634  static QChar IconClose; // Close icon
635 
636  static QString FontName; // Global font name
637  static int FontSize; // Global font size
638  static QString ConfigFile; // Config file path and name
639 
640  // Stylesheet color values
641  static QString TextColor; // Text color
642  static QString PanelColor; // Panel color
643  static QString BorderColor; // Border color
644  static QString NormalColorStart; // Normal state start color
645  static QString NormalColorEnd; // Normal state end color
646  static QString DarkColorStart; // Darkened state start color
647  static QString DarkColorEnd; // Darkened state end color
648  static QString HighColor; // Highlight color
649 
650  static void ReadConfig(); // Read config file, called at the beginning of
651  // main function when loading application
652  static void WriteConfig(); // Write config file, called when closing
653  // application after changing config
654  static void NewConfig(); // Create new config file with initial values
655  static bool CheckConfig(); // Validate config file
656 };
Rect frame
MouseEvent event
double normal[3]
int width
int size
int height
char type
math::float4 color
#define slots
IconHelper(QObject *parent=0)
void setIcon(QLabel *lab, QChar c, quint32 size=9)
static IconHelper * Instance()
Definition: ecvUIManager.h:552
bool eventFilter(QObject *watched, QEvent *event)
QPixmap getPixmap(const QString &color, QChar c, quint32 size=9, quint32 pixWidth=10, quint32 pixHeight=10)
static void setStyle(QWidget *widget, const QString &type="left", int borderWidth=3, const QString &borderColor="#029FEA", const QString &normalBgColor="#292F38", const QString &darkBgColor="#1D2025", const QString &normalTextColor="#54626F", const QString &darkTextColor="#FDFDFD")
static void WriteConfig()
static void ReadConfig()
static QChar IconClose
Definition: ecvUIManager.h:634
static QChar IconNormal
Definition: ecvUIManager.h:633
static QString BorderColor
Definition: ecvUIManager.h:643
static void NewConfig()
static QString FontName
Definition: ecvUIManager.h:636
static QString DarkColorEnd
Definition: ecvUIManager.h:647
static QString NormalColorStart
Definition: ecvUIManager.h:644
static QString HighColor
Definition: ecvUIManager.h:648
static QChar IconMin
Definition: ecvUIManager.h:631
static QChar IconMenu
Definition: ecvUIManager.h:630
static int FontSize
Definition: ecvUIManager.h:637
static QString TextColor
Definition: ecvUIManager.h:641
static QChar IconMain
Definition: ecvUIManager.h:629
static QString ConfigFile
Definition: ecvUIManager.h:638
static QString PanelColor
Definition: ecvUIManager.h:642
static QChar IconMax
Definition: ecvUIManager.h:632
static bool CheckConfig()
static QString NormalColorEnd
Definition: ecvUIManager.h:645
static QString DarkColorStart
Definition: ecvUIManager.h:646
void setParameter(const QString &title, int type=0, int closeSec=0, QString defaultValue=QString(), bool pwd=false)
bool eventFilter(QObject *obj, QEvent *evt)
void closeEvent(QCloseEvent *)
static QUIInputBox * Instance()
Definition: ecvUIManager.h:478
QUIInputBox(QWidget *parent=0)
void setIconMain(QChar str, quint32 size=9)
QString getValue() const
void setMessage(const QString &msg, int type, int closeSec=0)
static QUIMessageBox * Instance()
Definition: ecvUIManager.h:409
bool eventFilter(QObject *obj, QEvent *evt)
QUIMessageBox(QWidget *parent=0)
void setIconMain(QChar str, quint32 size=9)
void closeEvent(QCloseEvent *)
QPushButton * getBtnMenuMin() const
static QString decimalToStrBin1(int decimal)
static int deskWidth()
static void setFormInCenter(QWidget *frm)
void setMinHide(bool minHide)
static QString getNetIP(const QString &webCode)
static bool isTel(const QString &tel)
static QString getFolderName()
void setMainWidget(MainWindow *mainWidget)
static QString decimalToStrBin2(int decimal)
Style getStyle() const
static QByteArray hexStrToByteArray(const QString &str)
static QString appName()
static void runWithSystem(const QString &strName, const QString &strPath, bool autoRun=true)
static uchar getOrCode(const QByteArray &data)
static void setStyle(QUIWidget::Style style)
void setWindowLogo(const QString &icon)
static char convertHexChar(char ch)
void setPixmap(QUIWidget::Widget widget, const QString &file, const QSize &size=QSize(32, 32))
static QString byteArrayToAsciiStr(const QByteArray &data)
static QByteArray ushortToByte(ushort i)
static QString getFileName(const QString &filter, QString defaultDir=QCoreApplication::applicationDirPath())
QLabel * getLabIco() const
static void setCode()
static QString decimalToStrHex(int decimal)
static int strHexToDecimal(const QString &strHex)
static QString getLocalIP()
static QByteArray asciiStrToByteArray(const QString &str)
static void sleep(int sec)
void setOnlyCloseBtn()
static QByteArray intToByte(int i)
static bool copyFile(const QString &sourceFile, const QString &targetFile)
void toggleFullScreen(bool state)
toggles full screen
static uchar getCheckCode(const QByteArray &data)
void createTrayMenu()
static QString byteArrayToHexStr(const QByteArray &data)
static QString getXorEncryptDecrypt(const QString &str, char key)
static void showMessageBoxInfo(const QString &info, int closeSec=0)
static void getQssColor(const QString &qss, QString &textColor, QString &panelColor, QString &borderColor, QString &normalColorStart, QString &normalColorEnd, QString &darkColorStart, QString &darkColorEnd, QString &highColor)
static int byteToUShort(const QByteArray &data)
static QString strHexToStrBin(const QString &strHex)
static bool isEmail(const QString &email)
static bool isWebOk()
static bool fileIsExist(const QString &strFile)
void setVisible(QUIWidget::Widget widget, bool visible=true)
QString title
Definition: ecvUIManager.h:54
static QString appPath()
void setIcon(QUIWidget::Widget widget, QChar str, quint32 size=9)
static QString urlToIP(const QString &url)
static void setTranslator(const QString &qmFile=":/image/qt_zh_CN.qm")
QUIWidget(QWidget *parent=0)
void setIconMain(QChar str, quint32 size=9)
static void setSystemDateTime(const QString &year, const QString &month, const QString &day, const QString &hour, const QString &min, const QString &sec)
void changeStyle(const QString &qssFile)
static QString getHtml(const QString &url)
static void showMessageBoxError(const QString &info, int closeSec=0)
static int strBinToDecimal(const QString &strBin)
QString getTitle() const
QPushButton * getBtnMenuMax() const
static QString getFileNameWithExtension(const QString &strFilePath)
static bool ipLive(const QString &ip, int port, int timeout=1000)
static int byteToInt(const QByteArray &data)
static bool isIP(const QString &ip)
Qt::Alignment alignment
Definition: ecvUIManager.h:55
void setBtnWidth(int width)
static void deleteDirectory(const QString &path)
QPushButton * getBtnMenuMClose() const
static QString showInputBox(bool &ok, const QString &title, int type=0, int closeSec=0, QString defaultValue=QString(), bool pwd=false)
void setTitle(const QString &title)
void closing()
static bool isMac(const QString &mac)
QSize minimumSizeHint() const
QLabel * getLabTitle() const
Qt::Alignment getAlignment() const
static int showMessageBoxQuestion(const QString &info)
static int strDecimalToDecimal(const QString &strDecimal)
static bool folderIsExist(const QString &strFolder)
QToolButton * getBtnMenu() const
static int deskHeight()
QSize sizeHint() const
static void newDir(const QString &dirName)
static void writeInfo(const QString &info, const QString &filePath="log")
void setAlignment(Qt::Alignment alignment)
static QStringList getFileNames(const QString &filter, QString defaultDir=QCoreApplication::applicationDirPath())
static QStringList getFolderFileNames(const QStringList &filter)
void setTitleHeight(int height)
unsigned short ushort
Definition: cutil_math.h:29
int min(int a, int b)
Definition: cutil_math.h:53
int max(int a, int b)
Definition: cutil_math.h:48
static const std::string path
Definition: PointCloud.cpp:59
unsigned char uchar
Definition: matrix.h:41