Results 1 to 2 of 2

Thread: Why my text entry scrollbar track color is transparent?

  1. #1
    Ishaq Khan Guest

    Red face Why my text entry scrollbar track color is transparent?

    Hi,

    I have a text entry whose background color is black and I want its scrollbar track color also to be black. But I get some pattern/texture similar to transparent part of a layer we see in Photoshop, applied to scrollbar's track.

    Below is my code:
    Qt Code:
    1. from PyQt5.QtWidgets import QApplication, QPlainTextEdit
    2.  
    3. app = QApplication([])
    4.  
    5. t = QPlainTextEdit('blah ' * 100, styleSheet='background: black; color: white; font-size: 12pt')
    6. t.verticalScrollBar().setStyleSheet('background: black')
    7.  
    8. t.show()
    9. app.exec_()
    To copy to clipboard, switch view to plain text mode 

    in case someone want to know my problem visually, I have added an image showing gotten and desired (Photoshopped) result. See below:
    Untitled-3.png

    This is a very important issue for me, please kindly solve it if you can. I shall be very thankful to you.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Why my text entry scrollbar track color is transparent?

    The style draws different parts of widgets with different colors, e.g. to achieve a "3D" effect, see https://doc.qt.io/archives/qt-4.8/qp...ColorRole-enum

    So in this case it might not be using the normal background for some of the areas.

    You could try modifying the widget's palette and experiment if you can find which color role is the one being used.

    Cheers,
    _

Similar Threads

  1. reading the latest entry text from QplaintextEdit
    By PHANI in forum Qt Programming
    Replies: 3
    Last Post: 6th February 2012, 12:30
  2. Replies: 0
    Last Post: 25th August 2010, 18:39
  3. Replies: 3
    Last Post: 22nd January 2010, 17:46
  4. QLineEdit shadow text disappear on first entry
    By dentharg in forum Qt Programming
    Replies: 1
    Last Post: 6th July 2008, 18:40
  5. clean with transparent color
    By Lele in forum Qt Programming
    Replies: 9
    Last Post: 28th October 2007, 14:45

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.