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. Need stylsheet coaching
QtWS25 Last Chance

Need stylsheet coaching

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.9k 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.
  • QT-static-prgmQ Offline
    QT-static-prgmQ Offline
    QT-static-prgm
    wrote on last edited by A Former User
    #1

    Hi,

    this is my stylesheetcode:

    "QTreeWidget{border-style:none; background-color:rgba(0,0,0,0); color:rgb(255,255,255); selection-background-color:transparent;} QTreeWidget::item:hover,QTreeWidget::item:hover:selected{border-radius:5px;border-style:none;border-width:1px;border-color:rgb(100,100,100); background-color:rgba(255,255,255,100);}QTreeWidget::item:selected{background-color:rgba(255,255,255,0);}"
    

    and this is the result:

    Most is intended but if something is selected there is that dotted border around the text and if you look carefully you'll notice that the icon. I want to remove all this.
    the white background on selected is already removed as you can see in the code

    M 1 Reply Last reply
    0
    • QT-static-prgmQ QT-static-prgm

      Hi,

      this is my stylesheetcode:

      "QTreeWidget{border-style:none; background-color:rgba(0,0,0,0); color:rgb(255,255,255); selection-background-color:transparent;} QTreeWidget::item:hover,QTreeWidget::item:hover:selected{border-radius:5px;border-style:none;border-width:1px;border-color:rgb(100,100,100); background-color:rgba(255,255,255,100);}QTreeWidget::item:selected{background-color:rgba(255,255,255,0);}"
      

      and this is the result:

      Most is intended but if something is selected there is that dotted border around the text and if you look carefully you'll notice that the icon. I want to remove all this.
      the white background on selected is already removed as you can see in the code

      M Offline
      M Offline
      mostefa
      wrote on last edited by mostefa
      #2

      @QT-static-prgm said in need stylsheet coaching:

      Hi,

      this is my stylesheetcode:

      "QTreeWidget{border-style:none; background-color:rgba(0,0,0,0); color:rgb(255,255,255); selection-background-color:transparent;} QTreeWidget::item:hover,QTreeWidget::item:selected{border-radius:5px;border-style:none;border-width:1px;border-color:rgb(100,100,100); background-color:rgba(255,255,255,100);}"
      

      and this is the result:

      Most is intended but if something is selected there is that dotted border around the text and if you look carefully you'll notice that the icon. I want to remove all this.

      As far as i remember , you need to set the outline property

      outline: 0;
      

      I also advice you to have a look at list of available properties in stylesheet

      doc.qt.io/qt-5/stylesheet-reference.html#list-of-properties

      Hope this can help ! if not keep me informed

      1 Reply Last reply
      1
      • QT-static-prgmQ Offline
        QT-static-prgmQ Offline
        QT-static-prgm
        wrote on last edited by
        #3

        running the final program it looks like this:

        So there is no dotted line. Needs to be something else. But why is it that white??

        The reference i already found and used. But i found nothing that explains the blueish hue of the icon (only the icon) and why transparent is not transparent (as you can see on the new image the white highlight.)

        my old stylesheet variant (put everything in one line) was ok when the code was shorter. Now i read the stylesheet from a file, so it's better readable:

        QTreeWidget {
        	border-style:none;
        	background-color:rgba(0,0,0,0);
        	color:rgb(255,255,255);
        	selection-background-color:transparent;
        }
        
        QTreeWidget::item:hover,QTreeWidget::item:hover:selected {
        	border-radius:5px;
        	border-style:none;
        	border-width:1px;
        	border-color:rgb(100,100,100);
        	background-color:rgba(255,255,255,100);
        }
        
        QTreeWidget::item:selected {
        	background-color:rgba(255,255,255,0);
        	outline:0;
        	border-style:none;
        }
        
        M 1 Reply Last reply
        0
        • QT-static-prgmQ QT-static-prgm

          running the final program it looks like this:

          So there is no dotted line. Needs to be something else. But why is it that white??

          The reference i already found and used. But i found nothing that explains the blueish hue of the icon (only the icon) and why transparent is not transparent (as you can see on the new image the white highlight.)

          my old stylesheet variant (put everything in one line) was ok when the code was shorter. Now i read the stylesheet from a file, so it's better readable:

          QTreeWidget {
          	border-style:none;
          	background-color:rgba(0,0,0,0);
          	color:rgb(255,255,255);
          	selection-background-color:transparent;
          }
          
          QTreeWidget::item:hover,QTreeWidget::item:hover:selected {
          	border-radius:5px;
          	border-style:none;
          	border-width:1px;
          	border-color:rgb(100,100,100);
          	background-color:rgba(255,255,255,100);
          }
          
          QTreeWidget::item:selected {
          	background-color:rgba(255,255,255,0);
          	outline:0;
          	border-style:none;
          }
          
          M Offline
          M Offline
          mostefa
          wrote on last edited by
          #4

          @QT-static-prgm said in need stylsheet coaching:

          running the final program it looks like this:

          So there is no dotted line. Needs to be something else. But why is it that white??

          The reference i already found and used. But i found nothing that explains the blueish hue of the icon (only the icon) and why transparent is not transparent (as you can see on the new image the white highlight.)

          my old stylesheet variant (put everything in one line) was ok when the code was shorter. Now i read the stylesheet from a file, so it's better readable:

          QTreeWidget {
          	border-style:none;
          	background-color:rgba(0,0,0,0);
          	color:rgb(255,255,255);
          	selection-background-color:transparent;
          }
          
          QTreeWidget::item:hover,QTreeWidget::item:hover:selected {
          	border-radius:5px;
          	border-style:none;
          	border-width:1px;
          	border-color:rgb(100,100,100);
          	background-color:rgba(255,255,255,100);
          }
          
          QTreeWidget::item:selected {
          	background-color:rgba(255,255,255,0);
          	outline:0;
          	border-style:none;
          }
          

          have you tried to add

          border: none;
          

          ?

          1 Reply Last reply
          0
          • QT-static-prgmQ Offline
            QT-static-prgmQ Offline
            QT-static-prgm
            wrote on last edited by
            #5

            just tried, did not work.

            QTreeWidget,* {
            	border-style:none;
            	background-color:rgba(0,0,0,0);
            	color:rgb(255,255,255);
            	selection-background-color:transparent;
            	show-decoration-selected:0;
            }
            
            QTreeWidget::item:hover,QTreeWidget::item:hover:selected {
            	border-radius:5px;
            	border-style:none;
            	border-width:1px;
            	border-color:rgb(100,100,100);
            	background-color:rgba(255,255,255,100);
            }
            
            QTreeWidget::item:selected {
            	background-color:rgba(255,255,255,0);
            	show-decoration-selected:0;
            	border:none;
            }
            

            changing the background-Color from QTreeWidget::item:selected to 0,0,0,0 makes a black border and background around it.

            I just noticed that if the window has no focus the white highlight is gone.

            So i tried this:

            QTreeWidget::item:selected, QTreeWidget::item:focus {
            	background-color:rgba(255,255,255,0);
            	show-decoration-selected:0;
            	border:none;
            }
            

            and this

            QTreeWidget::item:selected, QTreeWidget::item:selected:focus {
            	background-color:rgba(255,255,255,0);
            	show-decoration-selected:0;
            	border:none;
            }
            

            But it disables just the hover from selected items.

            And the other problem is the blue hue on the icon. Why is it blue???

            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