Skip to content
  • 144k Topics
    722k Posts
    EndrII 0E
    Hi everyone, I'm developing a graphics application (a game) with a first-person perspective using Qt (QWindow ) and I'm facing a challenge with mouse-based camera control. My Goal: I need the mouse cursor to remain "captured" within my QWindow, and for me to receive only relative changes in mouse position (deltas), not absolute cursor coordinates. This is crucial for smooth and continuous camera rotation, regardless of the physical screen boundaries or the cursor moving outside the QWindow. Additionally, the system cursor should be hidden, as I plan to draw my own custom cursor or not display one at all. The Problem: Standard QMouseEvents (for example, from QWindow::mouseMoveEvent) stop being sent when the mouse cursor reaches the edge of the screen or moves outside my QWindow. This results in the camera "hitting a wall" and interrupting rotation. What I've Explored/Tried: I understand that this functionality (often referred to as "raw mouse input" or "relative mouse mode") is possible on all major platforms (Windows, Linux, macOS) and is commonly used in games. I've looked into the QSinglePointEvent::exclusivePointGrabber property, but: I can't find a working example of how to use it. Based on its description, it seems to be more about "grabbing" pointer events (to ensure they're delivered only to one QWindow), rather than "locking" the cursor in the center of the window and providing relative deltas. My primary need is for the cursor not to escape and hit the screen edge. My Question: Is there a built-in, cross-platform way in Qt to achieve this "relative mouse mode" (mouse grabbing / relative mouse mode) for a QWindow, such that: The mouse cursor remains contained within the QWindow? I receive only xrel and yrel (delta) mouse movements? The system cursor is hidden? I'm looking for something that works like SDL_SetRelativeMouseMode in SDL Any help and code examples would be greatly appreciated! Thank you.
  • Jobs, project showcases, announcements - anything that isn't directly development
    4k 23k
    4k Topics
    23k Posts
    DeSGuND
    @JonB read post more once and did through qml thanks an answer
  • Everything related to designing and design tools

    127 383
    127 Topics
    383 Posts
    R
    I see this is an old thread and I see several unresolved threads on this topic. I'm leaving this incase it helps someone else who ends up here. The solution was twofold for me. Go to File > Export Project and select Enable Python Generator. This will create a main.py. Make sure you pip install PySide6-DS Hope this helps someone.
  • Everything related to the QA Tools

    77 213
    77 Topics
    213 Posts
    J
    Hello i am using WinCC OA to develop a qt application. WinCC OA has some custom elements which cannot be detected by squish for example a polygon. Squish is now not able to detect this element with the picker. I know the name of the element but as it is of WinCC OA internal i do not know the type: waitForObject( {"container": "container", "name": "POLYGON1","type": "???","visible": 1} ); How do i get this information? And what to use if unknown? Is there any other way? I mainly just need to click this element. Thanks a lot
  • Everything related to learning Qt.

    381 2k
    381 Topics
    2k Posts
    D
    Hi Everyone, I'm looking at QT to do some development on Mac while in university. I tried to apply for the educational / student license but the form simply seems not to exist, as the section of the page is blank. How would I go about acquiring an educational license at this point? Thank you.
  • 2k Topics
    13k Posts
    S
    @JonB correct
  • 4k Topics
    18k Posts
    msauer751M
    @Pl45m4 Ja Hab ich. Dies ist die komplette Datei. #pragma once // Includes //--------------------------------------------------------------------------------------------------------------------- // own header // other includes // system includes #include <QtCore/qglobal.h> // Macros/Defines //---------------------------------------------------------------------------------------------------------------------- #if defined(LIBDB_LIBRARY) # define LIBDBSHARED_EXPORT Q_DECL_EXPORT #else # define LIBDBSHARED_EXPORT Q_DECL_IMPORT #endif // Forward declarations //----------------------------------------------------------------------------------------------------------------------
  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k 10k
    1k Topics
    10k Posts
    SGaistS
    @RokeJulianLockhart to the best of my knowledge, no. The first release of Discourse was in 2014 and the forum is several years older than that.