> Question 2: Is there way to control the initial position of the three > dock widgets? In this application's developmental history, we > already had widgets B & C by themselves in the left dock area. My > current task is adding widget A to the mix, but I want it to be always > in the application's upper left corner. When I first attempted to add > it to the .ui file via drag and drop in QtDesigner, QtDesigner would > only put it below dock widgets B & C. I then closed the .ui file in > QtDesigner, opened it in a text editor and rearranged the XML to > put widget A first, then B, then C and saved it. Now when I open > this modified .ui file in QtDesigner it visually looks like how I want > - A, B, then C from top to bottom. But when I then compile and run > the application, the dock widgets are laid out as B, C, then A from > top to bottom. I can't seem to figure out what is causing the widgets > to reorder? When I look at the ui_mainwindow.h file, the widgets are > instantiated in the desired order (A, B, C) and the three > MainWindow->addDockWidget() calls are in the correct order as well > (A, B, C), but for some reason when displayed I see B, C, then A.
I may have discovered the answer to my second question. When the application quits we call saveGeometry(), and on launch we call restoreGeometry(), and it appears that save/restore geometry remembers the location of the docked widgets, which makes sense when I think about it. So since on my development machine I had previously saved the geometry back when only widgets B & C existed, restoreGeometry() was putting them back where they were on last exit, and then putting widget A after them since there was no previous information on where A should be. And then successive launches would restore the saved out order of B, C, then A. I discovered this by undocking B & C, then redocking them in the order I wanted them to be, then quitting and relaunching and noticed that they remained in my desired order. I then tested removing the geometry entry in the application settings and verified that a launch with no stored geometry information behaves the way I want. I'm still curious on my Question 1 - whether putting widget A in a dock widget and removing all the dock widget features is the best way to accomplish what I want. Sean This e-mail, including any attached files, may contain confidential information, privileged information and/or trade secrets for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. _______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest