Skip to content
Permalink
Browse files

Make parameter panel a stacked panel

  • Loading branch information
nyalldawson committed Mar 24, 2020
1 parent 2ce58cd commit 2913bebcff70ee729e298031ae162fdafe4f6090
@@ -56,7 +56,7 @@ Returns the algorithm running in the dialog.
.. seealso:: :py:func:`setAlgorithm`
%End

void setMainWidget( QWidget *widget /Transfer/ );
void setMainWidget( QgsPanelWidget *widget /Transfer/ );
%Docstring
Sets the main ``widget`` for the dialog, usually a panel for configuring algorithm parameters.

@@ -10,7 +10,7 @@



class QgsProcessingParametersWidget : QWidget
class QgsProcessingParametersWidget : QgsPanelWidget
{
%Docstring
A widget which allows users to select the value for the parameters for an algorithm.
@@ -24,6 +24,7 @@
#include "processing/qgsprocessingalgrunnertask.h"
#include "qgsstringutils.h"
#include "qgsapplication.h"
#include "qgspanelwidget.h"
#include <QToolButton>
#include <QDesktopServices>
#include <QScrollBar>
@@ -174,15 +175,16 @@ QgsProcessingAlgorithm *QgsProcessingAlgorithmDialogBase::algorithm()
return mAlgorithm.get();
}

void QgsProcessingAlgorithmDialogBase::setMainWidget( QWidget *widget )
void QgsProcessingAlgorithmDialogBase::setMainWidget( QgsPanelWidget *widget )
{
if ( mMainWidget )
{
mMainWidget->deleteLater();
}

mPanelStack->setMainPanel( widget );

mMainWidget = widget;
mTabWidget->widget( 0 )->layout()->addWidget( mMainWidget );
}

QWidget *QgsProcessingAlgorithmDialogBase::mainWidget()
@@ -119,7 +119,7 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
* Sets the main \a widget for the dialog, usually a panel for configuring algorithm parameters.
* \see mainWidget()
*/
void setMainWidget( QWidget *widget SIP_TRANSFER );
void setMainWidget( QgsPanelWidget *widget SIP_TRANSFER );

/**
* Returns the main widget for the dialog, usually a panel for configuring algorithm parameters.
@@ -20,7 +20,7 @@
///@cond NOT_STABLE

QgsProcessingParametersWidget::QgsProcessingParametersWidget( const QgsProcessingAlgorithm *algorithm, QWidget *parent )
: QWidget( parent )
: QgsPanelWidget( parent )
, mAlgorithm( algorithm )
{
Q_ASSERT( mAlgorithm );
@@ -32,7 +32,7 @@ class QgsProcessingParameterDefinition;
* \note Not stable API
* \since QGIS 3.14
*/
class GUI_EXPORT QgsProcessingParametersWidget : public QWidget, private Ui::QgsProcessingParametersWidgetBase
class GUI_EXPORT QgsProcessingParametersWidget : public QgsPanelWidget, private Ui::QgsProcessingParametersWidgetBase
{
Q_OBJECT

@@ -163,7 +163,7 @@
<x>0</x>
<y>0</y>
<width>256</width>
<height>97</height>
<height>98</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
@@ -253,7 +253,7 @@
<x>0</x>
<y>0</y>
<width>256</width>
<height>153</height>
<height>152</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -58,6 +58,9 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QgsPanelWidgetStack" name="mPanelStack" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
@@ -217,37 +220,18 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsPanelWidgetStack</class>
<extends>QWidget</extends>
<header>qgspanelwidgetstack.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
</resources>
<connections/>
</ui>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsProcessingParametersWidgetBase</class>
<widget class="QWidget" name="QgsProcessingParametersWidgetBase">
<widget class="QgsPanelWidget" name="QgsProcessingParametersWidgetBase">
<property name="geometry">
<rect>
<x>0</x>
@@ -96,6 +96,12 @@
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsPanelWidget</class>
<extends>QWidget</extends>
<header>qgspanelwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>

0 comments on commit 2913beb

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