Skip to content

Commit 21a1d29

Browse files
committed
Fix building against Qt6
1 parent c5433e7 commit 21a1d29

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ include(AsteroidCMakeSettings)
1919

2020
set(ASTEROID_MODULES_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/asteroidapp/cmake)
2121

22-
find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS DBus Qml Quick Svg REQUIRED)
22+
find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS DBus Qml Quick Svg ShaderTools REQUIRED)
2323
if (WITH_ASTEROIDAPP)
24-
find_package(Mlite5 MODULE REQUIRED)
25-
find_package(Mapplauncherd_qt5 MODULE REQUIRED)
24+
find_package(Mlite6 MODULE REQUIRED)
25+
find_package(Mapplauncherd_qt6 MODULE REQUIRED)
2626
endif()
2727

2828
ecm_find_qmlmodule(QtQuick.VirtualKeyboard 2.1)

src/controls/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ add_custom_command(
6464
)
6565

6666
target_link_libraries(asteroidcontrolsplugin
67-
Qt5::Qml
68-
Qt5::Quick
69-
Qt5::Svg)
67+
Qt::Qml
68+
Qt::Quick
69+
Qt::Svg)
7070

7171
install(TARGETS asteroidcontrolsplugin
7272
DESTINATION ${INSTALL_QML_IMPORT_DIR}/org/asteroid/controls)

src/controls/src/icon.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <QPainter>
3333
#include <QIcon>
3434
#include <QSvgRenderer>
35+
#include <QFile>
3536

3637
#define ICONS_DIRECTORY "/usr/share/icons/asteroid/"
3738

@@ -79,9 +80,10 @@ void Icon::paint(QPainter *painter)
7980
painter->drawPixmap(0, 0, width(), height(), m_pixmap);
8081
}
8182

82-
void Icon::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
83+
84+
void Icon::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
8385
{
84-
QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry);
86+
QQuickPaintedItem::geometryChange(newGeometry, oldGeometry);
8587
if(newGeometry.size() == oldGeometry.size() || newGeometry.width() == 0 || newGeometry.height() == 0)
8688
return;
8789
updateBasePixmap();

src/controls/src/icon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Icon : public QQuickPaintedItem
5252

5353
void paint(QPainter *painter) override;
5454

55-
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
55+
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
5656

5757
signals:
5858
void nameChanged();

src/utils/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ set(HEADERS
1212
add_library(asteroidutilsplugin ${SRC} ${HEADERS})
1313

1414
target_link_libraries(asteroidutilsplugin
15-
Qt5::DBus
16-
Qt5::Qml
17-
Qt5::Quick)
15+
Qt::DBus
16+
Qt::Qml
17+
Qt::Quick)
1818

1919
install(TARGETS asteroidutilsplugin
2020
DESTINATION ${INSTALL_QML_IMPORT_DIR}/org/asteroid/utils)

src/utils/src/deviceinfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ DeviceInfo::DeviceInfo()
3535
QFile host(HOST_FILE);
3636
if (host.open(QIODevice::ReadOnly | QIODevice::Text)) {
3737
QTextStream in(&host);
38-
in.setCodec("UTF-8");
38+
in.setEncoding(QStringConverter::Utf8);
3939
m_hostname = in.readLine();
4040
host.close();
4141
}
4242

4343
QFile release(OS_RELEASE_FILE);
4444
if (release.open(QIODevice::ReadOnly | QIODevice::Text)) {
4545
QTextStream in(&release);
46-
in.setCodec("UTF-8");
46+
in.setEncoding(QStringConverter::Utf8);
4747
QString line = in.readLine();
4848
for (bool searching{true}; searching && !in.atEnd(); line = in.readLine()) {
4949
if (line.startsWith("BUILD_ID")) {

0 commit comments

Comments
 (0)