Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Buttons become transparent over images using Material Style

    QML and Qt Quick
    2
    7
    434
    Loading More Posts
    • 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.
    • aarelovich
      aarelovich last edited by

      I want my application to use an image as a Background. So I use this code:

      In my ApplicationWindow:

      Image {
          id: bkgImage
          source: "qrc:/images/bkg.jpg"
          anchors.centerIn: parent
      }
      

      To add a button

      Button {
          id: btnAsistencia
          text: qsTr("ASISTENCIA")
          font.pixelSize: fhButttonTextSize
          anchors.horizontalCenter: parent.horizontalCenter
          anchors.top: btnInscripcion.bottom
          anchors.topMargin: parent.height*0.1
      }
      

      The code above is for the second button, but I added one before in the exact same way. This is the result:

      alt text

      The second button becomes transparent over the image. How can I prevent this?

      ekkescorner 1 Reply Last reply Reply Quote 0
      • ekkescorner
        ekkescorner Qt Champions 2016 @aarelovich last edited by

        @aarelovich you can customize the background of your Button
        https://doc.qt.io/qt-5.9/qtquickcontrols2-customize.html#customizing-button

        ekke
        Qt Champion
        mobile business apps
        Qt Quick Controls 2 (Material style) for Android / iOS

        1 Reply Last reply Reply Quote 2
        • aarelovich
          aarelovich last edited by

          I ended up doing that, but I wanted to use the standard colors for the Material.Dark Theme. Thanks for the reply.

          ekkescorner 1 Reply Last reply Reply Quote 0
          • ekkescorner
            ekkescorner Qt Champions 2016 @aarelovich last edited by

            @aarelovich please open a bug report

            ekke
            Qt Champion
            mobile business apps
            Qt Quick Controls 2 (Material style) for Android / iOS

            aarelovich 1 Reply Last reply Reply Quote 0
            • aarelovich
              aarelovich @ekkescorner last edited by

              @ekkescorner

              I don't understand, what exactly is the bug here? Just because something does not behave like I'd like, it is not necessarily a bug, right?

              ekkescorner 1 Reply Last reply Reply Quote 0
              • ekkescorner
                ekkescorner Qt Champions 2016 @aarelovich last edited by

                @aarelovich then I misunderstood. thought it's not working as expected from Google Material Guidelines.

                ekke
                Qt Champion
                mobile business apps
                Qt Quick Controls 2 (Material style) for Android / iOS

                aarelovich 1 Reply Last reply Reply Quote 0
                • aarelovich
                  aarelovich @ekkescorner last edited by

                  @ekkescorner Ok, that might be. Thanks!

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post