Skip to content
Snippets Groups Projects
Commit dd516949 authored by Le Tiec Aymeric's avatar Le Tiec Aymeric
Browse files

Début de la partie d'interface

parent 0ff02d62
Branches
No related tags found
No related merge requests found
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
*.qbs.user*
CMakeLists.txt.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe
# Directories with generated files
.moc/
.obj/
.pch/
.rcc/
.uic/
/build*/
cmake_minimum_required(VERSION 3.16)
project(Jeu_2048 VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(appJeu_2048
main.cpp
)
qt_add_qml_module(appJeu_2048
URI Jeu_2048
VERSION 1.0
QML_FILES
Main.qml
SOURCES bouton.h bouton.cpp
SOURCES case.h case.cpp
QML_FILES Partie.qml
QML_FILES Menu_de_Controle.qml
)
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
set_target_properties(appJeu_2048 PROPERTIES
# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appJeu_2048
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
target_link_libraries(appJeu_2048
PRIVATE Qt6::Quick
)
include(GNUInstallDirs)
install(TARGETS appJeu_2048
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
import QtQuick
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
}
import QtQuick
Item {
}
import QtQuick
Item {
id: _item
width: 600
height: 900
Rectangle {
id: background
color: "#ffffff"
anchors.fill: parent
Rectangle {
id: grille
y: 300
width: 500
height: 500
color: "#a49381"
anchors.horizontalCenterOffset: 0
anchors.horizontalCenter: parent.horizontalCenter
Rectangle {
id: rectangle1
x: 20
y: 20
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle2
x: 140
y: 20
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
}
Rectangle {
id: rectangle3
x: 260
y: 20
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle4
x: 380
y: 20
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle5
x: 20
y: 140
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle6
x: 140
y: 140
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
}
Rectangle {
id: rectangle7
x: 260
y: 140
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle8
x: 380
y: 140
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle9
x: 20
y: 260
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle10
x: 140
y: 260
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
}
Rectangle {
id: rectangle11
x: 260
y: 260
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle12
x: 380
y: 260
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle13
x: 20
y: 380
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle14
x: 140
y: 380
width: 100
height: 100
color: "#c9c6ac"
rotation: 0
}
Rectangle {
id: rectangle15
x: 260
y: 380
width: 100
height: 100
color: "#c9c6ac"
}
Rectangle {
id: rectangle16
x: 380
y: 380
width: 100
height: 100
color: "#c9c6ac"
}
}
Rectangle {
id: rectangle
x: 50
y: 50
width: 200
height: 150
color: "#edcc5f"
Text {
id: _text
width: 200
height: 150
text: qsTr("2048")
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 50
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Tahoma"
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
}
}
Rectangle {
id: rectangle17
x: 270
y: 50
width: 130
height: 65
color: "#3c3a33"
}
Rectangle {
id: rectangle18
x: 420
y: 50
width: 130
height: 65
color: "#3c3a33"
}
Rectangle {
id: rectangle19
x: 270
y: 135
width: 130
height: 65
color: "#f65e3d"
}
Text {
id: _text1
x: 50
y: 225
width: 500
height: 50
text: qsTr("Join the numbers and get the 2048 tile!")
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
}
}
Rectangle {
id: rectangle20
x: 420
y: 135
width: 130
height: 65
color: "#f65e3d"
}
}
#include "bouton.h"
Bouton::Bouton() {}
#ifndef BOUTON_H
#define BOUTON_H
class Bouton
{
public:
Bouton();
};
#endif // BOUTON_H
#include "case.h"
case ::case (){
}
#ifndef CASE_H
#define CASE_H
class case {public:
case();
};
#endif // CASE_H
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("Jeu_2048", "Main");
return app.exec();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment