Qt4: Making fullscreen window impossible to get around (a lock screen)?

爷,独闯天下 提交于 2019-12-01 23:19:43

I don't know how to do it with Qt, but what you are looking for is called grabbing. You can grab the pointer input device as well as the keyboard.

Edit: Looking in to the Qt4 docs, have you tried to use QWidget::grabMouse? It looks like this function does exactly what you want.

I don't know if this is the best solution, but you can try an event handler using QObject::installEventFilter().

If you are using Windows, you can install an event filter that handles messages where event->type() == QEvent::WinEventAct.

I don't really know much about other OSs, but Qt probably has something for that too.

sai

inherit Qwidget class with parameter Qt::WindowStaysOnTopHint see below

myclass::myclass(QWidget *parent) : QWidget(parent,Qt::WindowStaysOnTopHint)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!