Hi, I Have a question and looking for suggestions if you can.
I'm trying to load a maze, but I can't even show a single Image in the window.
What I'm doing wrong?
#include <QApplication>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QMainWindow>
int main(int argc, char *argv[])
{
QPixmap imagen
("E:\Data\Pictures\PixelArt\60px-Brick.png");
scene.addItem(newImagen);
newImagen->setPos(5.0,5.0);
view->show();
return a.exec();
}
#include <QApplication>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QMainWindow>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsScene scene(-350, -350, 700, 700);
QPixmap imagen("E:\Data\Pictures\PixelArt\60px-Brick.png");
QGraphicsPixmapItem *newImagen = new QGraphicsPixmapItem(imagen);
scene.addItem(newImagen);
newImagen->setPos(5.0,5.0);
QGraphicsView *view= new QGraphicsView(&scene);
view->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
And if you got any suggestions on how to do load a maze, I already got one answer from an user, but if you got other suggestions, I'll appreciate it.
Bookmarks