Skip to content
Permalink
Browse files

Also use splitter in QgsProjectionSelectionDialog

  • Loading branch information
nyalldawson committed Sep 23, 2020
1 parent 9c40f6b commit 05c25194d1c4bc698b5c80809ebcff78a01025ec
@@ -44,6 +44,8 @@ the you probably want to look at QgsProjectionSelectionWidget instead.
Constructor for QgsProjectionSelectionDialog.
%End

~QgsProjectionSelectionDialog();

QgsCoordinateReferenceSystem crs() const;
%Docstring
Returns the CRS currently selected in the widget.
@@ -36,6 +36,15 @@ QgsProjectionSelectionDialog::QgsProjectionSelectionDialog( QWidget *parent,

//apply selected projection upon double-click on item
connect( projectionSelector, &QgsProjectionSelectionTreeWidget::projectionDoubleClicked, this, &QgsProjectionSelectionDialog::accept );

QgsSettings settings;
mSplitter->restoreState( settings.value( QStringLiteral( "Windows/ProjectionSelectorDialog/splitterState" ) ).toByteArray() );
}

QgsProjectionSelectionDialog::~QgsProjectionSelectionDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/ProjectionSelectorDialog/splitterState" ), mSplitter->saveState() );
}

void QgsProjectionSelectionDialog::setMessage( const QString &message )
@@ -59,6 +59,8 @@ class GUI_EXPORT QgsProjectionSelectionDialog : public QDialog, private Ui::QgsG
QgsProjectionSelectionDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr,
Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );

~QgsProjectionSelectionDialog() override;

/**
* Returns the CRS currently selected in the widget.
* \see setCrs()
@@ -15,48 +15,50 @@
</property>
<property name="windowIcon">
<iconset>
<normaloff/>
</iconset>
<normaloff>.</normaloff>.</iconset>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QTextEdit" name="textEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QSplitter" name="mSplitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>160</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops">
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<widget class="QTextEdit" name="textEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>160</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QgsProjectionSelectionTreeWidget" name="projectionSelector" native="true"/>
</widget>
</item>
<item row="1" column="0">
<widget class="QgsProjectionSelectionTreeWidget" name="projectionSelector" native="true"/>
</item>
<item row="2" column="0">
<item>
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>

0 comments on commit 05c2519

Please sign in to comment.
You can’t perform that action at this time.