2017-05-01 13:35:13 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgscolordialog.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-08 14:22:27 -07:00
|
|
|
|
2014-09-11 22:50:03 +10:00
|
|
|
|
2016-08-06 13:24:36 +10:00
|
|
|
class QgsColorDialog : QDialog
|
2014-09-11 22:50:03 +10:00
|
|
|
{
|
2017-05-01 13:35:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
A custom QGIS dialog for selecting a color. Has many improvements over the standard Qt color picker dialog, including
|
|
|
|
hue wheel supports, color swatches, and a color sampler.
|
|
|
|
|
2017-05-01 13:35:13 +02:00
|
|
|
.. versionadded:: 2.5
|
2014-09-11 22:50:03 +10:00
|
|
|
%End
|
|
|
|
|
2017-05-01 13:35:13 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscolordialog.h"
|
|
|
|
%End
|
2014-09-11 22:50:03 +10:00
|
|
|
public:
|
|
|
|
|
2017-05-07 20:58:28 +10:00
|
|
|
QgsColorDialog( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags,
|
2017-05-01 13:35:13 +02:00
|
|
|
const QColor &color = QColor() );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Create a new color picker dialog
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param parent: parent widget
|
|
|
|
:param fl: window flags
|
|
|
|
:param color: initial color for dialog
|
2017-05-01 13:35:13 +02:00
|
|
|
%End
|
2014-09-11 22:50:03 +10:00
|
|
|
|
|
|
|
QColor color() const;
|
2017-05-01 13:35:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current color for the dialog
|
|
|
|
|
|
|
|
:return: dialog color
|
2017-05-01 13:35:13 +02:00
|
|
|
%End
|
2014-09-11 22:50:03 +10:00
|
|
|
|
2017-05-01 13:35:13 +02:00
|
|
|
void setTitle( const QString &title );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the title for the color dialog
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param title: title for dialog box
|
2017-05-01 13:35:13 +02:00
|
|
|
%End
|
2014-09-11 22:50:03 +10:00
|
|
|
|
2017-05-30 13:33:09 +10:00
|
|
|
void setAllowOpacity( const bool allowOpacity );
|
2017-05-01 13:35:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether opacity modification (transparency) is permitted
|
|
|
|
for the color dialog. Defaults to true.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param allowOpacity: set to false to disable opacity modification
|
|
|
|
|
2017-05-30 13:33:09 +10:00
|
|
|
.. versionadded:: 3.0
|
2017-05-01 13:35:13 +02:00
|
|
|
%End
|
2014-09-11 22:50:03 +10:00
|
|
|
|
|
|
|
static QColor getColor( const QColor &initialColor, QWidget *parent, const QString &title = QString(),
|
2017-05-30 13:33:09 +10:00
|
|
|
const bool allowOpacity = false );
|
2017-05-01 13:35:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return a color selection from a color dialog.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param initialColor: the initial color of the selection dialog.
|
|
|
|
:param parent: parent widget
|
|
|
|
:param title: the title of the dialog.
|
|
|
|
:param allowOpacity: set to true to allow modification of color opacity value (transparency)
|
|
|
|
|
|
|
|
:return: Selected color on accepted() or initialColor on rejected().
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`getLiveColor`
|
2017-05-01 13:35:13 +02:00
|
|
|
%End
|
2014-09-11 22:50:03 +10:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
void currentColorChanged( const QColor &color );
|
2017-05-01 13:35:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the dialog's color changes
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param color: current color
|
2017-05-01 13:35:13 +02:00
|
|
|
%End
|
2014-09-11 22:50:03 +10:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2014-11-20 14:17:51 +01:00
|
|
|
void setColor( const QColor &color );
|
2017-05-01 13:35:13 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the current color for the dialog
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param color: desired color
|
2017-05-01 13:35:13 +02:00
|
|
|
%End
|
2014-11-13 23:13:13 +01:00
|
|
|
|
2014-09-11 22:50:03 +10:00
|
|
|
protected:
|
|
|
|
|
2017-05-01 13:35:13 +02:00
|
|
|
virtual void closeEvent( QCloseEvent *e );
|
|
|
|
|
2014-09-11 22:50:03 +10:00
|
|
|
|
|
|
|
};
|
2017-05-01 13:35:13 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgscolordialog.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|