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. Questions about StyleSheet.
Forum Updated to NodeBB v4.3 + New Features

Questions about StyleSheet.

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 144 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello there, I got some questions about qss:
    (1) How to place the text of QProgressBar outside the bar when styleSheet is set to the QProgressBar?
    By default, the text of the QProgressBar is always outside the bar:
    Default progressBar

    However, when I set a styleSheet to the progressbar, I found that the text can be only put inside the bar:
    progressBar with StyleSheet

    My stylesheet is like this:

    QProgressBar* b = new QProgressBar();
    QString s1 = "QProgressBar{border: 1px solid #FFFFFF; border-radius: 8px; background-color: #ECECEC; color:#00ADEF; font: bold 18px; text-align: right;}\n";
    QString s2 = "QProgressBar::chunk {background-color: #00ADEF; border-radius: 7px;}\n";
    b->setStyleSheet(s1.append(s2));
    

    What shuold I do if I want the effects of the styleSheet and keep the text outside the bar?

    (2) Dynamically changing the icons and the size of the icons of the QPushButton through StyleSheet when hovering and not hovering.
    I have tried qproperty-iconSize along with qproperty-icon , but this method can only get the icon size to be what I wanted, but the icon couldn't change.
    I also tried icon and icon-size for "hover" and "!hover" conditions, and the icon could change as I wanted, but the icon-size seemed not to work. Could anyone gives me any hints?

    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