20 #include <QDialogButtonBox> 22 #include <QListWidget> 23 #include <QMessageBox> 25 #include <QStackedWidget> 32 , mOptsKey( settingsKey )
34 , mOptListWidget( nullptr )
35 , mOptStackedWidget( nullptr )
36 , mOptSplitter( nullptr )
37 , mOptButtonBox( nullptr )
40 , mSettings( settings )
41 , mDelSettings( false )
90 QFrame* optionsFrame = findChild<QFrame*>(
"mOptionsFrame" );
92 mOptSplitter = findChild<QSplitter*>(
"mOptionsSplitter" );
94 QFrame* buttonBoxFrame = findChild<QFrame*>(
"mButtonBoxFrame" );
96 if ( !
mOptListWidget || !mOptStackedWidget || !mOptSplitter || !optionsFrame )
108 optionsFrame->layout()->setContentsMargins( 0, 3, 3, 3 );
111 if ( buttonBoxFrame )
246 int snapToIconWidth = iconWidth + 32;
249 mIconOnly = ( splitSizes.
at( 0 ) <= snapToIconWidth );
260 splitSizes[1] = splitSizes.
at( 1 ) - ( splitSizes.
at( 0 ) - newWidth );
261 splitSizes[0] = newWidth;
289 tr(
"Base options dialog could not be initialized.\n\n" 290 "Missing some of the .ui template objects:\n" )
291 +
" mOptionsListWidget,\n mOptionsStackedWidget,\n mOptionsSplitter",
void warnAboutMissingObjects()
virtual QLayout * layout()
void setContentsMargins(int left, int top, int right, int bottom)
void setSizes(const QList< int > &list)
void setSettings(QSettings *settings)
void initOptionsBase(bool restoreUi=true, const QString &title=QString())
Set up the base ui connections for vertical tabs.
const T & at(int i) const
void paintEvent(QPaintEvent *e) override
bool restoreState(const QByteArray &state)
void restoreOptionsBaseUi(const QString &title=QString())
Restore the base ui.
virtual int count() const
void setFrameStyle(int style)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QString tr(const char *sourceText, const char *disambiguation, int n)
QList< int > sizes() const
void setIconSize(const QSize &size)
void optionsStackedWidget_WidgetRemoved(int indx)
void showEvent(QShowEvent *e) override
bool blockSignals(bool block)
QDialogButtonBox * mOptButtonBox
QgsOptionsDialogBase(const QString &settingsKey, QWidget *parent=nullptr, const Qt::WindowFlags &fl=nullptr, QSettings *settings=nullptr)
Constructor.
QListWidget * mOptListWidget
void updateOptionsListVerticalTabs()
void optionsStackedWidget_CurrentChanged(int indx)
virtual void updateWindowTitle()
virtual void showEvent(QShowEvent *event)
QStackedWidget * mOptStackedWidget
StandardButton warning(QWidget *parent, const QString &title, const QString &text, QFlags< QMessageBox::StandardButton > buttons, StandardButton defaultButton)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QByteArray saveState() const
QPointer< QSettings > mSettings