Results 1 to 20 of 20

Thread: Sample for Mutithreading

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Sample for Mutithreading

    Hmm.... thanks for this really interesting approach. I will do some tests with a single thread environment.

    Actually I stuck in another problem. As mentioned earlier I'm really familiar with C# and Java. But I'm completely new to QT. I plan to create a BaseClass for the handlers for different manufacturers.

    I planned to make a base class that defines the set of methods that will be called by the serial thread. First I tried to make an Interface but I didn't manage it The implementation classes shall emit Signals to be able to connect them to the database thread.

    Now I'm trying it with a BaseClass which I want to subclass. But even with my 10 line trial I stuck in linker warnings.

    This is the implmentation now:

    serialhandlerbase.h

    Qt Code:
    1. #ifndef SERIALHANDLERBASE_H
    2. #define SERIALHANDLERBASE_H
    3.  
    4. #include <QObject>
    5.  
    6. class SerialHandlerBase : public QObject
    7. {
    8. Q_OBJECT
    9. public:
    10. SerialHandlerBase();
    11. virtual void startHandling();
    12. virtual void stopHandling();
    13. };
    14.  
    15. #endif // SERIALHANDLERBASE_H
    To copy to clipboard, switch view to plain text mode 


    serialbasehandler.cpp

    Qt Code:
    1. #include "serialhandlerbase.h"
    2.  
    3. SerialHandlerBase::SerialHandlerBase()
    4. {
    5. }
    To copy to clipboard, switch view to plain text mode 


    The compiler says: undefined reference to 'vtable for SerialHandlerBase'
    and the linker: collect2: Id returned 1 exit status

    I can get rid of the compiler messages if I declare a destructor and implement it in the cpp file. But it does not fix the linker message.

    Do you have an idea for me?
    Last edited by wysota; 13th June 2010 at 12:34. Reason: missing [code] tags

Similar Threads

  1. UTF-8 Issues in Sample
    By trevelyan in forum Newbie
    Replies: 6
    Last Post: 19th May 2011, 01:41
  2. Problem with QSettings sample
    By neoclaw in forum Qt Programming
    Replies: 3
    Last Post: 3rd June 2010, 09:52
  3. Question regarding the flicklist qt sample
    By advokate3 in forum Qt Programming
    Replies: 0
    Last Post: 8th December 2009, 20:15
  4. mysql connection sample
    By mohanakrishnan in forum Newbie
    Replies: 3
    Last Post: 12th November 2009, 16:23
  5. Trouble building a sample (4.6)
    By Asperamanca in forum Newbie
    Replies: 12
    Last Post: 21st October 2009, 08:55

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.