Changeset View
Changeset View
Standalone View
Standalone View
kmplot/equationeditor.cpp
Show All 34 Lines | 34 | { | |||
---|---|---|---|---|---|
35 | m_widget = new EquationEditorWidget(this); | 35 | m_widget = new EquationEditorWidget(this); | ||
36 | m_widget->edit->showEditButton(false); | 36 | m_widget->edit->showEditButton(false); | ||
37 | m_widget->edit->m_equationEditWidget->setClearSelectionOnFocusOut(false); | 37 | m_widget->edit->m_equationEditWidget->setClearSelectionOnFocusOut(false); | ||
38 | m_widget->layout()->setMargin(0); | 38 | m_widget->layout()->setMargin(0); | ||
39 | 39 | | |||
40 | setWindowTitle(i18n("Equation Editor")); | 40 | setWindowTitle(i18n("Equation Editor")); | ||
41 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); | 41 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); | ||
42 | connect(buttonBox, &QDialogButtonBox::rejected, this, &EquationEditor::reject); | 42 | connect(buttonBox, &QDialogButtonBox::rejected, this, &EquationEditor::reject); | ||
43 | m_widget->layout()->addWidget(buttonBox); | 43 | QVBoxLayout *dialogLayout = new QVBoxLayout (this); | ||
44 | dialogLayout->addWidget (m_widget); | ||||
45 | dialogLayout->addWidget (buttonBox); | ||||
44 | 46 | | |||
45 | connect(m_widget->edit, &EquationEdit::returnPressed, this, &EquationEditor::accept); | 47 | connect(m_widget->edit, &EquationEdit::returnPressed, this, &EquationEditor::accept); | ||
46 | } | 48 | } | ||
47 | 49 | | |||
48 | 50 | | |||
49 | QString EquationEditor::text() const { | 51 | QString EquationEditor::text() const { | ||
50 | return m_widget->edit->text(); | 52 | return m_widget->edit->text(); | ||
51 | } | 53 | } | ||
52 | 54 | | |||
53 | 55 | | |||
54 | EquationEdit* EquationEditor::edit() const { | 56 | EquationEdit* EquationEditor::edit() const { | ||
55 | return m_widget->edit; | 57 | return m_widget->edit; | ||
56 | } | 58 | } |