Trying to get rid of our QML timer.
We now connect to our window after animation signal from C++.
It looks like it works much better now. Less UI lags smother animation.
2 import QtQuick.Controls 1.2
3 import QtQuick.Dialogs 1.1
4 import QtQuick.Layouts 1.1
5 import Qt.labs.settings 1.0
11 property alias font: textFontDemoLowerCase.font;
12 property alias checkBoxScalableFonts: checkBoxScalableFonts.checked
13 property alias checkBoxNonScalableFonts: checkBoxNonScalableFonts.checked
14 property alias checkBoxMonospacedFonts: checkBoxMonospacedFonts.checked
15 property alias checkBoxProportionalFonts: checkBoxProportionalFonts.checked
24 modality: Qt.WindowModal
25 scalableFonts: checkBoxScalableFonts.checked
26 nonScalableFonts: checkBoxNonScalableFonts.checked
27 monospacedFonts: checkBoxMonospacedFonts.checked
28 proportionalFonts: checkBoxProportionalFonts.checked
29 title: qsTr("Choose a font")
30 font: textFontDemoLowerCase.font
31 currentFont: textFontDemoLowerCase.font
32 //onCurrentFontChanged: { console.log("CurrentFontChanged: " + currentFont) }
33 //onFontChanged: { console.log("FontChanged: " + font) }
35 //console.log("Accepted: " + font);
36 textFontDemoLowerCase.font = currentFont;
38 display.font = currentFont;
39 display.swapBuffers();
40 //textFontDemoUpperCase.font = currentFont;
41 //textFontDemoDigits.font = currentFont;
43 //onRejected: { console.log("Rejected") }
53 text: "Current font: <b>" + textFontDemoLowerCase.font.family + " - " + textFontDemoLowerCase.font.pointSize +"</b>"
56 onClicked: fontDialog.open()
65 id: textFontDemoLowerCase
67 text: "abcdefghijklmnopqrstyvwxyz"
68 font: Qt.font({ family: "Arial", pointSize: 16, weight: Font.Normal })
72 id: textFontDemoUpperCase
74 text: "ABCDEFGHIJKLMNOPQRSTYVWXYZ"
75 font: textFontDemoLowerCase.font
79 id: textFontDemoDigits
82 font: textFontDemoLowerCase.font
86 //Font selection options
93 id: checkBoxScalableFonts
94 text: "Scalable fonts"
96 //Binding on checked { value: fontDialog.scalableFonts }
99 id: checkBoxNonScalableFonts
100 text: "Non scalable fonts"
102 //Binding on checked { value: fontDialog.nonScalableFonts }
105 id: checkBoxMonospacedFonts
106 text: "Monospaced fonts"
108 //Binding on checked { value: fontDialog.monospacedFonts }
111 id: checkBoxProportionalFonts
112 text: "Proportional fonts"
114 //Binding on checked { value: fontDialog.proportionalFonts }
121 text: qsTr("Change font")
123 //We had to do this double magic cause otherwise our font list
124 //would not reflect our options.
125 fontDialog.setVisible(true);