Problem with transform of pointer
-
I have parent class and widget, and in class of this widget i write
@ RizekColorManager * rcm;
rcm = qobject_cast<RizekColorManager*>(parent());
if (rcm)
rcm->setWindowTitle("asd");@
There no some mistakes, but there are doesnt work, why?
Advance thanks for your help! -
Are you sure that parent of your widget is RizekColorManager instance?
-
RizekColorManager has to derive or indirectly derive from QObject and must also have the Q_Object macro according to Qt Assistant.
-
For a widget, parent has to be a widget. The problem is probably that the parent widget is not actually the expected RizekColorManager.
-
Many thanks for your help, I did not consider object CentralWidget