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. Adding space in top and bottom of a border with stylesheet
Forum Updated to NodeBB v4.3 + New Features

Adding space in top and bottom of a border with stylesheet

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 440 Views
  • 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.
  • S Offline
    S Offline
    saber
    wrote on last edited by
    #1

    Hi, i want to add a border like shown in the bellow pic.
    c9151e73-d41a-4a48-a97d-ccd201dae158-image.png

    See there is spacing on the borders so they don't touch each other. here is my stylesheet

    QToolButton {
    border: none;
    border-radius: 0px;
    background-color: transparent;
    border-left: 2px solid blue;
    }
    
    QToolButton:hover {
    background-color: palette(Highlight);
    }
    
    QToolButton:pressed {
    margin-left: 1px;
    margin-top: 1px;
    }
    

    here is the result , i need the border not touching each other.

    dd0cb85a-c406-4bbe-9b83-d237adca606b-image.png

    I can add spacing in the layout, but it's taking extra space that i don't want

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      See The Box Model and try playing with the margin properties.

      If that fails you can create your on QToolButton sub-class and perform custom painting of the "border"

      1 Reply Last reply
      0
      • qwasder85Q Offline
        qwasder85Q Offline
        qwasder85
        wrote on last edited by qwasder85
        #3

        Try with padding or set a larger spacing for the toolbar.

        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