-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgsbrowser.h
84 lines (68 loc) · 2.56 KB
/
qgsbrowser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/***************************************************************************
qgsbrowser.h - Data sources browser
-------------------
begin : 2011-04-01
copyright : (C) 2011 Radim Blazek
email : radim dot blazek at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSBROWSER_H
#define QGSBROWSER_H
#include <QMainWindow>
#include <QMap>
#include <QModelIndex>
#include "ui_qgsbrowserbase.h"
class QgsBrowserModel;
class QgsLayerItem;
class QgsMapLayer;
class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase
{
Q_OBJECT
public:
QgsBrowser( QWidget *parent = 0, Qt::WindowFlags flags = 0 );
~QgsBrowser();
// Expand to given path
void expandPath( QString path );
void setLayer( QgsVectorLayer* vLayer );
public slots:
void itemClicked( const QModelIndex& index );
void itemDoubleClicked( const QModelIndex& index );
void on_mActionSetProjection_triggered();
void on_mActionWmsConnections_triggered();
void on_mActionRefresh_triggered();
void newVectorLayer();
void saveWindowState();
void restoreWindowState();
void tabChanged();
void updateCurrentTab();
void stopRendering();
// Refresh all leaf or expanded items
void refresh( const QModelIndex& index = QModelIndex() );
protected:
void keyPressEvent( QKeyEvent * e ) override;
void keyReleaseEvent( QKeyEvent * e ) override;
bool layerClicked( QgsLayerItem* ptr );
enum Tab
{
Metadata,
Preview,
Attributes
};
Tab activeTab();
bool mDirtyMetadata, mDirtyPreview, mDirtyAttributes;
QgsBrowserModel* mModel;
QgsMapLayer *mLayer;
QModelIndex mIndex;
QWidget *mParamWidget;
// last (selected) tab for each
QMap<QString, int> mLastTab;
QgsAttributeTableFilterModel* mAttributeTableFilterModel;
};
#endif // QGSBROWSER_H