15 #ifndef QGSFONTBUTTON_H 16 #define QGSFONTBUTTON_H 22 #include <QToolButton> 46 Q_PROPERTY(
Mode mode READ mode WRITE setMode )
47 Q_PROPERTY( QString dialogTitle READ dialogTitle WRITE setDialogTitle )
48 Q_PROPERTY( QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY changed )
49 Q_PROPERTY(
QgsTextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY changed )
69 QSize minimumSizeHint() const override;
70 QSize sizeHint() const override;
85 void setMode(
Mode mode );
91 void setDialogTitle( const QString &title );
97 QString dialogTitle() const;
124 QFont currentFont()
const;
141 void setCurrentFont(
const QFont &font );
148 void setColor(
const QColor &color );
187 bool event( QEvent *e )
override;
188 void changeEvent( QEvent *e )
override;
189 void showEvent( QShowEvent *e )
override;
190 void resizeEvent( QResizeEvent *event )
override;
193 void mousePressEvent( QMouseEvent *e )
override;
195 void mouseMoveEvent( QMouseEvent *e )
override;
198 void dragEnterEvent( QDragEnterEvent *e )
override;
201 void dragLeaveEvent( QDragLeaveEvent *e )
override;
204 void dropEvent( QDropEvent *e )
override;
206 void wheelEvent( QWheelEvent *event )
override;
210 void showSettingsDialog();
217 void addRecentColor(
const QColor &color );
223 Mode mMode = ModeTextRenderer;
225 QString mDialogTitle;
231 QPoint mDragStartPosition;
233 QMenu *mMenu =
nullptr;
244 bool formatFromMimeData(
const QMimeData *mimeData,
QgsTextFormat &resultFormat )
const;
254 bool fontFromMimeData(
const QMimeData *mimeData, QFont &resultFont )
const;
265 bool colorFromMimeData(
const QMimeData *mimeData, QColor &resultColor,
bool &hasAlpha );
270 QPixmap createColorIcon(
const QColor &color )
const;
275 QPixmap createDragIcon( QSize size = QSize( 50, 50 ),
const QgsTextFormat *tempFormat =
nullptr,
const QFont *tempFont =
nullptr )
const;
281 void updatePreview(
const QColor &color = QColor(),
QgsTextFormat *tempFormat =
nullptr, QFont *tempFont =
nullptr );
284 #endif // QGSFONTBUTTON_H
Map canvas is a class for displaying all GIS data types on a canvas.
Container for all settings relating to text rendering.