-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameView.h
More file actions
40 lines (32 loc) · 822 Bytes
/
Copy pathGameView.h
File metadata and controls
40 lines (32 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// Created by silly on 23.05.25.
//
#ifndef GAMEVIEW_H
#define GAMEVIEW_H
#include "Game.h"
#include "MDISubWindow.h"
class GameView : public MDISubWindow {
public:
GameView();
void setGame(Game* game);
void updateGame();
private Q_SLOTS:
void zoomIn() const {
view->scale(1.2, 1.2); // Увеличиваем масштаб
}
void zoomOut() const {
view->scale(0.8, 0.8); // Уменьшаем масштаб
}
private:
void updateToolbarIcons();
QToolBar *toolBar;
QAction *zoomInButton, *zoomOutButton;
QGraphicsView *view;
Game* game;
QGridLayout *viewLayout;
QWidget *centralWidget, *spacer;
QScrollBar *scrollVBar, *scrollHBar;
QIcon heartIcon = QPixmap(":/icons/heart");
QVector<QAction*> hearts;
};
#endif //GAMEVIEW_H