Results 1 to 7 of 7

Thread: [solved] Which object type is QObject::sender()?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Which object type is QObject::sender()?

    Quote Originally Posted by ricardo View Post
    QObject* sender = const_cast<QObject*>(QObject::sender());
    QDockWidget* dock = static_cast<QDockWidget*>(sender);
    you also can use the Qt way
    Qt Code:
    1. QDockWidget* dock = qobject_cast<QDockWidget *>(QObject::sender());
    To copy to clipboard, switch view to plain text mode 

  2. The following 3 users say thank you to Lykurg for this useful post:

    perfectcircle (20th July 2013), ricardo (8th May 2009), thanyaj (20th December 2010)

Similar Threads

  1. Replies: 4
    Last Post: 19th February 2009, 11:10
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  3. Getting type of object
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 29th November 2007, 14:38
  4. dummy question(Error)
    By Masih in forum Qt Programming
    Replies: 12
    Last Post: 19th July 2007, 23:38
  5. Replies: 3
    Last Post: 15th April 2007, 19:16

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.