Results 1 to 6 of 6

Thread: QGridlaout - Dynamic deployment in a grid

  1. #1
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    15
    Thanks
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Exclamation QGridlaout - Dynamic deployment in a grid

    Hi,
    I have a problem with placing a widget in a grid.
    I want the widgets they added to the grid without a position.
    Qt Code:
    1. GridLayout->addWidget(myWidget)
    To copy to clipboard, switch view to plain text mode 
    But when trying to add Wiget is a program that adds it in a vertical position (one by one).
    I want wigety were added horizontally.

    Temporarily, I fixed it this way ... I put it in the net three wigety horizontal position (qt designer), then when you create the window destructor and destroying doing these three wigety. I can now add to the grid dynamically wigety the way I wanted.
    This is not an elegant solution.

    Please help and sorry for my English.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QGridlaout - Dynamic deployment in a grid

    If you don't want to mention the position, then you have two options
    1. Write your own Layout, and other
    or
    2. Use QHBoxLayouts on QVBoxLayouts, and put the QWidgets on QHBoxLayout
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    15
    Thanks
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Unhappy Re: QGridlaout - Dynamic deployment in a grid

    It's not working.
    Must be manually placed at least two widgets that made ​​the grid. Otherwise, the widgets are added in a single line ;/

  4. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QGridlaout - Dynamic deployment in a grid

    Give us a sample compiling program of how you are doing things.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  5. #5
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    15
    Thanks
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QGridlaout - Dynamic deployment in a grid

    Code for U.
    Attached Files Attached Files

  6. #6
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QGridlaout - Dynamic deployment in a grid

    Ok, here is code back with changes which I think you wanted to behave like.

    Note that I changed the some layout setting to make the UI fit on to my small 15" laptop screen, please ignore then if you needed a fixed size window, it's up to you.
    Attached Files Attached Files
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Replies: 0
    Last Post: 29th March 2012, 20:56
  2. MAC OSX Dynamic Linking and Deployment
    By rokkamraja in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2009, 16:14
  3. MAC OSX Dynamic Linking and Deployment
    By rokkamraja in forum Newbie
    Replies: 0
    Last Post: 23rd October 2009, 13:12
  4. Best Qt class for a dynamic color grid
    By josiah42 in forum Newbie
    Replies: 3
    Last Post: 7th January 2009, 21:13
  5. Dynamic grid layout
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2006, 16:19

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.