Results 1 to 7 of 7

Thread: how can I know which object caused a specific event ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    258
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how can I know which object caused a specific event ?

    Uff, this seems to be some kind of "VS" trick. The logic of the handler seems to be okay, sliderMoved(int) is a legal QSlider signal (so what "no matching signal?), the name of the slot handler is decided by you. No "special form" is prescribed. Sure, frmCustomNetwork must be a Q_OBJECT and the slot handler should be declared in the frmCustomNetwork class header in the public, private or protected slots section. The connect() calls seem to be okay. Supposing the handler is declared in frmCustomNetwork, the code should run.
    In the Creator, you get useful hints when writing connect(). Once you type "SIGNAL(", you get available signals of the signaling class. You should see "sliderMoved(int)" on the list. Once you type "SLOT(", you get available slots of the target class. You should see your signal handler on the list. Selecting from the lists avoids most of errors.

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

    Hossein (21st October 2015)

Similar Threads

  1. Pass event (QWheelEvent) to a specific widget
    By stefanadelbert in forum Qt Programming
    Replies: 3
    Last Post: 5th May 2021, 03:10
  2. How to know the signal which caused a qstate transition
    By ClintEastwood in forum Qt Programming
    Replies: 6
    Last Post: 24th April 2013, 15:27
  3. Style3sheet problem, QTreeView for specific object
    By hubbobubbo in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2010, 21:15
  4. Signal to specific object slot
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 27th December 2007, 15:51
  5. Crash caused by QVariant (mis)use
    By mclark in forum Newbie
    Replies: 2
    Last Post: 31st October 2006, 15:05

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.