Skip to content
Permalink
Browse files

[layouts] Expose designer enable atlas preview and show item options to

stable API
  • Loading branch information
nyalldawson committed Oct 11, 2018
1 parent ab5c4fc commit 448b4505bbf6a3e3f3dabbb53a2313b0e86c669d
@@ -62,6 +62,35 @@ Returns the designer's message bar.
Selects the specified ``items``.
%End

virtual void setAtlasPreviewEnabled( bool enabled ) = 0;
%Docstring
Toggles whether the atlas preview mode should be ``enabled`` in the designer.

.. seealso:: :py:func:`atlasPreviewModeEnabled`

.. versionadded:: 3.4
%End

virtual bool atlasPreviewEnabled() const = 0;
%Docstring
Returns whether the atlas preview mode is enabled in the designer.

.. seealso:: :py:func:`setAtlasPreviewEnabled`

.. versionadded:: 3.4
%End

virtual void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) = 0;
%Docstring
Shows the configuration widget for the specified layout ``item``.

If ``bringPanelToFront`` is true, then the item properties panel will be automatically
shown and raised to the top of the interface.

.. versionadded:: 3.4
%End


public slots:

virtual void close() = 0;
@@ -127,6 +127,21 @@ void QgsAppLayoutDesignerInterface::selectItems( const QList<QgsLayoutItem *> &i
mDesigner->selectItems( items );
}

void QgsAppLayoutDesignerInterface::setAtlasPreviewEnabled( bool enabled )
{
mDesigner->setAtlasPreviewEnabled( enabled );
}

bool QgsAppLayoutDesignerInterface::atlasPreviewEnabled() const
{
return mDesigner->atlasPreviewEnabled();
}

void QgsAppLayoutDesignerInterface::showItemOptions( QgsLayoutItem *item, bool bringPanelToFront )
{
mDesigner->showItemOptions( item, bringPanelToFront );
}

void QgsAppLayoutDesignerInterface::close()
{
mDesigner->close();
@@ -4315,6 +4330,17 @@ QgsMessageBar *QgsLayoutDesignerDialog::messageBar()
return mMessageBar;
}

void QgsLayoutDesignerDialog::setAtlasPreviewEnabled( bool enabled )
{
whileBlocking( mActionAtlasPreview )->setChecked( enabled );
atlasPreviewTriggered( enabled );
}

bool QgsLayoutDesignerDialog::atlasPreviewEnabled() const
{
return mActionAtlasPreview->isChecked();
}

void QgsLayoutDesignerDialog::setAtlasFeature( QgsMapLayer *layer, const QgsFeature &feat )
{
QgsLayoutAtlas *layoutAtlas = atlas();
@@ -60,7 +60,9 @@ class QgsAppLayoutDesignerInterface : public QgsLayoutDesignerInterface
QgsLayoutView *view() override;
QgsMessageBar *messageBar() override;
void selectItems( const QList< QgsLayoutItem * > &items ) override;

void setAtlasPreviewEnabled( bool enabled ) override;
bool atlasPreviewEnabled() const override;
void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) override;
public slots:

void close() override;
@@ -139,6 +141,21 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
*/
QgsMessageBar *messageBar();


/**
* Toggles whether the atlas preview mode should be \a enabled in the designer.
*
* \see atlasPreviewModeEnabled()
*/
void setAtlasPreviewEnabled( bool enabled );

/**
* Returns whether the atlas preview mode is enabled in the designer.
*
* \see setAtlasPreviewEnabled()
*/
bool atlasPreviewEnabled() const;

/**
* Sets the specified feature as the current atlas feature
*/
@@ -78,6 +78,33 @@ class GUI_EXPORT QgsLayoutDesignerInterface: public QObject
*/
virtual void selectItems( const QList< QgsLayoutItem * > &items ) = 0;

/**
* Toggles whether the atlas preview mode should be \a enabled in the designer.
*
* \see atlasPreviewModeEnabled()
* \since QGIS 3.4
*/
virtual void setAtlasPreviewEnabled( bool enabled ) = 0;

/**
* Returns whether the atlas preview mode is enabled in the designer.
*
* \see setAtlasPreviewEnabled()
* \since QGIS 3.4
*/
virtual bool atlasPreviewEnabled() const = 0;

/**
* Shows the configuration widget for the specified layout \a item.
*
* If \a bringPanelToFront is true, then the item properties panel will be automatically
* shown and raised to the top of the interface.
*
* \since QGIS 3.4
*/
virtual void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) = 0;


public slots:

/**

0 comments on commit 448b450

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