From 917f4fa7d6ac9d0183d70a3d44be66acf8f09da5 Mon Sep 17 00:00:00 2001 From: "G.K.MacGregor" Date: Fri, 12 Feb 2021 21:43:14 +0000 Subject: [PATCH] Prevent Level radio buttons stealing focus --- mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 67a644d..f474086 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -655,10 +655,10 @@ void MainWindow::createStatusBar() m_levelRadioButton[1] = new QRadioButton("1.5"); m_levelRadioButton[2] = new QRadioButton("2.5"); m_levelRadioButton[3] = new QRadioButton("3.5"); - statusBar()->addPermanentWidget(m_levelRadioButton[0]); - statusBar()->addPermanentWidget(m_levelRadioButton[1]); - statusBar()->addPermanentWidget(m_levelRadioButton[2]); - statusBar()->addPermanentWidget(m_levelRadioButton[3]); + for (int i=0; i<4; i++) { + m_levelRadioButton[i]->setFocusPolicy(Qt::NoFocus); + statusBar()->addPermanentWidget(m_levelRadioButton[i]); + } m_levelRadioButton[0]->toggle(); connect(m_levelRadioButton[0], &QAbstractButton::clicked, [=]() { m_textWidget->pageRender()->setRenderLevel(0); m_textWidget->update(); }); connect(m_levelRadioButton[1], &QAbstractButton::clicked, [=]() { m_textWidget->pageRender()->setRenderLevel(1); m_textWidget->update(); });