QGIS API Documentation 3.99.0-Master (18a1e75d814)
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 "ui_qgsbrowserdirectorypropertiesbase.h"
36#include "ui_qgsbrowserlayerpropertiesbase.h"
37#include "ui_qgsbrowserpropertiesdialogbase.h"
38
39#include "qgsbrowsertreeview.h"
41#include "qgsdockwidget.h"
42
43#include <QSortFilterProxyModel>
44
45#define SIP_NO_FILE
46
48class QModelIndex;
49class QgsDockBrowserTreeView;
50class QgsLayerItem;
51class QgsDataItem;
53
54
58class QgsBrowserPropertiesWrapLabel : public QTextEdit
59{
60 Q_OBJECT
61 public:
67 QgsBrowserPropertiesWrapLabel( const QString &text, QWidget *parent = nullptr );
68
69 private slots:
70 void adjustHeight( QSizeF size );
71};
72
76class QgsBrowserPropertiesWidget : public QWidget
77{
78 Q_OBJECT
79 public:
84 explicit QgsBrowserPropertiesWidget( QWidget *parent = nullptr );
86 static QgsBrowserPropertiesWidget *createWidget( QgsDataItem *item, const QgsDataItemGuiContext &context, QWidget *parent = nullptr );
88 virtual void setItem( QgsDataItem *item ) { Q_UNUSED( item ); }
90 virtual void setWidget( QWidget *widget );
91
97 virtual void setCondensedMode( bool condensedMode ) { Q_UNUSED( condensedMode ) }
98};
99
103class QgsBrowserLayerProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserLayerPropertiesBase
104{
105 Q_OBJECT
106 public:
111 explicit QgsBrowserLayerProperties( QWidget *parent = nullptr );
113 void setItem( QgsDataItem *item ) override;
114
120 void setCondensedMode( bool condensedMode ) override;
121
122 private slots:
123
124 void urlClicked( const QUrl &url );
125
126 private:
127 void loadAttributeTable();
128
129 std::unique_ptr<QgsMapLayer> mLayer;
130 QgsAttributeTableFilterModel *mAttributeTableFilterModel = nullptr;
131};
132
136class QgsBrowserDirectoryProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserDirectoryPropertiesBase
137{
138 Q_OBJECT
139 public:
144 explicit QgsBrowserDirectoryProperties( QWidget *parent = nullptr );
145
147 void setItem( QgsDataItem *item ) override;
148
149 private:
150 QgsDirectoryParamWidget *mDirectoryWidget = nullptr;
151 QgsBrowserPropertiesWrapLabel *mPathLabel = nullptr;
152};
153
157class GUI_EXPORT QgsBrowserPropertiesDialog : public QDialog, private Ui::QgsBrowserPropertiesDialogBase
158{
159 Q_OBJECT
160 public:
166 QgsBrowserPropertiesDialog( const QString &settingsSection, QWidget *parent = nullptr );
167
169 void setItem( QgsDataItem *item, const QgsDataItemGuiContext &context );
170
171 private:
172 QgsBrowserPropertiesWidget *mPropertiesWidget = nullptr;
173 QString mSettingsSection;
174};
175
176
185class QgsDockBrowserTreeView : public QgsBrowserTreeView
186{
187 Q_OBJECT
188
189 public:
194 explicit QgsDockBrowserTreeView( QWidget *parent );
196 void dragEnterEvent( QDragEnterEvent *e ) override;
198 void dragMoveEvent( QDragMoveEvent *e ) override;
200 void dropEvent( QDropEvent *e ) override;
201
202 private:
203 void setAction( QDropEvent *e );
204};
205
207
208#endif // QGSBROWSERDOCKWIDGET_P_H
A model for showing available data sources and other items in a structured tree.
Extends QTreeView with save/restore tree state and other browser-specific functionality.
Base class for all items in the model.
Definition qgsdataitem.h:50
Browser parameter widget implementation for directory items.
A browser item that represents a layer that can be opened with one of the providers.