Skip to content

Commit 7b974ff

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 371c1c7 commit 7b974ff

103 files changed

Lines changed: 458 additions & 458 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/dockwidgets/MyMainWindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class MyMainWindow : public KDDockWidgets::QtWidgets::MainWindow
3333

3434
explicit MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
3535
ExampleOptions exampleOptions,
36-
const QString &affinityName = {}, // Usually not needed. Just here to show
37-
// the feature.
36+
const QString &affinityName = { }, // Usually not needed. Just here to show
37+
// the feature.
3838
QWidget *parent = nullptr);
3939
~MyMainWindow() override;
4040

examples/dockwidgets/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ int main(int argc, char **argv)
407407
KDDockWidgets::Config::self().setFlags(flags);
408408

409409

410-
MyMainWindow::ExampleOptions exampleOptions = {};
410+
MyMainWindow::ExampleOptions exampleOptions = { };
411411

412412
if (parser.isSet(ctrlTogglesDropIndicators))
413413
exampleOptions |= MyMainWindow::ExampleOption::CtrlKeyFiltersDropIndicators;
@@ -498,7 +498,7 @@ int main(int argc, char **argv)
498498
new KDDockWidgets::QtWidgets::DockWidget(QStringLiteral("MyMainWindow-2-DW"));
499499

500500
const QString affinity = QStringLiteral("Inner-DockWidgets-2");
501-
MyMainWindow::ExampleOptions exampleOptions2 = {};
501+
MyMainWindow::ExampleOptions exampleOptions2 = { };
502502
if (parser.isSet(relativeRestore))
503503
exampleOptions2 |= MyMainWindow::ExampleOption::RestoreIsRelative;
504504
auto dockableMainWindow =

examples/mdi_with_docking/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
7272
mainWindow.addDockWidget(dock2, KDDockWidgets::Location_OnBottom, nullptr,
7373
KDDockWidgets::InitialOption(QSize(0, 300)));
7474

75-
KDDockWidgets::DockWidgetOptions options = {};
75+
KDDockWidgets::DockWidgetOptions options = { };
7676
if (parser.isSet(nestedDocking)) {
7777
options |= KDDockWidgets::DockWidgetOption_MDINestable;
7878
}

src/LayoutSaver.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ std::unordered_map<QString, CloseReason> LayoutSaver::Private::s_unrestoredPrope
7373

