Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
KGoldrunner
Commits
c657a953
Commit
c657a953
authored
Dec 30, 2021
by
Laurent Montel
Browse files
Adapt build system + fix compile against qt6
parent
8cfeadfc
Pipeline
#116026
passed with stage
in 46 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
c657a953
...
...
@@ -9,7 +9,7 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project
(
kgoldrunner VERSION
${
RELEASE_SERVICE_VERSION
}
)
set
(
QT_MIN_VERSION
"5.15.0"
)
set
(
KF5_MIN_VERSION
"5.
85
.0"
)
set
(
KF5_MIN_VERSION
"5.
90
.0"
)
find_package
(
ECM
${
KF5_MIN_VERSION
}
REQUIRED CONFIG
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
ECM_MODULE_PATH
}
)
...
...
@@ -24,7 +24,9 @@ include(ECMQtDeclareLoggingCategory)
include
(
ECMSetupVersion
)
include
(
FeatureSummary
)
find_package
(
Qt5
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Gui Widgets
)
find_package
(
Qt
${
QT_MAJOR_VERSION
}
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Gui Widgets
)
find_package
(
Qt
${
QT_MAJOR_VERSION
}
QuickWidgets
${
REQUIRED_QT_VERSION
}
CONFIG
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED COMPONENTS
Config
ConfigWidgets
...
...
src/kgoldrunner.cpp
View file @
c657a953
...
...
@@ -10,11 +10,12 @@
#include
<QAction>
#include
<QApplication>
#include
<QDesktopWidget>
#include
<QIcon>
#include
<QKeyEvent>
#include
<QKeySequence>
#include
<QShortcut>
#include
<QActionGroup>
#include
<QScreen>
#include
<KActionCollection>
#include
<KConfig>
...
...
@@ -71,11 +72,12 @@ KGoldrunner::KGoldrunner()
/************************ SET PLAYFIELD AND GAME DATA ***********************/
/******************************************************************************/
const
QSize
maxSize
=
screen
()
->
availableGeometry
().
size
();
// Base the size of playing-area and widgets on the monitor resolution.
int
dw
=
QApplication
::
desktop
()
->
width
();
int
dw
=
maxSize
.
width
();
// Need to consider the height, for widescreen displays (eg. 1280x768).
int
dh
=
QApplication
::
desktop
()
->
height
();
int
dh
=
maxSize
.
height
();
dw
=
qMin
((
4
*
dh
+
1
)
/
3
,
dw
);
// KGoldrunner aspect ratio is 4:3.
dh
=
(
3
*
dw
+
2
)
/
4
;
...
...
src/kgrgame.cpp
View file @
c657a953
...
...
@@ -1567,7 +1567,11 @@ bool KGrGame::selectSavedGame (int & selectedGame, int & selectedLevel)
}
if
(
index
>=
0
)
{
selectedGame
=
index
;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
selectedLevel
=
loadedData
.
midRef
(
28
,
3
).
toInt
();
#else
selectedLevel
=
QStringView
(
loadedData
).
mid
(
28
,
3
).
toInt
();
#endif
result
=
true
;
}
else
{
...
...
src/kgrselector.cpp
View file @
c657a953
...
...
@@ -12,9 +12,9 @@
#include
"kgrgameio.h"
#include
<QApplication>
#include
<QDesktopWidget>
#include
<QGridLayout>
#include
<QHeaderView>
#include
<QScreen>
#include
<QLabel>
#include
<QPainter>
#include
<QPushButton>
...
...
@@ -224,8 +224,8 @@ void KGrSLDialog::setupWidgets()
// Avoid spilling into the Taskbar or Apple Dock area if they get too close.
// Otherwise allow the dialog to choose its size and then be resizeable.
const
Q
Rect
avail
=
QApplication
::
desktop
()
->
availableGeometry
(
this
);
if
((
avail
.
height
()
-
slParent
->
height
())
<=
120
)
{
const
Q
Size
maxSize
=
screen
()
->
availableGeometry
(
).
size
(
);
if
((
maxSize
.
height
()
-
slParent
->
height
())
<=
120
)
{
dad
->
setFixedHeight
(
slParent
->
height
()
-
120
);
// Keep 120 for buttons.
}
...
...
src/main.cpp
View file @
c657a953
...
...
@@ -23,7 +23,9 @@ static void addCredits (KAboutData & about);
int
main
(
int
argc
,
char
**
argv
)
{
// Fixes blurry icons with fractional scaling
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication
::
setAttribute
(
Qt
::
AA_UseHighDpiPixmaps
);
#endif
QApplication
app
(
argc
,
argv
);
KLocalizedString
::
setApplicationDomain
(
"kgoldrunner"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment