Qt 5.9 > Qt Quick Controls 2 > ComboBox: the textbox doesn't support multiline text because it ignores formatting



  • QML Type ComboBox in version Qt 5.9 behaves differently from Qt 5.8. In Qt 5.9 the textbox of a ComboBox ignores formatting and doesn't support multiline text and HTML.

    Here's a minimalistic example for producing the problem:
    main.qml:

    import QtQuick 2.8
    import QtQuick.Controls 2.1
    import QtQuick.Window 2.2
    
    ApplicationWindow  {
        visible: true
        width: 400
        height: 300
        title: qsTr("ComboBox test with Qt 5.9")
    
        ComboBox {
            id: multilineComboBox
            anchors {
                topMargin: 20
                rightMargin: 20
                leftMargin: 20
                top: parent.top
                right: parent.right
                left: parent.left
            }
    
            model: [
                "multiline:\n choise 1",
                "multiline:\n choise 2",
                "multiline:\n choise 3"
            ]
        }
    }
    
    

    The result for Qt 5.8:
    0_1503494429500_ComboBox test with Qt 5_8.png

    The result for Qt 5.9:
    0_1503494437445_ComboBox test with Qt 5_9.png

    Is it possible to fix this problem in the next version of Qt 5.9?


  • Moderators

    @Konst_777
    Is it the exact same QML file tested with both versions? If so it is a regression bug and should be reported (if not done already).



  • Yes, it is the exact same QML file except line "title: qsTr("ComboBox test with Qt 5.9")", where the version number of the Qt was changed from "5.8" to "5.9".
    Accordingly to your advice I reported about this problem in QTBUG-62686.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.