Results 1 to 6 of 6

Thread: Signal from a ComboBox cell in a QTableWidget

  1. #1
    Join Date
    Nov 2006
    Posts
    14
    Thanks
    1

    Default Signal from a ComboBox cell in a QTableWidget

    Hi,
    I have created a table with QTableWidget which contains few combobox cells.
    My question is how can I send signals from a combobox when I change the current index of the combobox?
    Thanks for any help!

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal from a ComboBox cell in a QTableWidget

    how did you add comboboxes, using custom delegate?

  3. #3
    Join Date
    Nov 2006
    Posts
    14
    Thanks
    1

    Default Re: Signal from a ComboBox cell in a QTableWidget

    I used this to update a table called ViewData_tableWidget

    QStringList TableArgs;

    for (int col= 0 ; col < 5 ; col ++ )
    {
    QComboBox *Box = new QComboBox(this);
    Box -> addItems(TableArgs);
    ViewData_tableWidget -> setCellWidget(0,col,Box);
    }

    To send signal I tried this:

    connect(ViewData_tableWidget,SIGNAL(cellChanged(in t,int) ),
    this, SLOT(ViewData_updateTable(int,int)));

    But changing the combo index does not trigger any signal!

    Thanks

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal from a ComboBox cell in a QTableWidget

    what version of Qt do you use?

  5. #5
    Join Date
    Nov 2006
    Posts
    14
    Thanks
    1

    Default Re: Signal from a ComboBox cell in a QTableWidget

    I am using QT 4

    thanks

  6. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal from a ComboBox cell in a QTableWidget

    then use delegate for creating comboboxes.
    see an example QTDIR/examples/widgets/icons/imagedelegate.cpp.

Similar Threads

  1. Can't See QToolButton pressed Signal from QTableWidget
    By mbrusati in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2008, 20:06
  2. Replies: 0
    Last Post: 2nd May 2008, 07:57
  3. QTableWidget signal cellActivated?
    By abrou in forum Newbie
    Replies: 2
    Last Post: 14th February 2008, 21:12
  4. Word wrapping in a QTableWidget cell
    By jcooperddtd in forum Qt Programming
    Replies: 3
    Last Post: 1st May 2007, 03:57
  5. Replies: 3
    Last Post: 8th September 2006, 18:54

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.