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. How does the Fusion style create 2 adjacent border colors?
QtWS25 Last Chance

How does the Fusion style create 2 adjacent border colors?

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

    I am trying to replicate this effect in QSS (rather than using QPalette). How can I do this? Any CSS solution seems to use box-shadow or :before/:after which aren't supported by QSS.

    5baabf6d-b4a3-466d-854a-2f0d73f5e009-image.png

    from PyQt5.QtWidgets import *
    from PyQt5.QtGui import *
    from PyQt5.QtCore import *
    
    app = QApplication([])
    button = QPushButton("Button")
    layout = QVBoxLayout()
    layout.addWidget(button)
    container = QWidget()
    container.show()
    container.setLayout(layout)
    button.setFixedSize(QSize(100, 30))
    container.setFixedSize(QSize(500, 500))
    
    darkPalette = QPalette()
    darkPalette.setColor(QPalette.Button, QColor(53, 53, 53))
    darkPalette.setColor(QPalette.ButtonText, QColor(180, 180, 180))
    darkPalette.setColor(QPalette.Base, QColor(42, 42, 42))
    darkPalette.setColor(QPalette.Window, QColor(53, 53, 53))
    
    app.setStyle('Fusion')
    app.setPalette(darkPalette)
    app.exec_()
    
    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