15 #ifndef QGSSYMBOLBUTTON_H
16 #define QGSSYMBOLBUTTON_H
21 #include <QToolButton>
45 Q_PROPERTY( QString dialogTitle READ dialogTitle WRITE setDialogTitle )
55 QSize minimumSizeHint()
const override;
56 QSize sizeHint()
const override;
76 void setDialogTitle(
const QString &title );
82 QString dialogTitle()
const;
100 SymbolType *symbolCastToType =
dynamic_cast<SymbolType *
>( tmpSymbol );
102 if ( symbolCastToType )
104 return symbolCastToType->
clone();
175 void setColor(
const QColor &color );
214 void changeEvent( QEvent *e )
override;
215 void showEvent( QShowEvent *e )
override;
216 void resizeEvent( QResizeEvent *event )
override;
219 void mousePressEvent( QMouseEvent *e )
override;
221 void mouseMoveEvent( QMouseEvent *e )
override;
222 void mouseReleaseEvent( QMouseEvent *e )
override;
223 void keyPressEvent( QKeyEvent *e )
override;
225 void dragEnterEvent( QDragEnterEvent *e )
override;
228 void dragLeaveEvent( QDragLeaveEvent *e )
override;
231 void dropEvent( QDropEvent *e )
override;
235 void showSettingsDialog();
236 void updateSymbolFromWidget();
244 void addRecentColor(
const QColor &color );
249 void activatePicker();
255 QString mDialogTitle;
262 QPoint mDragStartPosition;
264 QMenu *mMenu =
nullptr;
266 QPointer< QgsVectorLayer > mLayer;
270 std::unique_ptr< QgsSymbol > mSymbol;
274 bool mPickingColor =
false;
280 void updatePreview(
const QColor &color = QColor(),
QgsSymbol *tempSymbol =
nullptr );
291 bool colorFromMimeData(
const QMimeData *mimeData, QColor &resultColor,
bool &hasAlpha );
296 QPixmap createColorIcon(
const QColor &color )
const;
304 void stopPicking( QPoint eventPos,
bool samplingColor =
true );
306 void showColorDialog();
310 #endif // QGSSYMBOLBUTTON_H