21#include <QDialogButtonBox>
25#include "moc_qgspanelwidget.cpp"
34 const auto constPanels = panels;
65 if ( p->window() == p )
72 p = p->parentWidget();
99 QDialog *dlg =
new QDialog();
100 const QString key = QStringLiteral(
"/UI/paneldialog/%1" ).arg( panel->
panelTitle() );
102 dlg->restoreGeometry( settings.
value( key ).toByteArray() );
104 dlg->setLayout(
new QVBoxLayout() );
105 dlg->layout()->addWidget( panel );
106 QDialogButtonBox *buttonBox =
new QDialogButtonBox( QDialogButtonBox::Ok );
107 connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
108 dlg->layout()->addWidget( buttonBox );
110 settings.
setValue( key, dlg->saveGeometry() );
122 if ( event->key() == Qt::Key_Escape )
128 QWidget::keyPressEvent( event );
136 this->setLayout(
new QVBoxLayout() );
137 this->layout()->setContentsMargins( 0, 0, 0, 0 );
138 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.