Results 1 to 4 of 4

Thread: Connecting tableWidget signal and external slot

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Connecting tableWidget signal and external slot

    You must use the cellDoubleClick(int, int) signal of your tableWidget object.

    So, if your tableview member is public, the connect should look something like:
    QObject::connect( window->Your_tableWidget_name, SIGNAL(cellDoubleClicked(int, int)),
    window, SLOT(onCellClicked(int, int))
    );

    But most likely the tableWidget is private (or the ui object or pointer is private, depends on your project), then you can create another signal in your mainwindow class, connect the cellDoubleClicked(int, int) signal with the signal you create (you can connect two signals) and use this signal to finally connect to the slot that you need to execute.

  2. The following user says thank you to Zlatomir for this useful post:

    qutron (17th November 2010)

Similar Threads

  1. Replies: 8
    Last Post: 13th July 2010, 14:08
  2. Replies: 2
    Last Post: 9th September 2009, 00:26
  3. Connecting signal to custom slot?
    By dbrmik in forum Qt Tools
    Replies: 2
    Last Post: 30th April 2009, 09:28
  4. Connecting two classes with slgnal and slot
    By Benjamin in forum Newbie
    Replies: 2
    Last Post: 22nd January 2009, 13:16
  5. Connecting to a slot not within an Obejct
    By Matze-o in forum Qt Programming
    Replies: 2
    Last Post: 10th November 2008, 14:02

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