slightly changed layout for logs and cache

This commit is contained in:
fourtf
2019-09-03 13:09:33 +02:00
parent 577e2e0a21
commit 1c0ed6b1aa
3 changed files with 45 additions and 19 deletions
+10 -3
View File
@@ -69,14 +69,21 @@ public:
bool editable = false);
template <typename OnClick>
QPushButton *addButton(const QString &text, OnClick onClick)
QPushButton *makeButton(const QString &text, OnClick onClick)
{
auto button = new QPushButton(text);
this->groups_.back().widgets.push_back({button, {text}});
QObject::connect(button, &QPushButton::clicked, onClick);
return button;
}
template <typename OnClick>
QPushButton *addButton(const QString &text, OnClick onClick)
{
auto button = makeButton(text, onClick);
auto layout = new QHBoxLayout();
layout->addWidget(button);
layout->addStretch(1);
this->groups_.back().widgets.push_back({button, {text}});
QObject::connect(button, &QPushButton::clicked, onClick);
this->addLayout(layout);
return button;
}