Results 1 to 2 of 2

Thread: Adding rows to a grid layout? or is there another way?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Adding rows to a grid layout? or is there another way?

    Hey guys Sorry in advance if this is a simple question, but I have been using QT creators drag and drop interface designer to design all of my GUI's up until this point.

    I am creating a simple file editor that allows the user to edit files in HEX. For example the user could open a file, and for each block of 16 bytes of data found in the file I wish to create a row of 16 QLineEdits.

    So my question is this: is there a way to add a row to a grid layout? I can easily detect the size of the file and determine how many rows and columns I need. And I can also easily apply the file contents to the line edits. But how can I add and remove rows from the grid layout and add line edits to the grid layout cells?

    Regards aatwo.

  2. #2
    Join Date
    Aug 2009
    Location
    Greece
    Posts
    69
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding rows to a grid layout? or is there another way?

    Start by reading about the QGridLayout,
    and then examine the example from the reference in http://doc.qt.nokia.com/4.7/layouts-basiclayouts.html.
    Basically all you need is an addWidget() function in a loop.

Similar Threads

  1. Replies: 0
    Last Post: 12th December 2010, 05:09
  2. How do I layout in a Grid?
    By DPinLV in forum Qt Tools
    Replies: 7
    Last Post: 10th August 2006, 01:37
  3. Dynamic grid layout
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2006, 15:19
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. Grid layout
    By nupul in forum Qt Programming
    Replies: 7
    Last Post: 21st April 2006, 21:15

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.