@ -0,0 +1,108 @@ |
|||
#include "board.h" |
|||
|
|||
//Constructor that creates the board of the game for a size
|
|||
Board::Board(int Nbombs, int rows, int cols){ |
|||
this->rows=rows; |
|||
this->cols=cols; |
|||
this->Nbombs=Nbombs; |
|||
|
|||
for(int j=0;j<rows;j++){ //Start-up empty gameBoard
|
|||
gameBoard.push_back(QVector<int>(cols)); |
|||
for(int k=0;k<cols;k++){ |
|||
gameBoard[j][k] = 0; |
|||
} |
|||
} |
|||
srand(time(NULL)); //seed
|
|||
for (int i=0;i<Nbombs;i++){ |
|||
int x,y; |
|||
x=rand()%rows; //x between 0 and number of rows
|
|||
y=rand()%cols; //y between 0 and number of columns
|
|||
if(gameBoard[x][y]==0){ //No bomb previously there
|
|||
gameBoard[x][y]=-1; |
|||
} |
|||
else i=i-1; //fix counter
|
|||
} |
|||
//Scan all the vector and calculate the number of neighbor bombs in positions that don't have a bomb
|
|||
for(int i=0; i<rows; i++){ |
|||
for(int j=0; j<cols; j++){ |
|||
if (gameBoard[i][j] != -1){ |
|||
gameBoard[i][j] = calculateNeighborsBombs(i,j); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
//Constructor that takes an already made board
|
|||
Board::Board(QVector< QVector<int> > board){ |
|||
rows = board.size(); |
|||
cols = board.at(0).size(); |
|||
this->gameBoard = board; |
|||
int sum = 0; |
|||
//Calculate how many bombs the board has
|
|||
for(int i=0; i<rows; ++i){ |
|||
for(int j=0; j<cols; ++j){ |
|||
if(gameBoard.at(i).at(j) == -1){ |
|||
++sum; |
|||
} |
|||
} |
|||
} |
|||
Nbombs = sum; |
|||
} |
|||
|
|||
//Method that calculates and returns the number of neighbors bombs of a position (x,y) in the board
|
|||
int Board::calculateNeighborsBombs(int x,int y){ |
|||
int sum=0; |
|||
|
|||
if(gameBoard.at(x).at(y) != -1){ //No bomb in gameBoard[x][y]
|
|||
for(int i=x-1; i<x+2; i++){ |
|||
for(int j=y-1; j<y+2; j++){ |
|||
if(isInsideTheBoard(i,j)){ |
|||
if(gameBoard.at(i).at(j) == -1){ //bomb in gameBoard[i][j]
|
|||
sum=sum+1; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return sum; |
|||
} |
|||
|
|||
bool Board::isInsideTheBoard(int x, int y){ |
|||
return ((x < rows) && (x >= 0) && (y < cols) && (y >= 0)); |
|||
} |
|||
|
|||
//Return the vector of the board
|
|||
QVector< QVector<int> > Board::getBoard(){ |
|||
return gameBoard; |
|||
} |
|||
|
|||
//Return the number of bombs of a position x,y
|
|||
int Board::getNumberOfBombs(int x,int y){ |
|||
return gameBoard[x][y]; |
|||
} |
|||
|
|||
int Board::getNbombs() const{ |
|||
return Nbombs; |
|||
} |
|||
|
|||
//Return the board with data encrypted
|
|||
QVector<QVector<int> > Board::getEncryption(){ |
|||
QVector< QVector<int> > encrypt(gameBoard.size(), QVector<int>(gameBoard.at(0).size())); |
|||
for(int i=0; i<gameBoard.size(); ++i){ |
|||
for(int j=0; j<gameBoard.at(i).size(); ++j){ |
|||
encrypt[i].replace(j,(gameBoard.at(i).at(j) ^ XOR_NUM) + i); |
|||
} |
|||
} |
|||
return encrypt; |
|||
} |
|||
|
|||
//Return the decrypted board
|
|||
QVector< QVector<int> > Board::getDecryption(QVector< QVector<int> > board){ |
|||
QVector< QVector<int> > decrypt(board.size(), QVector<int>(board.at(0).size())); |
|||
for(int i=0; i<board.size(); ++i){ |
|||
for(int j=0; j<board.at(i).size(); ++j){ |
|||
decrypt[i].replace(j,((board.at(i).at(j) - i) ^ XOR_NUM)); |
|||
} |
|||
} |
|||
return decrypt; |
|||
} |
@ -0,0 +1,30 @@ |
|||
#ifndef BOARD_H |
|||
#define BOARD_H |
|||
|
|||
#include <QVector> |
|||
|
|||
#include <cstdlib> |
|||
#include <ctime> |
|||
|
|||
#define XOR_NUM 6 |
|||
|
|||
class Board{ |
|||
private: |
|||
QVector< QVector<int> > gameBoard;//Vector for the board
|
|||
int rows; //Number of Rows
|
|||
int cols; //Number of columns
|
|||
int Nbombs; //Number of Bombs
|
|||
bool isInsideTheBoard(int, int); //True if coordinates are inside the board
|
|||
public: |
|||
QVector< QVector<int> > getBoard(); //Return the vector of the board
|
|||
Board(int Nbombs, int rows, int cols); //First constructor
|
|||
Board(QVector< QVector<int> >); //Second constructor
|
|||
int calculateNeighborsBombs(int x,int y); |
|||
int getNumberOfBombs(int x,int y); |
|||
int getNbombs() const; |
|||
QVector< QVector<int> > getEncryption(); |
|||
QVector< QVector<int> > getDecryption(QVector< QVector<int> >); |
|||
|
|||
}; |
|||
|
|||
#endif // BOARD_H
|
After Width: | Height: | Size: 239 B |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 259 B |
After Width: | Height: | Size: 292 B |
After Width: | Height: | Size: 176 B |
After Width: | Height: | Size: 235 B |
After Width: | Height: | Size: 168 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 288 B |
After Width: | Height: | Size: 281 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 136 B |
@ -0,0 +1,14 @@ |
|||
#include <QApplication> |
|||
|
|||
#include "window.h" |
|||
#include "board.h" |
|||
|
|||
int main(int argc, char *argv[]) |
|||
{ |
|||
QApplication app(argc, argv); |
|||
|
|||
myWindow window; |
|||
window.show(); |
|||
|
|||
return app.exec(); |
|||
} |
@ -0,0 +1,24 @@ |
|||
<ui version="4.0"> |
|||
<class>MainWindow</class> |
|||
<widget class="QMainWindow" name="MainWindow" > |
|||
<property name="geometry" > |
|||
<rect> |
|||
<x>0</x> |
|||
<y>0</y> |
|||
<width>400</width> |
|||
<height>300</height> |
|||
</rect> |
|||
</property> |
|||
<property name="windowTitle" > |
|||
<string>MainWindow</string> |
|||
</property> |
|||
<widget class="QMenuBar" name="menuBar" /> |
|||
<widget class="QToolBar" name="mainToolBar" /> |
|||
<widget class="QWidget" name="centralWidget" /> |
|||
<widget class="QStatusBar" name="statusBar" /> |
|||
</widget> |
|||
<layoutDefault spacing="6" margin="11" /> |
|||
<pixmapfunction></pixmapfunction> |
|||
<resources/> |
|||
<connections/> |
|||
</ui> |
After Width: | Height: | Size: 256 KiB |
@ -0,0 +1 @@ |
|||
IDI_ICON1 ICON DISCARDABLE "mineicon.ico" |
@ -0,0 +1,44 @@ |
|||
#include "minesweeperbutton.h" |
|||
#include <QMouseEvent> |
|||
#include <QDebug> |
|||
|
|||
//Detect Left click
|
|||
MineSweeperButton::MineSweeperButton(QWidget *parent) : QPushButton(parent) |
|||
{ |
|||
} |
|||
|
|||
MineSweeperButton::MineSweeperButton(QString blah) : QPushButton(blah) |
|||
{ |
|||
} |
|||
|
|||
//Enables Right clicking
|
|||
void MineSweeperButton::mousePressEvent(QMouseEvent *qMEvent) |
|||
{ |
|||
//If we right click
|
|||
if ( qMEvent->button() == Qt::RightButton ) |
|||
{ |
|||
emit rightButtonClicked(); //emit rightButtonSignal
|
|||
} |
|||
|
|||
//Do default behavior otherwise
|
|||
QPushButton::mousePressEvent(qMEvent); |
|||
} |
|||
|
|||
MineSweeperButton::MineSweeperButton(int row,int column,QWidget *parent) : QPushButton(parent){ |
|||
this->row = row; |
|||
this->column = column; |
|||
this->flaged = false; |
|||
} |
|||
|
|||
int MineSweeperButton::getRow() const{ |
|||
return row; |
|||
} |
|||
int MineSweeperButton::getColumn() const{ |
|||
return column; |
|||
} |
|||
bool MineSweeperButton::isFlaged() const{ |
|||
return flaged; |
|||
} |
|||
void MineSweeperButton::setFlaged(bool flag_state){ |
|||
this->flaged = flag_state; |
|||
} |
@ -0,0 +1,27 @@ |
|||
#ifndef MINESWEEPERBUTTON_H |
|||
#define MINESWEEPERBUTTON_H |
|||
|
|||
#include<QPushButton> |
|||
|
|||
class MineSweeperButton : public QPushButton |
|||
{ |
|||
Q_OBJECT |
|||
public: |
|||
MineSweeperButton(QWidget* = 0); |
|||
MineSweeperButton(QString); |
|||
MineSweeperButton(int,int,QWidget* = 0); |
|||
int getRow() const; |
|||
int getColumn() const; |
|||
bool isFlaged() const; |
|||
void setFlaged(bool); |
|||
void setClicked(bool); |
|||
signals: |
|||
void rightButtonClicked(); |
|||
protected: |
|||
void mousePressEvent(QMouseEvent*); |
|||
private: |
|||
int row,column; |
|||
bool flaged,clicked; |
|||
}; |
|||
|
|||
#endif // MINESWEEPERBUTTON_H
|
@ -0,0 +1,24 @@ |
|||
#------------------------------------------------- |
|||
# |
|||
# Project created by QtCreator 2015-12-20T11:50:09 |
|||
# |
|||
#------------------------------------------------- |
|||
|
|||
QT += widgets |
|||
QT += designer |
|||
RC_FILE = minesico.rc |
|||
|
|||
HEADERS = window.h \ |
|||
minesweeperbutton.h \ |
|||
board.h |
|||
SOURCES = window.cpp \ |
|||
main.cpp \ |
|||
minesweeperbutton.cpp \ |
|||
board.cpp |
|||
|
|||
# install |
|||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/widgets/groupbox |
|||
INSTALLS += target |
|||
|
|||
RESOURCES += \ |
|||
resource.qrc |
@ -0,0 +1,318 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE QtCreatorProject> |
|||
<!-- Written by QtCreator 4.3.0, 2017-06-18T02:40:47. --> |
|||
<qtcreator> |
|||
<data> |
|||
<variable>EnvironmentId</variable> |
|||
<value type="QByteArray">{7e31b7e0-3725-4f5a-a3b0-9d84553c1075}</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.ActiveTarget</variable> |
|||
<value type="int">0</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.EditorSettings</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value> |
|||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> |
|||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> |
|||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> |
|||
<value type="QString" key="language">Cpp</value> |
|||
<valuemap type="QVariantMap" key="value"> |
|||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value> |
|||
</valuemap> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> |
|||
<value type="QString" key="language">QmlJS</value> |
|||
<valuemap type="QVariantMap" key="value"> |
|||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> |
|||
</valuemap> |
|||
</valuemap> |
|||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> |
|||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> |
|||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> |
|||
<value type="int" key="EditorConfiguration.IndentSize">4</value> |
|||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> |
|||
<value type="int" key="EditorConfiguration.MarginColumn">80</value> |
|||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value> |
|||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value> |
|||
<value type="int" key="EditorConfiguration.PaddingMode">1</value> |
|||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> |
|||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value> |
|||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> |
|||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value> |
|||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> |
|||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> |
|||
<value type="int" key="EditorConfiguration.TabSize">8</value> |
|||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value> |
|||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> |
|||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> |
|||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value> |
|||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> |
|||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.PluginSettings</variable> |
|||
<valuemap type="QVariantMap"/> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Target.0</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.9.0 MinGW 32bit</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.9.0 MinGW 32bit</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.59.win32_mingw53_kit</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/Workspace/QT/build-my_minesweeper-Desktop_Qt_5_9_0_MinGW_32bit-Debug</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/Workspace/QT/build-my_minesweeper-Desktop_Qt_5_9_0_MinGW_32bit-Release</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/Workspace/QT/build-my_minesweeper-Desktop_Qt_5_9_0_MinGW_32bit-Profile</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|||
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value> |
|||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> |
|||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> |
|||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> |
|||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> |
|||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> |
|||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|||
<value type="int">0</value> |
|||
<value type="int">1</value> |
|||
<value type="int">2</value> |
|||
<value type="int">3</value> |
|||
<value type="int">4</value> |
|||
<value type="int">5</value> |
|||
<value type="int">6</value> |
|||
<value type="int">7</value> |
|||
<value type="int">8</value> |
|||
<value type="int">9</value> |
|||
<value type="int">10</value> |
|||
<value type="int">11</value> |
|||
<value type="int">12</value> |
|||
<value type="int">13</value> |
|||
<value type="int">14</value> |
|||
</valuelist> |
|||
<value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">my_minesweeper</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/Workspace/QT/my_minesweeper/my_minesweeper.pro</value> |
|||
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">my_minesweeper.pro</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">E:/Workspace/QT/build-my_minesweeper-Desktop_Qt_5_9_0_MinGW_32bit-Debug</value> |
|||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> |
|||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> |
|||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.TargetCount</variable> |
|||
<value type="int">1</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|||
<value type="int">18</value> |
|||
</data> |
|||
<data> |
|||
<variable>Version</variable> |
|||
<value type="int">18</value> |
|||
</data> |
|||
</qtcreator> |
@ -0,0 +1,562 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE QtCreatorProject> |
|||
<!-- Written by QtCreator 3.6.0, 2016-01-02T15:52:17. --> |
|||
<qtcreator> |
|||
<data> |
|||
<variable>EnvironmentId</variable> |
|||
<value type="QByteArray">{d6973540-b17c-4dc7-8548-3d1936c5664b}</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.ActiveTarget</variable> |
|||
<value type="int">0</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.EditorSettings</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value> |
|||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> |
|||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> |
|||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> |
|||
<value type="QString" key="language">Cpp</value> |
|||
<valuemap type="QVariantMap" key="value"> |
|||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value> |
|||
</valuemap> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> |
|||
<value type="QString" key="language">QmlJS</value> |
|||
<valuemap type="QVariantMap" key="value"> |
|||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> |
|||
</valuemap> |
|||
</valuemap> |
|||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> |
|||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> |
|||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> |
|||
<value type="int" key="EditorConfiguration.IndentSize">4</value> |
|||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> |
|||
<value type="int" key="EditorConfiguration.MarginColumn">80</value> |
|||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value> |
|||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value> |
|||
<value type="int" key="EditorConfiguration.PaddingMode">1</value> |
|||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> |
|||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value> |
|||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> |
|||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> |
|||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> |
|||
<value type="int" key="EditorConfiguration.TabSize">8</value> |
|||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value> |
|||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> |
|||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> |
|||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value> |
|||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> |
|||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.PluginSettings</variable> |
|||
<valuemap type="QVariantMap"/> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Target.0</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.1 MinGW 32bit</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.1 MinGW 32bit</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.55.win32_mingw492_kit</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/qtWorkspace/build-my_minesweeper-Desktop_Qt_5_5_1_MinGW_32bit-Debug</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/qtWorkspace/build-my_minesweeper-Desktop_Qt_5_5_1_MinGW_32bit-Release</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/qtWorkspace/build-my_minesweeper-Desktop_Qt_5_5_1_MinGW_32bit-Profile</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> |
|||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> |
|||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> |
|||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> |
|||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> |
|||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|||
<value type="int">0</value> |
|||
<value type="int">1</value> |
|||
<value type="int">2</value> |
|||
<value type="int">3</value> |
|||
<value type="int">4</value> |
|||
<value type="int">5</value> |
|||
<value type="int">6</value> |
|||
<value type="int">7</value> |
|||
<value type="int">8</value> |
|||
<value type="int">9</value> |
|||
<value type="int">10</value> |
|||
<value type="int">11</value> |
|||
<value type="int">12</value> |
|||
<value type="int">13</value> |
|||
<value type="int">14</value> |
|||
</valuelist> |
|||
<value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">my_minesweeper</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">my_minesweeper2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/qtWorkspace/my_minesweeper/my_minesweeper.pro</value> |
|||
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">my_minesweeper.pro</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> |
|||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> |
|||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Target.1</variable> |
|||
<valuemap type="QVariantMap"> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">MIngw</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">MIngw</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{eec87427-6c04-4bfb-9263-80f771d5b719}</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/qtWorkspace/build-my_minesweeper-MIngw-Debug</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/qtWorkspace/build-my_minesweeper-MIngw-Release</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> |
|||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/qtWorkspace/build-my_minesweeper-MIngw-Profile</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> |
|||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> |
|||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|||
</valuemap> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> |
|||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> |
|||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|||
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> |
|||
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> |
|||
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> |
|||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> |
|||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> |
|||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> |
|||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> |
|||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|||
<value type="int">0</value> |
|||
<value type="int">1</value> |
|||
<value type="int">2</value> |
|||
<value type="int">3</value> |
|||
<value type="int">4</value> |
|||
<value type="int">5</value> |
|||
<value type="int">6</value> |
|||
<value type="int">7</value> |
|||
<value type="int">8</value> |
|||
<value type="int">9</value> |
|||
<value type="int">10</value> |
|||
<value type="int">11</value> |
|||
<value type="int">12</value> |
|||
<value type="int">13</value> |
|||
<value type="int">14</value> |
|||
</valuelist> |
|||
<value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">my_minesweeper</value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/qtWorkspace/sample/my_minesweeper.pro</value> |
|||
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">my_minesweeper.pro</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value> |
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> |
|||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> |
|||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|||
</valuemap> |
|||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> |
|||
</valuemap> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.TargetCount</variable> |
|||
<value type="int">2</value> |
|||
</data> |
|||
<data> |
|||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|||
<value type="int">18</value> |
|||
</data> |
|||
<data> |
|||
<variable>Version</variable> |
|||
<value type="int">18</value> |
|||
</data> |
|||
</qtcreator> |
@ -0,0 +1,16 @@ |
|||
<!DOCTYPE RCC><RCC version="1.0"> |
|||
<qresource> |
|||
<file>images/zero.png</file> |
|||
<file>images/one.png</file> |
|||
<file>images/two.png</file> |
|||
<file>images/three.png</file> |
|||
<file>images/four.png</file> |
|||
<file>images/five.png</file> |
|||
<file>images/six.png</file> |
|||
<file>images/seven.png</file> |
|||
<file>images/eight.png</file> |
|||
<file>images/bomb.png</file> |
|||
<file>images/Activatedbomb.png</file> |
|||
<file>images/flag.png</file> |
|||
</qresource> |
|||
</RCC> |
@ -0,0 +1,760 @@ |
|||
#include "window.h" |
|||
|
|||
myWindow::myWindow(QWidget *parent) |
|||
: QMainWindow(parent){ |
|||
|
|||
createActions(); |
|||
createMenus(); |
|||
createToolbarAndBoard(); |
|||
createStatusBar(); |
|||
|
|||
newGame(0); |
|||
|
|||
/*
|
|||
* centralWidget is a widget of type QWidget which will be the centralWidget of myWindow class. |
|||
*/ |
|||
centralWidget = new QWidget(); //Allocate memory for the QWidget object centralWidget
|
|||
setCentralWidget(centralWidget); //Set centralWidget to be the central widget of the class (myWindow)
|
|||
centralWidget->setLayout(layout); //Set centralWidget's layout to layout
|
|||
setWindowTitle("My Cool Minesweeper Game!![*]"); //Set window's title
|
|||
} |
|||
|
|||
/*
|
|||
* createPushButtonGrid takes two integer arguments and returns a QWidget |
|||
* createPushButtonGrid creates a vertical box that contains f_rows horizontal boxes |
|||
* Each horizontal box holds f_cols buttons. Then the vertical box is added to a widget |
|||
* and the widget is returned. |
|||
*/ |
|||
|
|||
QWidget* myWindow::createPushButtonGrid(int pLevel, int f_cols, int f_rows){ |
|||
buttons.push_back(QVector<QVector<MineSweeperButton*> >(f_rows)); |
|||
QWidget* toBeReturned = new QWidget(); //Allocate memory for the QWidget object toBeReturned
|
|||
QVBoxLayout* buttonGrid = new QVBoxLayout(); //Allocate memory for the QVBoxLayout object buttonGrid
|
|||
|
|||
for(int i=0; i<f_rows; ++i){ //For every row that needs to be build
|
|||
//buttons[i].push_back(QVector<MineSweeperButton*>());
|
|||
QHBoxLayout* hbox = new QHBoxLayout(); //Allocate memory for a QHBoxLayout object hbox
|
|||
for(int j=0; j<f_cols; ++j){ //For every column that needs to be build
|
|||
buttons[pLevel][i].push_back(new MineSweeperButton(i,j)); //Allocate memory for a QPushButton object button
|
|||
buttons[pLevel][i][j] -> setFixedSize(SIZE_OF_BUTTON,SIZE_OF_BUTTON); //Set fixed (can't be changed later) size to SIZE_OF_BUTTON
|
|||
connect(buttons[pLevel][i][j], SIGNAL(released()), this, SLOT(handleButtonReleased())); |
|||
connect(buttons[pLevel][i][j], SIGNAL(rightButtonClicked()), this, SLOT(handleRightButton())); |
|||
hbox -> addWidget(buttons[pLevel][i][j]); //Add button widget to hbox
|
|||
} |
|||
hbox -> setSpacing(0); //Set spacing of hbox to 0 so buttons will be close to one another
|
|||
buttonGrid->addLayout(hbox); //Add hbox layout to buttonGrid
|
|||
} |
|||
buttonGrid -> setSpacing(0); //Set buttonGrid's spacing to 0
|
|||
toBeReturned->setLayout(buttonGrid); //Set buttonGrid to be the layout of toBeReturned widget
|
|||
toBeReturned->setFixedSize(SIZE_OF_BUTTON*f_cols,SIZE_OF_BUTTON*f_rows); //Set fixed size of toBeReturned
|
|||
|
|||
return toBeReturned; |
|||
} |
|||
|
|||
void myWindow::createToolbarAndBoard(){ |
|||
/*
|
|||
* levelSelect is a layout of QHBoxLayout type, meaning it is a horizontal box that holds |
|||
* different widgets. levelSelect is used to hold the buttons for level selection. |
|||
*/ |
|||
levelSelect = new QHBoxLayout(); //Allocate memory for the QHBoxLayout object levelSelect
|
|||
|
|||
QPushButton *easy = new QPushButton(tr("&Easy")); //Create button easy
|
|||
connect(easy, SIGNAL(clicked()), this, SLOT(handleEasy())); //Conect button with appropriate slot
|
|||
easy->setStatusTip(tr("Start new game at easy level")); //Set status bar tip
|
|||
|
|||
QPushButton *moderate = new QPushButton(tr("&Moderate")); //Create button moderate
|
|||
connect(moderate, SIGNAL(clicked()), this, SLOT(handleModerate())); //Conect button with appropriate slot
|
|||
moderate->setStatusTip(tr("Start new game at moderate level")); //Set status bar tip
|
|||
|
|||
QPushButton *hard = new QPushButton(tr("&Hard")); //Create button hard
|
|||
connect(hard, SIGNAL(clicked()), this, SLOT(handleHard())); //Conect button with appropriate slot
|
|||
hard->setStatusTip(tr("Start new game at hard level")); //Set status bar tip
|
|||
|
|||
levelSelect->addWidget(easy); //Add button easy to levelSelect Layout
|
|||
levelSelect->addWidget(moderate); //Add button moderate to levelSelect Layout
|
|||
levelSelect->addWidget(hard); //Add button hard to levelSelect Layout
|
|||
|
|||
/*
|
|||
* boardSelect is a widget of QStackedWidget type. It has 3 layers of widgets. At any time only one is vissible. |
|||
* Each widget in every level contains a button grid with the appropriate amount of buttons for each level. |
|||
*/ |
|||
boardSelect = new QStackedWidget(); //Allocate memory for the QStackedWidget object boardSelect
|
|||
boardSelect->addWidget(createPushButtonGrid(0,EASY_COLUMNS,EASY_ROWS)); //Add a widget with button grid for easy level
|
|||
boardSelect->addWidget(createPushButtonGrid(1,MODERATE_COLUMNS,MODERATE_ROWS)); //Add a widget with button grid for moderate level
|
|||
boardSelect->addWidget(createPushButtonGrid(2,HARD_COLUMNS,HARD_ROWS)); //Add a widget with button grid for hard level
|
|||
boardSelect->setCurrentIndex(0); //Set stack index to 0, board for easy level will be shown
|
|||
|
|||
/*
|
|||
* Sxolia edw! |
|||
* |
|||
*/ |
|||
timer= new QTimer(); |
|||
lcdNumber1 = new QLCDNumber; //show time
|
|||
lcdNumber1->setDigitCount(4); |
|||
currentTime=0; |
|||
connect(timer, SIGNAL(timeout()), this, SLOT(updateTimer())); |
|||
|
|||
/*
|
|||
* layout is a layout of type QVBoxLayout,meaning it is a vertical box that holds |
|||
* different widgets and child layouts. layout should contain every widget and layout |
|||
* the basic window has. |
|||
*/ |
|||
layout = new QVBoxLayout; //Allocate memory for the QVBoxLayout object layout
|
|||
layout->addLayout(levelSelect); //Add levelSelect as a child layout to layout
|
|||
layout->addWidget(lcdNumber1); //Add clock widget to layout
|
|||
layout->addWidget(boardSelect); //Add boardSelect widget to layout
|
|||
layout->setSpacing(0); //Set layout's spacing to 0
|
|||
} |
|||
|
|||
/*
|
|||
* createActions allocates memory for the actions of save,save as, open, exit, |
|||
* about and about qt. In this funtion these actions are created, given their |
|||
* properties and connected to their different signals |
|||
*/ |
|||
|
|||
void myWindow::createActions(){ |
|||
|
|||
openAct = new QAction("&Open",this); |
|||
openAct->setShortcuts(QKeySequence::Open); |
|||
openAct->setStatusTip(tr("Open a saved game")); |
|||
connect(openAct, SIGNAL(triggered()), this, SLOT(open())); |
|||
|
|||
saveAct = new QAction("&Save",this); |
|||
saveAct->setShortcuts(QKeySequence::Save); |
|||
saveAct->setStatusTip(tr("Save progress")); |
|||
connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); |
|||
|
|||
saveAsAct = new QAction(tr("Save &As..."), this); |
|||
saveAsAct->setShortcuts(QKeySequence::SaveAs); |
|||
saveAsAct->setStatusTip(tr("Save progress under a new name")); |
|||
connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs())); |
|||
|
|||
exitAct = new QAction(tr("E&xit"), this); |
|||
exitAct->setShortcuts(QKeySequence::Quit); |
|||
exitAct->setStatusTip(tr("Exit the application")); |
|||
connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); |
|||
|
|||
aboutAct = new QAction(tr("&About"),this); |
|||
aboutAct->setStatusTip(tr("Show the application's About box")); |
|||
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); |
|||
|
|||
aboutQtAct = new QAction(tr("About &Qt"),this); |
|||
aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); |
|||
connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); |
|||
} |
|||
|
|||
/*
|
|||
* createMenus allocates memory for the menus file,help and the submenu new |
|||
* In this funtion these menus are created, given their properties and |
|||
* defferent actions are added to them. Also the actions added to the new |
|||
* submenu are created here. |
|||
*/ |
|||
|
|||
void myWindow::createMenus() |
|||
{ |
|||
fileMenu = menuBar()->addMenu(tr("&File")); |
|||
|
|||
newMenu = fileMenu->addMenu(tr("&New")); |
|||
|
|||
newEasy = new QAction("New &Easy Game (10X10)",newMenu); |
|||
newEasy->setStatusTip(tr("New easy game 10 bmbs")); |
|||
connect(newEasy, SIGNAL(triggered()), this, SLOT(handleEasy())); |
|||
|
|||
newModerate = new QAction("New &Moderate Game (12X15)",newMenu); |
|||
newModerate->setStatusTip(tr("New moderate game 40 bmbs")); |
|||
connect(newModerate, SIGNAL(triggered()), this, SLOT(handleModerate())); |
|||
|
|||
newHard = new QAction("New &Hard Game (15X20)",newMenu); |
|||
newHard->setStatusTip(tr("New hard game 70 bmbs")); |
|||
connect(newHard, SIGNAL(triggered()), this, SLOT(handleHard())); |
|||
|
|||
newMenu->addAction(newEasy); |
|||
newMenu->addAction(newModerate); |
|||
newMenu->addAction(newHard); |
|||
|
|||
fileMenu->addMenu(newMenu); |
|||
fileMenu->addAction(openAct); |
|||
fileMenu->addAction(saveAct); |
|||
fileMenu->addAction(saveAsAct); |
|||
fileMenu->addSeparator(); |
|||
fileMenu->addAction(exitAct); |
|||
|
|||
menuBar()->addSeparator(); |
|||
|
|||
helpMenu = menuBar()->addMenu(tr("&Help")); |
|||
helpMenu->addAction(aboutAct); |
|||
helpMenu->addAction(aboutQtAct); |
|||
} |
|||
|
|||
void myWindow::handleEasy(){ |
|||
//Button easy was pressed
|
|||
if(maybeSave()){ |
|||
setWindowModified(false); |
|||
newGame(0); |
|||
} |
|||
} |
|||
|
|||
void myWindow::handleModerate(){ |
|||
//Button moderate was pressed
|
|||
if(maybeSave()){ |
|||
setWindowModified(false); |
|||
newGame(1); |
|||
} |
|||
} |
|||
|
|||
void myWindow::handleHard(){ |
|||
//Button moderate was pressed
|
|||
if(maybeSave()){ |
|||
setWindowModified(false); |
|||
newGame(2); |
|||
} |
|||
} |
|||
|
|||
void myWindow::newGame(int pLevel){ |
|||
level = pLevel; //Set level
|
|||
switch(level){ |
|||
case 0: |
|||
//Set all buttons to initial state
|
|||
for(int i=0; i<EASY_ROWS; ++i){ |
|||
for(int j=0; j<EASY_COLUMNS; ++j){ |
|||
buttons[level][i][j]->setFlat(false); |
|||
buttons[level][i][j]->setFlaged(false); |
|||
buttons[level][i][j]->setIcon(QIcon()); |
|||
} |
|||
} |
|||
board = new Board(BOMBS_ON_EASY,EASY_ROWS,EASY_COLUMNS); //Create a new board
|
|||
boardSelect->setCurrentIndex(level); //Set boardSelect's index to level (0) to show the board for easy
|
|||
this->setFixedSize(250,320); //Set window's size
|
|||
break; |
|||
case 1: |
|||
//Set all buttons to initial state
|
|||
for(int i=0; i<MODERATE_ROWS; ++i){ |
|||
for(int j=0; j<MODERATE_COLUMNS; ++j){ |
|||
buttons[level][i][j]->setFlat(false); |
|||
buttons[level][i][j]->setFlaged(false); |
|||
buttons[level][i][j]->setIcon(QIcon()); |
|||
} |
|||
} |
|||
board = new Board(BOMBS_ON_MODERATE,MODERATE_ROWS,MODERATE_COLUMNS); //Create a new board
|
|||
boardSelect->setCurrentIndex(level); //Set boardSelect's index to level (1) to show the board for moderate
|
|||
this->setFixedSize(330,350); //Set window's size
|
|||
break; |
|||
case 2: |
|||
//Set all buttons to initial state
|
|||
for(int i=0; i<HARD_ROWS; ++i){ |
|||
for(int j=0; j<HARD_COLUMNS; ++j){ |
|||
buttons[level][i][j]->setFlat(false); |
|||
buttons[level][i][j]->setFlaged(false); |
|||
buttons[level][i][j]->setIcon(QIcon()); |
|||
} |
|||
} |
|||
board = new Board(BOMBS_ON_HARD,HARD_ROWS,HARD_COLUMNS); //Create a new board
|
|||
boardSelect->setCurrentIndex(level); //Set boardSelect's index to level (2) to show the board for hard
|
|||
this->setFixedSize(430,420); //Set window's size
|
|||
break; |
|||
default: |
|||
// should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Error","An error has occured at newGame function!"); |
|||
messageBox.setFixedSize(500,200); |
|||
throw(EXCEPTION_EXECUTE_FAULT); |
|||
} |
|||
gameEnded = false; |
|||
trueClickedCounter = 0; |
|||
trueFlagCounter = 0; |
|||
hasStarted=false; |
|||
} |
|||
|
|||
void myWindow::open(){ |
|||
//Action open was pressed
|
|||
QString fileName = QFileDialog::getOpenFileName(this); //Ask user to select a file
|
|||
if (!fileName.isEmpty()) { //User has selected a file
|
|||
if (isUntitled && !isWindowModified()){ //No progress was made in current game
|
|||
loadFile(fileName); //Load selected file
|
|||
} else { //There is unsaved progress in current game
|
|||
if(maybeSave()) //User wants to save?
|
|||
loadFile(fileName); //Load selected file
|
|||
} |
|||
} |
|||
} |
|||
|
|||
bool myWindow::save(){ |
|||
//Action save was pressed
|
|||
if (isUntitled) { //There in no previously saved file of this game
|
|||
return saveAs(); //Create a new file and save there
|
|||
} |
|||
else if(gameEnded){ //Don't save and ended game!
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Game ended!", |
|||
"You can't save an ended game."); |
|||
messageBox.setFixedSize(500,200); |
|||
return true; |
|||
} |
|||
else { //This game has been saved before in a file
|
|||
return saveFile(curFile); //Replace old file with new
|
|||
} |
|||
} |
|||
|
|||
bool myWindow::saveAs(){ |
|||
//Action save as was pressed
|
|||
if(gameEnded){ //Don't save and ended game!
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Game ended!", |
|||
"You can't save an ended game."); |
|||
messageBox.setFixedSize(500,200); |
|||
return true; |
|||
} |
|||
//Ask user for a name and directory of the save file
|
|||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), |
|||
curFile); |
|||
if (fileName.isEmpty()) //No name and directory were givven
|
|||
return false; |
|||
|
|||
return saveFile(fileName); //Save game
|
|||
} |
|||
|
|||
void myWindow::about(){ |
|||
//Action about was pressed
|
|||
QMessageBox::about(this, tr("About Minesweeper"), |
|||
tr("Write shit here!")); |
|||
} |
|||
|
|||
void myWindow::wasModified(){ |
|||
//Action about qt was pressed
|
|||
setWindowModified(true); |
|||
} |
|||
|
|||
void myWindow::createStatusBar(){ //Initialize the status bar
|
|||
statusBar()->showMessage(tr("Good luck!")); |
|||
} |
|||
|
|||
bool myWindow::maybeSave(){ |
|||
if (isWindowModified() && (!gameEnded) ){ //There has been progress on this game
|
|||
QMessageBox::StandardButton ret; |
|||
//Ask user wether to save or not.
|
|||
ret = QMessageBox::warning(this, tr("Minesweeper"), |
|||
tr("The document has been modified.\n" |
|||
"Do you want to save your changes?"), |
|||
QMessageBox::Save | QMessageBox::Discard |
|||
| QMessageBox::Cancel); |
|||
if (ret == QMessageBox::Save) //User wants to save
|
|||
return save(); //Save
|
|||
else if (ret == QMessageBox::Cancel) //User wants to discard
|
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
void myWindow::loadFile(const QString &fileName){ //Load a saved game for directory fileName
|
|||
QFile file(fileName); |
|||
if (!file.open(QFile::ReadOnly | QFile::Text)) { //Try to open file
|
|||
//File could not be oppened
|
|||
QMessageBox::warning(this, tr("Minesweeper"), |
|||
tr("Cannot read file %1:\n%2.") |
|||
.arg(fileName) |
|||
.arg(file.errorString())); |
|||
return; |
|||
} |
|||
|
|||
//File was successfully opened
|
|||
QTextStream in(&file); //Initialize a text stream (same as string stream)
|
|||
QString line = in.readLine(); //Read a line (first line) from the file
|
|||
if(line == "Minesweeper game"){ //If the line is correct this is indeed a Minesweeper game file
|
|||
int lLevel,lRows,lColumns; //Localy used variables
|
|||
lLevel = (in.readLine().toInt()); //Second line is the level
|
|||
switch (lLevel){ //Initialize rows and columns depending on the level
|
|||
case(0): |
|||
lRows = EASY_ROWS; |
|||
lColumns = EASY_COLUMNS; |
|||
break; |
|||
case(1): |
|||
lRows = MODERATE_ROWS; |
|||
lColumns = MODERATE_COLUMNS; |
|||
break; |
|||
case(2): |
|||
lRows = HARD_ROWS; |
|||
lColumns = HARD_COLUMNS; |
|||
break; |
|||
default: |
|||
//Should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Error","An error has occured while reading from the file!"); |
|||
messageBox.setFixedSize(500,200); |
|||
throw(EXCEPTION_READ_FAULT); |
|||
} |
|||
|
|||
//Declare a vector, will hold the encrypted file data
|
|||
QVector< QVector<int> > encrypted(lRows, QVector<int>(lColumns)); |
|||
|
|||
int lRowCounter = 0; |
|||
//Until all neccessery data were readen or reached the end of the file
|
|||
while( (lRowCounter < lRows) && (!in.atEnd()) ) { |
|||
QString line = in.readLine(); //Read next line
|
|||
QStringList fields = line.split(","); //Split lines data in strings at every ","
|
|||
|
|||
if(fields.size() < (lColumns-1)){ //Not enough data on this line
|
|||
//Should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Error", |
|||
"An error has occured while reading from the file!\n Either not enough data on the file or data of wrong format!"); |
|||
messageBox.setFixedSize(500,200); |
|||
throw(EXCEPTION_READ_FAULT); |
|||
} |
|||
for(int i=0; i<fields.size(); ++i){ //For every string produced
|
|||
QString tmp = fields.at(i); |
|||
encrypted[lRowCounter][i] = tmp.toInt(); //Asign value to the vector
|
|||
} |
|||
++lRowCounter; |
|||
} |
|||
|
|||
QVector< QVector<int> > decrypted = board->getDecryption(encrypted); //Decrypt data
|
|||
newGame(lLevel); //Start a new game
|
|||
board = new Board(decrypted); //Create new board
|
|||
lRowCounter = 0; //Restart counter
|
|||
|
|||
/*Read and recreate previously done progress */ |
|||
|
|||
//Until all neccessery data were readen or reached the end of the file
|
|||
while( (lRowCounter < lRows) && (!in.atEnd()) ) { |
|||
QString line = in.readLine(); //Read next line
|
|||
QStringList fields = line.split(","); //Split lines data in strings at every ","
|
|||
|
|||
if(fields.size() < (lColumns-1)){ //Not enough data on this line
|
|||
//Should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Error", |
|||
"An error has occured while reading from the file!\n Either not enough data on the file or data of wrong format!"); |
|||
messageBox.setFixedSize(500,200); |
|||
throw(EXCEPTION_READ_FAULT); |
|||
} |
|||
for(int i=0; i<fields.size(); ++i){ //For every string produced
|
|||
QString tmp = fields.at(i); |
|||
int som = tmp.toInt(); //Asign value to a temporary variable
|
|||
switch(som){ |
|||
case 0: |
|||
//Means button at (lRowCounter,i) hasn't been clicked
|
|||
break; |
|||
case 1: |
|||
//Means button at (lRowCounter,i) has been left-clicked before saving
|
|||
buttons[lLevel][lRowCounter][i]->click(); //Do it again
|
|||
break; |
|||
case -1: |
|||
//Means button at (lRowCounter,i) has been right-clicked before saving
|
|||
buttons[lLevel][lRowCounter][i]->rightButtonClicked(); //Do it again
|
|||
break; |
|||
default: |
|||
//Should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Error", |
|||
"An error has occured while reading from the file!\n Bad data!"); |
|||
messageBox.setFixedSize(500,200); |
|||
throw(EXCEPTION_READ_FAULT); |
|||
} |
|||
} |
|||
++lRowCounter; |
|||
} |
|||
|
|||
/* Data reading is done, am I at the end of the file? */ |
|||
if(!in.atEnd()){ |
|||
//Should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Warning", |
|||
"There are more data at the end of the file!"); |
|||
messageBox.setFixedSize(500,200); |
|||
} |
|||
file.close(); //Close file
|
|||
|
|||
setCurrentFile(fileName); |
|||
statusBar()->showMessage(tr("File loaded"), 2000); |
|||
setWindowModified(false); //No changes done since loading the file
|
|||
return; |
|||
} |
|||
else{ //This is propably not a Minesweeper game file, first line was not Minesweeper game
|
|||
// should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Error", |
|||
"An error has occured while loading the file!\nThis is not a Minesweeper game file!"); |
|||
messageBox.setFixedSize(500,200); |
|||
throw(EXCEPTION_INVALID_HANDLE); |
|||
} |
|||
} |
|||
|
|||
bool myWindow::saveFile(const QString &fileName){ //Save game at fileName directory
|
|||
QFile file(fileName); |
|||
if (!file.open(QFile::WriteOnly | QFile::Text)) { //Try to create an empty file
|
|||
//File could not be created
|
|||
QMessageBox::warning(this, tr("Minesweeper"), |
|||
tr("Cannot write file %1:\n%2.") |
|||
.arg(fileName) |
|||
.arg(file.errorString())); |
|||
return false; |
|||
} |
|||
|
|||
//File was successfully created
|
|||
QTextStream out(&file); //Initialize a text stream (same as string stream)
|
|||
//Declare a vector and put the encrypted file data there
|
|||
QVector< QVector<int> > encrypted = board->getEncryption(); |
|||
out << "Minesweeper game" << endl; //First line is this to distinguish Minesweeper files
|
|||
out << level << endl; //Second line is the level
|
|||
/*
|
|||
* Next line are the encrypted data in this format: |
|||
* b(0,0),b(1,0), ... ,b(columns-1,0) |
|||
* b(1,1), ... ,b(columns-1,1) |
|||
* . . |
|||
* . . |
|||
* . . |
|||
* b(rows-1,0), ... ,b(rows-1,columns-1) |
|||
*/ |
|||
for(int i=0; i<encrypted.size(); ++i){ |
|||
for(int j=0; j<encrypted.at(i).size(); ++j){ |
|||
out << encrypted.at(i).at(j); //Write the encrypted number of the board at (i,j)
|
|||
if(j != (encrypted.at(i).size()-1)) //Make sure we don't put semicolon at the end of the row
|
|||
out << "," ; |
|||
} |
|||
out << endl; |
|||
} |
|||
/*
|
|||
* Information about which buttons have been clicked or flagged (the actual progress) |
|||
* is writen on the file in an array, where 1 represents clicked, -1 represents |
|||
* flaged and 0 represents no activity. This array uses the same format as the previous. |
|||
*/ |
|||
for(int i=0; i<encrypted.size(); ++i){ |
|||
for(int j=0; j<encrypted.at(i).size(); ++j){ |
|||
if(buttons[level][i][j]->isFlat()){ |
|||
out << 1; |
|||
} |
|||
else if(buttons[level][i][j]->isFlaged()){ |
|||
out << -1; |
|||
} |
|||
else |
|||
out << 0; |
|||
if(j != (encrypted.at(i).size()-1)) //Make sure we don't put semicolon at the end of the row
|
|||
out << "," ; |
|||
} |
|||
out << endl; |
|||
} |
|||
file.close(); //Close file
|
|||
setCurrentFile(fileName); |
|||
statusBar()->showMessage(tr("File saved"), 2000); |
|||
setWindowModified(false); |
|||
return true; |
|||
} |
|||
|
|||
void myWindow::setCurrentFile(const QString &fileName){ |
|||
static int sequenceNumber = 1; |
|||
|
|||
isUntitled = fileName.isEmpty(); |
|||
if (isUntitled) { |
|||
curFile = tr("document%1.txt").arg(sequenceNumber++); |
|||
} else { |
|||
curFile = QFileInfo(fileName).canonicalFilePath(); |
|||
} |
|||
|
|||
setWindowModified(false); |
|||
setWindowFilePath(curFile); |
|||
} |
|||
|
|||
void myWindow::handleButtonReleased(){ |
|||
//A button has been left-clicked
|
|||
MineSweeperButton* sendedBy = (MineSweeperButton *) sender(); //Get the button
|
|||
if(!hasStarted){ |
|||
timer->start(1000); |
|||
hasStarted=true; |
|||
} |
|||
if(sendedBy->isFlaged() || sendedBy->isFlat()) //If the button is flaged do nothing
|
|||
return; |
|||
setWindowModified(true); //Else there has been progress since last save
|
|||
switch(board->getNumberOfBombs(sendedBy->getRow(),sendedBy->getColumn())){ |
|||
case 0: //If the button has no neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 0
|
|||
QPixmap pixmap(":/images/zero.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 1: //If the button has one neighboring bomb
|
|||
{ |
|||
//Set the button's icon and size for 1
|
|||
QPixmap pixmap(":/images/one.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 2: //If the button has two neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 2
|
|||
QPixmap pixmap(":/images/two.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 3: //If the button has three neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 3
|
|||
QPixmap pixmap(":/images/three.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 4: //If the button has four neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 4
|
|||
QPixmap pixmap(":/images/four.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 5: //If the button has five neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 5
|
|||
QPixmap pixmap(":/images/five.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 6://If the button has six neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 6
|
|||
QPixmap pixmap(":/images/six.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 7: //If the button has seven neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 7
|
|||
QPixmap pixmap(":/images/seven.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case 8: //If the button has eight neighboring bombs
|
|||
{ |
|||
//Set the button's icon and size for 8
|
|||
QPixmap pixmap(":/images/eight.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
++trueClickedCounter; |
|||
} |
|||
break; |
|||
case -1: //If the button has a bomb
|
|||
{ |
|||
if(!gameEnded){ |
|||
//Set the button's icon and size for activated bomb
|
|||
QPixmap pixmap(":/images/Activatedbomb.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
sendedBy->setFlat(true); |
|||
//Player lost!
|
|||
lose(); |
|||
} |
|||
else{ |
|||
//Set the button's icon and size for bomb
|
|||
QPixmap pixmap(":/images/bomb.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
} |
|||
} |
|||
break; |
|||
default: |
|||
// should never be reached
|
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"Error", |
|||
"Something went wrong in handelButtonReleased slot!"); |
|||
messageBox.setFixedSize(500,200); |
|||
throw(EXCEPTION_INVALID_HANDLE); |
|||
} |
|||
sendedBy->setFlat(true); //Set button to flat so we know it's been left-clicked
|
|||
if(trueClickedCounter == (buttons.at(level).size() * buttons.at(level).at(0).size() - board->getNbombs()) ){ |
|||
if(!gameEnded) |
|||
win(); |
|||
} |
|||
} |
|||
|
|||
void myWindow::handleRightButton(){ |
|||
//A button has been right-clicked
|
|||
MineSweeperButton* sendedBy = (MineSweeperButton *) sender(); //Get the button
|
|||
if(sendedBy->isFlat()) //If the button is flat (has been left-clicked) do nothing
|
|||
return; |
|||
setWindowModified(true); //Else there has been progress since last save
|
|||
if(!(sendedBy->isFlaged())){ //If the button is not already flagged
|
|||
//Set the button's icon and size to flag
|
|||
sendedBy->setFlaged(true); |
|||
QPixmap pixmap(":/images/flag.png"); |
|||
QIcon ButtonIcon(pixmap); |
|||
sendedBy->setIcon(ButtonIcon); |
|||
sendedBy->setIconSize(pixmap.rect().size()); |
|||
if(board->getNumberOfBombs(sendedBy->getRow(),sendedBy->getColumn()) == -1){ |
|||
++trueFlagCounter; |
|||
} |
|||
else |
|||
--trueFlagCounter; |
|||
} |
|||
else{ //The button is already flagged
|
|||
//Un-do the "flagging"
|
|||
sendedBy->setFlaged(false); |
|||
sendedBy->setIcon(QIcon()); |
|||
if(board->getNumberOfBombs(sendedBy->getRow(),sendedBy->getColumn()) == -1){ |
|||
--trueFlagCounter; |
|||
} |
|||
else |
|||
++trueFlagCounter; |
|||
} |
|||
if(trueFlagCounter == board->getNbombs()){ |
|||
if(!gameEnded) |
|||
win(); |
|||
} |
|||
} |
|||
|
|||
void myWindow::lose(){ |
|||
//Player lost
|
|||
gameEnded = true; |
|||
revealAll(); |
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"You lost!", |
|||
"Better luck next time... :)"); |
|||
messageBox.setFixedSize(500,200); |
|||
} |
|||
|
|||
void myWindow::win(){ |
|||
//Player won
|
|||
gameEnded = true; |
|||
revealAll(); |
|||
QMessageBox messageBox; |
|||
messageBox.critical(0,"You won!", |
|||
"Great job! :)"); |
|||
messageBox.setFixedSize(500,200); |
|||
} |
|||
void myWindow::updateTimer(){ |
|||
currentTime++; |
|||
lcdNumber1->display(currentTime); |
|||
} |
|||
|
|||
void myWindow::revealAll() const{ |
|||
for(int i=0; i<buttons.at(level).size(); ++i){ |
|||
for(int j=0; j<buttons.at(level).at(i).size(); ++j){ |
|||
if(! (buttons.at(level).at(i).at(j)->isFlat()) ) |
|||
buttons[level][i][j]->click(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,98 @@ |
|||
#ifndef WINDOW_H |
|||
#define WINDOW_H |
|||
|
|||
#include <QtWidgets> |
|||
#include <QMainWindow> |
|||
#include <QTimer> |
|||
#include <QLCDNumber> |
|||
#include "board.h" |
|||
#include "minesweeperbutton.h" |
|||
|
|||
#define SIZE_OF_BUTTON 20 |
|||
#define EASY_COLUMNS 10 |
|||
#define EASY_ROWS 10 |
|||
#define MODERATE_COLUMNS 15 |
|||
#define MODERATE_ROWS 12 |
|||
#define HARD_COLUMNS 20 |
|||
#define HARD_ROWS 15 |
|||
#define BOMBS_ON_EASY 10 |
|||
#define BOMBS_ON_MODERATE 30 |
|||
#define BOMBS_ON_HARD 70 |
|||
|
|||
class QHBoxLayout; |
|||
class QVBoxLayout; |
|||
|
|||
namespace Ui { |
|||
class myWindow; |
|||
} |
|||
|
|||
class myWindow : public QMainWindow |
|||
{ |
|||
Q_OBJECT |
|||
|
|||
public: |
|||
myWindow(QWidget *parent = 0); |
|||
private slots: |
|||
void updateTimer(); |
|||
void handleEasy(); //For easy button-press
|
|||
void handleModerate(); //For moderate button-press
|
|||
void handleHard(); //For hard button-press
|
|||
void handleButtonReleased(); |
|||
void handleRightButton(); |
|||
//Slots for menu actions
|
|||
void open(); |
|||
bool save(); |
|||
bool saveAs(); |
|||
void about(); |
|||
void wasModified(); |
|||
private: |
|||
Board* board; //A pointer to Board objects, holds actual board
|
|||
int level; //Current game level
|
|||
int currentTime; |
|||
int trueFlagCounter, trueClickedCounter; |
|||
bool isUntitled,gameEnded; |
|||
bool hasStarted; |
|||
QString curFile; //Current file's name
|
|||
QTimer *timer; |
|||
QLCDNumber *lcdNumber1; |
|||
QWidget* centralWidget; //Holds basic window layout
|
|||
QVBoxLayout* layout; //Window layout
|
|||
QHBoxLayout* levelSelect; //Holds buttons easy,moderate,hard
|
|||
QHBoxLayout* counters; |
|||
QStackedWidget* boardSelect; //Has boards for all levels stacked
|
|||
QVector< QVector< QVector<MineSweeperButton*> > > buttons; //Has pointers to all buttons
|
|||
|
|||
//The two basic menus
|
|||
QMenu *fileMenu; |
|||
QMenu *helpMenu; |
|||
|
|||
//Menu actions and submenus
|
|||
QMenu *newMenu; //New is a submenu of File menu
|
|||
QAction *newEasy; |
|||
QAction *newModerate; |
|||
QAction *newHard; |
|||
QAction *openAct; |
|||
QAction *saveAct; |
|||
QAction *saveAsAct; |
|||
QAction *exitAct; |
|||
QAction *aboutAct; |
|||
QAction *aboutQtAct; |
|||
|
|||
QWidget *createPushButtonGrid(int pLevel, int f_cols, int f_rows); //Function that creates a button grid of size cols*rows
|
|||
|
|||
void newGame(int); |
|||
void createActions(); |
|||
void createMenus(); |
|||
void createStatusBar(); |
|||
void createToolbarAndBoard(); |
|||
bool maybeSave(); |
|||
void loadFile(const QString &fileName); |
|||
bool saveFile(const QString &fileName); |
|||
void setCurrentFile(const QString &fileName); |
|||
|
|||
void lose(); |
|||
void revealAll() const; |
|||
void win(); |
|||
}; |
|||
|
|||
#endif |