Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110433

Material UI Controls not styled on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.15.13
    • 5.15.12
    • Quick: Controls 2
    • None
    • Android
    • d83b399d4 (tqtc/lts-5.15), cfd461d43 (tqtc/lts-5.15), 30d9c910c (tqtc/lts-5.15)
    • 2023wk06FOQtforAndroid

    Description

      while testing wrong height of Android Window (QTBUG-107923) I also noticed, that Material Style of QtQuickControls2 (per ex. ToolBar, TabBar, Button) is lost on Android Devices running Qt 5.15.12.

      Works well on iOS, macOS under 5.15.12, also on Android 5.15.7, but fails on all Android Devices on 5.15.12

      Customizing a Button and using Material.accentColor or so works.

      Easy to test:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import QtQuick.Controls.Material 2.15
      ApplicationWindow {
          width: 410
          height: 680
          visible: true
          title: qsTr("Hello World")
          Material.accent: Material.Red
          Material.primary: Material.Yellow
          Material.theme: Material.Light
          Page {
              anchors.right: parent.right
              anchors.left: parent.left
              ToolBar {
                  id: myToolBar
                  anchors.right: parent.right
                  anchors.left: parent.left
                  Label {
                      anchors.centerIn: parent
                      text: "Material Toolbar, TabBar not styled: Qt 5.15.12, Android"
                      color: Material.accentColor
                  }
              }
              TabBar {
                  id: myTabBar
                  anchors.top: myToolBar.bottom
                  anchors.topMargin: 48
                  anchors.right: parent.right
                  anchors.left: parent.left
                  TabButton {
                      text: "Tab A"
                  }
                  TabButton {
                      text: "Tab B"
                  }
                  TabButton {
                      text: "Tab C"
                  }
              }
              Button {
                  id: myButton
                  anchors.top: myTabBar.bottom
                  anchors.topMargin: 48
                  text: "Material Button not styled on Android"
              }
              Button {
                  id: customizedButton
                  anchors.top: myButton.bottom
                  anchors.topMargin: 48
                  text: "Customized Flat Button works"
                  leftPadding: 6
                  rightPadding: 6
                  contentItem: Text {
                      id: buttonText
                      text: customizedButton.text
                      color: Material.accentColor
                      horizontalAlignment: Text.AlignHCenter
                      verticalAlignment: Text.AlignVCenter
                      elide: Text.ElideRight
                      font.capitalization: Qt.platform.os == "ios" ? Font.Capitalize : Font.AllUppercase
                      font.weight: Font.Medium
                  }
                  background:
                      Rectangle {
                      id: buttonBackground
                      implicitHeight: 48
                      color: customizedButton.pressed ? Material.primaryColor : "transparent"
                      radius: 2
                  } // background
              } // button
          }
      } 

      5.15.12 on macOS (or iOS) all looks good

      5.15.12 on Android - NO Material Styling

      5.15.7 - Material Style is OK

      This is a real showstopper for me. vminenko 

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              semlanik Alexey Edelev
              ekkescorner Ekkehard
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews