Source

Target

Commits (14)
Showing with 262 additions and 150 deletions
...@@ -38,103 +38,71 @@ ...@@ -38,103 +38,71 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
Rectangle { Item {
id:root id:root
anchors.fill: parent
anchors.margins: 8
width: 540 ColumnLayout {
height: 340 id: mainLayout
color:"#c3c3c3"
ScrollView {
frameVisible: false
anchors.fill: parent anchors.fill: parent
spacing: 4
Item { GroupBox {
width:600 id: rowBox
height:600 title: "Row layout"
BorderImage { Layout.fillWidth: true
id: page RowLayout {
source: "../images/page.png" id: rowLayout
y:10; x:50 anchors.fill: parent
width: 400; height: 400 TextField {
border.left: 12; border.top: 12 placeholderText: "This wants to grow horizontally"
border.right: 12; border.bottom: 12 Layout.fillWidth: true
Text {
id:text
anchors.fill: parent
anchors.margins: 40
text:textfield.text
} }
Rectangle { Button {
border.color: "#444" text: "Button"
anchors.centerIn: parent
color: Qt.rgba(s1.value, s2.value, s3.value)
width: 200
height: width
} }
} }
}
BorderImage { GroupBox {
id: sidebar id: gridBox
source: "../images/panel.png" title: "Grid layout"
anchors.left: parent.left Layout.fillWidth: true
anchors.top: parent.top
width: show ? 160 : 40
height:root.height
Behavior on width { NumberAnimation { easing.type: Easing.OutSine ; duration: 250 } }
property bool show: false
border.left: 0;
border.right: 26;
MouseArea {
id:mouseArea
anchors.fill: parent
onClicked: sidebar.show = !sidebar.show
}
Column {
id: panel1
opacity: sidebar.show ? 1 : 0
Behavior on opacity { NumberAnimation { easing.type:Easing.InCubic; duration: 600} }
scale: sidebar.show ? 1 : 0 GridLayout {
Behavior on scale { NumberAnimation { easing.type:Easing.InCubic; duration: 200 } } id: gridLayout
transformOrigin: Item.Top anchors.fill: parent
anchors.margins: 4
rows: 3
flow: GridLayout.TopToBottom
anchors.top: parent.top Label { text: "Line 1" }
anchors.left: parent.left Label { text: "Line 2" }
anchors.right: parent.right Label { text: "Line 3" }
anchors.margins: 12
spacing:12
Button { width: parent.width - 12; text: "Close Panel"; onClicked: sidebar.show = false} TextField { }
TextField { id: textfield; text: "Some text" ; width: parent.width - 12} TextField { }
SpinBox { width: parent.width - 12} TextField { }
CheckBox{ id: expander; text:"Sliders"}
}
Column {
id: panel2
opacity: expander.checked && sidebar.show ? 1 : 0
scale: opacity
Behavior on opacity{ NumberAnimation { easing.type:Easing.OutSine; duration: 300}}
transformOrigin: Item.Top
anchors.top: panel1.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 12
spacing: 12
Slider { id: s1; width:parent.width - 12; value:0.5}
Slider { id: s2; width:parent.width - 12; value:0.5}
Slider { id: s3; width:parent.width - 12; value:0.5}
TextArea {
text: "This widget spans over three rows in the GridLayout.\n"
+ "All items in the GridLayout are implicitly positioned from top to bottom."
Layout.rowSpan: 3
Layout.fillHeight: true
Layout.fillWidth: true
} }
} }
} }
TextArea {
id: t3
text: "This fills the whole cell"
Layout.minimumHeight: 30
Layout.fillHeight: true
Layout.fillWidth: true
}
} }
} }
...@@ -172,17 +172,13 @@ Item { ...@@ -172,17 +172,13 @@ Item {
// Style delegates: // Style delegates:
property Component buttonStyle: ButtonStyle { property Component buttonStyle: ButtonStyle {
panel: Rectangle { background: Rectangle {
implicitHeight: 20 implicitHeight: 20
implicitWidth: 100 implicitWidth: 100
color: control.pressed ? "darkGray" : "lightGray" color: control.pressed ? "darkGray" : "lightGray"
antialiasing: true antialiasing: true
border.color: "gray" border.color: "gray"
radius: height/2 radius: height/2
Text {
anchors.centerIn: parent
text: control.text
}
} }
} }
...@@ -220,21 +216,21 @@ Item { ...@@ -220,21 +216,21 @@ Item {
} }
property Component progressbarStyle: ProgressBarStyle { property Component progressbarStyle: ProgressBarStyle {
panel: Rectangle { background: Rectangle {
implicitWidth: 100 implicitWidth: 100
implicitHeight: 20 implicitHeight: 20
color: "#f0f0f0" color: "#f0f0f0"
border.color: "gray" border.color: "gray"
antialiasing: true antialiasing: true
radius: height/2 radius: height/2
Rectangle { }
implicitWidth: 100 progress: Rectangle {
implicitHeight: 20 implicitWidth: 100
color: "#f0f0f0" implicitHeight: 20
border.color: "gray" color: "#c0c0c0"
antialiasing: true border.color: "gray"
radius: height/2 antialiasing: true
} radius: height/2
} }
} }
...@@ -258,13 +254,13 @@ Item { ...@@ -258,13 +254,13 @@ Item {
BorderImage { BorderImage {
id: image id: image
anchors.fill: parent anchors.fill: parent
source: tab.selected ? "../images/tab_selected.png" : "../images/tab.png" source: styleData.selected ? "../images/tab_selected.png" : "../images/tab.png"
border.left: 50 border.left: 50
smooth: false smooth: false
border.right: 50 border.right: 50
} }
Text { Text {
text: tab.title text: styleData.title
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
......
examples/quick/controls/gallery/images/page.png

639 Bytes

examples/quick/controls/gallery/images/panel.png

1.71 KB

...@@ -281,8 +281,8 @@ ApplicationWindow { ...@@ -281,8 +281,8 @@ ApplicationWindow {
Styles { anchors.fill: parent } Styles { anchors.fill: parent }
} }
Tab { Tab {
title: "Sidebar" title: "Layouts"
Panel { anchors.fill:parent } Layouts { anchors.fill:parent }
} }
} }
} }
......
...@@ -5,18 +5,16 @@ ...@@ -5,18 +5,16 @@
<file>content/Controls.qml</file> <file>content/Controls.qml</file>
<file>content/ImageViewer.qml</file> <file>content/ImageViewer.qml</file>
<file>content/ModelView.qml</file> <file>content/ModelView.qml</file>
<file>content/Panel.qml</file> <file>content/Layouts.qml</file>
<file>content/Styles.qml</file> <file>content/Styles.qml</file>
<file>images/document-open.png</file> <file>images/document-open.png</file>
<file>images/document-open@2x.png</file> <file>images/document-open@2x.png</file>
<file>images/document-save-as.png</file> <file>images/document-save-as.png</file>
<file>images/document-save-as@2x.png</file> <file>images/document-save-as@2x.png</file>
<file>images/folder_new.png</file> <file>images/folder_new.png</file>
<file>images/page.png</file>
<file>images/tab.png</file> <file>images/tab.png</file>
<file>images/tab_selected.png</file> <file>images/tab_selected.png</file>
<file>images/window-new.png</file> <file>images/window-new.png</file>
<file>images/window-new@2x.png</file> <file>images/window-new@2x.png</file>
<file>images/panel.png</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -104,9 +104,9 @@ Window { ...@@ -104,9 +104,9 @@ Window {
ListModel { ListModel {
id: nestedModel id: nestedModel
ListElement{controlState: ListElement { description: "Core" ; color:"#ffaacc"}} ListElement{content: ListElement { description: "Core" ; color:"#ffaacc"}}
ListElement{controlState: ListElement { description: "Second" ; color:"#ffccaa"}} ListElement{content: ListElement { description: "Second" ; color:"#ffccaa"}}
ListElement{controlState: ListElement { description: "Third" ; color:"#ffffaa"}} ListElement{content: ListElement { description: "Third" ; color:"#ffffaa"}}
} }
ListModel { ListModel {
...@@ -176,14 +176,14 @@ Window { ...@@ -176,14 +176,14 @@ Window {
anchors.margins: 12 anchors.margins: 12
TableViewColumn { TableViewColumn {
role: "controlState" role: "content"
title: "Text and Color" title: "Text and Color"
width: 220 width: 220
} }
itemDelegate: Item { itemDelegate: Item {
Rectangle{ Rectangle{
color: itemValue.get(0).color color: styleData.value.get(0).color
anchors.top:parent.top anchors.top:parent.top
anchors.right:parent.right anchors.right:parent.right
anchors.bottom:parent.bottom anchors.bottom:parent.bottom
...@@ -196,9 +196,9 @@ Window { ...@@ -196,9 +196,9 @@ Window {
anchors.margins: 4 anchors.margins: 4
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
elide: itemElideMode elide: styleData.elideMode
text: itemValue.get(0).description text: styleData.value.get(0).description
color: itemTextColor color: styleData.textColor
} }
} }
...@@ -251,32 +251,23 @@ Window { ...@@ -251,32 +251,23 @@ Window {
anchors.margins: 4 anchors.margins: 4
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
elide: itemElideMode elide: styleData.elideMode
text: itemValue !== undefined ? itemValue : "" text: styleData.value !== undefined ? styleData.value : ""
color: itemTextColor color: styleData.textColor
} }
} }
} }
Component {
id: slickRowDelegate
Rectangle { color: alternateBackground ? "#cef" : "white" }
}
Component { Component {
id: delegate2 id: delegate2
Item { Text {
height: itemSelected? 60 : 20 width: parent.width
Behavior on height{ NumberAnimation{} } anchors.margins: 4
Text { anchors.left: parent.left
width: parent.width anchors.verticalCenter: parent.verticalCenter
anchors.margins: 4 elide: styleData.elideMode
anchors.left: parent.left text: styleData.value !== undefined ? styleData.value : ""
anchors.verticalCenter: parent.verticalCenter color: styleData.textColor
elide: itemElideMode
text: itemValue !== undefined ? itemValue : ""
color: itemTextColor
}
} }
} }
...@@ -289,10 +280,10 @@ Window { ...@@ -289,10 +280,10 @@ Window {
anchors.margins: 4 anchors.margins: 4
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
elide: itemElideMode elide: styleData.elideMode
text: itemValue !== undefined ? itemValue : "" text: styleData.value !== undefined ? styleData.value : ""
color: itemTextColor color: styleData.textColor
visible: !itemSelected visible: !styleData.selected
} }
Loader { // Initialize text editor lazily to improve performance Loader { // Initialize text editor lazily to improve performance
id: loaderEditor id: loaderEditor
...@@ -301,19 +292,19 @@ Window { ...@@ -301,19 +292,19 @@ Window {
Connections { Connections {
target: loaderEditor.item target: loaderEditor.item
onAccepted: { onAccepted: {
if (typeof itemValue === 'number') if (typeof styleData.value === 'number')
model.setProperty(row, role, Number(parseFloat(loaderEditor.item.text).toFixed(0))) model.setProperty(styleData.row, styleData.role, Number(parseFloat(loaderEditor.item.text).toFixed(0)))
else else
model.setProperty(row, role, loaderEditor.item.text) model.setProperty(styleData.row, styleData.role, loaderEditor.item.text)
} }
} }
sourceComponent: itemSelected ? editor : null sourceComponent: styleData.selected ? editor : null
Component { Component {
id: editor id: editor
TextInput { TextInput {
id: textinput id: textinput
color: itemTextColor color: styleData.textColor
text: itemValue text: styleData.value
MouseArea { MouseArea {
id: mouseArea id: mouseArea
anchors.fill: parent anchors.fill: parent
...@@ -354,25 +345,22 @@ Window { ...@@ -354,25 +345,22 @@ Window {
source: "images/header.png" source: "images/header.png"
border{left:2;right:2;top:2;bottom:2} border{left:2;right:2;top:2;bottom:2}
Text { Text {
text: itemValue text: styleData.value
anchors.centerIn:parent anchors.centerIn:parent
color:"#333" color:"#333"
} }
} }
rowDelegate: Rectangle { rowDelegate: Rectangle {
height: 20 height: (delegateChooser.currentIndex == 1 && styleData.selected) ? 30 : 20
color: rowSelected ? "#448" : (alternateBackground ? "#eee" : "#fff") Behavior on height{ NumberAnimation{} }
border.color:"#ccc"
border.width: 1 color: styleData.selected ? "#448" : (styleData.alternate? "#eee" : "#fff")
anchors.left: parent ? parent.left : undefined
anchors.leftMargin: -2
anchors.rightMargin: -1
BorderImage{ BorderImage{
id: selected id: selected
anchors.fill: parent anchors.fill: parent
source: "images/selectedrow.png" source: "images/selectedrow.png"
visible: rowSelected visible: styleData.selected
border{left:2; right:2; top:2; bottom:2} border{left:2; right:2; top:2; bottom:2}
SequentialAnimation { SequentialAnimation {
running: true; loops: Animation.Infinite running: true; loops: Animation.Infinite
...@@ -383,14 +371,10 @@ Window { ...@@ -383,14 +371,10 @@ Window {
} }
itemDelegate: { itemDelegate: {
switch (delegateChooser.currentIndex) { if (delegateChooser.currentIndex == 2)
case 0: return editableDelegate;
return delegate1 else
case 1: return delegate1;
return delegate2
case 2:
return editableDelegate
}
} }
} }
} }
......
...@@ -80,11 +80,11 @@ Item { ...@@ -80,11 +80,11 @@ Item {
anchors.fill: parent anchors.fill: parent
border.bottom: 8 border.bottom: 8
border.top: 8 border.top: 8
source: tab.selected ? "../images/tab_selected.png":"../images/tabs_standard.png" source: styleData.selected ? "../images/tab_selected.png":"../images/tabs_standard.png"
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
text: tab.title.toUpperCase() text: styleData.title.toUpperCase()
font.pixelSize: 16 font.pixelSize: 16
} }
Rectangle { Rectangle {
......
...@@ -125,14 +125,6 @@ Window { ...@@ -125,14 +125,6 @@ Window {
/*! \internal */ /*! \internal */
default property alias data: contentArea.data default property alias data: contentArea.data
/*! \internal */
Binding {
target: contentItem
property: "activeFocusOnTab"
when: activeFocusItem
value: activeFocusItem ? ( (activeFocusItem != contentItem) ? !activeFocusItem.activeFocusOnTab : true ) : false
}
color: syspal.window color: syspal.window
SystemPalette {id: syspal} SystemPalette {id: syspal}
......
...@@ -212,7 +212,11 @@ Item { ...@@ -212,7 +212,11 @@ Item {
enabled: (!groupbox.checkable || groupbox.checked) enabled: (!groupbox.checkable || groupbox.checked)
property Item layoutItem: container.children.length === 1 ? container.children[0] : null property Item layoutItem: container.children.length === 1 ? container.children[0] : null
function calcWidth () { return (layoutItem ? (layoutItem.implicitWidth || layoutItem.width) : container.childrenRect.width) } function calcWidth () { return (layoutItem ? (layoutItem.implicitWidth || layoutItem.width) +
function calcHeight () { return (layoutItem ? (layoutItem.implicitHeight || layoutItem.height) : container.childrenRect.height) } (layoutItem.anchors.fill ? layoutItem.anchors.leftMargin +
layoutItem.anchors.rightMargin : 0) : container.childrenRect.width) }
function calcHeight () { return (layoutItem ? (layoutItem.implicitHeight || layoutItem.height) +
(layoutItem.anchors.fill ? layoutItem.anchors.topMargin +
layoutItem.anchors.bottomMargin : 0) : container.childrenRect.height) }
}] }]
} }
...@@ -236,11 +236,15 @@ FocusScope { ...@@ -236,11 +236,15 @@ FocusScope {
property bool horizontalRecursionGuard: false property bool horizontalRecursionGuard: false
property bool verticalRecursionGuard: false property bool verticalRecursionGuard: false
horizontalMaximumValue: flickableItem ? flickableItem.contentWidth - viewport.width : 0 horizontalMinimumValue: flickableItem ? flickableItem.originX : 0
verticalMaximumValue: flickableItem ? flickableItem.contentHeight - viewport.height + __viewTopMargin : 0 horizontalMaximumValue: flickableItem ? flickableItem.originX + flickableItem.contentWidth - viewport.width : 0
verticalMinimumValue: flickableItem ? flickableItem.originY : 0
verticalMaximumValue: flickableItem ? flickableItem.originY + flickableItem.contentHeight - viewport.height + __viewTopMargin : 0
Connections { Connections {
target: flickableItem target: flickableItem
onContentYChanged: { onContentYChanged: {
wheelArea.verticalRecursionGuard = true wheelArea.verticalRecursionGuard = true
wheelArea.verticalValue = flickableItem.contentY wheelArea.verticalValue = flickableItem.contentY
......
...@@ -148,7 +148,7 @@ Control { ...@@ -148,7 +148,7 @@ Control {
/*! \internal */ /*! \internal */
property alias __text: input.text property alias __text: input.text
__controlState: QtObject { __styleData: QtObject {
readonly property bool upEnabled: value != maximumValue; readonly property bool upEnabled: value != maximumValue;
readonly property alias upHovered: mouseUp.containsMouse readonly property alias upHovered: mouseUp.containsMouse
readonly property alias upPressed: mouseUp.pressed readonly property alias upPressed: mouseUp.pressed
......
...@@ -128,22 +128,23 @@ ScrollView { ...@@ -128,22 +128,23 @@ ScrollView {
In the item delegate you have access to the following special properties: In the item delegate you have access to the following special properties:
\list \list
\li itemSelected - if the item is currently selected \li styleData.selected - if the item is currently selected
\li itemValue - the value or text for this item \li styleData.value - the value or text for this item
\li itemTextColor - the default text color for an item \li styleData.textColor - the default text color for an item
\li row - the index of the row \li styleData.row - the index of the row
\li column - the index of the column \li styleData.column - the index of the column
\li itemElideMode - the elide mode of the column \li styleData.elideMode - the elide mode of the column
\li itemTextAlignment - the horizontal text alignment of the column \li styleData.textAlignment - the horizontal text alignment of the column
\endlist \endlist
Example: Example:
\code \code
itemDelegate: Item { itemDelegate: Item {
Text { Text {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: itemTextColor color: styleData.textColor
elide: itemElideMode elide: styleData.elideMode
text: itemValue text: styleData.value
} }
} }
\endcode */ \endcode */
...@@ -153,9 +154,9 @@ ScrollView { ...@@ -153,9 +154,9 @@ ScrollView {
In the row delegate you have access to the following special properties: In the row delegate you have access to the following special properties:
\list \list
\li alternateBackground - if the row uses the alternate background color \li styleData.alternate - true when the row uses the alternate background color
\li rowSelected - if the row is currently selected \li styleData.selected - true when the row is currently selected
\li index - the index of the row \li styleData.row - the index of the row
\endlist \endlist
*/ */
property Component rowDelegate: __style ? __style.rowDelegate : null property Component rowDelegate: __style ? __style.rowDelegate : null
...@@ -166,7 +167,16 @@ ScrollView { ...@@ -166,7 +167,16 @@ ScrollView {
The default value is the base color of the SystemPalette. */ The default value is the base color of the SystemPalette. */
property alias backgroundColor: colorRect.color property alias backgroundColor: colorRect.color
/*! This property defines a delegate to draw a header. */ /*! This property defines a delegate to draw a header.
In the header delegate you have access to the following special properties:
\list
\li styleData.value - the value or text for this item
\li styleData.column - the index of the column
\li styleData.pressed - true when the column is being pressed
\li styleData.containsMouse - true when the column is under the mouse
\endlist
*/
property Component headerDelegate: __style ? __style.headerDelegate : null property Component headerDelegate: __style ? __style.headerDelegate : null
/*! Index of the current sort column. /*! Index of the current sort column.
...@@ -408,11 +418,13 @@ ScrollView { ...@@ -408,11 +418,13 @@ ScrollView {
width: rowfiller.width width: rowfiller.width
height: rowfiller.rowHeight height: rowfiller.rowHeight
sourceComponent: root.rowDelegate sourceComponent: root.rowDelegate
readonly property bool alternateBackground: (index + rowCount) % 2 === 1 property QtObject styleData: QtObject {
readonly property bool rowSelected: false readonly property bool alternate: (index + rowCount) % 2 === 1
readonly property bool selected: false
readonly property bool hasActiveFocus: root.activeFocus
}
readonly property var model: listView.model readonly property var model: listView.model
readonly property var modelData: null readonly property var modelData: null
readonly property bool hasActiveFocus: root.activeFocus
} }
} }
} }
...@@ -439,7 +451,7 @@ ScrollView { ...@@ -439,7 +451,7 @@ ScrollView {
height: rowstyle.height height: rowstyle.height
readonly property int rowIndex: model.index readonly property int rowIndex: model.index
readonly property bool alternateBackground: alternatingRowColors && rowIndex % 2 == 1 readonly property bool alternate: alternatingRowColors && rowIndex % 2 == 1
readonly property var itemModelData: typeof modelData == "undefined" ? null : modelData readonly property var itemModelData: typeof modelData == "undefined" ? null : modelData
readonly property var itemModel: model readonly property var itemModel: model
readonly property bool itemSelected: ListView.isCurrentItem readonly property bool itemSelected: ListView.isCurrentItem
...@@ -457,12 +469,14 @@ ScrollView { ...@@ -457,12 +469,14 @@ ScrollView {
// these properties are exposed to the row delegate // these properties are exposed to the row delegate
// Note: these properties should be mirrored in the row filler as well // Note: these properties should be mirrored in the row filler as well
readonly property bool alternateBackground: rowitem.alternateBackground property QtObject styleData: QtObject {
readonly property bool rowSelected: rowitem.itemSelected readonly property int row: rowitem.rowIndex
readonly property int row: rowitem.rowIndex readonly property bool alternate: rowitem.alternate
readonly property bool selected: rowitem.itemSelected
readonly property bool hasActiveFocus: root.activeFocus
}
readonly property var model: listView.model readonly property var model: listView.model
readonly property var modelData: rowitem.itemModelData readonly property var modelData: rowitem.itemModelData
readonly property bool hasActiveFocus: root.activeFocus
} }
Row { Row {
id: itemrow id: itemrow
...@@ -482,20 +496,22 @@ ScrollView { ...@@ -482,20 +496,22 @@ ScrollView {
readonly property var model: listView.model readonly property var model: listView.model
readonly property var modelData: itemModelData readonly property var modelData: itemModelData
readonly property var itemValue: __hasModelRole ? itemModel[role] // Qml ListModel and QAbstractItemModel property QtObject styleData: QtObject {
: __hasModelDataRole ? modelData[role] // QObjectList / QObject readonly property var value: __hasModelRole ? itemModel[role] // Qml ListModel and QAbstractItemModel
: modelData != undefined ? modelData : "" // Models without role : __hasModelDataRole ? modelData[role] // QObjectList / QObject
readonly property bool itemSelected: rowitem.itemSelected : modelData != undefined ? modelData : "" // Models without role
readonly property color itemTextColor: rowitem.itemTextColor readonly property int row: rowitem.rowIndex
readonly property int row: rowitem.rowIndex readonly property int column: index
readonly property int column: index readonly property int elideMode: __column.elideMode
readonly property int itemElideMode: __column.elideMode readonly property int textAlignment: __column.horizontalAlignment
readonly property int itemTextAlignment: __column.horizontalAlignment readonly property bool selected: rowitem.itemSelected
readonly property string role: __column.role readonly property color textColor: rowitem.itemTextColor
readonly property string role: __column.role
}
readonly property TableViewColumn __column: columns[index] readonly property TableViewColumn __column: columns[index]
readonly property bool __hasModelRole: role && itemModel.hasOwnProperty(role) readonly property bool __hasModelRole: styleData.role && itemModel.hasOwnProperty(styleData.role)
readonly property bool __hasModelDataRole: role && modelData && modelData.hasOwnProperty(role) readonly property bool __hasModelDataRole: styleData.role && modelData && modelData.hasOwnProperty(styleData.role)
} }
} }
onWidthChanged: listView.contentWidth = width onWidthChanged: listView.contentWidth = width
...@@ -545,13 +561,12 @@ ScrollView { ...@@ -545,13 +561,12 @@ ScrollView {
sourceComponent: root.headerDelegate sourceComponent: root.headerDelegate
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
property string itemValue: columns[index].title property QtObject styleData: QtObject {
property string itemSort: (sortIndicatorVisible && index == sortIndicatorColumn) ? (sortIndicatorOrder == Qt.AscendingOrder ? "up" : "down") : ""; readonly property string value: columns[index].title
property bool itemPressed: headerClickArea.pressed readonly property bool pressed: headerClickArea.pressed
property bool itemContainsMouse: headerClickArea.containsMouse readonly property bool containsMouse: headerClickArea.containsMouse
property string itemPosition: columnCount === 1 ? "only" : readonly property int column: index
index===columnCount-1 ? "end" : }
index===0 ? "beginning" : ""
} }
Rectangle{ Rectangle{
id: targetmark id: targetmark
...@@ -612,11 +627,12 @@ ScrollView { ...@@ -612,11 +627,12 @@ ScrollView {
Loader { Loader {
id: draghandle id: draghandle
property string itemValue: columns[index].title property QtObject styleData: QtObject{
property string itemSort: (sortIndicatorVisible && index == sortIndicatorColumn) ? (sortIndicatorOrder == Qt.AscendingOrder ? "up" : "down") : ""; readonly property string value: columns[index].title
property bool itemPressed: headerClickArea.pressed readonly property bool pressed: headerClickArea.pressed
property bool itemContainsMouse: headerClickArea.containsMouse readonly property bool containsMouse: headerClickArea.containsMouse
property string itemPosition readonly property int column: index
}
parent: tableHeader parent: tableHeader
width: columns[index].width width: columns[index].width
...@@ -661,11 +677,12 @@ ScrollView { ...@@ -661,11 +677,12 @@ ScrollView {
} }
Loader { Loader {
id: loader id: loader
property string itemValue property QtObject styleData: QtObject{
property string itemSort readonly property string value: ""
property bool itemPressed readonly property bool pressed: false
property bool itemContainsMouse readonly property bool containsMouse: false
property string itemPosition readonly property int column: -1
}
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
......
TARGET = qtquickcontrols TARGET = qtquickcontrolsplugin
TARGETPATH = QtQuick/Controls TARGETPATH = QtQuick/Controls
QT += qml quick gui-private core-private QT += qml quick gui-private core-private
......
...@@ -82,6 +82,9 @@ ...@@ -82,6 +82,9 @@
\li \l{Qt Quick Controls Examples} \li \l{Qt Quick Controls Examples}
\endlist \endlist
\l {Qt Quick Controls Styles QML Types} \section2 Styles
\list
\li \l {Qt Quick Controls Styles QML Types}
\endlist
*/ */
...@@ -3,7 +3,7 @@ import QtQuick.tooling 1.1 ...@@ -3,7 +3,7 @@ import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library. // This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only. // It is used for QML tooling purposes only.
// //
// This file was auto-generated with the command '/home/jpnurmi/Projects/qt5-stable/qtbase/bin/qmlplugindump -notrelocatable QtQuick.Controls 1.0'. // This file was auto-generated with the command 'qmlplugindump -notrelocatable QtQuick.Controls 1.0'.
Module { Module {
Component { Component {
...@@ -67,6 +67,8 @@ Module { ...@@ -67,6 +67,8 @@ Module {
Property { name: "__contentItem"; type: "QQuickItem"; isPointer: true } Property { name: "__contentItem"; type: "QQuickItem"; isPointer: true }
Property { name: "__minimumWidth"; type: "int" } Property { name: "__minimumWidth"; type: "int" }
Property { name: "__font"; type: "QFont" } Property { name: "__font"; type: "QFont" }
Property { name: "__xOffset"; type: "double" }
Property { name: "__yOffset"; type: "double" }
Signal { name: "__menuClosed" } Signal { name: "__menuClosed" }
Signal { name: "popupVisibleChanged" } Signal { name: "popupVisibleChanged" }
Method { name: "__closeMenu" } Method { name: "__closeMenu" }
......
module QtQuick.Controls module QtQuick.Controls
plugin qtquickcontrols plugin qtquickcontrolsplugin
ApplicationWindow 1.0 ApplicationWindow.qml ApplicationWindow 1.0 ApplicationWindow.qml
Button 1.0 Button.qml Button 1.0 Button.qml
CheckBox 1.0 CheckBox.qml CheckBox 1.0 CheckBox.qml
......
...@@ -3,7 +3,7 @@ import QtQuick.tooling 1.1 ...@@ -3,7 +3,7 @@ import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library. // This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only. // It is used for QML tooling purposes only.
// //
// This file was auto-generated with the command '/Users/thohartm/dev/qt5/qtbase/bin/qmlplugindump.app/Contents/MacOS/qmlplugindump QtQuick.Layouts 1.0 -notrelocatable'. // This file was auto-generated with the command 'qmlplugindump QtQuick.Layouts 1.0 -notrelocatable'.
Module { Module {
Component { Component {
...@@ -11,12 +11,14 @@ Module { ...@@ -11,12 +11,14 @@ Module {
defaultProperty: "data" defaultProperty: "data"
prototype: "QQuickLinearLayout" prototype: "QQuickLinearLayout"
exports: ["QtQuick.Layouts/ColumnLayout 1.0"] exports: ["QtQuick.Layouts/ColumnLayout 1.0"]
exportMetaObjectRevisions: [0]
} }
Component { Component {
name: "QQuickGridLayout" name: "QQuickGridLayout"
defaultProperty: "data" defaultProperty: "data"
prototype: "QQuickGridLayoutBase" prototype: "QQuickGridLayoutBase"
exports: ["QtQuick.Layouts/GridLayout 1.0"] exports: ["QtQuick.Layouts/GridLayout 1.0"]
exportMetaObjectRevisions: [0]
Enum { Enum {
name: "Flow" name: "Flow"
values: { values: {
...@@ -36,6 +38,7 @@ Module { ...@@ -36,6 +38,7 @@ Module {
defaultProperty: "data" defaultProperty: "data"
prototype: "QQuickItem" prototype: "QQuickItem"
exports: ["QtQuick.Layouts/Layout 1.0"] exports: ["QtQuick.Layouts/Layout 1.0"]
exportMetaObjectRevisions: [0]
attachedType: "QQuickLayoutAttached" attachedType: "QQuickLayoutAttached"
} }
Component { Component {
...@@ -66,5 +69,6 @@ Module { ...@@ -66,5 +69,6 @@ Module {
defaultProperty: "data" defaultProperty: "data"
prototype: "QQuickLinearLayout" prototype: "QQuickLinearLayout"
exports: ["QtQuick.Layouts/RowLayout 1.0"] exports: ["QtQuick.Layouts/RowLayout 1.0"]
exportMetaObjectRevisions: [0]
} }
} }
...@@ -71,7 +71,7 @@ FocusScope { ...@@ -71,7 +71,7 @@ FocusScope {
activeFocusOnTab: false activeFocusOnTab: false
/*! \internal */ /*! \internal */
property alias __controlState: styleLoader.controlState property alias __styleData: styleLoader.styleData
Loader { Loader {
id: panelLoader id: panelLoader
...@@ -82,7 +82,7 @@ FocusScope { ...@@ -82,7 +82,7 @@ FocusScope {
id: styleLoader id: styleLoader
sourceComponent: style sourceComponent: style
property Item __control: root property Item __control: root
property QtObject controlState: null property QtObject styleData: null
onStatusChanged: { onStatusChanged: {
if (status === Loader.Error) if (status === Loader.Error)
console.error("Failed to load Style for", root) console.error("Failed to load Style for", root)
......
...@@ -75,7 +75,7 @@ Item { ...@@ -75,7 +75,7 @@ Item {
sourceComponent: __style ? __style.__scrollbar : null sourceComponent: __style ? __style.__scrollbar : null
onStatusChanged: if (status === Loader.Error) console.error("Failed to load Style for", root) onStatusChanged: if (status === Loader.Error) console.error("Failed to load Style for", root)
property alias __control: scrollbar property alias __control: scrollbar
property QtObject controlState: QtObject { property QtObject __styleData: QtObject {
readonly property alias horizontal: internal.horizontal readonly property alias horizontal: internal.horizontal
readonly property alias upPressed: scrollbar.upPressed readonly property alias upPressed: scrollbar.upPressed
readonly property alias downPressed: scrollbar.downPressed readonly property alias downPressed: scrollbar.downPressed
......