Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Hide cursor with Pyside6?

Hide cursor with Pyside6?

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 552 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IGuessIJustStoopid
    wrote on last edited by
    #1

    How can I hide the cursor with pyside6 in the qml? I have tried a few ways but I am not getting anything. I have searched both forum and online and cannot find anything.

    Here is my current QML:

    import QtQuick
    import QtQuick.Window
    import QtQuick.Controls
    import QtMultimedia
    
    Window {
        id: window
        width: 1920
        height: 1080
        visible: true
        color: "#1a2c47"
        title: qsTr("EveryScreen - Digital Sign Display")
    
        property int inactivityTimeout: 3000
    
        MouseArea {
            anchors.fill: parent
            hoverEnabled: true
            onEntered: {
                back_button.visible = true
                Qt.application.overrideCursor = Qt.ArrowCursor; // Set the cursor to arrow when mouse enters
                inactivityTimer.restart()
            }
            onExited: {
                inactivityTimer.restart()
            }
        }
    
        Timer {
            id: inactivityTimer
            interval: inactivityTimeout
            repeat: false
            onTriggered: {
                back_button.visible = false
                Qt.application.overrideCursor = Qt.BlankCursor; // Restore cursor on inactivity
            }
            running: true
        }
    
        TextField {
            id: pininput
            y: 772
            width: 342
            height: 77
            color: "#ffffff"
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 231
            horizontalAlignment: Text.AlignHCenter
            maximumLength: 6
            anchors.horizontalCenter: parent.horizontalCenter
            font.pointSize: 39
            hoverEnabled: false
            placeholderTextColor: "#85ffffff"
            placeholderText: qsTr("Enter Pin")
            onAccepted: {
                loading_text.visible = true;
                pininput.visible = false;
                networkManager.submit_pin(pininput.text, screenIndex);  // Emit signal when pin is submitted
            }
            background: Rectangle {
                color: "transparent" // The fill color of the rectangle
                border.color: "white" // The color of the border
                border.width: 0 // Set the width of the top, left, and right borders to 0
                Rectangle {
                    width: parent.width
                    height: 2 // The height of the bottom border
                    color: "white" // The color of the bottom border
                    anchors.bottom: parent.bottom
                }
            }
        }
    
        Text {
            id: home_screen_text
            y: 284
            color: "#ffffff"
            text: qsTr("SCREEN ") + screenIndex
            font.pixelSize: 65
            clip: false
            anchors.horizontalCenter: parent.horizontalCenter
        }
        Video {
            id: video
            opacity: 1
            anchors.fill: parent
            source: ""
            transformOrigin: Item.Center
            playbackRate: 1
            z: 0
            loops: MediaPlayer.Infinite
            onErrorOccurred: function(error, errorString) {
                console.error("Playback error: " + errorString);
            }
            focus: true
            Connections {
                target: mediaManager
                onMediaReady: {
                    var screenIndexFromSignal = Number(arguments[0]);  // First emitted value
                    var filePath = arguments[1];  // Second emitted value
                    if (screenIndex === screenIndexFromSignal) { // Check if signal is for this screen
                        loading_text.visible = false;
                        back_button.visible = true;
                        video.source = "file:///E:/qtprojects/everyscreen-sign-display/" + filePath; // Use the received filePath
                        video.play();
                    }
                }
            }
        }
    
        Rectangle {
            id: back_button
            x: 60
            y: 60
            visible: false
            width: 100
            height: 70
            color: "#0bffffff"
    
            Image {
                id: back
                anchors.fill: parent
                anchors.leftMargin: 20
                anchors.rightMargin: 20
                anchors.topMargin: 10
                anchors.bottomMargin: 10
                source: "images/back.svg"
                fillMode: Image.PreserveAspectFit
            }
        }
    
        Text {
            id: loading_text
            x: 856
            y: 507
            visible: false
            color: "#ffffff"
            text: qsTr("Loading...")
            font.pixelSize: 50
            Connections {
                    target: networkManager
                    onRequestFinished: {
                        console.log("Request finished");
                    }
                }
        }
    
    }
    
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved