mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Use a vertical layout for property assistant when in dock mode
This commit is contained in:
parent
76e27818a5
commit
7bf97be941
@ -64,6 +64,10 @@ QgsPropertyAssistantWidget::QgsPropertyAssistantWidget( QWidget* parent ,
|
||||
mLegendPreview->setItemDelegate( new ItemDelegate( &mPreviewList ) );
|
||||
mLegendPreview->setHeaderHidden( true );
|
||||
mLegendPreview->expandAll();
|
||||
mLegendVerticalFrame->setLayout( new QVBoxLayout() );
|
||||
mLegendVerticalFrame->layout()->setContentsMargins( 0, 0, 0, 0 );
|
||||
mLegendVerticalFrame->layout()->setMargin( 0 );
|
||||
mLegendVerticalFrame->hide();
|
||||
|
||||
switch ( definition.standardTemplate() )
|
||||
{
|
||||
@ -116,6 +120,17 @@ void QgsPropertyAssistantWidget::updateProperty( QgsProperty& property )
|
||||
property.setTransformer( mTransformerWidget->createTransformer( minValueSpinBox->value(), maxValueSpinBox->value() ) );
|
||||
}
|
||||
|
||||
void QgsPropertyAssistantWidget::setDockMode( bool dockMode )
|
||||
{
|
||||
QgsPanelWidget::setDockMode( dockMode );
|
||||
|
||||
if ( dockMode && mLegendVerticalFrame->isHidden() )
|
||||
{
|
||||
mLegendVerticalFrame->layout()->addWidget( mLegendPreview );
|
||||
mLegendVerticalFrame->show();
|
||||
}
|
||||
}
|
||||
|
||||
void QgsPropertyAssistantWidget::computeValuesFromLayer()
|
||||
{
|
||||
if ( !mLayer )
|
||||
|
@ -107,6 +107,8 @@ class GUI_EXPORT QgsPropertyAssistantWidget : public QgsPanelWidget, private Ui:
|
||||
|
||||
void setSymbol( std::shared_ptr< QgsSymbol > symbol ) { mSymbol = symbol; updatePreview(); }
|
||||
|
||||
void setDockMode( bool dockMode ) override;
|
||||
|
||||
private slots:
|
||||
void computeValuesFromLayer();
|
||||
void updatePreview();
|
||||
|
@ -10,7 +10,17 @@
|
||||
<height>332</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,1,0">
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0">
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<widget class="QTreeView" name="mLegendPreview">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
@ -129,13 +139,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<widget class="QTreeView" name="mLegendPreview">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
<item row="2" column="0">
|
||||
<widget class="QFrame" name="mLegendVerticalFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user