Skip to content

Commit

Permalink
Fix touch bar on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Dec 1, 2024
1 parent 0e022df commit 31f2feb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions plugins/MacIntegration/mainwindowtouchbar-objc.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ @interface MainWindowTouchBarProvider: NSResponder <NSTouchBarDelegate, NSApplic

@property (strong) NSObject *qtDelegate;
@property QObject *parentQObject;
@property QWidget *mainWindow;
@property QQuickWindow *mainWindow;
//@property Ui::MainWindow *mainWindowUi;
@property QList<TouchBarItemPtr> touchBarActionMapping;

Expand All @@ -53,7 +53,7 @@ @interface MainWindowTouchBarProvider: NSResponder <NSTouchBarDelegate, NSApplic

@implementation MainWindowTouchBarProvider

- (id)init: (QWidget*)mainWin {
- (id)init: (QQuickWindow*)mainWin {
if (self = [super init]) {
self.parentQObject = new QObject();

Expand Down
2 changes: 1 addition & 1 deletion plugins/MacIntegration/mainwindowtouchbar.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "mainwindowtouchbar.h"
#include "mainwindowtouchbar_p.h"

MainWindowTouchBar::MainWindowTouchBar(QWidget *parent) : QObject(parent)
MainWindowTouchBar::MainWindowTouchBar(QQuickWindow *parent) : QObject(parent)
{
d = new MainWindowTouchBarPrivate();
d->parentWidget = parent;
Expand Down
9 changes: 4 additions & 5 deletions plugins/MacIntegration/mainwindowtouchbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#define MAINWINDOWTOUCHBAR_H

#include <QObject>
#include <QQuickWindow>

struct MainWindowTouchBarPrivate;
class MainWindowTouchBar : public QObject
{
Q_OBJECT
class MainWindowTouchBar : public QObject {
Q_OBJECT
public:
explicit MainWindowTouchBar(QWidget *parent = nullptr);
explicit MainWindowTouchBar(QQuickWindow* parent = nullptr);
~MainWindowTouchBar();

signals:
Expand All @@ -17,7 +17,6 @@ class MainWindowTouchBar : public QObject
MainWindowTouchBarPrivate* d;

void setupTouchBar();

};

#endif // MAINWINDOWTOUCHBAR_H
4 changes: 2 additions & 2 deletions plugins/MacIntegration/mainwindowtouchbar_p.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef MAINWINDOWTOUCHBAR_P_H
#define MAINWINDOWTOUCHBAR_P_H

#include <QWidget>
#include <QQuickWindow>

struct MainWindowTouchBarPrivate {
QWidget* parentWidget;
QQuickWindow* parentWidget;
};

#endif // MAINWINDOWTOUCHBAR_P_H

0 comments on commit 31f2feb

Please sign in to comment.