Houdini-21 Material theme issues

   583   0   0
User Avatar
Member
1 posts
Joined: Aug. 2020
Offline
Hello,

We are planning to upgrade from Houdini-20.5 to Houdini-21.
Everything seems to work great, except that the QML UIs we were using in Houdini-20.5 have some issues with Material theme in Houdini-21.
I've attached a gif showing the issue we are facing, with every hovered item having the effect shown at the top left of the window instead of on the hovered widgets.

Here is the minimal example used in the gif:

# main.py
import sys

try:
    from PySide6.QtGui import QGuiApplication
    from PySide6.QtCore import QSize, QUrl
    from PySide6.QtQuickControls2 import QQuickStyle
    from PySide6.QtQuick import QQuickView
    PYSIDE_VERSION = 6
except ImportError:
    from PySide2.QtGui import QGuiApplication
    from PySide2.QtCore import QSize, QUrl
    from PySide2.QtQuick import QQuickView
    from PySide2.QtQuickControls2 import QQuickStyle
    PYSIDE_VERSION = 2

QQuickStyle.setStyle("Material")


class BugReporterUI(QQuickView):
    def __init__(self):
        super(BugReporterUI, self).__init__()
        self.setTitle("Bug Reporter")
        self.setSource(QUrl.fromLocalFile("main.qml"))
        self.setMinimumSize(QSize(350, 400))


def launch():
    global bugReporter
    bugReporter = BugReporterUI()
    bugReporter.show()


if __name__ == "__main__":
    import sys
    app = QGuiApplication(sys.argv)
    launch()
    if PYSIDE_VERSION == 6:
        app.exec()
    else:
        app.exec_()

# main.qml
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Layouts 1.3

Rectangle {
    visible: true
    anchors.fill: parent

    Material.accent: "#DC8D02"
    Material.background: "#191919"
    Material.foreground: "#EEEEEE"
    Material.primary: "#607A87"
    Material.theme: Material.Dark

    color: Material.background


    ColumnLayout {
        id: root

        anchors.fill: parent

        Label {
            Layout.fillWidth: true
            Layout.leftMargin: 15
            Layout.rightMargin: 10
            Layout.topMargin: 5
            text: qsTr("Assigned To")
        }

        TextField {
            Layout.bottomMargin: 5
            Layout.fillWidth: true
            Layout.leftMargin: 10
            Layout.rightMargin: 10
            selectByMouse: true
        }

        Label {
            Layout.fillWidth: true
            Layout.leftMargin: 15
            Layout.rightMargin: 10
            text: qsTr("Impact")
        }

        ComboBox {
            id: presetsCombo

            Layout.bottomMargin: 5
            Layout.fillWidth: true
            Layout.leftMargin: 10
            Layout.rightMargin: 10
            currentIndex: 3
            implicitHeight: 35
            model: ["This bug prevents my whole department (or more) from working", "This bug concerns a few people", "This bug concerns me and me alone", "This bug doesn't prevent me from working", "I don't know, bring me a lawyer"]
        }

        Label {
            Layout.fillWidth: true
            Layout.leftMargin: 15
            Layout.rightMargin: 10
            text: qsTr("Bug Description")
        }

        TabBar {
            id: bar

            Layout.fillWidth: true
            Layout.leftMargin: 10
            Layout.rightMargin: 10

            TabButton {
                text: qsTr("Bug Report")
            }

            TabButton {
                text: qsTr("Context")
            }
        }

        StackLayout {
            Layout.fillHeight: true
            Layout.fillWidth: true
            Layout.leftMargin: 10
            Layout.rightMargin: 10
            currentIndex: bar.currentIndex

            ScrollView {
                id: report

                clip: true

                TextArea {
                    clip: true
                    selectByMouse: true
                    text: "a"
                    wrapMode: TextArea.Wrap
                }
            }

            ScrollView {
                id: context

                clip: true

                TextArea {
                    clip: true
                    readOnly: true
                    selectByMouse: true
                    text: "b"
                    wrapMode: TextArea.Wrap
                }
            }
        }

        Button {
            height: 30
            Layout.fillWidth: true
            text: "submit"
        }
    }
}

# in houdini
import main
main.launch()

# in standalone
hython main.py

Attachments:
Recording 2025-10-17 at 14.34.01.gif (5.5 MB)

  • Quick Links