Skip to content

Commit 5432b0b

Browse files
committed
Fix Qt5 build.
1 parent 9797772 commit 5432b0b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

SerialPrograms/Source/CommonFramework/Windows/MainWindow.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ MainWindow::MainWindow(QWidget* parent)
9797
m_sleep_box = new QCheckBox("Force On", support_box);
9898
layout->addWidget(m_sleep_box, 1, Qt::AlignHCenter);
9999
sleep_suppress_state_changed(SystemSleepController::instance().current_state());
100+
#if QT_VERSION < 0x060700
101+
connect(
102+
m_sleep_box, &QCheckBox::stateChanged,
103+
this, [this](int){
104+
if (m_sleep_box->isChecked()){
105+
m_sleep_scope.reset(new SleepSuppressScope(SleepSuppress::SCREEN_ON));
106+
}else{
107+
m_sleep_scope.reset();
108+
}
109+
}
110+
);
111+
#else
100112
connect(
101113
m_sleep_box, &QCheckBox::checkStateChanged,
102114
this, [this](Qt::CheckState state){
@@ -107,6 +119,7 @@ MainWindow::MainWindow(QWidget* parent)
107119
}
108120
}
109121
);
122+
#endif
110123
}
111124

112125
QHBoxLayout* support = new QHBoxLayout();

0 commit comments

Comments
 (0)