21#include <QDialogButtonBox>
26#include "moc_qgspanelwidget.cpp"
28using namespace Qt::StringLiterals;
37 if ( mForwardChangedSignal )
41 mForwardChangedSignal =
true;
43 mForwardChangedSignal =
false;
48 if ( mForwardChangedSignal )
52 mForwardChangedSignal =
true;
54 mForwardChangedSignal =
false;
61 const auto constPanels = panels;
92 if ( p->window() == p )
99 p = p->parentWidget();
126 QDialog *dlg =
new QDialog();
127 const QString key = u
"/UI/paneldialog/%1"_s.arg( panel->
panelTitle() );
129 dlg->restoreGeometry( settings.
value( key ).toByteArray() );
131 dlg->setLayout(
new QVBoxLayout() );
132 dlg->layout()->addWidget( panel );
133 QDialogButtonBox *buttonBox =
new QDialogButtonBox( QDialogButtonBox::Ok );
134 connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
135 dlg->layout()->addWidget( buttonBox );
137 settings.
setValue( key, dlg->saveGeometry() );
149 if ( event->key() == Qt::Key_Escape )
155 QWidget::keyPressEvent( event );
163 this->setLayout(
new QVBoxLayout() );
164 this->layout()->setContentsMargins( 0, 0, 0, 0 );
165 this->layout()->addWidget(
widget );
Stores settings for use within QGIS.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH