Implemented "Insert field" button.
This commit is contained in:
@@ -62,6 +62,7 @@ ObjectEditor::ObjectEditor( QWidget *parent )
|
||||
textColorButton->init( "Default", QColor(0,0,0,255), QColor(0,0,0,255) );
|
||||
shadowColorButton->init( "Default", QColor(0,0,0,255), QColor(0,0,0,255) );
|
||||
|
||||
textInsertFieldCombo->setName( "Insert Field" );
|
||||
imageFieldCombo->setName( "Key" );
|
||||
|
||||
setEnabled( false );
|
||||
@@ -420,6 +421,7 @@ void ObjectEditor::onMergeSourceChanged()
|
||||
QStringList keys = mModel->merge()->keys();
|
||||
lineColorButton->setKeys( keys );
|
||||
fillColorButton->setKeys( keys );
|
||||
textInsertFieldCombo->setKeys( keys );
|
||||
imageFieldCombo->setKeys( keys );
|
||||
shadowColorButton->setKeys( keys );
|
||||
}
|
||||
@@ -601,6 +603,12 @@ void ObjectEditor::onTextControlsChanged()
|
||||
}
|
||||
|
||||
|
||||
void ObjectEditor::onTextInsertFieldKeySelected( QString key )
|
||||
{
|
||||
textEdit->insertPlainText( "${" + key + "}" );
|
||||
}
|
||||
|
||||
|
||||
void ObjectEditor::onShadowControlsChanged()
|
||||
{
|
||||
if ( !mBlocked )
|
||||
|
||||
@@ -86,6 +86,7 @@ private slots:
|
||||
void onRectSizeControlsChanged();
|
||||
void onLineSizeControlsChanged();
|
||||
void onTextControlsChanged();
|
||||
void onTextInsertFieldKeySelected( QString key );
|
||||
void onShadowControlsChanged();
|
||||
void onChanged();
|
||||
|
||||
|
||||
+19
-22
@@ -486,11 +486,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="textInsertFieldButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="FieldButton" name="textInsertFieldCombo"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
@@ -1749,7 +1745,7 @@
|
||||
<slot>onTextControlsChanged()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>180</x>
|
||||
<x>173</x>
|
||||
<y>389</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
@@ -1758,22 +1754,6 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>textInsertFieldButton</sender>
|
||||
<signal>keySelected()</signal>
|
||||
<receiver>ObjectEditor</receiver>
|
||||
<slot>onChanged()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>215</x>
|
||||
<y>652</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>396</x>
|
||||
<y>638</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>barcodeTypeCombo</sender>
|
||||
<signal>currentIndexChanged(int)</signal>
|
||||
@@ -2190,6 +2170,22 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>textInsertFieldCombo</sender>
|
||||
<signal>keySelected(QString)</signal>
|
||||
<receiver>ObjectEditor</receiver>
|
||||
<slot>onTextInsertFieldKeySelected(QString)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>231</x>
|
||||
<y>653</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>395</x>
|
||||
<y>645</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>onChanged()</slot>
|
||||
@@ -2203,5 +2199,6 @@
|
||||
<slot>onImageFileButtonClicked()</slot>
|
||||
<slot>onImageKeySelected(QString)</slot>
|
||||
<slot>onTextControlsChanged()</slot>
|
||||
<slot>onTextInsertFieldKeySelected(QString)</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user