Advertisement
peter9477

Qt scrolling lagginess test app

Jun 15th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 1.1
  2.  
  3. Rectangle {
  4.     width: 1024
  5.     height: 600
  6.  
  7.     Flickable {
  8.         anchors.fill: parent
  9.         contentHeight: content.paintedHeight
  10.         clip: true
  11.  
  12.         TextEdit {
  13.             id: content
  14.  
  15.             width: parent.width
  16.             readOnly: true
  17.             font.pointSize: 22
  18.  
  19.             text: ""
  20.         }
  21.     }
  22.  
  23.     Component.onCompleted: {
  24.         var array = [];
  25.         for (var i = 0; i < 1000; i++) {
  26.             array.push("adding another line " + i);
  27.             if (Math.random() < 0.25)
  28.                 array.push("    just to be different we added this line");
  29.         }
  30.         content.text = array.join("\n");
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement