C++ (Qt)void FMain::paintEvent(QPaintEvent * event){ QPainter *painter = new QPainter(graphicsView_cpuTemp); painter->setPen(Qt::SolidLine); painter->drawLine(10,10,60,10); }
C++ (Qt)void FMain::paintEvent(QPaintEvent * event){ QPainter painter; painter.begin(graphicsView_cpuTemp->viewport()); painter.setPen(Qt::SolidLine); painter.drawLine(10,10,60,10); painter.end(); }
C++ (Qt)void CustomGraphicsView::paintEvent(QPaintEvent * event){ QPainter painter; painter.begin(viewport()); painter.setPen(Qt::SolidLine); painter.drawLine(10,10,60,10); painter.end(); }
C++ (Qt)QScrollArea *scrollArea; scrollArea = new QScrollArea(groupBox_3); scrollArea->setObjectName(QString::fromUtf8("scrollArea")); scrollArea->setGeometry(QRect(130, 10, 301, 80)); scrollArea->setWidgetResizable(true); scrollArea->show(); QGraphicsScene *scene; scene = new QGraphicsScene(scrollArea); scene->addLine(10,10,50,20); QGraphicsView *view; view = new QGraphicsView(scene); view->show();