Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to move a QPushButton inside gridLayout?

    General and Desktop
    qpushbutton qgridlayout
    2
    3
    1903
    Loading More Posts
    • 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.
    • NIXIN
      NIXIN last edited by

      I have just tried a simple thing, in designer I created one push button, inside grid layout. The problem is geometry option got disabled in Property box, and I am not able to change the cordinates. In this situation how should I move the push button from its original place if required?

      Can somebody help me to achieve this??

      mrjj 1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion @NIXIN last edited by

        @NIXIN
        Hi
        Since a layout arrange its members , you are not allowed to use the geometry to just freely set it.

        You can however move it around in the grid by dragging.

        Or if you insert from code

        MyGridLayout->addWidget(new QPushButton("Button"), ROW, COL);

        NIXIN 1 Reply Last reply Reply Quote 2
        • NIXIN
          NIXIN @mrjj last edited by

          @mrjj I tried it but it didn't worked, however I found the solution for it.
          Break the Layout, arrange the widgets and then set the layout

          1 Reply Last reply Reply Quote 1
          • First post
            Last post