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

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

SAP BPC EPM dynamic table member -