is it possible to change layout in QWidget when i have set one before? do i need to unset the first before setting new one?
is it possible to change layout in QWidget when i have set one before? do i need to unset the first before setting new one?
Hi damiano19902,
use the designer to access the docs. For Qt they are really great and well documented. And yes you must first delete an old set layout befor you can use a new one.
LykurgIf there already is a layout manager installed on this widget, QWidget won't let you install another. You must first delete the existing layout manager (returned by layout()) before you can call setLayout() with the new layout.
whats the best way to delete it?
simple use delete.
Qt Code:
if (oldLayout) // paranoic check delete oldLayout; QXYZLayout *newLayout = new QXYZLayout; //... populate the layout setLayout(newLayout);To copy to clipboard, switch view to plain text mode
damiano19902 (31st May 2009)
Bookmarks