QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
symbology
qgscptcitycolorrampdialog.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgscptcitycolorrampdialog.h
3
---------------------
4
begin : July 2012
5
copyright : (C) 2012 by Etienne Tourigny
6
email : etourigny dot dev at gmail.com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSCPTCITYCOLORRAMPDIALOG_H
17
#define QGSCPTCITYCOLORRAMPDIALOG_H
18
19
20
#include "ui_qgscptcitycolorrampdialogbase.h"
21
22
#include "qgis_gui.h"
23
#include "
qgis_sip.h
"
24
#include "
qgscptcityarchive.h
"
25
26
#include <QAbstractProxyModel>
27
#include <QDialog>
28
#include <QFileInfo>
29
#include <QSortFilterProxyModel>
30
31
class
QgsCptCityColorRamp
;
32
class
TreeFilterProxyModel;
33
class
ListFilterProxyModel;
34
class
UngroupProxyModel;
35
41
class
GUI_EXPORT
QgsCptCityColorRampDialog
:
public
QDialog,
private
Ui::QgsCptCityColorRampDialogBase
42
{
43
Q_OBJECT
44
Q_PROPERTY(
QgsCptCityColorRamp
ramp
READ
ramp
WRITE
setRamp
)
45
46
public
:
52
QgsCptCityColorRampDialog
(
const
QgsCptCityColorRamp
&
ramp
, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
53
58
QgsCptCityColorRamp
ramp
()
const
{
return
mRamp; }
59
65
void
setRamp(
const
QgsCptCityColorRamp
&ramp );
66
70
QString
selectedName
()
const
{
return
QFileInfo( mRamp.schemeName() ).baseName() + mRamp.variantName(); }
71
75
bool
saveAsGradientRamp()
const
;
76
81
QDialogButtonBox *buttonBox()
const
;
82
83
bool
eventFilter( QObject *obj, QEvent *event )
override
;
84
85
signals:
86
88
void
changed
();
89
90
private
slots:
91
void
populateVariants();
92
93
void
mTreeView_clicked(
const
QModelIndex & );
94
void
mListWidget_itemClicked( QListWidgetItem *item );
95
void
mListWidget_itemSelectionChanged();
96
void
tabBar_currentChanged(
int
index );
97
void
pbtnLicenseDetails_pressed();
98
void
cboVariantName_currentIndexChanged(
int
index );
99
void
onFinished();
100
void
showHelp();
101
/* void refresh(); */
102
103
private
:
104
void
updateUi();
105
void
updatePreview(
bool
clear =
false
);
106
void
clearCopyingInfo();
107
void
updateCopyingInfo(
const
QMap<QString, QString> ©ingMap );
108
void
updateTreeView(
QgsCptCityDataItem
*item,
bool
resetRamp =
true
);
109
void
updateListWidget(
QgsCptCityDataItem
*item );
110
111
QgsCptCityColorRamp
mRamp;
112
QgsCptCityArchive
*mArchive =
nullptr
;
113
QgsCptCityBrowserModel::ViewType
mArchiveViewType =
QgsCptCityBrowserModel::Selections
;
114
115
/* void refreshModel( const QModelIndex& index ); */
116
bool
updateRamp();
117
void
showAll();
118
void
setTreeModel(
QgsCptCityBrowserModel
*model );
119
120
QgsCptCityBrowserModel
*mModel =
nullptr
;
121
QgsCptCityBrowserModel
*mAuthorsModel =
nullptr
;
122
QgsCptCityBrowserModel
*mSelectionsModel =
nullptr
;
123
TreeFilterProxyModel *mTreeFilter =
nullptr
;
124
QVector<QgsCptCityColorRampItem *> mListRamps;
125
};
126
127
#ifndef SIP_RUN
129
134
class
TreeFilterProxyModel :
public
QSortFilterProxyModel
135
{
136
Q_OBJECT
137
138
public
:
139
TreeFilterProxyModel( QObject *parent,
QgsCptCityBrowserModel
*model );
140
141
protected
:
142
bool
filterAcceptsRow(
int
sourceRow,
const
QModelIndex &sourceParent )
const override
;
143
// bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
144
145
private
:
146
QgsCptCityBrowserModel
*mModel =
nullptr
;
147
};
148
150
#endif
151
152
#endif
QgsCptCityArchive
Represents a CPT City color scheme.
Definition
qgscptcityarchive.h:42
QgsCptCityBrowserModel
A custom item model for display of CPT City color palettes.
Definition
qgscptcityarchive.h:397
QgsCptCityBrowserModel::ViewType
ViewType
Definition
qgscptcityarchive.h:402
QgsCptCityBrowserModel::Selections
@ Selections
Definition
qgscptcityarchive.h:404
QgsCptCityColorRampDialog::QgsCptCityColorRampDialog
QgsCptCityColorRampDialog(const QgsCptCityColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsCptCityColorRampDialog.
Definition
qgscptcitycolorrampdialog.cpp:45
QgsCptCityColorRampDialog::ramp
QgsCptCityColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
Definition
qgscptcitycolorrampdialog.h:58
QgsCptCityColorRampDialog::setRamp
void setRamp(const QgsCptCityColorRamp &ramp)
Sets the color ramp to show in the dialog.
Definition
qgscptcitycolorrampdialog.cpp:136
QgsCptCityColorRampDialog::ramp
QgsCptCityColorRamp ramp
Definition
qgscptcitycolorrampdialog.h:44
QgsCptCityColorRampDialog::changed
void changed()
Emitted when the dialog settings change.
QgsCptCityColorRampDialog::selectedName
QString selectedName() const
Returns the name of the ramp currently selected in the dialog.
Definition
qgscptcitycolorrampdialog.h:70
QgsCptCityColorRamp
A color ramp from the CPT City collection.
Definition
qgscolorrampimpl.h:711
QgsCptCityDataItem
Base class for all items in a QgsCptCityBrowserModel model.
Definition
qgscptcityarchive.h:102
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgscptcityarchive.h
Generated on
for QGIS API Documentation by
1.17.0