Can qwidget show on top of anoter app when that app is in fullscreen mode on Mac OS?
-
wrote on 12 May 2022, 02:07 last edited by pengxu
Can qwidget show on top of anoter app when that app is in fullscreen mode on Mac OS?
-
Hi,
It's going to depend on the OS and the application.
Which are they ?
-
wrote on 12 May 2022, 21:33 last edited by JoeCFD 5 Dec 2022, 21:34
Yes, you can. Set its parent to nullptr and the flag to on top. This works on Linux.
-
@JoeCFD
like this?
QWidget* test = new QWidget();
test->setWindowFlag(Qt::WindowStaysOnTopHint);
test->show();It does not work on Mac, when other app at fullscreen state
wrote on 13 May 2022, 13:30 last edited by JoeCFD@pengxu said in Can qwidget show on top of anoter app when that app is in fullscreen mode on Mac OS?:
Qt::WindowStaysOnTopHint
Try to create a window and set the flags as below to see if it works. Do not use qwidget.
setWindowFlags(Qt::CustomizeWindowHint
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint);Sure, as mpergand suggested, you can try qdialog as well.
Or something like subwindow? not sure. Never used it.
https://localcoder.org/notification-window-in-mac-with-or-without-qt#solution_1If nothing works, add overlay widget to the fullscreen widget and use the full screen widget as parent. this will work.
-
A full screen application on macOS is not the same thing as one on Windows or Linux. It moves to its own "desktop" and thus other applications are not working on the same space.
What exactly are you trying to do with your application ?
-
A full screen application on macOS is not the same thing as one on Windows or Linux. It moves to its own "desktop" and thus other applications are not working on the same space.
What exactly are you trying to do with your application ?
wrote on 16 May 2022, 02:33 last edited by@SGaist
My application has an function "sharing screen", there is toolbar on top of screen that users can try to stop sharing. Even when user is using other apps on fullscreen mode.
I can achieve this by using objective-c code, but I don't know how to achieve this by Qt -
@pengxu said in Can qwidget show on top of anoter app when that app is in fullscreen mode on Mac OS?:
Qt::WindowStaysOnTopHint
Try to create a window and set the flags as below to see if it works. Do not use qwidget.
setWindowFlags(Qt::CustomizeWindowHint
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint);Sure, as mpergand suggested, you can try qdialog as well.
Or something like subwindow? not sure. Never used it.
https://localcoder.org/notification-window-in-mac-with-or-without-qt#solution_1If nothing works, add overlay widget to the fullscreen widget and use the full screen widget as parent. this will work.
wrote on 16 May 2022, 05:48 last edited by@JoeCFD
I tried this, but it does not work either
QDialog* test = new QDialog();
// test->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool | Qt::FramelessWindowHint);
test->setWindowFlags(Qt::CustomizeWindowHint
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint);
test->show(); -
Since it's macOS specific, nothing wrong with mixing some Objective-C++ to achieve your objective.
-
@SGaist
My application has an function "sharing screen", there is toolbar on top of screen that users can try to stop sharing. Even when user is using other apps on fullscreen mode.
I can achieve this by using objective-c code, but I don't know how to achieve this by Qt -
@SGaist
My application has an function "sharing screen", there is toolbar on top of screen that users can try to stop sharing. Even when user is using other apps on fullscreen mode.
I can achieve this by using objective-c code, but I don't know how to achieve this by Qt -
wrote on 25 Nov 2024, 21:03 last edited by
Hi all,
Any help with this issue?