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. setStyleSheet for QToolBar::separator?
Forum Updated to NodeBB v4.3 + New Features

setStyleSheet for QToolBar::separator?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 621 Views 2 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.
  • J Offline
    J Offline
    Joachim W
    wrote on last edited by
    #1

    In the constructor of a vertical toolbar class that inherits from QToolBar, I am trying

        setStyleSheet("border-left:1px solid rgb(180,180,180); separator:{background:yellow;height:80px;};");
    

    Works for the border, but not for the separators (created later on by addSeparator() statements).

    Anything wrong here? Any other way to set the height of a separator?

    Pl45m4P 1 Reply Last reply
    0
    • J Joachim W

      In the constructor of a vertical toolbar class that inherits from QToolBar, I am trying

          setStyleSheet("border-left:1px solid rgb(180,180,180); separator:{background:yellow;height:80px;};");
      

      Works for the border, but not for the separators (created later on by addSeparator() statements).

      Anything wrong here? Any other way to set the height of a separator?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Joachim-W said in setStyleSheet for QToolBar::separator?:

      Anything wrong here?

      Yes, the separator stylesheet.

      ::separator is a sub-control of QToolBar and therefore can't put next to the general properties of QToolBar, like border-left.
      It needs its own container.

      setStylesheet("QToolBar {border-left:1px solid rgb(180,180,180);} ::separator{background:yellow; height:80px; };");
      

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • J Joachim W has marked this topic as solved on

      • Login

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