From a447dd552b29c4aa9c4fa28c8087dcb9cca774fe Mon Sep 17 00:00:00 2001 From: Iwbnwif Yiw Date: Sun, 4 Feb 2024 23:08:29 +0000 Subject: [PATCH] Persist geometry of ComponentDialog --- qucs/components/componentdialog.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qucs/components/componentdialog.cpp b/qucs/components/componentdialog.cpp index c1d35342b..46dd24053 100644 --- a/qucs/components/componentdialog.cpp +++ b/qucs/components/componentdialog.cpp @@ -41,7 +41,9 @@ ComponentDialog::ComponentDialog(Component *c, Schematic *d) : QDialog(d) { - resize(450, 250); + QSettings settings("qucs","qucs_s"); + restoreGeometry(settings.value("ComponentDialog/geometry").toByteArray()); + setWindowTitle(tr("Edit Component Properties")); Comp = c; Doc = d; @@ -469,7 +471,7 @@ ComponentDialog::ComponentDialog(Component *c, Schematic *d) prop->setCurrentItem(prop->item(0,0)); slotSelectProperty(prop->item(0,0)); } - + /// \todo add key up/down browse and select prop connect(prop, SIGNAL(itemClicked(QTableWidgetItem*)), @@ -826,6 +828,9 @@ void ComponentDialog::slotApplyState(int State) // Is called if the "OK"-button is pressed. void ComponentDialog::slotButtOK() { + QSettings settings("qucs","qucs_s"); + settings.setValue("ComponentDialog/geometry", saveGeometry()); + slotApplyInput(); slotButtCancel(); }