QGIS API Documentation 3.41.0-Master (d5b93354e9c)
Loading...
Searching...
No Matches
qgsbrowserdockwidget_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsbrowserdockwidget_p.h
3
4 Private classes for QgsBrowserDockWidget
5
6 ---------------------
7 begin : May 2017
8 copyright : (C) 2017 by Alessandro Pasotti
9 real work done by : (C) 2011 by Martin Dobias
10 email : a dot pasotti at itopen dot it
11 ***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20
21#ifndef QGSBROWSERDOCKWIDGET_P_H
22#define QGSBROWSERDOCKWIDGET_P_H
23
25
26//
27// W A R N I N G
28// -------------
29//
30// This file is not part of the QGIS API. It exists purely as an
31// implementation detail. This header file may change from version to
32// version without notice, or even be removed.
33//
34
35#include <QSortFilterProxyModel>
36
37#include "ui_qgsbrowserlayerpropertiesbase.h"
38#include "ui_qgsbrowserdirectorypropertiesbase.h"
39#include "ui_qgsbrowserpropertiesdialogbase.h"
40
41#include "qgsbrowsertreeview.h"
42#include "qgsdockwidget.h"
44
46class QModelIndex;
47class QgsDockBrowserTreeView;
48class QgsLayerItem;
49class QgsDataItem;
51
52#define SIP_NO_FILE
53
57class QgsBrowserPropertiesWrapLabel : public QTextEdit
58{
59 Q_OBJECT
60 public:
66 QgsBrowserPropertiesWrapLabel( const QString &text, QWidget *parent = nullptr );
67
68 private slots:
69 void adjustHeight( QSizeF size );
70};
71
75class QgsBrowserPropertiesWidget : public QWidget
76{
77 Q_OBJECT
78 public:
83 explicit QgsBrowserPropertiesWidget( QWidget *parent = nullptr );
85 static QgsBrowserPropertiesWidget *createWidget( QgsDataItem *item, const QgsDataItemGuiContext &context, QWidget *parent = nullptr );
87 virtual void setItem( QgsDataItem *item ) { Q_UNUSED( item ); }
89 virtual void setWidget( QWidget *widget );
90
96 virtual void setCondensedMode( bool condensedMode ) { Q_UNUSED( condensedMode ) }
97};
98
102class QgsBrowserLayerProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserLayerPropertiesBase
103{
104 Q_OBJECT
105 public:
110 explicit QgsBrowserLayerProperties( QWidget *parent = nullptr );
112 void setItem( QgsDataItem *item ) override;
113
119 void setCondensedMode( bool condensedMode ) override;
120
121 private slots:
122
123 void urlClicked( const QUrl &url );
124
125 private:
126 void loadAttributeTable();
127
128 std::unique_ptr<QgsMapLayer> mLayer;
129 QgsAttributeTableFilterModel *mAttributeTableFilterModel = nullptr;
130};
131
135class QgsBrowserDirectoryProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserDirectoryPropertiesBase
136{
137 Q_OBJECT
138 public:
143 explicit QgsBrowserDirectoryProperties( QWidget *parent = nullptr );
144
146 void setItem( QgsDataItem *item ) override;
147
148 private:
149 QgsDirectoryParamWidget *mDirectoryWidget = nullptr;
150 QgsBrowserPropertiesWrapLabel *mPathLabel = nullptr;
151};
152
156class GUI_EXPORT QgsBrowserPropertiesDialog : public QDialog, private Ui::QgsBrowserPropertiesDialogBase
157{
158 Q_OBJECT
159 public:
165 QgsBrowserPropertiesDialog( const QString &settingsSection, QWidget *parent = nullptr );
166
168 void setItem( QgsDataItem *item, const QgsDataItemGuiContext &context );
169
170 private:
171 QgsBrowserPropertiesWidget *mPropertiesWidget = nullptr;
172 QString mSettingsSection;
173};
174
175
184class QgsDockBrowserTreeView : public QgsBrowserTreeView
185{
186 Q_OBJECT
187
188 public:
193 explicit QgsDockBrowserTreeView( QWidget *parent );
195 void dragEnterEvent( QDragEnterEvent *e ) override;
197 void dragMoveEvent( QDragMoveEvent *e ) override;
199 void dropEvent( QDropEvent *e ) override;
200
201 private:
202 void setAction( QDropEvent *e );
203};
204
206
207#endif // QGSBROWSERDOCKWIDGET_P_H
A model for showing available data sources and other items in a structured tree.
The QgsBrowserTreeView class extends QTreeView with save/restore tree state functionality.
Encapsulates the context in which a QgsDataItem is shown within the application GUI.
Base class for all items in the model.
Definition qgsdataitem.h:46
Browser parameter widget implementation for directory items.
Item that represents a layer that can be opened with one of the providers.