Results 1 to 4 of 4

Thread: From Qvariant to int (16) and long (32) and vice-versa

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default From Qvariant to int (16) and long (32) and vice-versa

    I have some confused with type conversion using QVariant.

    Qvariant.toInt gives me an int (16 ).
    I need QVariant.tolong (32 )

    and QVariant (int)
    and QVariant (long)

    I dont find a method....
    Thanks.

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

    Default Re: From Qvariant to int (16) and long (32) and vice-versa

    What system are you running on?
    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.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: From Qvariant to int (16) and long (32) and vice-versa

    Win xp
    I want to have a Qvariant for the standar int, long (to store and to return data)
    Now I have some mess with the int, qint, qint16, etc.
    Qvariant has not long ? And the int returned is a STD int or STD long ?
    Thanks

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

    Default Re: From Qvariant to int (16) and long (32) and vice-versa

    Quote Originally Posted by tonnot View Post
    Win xp
    On Win XP both int and long are 32 bit thus you can use toInt() in both cases.
    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. Replies: 10
    Last Post: 15th March 2011, 14:14
  2. sending signals to underlying qt code and vice versa
    By technoViking in forum Qt Quick
    Replies: 2
    Last Post: 9th November 2010, 12:10
  3. Mapping JavaScript object to QT (and vice versa)
    By leoalvesmachado in forum Newbie
    Replies: 2
    Last Post: 30th June 2010, 19:00
  4. conversion between string to hex and vice versa
    By mohanakrishnan in forum Newbie
    Replies: 2
    Last Post: 5th December 2009, 11:25
  5. Convert QByteArray to object and vice versa
    By DiamonDogX in forum Qt Programming
    Replies: 4
    Last Post: 20th July 2009, 20:07

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.