Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator editor font size error when using custom QSS
Forum Updated to NodeBB v4.3 + New Features

Qt Creator editor font size error when using custom QSS

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qtcreatortheme
1 Posts 1 Posters 398 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.
  • M Offline
    M Offline
    MaxQi
    wrote on 6 Dec 2023, 08:32 last edited by MaxQi
    #1

    Hello,

    (All words are from Google Translate, I apologize for this)
    I found that the scrollbar's background and handle of Qt Creator with a black theme are also black (close to black). So I searched and found this on Google:

    link text

    I set up the QSS file for Qt Creator as described in the link using starting parameter -stylesheet XXX.css. Here's my QSS file:

    QScrollBar {
        background: rgb(102, 101, 101);
        margin: 0px 0px 0px 0px;
    }
    QScrollBar:hover {
        background-color:rgb(86, 86, 86);
    }
    QScrollBar::handle {
        background-color: rgb(174, 255, 244);
    }
    QScrollBar::handle:hover {
        background-color:rgb(207, 233, 229);
    }
    QScrollBar::add-line:vertical {
        height: 0px;
        background-color: rgb(65, 155, 207);
        subcontrol-position: bottom;
        subcontrol-origin: margin;
    }
    QScrollBar::sub-line:vertical {
        height: 0px;
        background-color: rgb(65, 155, 207);
        subcontrol-position: top;
        subcontrol-origin: margin;
    }
    QScrollBar::add-line:horizontal {
        width: 0px;
        background-color: rgb(65, 155, 207);
        subcontrol-position: right;
        subcontrol-origin: margin;
    }
    QScrollBar::sub-line:horizontal {
        width: 0px;
        background-color: rgb(65, 155, 207);
        subcontrol-position: left;
        subcontrol-origin: margin;
    }
    

    This is indeed useful, as my scrollbar has become the following:
    1 scrollbar.png

    However, after clicking the Debug button on the left sidebar to enter the debug interface, and then clicking the "Edit" button or pressing ESC to return to the editing interface, my font scaling became very strange (and vice versa). And at this point, I used CTRL+mouse wheel to adjust the zoom, and it returned to normal.
    2 before.png
    3 after.png

    If I don't use the parameter -stylesheet XXX.css, everything is OK (Same theme and same text editor style).
    In fact, it doesn't matter whether the font scaling bug is resolved or not, I just want a prominently colored scrollbar slider. Also, I don't want to use a bright white theme as it hurts my eyes too much. Thanks.

    Qt Creator Version: 12.0.0, 12.0.1, 12.0.2

    1 Reply Last reply
    0

    1/1

    6 Dec 2023, 08:32

    • 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