Results 1 to 4 of 4

Thread: QWidget

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QWidget

    Hi I need an advice how to design a widget that would do something like this:
    It would have 4 buttons...OK,Cancel, RemoveMask and AddNewMask
    And it would contain a 2line edits with 2 labels describing it plus a checkbox...
    Button AddNewMask would add a new triple of mentioned widgets(2 line edits and checkbox) and button RemoveMask would remove checked triple from that widget view...
    So basically it would enable adding mask and removing masks when particular mask is checked...
    I dunno whats the best way to do that...
    Thanks for any advices !

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget

    You can use QTableView with a custom model or you can create a custom widget that represents such triplet and add them on the fly to a QGroupBox.

  3. #3
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget

    do you mean by that description that I need QTableView?? what about that checkbox ?
    I think I need a Dialog...but dunno how can I add widgets to it on fly...If I create a GroupBox I need to set a layout that would actually contain that triplet....but theres a BIG problem with adding a layout to already existing layout since it gets messed up when the dialog changes its size by user...thats just horrible thing to do

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget

    Quote Originally Posted by gyre View Post
    do you mean by that description that I need QTableView?? what about that checkbox ?
    You can have a checkable item in table view.

    Quote Originally Posted by gyre View Post
    I think I need a Dialog...but dunno how can I add widgets to it on fly...
    It's quite simple. You just have to create them, add them to a layout and finally show them.

    Quote Originally Posted by gyre View Post
    but theres a BIG problem with adding a layout to already existing layout since it gets messed up when the dialog changes its size by user...thats just horrible thing to do
    I don't see any problem. You can add those custom widgets to a QScrollArea. This way dialog's size won't change.

Similar Threads

  1. Replies: 4
    Last Post: 24th April 2007, 13:18
  2. Replies: 3
    Last Post: 8th March 2007, 14:54
  3. QTextEdit, sizeHint, QWidget
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 08:25
  4. Replies: 1
    Last Post: 2nd May 2006, 21:11
  5. QScrollArea problem positioning a QWidget inside
    By Spectator in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2006, 22:59

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.