import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.14
import io.qt.MainWindow 1.0
Window {
visible: true
width: 1080
height: 720
title: qsTr("Hello World")
MainWindow{
id: mainWindow
onMoveCircle: {
print("received")
view.currentIndex= index;
}
}
Component {
id: appDelegate
Item {
width: 100; height: 100
scale: PathView.iconScale
Image {
id: myIcon
y: 20; anchors.horizontalCenter: parent.horizontalCenter
source: icon
}
Text {
anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
text: name
}
MouseArea {
anchors.fill: parent
onClicked: view.currentIndex = index
}
}
}
ListModel {
id: appModel
ListElement { name: "Music"; icon: "pics/elem_1.png" }
ListElement { name: "Movies"; icon: "pics/elem_2.png" }
ListElement { name: "Camera"; icon: "pics/elem_3.png" }
ListElement { name: "Calendar"; icon: "pics/elem_4.png" }
ListElement { name: "Messaging"; icon: "pics/elem_5.png" }
ListElement { name: "Todo List"; icon: "pics/elem_6.png" }
}
PathView {
id: view
anchors.fill: parent
anchors.bottomMargin: 150
anchors.topMargin: 50
pathItemCount: 7
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
highlightRangeMode: PathView.StrictlyEnforceRange
model: appModel
delegate: appDelegate
path: Path {
startX: 0; startY: view.height/2
PathAttribute { name: "iconScale"; value: 0.2 }
PathAttribute { name: "iconOpacity"; value: 10.2 }
PathAttribute { name: "iconOrder"; value: 0 }
PathLine {x: view.width / 2; y: view.height/2 }
PathAttribute { name: "iconScale"; value: 1.2 }
PathAttribute { name: "iconOpacity"; value: 1 }
PathAttribute { name: "iconOrder"; value: 8 }
PathLine {x: view.width; y: view.height/2 }
}
}
Button{
id:draw
width: 50
height: 50
x: parent.width/2-width/2
y: parent.height*0.8-height
onClicked: {
mainWindow.rotate()
}
}
}
SLOT z CPP
void MainWindow::rotate(){
for(int i=0; i< 5; i++){
QThread::msleep(1000);
emit moveCircle(idx);
idx++;
}
}
/* for(int i=0; i< 5; i++){
QThread::msleep(500);
qDebug()<<"emit";
emit moveCircle(i);
}
}*/
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}