7474
static InternalRestoreOptions internalRestoreOptions(RestoreOptions options)
7575
{
76-
InternalRestoreOptions ret = {};
76+
InternalRestoreOptions ret = { };
7777
if (options.testFlag(RestoreOption_RelativeToMainWindow)) {
7878
ret.setFlag(InternalRestoreOption::SkipMainWindowGeometry);
7979
ret.setFlag(InternalRestoreOption::RelativeFloatingWindowGeometry);
@@ -132,7 +132,7 @@ static void from_json(const nlohmann::json &json, LayoutSaver::Group &f)
132132
f.isNull = jsonValue(json, "isNull", true);
133133
f.objectName = jsonValue(json, "objectName", QString());
134134
f.geometry = jsonValue(json, "geometry", Rect());
135-
f.options = jsonValue(json, "options", QFlags<FrameOption>::Int {});
135+
f.options = jsonValue(json, "options", QFlags<FrameOption>::Int { });
136136
f.currentTabIndex = jsonValue(json, "currentTabIndex", 0);
137137
f.mainWindowUniqueName = jsonValue(json, "mainWindowUniqueName", QString());
138138

@@ -431,7 +431,7 @@ QByteArray LayoutSaver::serializeLayout() const
431431
{
432432
if (!d->m_dockRegistry->isSane()) {
433433
KDDW_ERROR("Refusing to serialize this layout. Check previous warnings.");
434-
return {};
434+
return { };
435435
}
436436

437437
LayoutSaver::Layout layout;
@@ -631,7 +631,7 @@ bool LayoutSaver::restoreLayout(const QByteArray &data)
631631
flags.setFlag(FloatingWindowFlag::StartsMinimized, int(fw.windowState) & int(WindowState::Minimized));
632632

633633
auto floatingWindow =
634-
new Core::FloatingWindow({}, parent, flags);
634+
new Core::FloatingWindow({ }, parent, flags);
635635
fw.floatingWindowInstance = floatingWindow;
636636
d->deserializeWindowGeometry(fw, floatingWindow->view()->window());
637637
if (!floatingWindow->deserialize(fw)) {
@@ -862,7 +862,7 @@ Vector<QString> LayoutSaver::openedDockWidgetsInLayout(const QString &jsonFilena
862862
const QByteArray data = Platform::instance()->readFile(jsonFilename, /*by-ref*/ ok);
863863

864864
if (!ok)
865-
return {};
865+
return { };
866866

867867
return openedDockWidgetsInLayout(data);
868868
}
@@ -871,7 +871,7 @@ Vector<QString> LayoutSaver::openedDockWidgetsInLayout(const QByteArray &seriali
871871
{
872872
LayoutSaver::Layout layout;
873873
if (!layout.fromJson(serialized))
874-
return {};
874+
return { };
875875

876876
Vector<QString> names;
877877
names.reserve(layout.allDockWidgets.size()); // over-reserve so we have a single allocation
@@ -895,7 +895,7 @@ Vector<QString> LayoutSaver::sideBarDockWidgetsInLayout(const QString &jsonFilen
895895
const QByteArray data = Platform::instance()->readFile(jsonFilename, /*by-ref*/ ok);
896896

897897
if (!ok)
898-
return {};
898+
return { };
899899

900900
return sideBarDockWidgetsInLayout(data);
901901
}
@@ -904,7 +904,7 @@ Vector<QString> LayoutSaver::sideBarDockWidgetsInLayout(const QByteArray &serial
904904
{
905905
LayoutSaver::Layout layout;
906906
if (!layout.fromJson(serialized))
907-
return {};
907+
return { };
908908

909909
Vector<QString> names;
910910
names.reserve(layout.allDockWidgets.size()); // over-reserve so we have a single allocation
@@ -933,8 +933,8 @@ static void to_json(nlohmann::json &j, const LayoutSaver::Layout &layout)
933933
static void from_json(const nlohmann::json &j, LayoutSaver::Layout &layout)
934934
{
935935
layout.serializationVersion = j.value("serializationVersion", 0);
936-
layout.mainWindows = j.value("mainWindows", LayoutSaver::MainWindow::List {});
937-
layout.allDockWidgets = j.value("allDockWidgets", LayoutSaver::DockWidget::List {});
936+
layout.mainWindows = j.value("mainWindows", LayoutSaver::MainWindow::List { });
937+
layout.allDockWidgets = j.value("allDockWidgets", LayoutSaver::DockWidget::List { });
938938

939939
layout.closedDockWidgets.clear();
940940

@@ -944,8 +944,8 @@ static void from_json(const nlohmann::json &j, LayoutSaver::Layout &layout)
944944
LayoutSaver::DockWidget::dockWidgetForName(name));
945945
}
946946

947-
layout.floatingWindows = j.value("floatingWindows", LayoutSaver::FloatingWindow::List {});
948-
layout.screenInfo = j.value("screenInfo", LayoutSaver::ScreenInfo::List {});
947+
layout.floatingWindows = j.value("floatingWindows", LayoutSaver::FloatingWindow::List { });
948+
layout.screenInfo = j.value("screenInfo", LayoutSaver::ScreenInfo::List { });
949949
}
950950
}
951951

@@ -1021,15 +1021,15 @@ void LayoutSaver::Layout::scaleSizes(InternalRestoreOptions options)
10211021
LayoutSaver::MainWindow LayoutSaver::Layout::mainWindowForIndex(int index) const
10221022
{
10231023
if (index < 0 || index >= mainWindows.size())
1024-
return {};
1024+
return { };
10251025

10261026
return mainWindows.at(index);
10271027
}
10281028

10291029
LayoutSaver::FloatingWindow LayoutSaver::Layout::floatingWindowForIndex(int index) const
10301030
{
10311031
if (index < 0 || index >= floatingWindows.size())
1032-
return {};
1032+
return { };
10331033

10341034
return floatingWindows.at(index);
10351035
}
@@ -1147,7 +1147,7 @@ bool LayoutSaver::Group::skipsRestore() const
11471147
LayoutSaver::DockWidget::Ptr LayoutSaver::Group::singleDockWidget() const
11481148
{
11491149
if (!hasSingleDockWidget())
1150-
return {};
1150+
return { };
11511151

11521152
return dockWidgets.first();
11531153
}
@@ -1238,7 +1238,7 @@ bool LayoutSaver::MultiSplitter::hasSingleDockWidget() const
12381238
LayoutSaver::DockWidget::Ptr LayoutSaver::MultiSplitter::singleDockWidget() const
12391239
{
12401240
if (!hasSingleDockWidget())
1241-
return {};
1241+
return { };
12421242

12431243
const auto &group = groups.begin()->second;
12441244
return group.singleDockWidget();
@@ -1256,7 +1256,7 @@ LayoutSaver::Group LayoutSaver::MultiSplitter::centralGroup() const
12561256
if (group.options & FrameOption_IsCentralFrame)
12571257
return group;
12581258
}
1259-
return {};
1259+
return { };
12601260
}
12611261

12621262
void LayoutSaver::Position::scaleSizes(const ScalingInfo &scalingInfo)

src/QtCompat_p.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class HoverEvent : public Event
166166

167167
Point pos() const
168168
{
169-
return {};
169+
return { };
170170
}
171171
};
172172

@@ -218,7 +218,7 @@ class DropEvent : public Event
218218

219219
Point position() const
220220
{
221-
return {};
221+
return { };
222222
}
223223

224224
void setDropAction(Qt::DropAction)
@@ -245,7 +245,7 @@ class FocusEvent : public Event
245245
public:
246246
Qt::FocusReason reason() const
247247
{
248-
return {};
248+
return { };
249249
}
250250
};
251251

src/core/Controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Rect Controller::rect() const
7575
if (d->m_view)
7676
return d->m_view->rect();
7777

78-
return {};
78+
return { };
7979
}
8080

8181
Point Controller::mapToGlobal(Point localPt) const

src/core/DockRegistry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class DOCKS_EXPORT DockRegistry : public QObject, public Core::EventFilterInterf
9292
Q_INVOKABLE bool containsMainWindow(const QString &uniqueName) const;
9393

9494
Q_INVOKABLE KDDockWidgets::Core::DockWidget *
95-
dockByName(const QString &, KDDockWidgets::DockRegistry::DockByNameFlags = {}) const;
95+
dockByName(const QString &, KDDockWidgets::DockRegistry::DockByNameFlags = { }) const;
9696
Q_INVOKABLE KDDockWidgets::Core::MainWindow *mainWindowByName(const QString &) const;
9797

9898
bool isSane() const;
@@ -162,7 +162,7 @@ class DOCKS_EXPORT DockRegistry : public QObject, public Core::EventFilterInterf
162162
* @param affinities if specified only closes dock widgets and main windows with the specified
163163
* affinities
164164
*/
165-
Q_INVOKABLE void clear(const QVector<QString> &affinities = {});
165+
Q_INVOKABLE void clear(const QVector<QString> &affinities = { });
166166

167167
/**
168168
* @brief clear Overload that only clears the specified dockWidgets and main windows.

src/core/DockWidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ Icon DockWidget::icon(IconPlace place) const
406406
if (place == IconPlace::ToggleAction)
407407
return d->toggleAction->icon();
408408

409-
return {};
409+
return { };
410410
}
411411

412412
void DockWidget::forceClose()
@@ -722,7 +722,7 @@ Point DockWidget::Private::defaultCenterPosForFloating()
722722
// main than the others
723723
MainWindow *mw = mainWindows.isEmpty() ? nullptr : mainWindows.constFirst();
724724
if (!mw || !q->isFloating())
725-
return {};
725+
return { };
726726

727727
return mw->geometry().center();
728728
}

src/core/DockWidget.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class DOCKS_EXPORT DockWidget : public Controller
7272
* There's no parent argument. The DockWidget is either parented to FloatingWindow or MainWindow
7373
* when visible, or stays without a parent when hidden.
7474
*/
75-
explicit DockWidget(View *view, const QString &uniqueName, DockWidgetOptions options = {},
76-
LayoutSaverOptions layoutSaverOptions = {});
75+
explicit DockWidget(View *view, const QString &uniqueName, DockWidgetOptions options = { },
76+
LayoutSaverOptions layoutSaverOptions = { });
7777

7878
///@brief destructor
7979
~DockWidget() override;
@@ -89,7 +89,7 @@ class DOCKS_EXPORT DockWidget : public Controller
8989
* @sa MainWindow::addDockWidget(), DockWidget::addDockWidgetToContainingWindow()
9090
*/
9191
void addDockWidgetAsTab(KDDockWidgets::Core::DockWidget *other,
92-
const KDDockWidgets::InitialOption &initialOption = {});
92+
const KDDockWidgets::InitialOption &initialOption = { });
9393

