Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt 5.9 > Qt Quick Controls 2 > ComboBox: the textbox doesn't support multiline text because it ignores formatting

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 1.6k 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.
  • K Offline
    K Offline
    Konst_777
    wrote on last edited by Konst_777
    #1

    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?

    raven-worxR 1 Reply Last reply
    0
    • K Konst_777

      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?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @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).

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Konst_777
        wrote on last edited by Konst_777
        #3

        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.

        1 Reply Last reply
        2

        • Login

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