Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
|
c3e3f4e53f | 4 weeks ago |
|
ad9305e422 | 4 weeks ago |
|
eb5e628ed7 | 4 weeks ago |
@ -0,0 +1,82 @@
|
||||
# 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*/
|
@ -0,0 +1,11 @@
|
||||
TEMPLATE = app
|
||||
CONFIG += console c++17
|
||||
CONFIG -= app_bundle
|
||||
CONFIG -= qt
|
||||
|
||||
SOURCES += \
|
||||
dice.cpp \
|
||||
main.cpp
|
||||
|
||||
HEADERS += \
|
||||
dice.h
|
@ -0,0 +1,12 @@
|
||||
#include "dice.h"
|
||||
|
||||
#include <random>
|
||||
|
||||
unsigned int dice(unsigned int minDice, unsigned int maxDice)
|
||||
{
|
||||
static std::random_device rd;
|
||||
static std::mt19937 gen(rd());
|
||||
static std::uniform_int_distribution<> distrib(minDice, maxDice);
|
||||
|
||||
return distrib(gen);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
#ifndef _dice_hpp_
|
||||
#define _dice_hpp_
|
||||
|
||||
/** Petit jeu avec des static dedans **/
|
||||
unsigned int dice(unsigned int minDice, unsigned int maxDice);
|
||||
|
||||
#endif
|
@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
cout << "Hello World!" << endl;
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import QtQuick 2.15
|
||||
import I.hate.dictators 1.0
|
||||
|
||||
Rectangle {
|
||||
width: lv.width
|
||||
height: 30
|
||||
|
||||
required property string name
|
||||
required property string iso
|
||||
required property CountryType self
|
||||
|
||||
|
||||
Text {
|
||||
text: parent.name
|
||||
font.pixelSize: 20
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Image {
|
||||
id: flag
|
||||
source: "qrc:/assets/flags/"+parent.iso+".svg"
|
||||
height: parent.height - 4
|
||||
anchors.right: parent.right
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
mainWindow.selectedCountry = self
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
import QtQuick 2.15
|
||||
import I.hate.dictators 1.0
|
||||
|
||||
Rectangle {
|
||||
required property CountryType country
|
||||
|
||||
color: "lightgrey"
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
Image {
|
||||
id: choosenFlag
|
||||
source: country?'qrc:/assets/flags/'+country.iso+'.svg':''
|
||||
fillMode: Image.PreserveAspectFit
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
Text {
|
||||
id: nameText
|
||||
text: country ? country.name : ""
|
||||
font.pixelSize: 50
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
Text {
|
||||
text: country ? country.capital : ""
|
||||
font.pixelSize: nameText.font.pixelSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
Text {
|
||||
text: country ? country.region : ""
|
||||
font.pixelSize: nameText.font.pixelSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
@ -1,33 +1,29 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import I.hate.dictators 1.0
|
||||
|
||||
Window {
|
||||
width: 640
|
||||
height: 480
|
||||
visible: true
|
||||
title: qsTr("Flags of the world")
|
||||
id: mainWindow
|
||||
property CountryType selectedCountry
|
||||
|
||||
ListView {
|
||||
id: lv
|
||||
anchors.fill: parent
|
||||
anchors.left: parent.left
|
||||
height: parent.height
|
||||
width: parent.width / 3
|
||||
model: countries
|
||||
delegate: Rectangle {
|
||||
width: lv.width/3
|
||||
height: 30
|
||||
|
||||
Text {
|
||||
text: name
|
||||
font.pixelSize: 20
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
delegate: Country {
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
source: "qrc:/assets/flags/"+iso+".svg"
|
||||
height: parent.height - 4
|
||||
CountryDetail {
|
||||
anchors.right: parent.right
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
anchors.left: lv.right
|
||||
height: parent.height
|
||||
country: selectedCountry
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue