Portál AbcLinuxu, 10. května 2025 03:20
void myTableWidget::paintEvent(QPaintEvent *event) { QTableWidget::paintEvent(event); QPainter paint(this); paint.setPen(Qt::blue); paint.drawText(rect(), Qt::AlignCenter, "The Text"); }Z nějakého mě záhadného důvodu to nefunguje a když program spustím tak mi to v debugu píše: QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::setPen: Painter not active
Řešení dotazu:
QPainter paint(this->viewport());
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.