c++ - Move assingment operator for a QWidget derivate? -


this question has answer here:

i have qwidget derivate, let assume standard qwidget example

class mainwindow : public qmainwindow { //.. } 

does make sense class mainwindow fullfill rule of five, mean move constructor , move assignment ?

(since mainwindow should created once)

nope. qobject derived classes should never copied , using q_disable_copy macro qobject , derived classes explicitly disable/hide copy constructor , assignment operator declaring them private. possibly has changed recent releases , c++ 11 compatible compilers might declared deleted. see here

so rule of 5 out. , looking @ qt source can't find support moving qobject derived classes ...

one final read qt objects: identity vs value


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -