QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 "qgsdataitem.h"
43 #include "qgsbrowsertreeview.h"
44 #include "qgsdockwidget.h"
45 #include "qgsdataitemguiprovider.h"
46 
47 class QgsBrowserGuiModel;
48 class QModelIndex;
49 class QgsDockBrowserTreeView;
50 class QgsLayerItem;
51 class QgsDataItem;
53 
54 #define SIP_NO_FILE
55 
59 class QgsBrowserPropertiesWrapLabel : public QTextEdit
60 {
61  Q_OBJECT
62  public:
63 
69  QgsBrowserPropertiesWrapLabel( const QString &text, QWidget *parent = nullptr );
70 
71  private slots:
72  void adjustHeight( QSizeF size );
73 };
74 
78 class QgsBrowserPropertiesWidget : public QWidget
79 {
80  Q_OBJECT
81  public:
82 
87  explicit QgsBrowserPropertiesWidget( QWidget *parent = nullptr );
89  static QgsBrowserPropertiesWidget *createWidget( QgsDataItem *item, const QgsDataItemGuiContext &context, QWidget *parent = nullptr );
91  virtual void setItem( QgsDataItem *item ) { Q_UNUSED( item ); }
93  virtual void setWidget( QWidget *widget );
94 
101  virtual void setCondensedMode( bool condensedMode ) { Q_UNUSED( condensedMode ) }
102 };
103 
107 class QgsBrowserLayerProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserLayerPropertiesBase
108 {
109  Q_OBJECT
110  public:
111 
116  explicit QgsBrowserLayerProperties( QWidget *parent = nullptr );
118  void setItem( QgsDataItem *item ) override;
119 
126  void setCondensedMode( bool condensedMode ) override;
127 
128  private slots:
129 
130  void urlClicked( const QUrl &url );
131 
132  private:
133 
134  void loadAttributeTable();
135 
136  std::unique_ptr<QgsMapLayer> mLayer;
137  QgsAttributeTableFilterModel *mAttributeTableFilterModel = nullptr;
138 
139 };
140 
144 class QgsBrowserDirectoryProperties : public QgsBrowserPropertiesWidget, private Ui::QgsBrowserDirectoryPropertiesBase
145 {
146  Q_OBJECT
147  public:
148 
153  explicit QgsBrowserDirectoryProperties( QWidget *parent = nullptr );
154 
156  void setItem( QgsDataItem *item ) override;
157  private:
158  QgsDirectoryParamWidget *mDirectoryWidget = nullptr;
159  QgsBrowserPropertiesWrapLabel *mPathLabel = nullptr;
160 };
161 
165 class GUI_EXPORT QgsBrowserPropertiesDialog : public QDialog, private Ui::QgsBrowserPropertiesDialogBase
166 {
167  Q_OBJECT
168  public:
169 
175  QgsBrowserPropertiesDialog( const QString &settingsSection, QWidget *parent = nullptr );
176 
178  void setItem( QgsDataItem *item, const QgsDataItemGuiContext &context );
179 
180  private:
181  QgsBrowserPropertiesWidget *mPropertiesWidget = nullptr;
182  QString mSettingsSection;
183 };
184 
185 
194 class QgsDockBrowserTreeView : public QgsBrowserTreeView
195 {
196  Q_OBJECT
197 
198  public:
199 
204  explicit QgsDockBrowserTreeView( QWidget *parent );
206  void dragEnterEvent( QDragEnterEvent *e ) override;
208  void dragMoveEvent( QDragMoveEvent *e ) override;
210  void dropEvent( QDropEvent *e ) override;
211 
212  private:
213  void setAction( QDropEvent *e );
214 };
215 
217 
218 #endif // QGSBROWSERDOCKWIDGET_P_H
The QgsBrowserTreeView class extends QTreeView with save/restore tree state functionality.
A model for showing available data sources and other items in a structured tree.
Base class for all items in the model.
Definition: qgsdataitem.h:49
Encapsulates the context in which a QgsDataItem is shown within the application GUI.
TODO: move to qgis_gui for QGIS 4.
Definition: qgsdataitem.h:702
Item that represents a layer that can be opened with one of the providers.
Definition: qgsdataitem.h:452