Skip to content

Commit 4a0c52f

Browse files
author
Artem Marchenko
committed
Initial commit
0 parents  commit 4a0c52f

File tree

9 files changed

+1494
-0
lines changed

9 files changed

+1494
-0
lines changed

components/Page.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import QtQuick 2.0
2+
3+
Rectangle {
4+
width: 100
5+
height: 62
6+
}

cutecontacts.pro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
TEMPLATE = app
2+
3+
QT += qml quick widgets
4+
5+
SOURCES += main.cpp
6+
7+
RESOURCES += qml.qrc
8+
9+
# Additional import path used to resolve QML modules in Qt Creator's code model
10+
QML_IMPORT_PATH =
11+
12+
# Default rules for deployment.
13+
include(deployment.pri)

cutecontacts.pro.user

Lines changed: 1311 additions & 0 deletions
Large diffs are not rendered by default.

deployment.pri

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
android-no-sdk {
2+
target.path = /data/user/qt
3+
export(target.path)
4+
INSTALLS += target
5+
} else:android {
6+
x86 {
7+
target.path = /libs/x86
8+
} else: armeabi-v7a {
9+
target.path = /libs/armeabi-v7a
10+
} else {
11+
target.path = /libs/armeabi
12+
}
13+
export(target.path)
14+
INSTALLS += target
15+
} else:unix {
16+
isEmpty(target.path) {
17+
qnx {
18+
target.path = /tmp/$${TARGET}/bin
19+
} else {
20+
target.path = /opt/$${TARGET}/bin
21+
}
22+
export(target.path)
23+
}
24+
INSTALLS += target
25+
}
26+
27+
export(INSTALLS)

main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <QApplication>
2+
#include <QQmlApplicationEngine>
3+
4+
int main(int argc, char *argv[])
5+
{
6+
QApplication app(argc, argv);
7+
8+
QQmlApplicationEngine engine;
9+
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
10+
11+
return app.exec();
12+
}

main.qml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import QtQuick 2.2
2+
import QtQuick.Controls 1.1
3+
4+
import "pages"
5+
6+
ApplicationWindow {
7+
visible: true
8+
width: 320
9+
height: 568
10+
title: qsTr("Hello World")
11+
12+
StackView {
13+
id: pageStack
14+
15+
delegate: StackViewDelegate {
16+
pushTransition: StackViewTransition {
17+
PropertyAnimation {
18+
target: enterItem
19+
property: "y"
20+
from: 568
21+
to: 0
22+
easing.type: Easing.InOutQuad
23+
duration: 300
24+
}
25+
}
26+
popTransition: StackViewTransition {
27+
PropertyAnimation {
28+
target: exitItem
29+
property: "y"
30+
from: 0
31+
to: 568
32+
easing.type: Easing.InOutQuad
33+
duration: 300
34+
}
35+
}
36+
}
37+
38+
initialItem: MainPage {
39+
// anchors.fill: parent
40+
}
41+
}
42+
43+
44+
45+
Text {
46+
text: qsTr("Hello World")
47+
anchors.centerIn: parent
48+
}
49+
}

pages/MainPage.qml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import QtQuick 2.2
2+
import QtQuick.Controls 1.1
3+
4+
Item {
5+
Rectangle {
6+
id: titleBar
7+
anchors.left: parent.left
8+
anchors.right: parent.right
9+
anchors.top: parent.top
10+
height: 44
11+
color: "white"
12+
Label {
13+
anchors.centerIn: parent
14+
text: "All Contacts"
15+
}
16+
17+
ToolButton {
18+
anchors.right: parent.right
19+
anchors.verticalCenter: parent.verticalCenter
20+
text: "+"
21+
onClicked: {
22+
console.log("Plus clicked")
23+
pageStack.push("qrc:///pages/NewContactPage.qml")
24+
}
25+
}
26+
}
27+
Rectangle {
28+
id: searchBar
29+
anchors.left: parent.left
30+
anchors.right: parent.right
31+
anchors.top: titleBar.bottom
32+
height: 44
33+
color: "white"
34+
TextField {
35+
anchors.fill: parent
36+
horizontalAlignment: Text.AlignHCenter
37+
placeholderText: "Search"
38+
}
39+
}
40+
}

pages/NewContactPage.qml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import QtQuick 2.2
2+
import QtQuick.Controls 1.1
3+
4+
Item {
5+
Rectangle {
6+
id: titleBar
7+
anchors.left: parent.left
8+
anchors.right: parent.right
9+
anchors.top: parent.top
10+
height: 44
11+
color: "white"
12+
Label {
13+
anchors.centerIn: parent
14+
text: "New Contact"
15+
}
16+
17+
ToolButton {
18+
anchors.right: parent.right
19+
anchors.verticalCenter: parent.verticalCenter
20+
text: "Done"
21+
onClicked: {
22+
console.log("Done clicked")
23+
pageStack.pop()
24+
}
25+
}
26+
}
27+
28+
}

qml.qrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<RCC>
2+
<qresource prefix="/">
3+
<file>main.qml</file>
4+
<file>components/Page.qml</file>
5+
<file>pages/MainPage.qml</file>
6+
<file>pages/NewContactPage.qml</file>
7+
</qresource>
8+
</RCC>

0 commit comments

Comments
 (0)