From d0f134aa499d179a5b8556b9c92b262e5c5391c6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 15 Aug 2022 16:14:05 +0200 Subject: [PATCH] Help: inline .ui files bookmarkdialog.ui topicchooser.ui Change-Id: Ic5c36db648a56546ecf12ce2cb31a593732e7990 Reviewed-by: Eike Ziller Reviewed-by: --- src/plugins/help/generalsettingspage.cpp | 2 + src/plugins/help/help.qbs | 3 +- src/plugins/help/helpplugin.cpp | 3 + src/plugins/help/helpwidget.cpp | 2 + src/plugins/help/xbelsupport.cpp | 2 +- src/shared/help/CMakeLists.txt | 3 +- src/shared/help/bookmarkdialog.ui | 147 ---------------------- src/shared/help/bookmarkmanager.cpp | 150 +++++++++++++---------- src/shared/help/bookmarkmanager.h | 15 ++- src/shared/help/topicchooser.cpp | 63 ++++++---- src/shared/help/topicchooser.h | 13 +- src/shared/help/topicchooser.ui | 54 -------- 12 files changed, 156 insertions(+), 301 deletions(-) delete mode 100644 src/shared/help/bookmarkdialog.ui delete mode 100644 src/shared/help/topicchooser.ui diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp index c8f5c6687dc..212bff40647 100644 --- a/src/plugins/help/generalsettingspage.cpp +++ b/src/plugins/help/generalsettingspage.cpp @@ -49,7 +49,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/src/plugins/help/help.qbs b/src/plugins/help/help.qbs index 5c75128ffa7..0e01d583594 100644 --- a/src/plugins/help/help.qbs +++ b/src/plugins/help/help.qbs @@ -81,12 +81,11 @@ Project { name: "Shared Sources" prefix: project.sharedSourcesDir + "/help/" files: [ - "bookmarkdialog.ui", "bookmarkmanager.cpp", "bookmarkmanager.h", "contentwindow.cpp", "contentwindow.h", "helpicons.h", "indexwindow.cpp", "indexwindow.h", - "topicchooser.cpp", "topicchooser.h", "topicchooser.ui", + "topicchooser.cpp", "topicchooser.h", ] } } diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 1227da350b0..f44d480dbf1 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -74,9 +74,12 @@ #include #include +#include #include +#include #include #include +#include #include #include #include diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index d35a09111b5..6ee87bf8e79 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -53,8 +53,10 @@ #include #include +#include #include #include +#include #include #include #include diff --git a/src/plugins/help/xbelsupport.cpp b/src/plugins/help/xbelsupport.cpp index f9a4812b089..5a7bcd7892f 100644 --- a/src/plugins/help/xbelsupport.cpp +++ b/src/plugins/help/xbelsupport.cpp @@ -31,7 +31,7 @@ #include -#include +#include using namespace Help::Internal; diff --git a/src/shared/help/CMakeLists.txt b/src/shared/help/CMakeLists.txt index fb70a315e9b..d63f5bbb773 100644 --- a/src/shared/help/CMakeLists.txt +++ b/src/shared/help/CMakeLists.txt @@ -20,10 +20,9 @@ add_qtc_library(shared_help STATIC "${CMAKE_CURRENT_BINARY_DIR}/" "${CMAKE_CURRENT_LIST_DIR}" SOURCES - bookmarkdialog.ui bookmarkmanager.cpp bookmarkmanager.h contentwindow.cpp contentwindow.h helpicons.h indexwindow.cpp indexwindow.h - topicchooser.cpp topicchooser.h topicchooser.ui + topicchooser.cpp topicchooser.h ) diff --git a/src/shared/help/bookmarkdialog.ui b/src/shared/help/bookmarkdialog.ui deleted file mode 100644 index 18c9f985e57..00000000000 --- a/src/shared/help/bookmarkdialog.ui +++ /dev/null @@ -1,147 +0,0 @@ - - - BookmarkDialog - - - - 0 - 0 - 450 - 135 - - - - - 0 - 0 - - - - Add Bookmark - - - - - - - - - - Bookmark: - - - - - - - Add in folder: - - - - - - - - - - - - - - - - - - - - - - - - 25 - 20 - - - - + - - - - - - - Qt::Horizontal - - - - - - - - - - 0 - 0 - - - - - - - - - - New Folder - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - buttonBox - accepted() - BookmarkDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - BookmarkDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index 065143733a0..919fe0502f9 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -65,12 +66,8 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, , bookmarkManager(manager) { installEventFilter(this); - - ui.setupUi(this); - ui.bookmarkEdit->setText(title); - ui.newFolderButton->setVisible(false); - ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); + resize(450, 0); + setWindowTitle(tr("Add Bookmark")); proxyModel = new QSortFilterProxyModel(this); proxyModel->setFilterKeyColumn(0); @@ -78,30 +75,60 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, proxyModel->setFilterRole(Qt::UserRole + 10); proxyModel->setSourceModel(bookmarkManager->treeBookmarkModel()); proxyModel->setFilterRegularExpression(QRegularExpression(QLatin1String("Folder"))); - ui.treeView->setModel(proxyModel); - ui.treeView->expandAll(); - ui.treeView->setVisible(false); - ui.treeView->header()->setVisible(false); - ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); + m_bookmarkEdit = new QLineEdit(title); + m_bookmarkFolders = new QComboBox; + m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &BookmarkDialog::reject); - connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &BookmarkDialog::addAccepted); - connect(ui.newFolderButton, &QPushButton::clicked, this, &BookmarkDialog::addNewFolder); - connect(ui.toolButton, &QToolButton::clicked, this, &BookmarkDialog::toolButtonClicked); - connect(ui.bookmarkEdit, &QLineEdit::textChanged, this, &BookmarkDialog::textChanged); + m_toolButton = new QToolButton; + m_toolButton->setFixedSize(24, 24); + auto line = new QFrame; + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + line->setForegroundRole(QPalette::Midlight); + + m_treeView = new QTreeView; + m_treeView->setModel(proxyModel); + m_treeView->expandAll(); + m_treeView->header()->setVisible(false); + m_treeView->setContextMenuPolicy(Qt::CustomContextMenu); + QSizePolicy treeViewSP(QSizePolicy::Preferred, QSizePolicy::Ignored); + treeViewSP.setVerticalStretch(1); + m_treeView->setSizePolicy(treeViewSP); + + m_newFolderButton = new QPushButton(tr("New Folder")); + m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + using namespace Utils::Layouting; + Column { + Form { + tr("Bookmark:"), m_bookmarkEdit, br, + tr("Add in folder:"), m_bookmarkFolders, br, + }, + Row { m_toolButton, line, }, + m_treeView, + Row { m_newFolderButton, m_buttonBox, } + }.attachTo(this); + + toggleExpanded(); + + connect(m_buttonBox, &QDialogButtonBox::rejected, this, &BookmarkDialog::reject); + connect(m_buttonBox, &QDialogButtonBox::accepted, this, &BookmarkDialog::addAccepted); + connect(m_newFolderButton, &QPushButton::clicked, this, &BookmarkDialog::addNewFolder); + connect(m_toolButton, &QToolButton::clicked, this, &BookmarkDialog::toggleExpanded); + connect(m_bookmarkEdit, &QLineEdit::textChanged, this, &BookmarkDialog::textChanged); connect(bookmarkManager->treeBookmarkModel(), &QStandardItemModel::itemChanged, this, &BookmarkDialog::itemChanged); - connect(ui.bookmarkFolders, &QComboBox::currentIndexChanged, + connect(m_bookmarkFolders, &QComboBox::currentIndexChanged, this, &BookmarkDialog::selectBookmarkFolder); - connect(ui.treeView, &TreeView::customContextMenuRequested, + connect(m_treeView, &TreeView::customContextMenuRequested, this, &BookmarkDialog::showContextMenu); - connect(ui.treeView->selectionModel(), &QItemSelectionModel::currentChanged, + connect(m_treeView->selectionModel(), &QItemSelectionModel::currentChanged, this, &BookmarkDialog::currentChanged); } @@ -111,20 +138,20 @@ BookmarkDialog::~BookmarkDialog() void BookmarkDialog::addAccepted() { - QItemSelectionModel *model = ui.treeView->selectionModel(); + QItemSelectionModel *model = m_treeView->selectionModel(); const QModelIndexList &list = model->selection().indexes(); QModelIndex index; if (!list.isEmpty()) index = proxyModel->mapToSource(list.at(0)); - bookmarkManager->addNewBookmark(index, ui.bookmarkEdit->text(), m_url); + bookmarkManager->addNewBookmark(index, m_bookmarkEdit->text(), m_url); accept(); } void BookmarkDialog::addNewFolder() { - QItemSelectionModel *model = ui.treeView->selectionModel(); + QItemSelectionModel *model = m_treeView->selectionModel(); const QModelIndexList &list = model->selection().indexes(); QModelIndex index; @@ -134,32 +161,29 @@ void BookmarkDialog::addNewFolder() QModelIndex newFolder = bookmarkManager->addNewFolder(proxyModel->mapToSource(index)); if (newFolder.isValid()) { - ui.treeView->expand(index); + m_treeView->expand(index); const QModelIndex &index = proxyModel->mapFromSource(newFolder); model->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); + m_bookmarkFolders->clear(); + m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); const QString &name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); + m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(name)); } - ui.treeView->setFocus(); + m_treeView->setFocus(); } -void BookmarkDialog::toolButtonClicked() +void BookmarkDialog::toggleExpanded() { - bool visible = !ui.treeView->isVisible(); - ui.treeView->setVisible(visible); - ui.newFolderButton->setVisible(visible); - - if (visible) { - resize(QSize(width(), 400)); - ui.toolButton->setText(QLatin1String("-")); - } else { - resize(width(), minimumHeight()); - ui.toolButton->setText(QLatin1String("+")); - } + const char expand[] = "+"; + const char collapse[] = "-"; + const bool doCollapse = m_toolButton->text() != expand; + m_toolButton->setText(doCollapse ? expand : collapse); + m_treeView->setVisible(!doCollapse); + m_newFolderButton->setVisible(!doCollapse); + for (int i = 0; i <= 1; ++i) // Hack: resize twice to avoid "jumping" of m_toolButton + resize(width(), (doCollapse ? 1 : 400)); } void BookmarkDialog::itemChanged(QStandardItem *item) @@ -171,27 +195,27 @@ void BookmarkDialog::itemChanged(QStandardItem *item) } if (item->text() != oldText) { - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); + m_bookmarkFolders->clear(); + m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); QString name = tr("Bookmarks"); - const QModelIndex& index = ui.treeView->currentIndex(); + const QModelIndex& index = m_treeView->currentIndex(); if (index.isValid()) name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); + m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(name)); } } void BookmarkDialog::textChanged(const QString& string) { - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty()); + m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty()); } void BookmarkDialog::selectBookmarkFolder(int index) { - const QString folderName = ui.bookmarkFolders->itemText(index); + const QString folderName = m_bookmarkFolders->itemText(index); if (folderName == tr("Bookmarks")) { - ui.treeView->clearSelection(); + m_treeView->clearSelection(); return; } @@ -200,7 +224,7 @@ void BookmarkDialog::selectBookmarkFolder(int index) Qt::MatchCaseSensitive | Qt::MatchRecursive, 0); if (!list.isEmpty()) { const QModelIndex &index = model->indexFromItem(list.at(0)); - QItemSelectionModel *model = ui.treeView->selectionModel(); + QItemSelectionModel *model = m_treeView->selectionModel(); if (model) { model->setCurrentIndex(proxyModel->mapFromSource(index), QItemSelectionModel::ClearAndSelect); @@ -210,7 +234,7 @@ void BookmarkDialog::selectBookmarkFolder(int index) void BookmarkDialog::showContextMenu(const QPoint &point) { - QModelIndex index = ui.treeView->indexAt(point); + QModelIndex index = m_treeView->indexAt(point); if (!index.isValid()) return; @@ -219,26 +243,26 @@ void BookmarkDialog::showContextMenu(const QPoint &point) QAction *removeItem = menu.addAction(tr("Delete Folder")); QAction *renameItem = menu.addAction(tr("Rename Folder")); - QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); + QAction *picked = menu.exec(m_treeView->mapToGlobal(point)); if (!picked) return; const QModelIndex &proxyIndex = proxyModel->mapToSource(index); if (picked == removeItem) { - bookmarkManager->removeBookmarkItem(ui.treeView, proxyIndex); - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); + bookmarkManager->removeBookmarkItem(m_treeView, proxyIndex); + m_bookmarkFolders->clear(); + m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); QString name = tr("Bookmarks"); - index = ui.treeView->currentIndex(); + index = m_treeView->currentIndex(); if (index.isValid()) name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); + m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(name)); } else if (picked == renameItem) { BookmarkModel *model = bookmarkManager->treeBookmarkModel(); if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { item->setEditable(true); - ui.treeView->edit(index); + m_treeView->edit(index); item->setEditable(false); } } @@ -249,7 +273,7 @@ void BookmarkDialog::currentChanged(const QModelIndex ¤t) QString text = tr("Bookmarks"); if (current.isValid()) text = current.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(text)); + m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(text)); } bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) @@ -257,7 +281,7 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) if (object == this && e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast(e); - QModelIndex index = ui.treeView->currentIndex(); + QModelIndex index = m_treeView->currentIndex(); switch (ke->key()) { case Qt::Key_F2: { const QModelIndex &source = proxyModel->mapToSource(index); @@ -265,23 +289,23 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) bookmarkManager->treeBookmarkModel()->itemFromIndex(source); if (item) { item->setEditable(true); - ui.treeView->edit(index); + m_treeView->edit(index); item->setEditable(false); } } break; case Qt::Key_Backspace: case Qt::Key_Delete: { - bookmarkManager->removeBookmarkItem(ui.treeView, + bookmarkManager->removeBookmarkItem(m_treeView, proxyModel->mapToSource(index)); - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); + m_bookmarkFolders->clear(); + m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); QString name = tr("Bookmarks"); - index = ui.treeView->currentIndex(); + index = m_treeView->currentIndex(); if (index.isValid()) name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); + m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(name)); } break; default: diff --git a/src/shared/help/bookmarkmanager.h b/src/shared/help/bookmarkmanager.h index 652e22727e1..19db77b4ef4 100644 --- a/src/shared/help/bookmarkmanager.h +++ b/src/shared/help/bookmarkmanager.h @@ -25,8 +25,6 @@ #pragma once -#include "ui_bookmarkdialog.h" - #include #include @@ -42,8 +40,11 @@ #include QT_BEGIN_NAMESPACE +class QComboBox; +class QDialogButtonBox; class QEvent; class QLineEdit; +class QPushButton; class QTreeView; class QToolButton; class QStandardItem; @@ -67,7 +68,7 @@ public: private: void addAccepted(); void addNewFolder(); - void toolButtonClicked(); + void toggleExpanded(); void itemChanged(QStandardItem *item); void textChanged(const QString& string); void selectBookmarkFolder(int index); @@ -81,9 +82,15 @@ private: QString oldText; QStandardItem *renameItem; - Ui::BookmarkDialog ui; BookmarkManager *bookmarkManager; QSortFilterProxyModel *proxyModel; + + QLineEdit *m_bookmarkEdit; + QDialogButtonBox *m_buttonBox; + QComboBox *m_bookmarkFolders; + QPushButton *m_newFolderButton; + QTreeView *m_treeView; + QToolButton *m_toolButton; }; class TreeView : public Utils::NavigationTreeView diff --git a/src/shared/help/topicchooser.cpp b/src/shared/help/topicchooser.cpp index 44852da95bb..56cafe31d5f 100644 --- a/src/shared/help/topicchooser.cpp +++ b/src/shared/help/topicchooser.cpp @@ -25,10 +25,15 @@ #include "topicchooser.h" +#include +#include + #include #include #include +#include +#include #include #include @@ -37,13 +42,8 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, : QDialog(parent) , m_filterModel(new QSortFilterProxyModel(this)) { - ui.setupUi(this); - - setFocusProxy(ui.lineEdit); - ui.lineEdit->setFiltering(true); - ui.lineEdit->installEventFilter(this); - ui.lineEdit->setPlaceholderText(tr("Filter")); - ui.label->setText(tr("Choose a topic for %1:").arg(keyword)); + resize(400, 220); + setWindowTitle(tr("Choose Topic")); QStandardItemModel *model = new QStandardItemModel(this); m_filterModel->setSourceModel(model); @@ -57,20 +57,35 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, model->appendRow(item); } - ui.listWidget->setModel(m_filterModel); - ui.listWidget->setUniformItemSizes(true); - ui.listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_lineEdit = new Utils::FancyLineEdit; + m_lineEdit->setFiltering(true); + m_lineEdit->installEventFilter(this); + setFocusProxy(m_lineEdit); + m_listWidget = new QListView; + m_listWidget->setModel(m_filterModel); + m_listWidget->setUniformItemSizes(true); + m_listWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); if (m_filterModel->rowCount() != 0) - ui.listWidget->setCurrentIndex(m_filterModel->index(0, 0)); + m_listWidget->setCurrentIndex(m_filterModel->index(0, 0)); - connect(ui.buttonBox, &QDialogButtonBox::accepted, + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + using namespace Utils::Layouting; + Column { + tr("Choose a topic for %1:").arg(keyword), + m_lineEdit, + m_listWidget, + buttonBox, + }.attachTo(this); + + connect(buttonBox, &QDialogButtonBox::accepted, this, &TopicChooser::acceptDialog); - connect(ui.buttonBox, &QDialogButtonBox::rejected, + connect(buttonBox, &QDialogButtonBox::rejected, this, &TopicChooser::reject); - connect(ui.listWidget, &QListView::activated, + connect(m_listWidget, &QListView::activated, this, &TopicChooser::activated); - connect(ui.lineEdit, &Utils::FancyLineEdit::filterChanged, + connect(m_lineEdit, &Utils::FancyLineEdit::filterChanged, this, &TopicChooser::setFilter); } @@ -83,15 +98,15 @@ QUrl TopicChooser::link() const void TopicChooser::acceptDialog() { - m_activedIndex = ui.listWidget->currentIndex(); + m_activedIndex = m_listWidget->currentIndex(); accept(); } void TopicChooser::setFilter(const QString &pattern) { m_filterModel->setFilterFixedString(pattern); - if (m_filterModel->rowCount() != 0 && !ui.listWidget->currentIndex().isValid()) - ui.listWidget->setCurrentIndex(m_filterModel->index(0, 0)); + if (m_filterModel->rowCount() != 0 && !m_listWidget->currentIndex().isValid()) + m_listWidget->setCurrentIndex(m_filterModel->index(0, 0)); } void TopicChooser::activated(const QModelIndex &index) @@ -102,7 +117,7 @@ void TopicChooser::activated(const QModelIndex &index) bool TopicChooser::eventFilter(QObject *object, QEvent *event) { - if (object == ui.lineEdit && event->type() == QEvent::KeyPress) { + if (object == m_lineEdit && event->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast(event); int dIndex = 0; switch (ke->key()) { @@ -122,18 +137,18 @@ bool TopicChooser::eventFilter(QObject *object, QEvent *event) break; } if (dIndex != 0) { - QModelIndex idx = ui.listWidget->currentIndex(); + QModelIndex idx = m_listWidget->currentIndex(); int newIndex = qMin(m_filterModel->rowCount(idx.parent()) - 1, qMax(0, idx.row() + dIndex)); idx = m_filterModel->index(newIndex, idx.column(), idx.parent()); if (idx.isValid()) - ui.listWidget->setCurrentIndex(idx); + m_listWidget->setCurrentIndex(idx); return true; } - } else if (ui.lineEdit && event->type() == QEvent::FocusIn + } else if (m_lineEdit && event->type() == QEvent::FocusIn && static_cast(event)->reason() != Qt::MouseFocusReason) { - ui.lineEdit->selectAll(); - ui.lineEdit->setFocus(); + m_lineEdit->selectAll(); + m_lineEdit->setFocus(); } return QDialog::eventFilter(object, event); } diff --git a/src/shared/help/topicchooser.h b/src/shared/help/topicchooser.h index 7d47b13712b..7cf4bcee62f 100644 --- a/src/shared/help/topicchooser.h +++ b/src/shared/help/topicchooser.h @@ -25,8 +25,6 @@ #pragma once -#include "ui_topicchooser.h" - #include #include #include @@ -34,7 +32,12 @@ #include -QT_FORWARD_DECLARE_CLASS(QSortFilterProxyModel) +QT_BEGIN_NAMESPACE +class QListView; +class QSortFilterProxyModel; +QT_END_NAMESPACE + +namespace Utils { class FancyLineEdit; } class TopicChooser : public QDialog { @@ -52,9 +55,11 @@ private: void activated(const QModelIndex &index); bool eventFilter(QObject *object, QEvent *event) override; - Ui::TopicChooser ui; QList m_links; QModelIndex m_activedIndex; QSortFilterProxyModel *m_filterModel; + + Utils::FancyLineEdit *m_lineEdit; + QListView *m_listWidget; }; diff --git a/src/shared/help/topicchooser.ui b/src/shared/help/topicchooser.ui deleted file mode 100644 index b288f8334c3..00000000000 --- a/src/shared/help/topicchooser.ui +++ /dev/null @@ -1,54 +0,0 @@ - - - TopicChooser - - - - 0 - 0 - 393 - 218 - - - - Choose Topic - - - true - - - - - - &Topics - - - listWidget - - - - - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - Utils::FancyLineEdit - QLineEdit -
utils/fancylineedit.h
-
-
- - -