Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] Qt Quick/Qt Creator grid element question
Qt 6.11 is out! See what's new in the release blog

[SOLVED] Qt Quick/Qt Creator grid element question

Scheduled Pinned Locked Moved Qt Creator and other tools
12 Posts 4 Posters 5.0k 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.
  • E Offline
    E Offline
    EricRFMA
    wrote on last edited by
    #1

    Hello...

    I'm starting a Qt Quick UI project from scratch. In Qt Creator (3.1.2), in the designer, I dragged a grid element onto the canvas. Then I tried to drag some label elements onto the grid, which I was able to do. But, once the label elements were on the grid, they were cast in stone. I couldn't move or resize them via the GUI. I could do so changing in the Geometry in the Properties, but that wasn't the idea.

    Is this expected behavior? Or am I missing something (again?)

    I'm running under Mac OS 10.9.5, Qt 5.3.1

    Thanks!

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Ildar
      wrote on last edited by
      #2

      IMHO,The best way to create QML files is create them by hands, without Designer

      1 Reply Last reply
      0
      • E Offline
        E Offline
        EricRFMA
        wrote on last edited by
        #3

        Thanks Ildar... That has occurred to me, but I'm stubbornly trying to use the supplied GUI Designer :/ It seems like what I want to do should be something typical, that designer would be able to handle.

        I'll probably end up using a combination of by hand and the Designer.

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

          Hi,

          Can you try again with the latest version of Qt Creator ? That behavior sounds a bit fishy to me

          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
          • E Offline
            E Offline
            EricRFMA
            wrote on last edited by
            #5

            Which would be "latest?" I'm using 3.1.2 which I built from sources I pulled down two nights ago. My git-knowledge is limited, but I think the branch I got it from is 3.1 34d8971 Fix the build: add missing #includes

            Is that the most recent?

            Thanks!

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

              Nope, 3.2.2 is the latest officially released (some days ago if my memory serves well)

              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
              • E Offline
                E Offline
                EricRFMA
                wrote on last edited by
                #7

                Hmmmm... I could have sworn a posted a reply here, but it seems to have gone poof!

                So I pulled down the 3.2 build, but I'm having trouble building the source. In case anything obvious jumps out at you as the issue, the errors are:

                @
                /Projects/Qt5.3/bin/moc -DWITH_TESTS -DIDE_LIBRARY_BASENAME="lib" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x040900 -DQMAKE_AS_LIBRARY -DPROPARSER_THREAD_SAFE -DPROEVALUATOR_THREAD_SAFE -DPROEVALUATOR_CUMULATIVE -DPROEVALUATOR_SETENV -DREMOTELINUX_LIBRARY -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_CONCURRENT_LIB -DQT_TESTLIB_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR="/Volumes/Projects/myQt_Creator/src/plugins/remotelinux" -D__APPLE__ -D__GNUC__=4 -I/Projects/Qt5.3/mkspecs/macx-clang -I/Volumes/Projects/myQt_Creator/src/plugins/remotelinux -I/Volumes/Projects/myQt_Creator/src -I/Volumes/Projects/myQt_Creator/src/libs -I/Volumes/Projects/myQt_Creator/tools -I/Volumes/Projects/myQt_Creator/src/plugins -I/Volumes/Projects/myQt_Creator/src/shared -I/Volumes/Projects/myQt_Creator/src/libs/3rdparty -I/Projects/Qt5.3/lib/QtWidgets.framework/Headers -I/Projects/Qt5.3/lib/QtConcurrent.framework/Headers -I/Projects/Qt5.3/lib/QtTest.framework/Headers -I/Projects/Qt5.3/lib/QtNetwork.framework/Headers -I/Projects/Qt5.3/lib/QtGui.framework/Headers -I/Projects/Qt5.3/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/backward -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -F/Projects/Qt5.3/lib remotelinuxcheckforfreediskspacestep.h -o .moc/debug-shared/moc_remotelinuxcheckforfreediskspacestep.cpp
                qbsproject.cpp:267:43: error: no member named 'addFiles' in 'qbs::Project'
                qbs::ErrorInfo err = m_qbsProject.addFiles(productData, groupData, QStringList() << path);
                ~~~~~~~~~~~~ ^
                qbsproject.cpp:294:32: error: no member named 'removeFiles' in 'qbs::Project'
                = m_qbsProject.removeFiles(productData, groupData, QStringList() << path);
                ~~~~~~~~~~~~ ^
                /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DWITH_TESTS -DIDE_LIBRARY_BASENAME="lib" -DQT_CREATOR -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DISABLE_DEPRECATED_BEFORE=0x040900 -DQMAKE_AS_LIBRARY -DPROPARSER_THREAD_SAFE -DPROEVALUATOR_THREAD_SAFE -DPROEVALUATOR_CUMULATIVE -DPROEVALUATOR_SETENV -DQMLJSEDITOR_LIBRARY -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_SCRIPT_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR="/Volumes/Projects/myQt_Creator/src/plugins/qmljseditor" -I/Volumes/Projects/Qt5.3/mkspecs/macx-clang -I. -I../../../src -I../../libs -I/Volumes/Projects/myQt_Creator/tools -I../../plugins -I../../shared -I../../libs/3rdparty -I/Volumes/Projects/Qt5.3/lib/QtWidgets.framework/Versions/5/Headers -I/Volumes/Projects/Qt5.3/lib/QtScript.framework/Versions/5/Headers -I/Volumes/Projects/Qt5.3/lib/QtNetwork.framework/Versions/5/Headers -I/Volumes/Projects/Qt5.3/lib/QtConcurrent.framework/Versions/5/Headers -I/Volumes/Projects/Qt5.3/lib/QtTest.framework/Versions/5/Headers -I/Volumes/Projects/Qt5.3/lib/QtGui.framework/Versions/5/Headers -I/Volumes/Projects/Qt5.3/lib/QtCore.framework/Versions/5/Headers -I.moc/debug-shared -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers -I.uic -F/Projects/Qt5.3/lib -o .obj/debug-shared/qmljshoverhandler.o qmljshoverhandler.cpp
                2 errors generated.
                make[3]: *** [.obj/debug-shared/qbsproject.o] Error 1
                make[2]: *** [sub-qbsprojectmanager-make_first] Error 2
                make[2]: *** Waiting for unfinished jobs....
                @

                I've cleaned and rebuilt a few times, all with the same results. I'll have a look at the source code, but it looks like a relatively straightforward C++ error (Ha! Famous last words!)

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

                  Forgot that qbs is a separated git repo, you have to update that one also

                  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
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    Once an item is child of a layout/positioner you cannot move/resize the item in the form editor anymore.
                    The position inside the layout can still be changed in the navigator.

                    1 Reply Last reply
                    0
                    • E Offline
                      E Offline
                      EricRFMA
                      wrote on last edited by
                      #10

                      That seems like a major usability issue to me. If you don't get it right as soon as the child object lands in the layout, you can't use the GUI to reposition it. Even worse, in my experience, you'd have to drag and drop an object outside the layout, resize it, and then drag it into the layout and hope you get the positioning right first time.

                      Are there any plans for an enhancement to improve this? Or is there a different way to approach it so it doesn't seem as difficult and error-prone?

                      Thanks Thomas!

                      1 Reply Last reply
                      0
                      • ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #11

                        The problem is that the position (and for layouts also the size) is defined by the layout. This means that any code/tool that is capable of direct manipulating the items inside the layout has to understand the semantics of the layout to work correctly. Also getting the ui right for manipulating/positioning items inside e.g. a grid is not trivial.

                        While this is something nice to have, we did not have the resources to implement this. So instead of having something that only works "sometimes" and has unexpected behavior we locked the items.

                        You can still "move" them around by changing the order in the navigator (tree view).
                        So there is no need to get the position right. The position is determined by the order of the items and can be changed any time.

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          EricRFMA
                          wrote on last edited by
                          #12

                          Thanks for the detailed explanation. It makes it a lot easier to understand the situation.

                          I might still campaign to at least be able to resize an object in a layout. Maybe someday...

                          Thanks again!

                          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
                          • Unsolved