Renamed private members

This commit is contained in:
fourtf
2018-07-06 19:23:47 +02:00
parent 6935619820
commit 280bb4cf8e
141 changed files with 1754 additions and 1861 deletions
+19 -19
View File
@@ -15,29 +15,29 @@ class LayoutCreator
{
public:
LayoutCreator(T *_item)
: item(_item)
: item_(_item)
{
}
T *operator->()
{
return this->item;
return this->item_;
}
T &operator*()
{
return *this->item;
return *this->item_;
}
T *getElement()
{
return this->item;
return this->item_;
}
template <typename T2>
LayoutCreator<T2> append(T2 *_item)
{
this->_addItem(this->getOrCreateLayout(), _item);
this->addItem(this->getOrCreateLayout(), _item);
return LayoutCreator<T2>(_item);
}
@@ -47,7 +47,7 @@ public:
{
T2 *t = new T2(std::forward<Args>(args)...);
this->_addItem(this->getOrCreateLayout(), t);
this->addItem(this->getOrCreateLayout(), t);
return LayoutCreator<T2>(t);
}
@@ -57,7 +57,7 @@ public:
LayoutCreator<QWidget> emplaceScrollAreaWidget()
{
QWidget *widget = new QWidget;
this->item->setWidget(widget);
this->item_->setWidget(widget);
return LayoutCreator<QWidget>(widget);
}
@@ -68,14 +68,14 @@ public:
{
T2 *layout = new T2;
this->item->setLayout(layout);
this->item_->setLayout(layout);
return LayoutCreator<T2>(layout);
}
LayoutCreator<T> assign(T **ptr)
{
*ptr = this->item;
*ptr = this->item_;
return *this;
}
@@ -84,7 +84,7 @@ public:
typename std::enable_if<std::is_base_of<QLayout, Q>::value, int>::type = 0>
LayoutCreator<T> withoutMargin()
{
this->item->setContentsMargins(0, 0, 0, 0);
this->item_->setContentsMargins(0, 0, 0, 0);
return *this;
}
@@ -93,7 +93,7 @@ public:
typename std::enable_if<std::is_base_of<QWidget, Q>::value, int>::type = 0>
LayoutCreator<T> hidden()
{
this->item->setVisible(false);
this->item_->setVisible(false);
return *this;
}
@@ -107,24 +107,24 @@ public:
QWidget *widget = new QWidget;
widget->setLayout(item);
this->item->addTab(widget, title);
this->item_->addTab(widget, title);
return LayoutCreator<T2>(item);
}
private:
T *item;
T *item_;
template <typename T2,
typename std::enable_if<std::is_base_of<QWidget, T2>::value, int>::type = 0>
void _addItem(QLayout *layout, T2 *item)
void addItem(QLayout *layout, T2 *item)
{
layout->addWidget(item);
}
template <typename T2,
typename std::enable_if<std::is_base_of<QLayout, T2>::value, int>::type = 0>
void _addItem(QLayout *layout, T2 *item)
void addItem(QLayout *layout, T2 *item)
{
QWidget *widget = new QWidget();
widget->setLayout(item);
@@ -135,18 +135,18 @@ private:
typename std::enable_if<std::is_base_of<QLayout, Q>::value, int>::type = 0>
QLayout *getOrCreateLayout()
{
return this->item;
return this->item_;
}
template <typename Q = T,
typename std::enable_if<std::is_base_of<QWidget, Q>::value, int>::type = 0>
QLayout *getOrCreateLayout()
{
if (!this->item->layout()) {
this->item->setLayout(new QHBoxLayout());
if (!this->item_->layout()) {
this->item_->setLayout(new QHBoxLayout());
}
return this->item->layout();
return this->item_->layout();
}
};