Changeset 9b547e6 in subsurface


Ignore:
Timestamp:
Feb 10, 2015, 10:45:46 AM (3 years ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
Mtest, android_test, dcDownload, foratdotde, gitMerge, gitdebug, gitpictures, ios, master, mergeKirigamiPort, pictimeshift, resolutionIndependence, spinner, testTomaz, testing, v4.5-branch
Children:
9b62d36
Parents:
7b46a8f
git-author:
Tomaz Canabrava <tomaz.canabrava@…> (02/10/15 09:51:30)
git-committer:
Dirk Hohndel <dirk@…> (02/10/15 10:45:46)
Message:

Remove the flicker issue and the resize issue.

The flicker was caused by removing all widgets (and thus setting
the size of the splitter to zero) and then re-adding them.
I've added four QStackedWdigets that have a consistent size and
the only thing I do now is to set the corresponding widget to visible
without removing / readding anything, and thus, not messing with
the sizes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@…>
Signed-off-by: Dirk Hohndel <dirk@…>

Location:
qt-ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qt-ui/mainwindow.cpp

    r7b46a8f r9b547e6  
    15171517{
    15181518        applicationState[state] = WidgetForBorder(topLeft, bottomLeft, topRight, bottomRight);
     1519        if (ui.topLeft->indexOf(topLeft) == -1) {
     1520                ui.topLeft->addWidget(topLeft);
     1521        }
     1522        if (ui.topRight->indexOf(topRight) == -1) {
     1523                ui.topRight->addWidget(topRight);
     1524        }
     1525        if (ui.bottomLeft->indexOf(bottomLeft) == -1) {
     1526                ui.bottomLeft->addWidget(bottomLeft);
     1527        }
     1528        if(ui.bottomRight->indexOf(bottomRight) == -1) {
     1529                ui.bottomRight->addWidget(bottomRight);
     1530        }
    15191531}
    15201532
     
    15271539
    15281540        currentApplicationState = state;
    1529         QList<int> topSize = ui.topSplitter->sizes();
    1530         QList<int> bottomSize = ui.bottomSplitter->sizes();
    1531 
    1532         // yes, index is zero both times. please don't change it.
    1533         if (ui.topSplitter->count() >= 2) {
    1534                 ui.topSplitter->widget(0)->setParent(NULL);
    1535                 ui.topSplitter->widget(0)->setParent(NULL);
    1536         }
    1537         if (ui.bottomSplitter->count() >= 2) {
    1538                 ui.bottomSplitter->widget(0)->setParent(NULL);
    1539                 ui.bottomSplitter->widget(0)->setParent(NULL);
    1540         }
    1541 
    1542         WidgetForBorder curr = applicationState[state];
    1543         ui.topSplitter->addWidget(curr.topLeft);
    1544         ui.topSplitter->addWidget(curr.topRight);
    1545         ui.bottomSplitter->addWidget(curr.bottomLeft);
    1546         ui.bottomSplitter->addWidget(curr.bottomRight);
    1547         ui.topSplitter->setSizes(topSize);
    1548         ui.bottomSplitter->setSizes(bottomSize);
    1549 }
     1541        ui.topLeft->setCurrentWidget( applicationState[state].topLeft);
     1542        ui.bottomLeft->setCurrentWidget( applicationState[state].bottomLeft);
     1543        ui.topRight->setCurrentWidget( applicationState[state].topRight);
     1544        ui.bottomRight->setCurrentWidget( applicationState[state].bottomRight);
     1545}
  • qt-ui/mainwindow.ui

    r194dd8bd r9b547e6  
    77    <x>0</x>
    88    <y>0</y>
    9     <width>1682</width>
    10     <height>1151</height>
     9    <width>861</width>
     10    <height>800</height>
    1111   </rect>
    1212  </property>
     
    2828        <enum>Qt::Horizontal</enum>
    2929       </property>
     30       <widget class="QStackedWidget" name="topLeft"/>
     31       <widget class="QStackedWidget" name="topRight"/>
    3032      </widget>
    3133      <widget class="QSplitter" name="bottomSplitter">
     
    3335        <enum>Qt::Horizontal</enum>
    3436       </property>
     37       <widget class="QStackedWidget" name="bottomLeft"/>
     38       <widget class="QStackedWidget" name="bottomRight"/>
    3539      </widget>
    3640     </widget>
     
    4650     <x>0</x>
    4751     <y>0</y>
    48      <width>1682</width>
    49      <height>25</height>
     52     <width>861</width>
     53     <height>32</height>
    5054    </rect>
    5155   </property>
Note: See TracChangeset for help on using the changeset viewer.