forked from qt-creator/qt-creator
Squish: De-Q_OBJECT-ify SquishNavigationWidgetFactory
Change-Id: I9c86ce75855a45f32f3752016acb1c8cc8c2d8ee Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -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
|
|
||||||
|
@@ -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
|
|
||||||
|
Reference in New Issue
Block a user