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. flat QScrollBar stylesheet
Forum Updated to NodeBB v4.3 + New Features

flat QScrollBar stylesheet

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 648 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.
  • C Offline
    C Offline
    Craetor
    wrote on last edited by
    #1

    i need to make QScrollBar for flat style, without borders, but when i set QScrollBar::add-line or QScrollBar::sub-line it forgot the other properties, for example icon and etc. How can i change only background color and border with save other values in stylesheet?

    QScrollBar {
    background: #444444;
    }

    QScrollBar::sub-page {
    background: #747474;
    }

    QScrollBar::add-page {
    background: #747474;
    }

    alt text

    When added:

    QScrollBar::add-line {
    border: 1px none;
    border-color: #A0A094;
    }

    QScrollBar::sub-line {
    border: 1px none;
    border-color: #A0A094;
    }

    alt text

    Why buttons up / down are lost?

    raven-worxR 1 Reply Last reply
    0
    • C Craetor

      i need to make QScrollBar for flat style, without borders, but when i set QScrollBar::add-line or QScrollBar::sub-line it forgot the other properties, for example icon and etc. How can i change only background color and border with save other values in stylesheet?

      QScrollBar {
      background: #444444;
      }

      QScrollBar::sub-page {
      background: #747474;
      }

      QScrollBar::add-page {
      background: #747474;
      }

      alt text

      When added:

      QScrollBar::add-line {
      border: 1px none;
      border-color: #A0A094;
      }

      QScrollBar::sub-line {
      border: 1px none;
      border-color: #A0A094;
      }

      alt text

      Why buttons up / down are lost?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @Craetor
      there might be a high chance that once you set the ::add-line and ::sub-line sub-controls via a stylesheet style, you also need to style the whole sub-control.
      Means you wont be able to mix native with stylesheet style for certain (maybe even all?) sub-controls. So you also need to provide the up- and down-arrows as pixmaps and set them via stylesheet.

      See Customizing QScrollBar as reference

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2

      • Login

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