Results 1 to 6 of 6

Thread: Exit button that does a task before exiting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Exit button that does a task before exiting

    Thanx for the help. I forgot about destructors.

    DrDonut how would you define the destructor in a class? I tried the following:

    class Controller : public QWidget
    {
    Q_OBJECT

    public:
    Controller(QWidget *parent = 0);
    ~Controller();

    but receives the following error:
    error LNK2019: unresolved external symbol "public: void __thiscall Controller::exit(void)" (?exit@Controller@@QAEXXZ) referenced in function "public: virtual int __thiscall Controller::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@Controller@@UAEHW4Call@QMetaObject@@ HPAPAX@Z) moc_CONTROLLER.obj

    Do you have any idea?

  2. #2
    Join Date
    Mar 2008
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Exit button that does a task before exiting

    Hi Roelof,

    As far as I know, it should work the way you put it in your header file.

    Did you moc your header file in the proper way? (That would explain the metaObject stuff in the error message).

    Good luck!

Similar Threads

  1. How to hide application button on the task bar?
    By QCasper in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 23:10
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  3. Window without a exit button
    By jbpvr in forum Qt Programming
    Replies: 4
    Last Post: 12th March 2007, 23:54

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.