Important: Please read the Qt Code of Conduct -

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

  • 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:


    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]->setValue(m_item->shrinkingFactor(i) < 0.0 ? 1.0 : m_item->shrinkingFactor(i));
            m_propShrinkList[i]->setAttribute(QLatin1String("decimals"), 3);

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


  • 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 .....

Log in to reply