How can I round a QWidgets corners?

Posted by chacham15 on Stack Overflow See other posts from Stack Overflow or by chacham15
Published on 2012-02-21T00:35:29Z Indexed on 2014/08/21 22:20 UTC
Read the original article Hit count: 220

Filed under:
|

I am trying to round the corners of the current widget, but it doesnt work, why?


PopupWindow::PopupWindow() : QWidget(0) {
    setWindowFlags(
        Qt::Tool |
        Qt::FramelessWindowHint |
        Qt::WindowSystemMenuHint |
        Qt::WindowStaysOnTopHint
    );
    this->resize(300, 100);
    setStyleSheet(".PopupWindow {border-style: outset;border-width: 10px;border-radius:10px;}");

    QPushButton *hello = new QPushButton("Hello world!");
    hello->setFont(QFont("Times", 18, QFont::Bold));
    hello->setGeometry(10, 40, 180, 40);
    hello->setStyleSheet("");


    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(hello);
    setLayout(layout);
}

© Stack Overflow or respective owner

Related posts about c++

Related posts about qt