Widget application is what you usually want if you have a Qt GUI. If you want menus, toolbars, etc., then you would choose a main window-based application instead of a dialog-based one. If you use a main window, set the QGraphicsView as the "centralWidget" of the main window. You will also want to override the resizeEvent() of the main window and call QGraphicsView::fitInView() using a QRect based on the resize event's QSize to create the correct scaling so the scene is scaled to fit the window.Will I use console or widget application in creating a new project?
That's the best way to do it. All the images are compiled into the program instead of living as separate image files that have to be loaded at runtime. It would probably be a good idea to name your resource images so you can generate the name in a loop (e.g. "card01.png" instead of "aceofspades.png"). Otherwise you'll have to write 52 lines to load the images one-by-one instead of three lines to load them in a loop. You can make an enum that allows you to know the card (eAceOfSpaces = 01, eTwoOfSpades = 02, etc.) and match it to the correct index (card01, card02, ... ), the correct QGraphicsPixmapItem, the correct logical card, and so forth.card images from a resource file?
Bookmarks