Congratulations to our 2022 Qt Champions!

How to implement border-image effect, in QWidget .



  • @
    QPushButton {
    border-image: url(:/images/button.png) 16;
    border-width: 16px;
    padding: -16px 0px;
    }
    @
    When I use the above code to implemented border-image effect, it can work properly in QPushButton. When I want it to work in QWidget,
    the failed.
    how to implement border-image effect, in QWidget .
    Qstyle ?
    or other ?
    how?



  • QWidget does not have border. Try QFrame



  • A custom paint method will of course get you the required effect:-)

    I doubt that QFrame is the way to go.


Log in to reply