[Qt-interest] QMainWindow: Prevent mouse from leaving.
R. Reucher
rene.reucher at batcom-it.net
Tue Oct 27 17:44:33 CET 2009
On Tue, 27 Oct 2009 12:34:00 -0400, John McClurkin wrote:
> Set your application to run in full screen mode. This will also prevent
> viewing other parts of the desktop. It might be disturbing to a user to
> be unable to access applications that are on the desktop.
Yes...
I just tried this with grabMouse() / releaseMouse() and mouse-tracking...
for me it simply works!
Just make sure to grab the mouse outside of your main-window's
constructor.
--
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
setupUi(this);
// ...
setMouseTracking(true);
QTimer::singleShot(100, this, SLOT(delayedInit()));
}
MainWindow::~MainWindow()
{
releaseMouse();
}
void MainWindow::delayedInit()
{
grabMouse();
}
--
HTH, René
--
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/
More information about the Qt-interest-old
mailing list