#pragma once #include #include #include namespace chatterino { using LayoutItem = boost::variant; template T *makeLayout(std::initializer_list items) { auto t = new T; for (auto &item : items) { switch (item.which()) { case 0: t->addItem(new QWidgetItem(boost::get(item))); break; case 1: t->addItem(boost::get(item)); break; } } return t; } template T *makeWidget(With with) { auto t = new T; with(t); return t; } } // namespace chatterino