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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

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

javascript - Restarting Supervisor and effect on FlaskSocketIO -