I'm trying to learn how to use Qt (5.11.1) for GUI applications so I've done a simple memory game where 12 tiles are displayed and every time the user clicks on a tile it will show an image, so they have to match them into 6 pairs of images. There's a countdown of 1 minute. Game ends if the time is up before all 6 pairs have been matched, or if all 6 pairs are matched, only that it will show different messages to the user. There is no next level, saving score or anything, so it's very simple.
There's a countdown of 1 minute. Game ends if the time is up before all 6 pairs have been matched, or if all 6 pairs are matched, only that it will show different messages to the user. There is no next level, saving score or anything, so it's very simple.
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Memory game</string>
</property>
<property name="styleSheet">
<string notr="true">#centralWidget {
background-image: url(://background.png);
}
#howToPlay {
color: white;
}
#countdown {
color: white;
}
#scoring {
color: white;
}
#lblScore {
qproperty-alignment: AlignCenter;
color: white;
background: teal;
border: 3px solid silver;
border-radius: 7px;
}</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLabel" name="howToPlay">
<property name="geometry">
<rect>
<x>160</x>
<y>40</y>
<width>471</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Click on two tiles and try to match the images</string>
</property>
</widget>
<widget class="QLabel" name="countdown">
<property name="geometry">
<rect>
<x>690</x>
<y>20</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>cronómetro</string>
</property>
</widget>
<widget class="QLabel" name="scoring">
<property name="geometry">
<rect>
<x>330</x>
<y>520</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Puntos:</string>
</property>
</widget>
<widget class="QLabel" name="lblScore">
<property name="geometry">
<rect>
<x>410</x>
<y>510</y>
<width>41</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>70</x>
<y>80</y>
<width>661</width>
<height>431</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QPushButton" name="tile10">
<property name="geometry">
<rect>
<x>180</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile05">
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile06">
<property name="geometry">
<rect>
<x>180</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile09">
<property name="geometry">
<rect>
<x>20</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile07">
<property name="geometry">
<rect>
<x>340</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile03">
<property name="geometry">
<rect>
<x>340</x>
<y>20</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile11">
<property name="geometry">
<rect>
<x>340</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile01">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>130</width>
<height>110</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile04">
<property name="geometry">
<rect>
<x>500</x>
<y>20</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile12">
<property name="geometry">
<rect>
<x>500</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile02">
<property name="geometry">
<rect>
<x>180</x>
<y>20</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile08">
<property name="geometry">
<rect>
<x>500</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<zorder>frame</zorder>
<zorder>howToPlay</zorder>
<zorder>countdown</zorder>
<zorder>score</zorder>
<zorder>lblScore</zorder>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Memory game</string>
</property>
<property name="styleSheet">
<string notr="true">#centralWidget {
background-image: url(://background.png);
}
#howToPlay {
color: white;
}
#countdown {
color: white;
}
#scoring {
color: white;
}
#lblScore {
qproperty-alignment: AlignCenter;
color: white;
background: teal;
border: 3px solid silver;
border-radius: 7px;
}</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLabel" name="howToPlay">
<property name="geometry">
<rect>
<x>160</x>
<y>40</y>
<width>471</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Click on two tiles and try to match the images</string>
</property>
</widget>
<widget class="QLabel" name="countdown">
<property name="geometry">
<rect>
<x>690</x>
<y>20</y>
<width>81</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>cronómetro</string>
</property>
</widget>
<widget class="QLabel" name="scoring">
<property name="geometry">
<rect>
<x>330</x>
<y>520</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Puntos:</string>
</property>
</widget>
<widget class="QLabel" name="lblScore">
<property name="geometry">
<rect>
<x>410</x>
<y>510</y>
<width>41</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>70</x>
<y>80</y>
<width>661</width>
<height>431</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QPushButton" name="tile10">
<property name="geometry">
<rect>
<x>180</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile05">
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile06">
<property name="geometry">
<rect>
<x>180</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile09">
<property name="geometry">
<rect>
<x>20</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile07">
<property name="geometry">
<rect>
<x>340</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile03">
<property name="geometry">
<rect>
<x>340</x>
<y>20</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile11">
<property name="geometry">
<rect>
<x>340</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile01">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>130</width>
<height>110</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile04">
<property name="geometry">
<rect>
<x>500</x>
<y>20</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile12">
<property name="geometry">
<rect>
<x>500</x>
<y>300</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile02">
<property name="geometry">
<rect>
<x>180</x>
<y>20</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="tile08">
<property name="geometry">
<rect>
<x>500</x>
<y>160</y>
<width>131</width>
<height>111</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<zorder>frame</zorder>
<zorder>howToPlay</zorder>
<zorder>countdown</zorder>
<zorder>score</zorder>
<zorder>lblScore</zorder>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>