QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgshistorywidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgshistorywidget.h
3 ------------------
4 Date : April 2023
5 Copyright : (C) 2023 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSHISTORYWIDGET_H
17#define QGSHISTORYWIDGET_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "ui_qgshistorywidgetbase.h"
22#include "qgspanelwidget.h"
24
25#include <QSortFilterProxyModel>
26
29class QgsMessageBar;
30
31#ifndef SIP_RUN
32
34class GUI_EXPORT QgsHistoryEntryProxyModel : public QSortFilterProxyModel
35{
36 Q_OBJECT
37 public:
38
39 QgsHistoryEntryProxyModel( QObject *parent = nullptr );
40
41 void setFilter( const QString &filter );
42 bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const override;
43
44 private:
45
46 QString mFilter;
47
48};
50#endif
51
57class GUI_EXPORT QgsHistoryWidget : public QgsPanelWidget, private Ui::QgsHistoryWidgetBase
58{
59 Q_OBJECT
60
61 public:
62
73 QgsHistoryWidget( const QString &providerId = QString(),
75 QgsHistoryProviderRegistry *registry = nullptr,
77 QWidget *parent = nullptr );
78
79 private slots:
80
81 void currentItemChanged( const QModelIndex &selected, const QModelIndex &previous );
82 void nodeDoubleClicked( const QModelIndex &index );
83 void showNodeContextMenu( const QPoint &pos );
84 void urlClicked( const QUrl &url );
85
86 private:
87
88 QgsHistoryEntryModel *mModel = nullptr;
89 QgsHistoryEntryProxyModel *mProxyModel = nullptr;
91
92};
93
94#endif // QGSHISTORYWIDGET_H
@ LocalProfile
Local profile.
QFlags< HistoryProviderBackend > HistoryProviderBackends
Definition qgis.h:3259
An item model representing history entries in a hierarchical tree structure.
The QgsHistoryProviderRegistry is a registry for objects which track user history (i....
Contains settings which reflect the context in which a history widget is shown, e....
A widget showing entries from a QgsHistoryProviderRegistry.
A bar for displaying non-blocking messages to the user.
Base class for any widget that can be shown as a inline panel.