RTXI / rtxi

Tutorials, FAQs, and more at http://rtxi.org/docs
GNU General Public License v3.0
53 stars 15 forks source link

Minimized modules aren't displayed correctly when loaded from workspace .set files. #73

Closed sudorook closed 9 years ago

sudorook commented 9 years ago

(this only affects branch qt5; minimzing isn't enabled on master)

When loading modules that are minimized, they are not displayed correctly on the bottom of the screen. The horizontal width is equal to the width on the module had it been displayed normally.

The display error can be worked around by restoring and then reminimizing each module, from left to right. Doing that in another order will cause the UI to get screwed up. (The other modules will end up displayed in weird places.)

sudorook commented 9 years ago

This is caused by the QTimer in DefaultGUI:

QTimer::singleShot(0, this, SLOT(resizeMe()));

The timer causes the resize event to be handled after the module is loaded and all the UI-functions in createGUI and customizeGUI are executed. This is problematic when used in conjunction with the doLoad function in DefaultGUI. The function minimizes the module in the display, and at the end, when the single-shot timer's resize call is executed, the module gets resized while still minimized. This produces the anomalous behavior.

I can think of a few options going forward:

  1. Change the way modules resize upon load so that there isn't a need for the single-shot timer.
  2. Add another single-shot timer in the doLoad function that puts off the minimize event until after the resize event from the single-shot timer in the module constructor is executed.

I'll prioritize the first option. The second will work, but its more of a work-around than a solution. We don't need lots of timer events going off whenever a workspace is loaded.