Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.8.0
-
None
-
Macbook Pro
Description
My objective is to modify the window's 'title bar' to be 'transparent' and allow the content to occupy the space of the 'title bar'. The code(mentioned below) that I've used to achieve my objective works as expected in Qt 5.15.13 but does not function properly in Qt 6.8.0.
This is a blocker in the process of migrating our app from Qt5 to Qt6.
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect( &engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); QQuickWindow* _rootwin = static_cast<QQuickWindow*>(engine.rootObjects().constFirst()); NSView *nativeView = reinterpret_cast<NSView *>(_rootwin->winId()); NSWindow* nativeWindow = [nativeView _rootwin]; [nativeWindow setStyleMask:[nativeWindow styleMask] | NSWindowStyleMaskFullSizeContentView]; [nativeWindow setTitlebarAppearsTransparent:YES];