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. material theme custom effect
Qt 6.11 is out! See what's new in the release blog

material theme custom effect

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 984 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.
  • Q Offline
    Q Offline
    qunreallx
    wrote on last edited by
    #1

    I'm using qt 6.6 on windows and the problem is that I can't add a custom effect color on hover. I still have it standard, so I don't change it. Also when holding there is a wave effect, I would like to leave it but also change colors, how to achieve this??

    I will be glad for any help or advice!

    import QtQuick
    import QtQuick.Controls
    import QtQuick.Effects
    import QtQuick.Controls.Material
    import Qt5Compat.GraphicalEffects
    import QtQuick.Controls.Material.impl
    import QtQuick.Templates as T
    
    ComboBox {
                    id: owner_list
                    Material.theme: Material.Blue
    
                    anchors.centerIn: parent
                    editable: true
                    width: parent.width
                    height: parent.height
                    model: db.getAllCompanyNames()
                    z: 5
    
                    popup: T.Popup {
                        y: owner_list.height + 1
                        width: owner_list.width
                        height: Math.min(5 * 40 + verticalPadding * 2, owner_list.Window.height - topMargin - bottomMargin)
                        transformOrigin: Item.Top
                        topMargin: 12
                        bottomMargin: 12
                        verticalPadding: 8
    
                        Material.theme: owner_list.Material.theme
    
    
                        contentItem: ListView {
                            clip: true
                            implicitHeight: Math.min(5 * 40, model.count * 40)
                            model: owner_list.delegateModel
                            currentIndex: owner_list.highlightedIndex
                            // highlightMoveDuration: 0
    
                            delegate: Item {
                               width: parent.width
                               height: 40
    
                               Text {
                                   anchors.centerIn: parent
                                   text: modelData
                                   color: "white"
                               }
    
                               MouseArea {
                                   anchors.fill: parent
                                   onClicked: {
                                       owner_list.currentIndex = index;
                                       owner_list.popup.close();
                                   }
                               }
                           }
    
    
                            T.ScrollIndicator.vertical: ScrollIndicator { }
                        }
    
                        background: Rectangle {
                            radius: 4
                            color: "black"
    
                        }
                    }
    }
    
    1 Reply Last reply
    0

    • Login

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