Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. Change Input Style for numbers from "," to "."

Change Input Style for numbers from "," to "."

Scheduled Pinned Locked Moved Unsolved German
2 Posts 1 Posters 498 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Martin1726
    wrote on last edited by
    #1

    Hallo zusammen, hey guys

    I'm working on a source code which uses a local definition for floating point numbers. If I have a "German" setup (for Windows) the program uses a comma for all float numbers --> this: , but I would like to unify all values to the "english number style" with a point for a floating point number.

    I already found out that with:

    QLocale::setDefault(QLocale::c());
    

    I can "show" numbers in "english"-style. But I can't find how to change also the input for a (e.g.) "QtVariantProperty"
    I have the following:

        QtVariantProperty *m_propShrinkingFactors;
        QtVariantProperty *m_propShrinkList[MaxArguments];
    .
    .
    .
    
        m_manager = new QsVariantPropertyManager(this);
        m_propShrinkingFactors = m_manager->addProperty(QtVariantPropertyManager::enumTypeId());
        for (int i = 0; i < m_numOfSchrinkingFactors; ++i) {
            m_propShrinkList[i] = m_manager->addProperty(QVariant::Double);
            m_propShrinkList[i]->setEnabled(true);
            m_propShrinkList[i]->setValue(m_item->shrinkingFactor(i) < 0.0 ? 1.0 : m_item->shrinkingFactor(i));
            m_propShrinkList[i]->setAttribute(QLatin1String("decimals"), 3);
            m_propShrinkingFactors->addSubProperty(m_propShrinkList[i]);
        }
        m_browser->addProperty(m_propShrinkingFactors);
    
    

    With this settings I get for the "visualization":
    0_1551164304673_screen1.PNG
    BUT if I have to input a number I have to write:
    0_1551164335313_screen2.PNG
    I hope someone of you can help me!

    Best,
    Martin

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Martin1726
      wrote on last edited by
      #2

      hmmmm ..... an update for the problem:
      After a restart I can use "english-style" numbers, therefore the specific problem is solved, BUT now I cant use UTF-8 sybols (Ä,Ü,Ö ....) anymore :-/
      So, I'm still unhappy .....

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved