Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

How to hide QTableWidget border



  • Hi
    i would like to hide the border (the outer window , not the individual cells) in QTableWidgets.

    @
    Widget::Widget(QWidget *parent)
    : QWidget(parent)
    {
    setStyleSheet("QTableWidget {background-color: transparent;}");
    QTableWidget *table = new QTableWidget(this);
    table->setRowCount(3);
    table->setColumnCount(3);

    table->verticalHeader()->setVisible(false);
    table->horizontalHeader()->setVisible(false);
    table->verticalScrollBar()->setVisible(false);
    table->horizontalScrollBar()->setVisible(false);
    

    }
    @

    with the code above i can see 3X3 table but around the table there is one more box, looks like the border, i would like to hide it.

    please help..



  • I haven't tried it, but can you use the stylesheet to set it's border width to zero?
    @
    border: 0px;
    @



  • Try:
    @table->setFrameStyle(QFrame::NoFrame);@


Log in to reply