Implemented "Insert field" button.

This commit is contained in:
Jim Evins
2016-12-31 18:02:56 -05:00
parent aa11fcc4e6
commit d5508a2862
3 changed files with 30 additions and 24 deletions
+9 -1
View File
@@ -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 );
}
@@ -501,7 +503,7 @@ void ObjectEditor::onImageFileButtonClicked()
}
void ObjectEditor::onImageKeySelected(QString key )
void ObjectEditor::onImageKeySelected( QString key )
{
qDebug() << "Key = " << key;
}
@@ -601,6 +603,12 @@ void ObjectEditor::onTextControlsChanged()
}
void ObjectEditor::onTextInsertFieldKeySelected( QString key )
{
textEdit->insertPlainText( "${" + key + "}" );
}
void ObjectEditor::onShadowControlsChanged()
{
if ( !mBlocked )
+2 -1
View File
@@ -81,11 +81,12 @@ private slots:
void onLineControlsChanged();
void onFillControlsChanged();
void onImageFileButtonClicked();
void onImageKeySelected(QString key );
void onImageKeySelected( QString key );
void onPositionControlsChanged();
void onRectSizeControlsChanged();
void onLineSizeControlsChanged();
void onTextControlsChanged();
void onTextInsertFieldKeySelected( QString key );
void onShadowControlsChanged();
void onChanged();
+19 -22
View File
@@ -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>