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. Is there anyway to use "classic" ComboBox look with QtQuick.Controls 2.x

Is there anyway to use "classic" ComboBox look with QtQuick.Controls 2.x

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 4 Posters 1.7k 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.
  • F Offline
    F Offline
    Fheanor
    wrote on last edited by
    #1

    I need to use ComboBox that looks like this (sorry for the quality of the image, I can't upload image from where I am):

    this

    I also need to use ComboBox from QtQuick.Controls 2.x because I encountered a bug : ComboBox from QtQuick.Controls 1.x doesn't catch my keyboards inputs (Keys.onPressed never triggers).

    My problem is that ComboBox from QtQuick.Controls 2.x doesn't look like "classic" ComboBox.

    Is there a easy way to have a QtQuick.Controls 2.x ComboBox that has same look than QtQuick.Controls 1.x ComboBox ?

    E 1 Reply Last reply
    0
    • F Fheanor

      I need to use ComboBox that looks like this (sorry for the quality of the image, I can't upload image from where I am):

      this

      I also need to use ComboBox from QtQuick.Controls 2.x because I encountered a bug : ComboBox from QtQuick.Controls 1.x doesn't catch my keyboards inputs (Keys.onPressed never triggers).

      My problem is that ComboBox from QtQuick.Controls 2.x doesn't look like "classic" ComboBox.

      Is there a easy way to have a QtQuick.Controls 2.x ComboBox that has same look than QtQuick.Controls 1.x ComboBox ?

      E Offline
      E Offline
      Eeli K
      wrote on last edited by
      #2

      @Fheanor You can customize each Controls2 control, just look at the bottom of the detailed description of the component's documentation, there's a link to customizing. But first, the customization will be hardcoded, you can make it platform or style dependent only by hardcoding each wanted style. Second, the combobox is the most difficult to customize because it has so many elements. So the short answer to your question is "no". Try to find out if there's really a bug in the Controls1 combobox or if there's another way of doing what you want to achieve. If you want to get an ad hoc replacement combobox for a spefic style and platform it's doable with Controls2, otherwise it's easier to find and fix the bug in Controls2, IMO.

      F 1 Reply Last reply
      0
      • Everton FonsecaE Offline
        Everton FonsecaE Offline
        Everton Fonseca
        wrote on last edited by
        #3

        QtQuick.Control 1.5

        1 Reply Last reply
        0
        • E Eeli K

          @Fheanor You can customize each Controls2 control, just look at the bottom of the detailed description of the component's documentation, there's a link to customizing. But first, the customization will be hardcoded, you can make it platform or style dependent only by hardcoding each wanted style. Second, the combobox is the most difficult to customize because it has so many elements. So the short answer to your question is "no". Try to find out if there's really a bug in the Controls1 combobox or if there's another way of doing what you want to achieve. If you want to get an ad hoc replacement combobox for a spefic style and platform it's doable with Controls2, otherwise it's easier to find and fix the bug in Controls2, IMO.

          F Offline
          F Offline
          Fheanor
          wrote on last edited by
          #4

          @Eeli-K Thanks, I knew there is customization feature but it will not so easy to draw the "classic look".

          I don't understand why there is no easy way to choose the old look in QtQuick.Controls 2.x

          By the way, I have a strange behavior with ComboBox focus and pop up, please if you have time, have a look on : this

          E 1 Reply Last reply
          0
          • F Fheanor

            @Eeli-K Thanks, I knew there is customization feature but it will not so easy to draw the "classic look".

            I don't understand why there is no easy way to choose the old look in QtQuick.Controls 2.x

            By the way, I have a strange behavior with ComboBox focus and pop up, please if you have time, have a look on : this

            E Offline
            E Offline
            Eeli K
            wrote on last edited by
            #5

            @Fheanor Controls 2 works differently, its purpose is to look and behave the same on all platforms, it's not "native" look&feel. I think the naming convention isn't good (Controls 1, Controls 2) because they are not different versions of the same controls, they are technologically different.

            1 Reply Last reply
            0
            • 6thC6 Offline
              6thC6 Offline
              6thC
              wrote on last edited by
              #6

              Well, it does have a major version difference. Classically you'd expect potential incompatibilities / entirely new design across a major version. At least I would...

              I haven't used a lot of v1 but when I was picking up Qt and v2 controls I came across
              https://doc.qt.io/qt-5/qtquickcontrols2-index.html
              and
              https://doc.qt.io/qt-5/qtquickcontrols2-differences.html
              which I only discovered after realizing I was looking at documentation for a prior version. They got me back on track and explain the styling difference.

              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