GUI: add HistoryLineEdit support in LineEditDialog
This commit is contained in:
parent
5141ddce95
commit
c41d8b7b64
|
|
@ -71,7 +71,7 @@ void LineEditDialog::setCheckBoxText(const QString & text)
|
|||
ui->checkBox->setText(text);
|
||||
}
|
||||
|
||||
void LineEditDialog::on_textEdit_textChanged(const QString & arg1)
|
||||
void LineEditDialog::on_textEdit_textEdited(const QString & arg1)
|
||||
{
|
||||
editText = arg1;
|
||||
if(this->fixed_size != 0)
|
||||
|
|
@ -104,3 +104,16 @@ void LineEditDialog::setTextMaxLength(int length)
|
|||
{
|
||||
ui->textEdit->setMaxLength(length);
|
||||
}
|
||||
|
||||
void LineEditDialog::on_buttonOk_clicked()
|
||||
{
|
||||
ui->textEdit->addLineToHistory(editText);
|
||||
ui->textEdit->setText("");
|
||||
accept();
|
||||
}
|
||||
|
||||
void LineEditDialog::on_buttonCancel_clicked()
|
||||
{
|
||||
ui->textEdit->setText("");
|
||||
close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,10 @@ public:
|
|||
void selectAllText();
|
||||
|
||||
private slots:
|
||||
void on_textEdit_textChanged(const QString & arg1);
|
||||
void on_textEdit_textEdited(const QString & arg1);
|
||||
void on_checkBox_toggled(bool checked);
|
||||
void on_buttonOk_clicked();
|
||||
void on_buttonCancel_clicked();
|
||||
|
||||
private:
|
||||
Ui::LineEditDialog* ui;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="textEdit"/>
|
||||
<widget class="HistoryLineEdit" name="textEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
|
|
@ -81,41 +81,15 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>HistoryLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>HistoryLineEdit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../resource.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonOk</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>LineEditDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>243</x>
|
||||
<y>49</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>150</x>
|
||||
<y>57</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonCancel</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>LineEditDialog</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>320</x>
|
||||
<y>51</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>150</x>
|
||||
<y>41</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
|||
Loading…
Reference in New Issue