qt - Issue Subclassing a Qlabel C++ -



qt - Issue Subclassing a Qlabel C++ -

i attempting subclass qlabel using header file , error on constructor

intellisense: indirect nonvirtual base of operations class not allowed

class foo : public qlabel { q_object foo(qwidget* parent = 0) : qwidget(parent) { } void mousemoveevent( qmouseevent * event ) { //capture } };

any suggestions why happening , how can prepare ?

the problem here:

foo(qwidget* parent = 0) : qwidget(parent)

you inheriting qlabel, specify qwidget base. should write intead:

explicit foo(qwidget* parent = q_nullptr) : qlabel(parent) // ^^^^^^

also, please utilize explicit constructor q_null_ptr or @ to the lowest degree null instead of 0.

c++ qt intellisense qtgui qlabel

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -