Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.13
- import QtQuick.Window 2.13
- import QtQuick.Controls 2.13
- Item {
- property int page: 1
- Text {
- id: text
- text: ""
- anchors.horizontalCenter: parent.horizontalCenter
- font.family: "Courier New"
- color: "#f5edba"
- font.pixelSize: 15
- }
- Image {
- id: img
- sourceSize.width: 460
- sourceSize.height: 460
- anchors.top: text.bottom
- anchors.topMargin: 10
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- states:
- [
- State {
- name: "1"; when: page == 1;
- PropertyChanges {
- target: img;
- source: "images/1.jpg";
- anchors.topMargin: 10
- }
- },
- State {
- name: "2"; when: page == 2;
- PropertyChanges {
- target: img;
- source: "images/2.jpg";
- anchors.topMargin: 10
- }
- },
- State {
- name: "3"; when: page == 3;
- PropertyChanges {
- target: img;
- source: "images/3.jpg";
- }
- },
- State {
- name: "4"; when: page == 4;
- PropertyChanges {
- target: img;
- source: "images/4.jpg";
- }
- },
- State {
- name: "5"; when: page == 5;
- PropertyChanges {
- target: img;
- source: "images/5.jpg";
- }
- },
- State {
- name: "6"; when: page == 6;
- PropertyChanges {
- target: img;
- source: "images/6.jpg";
- }
- }
- ]
- }
- Button {
- id:leftButton
- font.pixelSize: 20
- text: "<="
- font.family: "Courier New"
- background: Rectangle {
- color: "#f5edba"
- border.width: 1
- radius: 4
- }
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: img.left
- anchors.rightMargin: 10
- onClicked: {
- if ((page - 1) > 0) page = page - 1
- }
- }
- Button {
- id:rightButton
- font.pixelSize: 20
- text: "=>"
- font.family: "Courier New"
- background: Rectangle {
- color: "#f5edba"
- border.width: 1
- radius: 4
- }
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: img.right
- anchors.leftMargin: 10
- onClicked: {
- if (page + 1 < 7) page = page + 1
- }
- }
- Button {
- id: home
- text: "На главную"
- font.family: "Courier New"
- font.pixelSize: 20
- background: Rectangle {
- color: "#f5edba"
- border.width: 1
- radius: 4
- }
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottomMargin: 10
- onClicked: {
- window.status = 0
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement