summaryrefslogtreecommitdiffstats
path: root/examples/widgets/layouts/borderlayout/borderlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/layouts/borderlayout/borderlayout.cpp')
-rw-r--r--examples/widgets/layouts/borderlayout/borderlayout.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/widgets/layouts/borderlayout/borderlayout.cpp b/examples/widgets/layouts/borderlayout/borderlayout.cpp
index 9b142584c9..b8ddd3af83 100644
--- a/examples/widgets/layouts/borderlayout/borderlayout.cpp
+++ b/examples/widgets/layouts/borderlayout/borderlayout.cpp
@@ -50,10 +50,10 @@
#include "borderlayout.h"
-BorderLayout::BorderLayout(QWidget *parent, int margin, int spacing)
+BorderLayout::BorderLayout(QWidget *parent, const QMargins &margins, int spacing)
: QLayout(parent)
{
- setMargin(margin);
+ setContentsMargins(margins);
setSpacing(spacing);
}
@@ -98,10 +98,7 @@ int BorderLayout::count() const
QLayoutItem *BorderLayout::itemAt(int index) const
{
ItemWrapper *wrapper = list.value(index);
- if (wrapper)
- return wrapper->item;
- else
- return 0;
+ return wrapper ? wrapper->item : nullptr;
}
QSize BorderLayout::minimumSize() const
@@ -111,7 +108,7 @@ QSize BorderLayout::minimumSize() const
void BorderLayout::setGeometry(const QRect &rect)
{
- ItemWrapper *center = 0;
+ ItemWrapper *center = nullptr;
int eastWidth = 0;
int westWidth = 0;
int northHeight = 0;
@@ -189,7 +186,7 @@ QLayoutItem *BorderLayout::takeAt(int index)
ItemWrapper *layoutStruct = list.takeAt(index);
return layoutStruct->item;
}
- return 0;
+ return nullptr;
}
void BorderLayout::add(QLayoutItem *item, Position position)