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. Remove dotted border around combo box items
Forum Updated to NodeBB v4.3 + New Features

Remove dotted border around combo box items

Scheduled Pinned Locked Moved General and Desktop
16 Posts 7 Posters 18.3k 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.
  • G Offline
    G Offline
    gauravofindia
    wrote on last edited by
    #1

    Hello All,

    Can someone guide me on how to remove border around text on hover.

    Here is style:-

    @
    QComboBox QAbstractItemView::item{padding: 10px;background-color:transparent;outline:none; border-bottom:1px solid #c6c6c6;}
    QComboBox QAbstractItemView::item:selected {color:#65b0a5;outline:none;}
    QComboBox QAbstractItemView::item:hover{background-color:#b5b5b5; color:#323232;outline:none;}
    @

    EDIT: please use @-tags around code, changed here - Gerolf

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gauravofindia
      wrote on last edited by
      #2

      Is there a way we can remove Focus from the items?

      1 Reply Last reply
      0
      • N Offline
        N Offline
        ngrosjean
        wrote on last edited by
        #3

        Not sure I understand exactly what you want, but you request a border by "border-bottom:1px solid #c6c6c6", no?

        Could you try something like

        @QComboBox::item { border: 0px solid black }@

        on your style sheet?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gauravofindia
          wrote on last edited by
          #4

          Here is the problem when i mouse over the combo box item.

          Please see the attached image.

          I wan to remove the border that is coming around the text.

          !http://www.intelligaia.com/images/cb.png(cb)!

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gauravofindia
            wrote on last edited by
            #5

            If you see i want to remove the boder which comes on mouse over on the Hit State text.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              ngrosjean
              wrote on last edited by
              #6

              so perhaps you could use :

              @QComboBox::selected:item { border: 0px solid black }@

              or

              @QAbstractScrollArea::selected:item { border: 0px solid black }@

              1 Reply Last reply
              0
              • G Offline
                G Offline
                gauravofindia
                wrote on last edited by
                #7

                how do apply the above style on QComboBox QAbstractItemView?

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  ngrosjean
                  wrote on last edited by
                  #8

                  For a first try, create a file named "my_style.qss", put the previous line inside, then simply launch your application with:

                  @myApplication -stylesheet my_style.qss@

                  NB : QAbstractItemView is an QAbstractScrollArea.

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    gauravofindia
                    wrote on last edited by
                    #9

                    Is there a way i can apply the style directly in style file?

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      giesbert
                      wrote on last edited by
                      #10

                      you can do that via q QStyle implementation, but I think, the focus rectangle (which is in fact the problem here) can't be modified via style sheet.

                      Nokia Certified Qt Specialist.
                      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        gauravofindia
                        wrote on last edited by
                        #11

                        Is there some way through or something else so i can the border invisible or hide it so it does not show?

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          giesbert
                          wrote on last edited by
                          #12

                          AFAIK not ...

                          Nokia Certified Qt Specialist.
                          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            arybnikov
                            wrote on last edited by
                            #13

                            Maybe topicstarter already has resolved this problem, but I found solution:

                            QComboBox QAbstractItemView {
                            outline: 0px;
                            }

                            this stylesheet deletes dotted border.
                            Maybe it helps someone.

                            1 Reply Last reply
                            6
                            • S Offline
                              S Offline
                              sahara108
                              wrote on last edited by
                              #14

                              i overwrite QApplication and use your code:
                              @this->setStyleSheet("QComboBox QAbstractItemView { outline: 0px;}");@
                              but the outline still there. Plz help

                              1 Reply Last reply
                              0
                              • R Offline
                                R Offline
                                redschmidt
                                wrote on last edited by
                                #15

                                It worked for me, thank you very much arybnikov.

                                1 Reply Last reply
                                0
                                • R Offline
                                  R Offline
                                  RukshanA
                                  wrote on last edited by
                                  #16

                                  Thank you "arybnikov" this worked for me as well :)

                                  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