View Single Post
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#253
Originally Posted by khuong View Post
@Marxian

Adding a timer to "No videos found" text seems to solve the problem. Work perfectly now!
Code:
	 Text {
		id: nvfText
            	anchors.centerIn: dimmer
            	font.pixelSize: largeFontSize
            	font.bold: true
            	color: "grey"
            	horizontalAlignment: Text.AlignHCenter
            	verticalAlignment: Text.AlignVCenter
		text: "No videos found"
		visible: false		
		Timer { interval: 1000; running: true; onTriggered: nvfText.visible = (videoListModel.status == XmlListModel.Ready) && (videoList.count == 0) }        		
        }
That wouldn't work on a slow internet connection, since it would likely take longer than 1 second for the model to be in ready status. I will use a more robust solution when I get round to it.
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 

The Following User Says Thank You to marxian For This Useful Post: