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. Manage resize events in Qt-Quick
QtWS25 Last Chance

Manage resize events in Qt-Quick

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

    Hi to all

    I need to manage some state changes in objects contained in the main rectangel item (formerly named "screen").

    I saw that in QML only keyboard and mouse generate formal events. Is there a ways to intercept when the size of the window changes in QML or I need to create the object in C++ and communicate with QML script?

    (I hope I had been clear)

    Enrico Miglino (aka Alicemirror)
    Balearic Dynamics
    Islas Baleares, Ibiza (Spain)
    www.balearicdynamics.com

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Are you using a QDeclarativeView? If so, it has different modes for resizing. Does that help?

      1 Reply Last reply
      0
      • AlicemirrorA Offline
        AlicemirrorA Offline
        Alicemirror
        wrote on last edited by
        #3

        Hi Andre, help so and so. I use QDelcarativeView, sure.
        (I was too sure I was not so clear ... sorry). The window will be resized by the user: so the main item has the same size, obviously. Thus when the user maximeze or resize the appplication windows (on the desktop) I will to know that it has changed, so change a state that change sizes, some properties and position of all the childs that are inside the window and not all can be anchored together.
        This is the question.

        Enrico Miglino (aka Alicemirror)
        Balearic Dynamics
        Islas Baleares, Ibiza (Spain)
        www.balearicdynamics.com

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Well, did you look into "this":http://doc.qt.nokia.com/latest/qdeclarativeview.html#resizeMode-prop piece of documentation?

          It explains that you can make QDeclarativeView automatically resize the root item of your QML, thus making automatic resizing of your layout possible.

          1 Reply Last reply
          0
          • AlicemirrorA Offline
            AlicemirrorA Offline
            Alicemirror
            wrote on last edited by
            #5

            Thank you Andre, this is a field I don't know so much. It is useful for me but unfortunately not in this case. Here I need to know when the window changes size, to do some stuff in several piece of the program (QML) depending on the screen size, new dimensions etc. What I need is possible that is a way to intercept the window resize event.

            A way I have in mind is to remove (again) the windows control, substituting with a custom piece on the interface, or = probably most correct = manage the resize event in the c++ code and communicate this to the qml sources.

            Enrico Miglino (aka Alicemirror)
            Balearic Dynamics
            Islas Baleares, Ibiza (Spain)
            www.balearicdynamics.com

            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