move object construction to initialization list

This commit is contained in:
laserpants 2016-06-21 15:29:26 +03:00
parent 7ffad28819
commit 0269911b2e
2 changed files with 10 additions and 12 deletions

View File

@ -2,13 +2,14 @@
#include "tabs_p.h" #include "tabs_p.h"
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QPainter> #include <QPainter>
#include <QPropertyAnimation>
#include "tabs_internal.h" #include "tabs_internal.h"
#include "lib/ripple.h" #include "lib/ripple.h"
#include "lib/style.h" #include "lib/style.h"
TabsPrivate::TabsPrivate(Tabs *q) TabsPrivate::TabsPrivate(Tabs *q)
: q_ptr(q), : q_ptr(q),
inkBar(new TabsInkBar(q)),
tabLayout(new QHBoxLayout),
tab(-1), tab(-1),
useThemeColors(true), useThemeColors(true),
showHalo(false), showHalo(false),
@ -20,9 +21,6 @@ void TabsPrivate::init()
{ {
Q_Q(Tabs); Q_Q(Tabs);
inkBar = new TabsInkBar(q);
tabLayout = new QHBoxLayout;
q->setLayout(tabLayout); q->setLayout(tabLayout);
tabLayout->setSpacing(0); tabLayout->setSpacing(0);
tabLayout->setMargin(0); tabLayout->setMargin(0);

View File

@ -20,14 +20,14 @@ public:
void init(); void init();
Tabs *const q_ptr; Tabs *const q_ptr;
TabsInkBar *inkBar; TabsInkBar *const inkBar;
QHBoxLayout *tabLayout; QHBoxLayout *const tabLayout;
QColor inkColor; QColor inkColor;
QColor backgroundColor; QColor backgroundColor;
QColor textColor; QColor textColor;
int tab; int tab;
bool useThemeColors; bool useThemeColors;
bool showHalo; bool showHalo;
Material::RippleStyle rippleStyle; Material::RippleStyle rippleStyle;
}; };