ui->setupUi(this);
scene->setSceneRect(0,0,350,250);
//timer=new QTimer();
ui->graphicsView->setScene(scene);
ui->graphicsView->adjustSize();
//image.fill(Qt::white);
nice.fill(qRgb(0, 0, 39));
image.fromImage(nice);
scene->addPixmap(image); scene->addPixmap(image);
text1
=scene
->addText
("hello",
QFont());
//text1->setPos(100,110);
nice.setPixel(20,20,qRgb(255, 255, 100));
scene->update();
ui->graphicsView->update();
ui->setupUi(this);
scene=new QGraphicsScene();
scene->setSceneRect(0,0,350,250);
//timer=new QTimer();
ui->graphicsView->setScene(scene);
ui->graphicsView->adjustSize();
image=QPixmap(350,250);
nice=QImage(350,250,QImage::Format_ARGB32);
//image.fill(Qt::white);
nice.fill(qRgb(0, 0, 39));
image.fromImage(nice);
scene->addPixmap(image); scene->addPixmap(image);
text1=scene->addText("hello",QFont());//text1->setPos(100,110);
nice.setPixel(20,20,qRgb(255, 255, 100));
scene->update();
ui->graphicsView->update();
To copy to clipboard, switch view to plain text mode
Bookmarks