diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2023-11-05 17:36:31.000000000 +0600
+++ b/CMakeLists.txt	2023-11-06 17:11:27.737912113 +0600
@@ -26,7 +26,7 @@
 set(CMAKE_AUTORCC ON)
 
 set(KF5_MINIMUM_VERSION "5.36.0")
-set(KF5SCREEN_MINIMUM_VERSION "5.27.0")
+set(KF5SCREEN_MINIMUM_VERSION "5.2.0")
 set(LXQT_MINIMUM_VERSION "1.4.0")
 set(QT_MINIMUM_VERSION "5.15.0")
 
diff -Naur a/lxqt-config-monitor/kscreenutils.cpp b/lxqt-config-monitor/kscreenutils.cpp
--- a/lxqt-config-monitor/kscreenutils.cpp	2023-11-05 17:36:31.000000000 +0600
+++ b/lxqt-config-monitor/kscreenutils.cpp	2023-11-06 17:21:02.617837963 +0600
@@ -63,7 +63,7 @@
         output->setPos(pos);
         output->setEnabled(true);
         //first left one as primary
-        output->setPriority(width == 0 ? 1 : 0);
+        output->setPrimary(width == 0);
         KScreen::ModePtr mode(output->currentMode());
         //if (!mode)
         {
diff -Naur a/lxqt-config-monitor/loadsettings.cpp b/lxqt-config-monitor/loadsettings.cpp
--- a/lxqt-config-monitor/loadsettings.cpp	2023-11-05 17:36:31.000000000 +0600
+++ b/lxqt-config-monitor/loadsettings.cpp	2023-11-06 17:22:22.123251231 +0600
@@ -133,7 +133,7 @@
                 if( !output->isConnected() )
                     continue;
                 output->setEnabled( monitor.enabled );
-                output->setPriority( monitor.primary ? 1 : 0 );
+                output->setPrimary( monitor.primary );
                 output->setPos( QPoint(monitor.xPos, monitor.yPos) );
                 output->setRotation( (KScreen::Output::Rotation)(monitor.rotation) );
                 // output->setCurrentModeId could fail. KScreen sometimes changes mode Id.
diff -Naur a/lxqt-config-monitor/monitorwidget.cpp b/lxqt-config-monitor/monitorwidget.cpp
--- a/lxqt-config-monitor/monitorwidget.cpp	2023-11-05 17:36:31.000000000 +0600
+++ b/lxqt-config-monitor/monitorwidget.cpp	2023-11-06 17:23:22.053808957 +0600
@@ -138,7 +138,7 @@
     if (config->connectedOutputs().count() == 1) {
         setOnlyMonitor(true);
         // There isn't always a primary output. Gross.
-        output->setPriority(1);
+        output->setPrimary(true);
     }
 
     ui.xPosSpinBox->setValue(output->pos().x());
@@ -208,7 +208,7 @@
     ui.xPosSpinBox->setVisible(idx == ExtendDisplay);
     ui.yPosSpinBox->setVisible(idx == ExtendDisplay);
 
-    output->setPriority(idx == PrimaryDisplay ? 1 : 0);
+    output->setPrimary(idx == PrimaryDisplay);
     if(idx == PrimaryDisplay)
         emit primaryOutputChanged(this);
 }
