9 #ifndef UI_PQICONBROWSER_H 10 #define UI_PQICONBROWSER_H 12 #include <QtCore/QVariant> 13 #include <QtGui/QIcon> 14 #include <QtWidgets/QApplication> 15 #include <QtWidgets/QComboBox> 16 #include <QtWidgets/QDialog> 17 #include <QtWidgets/QDialogButtonBox> 18 #include <QtWidgets/QGridLayout> 19 #include <QtWidgets/QHBoxLayout> 20 #include <QtWidgets/QListView> 21 #include <QtWidgets/QSpacerItem> 22 #include <QtWidgets/QToolButton> 23 #include <QtWidgets/QVBoxLayout> 45 if (pqIconBrowser->objectName().isEmpty())
46 pqIconBrowser->setObjectName(QString::fromUtf8(
"pqIconBrowser"));
47 pqIconBrowser->resize(786, 485);
48 gridLayout =
new QGridLayout(pqIconBrowser);
49 gridLayout->setObjectName(QString::fromUtf8(
"gridLayout"));
50 buttonsLayout =
new QHBoxLayout();
51 buttonsLayout->setObjectName(QString::fromUtf8(
"buttonsLayout"));
53 searchBox->setObjectName(QString::fromUtf8(
"searchBox"));
54 searchBox->setProperty(
"settingKey", QVariant(QString::fromUtf8(
"showAdvancedProperties")));
55 searchBox->setProperty(
"advancedSearchEnabled", QVariant(
false));
57 buttonsLayout->addWidget(searchBox);
59 filterBox =
new QComboBox(pqIconBrowser);
60 filterBox->setObjectName(QString::fromUtf8(
"filterBox"));
62 buttonsLayout->addWidget(filterBox);
65 gridLayout->addLayout(buttonsLayout, 4, 0, 1, 1);
67 buttonBox =
new QDialogButtonBox(pqIconBrowser);
68 buttonBox->setObjectName(QString::fromUtf8(
"buttonBox"));
69 buttonBox->setOrientation(Qt::Horizontal);
70 buttonBox->setStandardButtons(QDialogButtonBox::Close|QDialogButtonBox::Ok);
72 gridLayout->addWidget(buttonBox, 6, 0, 1, 4);
74 listView =
new QListView(pqIconBrowser);
75 listView->setObjectName(QString::fromUtf8(
"listView"));
76 listView->setIconSize(QSize(30, 30));
77 listView->setMovement(QListView::Static);
78 listView->setResizeMode(QListView::Adjust);
79 listView->setGridSize(QSize(150, 80));
80 listView->setViewMode(QListView::IconMode);
81 listView->setWordWrap(
true);
82 listView->setTextElideMode(Qt::ElideLeft);
83 listView->setItemAlignment(Qt::AlignBottom|Qt::AlignHCenter);
84 listView->setSelectionRectVisible(
true);
86 gridLayout->addWidget(listView, 5, 0, 1, 1);
88 verticalLayout =
new QVBoxLayout();
89 verticalLayout->setObjectName(QString::fromUtf8(
"verticalLayout"));
90 importIcon =
new QToolButton(pqIconBrowser);
91 importIcon->setObjectName(QString::fromUtf8(
"importIcon"));
93 icon.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqOpen.svg"), QSize(), QIcon::Normal, QIcon::Off);
94 importIcon->setIcon(icon);
96 verticalLayout->addWidget(importIcon);
98 remove =
new QToolButton(pqIconBrowser);
99 remove->setObjectName(QString::fromUtf8(
"remove"));
101 icon1.addFile(QString::fromUtf8(
":/QtWidgets/Icons/pqMinus.svg"), QSize(), QIcon::Normal, QIcon::Off);
102 remove->setIcon(icon1);
104 verticalLayout->addWidget(
remove);
106 verticalSpacer =
new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
108 verticalLayout->addItem(verticalSpacer);
110 removeAll =
new QToolButton(pqIconBrowser);
111 removeAll->setObjectName(QString::fromUtf8(
"removeAll"));
113 icon2.addFile(QString::fromUtf8(
":/QtWidgets/Icons/pqDelete.svg"), QSize(), QIcon::Normal, QIcon::Off);
114 removeAll->setIcon(icon2);
116 verticalLayout->addWidget(removeAll);
119 gridLayout->addLayout(verticalLayout, 5, 3, 1, 1);
123 QObject::connect(buttonBox, SIGNAL(accepted()), pqIconBrowser, SLOT(accept()));
124 QObject::connect(buttonBox, SIGNAL(rejected()), pqIconBrowser, SLOT(reject()));
126 QMetaObject::connectSlotsByName(pqIconBrowser);
131 pqIconBrowser->setWindowTitle(QCoreApplication::translate(
"pqIconBrowser",
"Browse icons",
nullptr));
132 #if QT_CONFIG(tooltip) 133 importIcon->setToolTip(QCoreApplication::translate(
"pqIconBrowser",
"Import new icon",
nullptr));
134 #endif // QT_CONFIG(tooltip) 135 importIcon->setText(QCoreApplication::translate(
"pqIconBrowser",
"...",
nullptr));
136 #if QT_CONFIG(tooltip) 137 remove->setToolTip(QCoreApplication::translate(
"pqIconBrowser",
"Remove custom icon",
nullptr));
138 #endif // QT_CONFIG(tooltip) 139 remove->setText(QCoreApplication::translate(
"pqIconBrowser",
"...",
nullptr));
140 #if QT_CONFIG(tooltip) 141 removeAll->setToolTip(QCoreApplication::translate(
"pqIconBrowser",
"Remove all custom icons",
nullptr));
142 #endif // QT_CONFIG(tooltip) 143 removeAll->setText(QCoreApplication::translate(
"pqIconBrowser",
"...",
nullptr));
154 #endif // UI_PQICONBROWSER_H void retranslateUi(QDialog *pqIconBrowser)
QSpacerItem * verticalSpacer
void setupUi(QDialog *pqIconBrowser)
pqSearchBox is a line edit and an advanced tool button in the same layout.
QDialogButtonBox * buttonBox
pqIconBrowser is a dialog to browse available icons.
QVBoxLayout * verticalLayout
QHBoxLayout * buttonsLayout