diff -r 000000000000 -r c0e13d2503b9 FontsTab.qml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FontsTab.qml Tue May 27 12:00:47 2014 +0200 @@ -0,0 +1,96 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Dialogs 1.1 + +Item { + width: 640 + height: 480 + //SystemPalette { id: palette } + clip: true + + + // + FontDialog { + id: fontDialog + visible: false + modality: Qt.WindowModal + scalableFonts: fontDialogScalableFonts.checked + nonScalableFonts: fontDialogNonScalableFonts.checked + monospacedFonts: fontDialogMonospacedFonts.checked + proportionalFonts: fontDialogProportionalFonts.checked + title: qsTr("Choose a font") + font: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal }) + currentFont: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal }) + onCurrentFontChanged: { console.log("CurrentFontChanged: " + currentFont) } + onAccepted: { console.log("Accepted: " + font) } + onRejected: { console.log("Rejected") } + } + // + + Flow { + anchors.fill: parent + anchors.margins: 12 + spacing: 10 + + CheckBox { + id: fontDialogScalableFonts + text: "Scalable fonts" + Binding on checked { value: fontDialog.scalableFonts } + } + CheckBox { + id: fontDialogNonScalableFonts + text: "Non scalable fonts" + Binding on checked { value: fontDialog.nonScalableFonts } + } + CheckBox { + id: fontDialogMonospacedFonts + text: "Monospaced fonts" + Binding on checked { value: fontDialog.monospacedFonts } + } + CheckBox { + id: fontDialogProportionalFonts + text: "Proportional fonts" + Binding on checked { value: fontDialog.proportionalFonts } + } + + Text { + text: "Current font:" + } + + Text { + id: fontLabel + color: palette.windowText + text: "" + fontDialog.font.family + " - " + fontDialog.font.pointSize + "" + MouseArea { + anchors.fill: parent + onClicked: fontDialog.open() + } + } + + Text { + id: textFontDemoLowerCase + text: "abcdefghijklmnopqrstyvwxyz" + font: fontDialog.font + } + + Text { + id: textFontDemoUpperCase + text: "ABCDEFGHIJKLMNOPQRSTYVWXYZ" + font: fontDialog.font + } + + Text { + id: textFontDemoDigits + text: "0123456789" + font: fontDialog.font + } + + + Button { + text: qsTr("Select Font") + onClicked: fontDialog.open() + } + + + } +}