mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Show breadcrumb and back button for rule based labeling (fixes #15153)
Following the way how rule based rendering widget was adjusted...
This commit is contained in:
parent
e00ba6d725
commit
1c91ae7733
@ -77,9 +77,9 @@ class QgsPanelWidget : public QWidget
|
||||
signals:
|
||||
|
||||
/**
|
||||
* Emiited when the panel is accpeted by the user.
|
||||
* Emitted when the panel is accepted by the user.
|
||||
* @param panel The panel widget that was accepted.
|
||||
* @note This argument is normally raised with emit panelAccpeted(this)
|
||||
* @note This argument is normally raised with emit panelAccepted(this)
|
||||
* so that callers can retrive the widget easier in calling code.
|
||||
*/
|
||||
void panelAccepted( QgsPanelWidget* panel );
|
||||
@ -93,7 +93,7 @@ class QgsPanelWidget : public QWidget
|
||||
void showPanel( QgsPanelWidget* panel );
|
||||
|
||||
/**
|
||||
* Emiited when the widget state changes.
|
||||
* Emitted when the widget state changes.
|
||||
* Connect to this to pull any changes off the widget when needed.
|
||||
* As panels are non blocking "dialogs" you should listen to this signal
|
||||
* to give the user feedback when something changes.
|
||||
@ -114,7 +114,7 @@ class QgsPanelWidget : public QWidget
|
||||
void openPanel( QgsPanelWidget* panel );
|
||||
|
||||
/**
|
||||
* Accept the panel. Causes panelAccepted to be emiited.
|
||||
* Accept the panel. Causes panelAccepted to be emitted.
|
||||
* Widgets are normally removed form the interface using the panel manager or the caller.
|
||||
*/
|
||||
void acceptPanel();
|
||||
|
@ -86,8 +86,8 @@ void QgsLabelingWidget::setLayer( QgsMapLayer* mapLayer )
|
||||
|
||||
void QgsLabelingWidget::setDockMode( bool enabled )
|
||||
{
|
||||
mDockMode = enabled;
|
||||
mLabelGui->setDockMode( mDockMode );
|
||||
QgsPanelWidget::setDockMode( enabled );
|
||||
mLabelGui->setDockMode( enabled );
|
||||
}
|
||||
|
||||
void QgsLabelingWidget::adaptToLayer()
|
||||
@ -155,7 +155,9 @@ void QgsLabelingWidget::labelModeChanged( int index )
|
||||
delete mWidget;
|
||||
mWidget = nullptr;
|
||||
|
||||
QgsRuleBasedLabelingWidget* ruleWidget = new QgsRuleBasedLabelingWidget( mLayer, mCanvas, this, mDockMode );
|
||||
QgsRuleBasedLabelingWidget* ruleWidget = new QgsRuleBasedLabelingWidget( mLayer, mCanvas, this );
|
||||
ruleWidget->setDockMode( dockMode() );
|
||||
connect( ruleWidget, SIGNAL( showPanel( QgsPanelWidget* ) ), this, SLOT( openPanel( QgsPanelWidget* ) ) );
|
||||
connect( ruleWidget, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
|
||||
mWidget = ruleWidget;
|
||||
mStackedWidget->addWidget( mWidget );
|
||||
|
@ -63,8 +63,6 @@ class QgsLabelingWidget : public QgsMapLayerConfigWidget, private Ui::QgsLabelin
|
||||
QgsVectorLayer* mLayer;
|
||||
QgsMapCanvas* mCanvas;
|
||||
|
||||
bool mDockMode;
|
||||
|
||||
QWidget* mWidget;
|
||||
QgsLabelingGui* mLabelGui;
|
||||
QScopedPointer< QgsAbstractVectorLayerLabeling > mOldSettings;
|
||||
|
@ -24,14 +24,12 @@
|
||||
#include <QClipboard>
|
||||
#include <QMessageBox>
|
||||
|
||||
QgsRuleBasedLabelingWidget::QgsRuleBasedLabelingWidget( QgsVectorLayer* layer, QgsMapCanvas* canvas, QWidget* parent, bool dockMode )
|
||||
: QWidget( parent )
|
||||
QgsRuleBasedLabelingWidget::QgsRuleBasedLabelingWidget( QgsVectorLayer* layer, QgsMapCanvas* canvas, QWidget* parent )
|
||||
: QgsPanelWidget( parent )
|
||||
, mLayer( layer )
|
||||
, mCanvas( canvas )
|
||||
, mRootRule( nullptr )
|
||||
, mModel( nullptr )
|
||||
, mRuleProps( nullptr )
|
||||
, mDockMode( dockMode )
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
@ -78,11 +76,6 @@ QgsRuleBasedLabelingWidget::~QgsRuleBasedLabelingWidget()
|
||||
delete mRootRule;
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::setDockMode( bool enabled )
|
||||
{
|
||||
mDockMode = enabled;
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::writeSettingsToLayer()
|
||||
{
|
||||
// also clear old-style labeling config
|
||||
@ -93,83 +86,46 @@ void QgsRuleBasedLabelingWidget::writeSettingsToLayer()
|
||||
|
||||
void QgsRuleBasedLabelingWidget::addRule()
|
||||
{
|
||||
if ( mRuleProps )
|
||||
mStackedWidget->removeWidget( mRuleProps );
|
||||
|
||||
delete mRuleProps;
|
||||
mRuleProps = nullptr;
|
||||
|
||||
// TODO Delete rule
|
||||
QgsRuleBasedLabeling::Rule* newrule = new QgsRuleBasedLabeling::Rule( new QgsPalLayerSettings );
|
||||
mRuleProps = new QgsLabelingRulePropsDialog( newrule, mLayer, this, mCanvas, mDockMode );
|
||||
mRuleProps->setCurrentMode( QgsLabelingRulePropsDialog::Adding );
|
||||
|
||||
mStackedWidget->addWidget( mRuleProps );
|
||||
mStackedWidget->setCurrentWidget( mRuleProps );
|
||||
|
||||
connect( mRuleProps, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
|
||||
connect( mRuleProps, SIGNAL( accepted() ), this, SLOT( saveRule() ) );
|
||||
connect( mRuleProps, SIGNAL( rejected() ), this, SLOT( rejectRule() ) );
|
||||
addNewRule( newrule );
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::saveRuleEdit()
|
||||
{
|
||||
QModelIndex index = viewRules->selectionModel()->currentIndex();
|
||||
mModel->updateRule( index.parent(), index.row() );
|
||||
if ( mRuleProps )
|
||||
mStackedWidget->removeWidget( mRuleProps );
|
||||
|
||||
delete mRuleProps;
|
||||
mRuleProps = nullptr;
|
||||
mStackedWidget->setCurrentIndex( 0 );
|
||||
emit widgetChanged();
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::saveRule()
|
||||
{
|
||||
if ( mRuleProps )
|
||||
mStackedWidget->removeWidget( mRuleProps );
|
||||
|
||||
delete mRuleProps;
|
||||
mRuleProps = nullptr;
|
||||
mStackedWidget->setCurrentIndex( 0 );
|
||||
emit widgetChanged();
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::addNewRule( QgsRuleBasedLabeling::Rule* newrule )
|
||||
{
|
||||
if ( currentRule() )
|
||||
QgsRuleBasedLabeling::Rule* current = currentRule();
|
||||
if ( current )
|
||||
{
|
||||
// add after this rule
|
||||
QModelIndex currentIndex = viewRules->selectionModel()->currentIndex();
|
||||
mModel->insertRule( currentIndex.parent(), currentIndex.row() + 1, newrule );
|
||||
viewRules->selectionModel()->select( mModel->index( currentIndex.row() + 1, 0 ), QItemSelectionModel::ClearAndSelect );
|
||||
QModelIndex newindex = mModel->index( currentIndex.row() + 1, 0, currentIndex.parent() );
|
||||
viewRules->selectionModel()->setCurrentIndex( newindex, QItemSelectionModel::ClearAndSelect );
|
||||
}
|
||||
else
|
||||
{
|
||||
// append to root rule
|
||||
int rows = mModel->rowCount();
|
||||
mModel->insertRule( QModelIndex(), rows, newrule );
|
||||
viewRules->selectionModel()->select( mModel->index( rows, 0 ), QItemSelectionModel::ClearAndSelect );
|
||||
QModelIndex newindex = mModel->index( rows, 0 );
|
||||
viewRules->selectionModel()->setCurrentIndex( newindex, QItemSelectionModel::ClearAndSelect );
|
||||
}
|
||||
editRule();
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::rejectRule()
|
||||
void QgsRuleBasedLabelingWidget::ruleWidgetPanelAccepted( QgsPanelWidget* panel )
|
||||
{
|
||||
if ( mRuleProps->currentMode() == QgsLabelingRulePropsDialog::Adding )
|
||||
removeRule();
|
||||
QgsLabelingRulePropsWidget* widget = qobject_cast<QgsLabelingRulePropsWidget*>( panel );
|
||||
widget->apply();
|
||||
|
||||
mStackedWidget->setCurrentIndex( 0 );
|
||||
QModelIndex index = viewRules->selectionModel()->currentIndex();
|
||||
mModel->updateRule( index.parent(), index.row() );
|
||||
|
||||
if ( mRuleProps )
|
||||
mStackedWidget->removeWidget( mRuleProps );
|
||||
|
||||
delete mRuleProps;
|
||||
mRuleProps = nullptr;
|
||||
emit widgetChanged();
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::liveUpdateRuleFromPanel()
|
||||
{
|
||||
ruleWidgetPanelAccepted( qobject_cast<QgsPanelWidget*>( sender() ) );
|
||||
}
|
||||
|
||||
|
||||
void QgsRuleBasedLabelingWidget::editRule()
|
||||
{
|
||||
editRule( viewRules->selectionModel()->currentIndex() );
|
||||
@ -180,23 +136,14 @@ void QgsRuleBasedLabelingWidget::editRule( const QModelIndex& index )
|
||||
if ( !index.isValid() )
|
||||
return;
|
||||
|
||||
if ( mRuleProps )
|
||||
mStackedWidget->removeWidget( mRuleProps );
|
||||
|
||||
delete mRuleProps;
|
||||
mRuleProps = nullptr;
|
||||
|
||||
QgsRuleBasedLabeling::Rule* rule = mModel->ruleForIndex( index );
|
||||
mRuleProps = new QgsLabelingRulePropsDialog( rule, mLayer, this, mCanvas, mDockMode );
|
||||
mRuleProps->setCurrentMode( QgsLabelingRulePropsDialog::Editing );
|
||||
|
||||
connect( mRuleProps, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
|
||||
|
||||
mStackedWidget->addWidget( mRuleProps );
|
||||
mStackedWidget->setCurrentWidget( mRuleProps );
|
||||
|
||||
connect( mRuleProps, SIGNAL( accepted() ), this, SLOT( saveRuleEdit() ) );
|
||||
connect( mRuleProps, SIGNAL( rejected() ), this, SLOT( rejectRule() ) );
|
||||
QgsLabelingRulePropsWidget* widget = new QgsLabelingRulePropsWidget( rule, mLayer, this, mCanvas );
|
||||
widget->setDockMode( true );
|
||||
widget->setPanelTitle( tr( "Edit rule" ) );
|
||||
connect( widget, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( ruleWidgetPanelAccepted( QgsPanelWidget* ) ) );
|
||||
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( liveUpdateRuleFromPanel() ) );
|
||||
openPanel( widget );
|
||||
}
|
||||
|
||||
void QgsRuleBasedLabelingWidget::removeRule()
|
||||
@ -622,23 +569,15 @@ void QgsRuleBasedLabelingModel::updateRule( const QModelIndex& parent, int row )
|
||||
|
||||
/////////
|
||||
|
||||
QgsLabelingRulePropsDialog::QgsLabelingRulePropsDialog( QgsRuleBasedLabeling::Rule* rule, QgsVectorLayer* layer, QWidget* parent, QgsMapCanvas* mapCanvas, bool dockMode )
|
||||
: QDialog( parent )
|
||||
QgsLabelingRulePropsWidget::QgsLabelingRulePropsWidget( QgsRuleBasedLabeling::Rule* rule, QgsVectorLayer* layer, QWidget* parent, QgsMapCanvas* mapCanvas )
|
||||
: QgsPanelWidget( parent )
|
||||
, mRule( rule )
|
||||
, mLayer( layer )
|
||||
, mLabelingGui( nullptr )
|
||||
, mSettings( nullptr )
|
||||
, mMapCanvas( mapCanvas )
|
||||
, mDockMode( dockMode )
|
||||
, mCurrentMode( Adding )
|
||||
{
|
||||
setupUi( this );
|
||||
#ifdef Q_OS_MAC
|
||||
setWindowModality( Qt::WindowModal );
|
||||
#endif
|
||||
|
||||
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
|
||||
editFilter->setText( mRule->filterExpression() );
|
||||
editFilter->setToolTip( mRule->filterExpression() );
|
||||
@ -668,7 +607,6 @@ QgsLabelingRulePropsDialog::QgsLabelingRulePropsDialog( QgsRuleBasedLabeling::Ru
|
||||
}
|
||||
|
||||
mLabelingGui = new QgsLabelingGui( nullptr, mMapCanvas, mSettings, this );
|
||||
mLabelingGui->setDockMode( mDockMode );
|
||||
mLabelingGui->layout()->setContentsMargins( 0, 0, 0, 0 );
|
||||
QVBoxLayout* l = new QVBoxLayout;
|
||||
l->addWidget( mLabelingGui );
|
||||
@ -680,21 +618,25 @@ QgsLabelingRulePropsDialog::QgsLabelingRulePropsDialog( QgsRuleBasedLabeling::Ru
|
||||
connect( btnExpressionBuilder, SIGNAL( clicked() ), this, SLOT( buildExpression() ) );
|
||||
connect( btnTestFilter, SIGNAL( clicked() ), this, SLOT( testFilter() ) );
|
||||
connect( editFilter, SIGNAL( textEdited( QString ) ), this, SIGNAL( widgetChanged() ) );
|
||||
connect( editDescription, SIGNAL( textChanged( QString ) ), this, SIGNAL( widgetChanged() ) );
|
||||
connect( groupScale, SIGNAL( toggled( bool ) ), this, SIGNAL( widgetChanged() ) );
|
||||
connect( mScaleRangeWidget, SIGNAL( rangeChanged( double, double ) ), this, SIGNAL( widgetChanged() ) );
|
||||
connect( groupSettings, SIGNAL( toggled( bool ) ), this, SIGNAL( widgetChanged() ) );
|
||||
connect( mLabelingGui, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
|
||||
connect( this, SIGNAL( widgetChanged() ), this, SLOT( updateRule() ) );
|
||||
|
||||
QSettings settings;
|
||||
restoreGeometry( settings.value( "/Windows/QgsLabelingRulePropsDialog/geometry" ).toByteArray() );
|
||||
}
|
||||
|
||||
QgsLabelingRulePropsDialog::~QgsLabelingRulePropsDialog()
|
||||
QgsLabelingRulePropsWidget::~QgsLabelingRulePropsWidget()
|
||||
{
|
||||
delete mSettings;
|
||||
QSettings settings;
|
||||
settings.setValue( "/Windows/QgsLabelingRulePropsDialog/geometry", saveGeometry() );
|
||||
}
|
||||
|
||||
void QgsLabelingRulePropsDialog::testFilter()
|
||||
void QgsLabelingRulePropsWidget::setDockMode( bool dockMode )
|
||||
{
|
||||
QgsPanelWidget::setDockMode( dockMode );
|
||||
mLabelingGui->setDockMode( dockMode );
|
||||
}
|
||||
|
||||
void QgsLabelingRulePropsWidget::testFilter()
|
||||
{
|
||||
QgsExpression filter( editFilter->text() );
|
||||
if ( filter.hasParserError() )
|
||||
@ -746,7 +688,7 @@ void QgsLabelingRulePropsDialog::testFilter()
|
||||
QMessageBox::information( this, tr( "Filter" ), tr( "Filter returned %n feature(s)", "number of filtered features", count ) );
|
||||
}
|
||||
|
||||
void QgsLabelingRulePropsDialog::buildExpression()
|
||||
void QgsLabelingRulePropsWidget::buildExpression()
|
||||
{
|
||||
QgsExpressionContext context;
|
||||
context << QgsExpressionContextUtils::globalScope()
|
||||
@ -769,7 +711,7 @@ void QgsLabelingRulePropsDialog::buildExpression()
|
||||
editFilter->setText( dlg.expressionText() );
|
||||
}
|
||||
|
||||
void QgsLabelingRulePropsDialog::updateRule()
|
||||
void QgsLabelingRulePropsWidget::apply()
|
||||
{
|
||||
mRule->setFilterExpression( editFilter->text() );
|
||||
mRule->setDescription( editDescription->text() );
|
||||
@ -778,9 +720,3 @@ void QgsLabelingRulePropsDialog::updateRule()
|
||||
mRule->setScaleMaxDenom( groupScale->isChecked() ? mScaleRangeWidget->maximumScaleDenom() : 0 );
|
||||
mRule->setSettings( groupSettings->isChecked() ? new QgsPalLayerSettings( mLabelingGui->layerSettings() ) : nullptr );
|
||||
}
|
||||
|
||||
void QgsLabelingRulePropsDialog::accept()
|
||||
{
|
||||
updateRule();
|
||||
QDialog::accept();
|
||||
}
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "qgspanelwidget.h"
|
||||
|
||||
#include <ui_qgsrulebasedlabelingwidget.h>
|
||||
|
||||
#include "qgsrulebasedlabeling.h"
|
||||
@ -72,36 +74,33 @@ class APP_EXPORT QgsRuleBasedLabelingModel : public QAbstractItemModel
|
||||
};
|
||||
|
||||
|
||||
class QgsLabelingRulePropsDialog;
|
||||
class QgsLabelingRulePropsWidget;
|
||||
|
||||
|
||||
class QgsRuleBasedLabelingWidget : public QWidget, private Ui::QgsRuleBasedLabelingWidget
|
||||
class QgsRuleBasedLabelingWidget : public QgsPanelWidget, private Ui::QgsRuleBasedLabelingWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QgsRuleBasedLabelingWidget( QgsVectorLayer* layer, QgsMapCanvas* canvas, QWidget* parent = nullptr, bool dockMode = false );
|
||||
QgsRuleBasedLabelingWidget( QgsVectorLayer* layer, QgsMapCanvas* canvas, QWidget* parent = nullptr );
|
||||
~QgsRuleBasedLabelingWidget();
|
||||
|
||||
//! save config to layer
|
||||
void writeSettingsToLayer();
|
||||
void setDockMode( bool enabled );
|
||||
|
||||
signals:
|
||||
void widgetChanged();
|
||||
|
||||
protected slots:
|
||||
void saveRuleEdit();
|
||||
void addRule();
|
||||
void saveRule();
|
||||
void rejectRule();
|
||||
void editRule();
|
||||
void editRule( const QModelIndex& index );
|
||||
void removeRule();
|
||||
void copy();
|
||||
void paste();
|
||||
|
||||
private:
|
||||
void addNewRule( QgsRuleBasedLabeling::Rule* newrule );
|
||||
private slots:
|
||||
void ruleWidgetPanelAccepted( QgsPanelWidget* panel );
|
||||
void liveUpdateRuleFromPanel();
|
||||
|
||||
protected:
|
||||
QgsRuleBasedLabeling::Rule* currentRule();
|
||||
@ -112,12 +111,10 @@ class QgsRuleBasedLabelingWidget : public QWidget, private Ui::QgsRuleBasedLabel
|
||||
|
||||
QgsRuleBasedLabeling::Rule* mRootRule;
|
||||
QgsRuleBasedLabelingModel* mModel;
|
||||
QgsLabelingRulePropsDialog* mRuleProps;
|
||||
|
||||
QAction* mCopyAction;
|
||||
QAction* mPasteAction;
|
||||
QAction* mDeleteAction;
|
||||
bool mDockMode;
|
||||
};
|
||||
|
||||
|
||||
@ -125,9 +122,9 @@ class QgsRuleBasedLabelingWidget : public QWidget, private Ui::QgsRuleBasedLabel
|
||||
|
||||
class QgsLabelingGui;
|
||||
|
||||
#include "ui_qgslabelingrulepropsdialog.h"
|
||||
#include "ui_qgslabelingrulepropswidget.h"
|
||||
|
||||
class APP_EXPORT QgsLabelingRulePropsDialog : public QDialog, private Ui::QgsLabelingRulePropsDialog
|
||||
class APP_EXPORT QgsLabelingRulePropsWidget : public QgsPanelWidget, private Ui::QgsLabelingRulePropsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -138,15 +135,13 @@ class APP_EXPORT QgsLabelingRulePropsDialog : public QDialog, private Ui::QgsLab
|
||||
Editing
|
||||
};
|
||||
|
||||
QgsLabelingRulePropsDialog( QgsRuleBasedLabeling::Rule* rule, QgsVectorLayer* layer,
|
||||
QWidget* parent = nullptr, QgsMapCanvas* mapCanvas = nullptr,
|
||||
bool dockMode = false );
|
||||
~QgsLabelingRulePropsDialog();
|
||||
QgsLabelingRulePropsWidget( QgsRuleBasedLabeling::Rule* rule, QgsVectorLayer* layer,
|
||||
QWidget* parent = nullptr, QgsMapCanvas* mapCanvas = nullptr );
|
||||
~QgsLabelingRulePropsWidget();
|
||||
|
||||
QgsRuleBasedLabeling::Rule* rule() { return mRule; }
|
||||
|
||||
Mode currentMode() { return mCurrentMode; }
|
||||
void setCurrentMode( Mode currentMode ) { mCurrentMode = currentMode; }
|
||||
virtual void setDockMode( bool dockMode ) override;
|
||||
|
||||
signals:
|
||||
void widgetChanged();
|
||||
@ -154,8 +149,11 @@ class APP_EXPORT QgsLabelingRulePropsDialog : public QDialog, private Ui::QgsLab
|
||||
public slots:
|
||||
void testFilter();
|
||||
void buildExpression();
|
||||
void updateRule();
|
||||
void accept() override;
|
||||
|
||||
/**
|
||||
* Apply any changes from the widget to the set rule.
|
||||
*/
|
||||
void apply();
|
||||
|
||||
protected:
|
||||
QgsRuleBasedLabeling::Rule* mRule; // borrowed
|
||||
@ -165,8 +163,6 @@ class APP_EXPORT QgsLabelingRulePropsDialog : public QDialog, private Ui::QgsLab
|
||||
QgsPalLayerSettings* mSettings; // a clone of original settings
|
||||
|
||||
QgsMapCanvas* mMapCanvas;
|
||||
bool mDockMode;
|
||||
Mode mCurrentMode;
|
||||
};
|
||||
|
||||
|
||||
|
@ -96,7 +96,10 @@ QgsPanelWidgetStack::QgsPanelWidgetStack( QWidget *parent )
|
||||
void QgsPanelWidgetStack::addMainPanel( QgsPanelWidget *panel )
|
||||
{
|
||||
// TODO Don't allow adding another main widget or else that would be strange for the user.
|
||||
connect( panel, SIGNAL( showPanel( QgsPanelWidget* ) ), this, SLOT( showPanel( QgsPanelWidget* ) ) );
|
||||
connect( panel, SIGNAL( showPanel( QgsPanelWidget* ) ), this, SLOT( showPanel( QgsPanelWidget* ) ),
|
||||
// using unique connection because addMainPanel() may be called multiple times
|
||||
// for a panel, so showPanel() slot could be invoked more times from one signal
|
||||
Qt::UniqueConnection );
|
||||
mStackedWidget->insertWidget( 0, panel );
|
||||
mStackedWidget->setCurrentIndex( 0 );
|
||||
}
|
||||
|
@ -100,9 +100,9 @@ class GUI_EXPORT QgsPanelWidget : public QWidget
|
||||
signals:
|
||||
|
||||
/**
|
||||
* Emiited when the panel is accpeted by the user.
|
||||
* Emitted when the panel is accepted by the user.
|
||||
* @param panel The panel widget that was accepted.
|
||||
* @note This argument is normally raised with emit panelAccpeted(this)
|
||||
* @note This argument is normally raised with emit panelAccepted(this)
|
||||
* so that callers can retrive the widget easier in calling code.
|
||||
*/
|
||||
void panelAccepted( QgsPanelWidget* panel );
|
||||
@ -116,7 +116,7 @@ class GUI_EXPORT QgsPanelWidget : public QWidget
|
||||
void showPanel( QgsPanelWidget* panel );
|
||||
|
||||
/**
|
||||
* Emiited when the widget state changes.
|
||||
* Emitted when the widget state changes.
|
||||
* Connect to this to pull any changes off the widget when needed.
|
||||
* As panels are non blocking "dialogs" you should listen to this signal
|
||||
* to give the user feedback when something changes.
|
||||
@ -137,7 +137,7 @@ class GUI_EXPORT QgsPanelWidget : public QWidget
|
||||
void openPanel( QgsPanelWidget* panel );
|
||||
|
||||
/**
|
||||
* Accept the panel. Causes panelAccepted to be emiited.
|
||||
* Accept the panel. Causes panelAccepted to be emitted.
|
||||
* Widgets are normally removed form the interface using the panel manager or the caller.
|
||||
*/
|
||||
void acceptPanel();
|
||||
|
@ -11,4 +11,3 @@ FILE(GLOB STYLEDOCK_UIS "${CMAKE_CURRENT_SOURCE_DIR}/styledock/*.ui")
|
||||
QT4_WRAP_UI(QGIS_UIS_H ${QGIS_UIS} ${SYMBOLLAYER_UIS} ${EDITORWIDGET_UIS} ${PAINTEFFECT_UIS} ${COMPOSER_UIS} ${AUTH_UIS} ${RASTER_UIS} ${STYLEDOCK_UIS})
|
||||
|
||||
ADD_CUSTOM_TARGET(ui ALL DEPENDS ${QGIS_UIS_H})
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsLabelingRulePropsDialog</class>
|
||||
<widget class="QDialog" name="QgsLabelingRulePropsDialog">
|
||||
<class>QgsLabelingRulePropsWidget</class>
|
||||
<widget class="QWidget" name="QgsLabelingRulePropsWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -14,7 +14,16 @@
|
||||
<string>Rule properties</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -31,11 +40,20 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>666</width>
|
||||
<height>540</height>
|
||||
<height>573</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -102,7 +120,7 @@
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QgsScaleRangeWidget" name="mScaleRangeWidget">
|
||||
<widget class="QgsScaleRangeWidget" name="mScaleRangeWidget" native="true">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
@ -134,16 +152,6 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
@ -158,7 +166,6 @@
|
||||
<tabstop>editFilter</tabstop>
|
||||
<tabstop>btnExpressionBuilder</tabstop>
|
||||
<tabstop>btnTestFilter</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
@ -15,106 +15,92 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="mStackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<widget class="QTreeView" name="viewRules">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::ActionsContextMenu</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="rulesPage">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTreeView" name="viewRules">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::ActionsContextMenu</enum>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::InternalMove</enum>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerMinimumSectionSize">
|
||||
<number>100</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAddRule">
|
||||
<property name="toolTip">
|
||||
<string>Add rule</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnEditRule">
|
||||
<property name="toolTip">
|
||||
<string>Edit rule</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyEdit.png</normaloff>:/images/themes/default/symbologyEdit.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRemoveRule">
|
||||
<property name="toolTip">
|
||||
<string>Remove rule</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::InternalMove</enum>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerMinimumSectionSize">
|
||||
<number>100</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAddRule">
|
||||
<property name="toolTip">
|
||||
<string>Add rule</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnEditRule">
|
||||
<property name="toolTip">
|
||||
<string>Edit rule</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyEdit.png</normaloff>:/images/themes/default/symbologyEdit.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRemoveRule">
|
||||
<property name="toolTip">
|
||||
<string>Remove rule</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user