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. QScrollBar stylesheet does not apply on windows
Forum Updated to NodeBB v4.3 + New Features

QScrollBar stylesheet does not apply on windows

Scheduled Pinned Locked Moved General and Desktop
qscrollbarstylesheet
1 Posts 1 Posters 838 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.
  • X Offline
    X Offline
    xlw12
    wrote on last edited by xlw12
    #1

    I want to change the style of my scrollbar in an QPlainTextEdit. But unfortunately on Windows it will always render the native windows scrollbar. On Mac OSX it works perfect. Whats the problem?

    I set the stylesheet on construction of the window like this:

    mPlainTextEdit = new QPlainTextEdit(mCentralWidget);
    mPlainTextEdit->setObjectName(QStringLiteral("LogText"));
    mPlainTextEdit->setStyleSheet(QString::fromUtf8(
        "QPlainTextEdit {"
        "    background-color: #4A4C4F;"
        "    color: #C6C8C8;"
        "    font-size: 10px;"
        "    border-style: none;"
        "}"
        "QScrollBar:vertical {"
        "    border-style: none;"
        "    background: #4A4C4F;"
        "    width: 10px;"
        "    margin: 0px;"
        "}"
        "QScrollBar::handle:vertical {"
        "   background: #555555;"
        "   border-style: solid;"
        "   border-width: 1px;"
        "   border-radius: 5px;"
        "   border-color: #555555;"
        "}"
        "QScrollBar::add-line:vertical { background: #4A4C4F; }"
        "QScrollBar::sub-line:vertical { background: #4A4C4F; }"));
    
    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