9494
/**
9595
* @brief docks @p other widget into the window that contains this one.
@@ -108,7 +108,7 @@ class DOCKS_EXPORT DockWidget : public Controller
108108
addDockWidgetToContainingWindow(KDDockWidgets::Core::DockWidget *other,
109109
KDDockWidgets::Location location,
110110
KDDockWidgets::Core::DockWidget *relativeTo = nullptr,
111-
const KDDockWidgets::InitialOption &initialOption = {});
111+
const KDDockWidgets::InitialOption &initialOption = { });
112112

113113
/**
114114
* @brief sets the widget which this dock widget hosts.

src/core/DropArea.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ DropArea::DropArea(View *parent, MainWindowOptions options, bool isMDIWrapper)
118118
}
119119

120120
if (d->m_centralGroup)
121-
addWidget(d->m_centralGroup->view(), KDDockWidgets::Location_OnTop, {});
121+
addWidget(d->m_centralGroup->view(), KDDockWidgets::Location_OnTop, { });
122122
}
123123

124124
DropArea::~DropArea()
@@ -278,7 +278,7 @@ Vector<QString> DropArea::affinities() const
278278
return fw->affinities();
279279
}
280280

281-
return {};
281+
return { };
282282
}
283283

284284
void DropArea::layoutParentContainerEqually(Core::DockWidget *dw)
@@ -707,7 +707,7 @@ Rect DropArea::rectForDrop(const WindowBeingDragged *wbd, Location location,
707707
{
708708
Core::Item item(nullptr);
709709
if (!wbd)
710-
return {};
710+
return { };
711711

712712
item.setSize(wbd->size().boundedTo(wbd->maxSize()));
713713
item.setMinSize(wbd->minSize());

0 commit comments

Comments
 (0)