Results 1 to 6 of 6

Thread: QThread and QSlot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3

    Default Re: QThread and QSlot

    I wrote in file OkragVector.h:
    #ifndef OkragVector_H
    #define OkragVector_H
    #include <QMetaType>
    #include "Okrag.h"

    typedef QVector<Okrag> OkragVector;
    qRegisterMetaType<OkragVector>("OkragVector");

    #endif
    But now I got lots of errors:
    c:\qt\projekty\graphicitem\OkragVector.h(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    c:\qt\projekty\graphicitem\OkragVector.h(8) : error C2365: 'qRegisterMetaType' : redefinition; previous definition was 'function'
    c:\qt\projekty\graphicitem\OkragVector.h(8) : error C2440: 'initializing' : cannot convert from 'const char [12]' to 'int'
    There is no context in which this conversion is possible
    When I delete QVector<Okrag> from arguments of slot/signal it's works and I get QMessageBox.

    Edit:
    Only QVector gives me:
    c:\qt\projekty\graphicitem\RysujacyKolkaWidget.h(4 0) : error C2955: 'QVector' : use of class template requires template argument list
    c:\msvc\vc\qt\include\qtcore\../../src/corelib/tools/qvector.h(96) : see declaration of 'QVector'

  2. #2
    Join Date
    Feb 2007
    Location
    Philadelphia, USA
    Posts
    255
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    43
    Thanked 21 Times in 21 Posts

    Default Re: QThread and QSlot

    Quote Originally Posted by Xaar View Post
    But now I got lots of errors:
    You need to put the qRegisterMetaType in a function (like main()). Just make sure you only register once.

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

    Xaar (6th December 2007)

  4. #3
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3

    Default Re: QThread and QSlot

    Quote Originally Posted by magland View Post
    You need to put the qRegisterMetaType in a function (like main()). Just make sure you only register once.
    Hehe, it's works perfect.
    This is what I need.
    Thanks VERY much

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.