Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. There is any way to move a SplashScreen Window in desktop env?

There is any way to move a SplashScreen Window in desktop env?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.6k Views
  • 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.
  • M Offline
    M Offline
    madoodia
    wrote on last edited by
    #1

    hi guys
    i am working on a project that i need to create an ApplicationWindow with flags set to Qt.SplashScreen.
    but i need to abale to move this window like when i move it with titlebar.

    what should i do?

    @import QtQuick 2.0
    import QtQuick.Controls 1.1

    ApplicationWindow {
    id: screen
    width: 500
    height: 500
    flags: Qt.SplashScreen
    }@

    1 Reply Last reply
    0
    • O Offline
      O Offline
      onek24
      wrote on last edited by
      #2

      I don't see a possibility of moving ApplicationWindow using a MouseArea and Drag since it is type of ApplicationWindow_QMLTYPE_7. What you can do is to create a transparent Rectangle, use a MouseArea to drag it around and pass it's x and y coordinates to cpp using a signal. In cpp you can set the coordinates of your ApplicationWindow based on the coordinates of the rectangle.

      Im sure it will even work if you have this function implemented in QML directly without cpp, but it is a really dry workaround...

      1 Reply Last reply
      0
      • M Offline
        M Offline
        madoodia
        wrote on last edited by
        #3

        thanks onek24
        unfortunately i don't use cpp.
        i want to implement it in QML.
        but this is a good idea
        thanks again

        1 Reply Last reply
        0
        • O Offline
          O Offline
          onek24
          wrote on last edited by
          #4

          You're welcome, i hope you find a solution.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            madoodia
            wrote on last edited by
            #5

            Lastly i find a way:
            in any item you want to move you should add this MouseArea:
            @
            MouseArea {
            anchors.fill: parent
            property real lastMouseX: 0
            property real lastMouseY: 0
            acceptedButtons: Qt.LeftButton
            onPressed: {
            if(mouse.button == Qt.LeftButton){
            parent.forceActiveFocus()
            lastMouseX = mouseX
            lastMouseY = mouseY
            }
            }
            onMouseXChanged: root.x += (mouseX - lastMouseX)
            onMouseYChanged: root.y += (mouseY - lastMouseY)
            }@

            Good luck

            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