Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to acquire the frame colour?
Forum Updated to NodeBB v4.3 + New Features

How to acquire the frame colour?

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 154 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.
  • R Offline
    R Offline
    RokeJulianLockhart
    wrote on 12 May 2025, 22:09 last edited by
    #1

    As explained at discuss.kde.org/t/34069:

    Rationale

    I'm implementing a line number area with QPen in a QPlainTextEdit. Undermentioned, you can see the line in question set to Accent:

    I want to utilise the semantic colour for its separator, rather than apply #BBBDBE:

    PyQt6.QtGui.QPen().setColor(PyQt6.QtGui.QColor(PyQt6.QtWidgets.QApplication.palette().color(PyQt6.QtGui.QPalette.ColorRole.Button)))
    

    (I suppose I could use a QSplitter, but I don't want to refactor the widget yet.)

    Questions

    Consequently:

    1. What colour from the QPalette (as KColorScheme exposes from the applied .colors file) does the QStyle use for the QScrollBar's QSplitter?

    2. What opacity is it?

    ...or, better yet, how could I determine this myself, in the future? I ask because:

    1. None of the undermentioned appear appropriate:

      class QPalette(PyQt6.sip.simplewrapper):
      
          class ColorRole(enum.Enum):
              WindowText = ...
              Button = ...
              Light = ...
              Midlight = ...
              Dark = ...
              Mid = ...
              Text = ...
              BrightText = ...
              ButtonText = ...
              Base = ...
              Window = ...
              Shadow = ...
              Highlight = ...
              HighlightedText = ...
              Link = ...
              LinkVisited = ...
              AlternateBase = ...
              ToolTipBase = ...
              ToolTipText = ...
              PlaceholderText = ...
              Accent = ...
              NoRole = ...
              NColorRoles = ...
      
    2. ...and I do not know what to look for in invent.kde.org/plasma/breeze/-/tree/9f6f7eb6f2bf61b66f0712e5975c5ed6ba2465f3/kstyle.

    Unfortunately, I'm beginning to believe, due to the comments under stackoverflow.com/questions/63915157, that this might not be feasible, even if technically possible (which is also doubtful). Can anyone confirm either way?

    When using a forum, remember to tag the person you are responding to, in case they are not subscribed to the thread.

    1 Reply Last reply
    0

    1/1

    12 May 2025, 22:09

    • Login

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