mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Expose angle control for point text annotations in widget
This was supported by the annotation, but not exposed in the widget for some reason
This commit is contained in:
parent
bbb9c3d0ea
commit
eb2941fa6c
@ -321,6 +321,8 @@ QgsAnnotationPointTextItemWidget::QgsAnnotationPointTextItemWidget( QWidget *par
|
||||
|
||||
mTextEdit->setMaximumHeight( mTextEdit->fontMetrics().height() * 10 );
|
||||
|
||||
mSpinTextAngle->setClearValue( 0 );
|
||||
|
||||
mTextFormatWidget->setDockMode( dockMode() );
|
||||
connect( mTextFormatWidget, &QgsTextFormatWidget::widgetChanged, this, [ = ]
|
||||
{
|
||||
@ -338,6 +340,12 @@ QgsAnnotationPointTextItemWidget::QgsAnnotationPointTextItemWidget( QWidget *par
|
||||
if ( !mBlockChangedSignal )
|
||||
emit itemChanged();
|
||||
} );
|
||||
|
||||
connect( mSpinTextAngle, qOverload< double >( &QgsDoubleSpinBox::valueChanged ), this, [ = ]
|
||||
{
|
||||
if ( !mBlockChangedSignal )
|
||||
emit itemChanged();
|
||||
} );
|
||||
}
|
||||
|
||||
QgsAnnotationItem *QgsAnnotationPointTextItemWidget::createItem()
|
||||
@ -345,6 +353,7 @@ QgsAnnotationItem *QgsAnnotationPointTextItemWidget::createItem()
|
||||
QgsAnnotationPointTextItem *newItem = mItem->clone();
|
||||
newItem->setFormat( mTextFormatWidget->format() );
|
||||
newItem->setText( mTextEdit->toPlainText() );
|
||||
newItem->setAngle( mSpinTextAngle->value() );
|
||||
mPropertiesWidget->updateItem( newItem );
|
||||
return newItem;
|
||||
}
|
||||
@ -355,6 +364,7 @@ void QgsAnnotationPointTextItemWidget::updateItem( QgsAnnotationItem *item )
|
||||
{
|
||||
pointTextItem->setFormat( mTextFormatWidget->format() );
|
||||
pointTextItem->setText( mTextEdit->toPlainText() );
|
||||
pointTextItem->setAngle( mSpinTextAngle->value() );
|
||||
mPropertiesWidget->updateItem( pointTextItem );
|
||||
}
|
||||
}
|
||||
@ -393,6 +403,7 @@ bool QgsAnnotationPointTextItemWidget::setNewItem( QgsAnnotationItem *item )
|
||||
mBlockChangedSignal = true;
|
||||
mTextFormatWidget->setFormat( mItem->format() );
|
||||
mTextEdit->setPlainText( mItem->text() );
|
||||
mSpinTextAngle->setValue( mItem->angle() );
|
||||
mPropertiesWidget->setItem( mItem.get() );
|
||||
mBlockChangedSignal = false;
|
||||
|
||||
|
@ -26,6 +26,31 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="4" column="0">
|
||||
<widget class="QgsAnnotationItemCommonPropertiesWidget" name="mPropertiesWidget" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QToolButton" name="mInsertExpressionButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Insert/Edit Expression…</string>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::MenuButtonPopup</enum>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextOnly</enum>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::DownArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPlainTextEdit" name="mTextEdit">
|
||||
<property name="minimumSize">
|
||||
@ -36,34 +61,47 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QToolButton" name="mInsertExpressionButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Insert/Edit Expression…</string>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::MenuButtonPopup</enum>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextOnly</enum>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::DownArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QgsAnnotationItemCommonPropertiesWidget" name="mPropertiesWidget" native="true"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QWidget" name="mTextFormatWidgetContainer" native="true"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Rotation</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QgsDoubleSpinBox" name="mSpinTextAngle">
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> °</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-360.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>360.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Angle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
@ -73,6 +111,11 @@
|
||||
<header>qgsannotationitemcommonpropertieswidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsDoubleSpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>qgsdoublespinbox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user