15#include <QDialogButtonBox>
22#include "moc_qgspanelwidget.cpp"
32 const auto constPanels = panels;
60 if (
QgsPanelWidget *panel = qobject_cast< QgsPanelWidget * >( p ) )
63 if ( p->window() == p )
70 p = p->parentWidget();
97 QDialog *dlg =
new QDialog();
98 const QString key = QStringLiteral(
"/UI/paneldialog/%1" ).arg( panel->
panelTitle() );
100 dlg->restoreGeometry( settings.
value( key ).toByteArray() );
102 dlg->setLayout(
new QVBoxLayout() );
103 dlg->layout()->addWidget( panel );
104 QDialogButtonBox *buttonBox =
new QDialogButtonBox( QDialogButtonBox::Ok );
105 connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
106 dlg->layout()->addWidget( buttonBox );
108 settings.
setValue( key, dlg->saveGeometry() );
120 if ( event->key() == Qt::Key_Escape )
126 QWidget::keyPressEvent( event );
134 this->setLayout(
new QVBoxLayout() );
135 this->layout()->setContentsMargins( 0, 0, 0, 0 );
136 this->layout()->addWidget(
widget );
This class is a composition of two QSettings instances:
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.