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. StyleSheet - disable coloring of selected text
Forum Updated to NodeBB v4.3 + New Features

StyleSheet - disable coloring of selected text

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 778 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.
  • C Offline
    C Offline
    Creatorczyk
    wrote on last edited by
    #1

    Hi,

    When clicking the down and up arrows on the SpinBox, the text is highlighted in blue as below:

    0bd36232-6cfc-4513-9f8f-69276043ccc5-image.png

    How could I remove this effect with qstylesheet, or make it transparent?

    JonBJ 1 Reply Last reply
    0
    • C Creatorczyk

      Hi,

      When clicking the down and up arrows on the SpinBox, the text is highlighted in blue as below:

      0bd36232-6cfc-4513-9f8f-69276043ccc5-image.png

      How could I remove this effect with qstylesheet, or make it transparent?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Creatorczyk
      I believe that is the selected style on the QLineEdit contained in the QSpinBox. You might try e.g.

      QSpinBox { selection-background-color: transparent }
      QLineEdit { selection-background-color: transparent }
      

      I have had (unresolved) trouble in the past trying to access the QSpinBox's QLineEdit via stylesheet rules => good luck!

      1 Reply Last reply
      1
      • C Offline
        C Offline
        CPPUIX
        wrote on last edited by
        #3

        Not specifying selection-color made the text invisible for me so I had to set it to the same color as color:

        QSpinBox
        {
            color: white;
            selection-background-color: transparent;
            selection-color: white;
        }
        

        I didn't have to set any stylesheet for the QSpinBox's QLineEdit.

        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