9 #ifndef UI_RECENTDOCK_H 10 #define UI_RECENTDOCK_H 12 #include <QtCore/QVariant> 13 #include <QtGui/QIcon> 14 #include <QtWidgets/QAction> 15 #include <QtWidgets/QApplication> 16 #include <QtWidgets/QDockWidget> 17 #include <QtWidgets/QListView> 18 #include <QtWidgets/QVBoxLayout> 19 #include <QtWidgets/QWidget> 20 #include "widgets/lineeditclear.h" 27 QAction *actionDelete;
28 QWidget *dockWidgetContents;
29 QVBoxLayout *verticalLayout;
30 LineEditClear *lineEdit;
31 QListView *listWidget;
33 void setupUi(QDockWidget *RecentDock)
35 if (RecentDock->objectName().isEmpty())
36 RecentDock->setObjectName(QString::fromUtf8(
"RecentDock"));
37 RecentDock->resize(396, 296);
38 RecentDock->setMinimumSize(QSize(150, 114));
40 QString iconThemeName = QString::fromUtf8(
"document-open-recent");
41 if (QIcon::hasThemeIcon(iconThemeName)) {
42 icon = QIcon::fromTheme(iconThemeName);
44 icon.addFile(QString::fromUtf8(
":/icons/oxygen/32x32/actions/document-open-recent.png"), QSize(), QIcon::Normal, QIcon::Off);
46 RecentDock->setWindowIcon(icon);
47 actionDelete =
new QAction(RecentDock);
48 actionDelete->setObjectName(QString::fromUtf8(
"actionDelete"));
49 dockWidgetContents =
new QWidget();
50 dockWidgetContents->setObjectName(QString::fromUtf8(
"dockWidgetContents"));
51 verticalLayout =
new QVBoxLayout(dockWidgetContents);
52 verticalLayout->setSpacing(0);
53 verticalLayout->setObjectName(QString::fromUtf8(
"verticalLayout"));
54 verticalLayout->setContentsMargins(0, 0, 0, 0);
55 lineEdit =
new LineEditClear(dockWidgetContents);
56 lineEdit->setObjectName(QString::fromUtf8(
"lineEdit"));
58 verticalLayout->addWidget(lineEdit);
60 listWidget =
new QListView(dockWidgetContents);
61 listWidget->setObjectName(QString::fromUtf8(
"listWidget"));
62 listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
63 listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
64 listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
65 listWidget->setAlternatingRowColors(
true);
66 listWidget->setSpacing(2);
68 verticalLayout->addWidget(listWidget);
70 RecentDock->setWidget(dockWidgetContents);
72 retranslateUi(RecentDock);
74 QMetaObject::connectSlotsByName(RecentDock);
77 void retranslateUi(QDockWidget *RecentDock)
79 RecentDock->setWindowTitle(QCoreApplication::translate(
"RecentDock",
"Recent",
nullptr));
80 actionDelete->setText(QCoreApplication::translate(
"RecentDock",
"Remove",
nullptr));
81 #if QT_CONFIG(tooltip) 82 actionDelete->setToolTip(QCoreApplication::translate(
"RecentDock",
"Remove",
nullptr));
83 #endif // QT_CONFIG(tooltip) 84 #if QT_CONFIG(tooltip) 85 lineEdit->setToolTip(QCoreApplication::translate(
"RecentDock",
"Show only files with name matching text",
nullptr));
86 #endif // QT_CONFIG(tooltip) 87 lineEdit->setPlaceholderText(QCoreApplication::translate(
"RecentDock",
"search",
nullptr));
93 class RecentDock:
public Ui_RecentDock {};
98 #endif // UI_RECENTDOCK_H