qDebug() << path << image.isNull() << QImageReader::supportedFormats();
Error: supportedFormats() is not a memeber of QImageReader...
well .. actualy I read Some Tuto About Graphics ...What I understand is That a QGraphicsScene sereves as a container for QgraphicsItem ..and The QGraphicsView Provides the View Widget that Visualize the contain of scene..
So I tryed That Code :
//connect (actionOpen,SIGNAL(triggered()),this,SLOT(Open()));
void myform::Open(){
if(!path.isEmpty()){
scene->addItem(&mypixmap); //scene declared as QGraphicsScene
graphicsView->setScene(scene); //graphicsView as QGraphicsView
graphicsView->show();
}
}
//connect (actionOpen,SIGNAL(triggered()),this,SLOT(Open()));
void myform::Open(){
path=QFileDialog::getOpenFileName(this,"Choose a file to oepn",QString::null,QString::null);
if(!path.isEmpty()){
QPixmap image(path);
QGraphicsPixmapItem mypixmap(image);
scene->addItem(&mypixmap); //scene declared as QGraphicsScene
graphicsView->setScene(scene); //graphicsView as QGraphicsView
graphicsView->show();
}
}
To copy to clipboard, switch view to plain text mode
but Nothing was displayed on the graphicsView ... (but a scrollbar was added to the View)
Sould I refresh My graphicsView or did I miss some function for displayin;??
Thanks for Help
Bookmarks