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. QtScrollBar right border in QTextEdit is not shown
Qt 6.11 is out! See what's new in the release blog

QtScrollBar right border in QTextEdit is not shown

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.8k 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.
  • P Offline
    P Offline
    pseudogelb
    wrote on last edited by pseudogelb
    #1

    Hi everyone,

    I want a QTextEdit with a scroll bar as shown in the picture below, but I am not able to display the
    right border of the QTextEdit and it looks like the scroll bar is covering it. Has someone an idea,
    how I can make the border on the right hand side appear again?

    0_1552328829524_ScrollBar border.png

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Could you post the stylesheet code as text so one can try it out?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pseudogelb
        wrote on last edited by
        #3

        Ye, sorry for that:

        QTextEdit  {
        	color:black;
            background-color: white;
            border-style: outset;
            border-width: 2px;
            border-radius: 16px;
            border-color: black;
            font: bold 12px;
            min-width: 1em;
            padding:16px;
        }
        
        QScrollBar:vertical {
        	background: transparent;
        	background-color: transparent;
        	width: 15px; 
        	margin: 10px 10px 0px -5px;
        
        }
        
        QScrollBar::handle {
        	background: rgb(211,211, 211);;
        	border: 2px solid black;
           border-radius: 6px;
        	margin: 0px 2px 0px 2px;
        }
        QScrollBar::add-line:vertical {
           height: 0px;
        	subcontrol-position: bottom;
        	subcontrol-origin: margin;
        }
        QScrollBar::sub-line:vertical {
        	height: 0 px;
        	subcontrol-position: top;
        	subcontrol-origin: margin;
        }
        
        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Np. its just with stylesheet its often impossible to just guess :)

          Anyway, i get another result than you.
          alt text
          So i wonder if you have some stylesheet on the parent ( blue box) that target QWidget and also
          affect the scrollbar/text edit also.

          1 Reply Last reply
          1
          • P Offline
            P Offline
            pseudogelb
            wrote on last edited by
            #5

            Thank you, indeed it was a scroll area in the background, that leaded to this behaviour.
            I put it now in a QGroupBox and everything works fine.

            1 Reply Last reply
            1

            • Login

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