Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved How does the Fusion style create 2 adjacent border colors?

    General and Desktop
    1
    1
    99
    Loading More Posts
    • 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
      Esor last edited by

      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 Reply Quote 0
      • First post
        Last post