Skip to content

Commit

Permalink
ticket:4345 Move the scroll bars to top position.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Mar 27, 2017
1 parent ebd8f5e commit 7007a3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions OMEdit/OMEditGUI/Options/OptionsDialog.cpp
Expand Up @@ -1244,10 +1244,10 @@ void OptionsDialog::setUpDialog()
mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole);
QHBoxLayout *horizontalLayout = new QHBoxLayout;
horizontalLayout->addWidget(mpOptionsList);
QScrollArea *pPagesWidgetScrollArea = new QScrollArea;
pPagesWidgetScrollArea->setWidgetResizable(true);
pPagesWidgetScrollArea->setWidget(mpPagesWidget);
horizontalLayout->addWidget(pPagesWidgetScrollArea);
mpPagesWidgetScrollArea = new QScrollArea;
mpPagesWidgetScrollArea->setWidgetResizable(true);
mpPagesWidgetScrollArea->setWidget(mpPagesWidget);
horizontalLayout->addWidget(mpPagesWidgetScrollArea);
// Create a layout
QGridLayout *mainLayout = new QGridLayout;
mainLayout->addLayout(horizontalLayout, 0, 0, 1, 2);
Expand Down Expand Up @@ -1419,6 +1419,9 @@ void OptionsDialog::changePage(QListWidgetItem *current, QListWidgetItem *previo
current = previous;
}
mpPagesWidget->setCurrentIndex(mpOptionsList->row(current));
/* ticket:4345 reset the scrollbars to top */
mpPagesWidgetScrollArea->verticalScrollBar()->setValue(0);
mpPagesWidgetScrollArea->horizontalScrollBar()->setValue(0);
}

//! Reimplementation of QWidget's reject function. If user reject the settings then set them back to original.
Expand Down
1 change: 1 addition & 0 deletions OMEdit/OMEditGUI/Options/OptionsDialog.h
Expand Up @@ -185,6 +185,7 @@ public slots:
QSettings *mpSettings;
QListWidget *mpOptionsList;
QStackedWidget *mpPagesWidget;
QScrollArea *mpPagesWidgetScrollArea;
Label *mpChangesEffectLabel;
QPushButton *mpCancelButton;
QPushButton *mpOkButton;
Expand Down

0 comments on commit 7007a3f

Please sign in to comment.