Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Quick scalable custom window

Qt Quick scalable custom window

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 1.7k 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.
  • orzel1244O Offline
    orzel1244O Offline
    orzel1244
    wrote on last edited by
    #1

    Hello people, I want to make my own, custom window using Qt Quick, I know I need to use Qt.Framlelesswindowhint, but I can't move / scale my window, any ideas?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @orzel1244 With some mouse handling using MouseArea it can be achieved. This is the so far the best I was able to do:

      Moving Frameless Window:

      Window {
          id: window
          width: 400
          height: 400
          visible: true
          flags: Qt.FramelessWindowHint
      
          MouseArea {
              anchors.fill: parent
              hoverEnabled: true
              property point lastPos
              onPressed: lastPos = Qt.point(mouseX, mouseY)
              onPositionChanged: {
                  window.x += (mouseX - lastPos.x)
                  window.y += (mouseY - lastPos.y)
              }
          }
      }
      

      Resizing Frameless Window:

      Window {
          id: win
          width: 300
          height: 300
          visible: true
          flags: Qt.FramelessWindowHint
      
          Rectangle {
              anchors.fill: parent
              color: "lightgray"
          }
      
          MouseArea {
              anchors.fill: parent
              onPositionChanged: {
                  win.width += mouseX-win.width
                  win.height += mouseY-win.height
              }
          }
      }
      

      You can try to manipulate the above code to accomplish both of them in a single Window;)

      157

      1 Reply Last reply
      0
      • orzel1244O Offline
        orzel1244O Offline
        orzel1244
        wrote on last edited by
        #3

        Thanks bro, cup of coffe for you <3

        p3c0P 1 Reply Last reply
        0
        • orzel1244O orzel1244

          Thanks bro, cup of coffe for you <3

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @orzel1244 ;) cheers.

          157

          1 Reply Last reply
          0
          • orzel1244O Offline
            orzel1244O Offline
            orzel1244
            wrote on last edited by
            #5

            But wait, it's not working like native window :/

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              What exactly Isn't?

              157

              1 Reply Last reply
              0
              • orzel1244O Offline
                orzel1244O Offline
                orzel1244
                wrote on last edited by
                #7

                It works like hmm.. selecting area in recording application

                1 Reply Last reply
                0
                • p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #8

                  @orzel1244 That was just a basic idea. You can modify it as per your needs. Then you could post the changes here and someone will try to make it more better :)

                  157

                  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