Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create a model for QgsHistoryEntries
A dynamic tree item model showing the entries in date groupings
  • Loading branch information
nyalldawson committed Apr 22, 2023
1 parent dee7605 commit a71671c
Show file tree
Hide file tree
Showing 6 changed files with 757 additions and 28 deletions.
68 changes: 68 additions & 0 deletions python/gui/auto_generated/history/qgshistoryentrymodel.sip.in
@@ -0,0 +1,68 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/history/qgshistoryentrymodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsHistoryEntryModel : QAbstractItemModel
{
%Docstring(signature="appended")
An item model representing history entries in a hierarchical tree structure.

.. versionadded:: 3.32
%End

%TypeHeaderCode
#include "qgshistoryentrymodel.h"
%End
public:

QgsHistoryEntryModel( const QString &providerId = QString(),
Qgis::HistoryProviderBackends backends = Qgis::HistoryProviderBackend::LocalProfile,
QgsHistoryProviderRegistry *registry = 0,
QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsHistoryEntryModel, with the specified ``parent`` object.

If ``providerId`` is specified then the model will contain only items from the matching
history provider.
If ``backends`` is specified then the model will be filtered to only matching backends.

If no ``registry`` is specified then the singleton :py:class:`QgsHistoryProviderRegistry` from :py:func:`QgsGui.historyProviderRegistry()`
will be used.
%End

~QgsHistoryEntryModel();

int rowCount( const QModelIndex &parent = QModelIndex() ) const final;
int columnCount( const QModelIndex &parent = QModelIndex() ) const final;
QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const final;
QModelIndex parent( const QModelIndex &child ) const final;
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;

virtual Qt::ItemFlags flags( const QModelIndex &index ) const;


QgsHistoryEntryNode *index2node( const QModelIndex &index ) const;
%Docstring
Returns node for given index. Returns root node for invalid index.
%End

};




/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/history/qgshistoryentrymodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -342,6 +342,7 @@
%Include auto_generated/effects/qgspainteffectwidget.sip
%Include auto_generated/elevation/qgselevationprofilecanvas.sip
%Include auto_generated/history/qgshistoryentry.sip
%Include auto_generated/history/qgshistoryentrymodel.sip
%Include auto_generated/history/qgshistoryentrynode.sip
%Include auto_generated/history/qgshistoryprovider.sip
%Include auto_generated/history/qgshistoryproviderregistry.sip
Expand Down
2 changes: 2 additions & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -237,6 +237,7 @@ set(QGIS_GUI_SRCS
elevation/qgselevationprofilelayertreeview.cpp

history/qgshistoryentry.cpp
history/qgshistoryentrymodel.cpp
history/qgshistoryentrynode.cpp
history/qgshistoryprovider.cpp
history/qgshistoryproviderregistry.cpp
Expand Down Expand Up @@ -1145,6 +1146,7 @@ set(QGIS_GUI_HDRS
elevation/qgselevationprofilelayertreeview.h

history/qgshistoryentry.h
history/qgshistoryentrymodel.h
history/qgshistoryentrynode.h
history/qgshistoryprovider.h
history/qgshistoryproviderregistry.h
Expand Down

0 comments on commit a71671c

Please sign in to comment.