Results 1 to 4 of 4

Thread: QTableWidget : insert multiple widgets in one cell..

  1. #1
    Join Date
    Oct 2007
    Posts
    13
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableWidget : insert multiple widgets in one cell..

    Hi all,

    I want to insert a lineEdit and a pushButton into one cell. When pushButton is clicked, the calling slot will set a text to the lineEdit. I can use setCellWidget() method of QTableWidget. But it takes one widget. So i need a widget which contains multiple widgets. Do you have any idae to implement this problem?

    Thanks,

  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: QTableWidget : insert multiple widgets in one cell..

    Subclass QFrame or QWidget and make your own custom widget.

  3. #3
    Join Date
    Oct 2007
    Posts
    13
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableWidget : insert multiple widgets in one cell..

    Thanks jacek,

    But i know this. I need some advices in implementation. Actually, i need a class which is derived from QWidget or QFrame as you said. Each class object should include a layouted pushButton and lineEdit. Then i will add this object to the tablewidget. is that right? it would be better if you provide some code..

    Thanks,

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableWidget : insert multiple widgets in one cell..

    Since you know everything, what is the question? Why don't you just sit down, do it, see if it works and if not, ask for specific help here?

Similar Threads

  1. Qt3 - Multiple transparent widgets
    By bythesea in forum Qt Programming
    Replies: 4
    Last Post: 11th September 2009, 11:24
  2. QTableWidget and multiple editors -- how to get them?
    By macias in forum Qt Programming
    Replies: 2
    Last Post: 25th June 2007, 17:49
  3. QTableWidget swapping rows with widgets in cells
    By dnnc in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2007, 14:11
  4. Word wrapping in a QTableWidget cell
    By jcooperddtd in forum Qt Programming
    Replies: 3
    Last Post: 1st May 2007, 03:57
  5. Replies: 11
    Last Post: 7th July 2006, 13:09

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
  •  
Qt is a trademark of The Qt Company.