-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues preventing library from building with Qt 6
1. CMake instructions now handle both Qt 6 and Qt 5 2. Pass correct QString-like type to setWindowTitle 3. Remove qAsConst optimization to address deprecation warning
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
include_directories(${QtWidgets_INCLUDE_DIRS}) | ||
|
||
if(QT_USE_QTNETWORK) | ||
find_package(QtNetwork REQUIRED) | ||
list(APPEND QT_LIBRARIES Qt::Network) | ||
include_directories(${QtNetwork_INCLUDE_DIRS}) | ||
endif() | ||
|
||
if(QT_USE_QTXML) | ||
find_package(QtXml REQUIRED) | ||
list(APPEND QT_LIBRARIES Qt::Xml) | ||
include_directories(${QtXml_INCLUDE_DIRS}) | ||
endif() | ||
|
||
if(QT_USE_QTTEST) | ||
find_package(QtTest REQUIRED) | ||
list(APPEND QT_LIBRARIES Qt::Test) | ||
include_directories(${QtTest_INCLUDE_DIRS}) | ||
endif() | ||
|
||
macro(qt4_wrap_ui) | ||
qt_wrap_ui(${ARGN}) | ||
endmacro() | ||
|
||
macro(qt4_wrap_cpp) | ||
qt_wrap_cpp(${ARGN}) | ||
endmacro() | ||
|
||
macro(qt4_add_resources) | ||
qt_add_resources(${ARGN}) | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/**************************************************************************** | ||
** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected]. | ||
** Copyright (C) 2024 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected]. | ||
** All rights reserved. | ||
** | ||
** This file is part of the KD MacTouchBar library. | ||
|
@@ -34,7 +34,7 @@ | |
|
||
MainWindow::MainWindow() | ||
{ | ||
setWindowTitle("KDMacTouchBar Example"); | ||
setWindowTitle(tr("KDMacTouchBar Example")); | ||
resize(400, 200); | ||
|
||
// attach a touchbar to this window | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/**************************************************************************** | ||
** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected]. | ||
** Copyright (C) 2024 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected]. | ||
** All rights reserved. | ||
** | ||
** This file is part of the KD MacTouchBar library. | ||
|
@@ -49,7 +49,7 @@ | |
|
||
auto nsImage = [[[NSImage alloc] initWithSize:NSZeroSize] autorelease]; | ||
|
||
for (const auto& size : qAsConst(sizes)) { | ||
for (const auto& size : sizes) { | ||
const QImage qimage = icon.pixmap(size).toImage(); | ||
CGImageRef cgImage = qimage.toCGImage(); | ||
if (!cgImage) | ||
|