added highlights page again

This commit is contained in:
fourtf
2018-01-13 02:00:02 +01:00
parent d16bbf6899
commit 2073447df7
6 changed files with 267 additions and 5 deletions
+15
View File
@@ -1,6 +1,7 @@
#pragma once
#include <QHBoxLayout>
#include <QTabWidget>
#include <QWidget>
#include <cassert>
@@ -62,6 +63,20 @@ public:
return *this;
}
template <typename Q = T, typename T2,
typename std::enable_if<std::is_same<QTabWidget, Q>::value, int>::type = 0>
LayoutCreator<T2> appendTab(T2 *item, const QString &title)
{
static_assert(std::is_base_of<QLayout, T2>::value, "needs to be QLayout");
QWidget *widget = new QWidget;
widget->setLayout(item);
this->item->addTab(widget, title);
return LayoutCreator<T2>(item);
}
private:
T *item;