added irc support

This commit is contained in:
fourtf
2019-09-08 18:06:43 +02:00
parent 9ee286f60f
commit cf23838099
11 changed files with 455 additions and 13 deletions
+22
View File
@@ -126,6 +126,20 @@ public:
return LayoutCreator<T2>(item);
}
template <typename Slot, typename Func>
LayoutCreator<T> connect(Slot slot, QObject *receiver, Func func)
{
QObject::connect(this->getElement(), slot, receiver, func);
return *this;
}
template <typename Func>
LayoutCreator<T> onClick(QObject *receiver, Func func)
{
QObject::connect(this->getElement(), &T::clicked, receiver, func);
return *this;
}
private:
T *item_;
@@ -169,4 +183,12 @@ private:
}
};
template <typename T, typename... Args>
LayoutCreator<T> makeDialog(Args &&... args)
{
T *t = new T(std::forward<Args>(args)...);
t->setAttribute(Qt::WA_DeleteOnClose);
return LayoutCreator<T>(t);
}
} // namespace chatterino