Skip to content
Permalink
Browse files

Move QgsColorButton::createMenuIcon to public API, make static

  • Loading branch information
nyalldawson committed Jan 11, 2019
1 parent 938adb8 commit 79d01a9b94de74ccf4ae44bc28888dfee414b1d3
Showing with 20 additions and 8 deletions.
  1. +10 −0 python/gui/auto_generated/qgscolorbutton.sip.in
  2. +10 −8 src/gui/qgscolorbutton.h
@@ -303,6 +303,16 @@ that are shown in the button's drop-down menu.
swatch grids are hidden from the button's drop-down menu.

.. seealso:: :py:func:`setColorSchemeRegistry`
%End

static QPixmap createMenuIcon( const QColor &color, bool showChecks = true );
%Docstring
Creates an icon for displaying a ``color`` in a drop-down menu.

If ``showChecks`` set to true, then a checkboard pattern will be shown behind
semi-transparent colors.

.. versionadded:: 3.6
%End

public slots:
@@ -271,6 +271,16 @@ class GUI_EXPORT QgsColorButton : public QToolButton
*/
QgsColorSchemeRegistry *colorSchemeRegistry() { return mColorSchemeRegistry; }

/**
* Creates an icon for displaying a \a color in a drop-down menu.
*
* If \a showChecks set to true, then a checkboard pattern will be shown behind
* semi-transparent colors.
*
* \since QGIS 3.6
*/
static QPixmap createMenuIcon( const QColor &color, bool showChecks = true );

public slots:

/**
@@ -448,14 +458,6 @@ class GUI_EXPORT QgsColorButton : public QToolButton
*/
void stopPicking( QPoint eventPos, bool samplingColor = true );

/**
* Create a color icon for display in the drop-down menu
* \param color for icon
* \param showChecks set to true to display a checkboard pattern behind
* transparent colors
*/
QPixmap createMenuIcon( const QColor &color, bool showChecks = true );

private slots:

void buttonClicked();

0 comments on commit 79d01a9

Please sign in to comment.
You can’t perform that action at this time.