Keep QDialog on top of everything, even fullscreen applications? - qt

On a project I work on, using Python3 + PySide, I try to print a popup-message as some sort of notification.
This popup needs to be on top of everything, this includes fullscreen applications like games or browsers. And that's the point that does not work. It works fine for all windows on my Desktop, normal windows, maximized, but as soon as there is a fullscreen application or a borderless window ("pseudo fullscreen") the popup is created, but "behind" the fullscreen app.
I already use self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) but this flag does get ignored by other fullscreen apps.
How do I fix this? Also without giving focus to the popup.
It is just there to present information, and it is not good when your window looses focus while playing a game.
My code can be found here: https://github.com/GosuSan/PyECM
additional Info:
- my project aims to be cross-platform, so I need a platform-independend solution
- I am running linux, without having a windows machine atm,
so I can't test stuff there.
If you need any more info, let me know!
Edit:
It seems that PySide.QtGui.QSystemTrayIcon.showMessage does what I want, it works on fullscreen as well as on borderless-windows. So I will try to either find out how those messages are displayed on top, or just use them, not sure for now.

Related

How to take webpage screenshots using QWebEngineView without opening window

I'm looking for a way to take website screenshots with QWebEngineView. The main goal is to develop a headless screencapture application that runs in the background.
I've managed to get a minimal working example to work (see this for example). However, these examples require that the QWebEngineView widget is made visible, either with calls to QWebEngineView::show(), QWebEngineView::showMinimized() or even QWebEngineView::setVisible(true), to be able to take a screen capture of a website. As this results in opening a series of windows, this solution is less than perfect.
Does anyone know of a way to use QWebEngineView to take screenshots of websites without having windows popping open?
The solution is rather easy: configure the QWebEngineView widget to not show onscreen by setting the Qt::WA_DontShowOnScreen attribute through a call to QWidget::setAttribute(Qt::WA_DontShowOnScreen).
http://doc.qt.io/qt-5/qt.html#WidgetAttribute-enum

Hide mouse pointer on Chromium kiosk

Web application with xHTML UI is shown on self-service kiosk, using Chromium in fullscreen kiosk mode. As the kiosk display is intended only for visual feedback, there is no mouse/touchscreen connected.
While it's very easy to hide the mouse pointer via the CSS:
html { cursor: none; }
This approach has one essential problem - user MUST move mouse at least few pixels for pointer to disappear. As I mentioned above, this kiosk has no input methods, and, as a result, after UI is loaded, cursor is still visible right in the middle of screen for rest of the time.
I know that it's possible to simply set transparent cursor in OS options, but unfortunately few of these kiosks has already been shipped to clients, so we can only change the displayed HTML/CSS/JS content remotely, not access and configure the underlying OS itself.
Also I googled around and it seems that there is no way to move the mouse via the jQuery. Can anyone suggest how to deal with this problem?
You cant do this only via browser && CSS/JS (belive me, i tried).
For me solution was to install unclutter on the client:
sudo apt-get install unclutter
And turn cursor off, by adding to autostart
nano ~/.config/lxsession/LXDE/autostart
line:
#unclutter -idle 0.1
It will make your coursor disappear after not moving for 0.1s, so if you want to use mouse - you still can.
For those searching for a SO level solution:
I suggest using nano, so on terminal type sudo nano /etc/lightdm/lightdm.conf to edit this file and add this line below:
xserver-command=X -nocursor
Important: You must add this line after [Seat*] declaration.
Solution used in Raspbian linux distribution.

Remove Universal Windows Platform Black toolbar

Might be a really stupid question but anyone got any idea how to get rid of the black toolbar appearing when running my application. I'm using Template10 as well.
That's buttons for debugging your application.
If you deploy your app and run it - your app will run without them.
Watch this thread if you want to manage:
How to remove the “Go to live visual tree” / “Enable selection” / “Display layout adorners” overlay when debugging?
There is a small button at the bottom of the black toolbar, which when clicked it hides the biggest part of it (in case you don't want to see it while debugging).

WatchKit Menu Items Not Displaying

I'm in Xcode 6.2 Beta 3 (Build 6C101), I've added a menu and two menu items to my Interface Controller, and created IBActions for both. I've given them titles and images, but when I run the app nothing displays.
I've read
https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/Menus.html
and can't see anything about need to show menu items programatically - what am I missing?
You do not need to present the menu programmatically. The only thing you need to do is wire each button to IBActions in your Watch app extension.
The most likely issue is caching of the previous Watch app storyboard. Do a clean build and try again.
Finally, as you likely know WatchKit menus only display on a "force press". They cannot be used for the main interface of the Watch app. In the Simulator, a click and hold with the mouse will simulate a force press, and the animation will make it clear when you have done one, even in contexts where it doesn't do anything.
This was solution for me- Go to Hardware->Touch Pressure->Deep Press then try tap on watch simulator.
I have recently encountered this issue on a real device, although the menu was working as expected on the watch simulator. In my case, the problem was in SF Symbol that I've used as an image.
Everything was fixed after replacing it with an image from the assets catalogue.

TV ergonomics in Flex

Im having fun toying with AIR and want to use it to create an application for my TV, but Im coping with a serious & dumb problem : TV ergonomics. Indeed, without a mouse, it is all about focus on elements and moving this focus in a natural fashion.
In HTML this is handled by the browsers perfectly, but in ActionScript Im having a real hard time ! For instance, I don't even know how to have an element on autofocus, so that when I load the app there is already something to click on (without it I just can't interact with my app at all!).
Do you have any idea on the best ways to create a listener for the remote controller arrows and OK button (should be enough) so that I never get stuck in the app ?
So whether you have already struggled with that or if you simply happen to know how to play with the focus and setFocus() parts of Flex, your help is very welcome !
I recommend you look at the Google TV Flash template. It's all about controls and navigation. I'm not sure if this works for Flex as I have not done any gtv development yet.

Resources