diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-07-02 16:57:06 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-07-08 10:53:28 +0000 |
commit | 29ee340c89a0868117fcab9d52688d62f06b5162 (patch) | |
tree | 6a35d39e67fbca15637de89d2ad751d556ff3fc8 /examples | |
parent | 3aba5f184c95fdb2e35acea5029d2b56ea3185d0 (diff) |
Speedup CalendarView
- Use spacing inside the positioner instead of setting padding
inside each and every cell.
- Resize cells in C++ to avoid those crazy expensive width/height
bindings (which lead to binding loops in certain circumstances).
- Cache QDate::currentDate() for model.today
- Remove the dynamic font size calculation. We can add that as an
example in the docs.
Before:
RESULT : tst_CreationTime::testCalendar():"CalendarView":
12.5 msecs per iteration (total: 100, iterations: 8)
After:
RESULT : tst_CreationTime::testCalendar():"CalendarView":
6.5 msecs per iteration (total: 52, iterations: 8)
Change-Id: Iba6c57cb543e1e90518d920f6b52bd981160e27c
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quick/calendar/main.qml | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/examples/quick/calendar/main.qml b/examples/quick/calendar/main.qml index 628d93d6..db7c2561 100644 --- a/examples/quick/calendar/main.qml +++ b/examples/quick/calendar/main.qml @@ -126,8 +126,6 @@ ApplicationWindow { delegate: Text { text: model.day - width: delegate.contentItem.width / 7 - height: delegate.contentItem.height / 6 opacity: model.month === delegate.month ? 1 : 0 color: model.today ? Theme.accentColor : Theme.textColor minimumPointSize: 8 |