mirror of
https://github.com/qgis/QGIS.git
synced 2025-06-19 00:02:48 -04:00
Add QgsTextFormatPanelWidget for text format control inside panel
This commit is contained in:
parent
8fa8167d7b
commit
f6a344c2c1
@ -119,3 +119,36 @@ class QgsTextFormatDialog : QDialog
|
||||
*/
|
||||
QgsTextFormat format() const;
|
||||
};
|
||||
|
||||
/** \class QgsTextFormatPanelWidget
|
||||
* \ingroup gui
|
||||
* A panel widget for customising text formatting settings.
|
||||
*
|
||||
* QgsTextFormatPanelWidget provides a panel widget for controlling the appearance of text rendered
|
||||
* using QgsTextRenderer. The dialog includes all settings contained within
|
||||
* a QgsTextFormat, including shadow, background and buffer.
|
||||
*
|
||||
* @note Added in QGIS 3.0
|
||||
*/
|
||||
|
||||
class QgsTextFormatPanelWidget : QgsPanelWidgetWrapper
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgstextformatwidget.h>
|
||||
%End
|
||||
public:
|
||||
|
||||
/** Constructor for QgsTextFormatPanelWidget.
|
||||
* @param format initial format settings to show in dialog
|
||||
* @param mapCanvas optional associated map canvas
|
||||
* @param parent parent widget
|
||||
*/
|
||||
QgsTextFormatPanelWidget( const QgsTextFormat& format, QgsMapCanvas* mapCanvas = nullptr, QWidget* parent /TransferThis/ = nullptr );
|
||||
|
||||
/** Returns the current formatting settings defined by the widget.
|
||||
*/
|
||||
QgsTextFormat format() const;
|
||||
|
||||
virtual void setDockMode( bool dockMode );
|
||||
|
||||
};
|
||||
|
@ -1413,3 +1413,21 @@ QgsTextFormat QgsTextFormatDialog::format() const
|
||||
{
|
||||
return mFormatWidget->format();
|
||||
}
|
||||
|
||||
QgsTextFormatPanelWidget::QgsTextFormatPanelWidget( const QgsTextFormat& format, QgsMapCanvas* mapCanvas, QWidget* parent )
|
||||
: QgsPanelWidgetWrapper( new QgsTextFormatWidget( format, mapCanvas ), parent )
|
||||
{
|
||||
mFormatWidget = qobject_cast< QgsTextFormatWidget* >( widget() );
|
||||
connect( mFormatWidget, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
|
||||
}
|
||||
|
||||
QgsTextFormat QgsTextFormatPanelWidget::format() const
|
||||
{
|
||||
return mFormatWidget->format();
|
||||
}
|
||||
|
||||
void QgsTextFormatPanelWidget::setDockMode( bool dockMode )
|
||||
{
|
||||
mFormatWidget->setDockMode( dockMode );
|
||||
QgsPanelWidgetWrapper::setDockMode( dockMode );
|
||||
}
|
||||
|
@ -231,6 +231,41 @@ class GUI_EXPORT QgsTextFormatDialog : public QDialog
|
||||
QgsTextFormatWidget* mFormatWidget;
|
||||
};
|
||||
|
||||
/** \class QgsTextFormatPanelWidget
|
||||
* \ingroup gui
|
||||
* A panel widget for customising text formatting settings.
|
||||
*
|
||||
* QgsTextFormatPanelWidget provides a panel widget for controlling the appearance of text rendered
|
||||
* using QgsTextRenderer. The dialog includes all settings contained within
|
||||
* a QgsTextFormat, including shadow, background and buffer.
|
||||
*
|
||||
* @note Added in QGIS 3.0
|
||||
*/
|
||||
|
||||
class GUI_EXPORT QgsTextFormatPanelWidget : public QgsPanelWidgetWrapper
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
/** Constructor for QgsTextFormatPanelWidget.
|
||||
* @param format initial format settings to show in dialog
|
||||
* @param mapCanvas optional associated map canvas
|
||||
* @param parent parent widget
|
||||
*/
|
||||
QgsTextFormatPanelWidget( const QgsTextFormat& format, QgsMapCanvas* mapCanvas = nullptr, QWidget* parent = nullptr );
|
||||
|
||||
/** Returns the current formatting settings defined by the widget.
|
||||
*/
|
||||
QgsTextFormat format() const;
|
||||
|
||||
virtual void setDockMode( bool dockMode ) override;
|
||||
|
||||
private:
|
||||
|
||||
QgsTextFormatWidget* mFormatWidget;
|
||||
};
|
||||
|
||||
#endif //QGSTEXTFORMATWIDGET_H
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user