Skip to content

Commit 7007a3f

Browse files
committed
ticket:4345 Move the scroll bars to top position.
1 parent ebd8f5e commit 7007a3f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

OMEdit/OMEditGUI/Options/OptionsDialog.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,10 +1244,10 @@ void OptionsDialog::setUpDialog()
12441244
mpButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole);
12451245
QHBoxLayout *horizontalLayout = new QHBoxLayout;
12461246
horizontalLayout->addWidget(mpOptionsList);
1247-
QScrollArea *pPagesWidgetScrollArea = new QScrollArea;
1248-
pPagesWidgetScrollArea->setWidgetResizable(true);
1249-
pPagesWidgetScrollArea->setWidget(mpPagesWidget);
1250-
horizontalLayout->addWidget(pPagesWidgetScrollArea);
1247+
mpPagesWidgetScrollArea = new QScrollArea;
1248+
mpPagesWidgetScrollArea->setWidgetResizable(true);
1249+
mpPagesWidgetScrollArea->setWidget(mpPagesWidget);
1250+
horizontalLayout->addWidget(mpPagesWidgetScrollArea);
12511251
// Create a layout
12521252
QGridLayout *mainLayout = new QGridLayout;
12531253
mainLayout->addLayout(horizontalLayout, 0, 0, 1, 2);
@@ -1419,6 +1419,9 @@ void OptionsDialog::changePage(QListWidgetItem *current, QListWidgetItem *previo
14191419
current = previous;
14201420
}
14211421
mpPagesWidget->setCurrentIndex(mpOptionsList->row(current));
1422+
/* ticket:4345 reset the scrollbars to top */
1423+
mpPagesWidgetScrollArea->verticalScrollBar()->setValue(0);
1424+
mpPagesWidgetScrollArea->horizontalScrollBar()->setValue(0);
14221425
}
14231426

14241427
//! Reimplementation of QWidget's reject function. If user reject the settings then set them back to original.

OMEdit/OMEditGUI/Options/OptionsDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public slots:
185185
QSettings *mpSettings;
186186
QListWidget *mpOptionsList;
187187
QStackedWidget *mpPagesWidget;
188+
QScrollArea *mpPagesWidgetScrollArea;
188189
Label *mpChangesEffectLabel;
189190
QPushButton *mpCancelButton;
190191
QPushButton *mpOkButton;

0 commit comments

Comments
 (0)