From cd67e8ddd70e9799c665976421605ae28f32b23e Mon Sep 17 00:00:00 2001 From: Carl Philipp Klemm Date: Mon, 13 Oct 2025 15:47:44 +0200 Subject: [PATCH] Add text edit to hold the output of the python script --- mainwindow.cpp | 6 +++++- mainwindow.h | 1 + mainwindow.ui | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 89f86a3..efef4b8 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -13,6 +13,7 @@ MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow), codeEditor(this), + pythonOutput(this), currentFilePath(""), isFileModified(false) { @@ -27,7 +28,10 @@ MainWindow::MainWindow(QWidget *parent): font.setStyleHint(QFont::TypeWriter); codeEditor.setFont(font); - ui->codeLayout->addWidget(&codeEditor); + ui->codeLayout->addWidget(&codeEditor, 1); + + pythonOutput.setReadOnly(true); + ui->codeLayout->addWidget(&pythonOutput); // Set up keyboard shortcuts ui->actionOpen->setShortcut(QKeySequence::Open); diff --git a/mainwindow.h b/mainwindow.h index 70bbc2f..ec96f0a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -26,6 +26,7 @@ class MainWindow : public QMainWindow QCodeEditor codeEditor; QPythonHighlighter highligter; QPythonCompleter completer; + QTextEdit pythonOutput; signals: void channelStateChanged(uint16_t device, uint16_t channel); diff --git a/mainwindow.ui b/mainwindow.ui index fbf1285..d32da49 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -59,8 +59,8 @@ 0 0 - 595 - 537 + 591 + 533