?? tictactoe.h
字號:
#ifndef TICTACTOE_H#define TICTACTOE_H#include <qwidget.h>class TicTacToe : public QWidget{ Q_OBJECTpublic: TicTacToe(QWidget *parent = 0, const char *name = 0); QSize sizeHint() const; bool gameInProgress() const; QString saveState() const;protected: void paintEvent(QPaintEvent *event); void mousePressEvent(QMouseEvent *event);private: enum { Empty = '-', Cross = 'X', Nought = 'O' }; void clearBoard(); void restoreState(); QString sessionFileName() const; QRect cellRect(int row, int col) const; int cellWidth() const { return width() / 3; } int cellHeight() const { return height() / 3; } char board[3][3]; int turnNumber;};#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -