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. How to move a QPushButton inside gridLayout?
QtWS: Super Early Bird Tickets Available!

How to move a QPushButton inside gridLayout?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qpushbuttonqgridlayout
3 Posts 2 Posters 2.2k 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.
  • NIXINN Offline
    NIXINN Offline
    NIXIN
    wrote on last edited by
    #1

    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??

    mrjjM 1 Reply Last reply
    0
  • mrjjM Offline
    mrjjM Offline
    mrjj Lifetime Qt Champion
    replied to NIXIN on last edited by
    #2

    @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);

    NIXINN 1 Reply Last reply
    2
  • NIXINN Offline
    NIXINN Offline
    NIXIN
    replied to mrjj on last edited by
    #3

    @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
    1

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved