Draw in an empty QTabWidget
-
Hi
Then you must subclass it and override paintEvent
and handle the no tab logic.Update:
very fast sample.class MyTab : public QTabWidget { Q_OBJECT public: explicit MyTab(QWidget* parent = nullptr) : QTabWidget(parent) {} protected: virtual void paintEvent(QPaintEvent* e ) override { QTabWidget::paintEvent(e); QPainter painter(this); if ( ! count() ) // has no tabs { painter.drawText( rect(), Qt::AlignCenter, "EMPTY"); } } };