Results 1 to 3 of 3

Thread: QtVariantProperty and attributeValue(QLatin1String("decimals")

  1. #1
    Join Date
    May 2012
    Posts
    99
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question QtVariantProperty and attributeValue(QLatin1String("decimals")

    Hi,

    I want to set 20 decimals in a QtVariantProperty. I use this code:

    Qt Code:
    1. QtVariantProperty* variantProperty = m_pVariantManager->addProperty(QVariant::Double, "test");
    2. variantProperty->setAttribute(QLatin1String("decimals"), 20);
    3. qDebug() << "decimals" << variantProperty->attributeValue(QLatin1String("decimals"));
    To copy to clipboard, switch view to plain text mode 

    The generated output is 'decimals 13'. Is it a limitation of QtVariantProperty? How can I set more than 13 decimals?

    Best regards.

  2. #2
    Join Date
    May 2012
    Posts
    99
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtVariantProperty and attributeValue(QLatin1String("decimals")

    Is it not possible?

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

    Default Re: QtVariantProperty and attributeValue(QLatin1String("decimals")

    More likely a limitation of the double type. Which of couse propagates to the attribute value.
    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: 1
    Last Post: 7th April 2010, 21:46
  2. Replies: 3
    Last Post: 15th February 2010, 17:27
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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.