Results 1 to 10 of 10

Thread: dynamically created tablewidget name problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: dynamically created tablewidget name problem

    The signal does not know anything about an index, but the slot can get the sender of the signal that caused the slot to be called.

    Alternatively you can create a "signal handler" class, i.e. a class derived from QObject to handle all signals for one single table view, and then create one instance of that class for each table view.

    Cheers,
    _

  2. #2
    Join Date
    Apr 2016
    Posts
    32
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products

    Default Re: dynamically created tablewidget name problem

    Quote Originally Posted by anda_skoa View Post
    but the slot can get the sender of the signal that caused the slot to be called._
    Could you expand on that a bit? If the slot got the sender of the signal, wouldn't that be the actual reference to the tableWidget so you wouldn't need to save it to a list in the first place?

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: dynamically created tablewidget name problem

    Yes, that would be the actual reference to the tableWidget, whether it is saved somewhere else or not doesn't matter.

    See QObject::sender().

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 18th June 2015, 06:58
  2. use value from dynamically created widget in a slot
    By Cyrebo in forum Qt Programming
    Replies: 55
    Last Post: 23rd April 2013, 14:51
  3. Dynamically created buttons.
    By Tomasz in forum Newbie
    Replies: 26
    Last Post: 2nd December 2010, 09:40
  4. Replies: 7
    Last Post: 2nd August 2010, 12:28
  5. tableWidget created in Qt Creator not updated
    By binaural in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2009, 21:50

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.