Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a QgsScrollArea when adding or inserting pages to QgsOptionsDialogBase #55978

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/gui/qgsoptionsdialogbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "qgsguiutils.h"
#include "qgsapplication.h"
#include "qgsvariantutils.h"
#include "qgsscrollarea.h"

QgsOptionsDialogBase::QgsOptionsDialogBase( const QString &settingsKey, QWidget *parent, Qt::WindowFlags fl, QgsSettings *settings )
: QDialog( parent, fl )
Expand Down Expand Up @@ -396,10 +397,15 @@ void QgsOptionsDialogBase::addPage( const QString &title, const QString &tooltip
mOptTreeModel->appendRow( item );
}

QgsScrollArea *scrollArea = new QgsScrollArea();
scrollArea->setWidgetResizable( true );
scrollArea->setFrameShape( QFrame::NoFrame );
scrollArea->setWidget( widget );
nyalldawson marked this conversation as resolved.
Show resolved Hide resolved

if ( newPage < 0 )
mOptStackedWidget->addWidget( widget );
mOptStackedWidget->addWidget( scrollArea );
else
mOptStackedWidget->insertWidget( newPage, widget );
mOptStackedWidget->insertWidget( newPage, scrollArea );
}

void QgsOptionsDialogBase::insertPage( const QString &title, const QString &tooltip, const QIcon &icon, QWidget *widget, const QString &before, const QStringList &path, const QString &key )
Expand Down Expand Up @@ -492,7 +498,11 @@ void QgsOptionsDialogBase::insertPage( const QString &title, const QString &tool
}
}

mOptStackedWidget->insertWidget( page, widget );
QgsScrollArea *scrollArea = new QgsScrollArea();
scrollArea->setWidgetResizable( true );
scrollArea->setFrameShape( QFrame::NoFrame );
scrollArea->setWidget( widget );
mOptStackedWidget->insertWidget( page, scrollArea );
return;
}
}
Expand Down
Loading