forked from zhengtianzuo/QtQuickExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c622f98
commit 0f71f69
Showing
65 changed files
with
251 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#------------------------------------------------- | ||
# | ||
# Copyright (C) 2003-2103 CamelSoft Corporation | ||
# | ||
#------------------------------------------------- | ||
|
||
QT += qml quick | ||
|
||
CONFIG += c++11 | ||
|
||
SOURCES += main.cpp | ||
|
||
RESOURCES += qml.qrc |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*! | ||
*@file main.cpp | ||
*@brief 程序主文件 | ||
*@version 1.0 | ||
*@section LICENSE Copyright (C) 2003-2103 CamelSoft Corporation | ||
*@author zhengtianzuo | ||
*/ | ||
#include <QGuiApplication> | ||
#include <QQmlApplicationEngine> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); | ||
QGuiApplication app(argc, argv); | ||
|
||
QQmlApplicationEngine engine; | ||
engine.load(QUrl(QLatin1String("qrc:/main.qml"))); | ||
|
||
return app.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
/*! | ||
*@file main.qml | ||
*@brief 主文件 | ||
*@version 1.0 | ||
*@section LICENSE Copyright (C) 2003-2103 CamelSoft Corporation | ||
*@author zhengtianzuo | ||
*/ | ||
import QtQuick 2.7 | ||
import QtQuick.Controls 2.0 | ||
import QtQuick.Layouts 1.0 | ||
|
||
ApplicationWindow { | ||
visible: true | ||
height: gridView.cellHeight*5+4*2 | ||
width: gridView.cellWidth*12+4*2 | ||
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | ||
|
||
ListModel { | ||
id: listModel | ||
} | ||
|
||
Component{ | ||
id: baseListDelegate | ||
|
||
Item { | ||
id: delegateItem | ||
height: gridView.cellHeight | ||
width: gridView.cellWidth | ||
|
||
Rectangle{ | ||
id: delegateItemBack | ||
anchors.fill: parent | ||
color : "#AAAAAA" | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
hoverEnabled: true | ||
onEntered: { | ||
delegateItem.GridView.view.currentIndex = model.index; | ||
} | ||
} | ||
|
||
Image { | ||
id: image | ||
anchors.centerIn: parent | ||
source: face | ||
width: 32 | ||
height: 32 | ||
MouseArea{ | ||
anchors.fill: parent | ||
onClicked: { | ||
console.debug(qsTr("选择的名称: ") + face) | ||
close() | ||
} | ||
} | ||
} | ||
} | ||
|
||
states: [ | ||
State { | ||
name: "isCurrentItem" | ||
when: delegateItem.GridView.isCurrentItem | ||
PropertyChanges { | ||
target: delegateItemBack; color : "#AAAAAA"; | ||
} | ||
}, | ||
State { | ||
name: "isNotCurrentItem" | ||
when: !delegateItem.GridView.isCurrentItem | ||
PropertyChanges { | ||
target: delegateItemBack; color : "transparent"; | ||
} | ||
} | ||
] | ||
} | ||
} | ||
|
||
GridView { | ||
id: gridView | ||
anchors.margins: 4 | ||
anchors.fill: parent | ||
clip: true | ||
cellWidth: 40 | ||
cellHeight: 40 | ||
model: listModel | ||
delegate: baseListDelegate | ||
boundsBehavior: Flickable.StopAtBounds | ||
|
||
Component.onCompleted: { | ||
listModel.append({"face" : "emoji/Face_(0).png"}) | ||
listModel.append({"face" : "emoji/Face_(1).png"}) | ||
listModel.append({"face" : "emoji/Face_(2).png"}) | ||
listModel.append({"face" : "emoji/Face_(3).png"}) | ||
listModel.append({"face" : "emoji/Face_(4).png"}) | ||
listModel.append({"face" : "emoji/Face_(5).png"}) | ||
listModel.append({"face" : "emoji/Face_(6).png"}) | ||
listModel.append({"face" : "emoji/Face_(7).png"}) | ||
listModel.append({"face" : "emoji/Face_(8).png"}) | ||
listModel.append({"face" : "emoji/Face_(9).png"}) | ||
listModel.append({"face" : "emoji/Face_(10).png"}) | ||
listModel.append({"face" : "emoji/Face_(11).png"}) | ||
listModel.append({"face" : "emoji/Face_(12).png"}) | ||
listModel.append({"face" : "emoji/Face_(13).png"}) | ||
listModel.append({"face" : "emoji/Face_(14).png"}) | ||
listModel.append({"face" : "emoji/Face_(15).png"}) | ||
listModel.append({"face" : "emoji/Face_(16).png"}) | ||
listModel.append({"face" : "emoji/Face_(17).png"}) | ||
listModel.append({"face" : "emoji/Face_(18).png"}) | ||
listModel.append({"face" : "emoji/Face_(19).png"}) | ||
listModel.append({"face" : "emoji/Face_(20).png"}) | ||
listModel.append({"face" : "emoji/Face_(21).png"}) | ||
listModel.append({"face" : "emoji/Face_(22).png"}) | ||
listModel.append({"face" : "emoji/Face_(23).png"}) | ||
listModel.append({"face" : "emoji/Face_(24).png"}) | ||
listModel.append({"face" : "emoji/Face_(25).png"}) | ||
listModel.append({"face" : "emoji/Face_(26).png"}) | ||
listModel.append({"face" : "emoji/Face_(27).png"}) | ||
listModel.append({"face" : "emoji/Face_(28).png"}) | ||
listModel.append({"face" : "emoji/Face_(29).png"}) | ||
listModel.append({"face" : "emoji/Face_(30).png"}) | ||
listModel.append({"face" : "emoji/Face_(31).png"}) | ||
listModel.append({"face" : "emoji/Face_(32).png"}) | ||
listModel.append({"face" : "emoji/Face_(33).png"}) | ||
listModel.append({"face" : "emoji/Face_(34).png"}) | ||
listModel.append({"face" : "emoji/Face_(35).png"}) | ||
listModel.append({"face" : "emoji/Face_(36).png"}) | ||
listModel.append({"face" : "emoji/Face_(37).png"}) | ||
listModel.append({"face" : "emoji/Face_(38).png"}) | ||
listModel.append({"face" : "emoji/Face_(39).png"}) | ||
listModel.append({"face" : "emoji/Face_(40).png"}) | ||
listModel.append({"face" : "emoji/Face_(41).png"}) | ||
listModel.append({"face" : "emoji/Face_(42).png"}) | ||
listModel.append({"face" : "emoji/Face_(43).png"}) | ||
listModel.append({"face" : "emoji/Face_(44).png"}) | ||
listModel.append({"face" : "emoji/Face_(45).png"}) | ||
listModel.append({"face" : "emoji/Face_(46).png"}) | ||
listModel.append({"face" : "emoji/Face_(47).png"}) | ||
listModel.append({"face" : "emoji/Face_(48).png"}) | ||
listModel.append({"face" : "emoji/Face_(49).png"}) | ||
listModel.append({"face" : "emoji/Face_(50).png"}) | ||
listModel.append({"face" : "emoji/Face_(51).png"}) | ||
listModel.append({"face" : "emoji/Face_(52).png"}) | ||
listModel.append({"face" : "emoji/Face_(53).png"}) | ||
listModel.append({"face" : "emoji/Face_(54).png"}) | ||
listModel.append({"face" : "emoji/Face_(55).png"}) | ||
listModel.append({"face" : "emoji/Face_(56).png"}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>main.qml</file> | ||
<file>emoji/Face_(0).png</file> | ||
<file>emoji/Face_(1).png</file> | ||
<file>emoji/Face_(2).png</file> | ||
<file>emoji/Face_(3).png</file> | ||
<file>emoji/Face_(4).png</file> | ||
<file>emoji/Face_(5).png</file> | ||
<file>emoji/Face_(6).png</file> | ||
<file>emoji/Face_(7).png</file> | ||
<file>emoji/Face_(8).png</file> | ||
<file>emoji/Face_(9).png</file> | ||
<file>emoji/Face_(10).png</file> | ||
<file>emoji/Face_(11).png</file> | ||
<file>emoji/Face_(12).png</file> | ||
<file>emoji/Face_(13).png</file> | ||
<file>emoji/Face_(14).png</file> | ||
<file>emoji/Face_(15).png</file> | ||
<file>emoji/Face_(16).png</file> | ||
<file>emoji/Face_(17).png</file> | ||
<file>emoji/Face_(18).png</file> | ||
<file>emoji/Face_(19).png</file> | ||
<file>emoji/Face_(20).png</file> | ||
<file>emoji/Face_(21).png</file> | ||
<file>emoji/Face_(22).png</file> | ||
<file>emoji/Face_(23).png</file> | ||
<file>emoji/Face_(24).png</file> | ||
<file>emoji/Face_(25).png</file> | ||
<file>emoji/Face_(26).png</file> | ||
<file>emoji/Face_(27).png</file> | ||
<file>emoji/Face_(28).png</file> | ||
<file>emoji/Face_(29).png</file> | ||
<file>emoji/Face_(30).png</file> | ||
<file>emoji/Face_(31).png</file> | ||
<file>emoji/Face_(32).png</file> | ||
<file>emoji/Face_(33).png</file> | ||
<file>emoji/Face_(34).png</file> | ||
<file>emoji/Face_(35).png</file> | ||
<file>emoji/Face_(36).png</file> | ||
<file>emoji/Face_(37).png</file> | ||
<file>emoji/Face_(38).png</file> | ||
<file>emoji/Face_(39).png</file> | ||
<file>emoji/Face_(40).png</file> | ||
<file>emoji/Face_(41).png</file> | ||
<file>emoji/Face_(42).png</file> | ||
<file>emoji/Face_(43).png</file> | ||
<file>emoji/Face_(44).png</file> | ||
<file>emoji/Face_(45).png</file> | ||
<file>emoji/Face_(46).png</file> | ||
<file>emoji/Face_(47).png</file> | ||
<file>emoji/Face_(48).png</file> | ||
<file>emoji/Face_(49).png</file> | ||
<file>emoji/Face_(50).png</file> | ||
<file>emoji/Face_(51).png</file> | ||
<file>emoji/Face_(52).png</file> | ||
<file>emoji/Face_(53).png</file> | ||
<file>emoji/Face_(54).png</file> | ||
<file>emoji/Face_(55).png</file> | ||
<file>emoji/Face_(56).png</file> | ||
</qresource> | ||
</RCC> |
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters