Squish: De-Q_OBJECT-ify SquishNavigationWidgetFactory

Change-Id: I9c86ce75855a45f32f3752016acb1c8cc8c2d8ee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-09-01 16:59:29 +02:00
parent 16c12f71ff
commit 2480189c5b
2 changed files with 29 additions and 44 deletions

View File

@@ -24,11 +24,35 @@
#include <QMenu> #include <QMenu>
#include <QVBoxLayout> #include <QVBoxLayout>
namespace Squish { namespace Squish::Internal {
namespace Internal {
const int defaultSectionSize = 17; const int defaultSectionSize = 17;
class SquishNavigationWidget : public QWidget
{
public:
explicit SquishNavigationWidget(QWidget *parent = nullptr);
~SquishNavigationWidget() override;
void contextMenuEvent(QContextMenuEvent *event) override;
static QList<QToolButton *> createToolButtons();
private:
void onItemActivated(const QModelIndex &idx);
void onExpanded(const QModelIndex &idx);
void onCollapsed(const QModelIndex &idx);
void onRowsInserted(const QModelIndex &parent, int, int);
void onRowsRemoved(const QModelIndex &parent, int, int);
void onRemoveSharedFolderTriggered(int row, const QModelIndex &parent);
void onRemoveAllSharedFolderTriggered();
void onRecordTestCase(const QString &suiteName, const QString &testCase);
void onNewTestCaseTriggered(const QModelIndex &index);
SquishTestTreeView *m_view;
SquishTestTreeModel *m_model; // not owned
SquishTestTreeSortModel *m_sortModel;
};
SquishNavigationWidget::SquishNavigationWidget(QWidget *parent) SquishNavigationWidget::SquishNavigationWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
@@ -346,5 +370,4 @@ Core::NavigationView SquishNavigationWidgetFactory::createWidget()
return view; return view;
} }
} // namespace Internal } // Squish::Internal
} // namespace Squish

View File

@@ -5,47 +5,10 @@
#include <coreplugin/inavigationwidgetfactory.h> #include <coreplugin/inavigationwidgetfactory.h>
#include <utils/navigationtreeview.h> namespace Squish::Internal {
QT_BEGIN_NAMESPACE
class QToolButton;
QT_END_NAMESPACE
namespace Squish {
namespace Internal {
class SquishTestTreeModel;
class SquishTestTreeSortModel;
class SquishTestTreeView;
class SquishNavigationWidget : public QWidget
{
Q_OBJECT
public:
explicit SquishNavigationWidget(QWidget *parent = nullptr);
~SquishNavigationWidget() override;
void contextMenuEvent(QContextMenuEvent *event) override;
static QList<QToolButton *> createToolButtons();
private:
void onItemActivated(const QModelIndex &idx);
void onExpanded(const QModelIndex &idx);
void onCollapsed(const QModelIndex &idx);
void onRowsInserted(const QModelIndex &parent, int, int);
void onRowsRemoved(const QModelIndex &parent, int, int);
void onRemoveSharedFolderTriggered(int row, const QModelIndex &parent);
void onRemoveAllSharedFolderTriggered();
void onRecordTestCase(const QString &suiteName, const QString &testCase);
void onNewTestCaseTriggered(const QModelIndex &index);
SquishTestTreeView *m_view;
SquishTestTreeModel *m_model; // not owned
SquishTestTreeSortModel *m_sortModel;
};
class SquishNavigationWidgetFactory : public Core::INavigationWidgetFactory class SquishNavigationWidgetFactory : public Core::INavigationWidgetFactory
{ {
Q_OBJECT
public: public:
SquishNavigationWidgetFactory(); SquishNavigationWidgetFactory();
@@ -53,5 +16,4 @@ private:
Core::NavigationView createWidget() override; Core::NavigationView createWidget() override;
}; };
} // namespace Internal } // Squish::Internal
} // namespace Squish