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. 1st Qt Quick - Porgram01
Forum Updated to NodeBB v4.3 + New Features

1st Qt Quick - Porgram01

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 5 Posters 1.9k Views 3 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.
  • P Offline
    P Offline
    Papa
    wrote on last edited by Papa
    #1

    I have this code

    import QtQuick 2.5
    
    Rectangle {
        property alias mouseArea: mouseArea
    
        width: 500
        height: 400
    
        MouseArea {
            id: mouseArea
    
            anchors.fill: parent
        }
    
        Text {
            anchors.centerIn: parent
            text: "Click me"
            horizontalAlignment: Text.AlignHCenter
        }
    }
    
    

    I expected that as the variable 'width' and 'height' are modify, the windows would increase/decrease in size accordingly, but the window display is always the same size. How can I change this program-behavior?

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by always the same size ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Calvev
        wrote on last edited by Calvev
        #3

        Not quite sure what you wanted to do.
        Do you want the mouse area to scale as you resize your window?

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Papa
          wrote on last edited by
          #4

          OK, the generic window created by the default Qt Quick application, when creating from New Project->Quick Application->Choose...., has a certain size, I want to change the size of that window, better yet, I would like to display that window taking the full size of the screen.
          I don't think I have to provide any code; since all one has to do is create a new project to see the generic window created and, thus, the code.

          Any help would be very much appreciated.

          mrjjM 1 Reply Last reply
          0
          • P Papa

            OK, the generic window created by the default Qt Quick application, when creating from New Project->Quick Application->Choose...., has a certain size, I want to change the size of that window, better yet, I would like to display that window taking the full size of the screen.
            I don't think I have to provide any code; since all one has to do is create a new project to see the generic window created and, thus, the code.

            Any help would be very much appreciated.

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Papa
            Hi
            It depends on what you have.
            http://stackoverflow.com/questions/9014298/full-screen-desktop-application-with-qml

            maybe just ask qmlviewer to do it?
            qmlviewer -fullscreen -frameless file.qml

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Papa
              wrote on last edited by
              #6

              @mrjj said:

              qmlviewer

              Thanks for the advice, however, after reading this:
              The QML Viewer is a tool for testing and developing QML applications. It is not intended for use in a production environment and should not be used for the deployment of QML applications. In those cases, the QML runtime should be invoked from a Qt application instead; see Qt Declarative UI Runtime for more information
              link text
              I think I am going to pass on the advice.

              1 Reply Last reply
              0
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #7

                well for deployment , you must use some of the
                other methods mentioned in the link.

                "I have this code" didn't sound like you were about to ship :)

                So it also depends on you already have a c++ loader or not.
                or want or not.

                1 Reply Last reply
                0
                • johngodJ Offline
                  johngodJ Offline
                  johngod
                  wrote on last edited by
                  #8

                  Hi

                  In your main.cpp file you should have something like

                  QQuickView view;
                     ....
                      view.show(); // change this line to 
                      view.showMaximized(); // or to
                      view.showFullScreen();
                  
                  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