c++ - Qt - Storing a widget pointer in a QAction? -


in qt have table each row has button in 1 of columns , button opens drop-down menu can click actions. connect triggered() signal of actions slot handle them, in slot have know row action triggered. can't store in setdata(), because stores qvariant. how else can store pointer widget?

q_declare_metatype(qpushbutton *) 

...

qpushbutton *pb = new qpushbutton; qvariant v = qvariant::fromvalue(pb); qdebug() << pb << v.value < qpushbutton * >(); 

works me.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -