Results 1 to 7 of 7

Thread: Is it possible to create a QThread without inheriting ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    185
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Is it possible to create a QThread without inheriting ?

    I would like to create a QThread by just including "# include <QThread>" and ofcourse giving an statement as:

    QThread* myThread;
    myThread = new QThread();

    This results in this error:

    server.cpp: In member function 'void Server::newConnection()':
    server.cpp:55: error: cannot allocate an object of abstract type 'QThread'
    /usr/local/Trolltech/Qt-4.1.1/include/QtCore/qthread.h:38: note: because the following virtual functions are pure within 'QThread':
    /usr/local/Trolltech/Qt-4.1.1/include/QtCore/qthread.h:86: note: virtual void QThread::run()
    make: *** [server.o] Error 1


    How can I create a QThread then ?

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

    incapacitant (23rd March 2006)

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.