Fix a few clazy warnings
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
// clazy:excludeall=missing-qobject-macro
|
||||
|
||||
class MyTitleBar : public KDDockWidgets::TitleBarWidget
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -135,26 +135,26 @@ void MyMainWindow::createDockWidgets()
|
||||
|
||||
|
||||
// MainWindow::addDockWidget() attaches a dock widget to the main window:
|
||||
addDockWidget(m_dockwidgets[0], KDDockWidgets::Location_OnTop);
|
||||
addDockWidget(m_dockwidgets.at(0), KDDockWidgets::Location_OnTop);
|
||||
|
||||
// Here, for finer granularity we specify right of dockwidgets[0]:
|
||||
addDockWidget(m_dockwidgets[1], KDDockWidgets::Location_OnRight, m_dockwidgets[0]);
|
||||
addDockWidget(m_dockwidgets.at(1), KDDockWidgets::Location_OnRight, m_dockwidgets.at(0));
|
||||
|
||||
addDockWidget(m_dockwidgets[2], KDDockWidgets::Location_OnLeft);
|
||||
addDockWidget(m_dockwidgets[3], KDDockWidgets::Location_OnBottom);
|
||||
addDockWidget(m_dockwidgets[4], KDDockWidgets::Location_OnBottom);
|
||||
addDockWidget(m_dockwidgets.at(2), KDDockWidgets::Location_OnLeft);
|
||||
addDockWidget(m_dockwidgets.at(3), KDDockWidgets::Location_OnBottom);
|
||||
addDockWidget(m_dockwidgets.at(4), KDDockWidgets::Location_OnBottom);
|
||||
|
||||
// Tab two dock widgets together
|
||||
m_dockwidgets[3]->addDockWidgetAsTab(m_dockwidgets[5]);
|
||||
m_dockwidgets[3]->addDockWidgetAsTab(m_dockwidgets.at(5));
|
||||
|
||||
// 6 is floating, as it wasn't added to the main window via MainWindow::addDockWidget().
|
||||
// and we tab 7 with it.
|
||||
m_dockwidgets[6]->addDockWidgetAsTab(m_dockwidgets[7]);
|
||||
m_dockwidgets[6]->addDockWidgetAsTab(m_dockwidgets.at(7));
|
||||
|
||||
// Floating windows also support nesting, here we add 8 to the bottom of the group
|
||||
m_dockwidgets[6]->addDockWidgetToContainingWindow(m_dockwidgets[8], KDDockWidgets::Location_OnBottom);
|
||||
m_dockwidgets[6]->addDockWidgetToContainingWindow(m_dockwidgets.at(8), KDDockWidgets::Location_OnBottom);
|
||||
|
||||
auto floatingWindow = m_dockwidgets[6]->window();
|
||||
auto floatingWindow = m_dockwidgets.at(6)->window();
|
||||
floatingWindow->move(100, 100);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ protected:
|
||||
|
||||
class MyWidget1 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget1(QWidget *parent = nullptr);
|
||||
protected:
|
||||
@@ -42,6 +43,7 @@ protected:
|
||||
|
||||
class MyWidget2 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget2(QWidget *parent = nullptr);
|
||||
protected:
|
||||
@@ -50,6 +52,7 @@ protected:
|
||||
|
||||
class MyWidget3 : public MyWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MyWidget3(QWidget *parent = nullptr);
|
||||
protected:
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
#include <QVector>
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
# include "multisplitter/Separator_quick.h"
|
||||
#endif
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
DropIndicatorType DefaultWidgetFactory::s_dropIndicatorType = DropIndicatorType::Classic;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "KDDockWidgets.h"
|
||||
#include "QWidgetAdapter.h"
|
||||
|
||||
// clazy:excludeall=ctor-missing-parent-argument
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief A factory class for allowing the user to customize some internal widgets.
|
||||
@@ -157,6 +159,7 @@ private:
|
||||
*/
|
||||
class DOCKS_EXPORT DefaultWidgetFactory : public FrameworkWidgetFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DefaultWidgetFactory() = default;
|
||||
Frame *createFrame(QWidgetOrQuick *parent, FrameOptions) const override;
|
||||
|
||||
@@ -272,7 +272,9 @@ public:
|
||||
s_currentLayoutBeingRestored = this;
|
||||
|
||||
const QList<QScreen*> screens = qApp->screens();
|
||||
for (int i = 0; i < screens.size(); ++i) {
|
||||
const int numScreens = screens.size();
|
||||
screenInfo.reserve(numScreens);
|
||||
for (int i = 0; i < numScreens; ++i) {
|
||||
ScreenInfo info;
|
||||
info.index = i;
|
||||
info.geometry = screens[i]->geometry();
|
||||
|
||||
@@ -224,6 +224,7 @@ SideBar *DockRegistry::sideBarForDockWidget(const DockWidgetBase *dw) const
|
||||
MainWindowBase::List DockRegistry::mainWindowsWithAffinity(const QStringList &affinities) const
|
||||
{
|
||||
MainWindowBase::List result;
|
||||
result.reserve(m_mainWindows.size());
|
||||
|
||||
for (auto mw : m_mainWindows) {
|
||||
const QStringList mwAffinities = mw->affinities();
|
||||
|
||||
@@ -32,6 +32,7 @@ class MinimalStateMachine;
|
||||
|
||||
class State : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit State(MinimalStateMachine *parent);
|
||||
~State() override;
|
||||
|
||||
@@ -992,7 +992,8 @@ void TestMultiSplitter::tst_insertAnotherRoot()
|
||||
|
||||
QCOMPARE(root1->hostWidget()->asQWidget(), host1);
|
||||
QCOMPARE(item2->hostWidget()->asQWidget(), host1);
|
||||
for (Item *item : root1->items_recursive()) {
|
||||
const auto &items = root1->items_recursive();
|
||||
for (Item *item : items) {
|
||||
QCOMPARE(item->hostWidget()->asQWidget(), host1);
|
||||
QVERIFY(item->isVisible());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user