Skip to content
Permalink
Browse files

Start porting item properties widget

  • Loading branch information
nyalldawson committed Oct 10, 2017
1 parent d3836e5 commit b2414d8d8d9d1db5bcb37dd4bde4be7e9dd7ff3d
@@ -53,6 +53,12 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
enum UndoCommand
{
UndoIncrementalMove,
UndoStrokeColor,
UndoStrokeWidth,
UndoBackgroundColor,
UndoOpacity,
UndoSetId,
UndoRotation,
};

explicit QgsLayoutItem( QgsLayout *layout, bool manageZValue = true );
@@ -166,6 +166,13 @@ class QgsLayoutObject: QObject, QgsExpressionContextGenerator
Refreshes the object, causing a recalculation of any property overrides.
%End

signals:

void changed();
%Docstring
Emitted when the object's properties change.
%End

protected:

bool writeObjectPropertiesToElement( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
@@ -97,6 +97,43 @@ class QgsLayoutItemBaseWidget: QgsPanelWidget

};


class QgsLayoutItemPropertiesWidget: QWidget
{
%Docstring
A widget for controlling the common properties of layout items (e.g. position and size, background, stroke, frame).
This widget can be embedded into other layout item widgets.
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgslayoutitemwidget.h"
%End
public:
QgsLayoutItemPropertiesWidget( QWidget *parent, QgsLayoutItem *item );

QgsLayoutItem::ReferencePoint positionMode() const;
%Docstring
:rtype: QgsLayoutItem.ReferencePoint
%End

void showBackgroundGroup( bool showGroup );

void showFrameGroup( bool showGroup );

protected slots:
void initializeDataDefinedButtons();
%Docstring
Initializes data defined buttons to current atlas coverage layer
%End
void populateDataDefinedButtons();
%Docstring
Sets data defined button state to match item
%End

};


/************************************************************************
* This file has been generated automatically from *
* *
@@ -178,6 +178,7 @@ SET(QGIS_APP_SRCS
layout/qgslayoutdesignerdialog.cpp
layout/qgslayoutguidewidget.cpp
layout/qgslayoutappmenuprovider.cpp
layout/qgslayoutmapwidget.cpp
layout/qgslayoutpagepropertieswidget.cpp
layout/qgslayoutpropertieswidget.cpp

@@ -373,6 +374,7 @@ SET (QGIS_APP_MOC_HDRS
layout/qgslayoutappmenuprovider.h
layout/qgslayoutdesignerdialog.h
layout/qgslayoutguidewidget.h
layout/qgslayoutmapwidget.h
layout/qgslayoutpagepropertieswidget.h
layout/qgslayoutpropertieswidget.h

@@ -18,6 +18,8 @@
#include "qgslayoutitemguiregistry.h"
#include "qgslayoutitemregistry.h"
#include "qgslayoutviewrubberband.h"
#include "qgslayoutmapwidget.h"
#include "qgslayoutitemmap.h"

void QgsLayoutAppUtils::registerGuiForKnownItemTypes()
{
@@ -40,7 +42,11 @@ void QgsLayoutAppUtils::registerGuiForKnownItemTypes()

registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutItem + 1002, QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddLabel.svg" ) ), nullptr, createRubberBand ) );

registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutMap, QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddMap.svg" ) ), nullptr, createRubberBand ) );
registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutMap, QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddMap.svg" ) ),
[ = ]( QgsLayoutItem * item )->QgsLayoutItemBaseWidget *
{
return new QgsLayoutMapWidget( qobject_cast< QgsLayoutItemMap * >( item ) );
}, createRubberBand ) );

registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutRectangle, QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddBasicRectangle.svg" ) ), nullptr, createRubberBand, QStringLiteral( "shapes" ) ) );
registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutEllipse, QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddBasicCircle.svg" ) ), nullptr, createEllipseBand, QStringLiteral( "shapes" ) ) );

0 comments on commit b2414d8

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