Results 1 to 8 of 8

Thread: problem with qvariant_casting to a usertype

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: problem with qvariant_casting to a usertype

    Hi, sorry but I like to bring this up again (as I hate unsolved problems and the proposed workaround of using QObjects would pose some nasty additional expenses on client code side):

    The thing is, that the qmetatype registration obviously seems to work because my type has an id(257) which is successfully retrieved within qvariant_cast. So if you register a couple of usertypes shouldnt they get all an id from 256+ ?

    I try to find out whether the usertype registration is working or not. And from what I see it is working. And if it is working then there really isnt anything else I can do wrong, isnt there?

    David

    P.S.: does somebody understand the == comarison in line 4 of the initial code snippet and explain it to me? I would expect it to be >= since there isnt only one usertype of id 256 qvariant_cast may cast to, but there are any numbers 256+

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: problem with qvariant_casting to a usertype

    Can you show us the exact code you use?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. deployment problem: msvc++ 2008 Express, Qt 4.4.3
    By vonCZ in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2008, 14:38
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.