Results 1 to 6 of 6

Thread: qApp is not accesible

  1. #1
    Join Date
    Jul 2009
    Posts
    7
    Thanks
    1
    Platforms
    Windows

    Question qApp is not accesible

    Hi

    In my dialog class I have a command button meant for application exit. And in my dialog's constructor I'm trying to connect the button click signal with application's quit slot, like ....
    Qt Code:
    1. connect(cmdExit, SIGNAL(clicked()), qApp, SLOT(quit()));
    To copy to clipboard, switch view to plain text mode 

    But, the compiler giving error, saying qApp was not declared in this scope !!! But as per docs its a macro which gives the pointer to application's instance.

    Please help.

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qApp is not accesible

    #include <QApplication>
    in your file

  3. The following user says thank you to nish for this useful post:

    URPradhan (10th July 2009)

  4. #3
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qApp is not accesible

    Do you have

    Qt Code:
    1. #include <QApplication>
    To copy to clipboard, switch view to plain text mode 

    in the source file where you use qApp?

  5. #4
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qApp is not accesible

    Damn, too late

  6. #5
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qApp is not accesible

    Quote Originally Posted by rexi View Post
    Damn, too late
    better luck next time

  7. #6
    Join Date
    Jul 2009
    Posts
    7
    Thanks
    1
    Platforms
    Windows

    Default Re: qApp is not accesible

    Oh ! wt a mistake
    Thank you.

Similar Threads

  1. Qt-based dll: qApp = 0 !!
    By Elder Orb in forum Qt Programming
    Replies: 6
    Last Post: 14th September 2010, 16:15
  2. ohhh my, Getting handle to main app
    By sticcino in forum Qt Programming
    Replies: 6
    Last Post: 20th June 2008, 21:02
  3. Replies: 5
    Last Post: 10th March 2008, 12:45
  4. how to use qApp inside a dll?
    By oob2 in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2006, 22:15
  5. Finding QObjcects in a qApp
    By rianquinn in forum Qt Programming
    Replies: 4
    Last Post: 6th February 2006, 12:16

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.