Skip to content

Commit

Permalink
Add some documentation to layout classes moved to GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jan 18, 2020
1 parent 509ba6c commit 6e7009a
Show file tree
Hide file tree
Showing 27 changed files with 327 additions and 71 deletions.
8 changes: 8 additions & 0 deletions src/gui/layout/qgsgeopdflayertreemodel.h
Expand Up @@ -28,11 +28,19 @@ class QgsMapCanvas;
class QgsProject;


/**
* \ingroup gui
* Layer tree model for Geo-PDF layers
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsGeoPdfLayerTreeModel : public QgsLayerTreeModel
{
Q_OBJECT

public:
//! constructor
QgsGeoPdfLayerTreeModel( QgsLayerTree *rootNode, QObject *parent = nullptr );

int columnCount( const QModelIndex &parent ) const override;
Expand Down
5 changes: 5 additions & 0 deletions src/gui/layout/qgslayoutaddpagesdialog.h
Expand Up @@ -29,14 +29,19 @@
#include "qgslayoutmeasurementconverter.h"

/**
* \ingroup gui
* A dialog for configuring properties of new pages to be added to a layout
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutAddPagesDialog : public QDialog, private Ui::QgsLayoutNewPageDialog
{
Q_OBJECT

public:

//! Page insertion positions
enum PagePosition
{
BeforePage,
Expand Down
11 changes: 8 additions & 3 deletions src/gui/layout/qgslayoutatlaswidget.h
Expand Up @@ -28,14 +28,19 @@ class QgsLayoutAtlas;
class QgsMessageBar;

/**
* \ingroup app
* A widget for layout atlas settings.
*/
* \ingroup gui
* Widget for configuring the properties of a layout atlas.
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutAtlasWidget: public QWidget, private Ui::QgsLayoutAtlasWidgetBase
{
Q_OBJECT
public:
//! Constructor
QgsLayoutAtlasWidget( QWidget *parent, QgsPrintLayout *layout );
//! Sets the message bar to which to emit messages
void setMessageBar( QgsMessageBar *bar );

private slots:
Expand Down
77 changes: 51 additions & 26 deletions src/gui/layout/qgslayoutattributeselectiondialog.h
Expand Up @@ -42,11 +42,13 @@ class QgsLayoutTableAvailableSortProxyModel;
class QgsLayoutObject;
class QgsLayoutTableColumn;

//QgsLayoutAttributeTableColumnModel

/**
* \ingroup gui
* A model for displaying columns shown in a QgsLayoutAttributeTable
*/
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutAttributeTableColumnModel: public QAbstractTableModel
{
Q_OBJECT
Expand Down Expand Up @@ -110,7 +112,6 @@ class GUI_EXPORT QgsLayoutAttributeTableColumnModel: public QAbstractTableModel
/**
* Sets a specified column as a sorted column in the QgsLayoutItemAttributeTable. The column will be
* added to the end of the sort rank list, ie it will take the next largest available sort rank.
* \see removeColumnFromSort()
* \see moveColumnInSortRank()
*/
void setColumnAsSorted( QgsLayoutTableColumn *column, Qt::SortOrder order );
Expand All @@ -133,12 +134,13 @@ class GUI_EXPORT QgsLayoutAttributeTableColumnModel: public QAbstractTableModel

};


//QgsLayoutTableSortColumnsProxyModel

/**
* \ingroup gui
* Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted
*/
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutTableSortColumnsProxyModel: public QSortFilterProxyModel
{
Q_OBJECT
Expand Down Expand Up @@ -209,14 +211,19 @@ class GUI_EXPORT QgsLayoutTableSortColumnsProxyModel: public QSortFilterProxyMod

};

// QgsLayoutColumnAlignmentDelegate

//! A delegate for showing column alignment as a combo box
/**
* \ingroup gui
* A delegate for showing column alignment as a combo box
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutColumnAlignmentDelegate : public QItemDelegate
{
Q_OBJECT

public:
//! constructor
explicit QgsLayoutColumnAlignmentDelegate( QObject *parent = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
Expand All @@ -225,36 +232,45 @@ class GUI_EXPORT QgsLayoutColumnAlignmentDelegate : public QItemDelegate

};


// QgsLayoutColumnSourceDelegate

//! A delegate for showing column attribute source as a QgsFieldExpressionWidget
/**
* \ingroup gui
* A delegate for showing column attribute source as a QgsFieldExpressionWidget
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutColumnSourceDelegate : public QItemDelegate, private QgsExpressionContextGenerator
{
Q_OBJECT

public:
//! constructor
QgsLayoutColumnSourceDelegate( QgsVectorLayer *vlayer, QObject *parent = nullptr, const QgsLayoutObject *layoutObject = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
public slots:
private slots:
void commitAndCloseEditor();
private:
QgsVectorLayer *mVectorLayer = nullptr;
const QgsLayoutObject *mLayoutObject = nullptr;
QgsExpressionContext createExpressionContext() const override;
};

// QgsLayoutColumnWidthDelegate

//! A delegate for showing column width as a spin box
/**
* \ingroup gui
* A delegate for showing column width as a spin box
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutColumnWidthDelegate : public QItemDelegate
{
Q_OBJECT

public:
//! constructor
explicit QgsLayoutColumnWidthDelegate( QObject *parent = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
Expand All @@ -263,15 +279,19 @@ class GUI_EXPORT QgsLayoutColumnWidthDelegate : public QItemDelegate

};


// QgsLayoutColumnSortOrderDelegate

//! A delegate for showing column sort order as a combo box
/**
* \ingroup gui
* A delegate for showing column sort order as a combo box
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutColumnSortOrderDelegate : public QItemDelegate
{
Q_OBJECT

public:
//! constructor
explicit QgsLayoutColumnSortOrderDelegate( QObject *parent = nullptr );
QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
void setEditorData( QWidget *editor, const QModelIndex &index ) const override;
Expand All @@ -281,13 +301,18 @@ class GUI_EXPORT QgsLayoutColumnSortOrderDelegate : public QItemDelegate
};


// QgsLayoutAttributeSelectionDialog

//! A dialog to select what attributes to display (in the table item), set the column properties and specify a sort order
/**
* \ingroup gui
* A dialog to select what attributes to display (in the table item), set the column properties and specify a sort order
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutAttributeSelectionDialog: public QDialog, private Ui::QgsLayoutAttributeSelectionDialogBase
{
Q_OBJECT
public:
//! constructor
QgsLayoutAttributeSelectionDialog( QgsLayoutItemAttributeTable *table, QgsVectorLayer *vLayer, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr );

private slots:
Expand Down
8 changes: 8 additions & 0 deletions src/gui/layout/qgslayoutattributetablewidget.h
Expand Up @@ -28,10 +28,18 @@
class QgsLayoutItemAttributeTable;
class QgsLayoutFrame;

/**
* \ingroup gui
* A widget for configuring layout attribute table items.
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutAttributeTableWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutAttributeTableWidgetBase
{
Q_OBJECT
public:
//! constructor
QgsLayoutAttributeTableWidget( QgsLayoutFrame *frame );

void setReportTypeString( const QString &string ) override;
Expand Down
25 changes: 24 additions & 1 deletion src/gui/layout/qgslayoutguidewidget.h
Expand Up @@ -30,10 +30,18 @@ class QgsLayoutView;
class QgsLayout;
class QgsLayoutGuideProxyModel;

/**
* \ingroup gui
* Widget for managing the layout guides
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutGuideWidget: public QgsPanelWidget, private Ui::QgsLayoutGuideWidgetBase
{
Q_OBJECT
public:
//! constructor
QgsLayoutGuideWidget( QWidget *parent, QgsLayout *layout, QgsLayoutView *layoutView );

public slots:
Expand Down Expand Up @@ -66,13 +74,20 @@ class GUI_EXPORT QgsLayoutGuideWidget: public QgsPanelWidget, private Ui::QgsLay

};


/**
* \ingroup gui
* View delegate displaying a QgsDoubleSpinBox for the layout guide position
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutGuidePositionDelegate : public QStyledItemDelegate
{
Q_OBJECT

public:

//! constructor
QgsLayoutGuidePositionDelegate( QObject *parent );

protected:
Expand All @@ -81,12 +96,20 @@ class GUI_EXPORT QgsLayoutGuidePositionDelegate : public QStyledItemDelegate

};

/**
* \ingroup gui
* View delegate displaying a QgsLayoutUnitsComboBox for the layout guide unit
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutGuideUnitDelegate : public QStyledItemDelegate
{
Q_OBJECT

public:

//! constructor
QgsLayoutGuideUnitDelegate( QObject *parent );

protected:
Expand Down
4 changes: 4 additions & 0 deletions src/gui/layout/qgslayoutguiutils.h
Expand Up @@ -24,7 +24,11 @@
class QgsMapCanvas;

/**
* \ingroup gui
* Utils for layout handling from app.
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutGuiUtils
{
Expand Down
11 changes: 8 additions & 3 deletions src/gui/layout/qgslayouthtmlwidget.h
Expand Up @@ -28,14 +28,19 @@ class QgsCodeEditorHTML;
class QgsCodeEditorCSS;

/**
* \ingroup app
* Input widget for the configuration of QgsLayoutItemHtml
*/
* \ingroup gui
* A widget for configuring layout html items.
*
* \note This class is not a part of public API
* \since QGIS 3.12
*/
class GUI_EXPORT QgsLayoutHtmlWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutHtmlWidgetBase
{
Q_OBJECT
public:
//! constructor
QgsLayoutHtmlWidget() = delete;
//! constructor
QgsLayoutHtmlWidget( QgsLayoutFrame *frame );
void setMasterLayout( QgsMasterLayoutInterface *masterLayout ) override;

Expand Down
3 changes: 3 additions & 0 deletions src/gui/layout/qgslayoutimageexportoptionsdialog.h
Expand Up @@ -27,7 +27,10 @@


/**
* \ingroup gui
* A dialog for customizing the properties of an exported image file.
*
* \note This class is not a part of public API
* \since QGIS 3.0
*/
class GUI_EXPORT QgsLayoutImageExportOptionsDialog: public QDialog, private Ui::QgsLayoutImageExportOptionsDialog
Expand Down

0 comments on commit 6e7009a

Please sign in to comment.