PDA

View Full Version : Visual Runtime Error On scrolling spinner created in Qml



vishnu717
27th May 2011, 12:13
This is the code in Qml


import Qt 4.7



Rectangle {
width:160; height:200


property int hr
property int min
property int ap

signal titleBarClicked(int hr,int min,int ap)


Row {
y: 0; x: 0; spacing: 5

Spinner {
id: spinner1
width: 50; height: 200
focus: true
model: 13
itemHeight: 30

delegate: Text { font.pixelSize:25;text: index; height: 30 }

}
// Text { text: "Current item index: " + spinner1.currentIndex }


}
Row {
y: 0; x:50; spacing: 20

Spinner {
id: spinner2
width: 60; height: 200
focus: true
model: 60
itemHeight: 30
delegate: Text { font.pixelSize:25;text: index; height: 30 }


}

//Text { text: "Current item index: " + spinner2.currentIndex }
}
Row {
y: 0; x: 110; spacing: 20

Spinner {
id: spinner3
width: 60; height: 200
focus: true

model: name,
name1
Text {
id: name
text:"PM"
font.pixelSize:25
}
Text {
id: name1
text:"AM"
font.pixelSize:25


}


itemHeight: 30
delegate: Text { font.pixelSize:25;text:name; height: 30 }
Text { font.pixelSize:25;text:name1 ; height: 30 }
MouseArea{ anchors.fill : parent ;
hoverEnabled: true
acceptedButtons: Qt.LeftButton

onReleased :
{
titleBarClicked(spinner1.currentIndex,spinner2.cur rentIndex,spinner3.currentIndex)

console.log("First currentIndex = "+ spinner1.currentIndex )
console.log("Second currentIndex = "+ spinner2.currentIndex )
console.log("currentIndex = "+ spinner3.currentIndex )
}
}

}

//Text { text: "Current item index: " + spinner3.currentIndex }
}


Keys.onEnterPressed:{
titleBarClicked(spinner1.currentIndex,spinner2.cur rentIndex,spinner3.currentIndex)
console.log("First currentIndex = "+ spinner1.currentIndex )
console.log("Second currentIndex = "+ spinner2.currentIndex )
console.log("currentIndex = "+ spinner3.currentIndex )
}

}



This is the Function used In qT FOR qML INTEGRATION


QDeclarativeView *qView=new QDeclarativeView(ui->graphicsView);
qView->setSource(QString("main.qml"));
QObject *obj =qView->rootObject();
connect (obj,SIGNAL(titleBarClicked(int,int,int)), this, SLOT(timecal(int,int,int)));




void AlarmSet::timecal(int hr1, int min1,int ap1)
{

hra=hr1;
mina=min1;
apa=ap1;
//HERE THE VALUE IS COMING
}








the value is coming in Qt but when we scroll more than five times , the visual runtime error occurs

This Is the Error Displaying At the Qt Console

QGraphicsItem::ungrabMouse: not a mouse grabber
ASSERT: "!implicit" in file graphicsview\qgraphicsscene.cpp, line 906[/B][/B][/SIZE]