Remove declarativeimports/test.
We moved it to kdeexamples
This commit is contained in:
parent
cdba0a2222
commit
b353a65502
@ -1,94 +0,0 @@
|
||||
// -*- coding: iso-8859-1 -*-
|
||||
/*
|
||||
* Copyright 2011 Sebastian Kügler <mart@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtras
|
||||
|
||||
PlasmaExtras.App {
|
||||
id: app
|
||||
width: 800
|
||||
height: 600
|
||||
|
||||
property string formFactor: "tablet"
|
||||
|
||||
navigation: navigationItem
|
||||
content: contentItem
|
||||
|
||||
Item {
|
||||
id: navigationItem
|
||||
width: navigationWidth + space
|
||||
height: parent.height
|
||||
// PlasmaExtras.Title {
|
||||
// text: "Navigation is zoo"
|
||||
// elide: Text.ElideMiddle
|
||||
// anchors { top: parent.top; left: parent.left; right: parent.right; }
|
||||
// }
|
||||
Column {
|
||||
id: navigationColumn
|
||||
anchors.fill: navigationItem
|
||||
width: navigationWidth
|
||||
PlasmaExtras.Title {
|
||||
width: navigationColumn.width
|
||||
visible: widthCheck.checked
|
||||
text: "Navigation Pane."
|
||||
elide: Text.ElideRight
|
||||
//anchors { top: parent.top; left: parent.left; topMargin: 48; }
|
||||
}
|
||||
}
|
||||
PlasmaComponents.CheckBox {
|
||||
id: widthCheck
|
||||
text: checked ? "Make big" : " "
|
||||
//width: navigationWidth
|
||||
checked: navigationWidth > 200
|
||||
anchors { left: parent.left; leftMargin: space; bottomMargin: space; bottom: parent.bottom; }
|
||||
onCheckedChanged: {
|
||||
var w = !checked ? 48 : 340;
|
||||
//print(" new: " + w);
|
||||
navigationWidth = w;
|
||||
}
|
||||
//width: contentItem.width
|
||||
}
|
||||
//Rectangle { color: "blue"; opacity: 0.3; anchors.fill: parent; }
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: contentItem
|
||||
source: "gallery/Extras.qml"
|
||||
width: app.width - navigationWidth - space*2
|
||||
parent: contentArea
|
||||
anchors.margins: space*2
|
||||
//Rectangle { color: "green"; opacity: 0.8; anchors.fill: contentItem; }
|
||||
}
|
||||
|
||||
onWidthChanged: {
|
||||
//return;
|
||||
if (width < 340 + 200) {
|
||||
//print("window changed: small " + width);
|
||||
navigationWidth = 48;
|
||||
} else {
|
||||
//print("window changed: tablet " + width);
|
||||
navigationWidth = 340;
|
||||
}
|
||||
widthCheck.checked = navigationWidth > 200;
|
||||
}
|
||||
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
height: childrenRect.height
|
||||
property int implicitHeight: childrenRect.height
|
||||
|
||||
PlasmaComponents.ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
spacing: 5
|
||||
PlasmaComponents.ToolButton {
|
||||
text: "ToolButton"
|
||||
}
|
||||
PlasmaComponents.ProgressBar {
|
||||
value: 0.3
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
text: "Busy widgets"
|
||||
}
|
||||
Component.onCompleted: {
|
||||
app.tools = toolbarlayout
|
||||
}
|
||||
}
|
||||
Column {
|
||||
spacing: 20
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Busy Indicator"
|
||||
}
|
||||
|
||||
PlasmaComponents.BusyIndicator { }
|
||||
|
||||
PlasmaComponents.BusyIndicator { running: true }
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Progress Bar"
|
||||
}
|
||||
|
||||
Text { text: "Horizontal" }
|
||||
|
||||
PlasmaComponents.ProgressBar {
|
||||
value: 0.3
|
||||
}
|
||||
|
||||
PlasmaComponents.ProgressBar {
|
||||
indeterminate: true
|
||||
}
|
||||
|
||||
PlasmaComponents.ProgressBar {
|
||||
minimumValue: 0
|
||||
maximumValue: 100
|
||||
value: 30
|
||||
}
|
||||
|
||||
Text { text: "Vertical" }
|
||||
Row {
|
||||
spacing: 20
|
||||
PlasmaComponents.ProgressBar {
|
||||
value: 0.3
|
||||
orientation: Qt.Vertical
|
||||
width: 20
|
||||
height: 100
|
||||
}
|
||||
PlasmaComponents.ProgressBar {
|
||||
value: 0.4
|
||||
orientation: Qt.Vertical
|
||||
width: 20
|
||||
height: 120
|
||||
}
|
||||
PlasmaComponents.ProgressBar {
|
||||
orientation: Qt.Vertical
|
||||
width: 20
|
||||
height: 100
|
||||
indeterminate: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
height: childrenRect.height
|
||||
|
||||
PlasmaComponents.ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
spacing: 5
|
||||
PlasmaComponents.Button {
|
||||
text: "Button"
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
text: "toolbar of the Buttons page"
|
||||
}
|
||||
PlasmaComponents.TextField {}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
app.tools = toolbarlayout
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: 20
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Buttons"
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: bt1
|
||||
width: 140
|
||||
height: 30
|
||||
text: "Button"
|
||||
|
||||
onClicked: {
|
||||
console.log("Clicked");
|
||||
}
|
||||
|
||||
Keys.onTabPressed: bt2.forceActiveFocus();
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: bt2
|
||||
width: 140
|
||||
height: 30
|
||||
text: "Checkable Button"
|
||||
checkable: true
|
||||
|
||||
onCheckedChanged: {
|
||||
if (checked)
|
||||
console.log("Button Checked");
|
||||
else
|
||||
console.log("Button Unchecked");
|
||||
}
|
||||
|
||||
Keys.onTabPressed: bt3.forceActiveFocus();
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: bt3
|
||||
width: 140
|
||||
height: 30
|
||||
text: "Different Font"
|
||||
font {
|
||||
pixelSize: 20
|
||||
family: "Helvetica"
|
||||
}
|
||||
|
||||
Keys.onTabPressed: bt4.forceActiveFocus();
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: bt4
|
||||
width: 140
|
||||
height: 30
|
||||
text: "Icon Button"
|
||||
iconSource: "system-shutdown"
|
||||
|
||||
Keys.onTabPressed: bt5.forceActiveFocus();
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: bt5
|
||||
width: 140
|
||||
height: 30
|
||||
iconSource: "system-switch-user"
|
||||
|
||||
Keys.onTabPressed: bt1.forceActiveFocus();
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
width: 140
|
||||
height: 30
|
||||
text: "Disabled Button"
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
|
||||
|
||||
PlasmaComponents.Page {
|
||||
height: childrenRect.height
|
||||
property int implicitHeight: childrenRect.height
|
||||
|
||||
PlasmaComponents.ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
spacing: 5
|
||||
PlasmaComponents.ToolButton {
|
||||
text: "ToolButton"
|
||||
}
|
||||
PlasmaComponents.CheckBox {
|
||||
text: "Checkbox in the toolbar"
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
text: "hello"
|
||||
}
|
||||
Component.onCompleted: {
|
||||
app.tools = toolbarlayout
|
||||
}
|
||||
}
|
||||
Column {
|
||||
spacing: 20
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Check Box"
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
width: 140
|
||||
height: 30
|
||||
text: "Check Box 1"
|
||||
|
||||
onCheckedChanged: {
|
||||
if (checked)
|
||||
console.log("CheckBox checked");
|
||||
else
|
||||
console.log("CheckBox unchecked");
|
||||
}
|
||||
onClicked: {
|
||||
console.log("CheckBox clicked");
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
height: 30
|
||||
text: "Disabled"
|
||||
enabled: false
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
height: 30
|
||||
text: ""
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
height: 30
|
||||
text: "A loooooooooooooong text"
|
||||
}
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Radio Button"
|
||||
}
|
||||
|
||||
PlasmaComponents.RadioButton {
|
||||
width: 140
|
||||
height: 30
|
||||
text: "RadioButton"
|
||||
|
||||
onCheckedChanged: {
|
||||
if (checked)
|
||||
console.log("RadioButton Checked");
|
||||
else
|
||||
console.log("RadioButton Unchecked");
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.Switch { }
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Button Row"
|
||||
}
|
||||
|
||||
PlasmaComponents.ButtonRow {
|
||||
spacing: 20
|
||||
PlasmaComponents.RadioButton { text: "A" }
|
||||
PlasmaComponents.RadioButton { text: "B" }
|
||||
PlasmaComponents.RadioButton { text: "C" }
|
||||
}
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Button Column"
|
||||
}
|
||||
|
||||
PlasmaComponents.ButtonColumn {
|
||||
spacing: 20
|
||||
PlasmaComponents.RadioButton { text: "Alice" }
|
||||
PlasmaComponents.RadioButton { text: "Bob" }
|
||||
PlasmaComponents.RadioButton { text: "Charles" }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,156 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtras
|
||||
|
||||
PlasmaExtras.App {
|
||||
id: app
|
||||
width: 1000
|
||||
height: 600
|
||||
navigationWidth: 200
|
||||
|
||||
property string formFactor: "tablet"
|
||||
|
||||
navigation: pageSelector
|
||||
content: page
|
||||
|
||||
ListView {
|
||||
id: pageSelector
|
||||
width: navigationWidth
|
||||
anchors {
|
||||
fill: parent
|
||||
top: content.top
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
model: ListModel {
|
||||
id: pagesModel
|
||||
ListElement {
|
||||
page: "Buttons.qml"
|
||||
title: "Buttons"
|
||||
}
|
||||
ListElement {
|
||||
page: "CheckableButtons.qml"
|
||||
title: "Checkable buttons"
|
||||
}
|
||||
ListElement {
|
||||
page: "Busy.qml"
|
||||
title: "Busy indicators"
|
||||
}
|
||||
ListElement {
|
||||
page: "Sliders.qml"
|
||||
title: "Sliders"
|
||||
}
|
||||
ListElement {
|
||||
page: "Scrollers.qml"
|
||||
title: "Scrollers"
|
||||
}
|
||||
ListElement {
|
||||
page: "Texts.qml"
|
||||
title: "Text elements"
|
||||
}
|
||||
ListElement {
|
||||
page: "TextEditing.qml"
|
||||
title: "Text Editing"
|
||||
}
|
||||
ListElement {
|
||||
page: "Misc.qml"
|
||||
title: "Misc stuff"
|
||||
}
|
||||
ListElement {
|
||||
page: "Extras.qml"
|
||||
title: "Extras"
|
||||
}
|
||||
ListElement {
|
||||
page: "Locale.qml"
|
||||
title: "Locale stuff"
|
||||
}
|
||||
}
|
||||
delegate: ListItem {
|
||||
enabled: true
|
||||
Column {
|
||||
Label {
|
||||
text: title
|
||||
}
|
||||
}
|
||||
onClicked: pageStack.replace(Qt.createComponent(page))
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
id: page
|
||||
clip: true
|
||||
width: app.contentWidth
|
||||
|
||||
// anchors {
|
||||
// top: toolBar.bottom
|
||||
// left: pageSelector.right
|
||||
// right: verticalScrollBar.left
|
||||
// bottom: horizontalScrollBar.top
|
||||
// leftMargin: 5
|
||||
// rightMargin: 5
|
||||
// topMargin: 5
|
||||
// bottomMargin: 5
|
||||
// }
|
||||
anchors.fill: parent
|
||||
contentWidth: app.contentWidth
|
||||
contentHeight: pageStack.currentPage.implicitHeight
|
||||
|
||||
PageStack {
|
||||
id: pageStack
|
||||
//toolBar: app.toolBar
|
||||
//width: page.width
|
||||
width: contentWidth
|
||||
height: currentPage.implicitHeight
|
||||
initialPage: Qt.createComponent("Buttons.qml")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ScrollBar {
|
||||
id: horizontalScrollBar
|
||||
|
||||
stepSize: 30
|
||||
|
||||
flickableItem: page
|
||||
orientation: Qt.Horizontal
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: verticalScrollBar.left
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
|
||||
ScrollBar {
|
||||
id: verticalScrollBar
|
||||
|
||||
stepSize: 30
|
||||
|
||||
orientation: Qt.Vertical
|
||||
flickableItem: page
|
||||
anchors {
|
||||
top: content.top
|
||||
right: parent.right
|
||||
bottom: horizontalScrollBar.top
|
||||
}
|
||||
}
|
||||
}
|
@ -1,484 +0,0 @@
|
||||
// -*- coding: iso-8859-1 -*-
|
||||
/*
|
||||
* Author: Giorgos Tsiapaliwkas <terietor@gmail.com>
|
||||
* Date: Wed Feb 15 2012, 18:28:32
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2 or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.locale 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property int minimumHeight: 200
|
||||
property int minimumWidth: 500
|
||||
Column {
|
||||
id: column
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
spacing: 20
|
||||
Text {
|
||||
id: text1
|
||||
anchors.horizontalCenter: column.horizontalCenter
|
||||
text: "<B>This is a test plasmoid for the locale bindings</B>"
|
||||
color: "black"
|
||||
}
|
||||
|
||||
Text {
|
||||
id: text2
|
||||
anchors.horizontalCenter: column.horizontalCenter
|
||||
text: "<B>If you see this text,that means that every " +
|
||||
" non printable property/method has been already set. And it works!!</B>"
|
||||
color: "black"
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: bt1
|
||||
anchors.horizontalCenter: column.horizontalCenter
|
||||
text: "click in order to test the Locale component"
|
||||
onClicked:{
|
||||
console.log("=====Locale Component====")
|
||||
console.log("country:" + locale.country)
|
||||
|
||||
locale.binaryUnitDialect = Locale.IECBinaryDialect
|
||||
locale.calendarSystem = Locale.CopticCalendar
|
||||
|
||||
locale.countryDivisionCode = "AL"
|
||||
console.log("countryDivisionCode:" + locale.countryDivisionCode)
|
||||
|
||||
console.log("currencyCode:" + locale.currencyCode)
|
||||
|
||||
locale.currencySymbol = "$"
|
||||
console.log("currencySymbol:" + locale.currencySymbol)
|
||||
|
||||
locale.dateTimeDigitSet = Locale.EasternArabicIndicDigits
|
||||
|
||||
locale.dateFormat = "Y"
|
||||
console.log("dateFormat:" + locale.dateFormat)
|
||||
|
||||
locale.dateFormatShort = "Y"
|
||||
console.log("dateFormatShort:" + locale.dateFormatShort)
|
||||
|
||||
locale.dateMonthNamePossessive = false
|
||||
console.log("dateMonthNamePossessive:" + locale.dateMonthNamePossessive)
|
||||
|
||||
locale.decimalPlaces = 2
|
||||
console.log("decimalPlaces:" + locale.decimalPlaces)
|
||||
|
||||
locale.decimalSymbol = "."
|
||||
console.log("decimalSymbol:" + locale.decimalSymbol)
|
||||
|
||||
locale.digitSet = Locale.EasternArabicIndicDigits
|
||||
console.log("digitSet:" + locale.digitSet)
|
||||
|
||||
console.log("language:" + locale.language)
|
||||
|
||||
locale.measureSystem = Locale.Imperial
|
||||
|
||||
locale.monetaryDecimalPlaces = 3
|
||||
console.log("monetaryDecimalPlaces:" + locale.monetaryDecimalPlaces)
|
||||
|
||||
locale.monetaryDecimalSymbol = "."
|
||||
console.log("monetaryDecimalSymbol:" + locale.monetaryDecimalSymbol)
|
||||
|
||||
locale.monetaryDigitSet = Locale.EasternArabicIndicDigits
|
||||
|
||||
locale.monetaryThousandsSeparator = "."
|
||||
console.log("monetaryThousandsSeparator:" + locale.monetaryThousandsSeparator)
|
||||
|
||||
locale.negativeMonetarySignPosition = Locale.AfterMoney
|
||||
|
||||
locale.negativePrefixCurrencySymbol = false
|
||||
console.log("negativePrefixCurrencySymbol:" + locale.negativePrefixCurrencySymbol)
|
||||
|
||||
locale.negativeSign = "-"
|
||||
console.log("negativeSign:" + locale.negativeSign)
|
||||
|
||||
locale.pageSize = 6
|
||||
console.log("pageSize:" + locale.pageSize)
|
||||
|
||||
locale.positiveMonetarySignPosition = Locale.AfterMoney
|
||||
|
||||
locale.positivePrefixCurrencySymbol = false
|
||||
console.log("positivePrefixCurrencySymbol:" + locale.positivePrefixCurrencySymbol)
|
||||
|
||||
locale.positiveSign = "+"
|
||||
console.log("positiveSign:" + locale.positiveSign)
|
||||
|
||||
locale.thousandsSeparator = "."
|
||||
console.log("thousandsSeparator:" + locale.thousandsSeparator)
|
||||
|
||||
locale.weekDayOfPray = 10
|
||||
console.log("weekDayOfPray:" + locale.weekDayOfPray)
|
||||
|
||||
locale.weekNumberSystem = Locale.FirstFullWeek
|
||||
|
||||
locale.weekStartDay = 3
|
||||
console.log("weekStartDay:" + locale.weekStartDay)
|
||||
|
||||
locale.workingWeekEndDay = 6
|
||||
console.log("workingWeekEndDay:" + locale.workingWeekEndDay)
|
||||
|
||||
locale.workingWeekStartDay = 2
|
||||
console.log("workingWeekStartDay:" + locale.workingWeekEndDay)
|
||||
|
||||
console.log("use12Clock:" + locale.use12Clock)
|
||||
|
||||
console.log("defaultLanguage:" + locale.defaultLanguage)
|
||||
|
||||
console.log("defaultCountry:" + locale.defaultCountry)
|
||||
|
||||
console.log("defaultCurrencyCode:" + locale.defaultCurrencyCode)
|
||||
|
||||
console.log("the useTranscript:" + locale.useTranscript)
|
||||
|
||||
console.log("the encodingMib:" + locale.encodingMib)
|
||||
|
||||
for (var i in locale.languageList) {
|
||||
console.log("languageList:" + locale.languageList[i])
|
||||
}
|
||||
|
||||
for (var i in locale.currencyCodeList) {
|
||||
console.log("currencyCodeList:" + locale.currencyCodeList[i])
|
||||
}
|
||||
|
||||
for (var i in locale.installedLanguages) {
|
||||
console.log("installedLanguages:" + locale.installedLanguages[i])
|
||||
}
|
||||
|
||||
for (var i in locale.allCountriesList) {
|
||||
console.log("allCountriesList:" + locale.allCountriesList[i])
|
||||
}
|
||||
|
||||
console.log("formatDate:" + locale.formatDate("2010-05-05"))
|
||||
|
||||
console.log("formatDateTime:" + locale.formatDateTime("2010-05-05"))
|
||||
|
||||
console.log("formatMoney:" + locale.formatMoney(10))
|
||||
|
||||
console.log("formatLong:" + locale.formatLong(10))
|
||||
|
||||
console.log("formatByteSize:" + locale.formatByteSize(10))
|
||||
|
||||
console.log("formatDuration:" + locale.formatDuration(10))
|
||||
|
||||
console.log("prettyFormatDuration:" + locale.prettyFormatDuration(10))
|
||||
|
||||
console.log("formatLocaleTime:" + locale.formatLocaleTime("11:12:13"))
|
||||
|
||||
console.log("dayPeriodText:" + locale.dayPeriodText("11:22:33"))
|
||||
|
||||
console.log("readMoney:" + locale.readMoney("$ 21"))
|
||||
|
||||
console.log("readNumber:" + locale.readNumber(10.0,3))
|
||||
|
||||
console.log("readDate:" + locale.readDate("2004-02-01", Locale.IsoFormat))
|
||||
|
||||
console.log("readTime:" + locale.readTime("11:22:33 AM"))
|
||||
|
||||
console.log("readLocaleTime:" + locale.readLocaleTime("11:12:13 AM"))
|
||||
|
||||
console.log("fileEncodingMib:" + locale.fileEncodingMib)
|
||||
|
||||
console.log("languageCodeToName:" + locale.languageCodeToName("en_US"))
|
||||
|
||||
console.log("isApplicationTranslatedInto:" + locale.isApplicationTranslatedInto("en_US"))
|
||||
|
||||
console.log("removeAcceleratorMarker:" + locale.removeAcceleratorMarker("&*hello"))
|
||||
|
||||
console.log("convertDigits:" + locale.convertDigits(locale.digitSet, Locale.ArabicDigits))
|
||||
|
||||
for (var i in locale.allDigitSetsList) {
|
||||
console.log("allDigitSetsList:" + locale.allDigitSetsList[i])
|
||||
}
|
||||
|
||||
console.log("===========end===========")
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: bt2
|
||||
property variant hash
|
||||
anchors.horizontalCenter: column.horizontalCenter
|
||||
text: "click in order to test the CalendarSystem component"
|
||||
onClicked:{
|
||||
console.log("=====CalendarSystem Component====")
|
||||
|
||||
console.log("calendarLabel:" + calendar.calendarLabel)
|
||||
|
||||
console.log("epoch:" + calendar.epoch)
|
||||
|
||||
console.log("earliestValidDate:" + calendar.earliestValidDate)
|
||||
|
||||
console.log("latestValidDate:" + calendar.latestValidDate)
|
||||
|
||||
console.log("shortYearWindowStartYear:" + calendar.shortYearWindowStartYear)
|
||||
|
||||
console.log("weekStartDay:" + locale.weekStartDay)
|
||||
|
||||
console.log("isLunar:" + calendar.isLunar)
|
||||
|
||||
console.log("isLunisolar:" + calendar.isLunisolar)
|
||||
|
||||
console.log("isSolar:" + calendar.isSolar)
|
||||
|
||||
console.log("isProleptic:" + calendar.isProleptic)
|
||||
//Q_INVOKABLE methods
|
||||
|
||||
console.log("isValidIsoWeekDate:" + calendar.isValidIsoWeekDate(2012, 2, 3))
|
||||
|
||||
console.log("isValid:" + calendar.isValid("2012-02-03"))
|
||||
|
||||
console.log("year:" + calendar.year("2012-02-03"))
|
||||
|
||||
console.log("month:" + calendar.month("2012-02-03"))
|
||||
|
||||
console.log("day:" + calendar.day("2012-02-03"))
|
||||
|
||||
console.log("eraName:" + calendar.eraName("2012-02-03"))
|
||||
|
||||
console.log("eraYear:" + calendar.eraYear("2012-02-03"))
|
||||
|
||||
console.log("yearInEra:" + calendar.yearInEra("2012-02-03"))
|
||||
|
||||
console.log("addYears:" + calendar.addYears("2012-02-03", 3))
|
||||
|
||||
console.log("addMonthss:" + calendar.addMonths("2012-02-03", 3))
|
||||
|
||||
console.log("addDays:" + calendar.addDays("2012-02-03", 3))
|
||||
|
||||
console.log("yearsDifference:" + calendar.yearsDifference("2010-02-03", "2012-02-03"))
|
||||
|
||||
console.log("monthsDifference:" + calendar.monthsDifference("2012-02-03", "2012-04-03"))
|
||||
|
||||
console.log("daysDifference:" + calendar.daysDifference("2012-02-03", "2012-02-13"))
|
||||
|
||||
console.log("monthsInYear:" + calendar.monthsInYear(2012))
|
||||
|
||||
console.log("weeksInYear:" + calendar.weeksInYear(2012, CalendarSystem.SimpleWeek))
|
||||
|
||||
console.log("daysInYear:" + calendar.daysInYear("2012-02-03"))
|
||||
|
||||
console.log("daysInMonth:" + calendar.daysInMonth(2012, 8))
|
||||
|
||||
console.log("daysInWeek:" + calendar.daysInWeek("2012-02-03"))
|
||||
|
||||
console.log("dayOfYear:" + calendar.dayOfYear("2012-02-03"))
|
||||
|
||||
console.log("week:" + calendar.week("2012-02-03", CalendarSystem.SimpleWeek))
|
||||
|
||||
console.log("isLeapYear:" + calendar.isLeapYear(2012))
|
||||
|
||||
console.log("firstDayOfYear:" + calendar.firstDayOfYear(2012))
|
||||
|
||||
console.log("lastDayOfYear:" + calendar.lastDayOfYear(2012))
|
||||
|
||||
console.log("firstDayOfMonth:" + calendar.firstDayOfMonth(2012, 02))
|
||||
|
||||
console.log("lastDayOfMonth:" + calendar.lastDayOfMonth(2012, 02))
|
||||
|
||||
console.log("monthName:" + calendar.monthName(02, 2012))
|
||||
|
||||
console.log("weekDayName:" + calendar.weekDayName(3))
|
||||
|
||||
console.log("formatDate:" + calendar.formatDate("2012-02-03", CalendarSystem.Year, CalendarSystem.ShortNumber, CalendarSystem.SimpleWeek))
|
||||
|
||||
console.log("readDate:" + calendar.readDate("2012-02-03", CalendarSystem.IsoFormat))
|
||||
|
||||
console.log("applyShortYearWindow:" + calendar.applyShortYearWindow(50))
|
||||
|
||||
console.log("calendarSystem:" + calendar.calendarSystem)
|
||||
console.log("getDate:")
|
||||
hash = calendar.getDate("2012-02-03")
|
||||
for (var i in hash) {
|
||||
console.log(" " + i, "=", hash[i])
|
||||
}
|
||||
|
||||
console.log("dateDifference:")
|
||||
hash = calendar.dateDifference("2012-01-01", "2014-03-03")
|
||||
for (var i in hash) {
|
||||
console.log(" " + i, "=", hash[i])
|
||||
}
|
||||
|
||||
for (var i in calendar.calendarSystemsList) {
|
||||
console.log("calendarSystemsList:" + calendar.calendarSystemsList[i])
|
||||
}
|
||||
|
||||
console.log("===============end===============")
|
||||
}
|
||||
}
|
||||
|
||||
Locale {
|
||||
id: locale
|
||||
|
||||
binaryUnitDialect: Locale.DefaultBinaryUnits
|
||||
onBinaryUnitDialectChanged: {
|
||||
console.log("the binaryUnitDialect property has been changed")
|
||||
}
|
||||
|
||||
calendarSystem: Locale.QDateCalendar
|
||||
onCalendarSystemChanged: {
|
||||
console.log("the calendarSystem property has been changed")
|
||||
}
|
||||
|
||||
onCurrencyCodeChanged: {
|
||||
console.log("the currencyCode property has been changed")
|
||||
}
|
||||
|
||||
currencySymbol: "$"
|
||||
onCurrencySymbolChanged: {
|
||||
console.log("the currencySymbol property has been changed")
|
||||
}
|
||||
|
||||
countryDivisionCode: "AD"
|
||||
onCountryDivisionCodeChanged: {
|
||||
console.log("the countryDivisionCode property has been changed")
|
||||
}
|
||||
|
||||
dateFormat: "y"
|
||||
onDateFormatChanged: {
|
||||
console.log("the dateFormat property has been changed")
|
||||
}
|
||||
|
||||
dateFormatShort: "y"
|
||||
onDateFormatShortChanged: {
|
||||
console.log("the dateFormatShort property has been changed")
|
||||
}
|
||||
|
||||
dateMonthNamePossessive: true
|
||||
onDateMonthNamePossessiveChanged: {
|
||||
console.log("the dateMonthNamePossessive property has been changed")
|
||||
}
|
||||
|
||||
dateTimeDigitSet: Locale.ArabicDigits
|
||||
onDateTimeDigitSetChanged: {
|
||||
console.log("the dateTimeDigitSet property has been changed")
|
||||
}
|
||||
|
||||
decimalPlaces: 1
|
||||
onDecimalPlacesChanged: {
|
||||
console.log("the decimalPlaces property has been changed")
|
||||
}
|
||||
|
||||
decimalSymbol: ","
|
||||
onDecimalSymbolChanged: {
|
||||
console.log("the decimalSymbol property has been changed")
|
||||
}
|
||||
|
||||
digitSet: Locale.ArabicDigits
|
||||
onDigitSetChanged: {
|
||||
console.log("the digitSet property has been changed")
|
||||
}
|
||||
|
||||
measureSystem: Locale.Metric
|
||||
onMeasureSystemChanged: {
|
||||
console.log("the measureSystem property has been changed")
|
||||
}
|
||||
|
||||
monetaryDecimalPlaces: 2
|
||||
onMonetaryDecimalPlacesChanged: {
|
||||
console.log("the monetaryDecimalPlaces property has been changed")
|
||||
}
|
||||
|
||||
monetaryDecimalSymbol: ","
|
||||
onMonetaryDecimalSymbolChanged: {
|
||||
console.log("the monetaryDecimalSymbol property has been changed")
|
||||
}
|
||||
|
||||
monetaryDigitSet: Locale.ArabicDigits
|
||||
onMonetaryDigitSetChanged: {
|
||||
console.log("the monetaryDigitSet property has been changed")
|
||||
}
|
||||
|
||||
monetaryThousandsSeparator: ","
|
||||
onMonetaryThousandsSeparatorChanged: {
|
||||
console.log("the monetaryThousandsSeparator property has been changed")
|
||||
}
|
||||
|
||||
negativeMonetarySignPosition: Locale.ParensAround
|
||||
onNegativeMonetarySignPositionChanged: {
|
||||
console.log("the negativeMonetarySignPosition property has been changed")
|
||||
}
|
||||
|
||||
negativePrefixCurrencySymbol: true
|
||||
onNegativePrefixCurrencySymbolChanged: {
|
||||
console.log("the negativePrefixCurrencySymbol property has been changed")
|
||||
}
|
||||
|
||||
negativeSign: "-----"
|
||||
onNegativeSignChanged: {
|
||||
console.log("the negativeSign property has been changed")
|
||||
}
|
||||
|
||||
pageSize: 5
|
||||
onPageSizeChanged: {
|
||||
console.log("the pageSign property has been changed")
|
||||
}
|
||||
|
||||
positiveMonetarySignPosition: Locale.ParensAround
|
||||
onPositiveMonetarySignPositionChanged: {
|
||||
console.log("the positiveMonetarySignPosition property has been changed")
|
||||
}
|
||||
|
||||
positivePrefixCurrencySymbol: true
|
||||
onPositivePrefixCurrencySymbolChanged: {
|
||||
console.log("the positivePrefixCurrencySymbol property has been changed")
|
||||
}
|
||||
|
||||
positiveSign: " "
|
||||
onPositiveSignChanged: {
|
||||
console.log("the positiveSign property has been changed")
|
||||
}
|
||||
|
||||
thousandsSeparator: ","
|
||||
onThousandsSeparatorChanged: {
|
||||
console.log("the thousandsSeparator property has been changed")
|
||||
}
|
||||
|
||||
weekDayOfPray: 20
|
||||
onWeekDayOfPrayChanged: {
|
||||
console.log("the weekDayOfPray property has been changed")
|
||||
}
|
||||
|
||||
weekNumberSystem: Locale.IsoWeekNumber
|
||||
onWeekNumberSystemChanged: {
|
||||
console.log("the weekNumberSystem property has been changed")
|
||||
}
|
||||
|
||||
weekStartDay: 2
|
||||
onWeekStartDayChanged: {
|
||||
console.log("the weekStartDay property has been changed")
|
||||
}
|
||||
|
||||
workingWeekEndDay: 5
|
||||
onWorkingWeekEndDayChanged: {
|
||||
console.log("the workingWeekEndDay property has been changed")
|
||||
}
|
||||
|
||||
workingWeekStartDay: 1
|
||||
onWorkingWeekStartDayChanged: {
|
||||
console.log("the workingWeekStartDay property has been changed")
|
||||
}
|
||||
}
|
||||
|
||||
CalendarSystem {
|
||||
id: calendar
|
||||
}
|
||||
}
|
||||
}
|
@ -1,636 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Components project.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1
|
||||
|
||||
|
||||
Column {
|
||||
id: column
|
||||
|
||||
// for demonstration and testing purposes each component needs to
|
||||
// set its inverted state explicitly
|
||||
property bool childrenInverted: false
|
||||
property bool windowInverted: false
|
||||
|
||||
spacing: 14
|
||||
|
||||
Label {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "Qt Components " + (enabled ? "(enabled)" : "(disabled)")
|
||||
}
|
||||
|
||||
Button {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "Push me"
|
||||
width: parent.width - parent.spacing
|
||||
}
|
||||
|
||||
TextField {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
placeholderText: "TextField"
|
||||
width: parent.width - parent.spacing
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: clearable
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
placeholderText: "Clearable TextField"
|
||||
text: "Clearable TextField"
|
||||
width: parent.width - parent.spacing
|
||||
|
||||
Image {
|
||||
id: clearText
|
||||
anchors { top: parent.top; right: parent.right; margins: 6 }
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: true; visible: parent.text
|
||||
source: "qrc:close_stop.svg"
|
||||
height: parent.height - 6
|
||||
width: parent.height - 6
|
||||
|
||||
MouseArea {
|
||||
id: clear
|
||||
anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
|
||||
height: clearable.height; width: clearable.height
|
||||
onClicked: clearable.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: customOperation
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
placeholderText: "Custom operation"
|
||||
width: parent.width - parent.spacing
|
||||
|
||||
Image {
|
||||
id: addText
|
||||
anchors { top: parent.top; right: parent.right }
|
||||
smooth: true
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: "qrc:ok.svg"
|
||||
height: parent.height; width: parent.height
|
||||
scale: LayoutMirroring.enabled ? -1 : 1
|
||||
|
||||
MouseArea {
|
||||
id: add
|
||||
anchors.fill: parent
|
||||
onClicked: textSelection.open()
|
||||
}
|
||||
|
||||
SelectionDialog {
|
||||
id: textSelection
|
||||
titleText: "Preset Texts"
|
||||
selectedIndex: -1
|
||||
model: ListModel {
|
||||
ListElement { name: "Lorem ipsum." }
|
||||
ListElement { name: "Lorem ipsum dolor sit amet." }
|
||||
ListElement { name: "Lorem ipsum dolor sit amet ipsum." }
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
customOperation.text = textSelection.model.get(textSelection.selectedIndex).name
|
||||
customOperation.forceActiveFocus()
|
||||
}
|
||||
|
||||
onRejected: selectedIndex = -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextArea {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
placeholderText: "This is a\n multiline control."
|
||||
width: parent.width - parent.spacing; height: 280
|
||||
}
|
||||
|
||||
Slider {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
value: 50
|
||||
}
|
||||
|
||||
ButtonRow {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: parent.spacing
|
||||
|
||||
exclusive: true
|
||||
|
||||
RadioButton {
|
||||
}
|
||||
|
||||
RadioButton {
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: parent.spacing
|
||||
|
||||
CheckBox {
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
checked: true
|
||||
}
|
||||
}
|
||||
|
||||
Switch {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
ProgressBar {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Timer {
|
||||
running: true
|
||||
repeat: true
|
||||
interval: 100
|
||||
onTriggered: parent.value = (parent.value + 1) % 1.1
|
||||
}
|
||||
}
|
||||
|
||||
ProgressBar {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
indeterminate: true
|
||||
}
|
||||
|
||||
Component {
|
||||
id: dialogComponent
|
||||
CommonDialog {
|
||||
id: dialog
|
||||
titleText: "CommonDialog"
|
||||
buttonTexts: ["Ok", "Cancel"]
|
||||
|
||||
content: Text {
|
||||
text: "This is the content"
|
||||
font { bold: true; pixelSize: 16 }
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
property CommonDialog dialog
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width - parent.spacing
|
||||
text: "CommonDialog"
|
||||
onClicked: {
|
||||
if (!dialog)
|
||||
dialog = dialogComponent.createObject(column)
|
||||
dialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: singleSelectionDialogComponent
|
||||
SelectionDialog {
|
||||
titleText: "Select background color"
|
||||
selectedIndex: 1
|
||||
|
||||
model: ListModel {
|
||||
id: colorModel
|
||||
|
||||
ListElement { name: "Red" }
|
||||
ListElement { name: "Blue" }
|
||||
ListElement { name: "Green" }
|
||||
ListElement { name: "Yellow" }
|
||||
ListElement { name: "Black" }
|
||||
ListElement { name: "White" }
|
||||
ListElement { name: "Grey" }
|
||||
ListElement { name: "Orange" }
|
||||
ListElement { name: "Pink" }
|
||||
}
|
||||
|
||||
onAccepted: { selectionDialogButton.parent.color = colorModel.get(selectedIndex).name }
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: selectionDialogButton.height
|
||||
width: parent.width - parent.spacing
|
||||
radius: 10
|
||||
|
||||
Button {
|
||||
id: selectionDialogButton
|
||||
property SelectionDialog singleSelectionDialog
|
||||
anchors.centerIn: parent
|
||||
text: "Selection Dialog"
|
||||
onClicked: {
|
||||
if (!singleSelectionDialog)
|
||||
singleSelectionDialog = singleSelectionDialogComponent.createObject(column)
|
||||
singleSelectionDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
property QueryDialog queryDialog
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width - parent.spacing
|
||||
text: "QueryDialog"
|
||||
onClicked: {
|
||||
if (!queryDialog)
|
||||
queryDialog = queryDialogComponent.createObject(column)
|
||||
queryDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: queryDialogComponent
|
||||
QueryDialog {
|
||||
titleText: "Query Dialog"
|
||||
// Arabic character in the beginning to test right-to-left UI alignment
|
||||
message: (LayoutMirroring.enabled ? "\u062a" : "") + "Lorem ipsum dolor sit amet, consectetur adipisici elit,"
|
||||
+ "sed eiusmod tempor incidunt ut labore et dolore magna aliqua."
|
||||
+ "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris"
|
||||
+ "nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit"
|
||||
+ "in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
|
||||
+ "Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui"
|
||||
+ "officia deserunt mollit anim id est laborum."
|
||||
|
||||
acceptButtonText: "Ok"
|
||||
rejectButtonText: "Cancel"
|
||||
|
||||
titleIcon: "kmail"
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: contentMenuButton.height
|
||||
width: parent.width - parent.spacing
|
||||
radius: 10
|
||||
|
||||
Button {
|
||||
id: contentMenuButton
|
||||
property ContextMenu contextMenu
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "ContextMenu"
|
||||
onClicked: {
|
||||
if (!contextMenu)
|
||||
contextMenu = contextMenuComponent.createObject(contentMenuButton)
|
||||
contextMenu.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: contextMenuComponent
|
||||
ContextMenu {
|
||||
MenuItem {
|
||||
text: "White"
|
||||
onClicked: contentMenuButton.parent.color = "White"
|
||||
}
|
||||
MenuItem {
|
||||
text: "Red"
|
||||
onClicked: contentMenuButton.parent.color = "Red"
|
||||
}
|
||||
MenuItem {
|
||||
text: "LightBlue"
|
||||
onClicked: contentMenuButton.parent.color = "LightBlue"
|
||||
}
|
||||
MenuItem {
|
||||
text: "LightGreen"
|
||||
onClicked: contentMenuButton.parent.color = "LightGreen"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width - parent.spacing; height: 120
|
||||
clip: true
|
||||
delegate: listDelegate
|
||||
model: listModel
|
||||
header: listHeading
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: listModel
|
||||
|
||||
ListElement {
|
||||
titleText: "Title"
|
||||
subTitleText: "SubTitle"
|
||||
}
|
||||
ListElement {
|
||||
titleText: "Title2"
|
||||
subTitleText: "SubTitle"
|
||||
}
|
||||
ListElement {
|
||||
titleText: "Title3"
|
||||
subTitleText: "SubTitle"
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: listHeading
|
||||
Label {
|
||||
text: "Heading"
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: listDelegate
|
||||
ListItem {
|
||||
id: listItem
|
||||
Column {
|
||||
|
||||
Label {
|
||||
text: titleText
|
||||
}
|
||||
Label {
|
||||
text: subTitleText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
property SelectionDialog selectionDialog
|
||||
text: {
|
||||
if (selectionDialog) {
|
||||
if (selectionDialog.selectedIndex >= 0)
|
||||
return selectionDialog.model.get(selectionDialog.selectedIndex).name
|
||||
}
|
||||
return "Three"
|
||||
}
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width - parent.spacing
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (!selectionDialog)
|
||||
selectionDialog = selectionDialogComponent.createObject(column)
|
||||
selectionDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: selectionDialogComponent
|
||||
SelectionDialog {
|
||||
titleText: "Select"
|
||||
selectedIndex: 2
|
||||
model: ListModel {
|
||||
ListElement { name: "One" }
|
||||
ListElement { name: "Two" }
|
||||
ListElement { name: "Three" }
|
||||
ListElement { name: "Four" }
|
||||
ListElement { name: "Five" }
|
||||
ListElement { name: "Six" }
|
||||
ListElement { name: "Seven" }
|
||||
ListElement { name: "Eight" }
|
||||
ListElement { name: "Nine" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TabBar {
|
||||
//width: parent.width - parent.spacing
|
||||
//height: 50
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
TabButton { tab: tab1content; text: "1"; iconSource: "qrc:close_stop.svg"}
|
||||
TabButton { tab: tab2content; text: "2"; iconSource: "konqueror"}
|
||||
TabButton { tab: tab3content; text: "3"}
|
||||
}
|
||||
|
||||
TabGroup {
|
||||
height: 100
|
||||
width: parent.width - parent.spacing
|
||||
Button { id: tab1content; text: "tab1" }
|
||||
Text {
|
||||
id: tab2content
|
||||
text: "tab2"
|
||||
horizontalAlignment: "AlignHCenter"
|
||||
verticalAlignment: "AlignVCenter"
|
||||
}
|
||||
Page {
|
||||
id: tab3content
|
||||
width: 50
|
||||
height: 32
|
||||
CheckBox { anchors.fill: parent; text: "tab3"}
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: toolButton
|
||||
text: "ToolButton"
|
||||
iconSource: "konqueror"
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: toolButton2
|
||||
flat: true
|
||||
iconSource: "qrc:ok.svg"
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: toolButton3
|
||||
text: "ToolButton"
|
||||
iconSource: "qrc:close_stop.svg"
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: 5
|
||||
|
||||
BusyIndicator {
|
||||
id: busyInd1
|
||||
width: 20
|
||||
height: 20
|
||||
running: true
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
// default width/height is 40
|
||||
id: busyInd2
|
||||
running: true
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
id: busyInd3
|
||||
width: 60
|
||||
height: 60
|
||||
running: true
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Toggle"
|
||||
onClicked: {
|
||||
busyInd1.running = !busyInd1.running
|
||||
busyInd2.running = !busyInd2.running
|
||||
busyInd3.running = !busyInd3.running
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
property CommonDialog sectionScroll
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width - parent.spacing
|
||||
text: "SectionScroller"
|
||||
iconSource: "konqueror"
|
||||
onClicked: {
|
||||
if (!sectionScroll)
|
||||
sectionScroll = sectionScrollComponent.createObject(column)
|
||||
sectionScroll.open()
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: sectionScrollComponent
|
||||
CommonDialog {
|
||||
id: sectionScroll
|
||||
titleText: "Section Scroller"
|
||||
buttonTexts: ["Close"]
|
||||
onButtonClicked: close()
|
||||
|
||||
content: Rectangle {
|
||||
color: Qr.rgba(1,1,1,0.8)
|
||||
width: parent.width
|
||||
implicitHeight: 300
|
||||
|
||||
ListModel {
|
||||
id: testModel
|
||||
ListElement { name: "A Cat 1"; alphabet: "A" }
|
||||
ListElement { name: "A Cat 2"; alphabet: "A" }
|
||||
ListElement { name: "Boo 1"; alphabet: "B" }
|
||||
ListElement { name: "Boo 2"; alphabet: "B" }
|
||||
ListElement { name: "Cat 1"; alphabet: "C" }
|
||||
ListElement { name: "Cat 2"; alphabet: "C" }
|
||||
ListElement { name: "Dog 1"; alphabet: "D" }
|
||||
ListElement { name: "Dog 2"; alphabet: "D" }
|
||||
ListElement { name: "Dog 3"; alphabet: "D" }
|
||||
ListElement { name: "Dog 4"; alphabet: "D" }
|
||||
ListElement { name: "Dog 5"; alphabet: "D" }
|
||||
ListElement { name: "Dog 6"; alphabet: "D" }
|
||||
ListElement { name: "Dog 7"; alphabet: "D" }
|
||||
ListElement { name: "Dog 8"; alphabet: "D" }
|
||||
ListElement { name: "Dog 9"; alphabet: "D" }
|
||||
ListElement { name: "Dog 10"; alphabet: "D" }
|
||||
ListElement { name: "Dog 11"; alphabet: "D" }
|
||||
ListElement { name: "Dog 12"; alphabet: "D" }
|
||||
ListElement { name: "Elephant 1"; alphabet: "E" }
|
||||
ListElement { name: "Elephant 2"; alphabet: "E" }
|
||||
ListElement { name: "FElephant 1"; alphabet: "F" }
|
||||
ListElement { name: "FElephant 2"; alphabet: "F" }
|
||||
ListElement { name: "Guinea pig"; alphabet: "G" }
|
||||
ListElement { name: "Goose"; alphabet: "G" }
|
||||
ListElement { name: "Horse"; alphabet: "H" }
|
||||
ListElement { name: "Horse"; alphabet: "H" }
|
||||
ListElement { name: "Parrot"; alphabet: "P" }
|
||||
ListElement { name: "Parrot"; alphabet: "P" }
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: list
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
cacheBuffer: contentHeight
|
||||
delegate: ListItem {
|
||||
Label {
|
||||
anchors {
|
||||
top: parent.top; topMargin: 4
|
||||
left: parent.left; leftMargin: 4
|
||||
}
|
||||
text: name + " (index " + index + ")"
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
}
|
||||
}
|
||||
|
||||
model: testModel
|
||||
section.property: "alphabet"
|
||||
section.criteria: ViewSection.FullString
|
||||
section.delegate: ListItem {
|
||||
sectionDelegate: true
|
||||
Label {
|
||||
anchors {
|
||||
top: parent.top; topMargin: 4
|
||||
left: parent.left; leftMargin: 4
|
||||
}
|
||||
text: section
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font { bold: true; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SectionScroller {
|
||||
id: sectionScroller
|
||||
listView: list
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ButtonRow {
|
||||
id: buttonRow1
|
||||
width: parent.width - parent.spacing
|
||||
exclusive: true
|
||||
checkedButton: b2
|
||||
|
||||
Button { text: "b1" }
|
||||
Button { text: "b2" }
|
||||
Button { text: "b3" }
|
||||
}
|
||||
|
||||
ButtonRow {
|
||||
id: buttonRow2
|
||||
width: parent.width - parent.spacing
|
||||
exclusive: true
|
||||
|
||||
ToolButton { text: "tb1" }
|
||||
ToolButton { text: "tb2" }
|
||||
}
|
||||
|
||||
ButtonColumn {
|
||||
id: buttonColumn
|
||||
width: parent.width - parent.spacing
|
||||
exclusive: true
|
||||
|
||||
Button { text: "b4" }
|
||||
Button { text: "b5" }
|
||||
Button { text: "b6" }
|
||||
Button { text: "b7" }
|
||||
}
|
||||
}
|
@ -1,154 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
height: childrenRect.height
|
||||
property int implicitHeight: childrenRect.height
|
||||
|
||||
PlasmaComponents.ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
spacing: 5
|
||||
PlasmaComponents.ToolButton {
|
||||
text: "ToolButton"
|
||||
}
|
||||
PlasmaComponents.ScrollBar {
|
||||
orientation: Qt.Horizontal
|
||||
interactive: true
|
||||
flickableItem: scrollArea
|
||||
width: 200
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
text: "hello"
|
||||
}
|
||||
Component.onCompleted: {
|
||||
app.tools = toolbarlayout
|
||||
}
|
||||
}
|
||||
Column {
|
||||
spacing: 20
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Scroll Bar"
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: scrollList
|
||||
|
||||
width: 200
|
||||
height: 200
|
||||
clip: true
|
||||
model: 20
|
||||
delegate: Text {
|
||||
width: 200
|
||||
height: 30
|
||||
text: index
|
||||
font.pixelSize: 18
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "grey"
|
||||
opacity: 0.3
|
||||
}
|
||||
|
||||
PlasmaComponents.ScrollBar {
|
||||
id: scrollBar
|
||||
orientation: Qt.Vertical
|
||||
flickableItem: scrollList
|
||||
stepSize: 40
|
||||
scrollButtonInterval: 50
|
||||
anchors {
|
||||
top: scrollList.top
|
||||
right: scrollList.right
|
||||
bottom: scrollList.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
font.pixelSize: 20
|
||||
text: "Scroll Decorator"
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 200
|
||||
height: 200
|
||||
PlasmaComponents.Highlight { anchors.fill: parent }
|
||||
Flickable {
|
||||
id: scrollArea
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
contentWidth: 400
|
||||
contentHeight: 400
|
||||
|
||||
// Flickable Contents
|
||||
Rectangle {
|
||||
color: "green"
|
||||
width: 100
|
||||
height: 100
|
||||
}
|
||||
Rectangle {
|
||||
x: 80
|
||||
y: 80
|
||||
color: "blue"
|
||||
width: 200
|
||||
height: 200
|
||||
}
|
||||
Rectangle {
|
||||
x: 200
|
||||
y: 200
|
||||
color: "red"
|
||||
width: 150
|
||||
height: 150
|
||||
}
|
||||
}
|
||||
|
||||
// Scroll Decorators
|
||||
PlasmaComponents.ScrollBar {
|
||||
orientation: Qt.Vertical
|
||||
flickableItem: scrollArea
|
||||
inverted: true
|
||||
anchors {
|
||||
top: scrollArea.top
|
||||
right: scrollArea.right
|
||||
bottom: scrollArea.bottom
|
||||
}
|
||||
Text {
|
||||
y: parent.height / 2
|
||||
x: 13
|
||||
rotation: -90
|
||||
text: "inverted"
|
||||
}
|
||||
}
|
||||
PlasmaComponents.ScrollBar {
|
||||
orientation: Qt.Horizontal
|
||||
flickableItem: scrollArea
|
||||
anchors {
|
||||
left: scrollArea.left
|
||||
right: scrollArea.right
|
||||
bottom: scrollArea.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,148 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
height: childrenRect.height
|
||||
property int implicitHeight: childrenRect.height
|
||||
|
||||
PlasmaComponents.ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
spacing: 5
|
||||
PlasmaComponents.ToolButton {
|
||||
text: "ToolButton"
|
||||
}
|
||||
PlasmaComponents.Slider {
|
||||
width: 140
|
||||
enabled: true
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
text: "hello"
|
||||
}
|
||||
Component.onCompleted: {
|
||||
app.tools = toolbarlayout
|
||||
}
|
||||
}
|
||||
Column {
|
||||
spacing: 20
|
||||
|
||||
PlasmaComponents.Label {
|
||||
font.pixelSize: 20
|
||||
text: "Slider"
|
||||
}
|
||||
|
||||
PlasmaComponents.Highlight {
|
||||
width: 300
|
||||
height: 400
|
||||
Column {
|
||||
anchors {
|
||||
fill: parent
|
||||
}
|
||||
spacing: 10
|
||||
|
||||
PlasmaComponents.Label { text: "Color Selector"; font.pixelSize: 20 }
|
||||
|
||||
PlasmaComponents.Label { text: "Red" }
|
||||
|
||||
PlasmaComponents.Slider {
|
||||
id: redSlider
|
||||
height: 20
|
||||
width: 255
|
||||
orientation: Qt.Horizontal
|
||||
minimumValue: 0
|
||||
maximumValue: 255
|
||||
stepSize: 10
|
||||
Keys.onTabPressed: greenSlider.forceActiveFocus()
|
||||
}
|
||||
|
||||
PlasmaComponents.Label { text: "Green" }
|
||||
|
||||
PlasmaComponents.Slider {
|
||||
id: greenSlider
|
||||
height: 20
|
||||
width: 255
|
||||
orientation: Qt.Horizontal
|
||||
minimumValue: 0
|
||||
maximumValue: 255
|
||||
stepSize: 10
|
||||
Keys.onTabPressed: blueSlider.forceActiveFocus()
|
||||
}
|
||||
|
||||
PlasmaComponents.Label { text: "Blue" }
|
||||
|
||||
PlasmaComponents.Slider {
|
||||
id: blueSlider
|
||||
height: 20
|
||||
width: 255
|
||||
orientation: Qt.Horizontal
|
||||
minimumValue: 0
|
||||
maximumValue: 255
|
||||
stepSize: 10
|
||||
Keys.onTabPressed: redSlider.forceActiveFocus()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width / 2
|
||||
height: width
|
||||
color: Qt.rgba(redSlider.value / 255, greenSlider.value / 255, blueSlider.value / 255, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.Label { text: "Disabled Horizontal Slider" }
|
||||
|
||||
PlasmaComponents.Slider {
|
||||
id: horizontalSlider
|
||||
width: 140
|
||||
height: 20
|
||||
enabled: false
|
||||
}
|
||||
|
||||
PlasmaComponents.Label { text: "Inverted Horizontal Slider" }
|
||||
|
||||
PlasmaComponents.Slider {
|
||||
id: invHorizontalSlider
|
||||
width: 140
|
||||
height: 20
|
||||
inverted: true
|
||||
enabled: true
|
||||
}
|
||||
|
||||
PlasmaComponents.Label { text: "Vertical Slider" }
|
||||
|
||||
Row {
|
||||
spacing: 30
|
||||
PlasmaComponents.Slider {
|
||||
id: verticalSlider
|
||||
width: 20
|
||||
height: 140
|
||||
orientation: Qt.Vertical
|
||||
minimumValue: 10
|
||||
maximumValue: 1000
|
||||
stepSize: 50
|
||||
inverted: true
|
||||
}
|
||||
PlasmaComponents.Label { text: verticalSlider.value }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
height: editThing.height
|
||||
width: 500
|
||||
//property int implicitHeight: childrenRect.height
|
||||
//scale: 1.25
|
||||
|
||||
PlasmaComponents.ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
spacing: 5
|
||||
PlasmaComponents.Label {
|
||||
text: "Text label:"
|
||||
}
|
||||
PlasmaComponents.ToolButton {
|
||||
text: "ToolButton"
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
placeholderText: "Place holder text"
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
text: "Text fields page"
|
||||
}
|
||||
Component.onCompleted: {
|
||||
app.tools = toolbarlayout
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: editThing
|
||||
onClicked: editThing.forceActiveFocus();
|
||||
}
|
||||
|
||||
Column {
|
||||
id: editThing
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: 300
|
||||
height: 300
|
||||
|
||||
spacing: 12
|
||||
Item { height: 4; width: parent.width; }
|
||||
PlasmaComponents.TextField {
|
||||
placeholderText: "Try copy & paste"
|
||||
text: "The cat bites into the socks"
|
||||
width: editThing.width
|
||||
clearButtonShown: true
|
||||
}
|
||||
PlasmaComponents.TextArea {
|
||||
width: editThing.width
|
||||
height: 200
|
||||
placeholderText: "Touch copy & paste not implemented yet."
|
||||
}
|
||||
}
|
||||
}
|
@ -1,127 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
height: childrenRect.height
|
||||
property int implicitHeight: childrenRect.height
|
||||
|
||||
PlasmaComponents.ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
spacing: 5
|
||||
PlasmaComponents.Label {
|
||||
text: "Text label:"
|
||||
}
|
||||
PlasmaComponents.ToolButton {
|
||||
text: "ToolButton"
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
placeholderText: "Place holder text"
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
text: "Text fields page"
|
||||
}
|
||||
Component.onCompleted: {
|
||||
app.tools = toolbarlayout
|
||||
}
|
||||
}
|
||||
Column {
|
||||
spacing: 30
|
||||
Text {
|
||||
text: "Text Fields"
|
||||
font.pixelSize: 20
|
||||
}
|
||||
|
||||
PlasmaComponents.Highlight {
|
||||
width: 200
|
||||
height: 100
|
||||
Column {
|
||||
spacing: 10
|
||||
Row {
|
||||
Text {
|
||||
text: "Username: "
|
||||
anchors.verticalCenter: tf1.verticalCenter
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
id: tf1
|
||||
placeholderText: "login"
|
||||
clearButtonShown: true
|
||||
Keys.onTabPressed: tf2.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
Text {
|
||||
text: "Password: "
|
||||
anchors.verticalCenter: tf2.verticalCenter
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
id: tf2
|
||||
clearButtonShown: true
|
||||
width: 120
|
||||
echoMode: TextInput.Password
|
||||
Keys.onTabPressed: loginButton.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.Button {
|
||||
id: loginButton
|
||||
text: "Login"
|
||||
z: -1
|
||||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: 0
|
||||
}
|
||||
width: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.TextField {
|
||||
width: 120
|
||||
clearButtonShown: true
|
||||
placeholderText: "Disabled Text Field"
|
||||
Keys.onTabPressed: loginButton.forceActiveFocus();
|
||||
enabled: false
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Text Area"
|
||||
font.pixelSize: 20
|
||||
}
|
||||
|
||||
PlasmaComponents.TextArea {
|
||||
width: 200
|
||||
height: 200
|
||||
placeholderText: "Lorem ipsum et dolor"
|
||||
wrapMode: TextEdit.WordWrap
|
||||
contentMaxWidth: 400
|
||||
contentMaxHeight: 400
|
||||
}
|
||||
|
||||
PlasmaComponents.TextArea {
|
||||
width: 200
|
||||
height: 100
|
||||
enabled: false
|
||||
text: "Disabled Text Area"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 by Sebastian Kügler <sebas@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtras
|
||||
|
||||
Column {
|
||||
|
||||
PlasmaExtras.ResourceInstance {
|
||||
uri: "http://api.kde.org/4.x-api/plasma-qml-apidocs/"
|
||||
title: "Plasma Components API documentation"
|
||||
}
|
||||
|
||||
ToolBarLayout {
|
||||
id: toolbarlayout
|
||||
Component.onCompleted: app.tools = toolbarlayout
|
||||
}
|
||||
//anchors.fill: parent
|
||||
// anchors.rightMargin: space*2
|
||||
width: 600
|
||||
spacing: 12
|
||||
PlasmaExtras.Title {
|
||||
text: "PlasmaExtras"
|
||||
}
|
||||
PlasmaExtras.Heading {
|
||||
level: 2
|
||||
text: "Additional Plasma Quick components for Apps"
|
||||
}
|
||||
PlasmaExtras.Paragraph {
|
||||
//width: contentWidth
|
||||
text: "PlasmaExtras contains additional components for your app. It makes available the appbackground image providers, for example, it also has components for structured, styled Text layout (PlasmaExtras.Title, PlasmaExtras.Heading, PlasmaExtras.Paragraph)."
|
||||
}
|
||||
PlasmaExtras.Paragraph {
|
||||
//width: contentWidth
|
||||
text:"PlasmaExtras.ResourceInstance offers a way for apps to announce the document they are currently viewing. This adds support for \"share-like-connect\" to your app. This page for example uses the PlasmaComponents API as \"current document\"."
|
||||
}
|
||||
PlasmaExtras.Heading {
|
||||
level: 3
|
||||
text: "Heading at level " + level
|
||||
}
|
||||
PlasmaExtras.Paragraph {
|
||||
text: "Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen. Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw, toen een onbekende drukker een zethaak met letters nam en ze door elkaar husselde om een font-catalogus te maken. Het heeft niet alleen vijf eeuwen overleefd maar is ook, vrijwel onveranderd, overgenomen in elektronische letterzetting. Het is in de jaren '60 populair geworden met de introductie van Letraset vellen met Lorem Ipsum passages en meer recentelijk door desktop publishing software zoals Aldus PageMaker die versies van Lorem Ipsum bevatten."
|
||||
}
|
||||
PlasmaExtras.Heading {
|
||||
level: 5
|
||||
text: "Heading at level " + level
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=org.kde.example.widgetgallery
|
||||
Name[de]=org.kde.example.widgetgallery
|
||||
Name[el]=org.kde.example.widgetgallery
|
||||
Name[et]=org.kde.example.widgetgallery
|
||||
Name[ia]=org.kde.example.widgetgallery
|
||||
Name[is]=org.kde.example.widgetgallery
|
||||
Name[nl]=org.kde.example.widgetgallery
|
||||
Name[pl]=org.kde.example.widgetgallery
|
||||
Name[pt]=org.kde.example.widgetgallery
|
||||
Name[pt_BR]=org.kde.example.widgetgallery
|
||||
Name[uk]=org.kde.example.widgetgallery
|
||||
Name[x-test]=xxorg.kde.example.widgetgalleryxx
|
||||
Type=Service
|
||||
X-KDE-PluginInfo-Author=Giorgos Tsiapaliwkas
|
||||
X-KDE-PluginInfo-Email=terietor@gmail.com
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-Name=org.kde.example.widgetgallery
|
||||
X-KDE-PluginInfo-Version=1
|
||||
X-KDE-ServiceTypes=Plasma/Applet
|
||||
X-Plasma-API=declarativeappletscript
|
||||
X-Plasma-DefaultSize=200,100
|
||||
X-Plasma-MainScript=ui/Gallery.qml
|
Loading…
Reference in New Issue
Block a user