Skip to content

Commit

Permalink
MacOS Qt6 updates (#410)
Browse files Browse the repository at this point in the history
* OSX: Fix issue where QKeyCombination cannot be recast as int on QT6 only

* OSX: Fix issue where 'QString *' and 'const QString' cannot be compared

* OSX: In Qt6 OpenGL calls are now in their own Qt module QtOpenGL

* OSX: modify MacDockSettings, MacMainSettings, MacFloatSettings, and MacDesktopSettings to use Non-Qt Class translation in Qt6
  • Loading branch information
jhoyt4 committed Nov 8, 2021
1 parent b50f8b1 commit fc08305
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputca.cpp
Expand Up @@ -575,7 +575,7 @@ AudioDeviceID CoreAudioData::GetDeviceWithName(const QString &deviceName)
if (device.GetTotalOutputChannels() == 0)
continue;
QString *name = device.GetName();
if (name && name == deviceName)
if (name && *name == deviceName)
{
Debug(QString("GetDeviceWithName: Found: %1").arg(*name));
deviceID = pDevices[dev];
Expand Down
6 changes: 6 additions & 0 deletions mythtv/libs/libmythtv/libmythtv.pro
Expand Up @@ -88,6 +88,12 @@ macx {
}

LIBS += -liconv

# Qt6 moved QtGui to use metal, link in QtOpenGL until migrated fully to
# Metal per https://doc.qt.io/qt-6/opengl-changes-qt6.html
equals(QT_MAJOR_VERSION, 6) {
QT += opengl
}
}

cygwin:QMAKE_LFLAGS_SHLIB += -Wl,--noinhibit-exec
Expand Down
5 changes: 4 additions & 1 deletion mythtv/libs/libmythui/devices/AppleRemoteListener.cpp
Expand Up @@ -57,8 +57,11 @@ void AppleRemoteListener::appleRemoteButton(AppleRemote::Event button,
QKeySequence a(code);
for (int i = 0; i < a.count(); i++)
{
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
int keycode = a[i];

#else
int keycode = a[i].toCombined();
#endif
if (pressedDown)
QCoreApplication::postEvent(mainWindow, new LircKeycodeEvent(
QEvent::KeyPress, keycode, Qt::NoModifier, code, code));
Expand Down
17 changes: 16 additions & 1 deletion mythtv/programs/mythfrontend/globalsettings.h
Expand Up @@ -74,15 +74,22 @@ class ChannelGroupSettings
#if CONFIG_DARWIN
class MacMainSettings : public GroupSetting
{
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
Q_OBJECT

#else
Q_DECLARE_TR_FUNCTIONS(MacMainSettings);
#endif
public:
MacMainSettings();
};

class MacFloatSettings : public GroupSetting
{
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
Q_OBJECT
#else
Q_DECLARE_TR_FUNCTIONS(MacFloatSettings);
#endif

public:
MacFloatSettings();
Expand All @@ -91,7 +98,11 @@ class MacFloatSettings : public GroupSetting

class MacDockSettings : public GroupSetting
{
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
Q_OBJECT
#else
Q_DECLARE_TR_FUNCTIONS(MacDockSettings);
#endif

public:
MacDockSettings();
Expand All @@ -100,7 +111,11 @@ class MacDockSettings : public GroupSetting

class MacDesktopSettings : public GroupSetting
{
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
Q_OBJECT
#else
Q_DECLARE_TR_FUNCTIONS(MacDesktopSettings);
#endif

public:
MacDesktopSettings();
Expand Down

0 comments on commit fc08305

Please sign in to comment.