Maybe you can solve this for me once and for all, and we can conclude if it is lack of knowledge or a syntactical error on my part, or a bug/flaw in either the QUiLoader or the Designer :-)
My form is a QMainWindow, placed top-most in it I have a QGridLayout containing a few widgets, and I need a pointer to this grid layout. The following things are not working:
(The form and other code is correct, because it will create, display and function properly when I obtain the pointer using previously pasted code)
pointer = qobject_cast<QGridLayout*>( (qobject_cast<QLabel*>( topmost_label_inside_layout->parent() ))->layout() );
pointer = qobject_cast<QGridLayout*>( central_widget->layout() );
pointer = qobject_cast<QGridLayout*>( main_window->layout() ); // long shot
pointer = qobject_cast<QGridLayout*>( (qobject_cast<QLabel*>( topmost_label_inside_layout->parent() ))->layout() );
pointer = qobject_cast<QGridLayout*>( central_widget->layout() );
pointer = qobject_cast<QGridLayout*>( main_window->layout() ); // long shot
To copy to clipboard, switch view to plain text mode
Putting my grid layout inside an additional dummy widget to solve this is not an acceptable overhead, sorry to say :S
Bookmarks