QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgscolordialog.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgscolordialog.h - color selection dialog
3
4
---------------------
5
begin : March 19, 2013
6
copyright : (C) 2013 by Larry Shaffer
7
email : larrys at dakcarto dot com
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
17
#ifndef QGSCOLORDIALOG_H
18
#define QGSCOLORDIALOG_H
19
20
#include "ui_qgscolordialog.h"
21
22
#include "qgis_gui.h"
23
#include "
qgis_sip.h
"
24
#include "
qgsguiutils.h
"
25
26
#include <QColorDialog>
27
28
class
QColor;
29
38
39
class
GUI_EXPORT
QgsColorDialog
:
public
QDialog,
private
Ui::QgsColorDialogBase
40
{
41
Q_OBJECT
42
43
public
:
50
QgsColorDialog
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags,
const
QColor &
color
= QColor() );
51
56
QColor
color
()
const
;
57
62
void
setTitle
(
const
QString &title );
63
69
void
setAllowOpacity
(
bool
allowOpacity );
70
79
static
QColor
getColor
(
const
QColor &initialColor, QWidget *parent,
const
QString &title = QString(),
bool
allowOpacity =
false
);
80
81
signals:
82
87
void
currentColorChanged
(
const
QColor &
color
);
88
89
public
slots:
90
95
void
setColor
(
const
QColor &
color
);
96
97
protected
:
98
void
closeEvent
( QCloseEvent *e )
override
;
99
100
private
slots:
101
102
void
mButtonBox_accepted();
103
void
mButtonBox_rejected();
104
void
mButtonBox_clicked( QAbstractButton *button );
105
void
discardColor();
106
void
showHelp();
107
108
private
:
109
QColor mPreviousColor;
110
111
bool
mAllowOpacity =
true
;
112
};
113
114
#endif
// #ifndef QGSCOLORDIALOG_H
QgsColorDialog::color
QColor color() const
Returns the current color for the dialog.
Definition
qgscolordialog.cpp:70
QgsColorDialog::setColor
void setColor(const QColor &color)
Sets the current color for the dialog.
Definition
qgscolordialog.cpp:140
QgsColorDialog::currentColorChanged
void currentColorChanged(const QColor &color)
Emitted when the dialog's color changes.
QgsColorDialog::setAllowOpacity
void setAllowOpacity(bool allowOpacity)
Sets whether opacity modification (transparency) is permitted for the color dialog.
Definition
qgscolordialog.cpp:80
QgsColorDialog::closeEvent
void closeEvent(QCloseEvent *e) override
Definition
qgscolordialog.cpp:158
QgsColorDialog::getColor
static QColor getColor(const QColor &initialColor, QWidget *parent, const QString &title=QString(), bool allowOpacity=false)
Returns a color selection from a color dialog.
Definition
qgscolordialog.cpp:86
QgsColorDialog::QgsColorDialog
QgsColorDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, const QColor &color=QColor())
Create a new color picker dialog.
Definition
qgscolordialog.cpp:38
QgsColorDialog::setTitle
void setTitle(const QString &title)
Sets the title for the color dialog.
Definition
qgscolordialog.cpp:75
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgsguiutils.h
Generated on
for QGIS API Documentation by
1.17.0