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. Button styles for newer buttons?
Qt 6.11 is out! See what's new in the release blog

Button styles for newer buttons?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 705 Views 1 Watching
  • 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.
  • fcarneyF Offline
    fcarneyF Offline
    fcarney
    wrote on last edited by
    #1

    I am reworking some code to use newer versions of QML libraries. I noticed that style is gone. Do I just use the style as a base object now?

    Assuming AButtonStyle.qml file:

    AButtonStyle{
        specific stuff here
    }
    

    Instead of:

    Button {
       style:  AButtonStyle{
       }
    }
    

    Old button docs
    New buttondocs

    C++ is a perfectly valid school of magic.

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      No, that is not going to work. I will need to redo the buttons.

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      0
      • IntruderExcluderI Offline
        IntruderExcluderI Offline
        IntruderExcluder
        wrote on last edited by
        #3

        Use QtQuick.Templates to customize controls for Controls 2.x.

        fcarneyF 1 Reply Last reply
        1
        • IntruderExcluderI IntruderExcluder

          Use QtQuick.Templates to customize controls for Controls 2.x.

          fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by
          #4

          @intruderexcluder It looks interesting, but I don't see how that replaces styles. For my issue I just did this:

          SpecialButton.qml

          Button {
            // custom things here that are common to all buttons
            // properties and stuff
          }
          

          Instead of using styles.

          C++ is a perfectly valid school of magic.

          1 Reply Last reply
          1
          • IntruderExcluderI Offline
            IntruderExcluderI Offline
            IntruderExcluder
            wrote on last edited by
            #5

            There is no more styles in controls2, they are much better and more lightweight. To see how to customize, for example, buttons you can use docs, or you can see how templates customized by default.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              Darta
              wrote on last edited by
              #6

              Like everyone said there is no more styles in cotrols2 but you can find most of the previous properties of "styles" directly into button (or any other item previously using styles), and if not there is a new equivalent.

              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