Results 1 to 6 of 6

Thread: Help: Signals/slots system

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    21
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    11

    Default Help: Signals/slots system

    Hey, how do you connect a signal from a child widget with a slot from the parent widget?

    1) I have a MainWindow, and i want to connect the newAction (QAction)
    2) the central widget of my main window is a stackedWidget which contains the child widget i want to connect
    3) the child widget is a customWidget with a public slot, called foo()

    See the attached image...

    i tried with this from stackedWidget, which is between(child & parent) mainwindow-customwidget:
    connect(parentWidget()->newAction, SIGNAL(triggered()), customWidget, SLOT(foo()));

    i get an error saying that QWidget doesn't have a member called newAction()....

    So, in short how to connect a child's slot with a parent's signal?

    thanks
    Attached Images Attached Images
    Last edited by 0xl33t; 23rd July 2009 at 22:59.

Similar Threads

  1. How to get system drive?
    By Raccoon29 in forum General Programming
    Replies: 2
    Last Post: 23rd November 2008, 15:13
  2. Using QT for Digital TV menu system?
    By mittalpa in forum Newbie
    Replies: 4
    Last Post: 2nd July 2008, 20:23
  3. System environment variable
    By fahlen in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2007, 20:02
  4. coordinating system
    By eleanor in forum Qt Programming
    Replies: 3
    Last Post: 7th November 2007, 21:57
  5. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 14:15

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.