QGIS API Documentation  3.20.0-Odense (decaadbb31)
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_qgsbrowserdockwidgetbase.h"
38 #include "ui_qgsbrowserlayerpropertiesbase.h"
39 #include "ui_qgsbrowserdirectorypropertiesbase.h"
40 #include "ui_qgsbrowserpropertiesdialogbase.h"
41 
42 #include "qgsbrowsertreeview.h"
43 #include "qgsdockwidget.h"
44 #include "qgsdataitemguiprovider.h"
45 
46 class QgsBrowserGuiModel;
47 class QModelIndex;
48 class QgsDockBrowserTreeView;
49 class QgsLayerItem;
50 class QgsDataItem;
52 
53 #define SIP_NO_FILE
54 
58 class QgsBrowserPropertiesWrapLabel : public QTextEdit
59 {
60  Q_OBJECT
61  public:
62 
68  QgsBrowserPropertiesWrapLabel( const QString &text, QWidget *parent = nullptr );
69 
70  private slots:
71  void adjustHeight( QSizeF size );
72 };
73 
77 class QgsBrowserPropertiesWidget : public QWidget
78 {
79  Q_OBJECT
80  public:
81 
86  explicit QgsBrowserPropertiesWidget( QWidget *parent = nullptr );
88  static QgsBrowserPropertiesWidget *createWidget( QgsDataItem *item, const QgsDataItemGuiContext &context, QWidget *parent = nullptr );
90  virtual void setItem( QgsDataItem *item ) { Q_UNUSED( item ); }
92  virtual void setWidget( QWidget *widget );
93 
100  virtual void setCondensedMode( bool condensedMode ) { Q_UNUSED( condensedMode ) }
101 };
102 
106 class QgsBrowserLayerProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserLayerPropertiesBase
107 {
108  Q_OBJECT
109  public:
110 
115  explicit QgsBrowserLayerProperties( QWidget *parent = nullptr );
117  void setItem( QgsDataItem *item ) override;
118 
125  void setCondensedMode( bool condensedMode ) override;
126 
127  private slots:
128 
129  void urlClicked( const QUrl &url );
130 
131  private:
132 
133  void loadAttributeTable();
134 
135  std::unique_ptr<QgsMapLayer> mLayer;
136  QgsAttributeTableFilterModel *mAttributeTableFilterModel = nullptr;
137 
138 };
139 
143 class QgsBrowserDirectoryProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserDirectoryPropertiesBase
144 {
145  Q_OBJECT
146  public:
147 
152  explicit QgsBrowserDirectoryProperties( QWidget *parent = nullptr );
153 
155  void setItem( QgsDataItem *item ) override;
156  private:
157  QgsDirectoryParamWidget *mDirectoryWidget = nullptr;
158  QgsBrowserPropertiesWrapLabel *mPathLabel = nullptr;
159 };
160 
164 class GUI_EXPORT QgsBrowserPropertiesDialog : public QDialog, private Ui::QgsBrowserPropertiesDialogBase
165 {
166  Q_OBJECT
167  public:
168 
174  QgsBrowserPropertiesDialog( const QString &settingsSection, QWidget *parent = nullptr );
175 
177  void setItem( QgsDataItem *item, const QgsDataItemGuiContext &context );
178 
179  private:
180  QgsBrowserPropertiesWidget *mPropertiesWidget = nullptr;
181  QString mSettingsSection;
182 };
183 
184 
193 class QgsDockBrowserTreeView : public QgsBrowserTreeView
194 {
195  Q_OBJECT
196 
197  public:
198 
203  explicit QgsDockBrowserTreeView( QWidget *parent );
205  void dragEnterEvent( QDragEnterEvent *e ) override;
207  void dragMoveEvent( QDragMoveEvent *e ) override;
209  void dropEvent( QDropEvent *e ) override;
210 
211  private:
212  void setAction( QDropEvent *e );
213 };
214 
216 
217 #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.
Definition: qgslayeritem.h:30