fluent connection for ButtonGadget

portability/boost
zetaPRIME 2019-06-30 16:41:11 -04:00
parent a052134503
commit ca5c31e639
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,8 @@ namespace Xybrid::UI {
inline ButtonGadget* setSize(qreal w, qreal h = 24) { size = {w, h}; update(); return this; }
inline ButtonGadget* setText(const QString& t) { text = t; update(); return this;}
template<typename F> ButtonGadget* onClick(F f) { connect(this, &ButtonGadget::clicked, f); return this; }
signals:
void clicked();
};