QGIS API Documentation 3.41.0-Master (57ec4277f5e)
Loading...
Searching...
No Matches
qgstablewidgetbase.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstablewidgetbase.h
3 --------------------------------------
4 Date : 09.2016
5 Copyright : (C) 2016 Patrick Valsecchi
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 QGSTABLEWIDGETBASE_H
17#define QGSTABLEWIDGETBASE_H
18
19#include "ui_qgstablewidgetuibase.h"
20#include <QAbstractTableModel>
21#include <QVariant>
22#include "qgis_gui.h"
23
32class GUI_EXPORT QgsTableWidgetBase : public QWidget, protected Ui::QgsTableWidgetUiBase
33{
34 Q_OBJECT
35 public:
39 explicit QgsTableWidgetBase( QWidget *parent );
40
47 bool isReadOnly() const { return mReadOnly; }
48
49 public slots:
50
57 virtual void setReadOnly( bool readOnly );
58
59 protected:
64 void init( QAbstractTableModel *model );
65
66 signals:
67
72
73 private slots:
74
78 void addButton_clicked();
79
83 void removeButton_clicked();
84
88 void onSelectionChanged();
89
90 private:
91 bool mReadOnly = false;
92
93 friend class TestQgsKeyValueWidget;
94 friend class TestQgsListWidget;
95};
96
97
98#endif // QGSTABLEWIDGETBASE_H
Base widget allowing to edit a collection, using a table.
bool isReadOnly() const
Returns true if the widget is shown in a read-only state.
void valueChanged()
Emitted each time a key or a value is changed.