Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can i create my custom ComboBox?
Forum Updated to NodeBB v4.3 + New Features

How can i create my custom ComboBox?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.4k 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.
  • YaldizY Offline
    YaldizY Offline
    Yaldiz
    wrote on last edited by
    #1

    HI:

    I want to create custom combobox with my custom widgets.

    For example custom objects locations, custom geometry.

    How can i do this?

    Regards.

    jsulmJ 1 Reply Last reply
    0
    • YaldizY Yaldiz

      HI:

      I want to create custom combobox with my custom widgets.

      For example custom objects locations, custom geometry.

      How can i do this?

      Regards.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Yaldiz Depends on the amount of changes you want to do compared to standard combo box.
      Also, are we talking about widgets or QML.
      For widgets you can either subclass QComboBox and implement your changes or implement your own combo box from scratch.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • YaldizY Offline
        YaldizY Offline
        Yaldiz
        wrote on last edited by
        #3

        We are talking about widgets.

        Can I change the default views with the method you specified?

        If possible, can you share a source where I can get an example?

        jsulmJ 1 Reply Last reply
        0
        • YaldizY Yaldiz

          We are talking about widgets.

          Can I change the default views with the method you specified?

          If possible, can you share a source where I can get an example?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Yaldiz said in How can i create my custom ComboBox?:

          Can I change the default views with the method you specified?

          I don't know what exactly you want to achieve.
          What is "custom objects locations" (what objects?)?
          What is "custom geometry"?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • YaldizY Offline
            YaldizY Offline
            Yaldiz
            wrote on last edited by
            #5

            A combobox where I can create the design with my own widgets, labels etc...

            Christian EhrlicherC 1 Reply Last reply
            0
            • YaldizY Yaldiz

              A combobox where I can create the design with my own widgets, labels etc...

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Yaldiz This still not answers how / what you need different from a normal combobox. How should your combobox look like? What's not achievable with the normal one?

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • YaldizY Offline
                YaldizY Offline
                Yaldiz
                wrote on last edited by
                #7

                I want different stylesheets, for example I don't want default dropdown arrow, I want custom designed arrow I want to use my custom widgets, labels like combobox items

                jsulmJ 1 Reply Last reply
                0
                • YaldizY Yaldiz

                  I want different stylesheets, for example I don't want default dropdown arrow, I want custom designed arrow I want to use my custom widgets, labels like combobox items

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Yaldiz said in How can i create my custom ComboBox?:

                  I want to use my custom widgets, labels like combobox items

                  See https://doc.qt.io/qt-5/qcombobox.html
                  "QComboBox uses the model/view framework for its popup list and to store its items. By default a QStandardItemModel stores the items and a QListView subclass displays the popuplist. You can access the model and view directly (with model() and view()), but QComboBox also provides functions to set and get item data (e.g., setItemData() and itemText()). You can also set a new model and view (with setModel() and setView()). For the text and icon in the combobox label, the data in the model that has the Qt::DisplayRole and Qt::DecorationRole is used. Note that you cannot alter the SelectionMode of the view(), e.g., by using setSelectionMode()."

                  Regarding style see https://doc.qt.io/qt-5/stylesheet-syntax.html

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  2

                  • Login

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