Hello!
I am using Qt4.2.3.
Please help me with pointers and correct this piece of code. And if possible, put some explanation on why I enounter errors such as "functional cast expression list treated as compound expression" and "no matching call' errors. Thanks in advance
void MainWinow::doFunction1()
{
int x = 0;
int y = 0;
for (x= 0; x < image->width(); x++){
for (y = 0; y < image->height(); y++){
image->setPixel(x, y, QRgb(255,0,0));
}
}
scene
->addPixmap
(QPixmap::fromImage(&image
));
//graphicsViewVis is globally declared
graphicsViewVis->setScene(scene);
graphicsViewVis->show();
}
void MainWinow::doFunction1()
{
QImage *image = new QImage(QSize(100,100), QImage::Format_RGB32);
int x = 0;
int y = 0;
for (x= 0; x < image->width(); x++){
for (y = 0; y < image->height(); y++){
image->setPixel(x, y, QRgb(255,0,0));
}
}
QGraphicsScene *scene = new QGraphicsScene;
QGraphicsPixmapItem *item;
item->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
item->setFlag(QGraphicsItem::ItemIsMovable);
scene->addPixmap(QPixmap::fromImage(&image));
//graphicsViewVis is globally declared
graphicsViewVis->setScene(scene);
graphicsViewVis->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks