15 #ifndef QGSFONTBUTTON_H
16 #define QGSFONTBUTTON_H
22 #include <QToolButton>
51 Q_PROPERTY(
Mode mode READ mode WRITE setMode )
52 Q_PROPERTY( QString dialogTitle READ dialogTitle WRITE setDialogTitle )
53 Q_PROPERTY( QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY changed )
54 Q_PROPERTY(
QgsTextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY changed )
74 QSize minimumSizeHint()
const override;
75 QSize sizeHint()
const override;
90 void setMode( Mode mode );
96 void setDialogTitle(
const QString &title );
102 QString dialogTitle()
const;
144 QFont currentFont()
const;
224 void setToNullFormat();
231 void setCurrentFont(
const QFont &font );
238 void setColor(
const QColor &color );
277 bool event( QEvent *e )
override;
278 void changeEvent( QEvent *e )
override;
279 void showEvent( QShowEvent *e )
override;
280 void resizeEvent( QResizeEvent *event )
override;
283 void mousePressEvent( QMouseEvent *e )
override;
285 void mouseMoveEvent( QMouseEvent *e )
override;
288 void dragEnterEvent( QDragEnterEvent *e )
override;
291 void dragLeaveEvent( QDragLeaveEvent *e )
override;
294 void dropEvent( QDropEvent *e )
override;
296 void wheelEvent( QWheelEvent *event )
override;
300 void showSettingsDialog();
307 void addRecentColor(
const QColor &color );
313 Mode mMode = ModeTextRenderer;
315 QString mDialogTitle;
322 QPoint mDragStartPosition;
324 QMenu *mMenu =
nullptr;
326 QPointer< QgsVectorLayer > mLayer;
332 bool mShowNoFormat =
false;
333 QString mNullFormatString;
334 QPointer< QAction > mNullFormatAction;
335 QPointer< QgsTextFormatPanelWidget > mActivePanel;
344 bool formatFromMimeData(
const QMimeData *mimeData,
QgsTextFormat &resultFormat )
const;
354 bool fontFromMimeData(
const QMimeData *mimeData, QFont &resultFont )
const;
365 bool colorFromMimeData(
const QMimeData *mimeData, QColor &resultColor,
bool &hasAlpha );
370 QPixmap createColorIcon(
const QColor &color )
const;
375 QPixmap createDragIcon( QSize size = QSize( 50, 50 ),
const QgsTextFormat *tempFormat =
nullptr,
const QFont *tempFont =
nullptr )
const;
381 void updatePreview(
const QColor &color = QColor(),
QgsTextFormat *tempFormat =
nullptr, QFont *tempFont =
nullptr );
Abstract interface for generating an expression context.
Map canvas is a class for displaying all GIS data types on a canvas.
A bar for displaying non-blocking messages to the user.
A panel widget for customizing text formatting settings.
Container for all settings relating to text rendering.
Represents a vector layer which manages a vector based data sets.