diff options
Diffstat (limited to 'src')
34 files changed, 1390 insertions, 823 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index c9f24b52..7a101969 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -354,7 +354,7 @@ Control { anchors.fill: parent anchors.leftMargin: 8 - anchors.rightMargin: __style.dropDownButtonWidth + anchors.rightMargin: __style.dropDownButtonWidth + __style.padding.right verticalAlignment: Text.AlignVCenter @@ -587,6 +587,8 @@ Control { if (__selectedIndex !== -1 && (selectedItem = items[__selectedIndex])) { input.editTextMatches = true selectedText = selectedItem.text + if (currentText !== selectedText) // __selectedIndex went form -1 to 0 + selectedTextChanged() } } } diff --git a/src/controls/Private/CalendarUtils.js b/src/controls/Private/CalendarUtils.js index 75f3b6c1..fce2a677 100644 --- a/src/controls/Private/CalendarUtils.js +++ b/src/controls/Private/CalendarUtils.js @@ -75,14 +75,37 @@ function setMonth(date, month) { return newDate; } -function cellRectAt(index, columns, rows, availableWidth, availableHeight) { +/*! + Returns the cell rectangle for the cell at the given \a index, assuming + that the grid has a number of columns equal to \a columns and rows + equal to \a rows, with an available width of \a availableWidth and height + of \a availableHeight. + + If \a gridLineWidth is greater than \c 0, the cell rectangle will be + calculated under the assumption that there is a grid between the cells: + + 31 | 1 | 2 | 3 | 4 | 5 | 6 + -------------------------------- + 7 | 8 | 9 | 10 | 11 | 12 | 13 + -------------------------------- + 14 | 15 | 16 | 17 | 18 | 19 | 20 + -------------------------------- + 21 | 22 | 23 | 24 | 25 | 26 | 27 + -------------------------------- + 28 | 29 | 30 | 31 | 1 | 2 | 3 + -------------------------------- + 4 | 5 | 6 | 7 | 8 | 9 | 10 +*/ +function cellRectAt(index, columns, rows, availableWidth, availableHeight, gridLineWidth) { var col = Math.floor(index % columns); var row = Math.floor(index / columns); - var remainingHorizontalSpace = Math.floor(availableWidth % columns); - var remainingVerticalSpace = Math.floor(availableHeight % rows); - var baseCellWidth = Math.floor(availableWidth / columns); - var baseCellHeight = Math.floor(availableHeight / rows); + var availableWidthMinusGridLines = availableWidth - ((columns - 1) * gridLineWidth); + var availableHeightMinusGridLines = availableHeight - ((rows - 1) * gridLineWidth); + var remainingHorizontalSpace = Math.floor(availableWidthMinusGridLines % columns); + var remainingVerticalSpace = Math.floor(availableHeightMinusGridLines % rows); + var baseCellWidth = Math.floor(availableWidthMinusGridLines / columns); + var baseCellHeight = Math.floor(availableHeightMinusGridLines / rows); var rect = Qt.rect(0, 0, 0, 0); @@ -108,5 +131,8 @@ function cellRectAt(index, columns, rows, availableWidth, availableHeight) { rect.y += Math.min(remainingVerticalSpace, row); } + rect.x += col * gridLineWidth; + rect.y += row * gridLineWidth; + return rect; } diff --git a/src/controls/Private/TabBar.qml b/src/controls/Private/TabBar.qml index f2010197..0d289e05 100644 --- a/src/controls/Private/TabBar.qml +++ b/src/controls/Private/TabBar.qml @@ -233,11 +233,11 @@ FocusScope { readonly property alias selected: tabitem.selected readonly property alias title: tabitem.title readonly property alias nextSelected: tabitem.nextSelected - readonly property alias previsousSelected: tabitem.previousSelected + readonly property alias previousSelected: tabitem.previousSelected readonly property alias pressed: tabitem.effectivePressed readonly property alias hovered: tabitem.containsMouse readonly property alias enabled: tabitem.enabled - readonly property bool activeFocus: tabbar.activeFocus + readonly property bool activeFocus: tabitem.activeFocus readonly property real availableWidth: tabbar.availableWidth readonly property real totalWidth: tabrow.contentWidth } diff --git a/src/controls/ScrollView.qml b/src/controls/ScrollView.qml index b18ebee7..431fadd1 100644 --- a/src/controls/ScrollView.qml +++ b/src/controls/ScrollView.qml @@ -231,7 +231,7 @@ FocusScope { WheelArea { id: wheelArea parent: flickableItem - + z: -1 // ### Note this is needed due to broken mousewheel behavior in Flickable. anchors.fill: parent diff --git a/src/controls/Styles/Base/BusyIndicatorStyle.qml b/src/controls/Styles/Base/BusyIndicatorStyle.qml index 03c3812e..ce8550db 100644 --- a/src/controls/Styles/Base/BusyIndicatorStyle.qml +++ b/src/controls/Styles/Base/BusyIndicatorStyle.qml @@ -58,7 +58,7 @@ import QtQuick.Controls.Private 1.0 indicator: Image { visible: control.running source: "spinner.png" - NumberAnimation on rotation { + RotationAnimator on rotation { running: control.running loops: Animation.Infinite duration: 2000 diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml index 34f6eb05..5f391b37 100644 --- a/src/controls/Styles/Base/CalendarStyle.qml +++ b/src/controls/Styles/Base/CalendarStyle.qml @@ -150,7 +150,7 @@ Style { function __cellRectAt(index) { return CalendarUtils.cellRectAt(index, control.__panel.columns, control.__panel.rows, - control.__panel.availableWidth, control.__panel.availableHeight); + control.__panel.availableWidth, control.__panel.availableHeight, gridVisible ? __gridLineWidth : 0); } function __isValidDate(date) { @@ -248,8 +248,13 @@ Style { */ property Component dayDelegate: Rectangle { anchors.fill: parent - anchors.margins: styleData.selected ? -1 : 0 + anchors.leftMargin: (!addExtraMargin || control.weekNumbersVisible) && styleData.index % CalendarUtils.daysInAWeek === 0 ? 0 : -1 + anchors.rightMargin: !addExtraMargin && styleData.index % CalendarUtils.daysInAWeek === CalendarUtils.daysInAWeek - 1 ? 0 : -1 + anchors.bottomMargin: !addExtraMargin && styleData.index >= CalendarUtils.daysInAWeek * (CalendarUtils.weeksOnACalendarMonth - 1) ? 0 : -1 + anchors.topMargin: styleData.selected ? -1 : 0 color: styleData.date !== undefined && styleData.selected ? selectedDateColor : "transparent" + + readonly property bool addExtraMargin: control.frameVisible && styleData.selected readonly property color sameMonthDateTextColor: "#444" readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : __syspal.highlight readonly property color selectedDateTextColor: "white" @@ -312,306 +317,318 @@ Style { readonly property int columns: CalendarUtils.daysInAWeek // The combined available width and height to be shared amongst each cell. - readonly property real availableWidth: (viewContainer.width - (control.frameVisible ? 2 * __gridLineWidth : 0)) - readonly property real availableHeight: (viewContainer.height - (control.frameVisible ? 2 * __gridLineWidth : 0)) + readonly property real availableWidth: viewContainer.width + readonly property real availableHeight: viewContainer.height property int hoveredCellIndex: -1 property int pressedCellIndex: -1 - Loader { - id: backgroundLoader + Rectangle { anchors.fill: parent - sourceComponent: background + color: "transparent" + border.color: gridColor + visible: control.frameVisible } - Loader { - id: navigationBarLoader - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top + Item { + id: container + anchors.fill: parent anchors.margins: control.frameVisible ? 1 : 0 - sourceComponent: navigationBar - property QtObject styleData: QtObject { - readonly property string title: control.__locale.standaloneMonthName(control.visibleMonth) - + new Date(control.visibleYear, control.visibleMonth, 1).toLocaleDateString(control.__locale, " yyyy") + Loader { + id: backgroundLoader + anchors.fill: parent + sourceComponent: background } - } - Row { - id: dayOfWeekHeaderRow - anchors.top: navigationBarLoader.bottom - anchors.left: parent.left - anchors.leftMargin: (control.weekNumbersVisible ? weekNumbersItem.width : 0) - anchors.right: parent.right - height: dayOfWeekHeaderRowHeight + Loader { + id: navigationBarLoader + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + sourceComponent: navigationBar - Repeater { - id: repeater - model: CalendarHeaderModel { - locale: control.__locale - } - Loader { - id: dayOfWeekDelegateLoader - sourceComponent: dayOfWeekDelegate - width: __cellRectAt(index).width - height: dayOfWeekHeaderRow.height - - readonly property var __dayOfWeek: dayOfWeek - - property QtObject styleData: QtObject { - readonly property alias dayOfWeek: dayOfWeekDelegateLoader.__dayOfWeek - } + property QtObject styleData: QtObject { + readonly property string title: control.__locale.standaloneMonthName(control.visibleMonth) + + new Date(control.visibleYear, control.visibleMonth, 1).toLocaleDateString(control.__locale, " yyyy") } } - } - Row { - id: gridRow - width: weekNumbersItem.width + viewContainer.width - height: viewContainer.height - anchors.top: dayOfWeekHeaderRow.bottom + Row { + id: dayOfWeekHeaderRow + anchors.top: navigationBarLoader.bottom + anchors.left: parent.left + anchors.leftMargin: (control.weekNumbersVisible ? weekNumbersItem.width : 0) + anchors.right: parent.right + height: dayOfWeekHeaderRowHeight - Item { - id: weekNumbersItem - visible: control.weekNumbersVisible - width: 30 - height: viewContainer.height Repeater { - id: weekNumberRepeater - model: panelItem.weeksToShow - + id: repeater + model: CalendarHeaderModel { + locale: control.__locale + } Loader { - id: weekNumberDelegateLoader - y: __cellRectAt(index * panelItem.columns).y + (gridVisible ? __gridLineWidth : 0) - width: weekNumbersItem.width - height: __cellRectAt(index * panelItem.columns).height - (control.frameVisible ? __gridLineWidth : 0) - sourceComponent: weekNumberDelegate - - readonly property int __index: index - property int __weekNumber: control.__model.weekNumberAt(index) - - Connections { - target: control - onVisibleMonthChanged: __weekNumber = control.__model.weekNumberAt(index) - onVisibleYearChanged: __weekNumber = control.__model.weekNumberAt(index) - } + id: dayOfWeekDelegateLoader + sourceComponent: dayOfWeekDelegate + width: __cellRectAt(index).width + height: dayOfWeekHeaderRow.height - Connections { - target: control.__model - onCountChanged: __weekNumber = control.__model.weekNumberAt(index) - } + readonly property var __dayOfWeek: dayOfWeek property QtObject styleData: QtObject { - readonly property alias index: weekNumberDelegateLoader.__index - readonly property int weekNumber: weekNumberDelegateLoader.__weekNumber + readonly property alias dayOfWeek: dayOfWeekDelegateLoader.__dayOfWeek } } } - Rectangle { - anchors.topMargin: - navigationBarLoader.height - anchors.top: parent.top - anchors.bottom: parent.bottom - - width: 1 - anchors.rightMargin: -1 - anchors.right: parent.right - color: gridColor - } + } + Rectangle { + id: topGridLine + color: gridColor + width: parent.width + height: __gridLineWidth + visible: gridVisible + anchors.top: dayOfWeekHeaderRow.bottom } - // Contains the grid lines and the grid itself. - Item { - id: viewContainer - width: panelItem.width - (control.weekNumbersVisible ? weekNumbersItem.width : 0) - height: panelItem.height - navigationBarLoader.height - dayOfWeekHeaderRow.height + Row { + id: gridRow + width: weekNumbersItem.width + viewContainer.width + height: viewContainer.height + anchors.top: topGridLine.bottom + + Item { + id: weekNumbersItem + visible: control.weekNumbersVisible + width: 30 + height: viewContainer.height + Repeater { + id: weekNumberRepeater + model: panelItem.weeksToShow + + Loader { + id: weekNumberDelegateLoader + y: __cellRectAt(index * panelItem.columns).y + width: weekNumbersItem.width + height: __cellRectAt(index * panelItem.columns).height + sourceComponent: weekNumberDelegate + + readonly property int __index: index + property int __weekNumber: control.__model.weekNumberAt(index) + + Connections { + target: control + onVisibleMonthChanged: __weekNumber = control.__model.weekNumberAt(index) + onVisibleYearChanged: __weekNumber = control.__model.weekNumberAt(index) + } + + Connections { + target: control.__model + onCountChanged: __weekNumber = control.__model.weekNumberAt(index) + } + + property QtObject styleData: QtObject { + readonly property alias index: weekNumberDelegateLoader.__index + readonly property int weekNumber: weekNumberDelegateLoader.__weekNumber + } + } + } + Rectangle { + anchors.topMargin: - navigationBarLoader.height + anchors.top: parent.top + anchors.bottom: parent.bottom - Repeater { - id: verticalGridLineRepeater - model: panelItem.columns - 1 - delegate: Rectangle { - // The last line will be an invalid index, so we must handle it - x: index < panelItem.columns - ? __cellRectAt(index + 1).x - : __cellRectAt(panelItem.columns).x + __cellRectAt(panelItem.columns).width - y: 0 width: __gridLineWidth - height: viewContainer.height + anchors.rightMargin: -__gridLineWidth + anchors.right: parent.right color: gridColor - visible: gridVisible } + } - Repeater { - id: horizontalGridLineRepeater - model: panelItem.rows - delegate: Rectangle { - x: 0 - // The last line will be an invalid index, so we must handle it - y: index < panelItem.columns - 1 - ? __cellRectAt(index * panelItem.columns).y - : __cellRectAt((panelItem.rows - 1) * panelItem.columns).y + __cellRectAt((panelItem.rows - 1) * panelItem.columns).height - width: viewContainer.width - height: __gridLineWidth - color: gridColor - visible: gridVisible + // Contains the grid lines and the grid itself. + Item { + id: viewContainer + width: container.width - (control.weekNumbersVisible ? weekNumbersItem.width : 0) + height: container.height - navigationBarLoader.height - dayOfWeekHeaderRow.height - topGridLine.height + + Repeater { + id: verticalGridLineRepeater + model: panelItem.columns - 1 + delegate: Rectangle { + x: __cellRectAt(index + 1).x - __gridLineWidth + y: 0 + width: __gridLineWidth + height: viewContainer.height + color: gridColor + visible: gridVisible + } } - } - MouseArea { - id: mouseArea - anchors.fill: parent + Repeater { + id: horizontalGridLineRepeater + model: panelItem.rows - 1 + delegate: Rectangle { + x: 0 + y: __cellRectAt((index + 1) * panelItem.columns).y - __gridLineWidth + width: viewContainer.width + height: __gridLineWidth + color: gridColor + visible: gridVisible + } + } - hoverEnabled: true + MouseArea { + id: mouseArea + anchors.fill: parent - function cellIndexAt(mouseX, mouseY) { - var viewContainerPos = viewContainer.mapFromItem(mouseArea, mouseX, mouseY); - var child = viewContainer.childAt(viewContainerPos.x, viewContainerPos.y); - // In the tests, the mouseArea sometimes gets picked instead of the cells, - // probably because stuff is still loading. To be safe, we check for that here. - return child && child !== mouseArea ? child.__index : -1; - } + hoverEnabled: true - onEntered: { - hoveredCellIndex = cellIndexAt(mouseX, mouseY); - if (hoveredCellIndex === undefined) { - hoveredCellIndex = cellIndexAt(mouseX, mouseY); + function cellIndexAt(mouseX, mouseY) { + var viewContainerPos = viewContainer.mapFromItem(mouseArea, mouseX, mouseY); + var child = viewContainer.childAt(viewContainerPos.x, viewContainerPos.y); + // In the tests, the mouseArea sometimes gets picked instead of the cells, + // probably because stuff is still loading. To be safe, we check for that here. + return child && child !== mouseArea ? child.__index : -1; } - var date = view.model.dateAt(hoveredCellIndex); - if (__isValidDate(date)) { - control.hovered(date); + onEntered: { + hoveredCellIndex = cellIndexAt(mouseX, mouseY); + if (hoveredCellIndex === undefined) { + hoveredCellIndex = cellIndexAt(mouseX, mouseY); + } + + var date = view.model.dateAt(hoveredCellIndex); + if (__isValidDate(date)) { + control.hovered(date); + } } - } - onExited: { - hoveredCellIndex = -1; - } + onExited: { + hoveredCellIndex = -1; + } - onPositionChanged: { - var indexOfCell = cellIndexAt(mouse.x, mouse.y); - var previousHoveredCellIndex = hoveredCellIndex; - hoveredCellIndex = indexOfCell; - if (indexOfCell !== -1) { - var date = view.model.dateAt(indexOfCell); - if (__isValidDate(date)) { - if (hoveredCellIndex !== previousHoveredCellIndex) - control.hovered(date); + onPositionChanged: { + var indexOfCell = cellIndexAt(mouse.x, mouse.y); + var previousHoveredCellIndex = hoveredCellIndex; + hoveredCellIndex = indexOfCell; + if (indexOfCell !== -1) { + var date = view.model.dateAt(indexOfCell); + if (__isValidDate(date)) { + if (hoveredCellIndex !== previousHoveredCellIndex) + control.hovered(date); + + // The date must be different for the pressed signal to be emitted. + if (pressed && date.getTime() !== control.selectedDate.getTime()) { + control.pressed(date); + + // You can't select dates in a different month while dragging. + if (date.getMonth() === control.selectedDate.getMonth()) { + control.selectedDate = date; + pressedCellIndex = indexOfCell; + } + } + } + } + } - if (pressed && date.getTime() !== control.selectedDate.getTime()) { + onPressed: { + var indexOfCell = cellIndexAt(mouse.x, mouse.y); + if (indexOfCell !== -1) { + var date = view.model.dateAt(indexOfCell); + pressedCellIndex = indexOfCell; + if (__isValidDate(date)) { control.selectedDate = date; - pressedCellIndex = indexOfCell; control.pressed(date); } } } - } - onPressed: { - var indexOfCell = cellIndexAt(mouse.x, mouse.y); - if (indexOfCell !== -1) { - var date = view.model.dateAt(indexOfCell); - pressedCellIndex = indexOfCell; - if (__isValidDate(date)) { - control.selectedDate = date; - control.pressed(date); + onReleased: { + var indexOfCell = cellIndexAt(mouse.x, mouse.y); + if (indexOfCell !== -1) { + // The cell index might be valid, but the date has to be too. We could let the + // selected date validation take care of this, but then the selected date would + // change to the earliest day if a day before the minimum date is clicked, for example. + var date = view.model.dateAt(indexOfCell); + if (__isValidDate(date)) { + control.released(date); + } } + pressedCellIndex = -1; } - } - onReleased: { - var indexOfCell = cellIndexAt(mouse.x, mouse.y); - if (indexOfCell !== -1) { - // The cell index might be valid, but the date has to be too. We could let the - // selected date validation take care of this, but then the selected date would - // change to the earliest day if a day before the minimum date is clicked, for example. - var date = view.model.dateAt(indexOfCell); - if (__isValidDate(date)) { - control.released(date); + onClicked: { + var indexOfCell = cellIndexAt(mouse.x, mouse.y); + if (indexOfCell !== -1) { + var date = view.model.dateAt(indexOfCell); + if (__isValidDate(date)) + control.clicked(date); } } - pressedCellIndex = -1; - } - onClicked: { - var indexOfCell = cellIndexAt(mouse.x, mouse.y); - if (indexOfCell !== -1) { - var date = view.model.dateAt(indexOfCell); - if (__isValidDate(date)) - control.clicked(date); + onDoubleClicked: { + var indexOfCell = cellIndexAt(mouse.x, mouse.y); + if (indexOfCell !== -1) { + var date = view.model.dateAt(indexOfCell); + if (__isValidDate(date)) + control.doubleClicked(date); + } } } - onDoubleClicked: { - var indexOfCell = cellIndexAt(mouse.x, mouse.y); - if (indexOfCell !== -1) { - var date = view.model.dateAt(indexOfCell); - if (__isValidDate(date)) - control.doubleClicked(date); - } + Connections { + target: control + onSelectedDateChanged: view.selectedDateChanged() } - } - Connections { - target: control - onSelectedDateChanged: view.selectedDateChanged() - } + Repeater { + id: view - Repeater { - id: view + property int currentIndex: -1 - property int currentIndex: -1 + model: control.__model - model: control.__model + Component.onCompleted: selectedDateChanged() - Component.onCompleted: selectedDateChanged() - - function selectedDateChanged() { - if (model !== undefined && model.locale !== undefined) { - currentIndex = model.indexAt(control.selectedDate); + function selectedDateChanged() { + if (model !== undefined && model.locale !== undefined) { + currentIndex = model.indexAt(control.selectedDate); + } } - } - - delegate: Loader { - id: delegateLoader - - x: __cellRectAt(index).x + (gridVisible ? __gridLineWidth : 0) - y: __cellRectAt(index).y + (gridVisible ? __gridLineWidth : 0) - width: __cellRectAt(index).width - (gridVisible ? __gridLineWidth : 0) - height: __cellRectAt(index).height - (gridVisible ? __gridLineWidth : 0) - z: styleData.selected ? 1 : 0 - sourceComponent: dayDelegate - readonly property int __index: index - readonly property date __date: date - // We rely on the fact that an invalid QDate will be converted to a Date - // whose year is -4713, which is always an invalid date since our - // earliest minimum date is the year 1. - readonly property bool valid: __isValidDate(date) - - property QtObject styleData: QtObject { - readonly property alias index: delegateLoader.__index - readonly property bool selected: control.selectedDate.getTime() === date.getTime() - readonly property alias date: delegateLoader.__date - readonly property bool valid: delegateLoader.valid - // TODO: this will not be correct if the app is running when a new day begins. - readonly property bool today: date.getTime() === new Date().setHours(0, 0, 0, 0) - readonly property bool visibleMonth: date.getMonth() === control.visibleMonth - readonly property bool hovered: panelItem.hoveredCellIndex == index - readonly property bool pressed: panelItem.pressedCellIndex == index - // todo: pressed property here, clicked and doubleClicked in the control itself + delegate: Loader { + id: delegateLoader + + x: __cellRectAt(index).x + y: __cellRectAt(index).y + width: __cellRectAt(index).width + height: __cellRectAt(index).height + sourceComponent: dayDelegate + + readonly property int __index: index + readonly property date __date: date + // We rely on the fact that an invalid QDate will be converted to a Date + // whose year is -4713, which is always an invalid date since our + // earliest minimum date is the year 1. + readonly property bool valid: __isValidDate(date) + + property QtObject styleData: QtObject { + readonly property alias index: delegateLoader.__index + readonly property bool selected: control.selectedDate.getTime() === date.getTime() + readonly property alias date: delegateLoader.__date + readonly property bool valid: delegateLoader.valid + // TODO: this will not be correct if the app is running when a new day begins. + readonly property bool today: date.getTime() === new Date().setHours(0, 0, 0, 0) + readonly property bool visibleMonth: date.getMonth() === control.visibleMonth + readonly property bool hovered: panelItem.hoveredCellIndex == index + readonly property bool pressed: panelItem.pressedCellIndex == index + // todo: pressed property here, clicked and doubleClicked in the control itself + } } } } } } - Rectangle { - anchors.fill: parent - color: "transparent" - border.color: gridColor - visible: control.frameVisible - } - } } diff --git a/src/controls/Styles/Base/ComboBoxStyle.qml b/src/controls/Styles/Base/ComboBoxStyle.qml index 824430ff..eed7e7f4 100644 --- a/src/controls/Styles/Base/ComboBoxStyle.qml +++ b/src/controls/Styles/Base/ComboBoxStyle.qml @@ -224,22 +224,25 @@ Style { property Component __popupStyle: Style { property int __maxPopupHeight: 400 property int submenuOverlap: 0 + property int submenuPopupDelay: 100 property Component frame: Rectangle { - width: (parent ? parent.contentWidth : 0) - height: (parent ? parent.contentHeight : 0) + 2 + id: popupFrame border.color: "white" - property real maxHeight: 500 - property int margin: 1 + Text { + text: "NOT IMPLEMENTED" + color: "red" + font { + pixelSize: 10 + bold: true + } + anchors.centerIn: parent + rotation: -Math.atan2(popupFrame.height, popupFrame.width) * 180 / Math.PI + } } property Component menuItemPanel: Text { - text: "NOT IMPLEMENTED" - color: "red" - font { - pixelSize: 14 - bold: true - } + text: styleData.text } property Component __scrollerStyle: null diff --git a/src/controls/Styles/Base/ScrollViewStyle.qml b/src/controls/Styles/Base/ScrollViewStyle.qml index 073a2e3f..d072f82e 100644 --- a/src/controls/Styles/Base/ScrollViewStyle.qml +++ b/src/controls/Styles/Base/ScrollViewStyle.qml @@ -372,6 +372,8 @@ Style { property int extent: Math.max(minimumHandleLength, __styleData.horizontal ? (flickableItem ? flickableItem.width/flickableItem.contentWidth : 0 ) * bg.width : (flickableItem ? flickableItem.height/flickableItem.contentHeight : 0) * bg.height) + readonly property real range: __control.maximumValue - __control.minimumValue + readonly property real begin: __control.value - __control.minimumValue Loader { id: handleControl @@ -379,8 +381,8 @@ Style { width: __styleData.horizontal ? extent : implicitWidth anchors.top: bg.top anchors.left: bg.left - anchors.topMargin: __styleData.horizontal ? 0 : -handleOverlap + (__control.value / __control.maximumValue) * (bg.height + 2 * handleOverlap- height) - anchors.leftMargin: __styleData.horizontal ? -handleOverlap + (__control.value / __control.maximumValue) * (bg.width + 2 * handleOverlap - width) : 0 + anchors.topMargin: __styleData.horizontal ? 0 : -handleOverlap + (2 * begin * (bg.height + (2 * handleOverlap) - extent) + range) / (2 * range) + anchors.leftMargin: __styleData.horizontal ? -handleOverlap + (2 * begin * (bg.width + (2 * handleOverlap) - extent) + range) / (2 * range) : 0 sourceComponent: handle property QtObject styleData: QtObject { readonly property bool hovered: activeControl === "handle" diff --git a/src/controls/Styles/Base/TabViewStyle.qml b/src/controls/Styles/Base/TabViewStyle.qml index acc46cf0..f13787ad 100644 --- a/src/controls/Styles/Base/TabViewStyle.qml +++ b/src/controls/Styles/Base/TabViewStyle.qml @@ -140,7 +140,7 @@ Style { scale: control.tabPosition === Qt.TopEdge ? 1 : -1 property int totalOverlap: tabOverlap * (control.count - 1) - property real maxTabWidth: (styleData.availableWidth + totalOverlap) / control.count + property real maxTabWidth: control.count > 0 ? (styleData.availableWidth + totalOverlap) / control.count : 0 implicitWidth: Math.round(Math.min(maxTabWidth, textitem.implicitWidth + 20)) implicitHeight: Math.round(textitem.implicitHeight + 10) diff --git a/src/controls/Styles/Base/TableViewStyle.qml b/src/controls/Styles/Base/TableViewStyle.qml index 667841bb..5dca6631 100644 --- a/src/controls/Styles/Base/TableViewStyle.qml +++ b/src/controls/Styles/Base/TableViewStyle.qml @@ -106,7 +106,7 @@ ScrollViewStyle { } /*! \qmlproperty Component TableViewStyle::rowDelegate - Delegate for header. This delegate is described in \l {TableView::rowDelegate} + Delegate for row. This delegate is described in \l {TableView::rowDelegate} */ property Component rowDelegate: Rectangle { height: Math.round(TextSingleton.implicitHeight * 1.2) diff --git a/src/controls/Styles/Desktop/ComboBoxStyle.qml b/src/controls/Styles/Desktop/ComboBoxStyle.qml index facc8223..9c8bf608 100644 --- a/src/controls/Styles/Desktop/ComboBoxStyle.qml +++ b/src/controls/Styles/Desktop/ComboBoxStyle.qml @@ -85,23 +85,26 @@ Style { } property Component __dropDownStyle: Style { + id: dropDownStyleRoot property int __maxPopupHeight: 600 property int submenuOverlap: 0 property int submenuPopupDelay: 0 property Component frame: StyleItem { elementType: "frame" - width: (parent ? parent.contentWidth : 0) - height: (parent ? parent.contentHeight : 0) + 2 * pixelMetric("defaultframewidth") + Component.onCompleted: { + var defaultFrameWidth = pixelMetric("defaultframewidth") + dropDownStyleRoot.padding.left = defaultFrameWidth + dropDownStyleRoot.padding.right = defaultFrameWidth + dropDownStyleRoot.padding.top = defaultFrameWidth + dropDownStyleRoot.padding.bottom = defaultFrameWidth + } } property Component menuItemPanel: StyleItem { elementType: "itemrow" selected: styleData.selected - x: pixelMetric("defaultframewidth") - y: pixelMetric("defaultframewidth") - implicitWidth: textItem.contentWidth implicitHeight: textItem.contentHeight diff --git a/src/controls/Styles/Desktop/TabViewStyle.qml b/src/controls/Styles/Desktop/TabViewStyle.qml index 9244c7d8..f39046b2 100644 --- a/src/controls/Styles/Desktop/TabViewStyle.qml +++ b/src/controls/Styles/Desktop/TabViewStyle.qml @@ -85,7 +85,7 @@ Style { property int tabHSpace: __barstyle.pixelMetric("tabhspace"); property int tabVSpace: __barstyle.pixelMetric("tabvspace"); property int totalOverlap: tabOverlap * (control.count - 1) - property real maxTabWidth: (control.width + totalOverlap) / control.count + property real maxTabWidth: control.count > 0 ? (control.width + totalOverlap) / control.count : 0 implicitWidth: Math.min(maxTabWidth, Math.max(50, styleitem.textWidth(styleData.title)) + tabHSpace + 2) implicitHeight: Math.max(styleitem.font.pixelSize + tabVSpace + 6, 0) diff --git a/src/controls/TabView.qml b/src/controls/TabView.qml index 2377b7a2..5787e3c4 100644 --- a/src/controls/TabView.qml +++ b/src/controls/TabView.qml @@ -63,7 +63,7 @@ FocusScope { property int currentIndex: 0 /*! The current tab count */ - property int count: 0 + readonly property int count: __tabs.count /*! The visibility of the tab frame around contents */ property bool frameVisible: true @@ -113,6 +113,7 @@ FocusScope { __tabs.insert(index, {tab: tab}) tab.__inserted = true tab.parent = stack + __didInsertIndex(index) __setOpacities() return tab } @@ -120,10 +121,9 @@ FocusScope { /*! Removes and destroys a tab at the given \a index. */ function removeTab(index) { var tab = __tabs.get(index).tab + __willRemoveIndex(index) __tabs.remove(index, 1) tab.destroy() - if (currentIndex > 0) - currentIndex-- __setOpacities() } @@ -147,7 +147,8 @@ FocusScope { /*! Returns the \l Tab item at \a index. */ function getTab(index) { - return __tabs.get(index).tab + var data = __tabs.get(index) + return data && data.tab } /*! \internal */ @@ -162,12 +163,24 @@ FocusScope { onCurrentIndexChanged: __setOpacities() /*! \internal */ + function __willRemoveIndex(index) { + // Make sure currentIndex will points to the same tab after the removal. + // Also activate the next index if the current index is being removed, + // except when it's both the current and last index. + if (count > 1 && (currentIndex > index || currentIndex == count -1)) + --currentIndex + } + function __didInsertIndex(index) { + // Make sure currentIndex points to the same tab as before the insertion. + if (count > 1 && currentIndex >= index) + currentIndex++ + } + function __setOpacities() { for (var i = 0; i < __tabs.count; ++i) { var child = __tabs.get(i).tab child.visible = (i == currentIndex ? true : false) } - count = __tabs.count } activeFocusOnTab: false @@ -239,6 +252,7 @@ FocusScope { if (completed) tab.Component.onDestruction.connect(stack.onDynamicTabDestroyed.bind(tab)) __tabs.append({tab: tab}) + __didInsertIndex(__tabs.count - 1) tabAdded = true } } @@ -249,6 +263,7 @@ FocusScope { function onDynamicTabDestroyed() { for (var i = 0; i < __tabs.count; ++i) { if (__tabs.get(i).tab === this) { + __willRemoveIndex(i) __tabs.remove(i, 1) __setOpacities() break diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml index 84046138..75e1b4e1 100644 --- a/src/controls/TableView.qml +++ b/src/controls/TableView.qml @@ -819,7 +819,7 @@ ScrollView { rowItemContainer.height = Qt.binding( function() { return rowItem.height }); // Reassign row-specific bindings - rowItem.rowIndex = model.index; + rowItem.rowIndex = Qt.binding( function() { return model.index }); rowItem.itemModelData = Qt.binding( function() { return typeof modelData === "undefined" ? null : modelData }); rowItem.itemModel = Qt.binding( function() { return model }); rowItem.parent = rowItemContainer; @@ -861,7 +861,7 @@ ScrollView { Loader { id: rowstyle // row delegate - sourceComponent: root.rowDelegate + sourceComponent: rowitem.itemModel !== undefined ? root.rowDelegate : null // Row fills the view width regardless of item size // But scrollbar should not adjust to it height: item ? item.height : 16 @@ -891,7 +891,8 @@ ScrollView { width: columnItem.width height: parent ? parent.height : 0 visible: columnItem.visible - sourceComponent: columnItem.delegate ? columnItem.delegate : itemDelegate + sourceComponent: rowitem.itemModel !== undefined ? // delays construction until model is initialized + (columnItem.delegate ? columnItem.delegate : itemDelegate) : null // these properties are exposed to the item delegate readonly property var model: itemModel diff --git a/src/controls/doc/src/qtquickcontrols-examples.qdoc b/src/controls/doc/src/qtquickcontrols-examples.qdoc index 45b61598..205720c8 100644 --- a/src/controls/doc/src/qtquickcontrols-examples.qdoc +++ b/src/controls/doc/src/qtquickcontrols-examples.qdoc @@ -44,6 +44,8 @@ This example project demonstrates the various UI components provided by \l{Qt Quick Controls}. + + \include examples-run.qdocinc */ /*! @@ -56,6 +58,8 @@ This example shows how to easily arrange UI components into \l{Qt Quick Layouts}{layouts} with \l{GridLayout}, \l{RowLayout}, and \l{ColumnLayout}. + + \include examples-run.qdocinc */ /*! @@ -68,6 +72,8 @@ This example project demonstrates the usage of \l {SplitView} from \l{Qt Quick Controls} - a control that lays out items horizontally or vertically with a draggable splitter between each item. + + \include examples-run.qdocinc */ /*! @@ -81,6 +87,8 @@ can be used together with different types of data models to display lists of information with support for scroll bars, selections and resizable header sections. + + \include examples-run.qdocinc */ /*! @@ -92,6 +100,8 @@ This example implements a text editor using \l{Qt Quick Controls}, complete with text formatting options, copy-paste and undo/redo. + + \include examples-run.qdocinc */ /*! @@ -103,6 +113,8 @@ This example shows how to implement a UI suitable for touch input using \l{Qt Quick Controls}. + + \include examples-run.qdocinc */ /*! @@ -114,4 +126,6 @@ This example shows how Calendar can be used to view events retrieved from an SQL database. + + \include examples-run.qdocinc */ diff --git a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc index 61c33cd6..25603541 100644 --- a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc +++ b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc @@ -64,7 +64,7 @@ The QML types can be imported into your application using the following import statement in your \c {.qml} file. \code - import QtQuick.Controls.Styles 1.1 + import QtQuick.Controls.Styles 1.2 \endcode \section1 Styling Views @@ -95,7 +95,7 @@ */ /*! - \qmlmodule QtQuick.Controls.Styles 1.1 + \qmlmodule QtQuick.Controls.Styles 1.2 \title Qt Quick Controls Styles QML Types \ingroup qmlmodules \brief Provides QML types for Qt Quick Controls styles. @@ -108,6 +108,6 @@ that can be replaced with custom QML snippets. \code - import QtQuick.Controls.Styles 1.1 + import QtQuick.Controls.Styles 1.2 \endcode */ diff --git a/src/controls/plugins.qmltypes b/src/controls/plugins.qmltypes index eadb72ef..a9d6e527 100644 --- a/src/controls/plugins.qmltypes +++ b/src/controls/plugins.qmltypes @@ -3,7 +3,8 @@ import QtQuick.tooling 1.1 // This file describes the plugin-supplied types contained in the library. // It is used for QML tooling purposes only. // -// This file was auto-generated with the command 'qmlplugindump -nonrelocatable QtQuick.Controls 1.1'. +// This file was auto-generated by: +// 'qmlplugindump -nonrelocatable QtQuick.Controls 1.2' Module { Component { @@ -30,6 +31,10 @@ Module { Property { name: "checked"; type: "bool" } Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup"; isPointer: true } Property { name: "shortcut"; type: "QVariant" } + Signal { + name: "triggered" + Parameter { name: "source"; type: "QObject"; isPointer: true } + } Signal { name: "triggered" } Signal { name: "toggled" @@ -44,17 +49,61 @@ Module { name: "tooltipChanged" Parameter { name: "arg"; type: "string" } } + Method { + name: "trigger" + Parameter { name: "source"; type: "QObject"; isPointer: true } + } Method { name: "trigger" } } Component { + name: "QQuickCalendarModel" + prototype: "QAbstractListModel" + exports: ["QtQuick.Controls.Private/CalendarModel 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "visibleDate"; type: "QDate" } + Property { name: "locale"; type: "QLocale" } + Property { name: "count"; type: "int"; isReadonly: true } + Signal { + name: "visibleDateChanged" + Parameter { name: "visibleDate"; type: "QDate" } + } + Signal { + name: "localeChanged" + Parameter { name: "locale"; type: "QLocale" } + } + Signal { + name: "countChanged" + Parameter { name: "count"; type: "int" } + } + Method { + name: "dateAt" + type: "QDate" + Parameter { name: "index"; type: "int" } + } + Method { + name: "indexAt" + type: "int" + Parameter { name: "visibleDate"; type: "QDate" } + } + Method { + name: "weekNumberAt" + type: "int" + Parameter { name: "row"; type: "int" } + } + } + Component { name: "QQuickControlSettings" prototype: "QObject" exports: ["QtQuick.Controls.Private/Settings 1.0"] + isCreatable: false + isSingleton: true exportMetaObjectRevisions: [0] Property { name: "style"; type: "QUrl"; isReadonly: true } Property { name: "styleName"; type: "string" } Property { name: "stylePath"; type: "string" } Property { name: "dpiScaleFactor"; type: "double"; isReadonly: true } + Property { name: "dragThreshold"; type: "double"; isReadonly: true } + Property { name: "hasTouchScreen"; type: "bool"; isReadonly: true } } Component { name: "QQuickExclusiveGroup" @@ -77,7 +126,7 @@ Module { name: "QQuickMenu" defaultProperty: "items" prototype: "QQuickMenuText" - exports: ["QtQuick.Controls/MenuPrivate 1.0"] + exports: ["QtQuick.Controls.Private/MenuPrivate 1.0"] exportMetaObjectRevisions: [0] Property { name: "title"; type: "string" } Property { name: "items"; type: "QObject"; isList: true; isReadonly: true } @@ -88,8 +137,12 @@ Module { Property { name: "__font"; type: "QFont" } Property { name: "__xOffset"; type: "double" } Property { name: "__yOffset"; type: "double" } + Property { name: "__action"; type: "QQuickAction"; isReadonly: true; isPointer: true } + Property { name: "__popupGeometry"; type: "QRect"; isReadonly: true } Signal { name: "__menuClosed" } Signal { name: "popupVisibleChanged" } + Signal { name: "menuContentItemChanged" } + Signal { name: "minimumWidthChanged" } Method { name: "__closeMenu" } Method { name: "__dismissMenu" } Method { name: "popup" } @@ -135,7 +188,7 @@ Module { name: "QQuickMenuBar" defaultProperty: "menus" prototype: "QObject" - exports: ["QtQuick.Controls/MenuBarPrivate 1.0"] + exports: ["QtQuick.Controls.Private/MenuBarPrivate 1.0"] exportMetaObjectRevisions: [0] Property { name: "menus"; type: "QQuickMenu"; isList: true; isReadonly: true } Property { name: "__contentItem"; type: "QQuickItem"; isPointer: true } @@ -147,10 +200,11 @@ Module { name: "QQuickMenuBase" prototype: "QObject" exports: ["QtQuick.Controls/MenuBase 1.0"] + isCreatable: false exportMetaObjectRevisions: [0] Property { name: "visible"; type: "bool" } Property { name: "type"; type: "QQuickMenuItemType::MenuItemType"; isReadonly: true } - Property { name: "__parentMenu"; type: "QQuickMenu"; isReadonly: true; isPointer: true } + Property { name: "__parentMenu"; type: "QObject"; isReadonly: true; isPointer: true } Property { name: "__isNative"; type: "bool"; isReadonly: true } Property { name: "__visualItem"; type: "QQuickItem"; isPointer: true } } @@ -175,13 +229,15 @@ Module { Component { name: "QQuickMenuItemType" exports: ["QtQuick.Controls/MenuItemType 1.0"] + isCreatable: false exportMetaObjectRevisions: [0] Enum { name: "MenuItemType" values: { "Separator": 0, "Item": 1, - "Menu": 2 + "Menu": 2, + "ScrollIndicator": 3 } } } @@ -225,6 +281,19 @@ Module { } } Component { + name: "QQuickPopupWindow" + defaultProperty: "popupContentItem" + prototype: "QQuickWindow" + exports: ["QtQuick.Controls.Private/PopupWindow 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "popupContentItem"; type: "QQuickItem"; isPointer: true } + Property { name: "parentItem"; type: "QQuickItem"; isPointer: true } + Signal { name: "popupDismissed" } + Signal { name: "geometryChanged" } + Method { name: "show" } + Method { name: "dismissPopup" } + } + Component { name: "QQuickRangeModel" prototype: "QObject" exports: ["QtQuick.Controls.Private/RangeModel 1.0"] @@ -291,6 +360,44 @@ Module { } } Component { + name: "QQuickRangedDate" + prototype: "QObject" + exports: ["QtQuick.Controls.Private/RangedDate 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "date"; type: "QDate" } + Property { name: "minimumDate"; type: "QDate" } + Property { name: "maximumDate"; type: "QDate" } + } + Component { + name: "QQuickRootItem" + defaultProperty: "data" + prototype: "QQuickItem" + Method { + name: "setWidth" + Parameter { name: "w"; type: "int" } + } + Method { + name: "setHeight" + Parameter { name: "h"; type: "int" } + } + } + Component { + name: "QQuickSelectionMode" + exports: ["QtQuick.Controls/SelectionMode 1.1"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "SelectionMode" + values: { + "NoSelection": 0, + "SingleSelection": 1, + "ExtendedSelection": 2, + "MultiSelection": 3, + "ContiguousSelection": 4 + } + } + } + Component { name: "QQuickSpinBoxValidator" prototype: "QValidator" exports: ["QtQuick.Controls.Private/SpinBoxValidator 1.0"] @@ -310,6 +417,7 @@ Module { name: "QQuickStack" prototype: "QObject" exports: ["QtQuick.Controls/Stack 1.0"] + isCreatable: false exportMetaObjectRevisions: [0] Enum { name: "Status" @@ -333,6 +441,7 @@ Module { prototype: "QQuickItem" exports: ["QtQuick.Controls.Private/StyleItem 1.0"] exportMetaObjectRevisions: [0] + Property { name: "border"; type: "QQuickPadding"; isReadonly: true; isPointer: true } Property { name: "sunken"; type: "bool" } Property { name: "raised"; type: "bool" } Property { name: "active"; type: "bool" } @@ -341,7 +450,7 @@ Module { Property { name: "on"; type: "bool" } Property { name: "hover"; type: "bool" } Property { name: "horizontal"; type: "bool" } - Property { name: "transient"; type: "bool" } + Property { name: "isTransient"; type: "bool" } Property { name: "elementType"; type: "string" } Property { name: "text"; type: "string" } Property { name: "activeControl"; type: "string" } @@ -356,6 +465,9 @@ Module { Property { name: "paintMargins"; type: "int" } Property { name: "contentWidth"; type: "int" } Property { name: "contentHeight"; type: "int" } + Property { name: "textureWidth"; type: "int" } + Property { name: "textureHeight"; type: "int" } + Signal { name: "transientChanged" } Signal { name: "infoChanged" } Signal { name: "hintChanged" } Signal { @@ -366,6 +478,14 @@ Module { name: "contentHeightChanged" Parameter { name: "arg"; type: "int" } } + Signal { + name: "textureWidthChanged" + Parameter { name: "w"; type: "int" } + } + Signal { + name: "textureHeightChanged" + Parameter { name: "h"; type: "int" } + } Method { name: "pixelMetric" type: "int" @@ -378,6 +498,7 @@ Module { } Method { name: "updateSizeHint" } Method { name: "updateRect" } + Method { name: "updateBaselineOffset" } Method { name: "updateItem" } Method { name: "hitTest" @@ -417,6 +538,8 @@ Module { name: "QQuickTooltip" prototype: "QObject" exports: ["QtQuick.Controls.Private/Tooltip 1.0"] + isCreatable: false + isSingleton: true exportMetaObjectRevisions: [0] Method { name: "showText" @@ -449,8 +572,12 @@ Module { name: "QQuickWindow" defaultProperty: "data" prototype: "QWindow" - exports: ["QtQuick.Window/Window 2.0", "QtQuick.Window/Window 2.1"] - exportMetaObjectRevisions: [0, 1] + Enum { + name: "SceneGraphError" + values: { + "ContextNotAvailable": 1 + } + } Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } Property { name: "color"; type: "QColor" } Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } @@ -462,11 +589,19 @@ Module { isPointer: true } Signal { name: "frameSwapped" } + Signal { + name: "openglContextCreated" + revision: 2 + Parameter { name: "context"; type: "QOpenGLContext"; isPointer: true } + } Signal { name: "sceneGraphInitialized" } Signal { name: "sceneGraphInvalidated" } Signal { name: "beforeSynchronizing" } + Signal { name: "afterSynchronizing"; revision: 2 } Signal { name: "beforeRendering" } Signal { name: "afterRendering" } + Signal { name: "afterAnimating"; revision: 2 } + Signal { name: "sceneGraphAboutToStop"; revision: 2 } Signal { name: "closing" revision: 1 @@ -477,6 +612,12 @@ Module { Parameter { type: "QColor" } } Signal { name: "activeFocusItemChanged"; revision: 1 } + Signal { + name: "sceneGraphError" + revision: 2 + Parameter { name: "error"; type: "QQuickWindow::SceneGraphError" } + Parameter { name: "message"; type: "string" } + } Method { name: "update" } Method { name: "releaseResources" } } @@ -501,14 +642,14 @@ Module { Property { name: "y"; type: "int" } Property { name: "width"; type: "int" } Property { name: "height"; type: "int" } - Property { name: "minimumWidth"; revision: 1; type: "int" } - Property { name: "minimumHeight"; revision: 1; type: "int" } - Property { name: "maximumWidth"; revision: 1; type: "int" } - Property { name: "maximumHeight"; revision: 1; type: "int" } + Property { name: "minimumWidth"; type: "int" } + Property { name: "minimumHeight"; type: "int" } + Property { name: "maximumWidth"; type: "int" } + Property { name: "maximumHeight"; type: "int" } Property { name: "visible"; type: "bool" } Property { name: "active"; revision: 1; type: "bool"; isReadonly: true } Property { name: "visibility"; revision: 1; type: "Visibility" } - Property { name: "contentOrientation"; revision: 1; type: "Qt::ScreenOrientation" } + Property { name: "contentOrientation"; type: "Qt::ScreenOrientation" } Property { name: "opacity"; revision: 1; type: "double" } Signal { name: "screenChanged" @@ -523,6 +664,10 @@ Module { Parameter { name: "windowState"; type: "Qt::WindowState" } } Signal { + name: "windowTitleChanged" + Parameter { name: "title"; type: "string" } + } + Signal { name: "xChanged" Parameter { name: "arg"; type: "int" } } @@ -540,22 +685,18 @@ Module { } Signal { name: "minimumWidthChanged" - revision: 1 Parameter { name: "arg"; type: "int" } } Signal { name: "minimumHeightChanged" - revision: 1 Parameter { name: "arg"; type: "int" } } Signal { name: "maximumWidthChanged" - revision: 1 Parameter { name: "arg"; type: "int" } } Signal { name: "maximumHeightChanged" - revision: 1 Parameter { name: "arg"; type: "int" } } Signal { @@ -570,7 +711,6 @@ Module { Signal { name: "activeChanged"; revision: 1 } Signal { name: "contentOrientationChanged" - revision: 1 Parameter { name: "orientation"; type: "Qt::ScreenOrientation" } } Signal { @@ -618,39 +758,32 @@ Module { } Method { name: "setMinimumWidth" - revision: 1 Parameter { name: "w"; type: "int" } } Method { name: "setMinimumHeight" - revision: 1 Parameter { name: "h"; type: "int" } } Method { name: "setMaximumWidth" - revision: 1 Parameter { name: "w"; type: "int" } } Method { name: "setMaximumHeight" - revision: 1 Parameter { name: "h"; type: "int" } } Method { name: "alert" + revision: 1 Parameter { name: "msec"; type: "int" } } } Component { - prototype: "QQuickWindow" - name: "QtQuick.Controls/ApplicationWindow" - exports: ["QtQuick.Controls/ApplicationWindow 1.0"] - exportMetaObjectRevisions: [0] + name: "QQuickWindow" defaultProperty: "data" - Property { name: "menuBar"; type: "MenuBar_QMLTYPE_1"; isPointer: true } - Property { name: "toolBar"; type: "QQuickItem"; isPointer: true } - Property { name: "statusBar"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + prototype: "QWindow" + exports: ["QtQuick.Window/Window 2.0"] + exportMetaObjectRevisions: [0] Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } Property { name: "color"; type: "QColor" } Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } @@ -678,8 +811,29 @@ Module { } Signal { name: "activeFocusItemChanged"; revision: 1 } Method { name: "update" } - Method { name: "forcePolish" } Method { name: "releaseResources" } + } + Component { + name: "QQuickWindowQmlImpl" + defaultProperty: "data" + prototype: "QQuickWindow" + exports: ["QtQuick.Window/Window 2.1"] + exportMetaObjectRevisions: [0] + } + Component { + name: "QWindow" + prototype: "QObject" + Enum { + name: "Visibility" + values: { + "Hidden": 0, + "AutomaticVisibility": 1, + "Windowed": 2, + "Minimized": 3, + "Maximized": 4, + "FullScreen": 5 + } + } Property { name: "title"; type: "string" } Property { name: "modality"; type: "Qt::WindowModality" } Property { name: "flags"; type: "Qt::WindowFlags" } @@ -820,10 +974,207 @@ Module { } } Component { + prototype: "QQuickWindow" + name: "QtQuick.Controls/ApplicationWindow" + exports: ["QtQuick.Controls/ApplicationWindow 1.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "menuBar"; type: "MenuBar_QMLTYPE_1"; isPointer: true } + Property { name: "toolBar"; type: "QQuickItem"; isPointer: true } + Property { name: "statusBar"; type: "QQuickItem"; isPointer: true } + Property { name: "__topBottomMargins"; type: "double" } + Property { name: "__qwindowsize_max"; type: "double"; isReadonly: true } + Property { name: "__width"; type: "double" } + Property { name: "__height"; type: "double" } + Property { name: "contentItem"; type: "ContentItem_QMLTYPE_9"; isReadonly: true; isPointer: true } + Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "visible"; type: "bool" } + Property { name: "visibility"; type: "Visibility" } + Signal { + name: "visibleChanged" + Parameter { name: "arg"; type: "bool" } + } + Signal { + name: "visibilityChanged" + Parameter { name: "visibility"; type: "QWindow::Visibility" } + } + Property { name: "color"; type: "QColor" } + Property { + name: "activeFocusItem" + revision: 1 + type: "QQuickItem" + isReadonly: true + isPointer: true + } + Signal { name: "frameSwapped" } + Signal { + name: "openglContextCreated" + revision: 2 + Parameter { name: "context"; type: "QOpenGLContext"; isPointer: true } + } + Signal { name: "sceneGraphInitialized" } + Signal { name: "sceneGraphInvalidated" } + Signal { name: "beforeSynchronizing" } + Signal { name: "afterSynchronizing"; revision: 2 } + Signal { name: "beforeRendering" } + Signal { name: "afterRendering" } + Signal { name: "afterAnimating"; revision: 2 } + Signal { name: "sceneGraphAboutToStop"; revision: 2 } + Signal { + name: "closing" + revision: 1 + Parameter { name: "close"; type: "QQuickCloseEvent"; isPointer: true } + } + Signal { + name: "colorChanged" + Parameter { type: "QColor" } + } + Signal { + name: "sceneGraphError" + revision: 2 + Parameter { name: "error"; type: "QQuickWindow::SceneGraphError" } + Parameter { name: "message"; type: "string" } + } + Method { name: "update" } + Method { name: "releaseResources" } + Property { name: "title"; type: "string" } + Property { name: "modality"; type: "Qt::WindowModality" } + Property { name: "flags"; type: "Qt::WindowFlags" } + Property { name: "x"; type: "int" } + Property { name: "y"; type: "int" } + Property { name: "width"; type: "int" } + Property { name: "height"; type: "int" } + Property { name: "minimumWidth"; type: "int" } + Property { name: "minimumHeight"; type: "int" } + Property { name: "maximumWidth"; type: "int" } + Property { name: "maximumHeight"; type: "int" } + Property { name: "active"; revision: 1; type: "bool"; isReadonly: true } + Property { name: "contentOrientation"; type: "Qt::ScreenOrientation" } + Property { name: "opacity"; revision: 1; type: "double" } + Signal { + name: "screenChanged" + Parameter { name: "screen"; type: "QScreen"; isPointer: true } + } + Signal { + name: "modalityChanged" + Parameter { name: "modality"; type: "Qt::WindowModality" } + } + Signal { + name: "windowStateChanged" + Parameter { name: "windowState"; type: "Qt::WindowState" } + } + Signal { + name: "windowTitleChanged" + Parameter { name: "title"; type: "string" } + } + Signal { + name: "xChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "yChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "widthChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "heightChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "minimumWidthChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "minimumHeightChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "maximumWidthChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "maximumHeightChanged" + Parameter { name: "arg"; type: "int" } + } + Signal { + name: "contentOrientationChanged" + Parameter { name: "orientation"; type: "Qt::ScreenOrientation" } + } + Signal { + name: "focusObjectChanged" + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "opacityChanged" + revision: 1 + Parameter { name: "opacity"; type: "double" } + } + Method { name: "requestActivate"; revision: 1 } + Method { + name: "setVisible" + Parameter { name: "visible"; type: "bool" } + } + Method { name: "show" } + Method { name: "hide" } + Method { name: "showMinimized" } + Method { name: "showMaximized" } + Method { name: "showFullScreen" } + Method { name: "showNormal" } + Method { name: "close"; type: "bool" } + Method { name: "raise" } + Method { name: "lower" } + Method { + name: "setTitle" + Parameter { type: "string" } + } + Method { + name: "setX" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setY" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setWidth" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setHeight" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setMinimumWidth" + Parameter { name: "w"; type: "int" } + } + Method { + name: "setMinimumHeight" + Parameter { name: "h"; type: "int" } + } + Method { + name: "setMaximumWidth" + Parameter { name: "w"; type: "int" } + } + Method { + name: "setMaximumHeight" + Parameter { name: "h"; type: "int" } + } + Method { + name: "alert" + revision: 1 + Parameter { name: "msec"; type: "int" } + } + } + Component { prototype: "QQuickFocusScope" name: "QtQuick.Controls/BusyIndicator" exports: ["QtQuick.Controls/BusyIndicator 1.1"] exportMetaObjectRevisions: [1] + isComposite: true defaultProperty: "data" Property { name: "running"; type: "bool" } Property { name: "style"; type: "QQmlComponent"; isPointer: true } @@ -837,7 +1188,10 @@ Module { name: "QtQuick.Controls/Button" exports: ["QtQuick.Controls/Button 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" + Property { name: "isDefault"; type: "bool" } + Property { name: "menu"; type: "Menu_QMLTYPE_43"; isPointer: true } Property { name: "checkable"; type: "bool" } Property { name: "checked"; type: "bool" } Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup"; isPointer: true } @@ -858,8 +1212,61 @@ Module { Property { name: "hovered"; type: "bool"; isReadonly: true } Signal { name: "clicked" } Method { name: "accessiblePressAction"; type: "QVariant" } - Property { name: "isDefault"; type: "bool" } - Property { name: "menu"; type: "Menu_QMLTYPE_16"; isPointer: true } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "QObject"; isPointer: true } + Property { name: "__panel"; type: "QQuickItem"; isPointer: true } + Property { name: "styleHints"; type: "QVariant" } + Property { name: "__styleData"; type: "QObject"; isPointer: true } + } + Component { + prototype: "QQuickFocusScope" + name: "QtQuick.Controls/Calendar" + exports: ["QtQuick.Controls/Calendar 1.2"] + exportMetaObjectRevisions: [2] + isComposite: true + defaultProperty: "data" + Property { name: "visibleMonth"; type: "int" } + Property { name: "visibleYear"; type: "int" } + Property { name: "frameVisible"; type: "bool" } + Property { name: "weekNumbersVisible"; type: "bool" } + Property { name: "dayOfWeekFormat"; type: "int" } + Property { name: "__model"; type: "QQuickCalendarModel"; isPointer: true } + Property { name: "__locale"; type: "QVariant" } + Property { name: "selectedDate"; type: "QDate" } + Property { name: "minimumDate"; type: "QDate" } + Property { name: "maximumDate"; type: "QDate" } + Signal { + name: "hovered" + Parameter { name: "date"; type: "QDateTime" } + } + Signal { + name: "pressed" + Parameter { name: "date"; type: "QDateTime" } + } + Signal { + name: "released" + Parameter { name: "date"; type: "QDateTime" } + } + Signal { + name: "clicked" + Parameter { name: "date"; type: "QDateTime" } + } + Signal { + name: "doubleClicked" + Parameter { name: "date"; type: "QDateTime" } + } + Method { name: "showPreviousMonth"; type: "QVariant" } + Method { name: "showNextMonth"; type: "QVariant" } + Method { name: "showPreviousYear"; type: "QVariant" } + Method { name: "showNextYear"; type: "QVariant" } + Method { name: "__selectPreviousMonth"; type: "QVariant" } + Method { name: "__selectNextMonth"; type: "QVariant" } + Method { name: "__selectPreviousWeek"; type: "QVariant" } + Method { name: "__selectNextWeek"; type: "QVariant" } + Method { name: "__selectFirstDayOfMonth"; type: "QVariant" } + Method { name: "__selectLastDayOfMonth"; type: "QVariant" } + Method { name: "__selectPreviousDay"; type: "QVariant" } + Method { name: "__selectNextDay"; type: "QVariant" } Property { name: "style"; type: "QQmlComponent"; isPointer: true } Property { name: "__style"; type: "QObject"; isPointer: true } Property { name: "__panel"; type: "QQuickItem"; isPointer: true } @@ -871,7 +1278,13 @@ Module { name: "QtQuick.Controls/CheckBox" exports: ["QtQuick.Controls/CheckBox 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" + Property { name: "checkedState"; type: "int" } + Property { name: "partiallyCheckedEnabled"; type: "bool" } + Property { name: "__ignoreChecked"; type: "bool" } + Property { name: "__ignoreCheckedState"; type: "bool" } + Method { name: "__cycleCheckBoxStates"; type: "QVariant" } Property { name: "checked"; type: "bool" } Property { name: "activeFocusOnPress"; type: "bool" } Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup"; isPointer: true } @@ -880,10 +1293,6 @@ Module { Property { name: "pressed"; type: "bool" } Property { name: "hovered"; type: "bool"; isReadonly: true } Signal { name: "clicked" } - Property { name: "checkedState"; type: "int" } - Property { name: "partiallyCheckedEnabled"; type: "bool" } - Property { name: "__ignoreChecked"; type: "bool" } - Method { name: "__cycleCheckBoxStates"; type: "QVariant" } Property { name: "style"; type: "QQmlComponent"; isPointer: true } Property { name: "__style"; type: "QObject"; isPointer: true } Property { name: "__panel"; type: "QQuickItem"; isPointer: true } @@ -895,6 +1304,7 @@ Module { name: "QtQuick.Controls/ComboBox" exports: ["QtQuick.Controls/ComboBox 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" Property { name: "textRole"; type: "string" } Property { name: "editable"; type: "bool" } @@ -925,6 +1335,8 @@ Module { Parameter { name: "text"; type: "QVariant" } } Method { name: "selectAll"; type: "QVariant" } + Method { name: "__selectPrevItem"; type: "QVariant" } + Method { name: "__selectNextItem"; type: "QVariant" } Property { name: "style"; type: "QQmlComponent"; isPointer: true } Property { name: "__style"; type: "QObject"; isPointer: true } Property { name: "__panel"; type: "QQuickItem"; isPointer: true } @@ -936,6 +1348,7 @@ Module { name: "QtQuick.Controls/GroupBox" exports: ["QtQuick.Controls/GroupBox 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "__content" Property { name: "title"; type: "string" } Property { name: "flat"; type: "bool" } @@ -944,184 +1357,29 @@ Module { Property { name: "checked"; type: "bool" } Property { name: "__content"; type: "QObject"; isList: true; isReadonly: true } Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "__checkbox"; type: "CheckBox_QMLTYPE_25"; isReadonly: true; isPointer: true } + Property { name: "__checkbox"; type: "CheckBox_QMLTYPE_69"; isReadonly: true; isPointer: true } Property { name: "__style"; type: "QObject"; isReadonly: true; isPointer: true } } Component { - name: "QQuickText" - defaultProperty: "data" - prototype: "QQuickImplicitSizeItem" - exports: ["QtQuick/Text 2.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "HAlignment" - values: { - "AlignLeft": 1, - "AlignRight": 2, - "AlignHCenter": 4, - "AlignJustify": 8 - } - } - Enum { - name: "VAlignment" - values: { - "AlignTop": 32, - "AlignBottom": 64, - "AlignVCenter": 128 - } - } - Enum { - name: "TextStyle" - values: { - "Normal": 0, - "Outline": 1, - "Raised": 2, - "Sunken": 3 - } - } - Enum { - name: "TextFormat" - values: { - "PlainText": 0, - "RichText": 1, - "AutoText": 2, - "StyledText": 4 - } - } - Enum { - name: "TextElideMode" - values: { - "ElideLeft": 0, - "ElideRight": 1, - "ElideMiddle": 2, - "ElideNone": 3 - } - } - Enum { - name: "WrapMode" - values: { - "NoWrap": 0, - "WordWrap": 1, - "WrapAnywhere": 3, - "WrapAtWordBoundaryOrAnywhere": 4, - "Wrap": 4 - } - } - Enum { - name: "RenderType" - values: { - "QtRendering": 0, - "NativeRendering": 1 - } - } - Enum { - name: "LineHeightMode" - values: { - "ProportionalHeight": 0, - "FixedHeight": 1 - } - } - Enum { - name: "FontSizeMode" - values: { - "FixedSize": 0, - "HorizontalFit": 1, - "VerticalFit": 2, - "Fit": 3 - } - } - Property { name: "text"; type: "string" } - Property { name: "font"; type: "QFont" } - Property { name: "color"; type: "QColor" } - Property { name: "linkColor"; type: "QColor" } - Property { name: "style"; type: "TextStyle" } - Property { name: "styleColor"; type: "QColor" } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "wrapMode"; type: "WrapMode" } - Property { name: "lineCount"; type: "int"; isReadonly: true } - Property { name: "truncated"; type: "bool"; isReadonly: true } - Property { name: "maximumLineCount"; type: "int" } - Property { name: "textFormat"; type: "TextFormat" } - Property { name: "elide"; type: "TextElideMode" } - Property { name: "contentWidth"; type: "double"; isReadonly: true } - Property { name: "contentHeight"; type: "double"; isReadonly: true } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "lineHeight"; type: "double" } - Property { name: "lineHeightMode"; type: "LineHeightMode" } - Property { name: "baseUrl"; type: "QUrl" } - Property { name: "minimumPixelSize"; type: "int" } - Property { name: "minimumPointSize"; type: "int" } - Property { name: "fontSizeMode"; type: "FontSizeMode" } - Property { name: "renderType"; type: "RenderType" } - Signal { - name: "textChanged" - Parameter { name: "text"; type: "string" } - } - Signal { - name: "linkActivated" - Parameter { name: "link"; type: "string" } - } - Signal { - name: "fontChanged" - Parameter { name: "font"; type: "QFont" } - } - Signal { - name: "styleChanged" - Parameter { name: "style"; type: "TextStyle" } - } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "VAlignment" } - } - Signal { - name: "textFormatChanged" - Parameter { name: "textFormat"; type: "TextFormat" } - } - Signal { - name: "elideModeChanged" - Parameter { name: "mode"; type: "TextElideMode" } - } - Signal { name: "contentSizeChanged" } - Signal { - name: "lineHeightChanged" - Parameter { name: "lineHeight"; type: "double" } - } - Signal { - name: "lineHeightModeChanged" - Parameter { name: "mode"; type: "LineHeightMode" } - } - Signal { - name: "lineLaidOut" - Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true } - } - Method { name: "doLayout" } - } - - Component { prototype: "QQuickText" name: "QtQuick.Controls/Label" exports: ["QtQuick.Controls/Label 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" } Component { - prototype: "QQuickMenu" + prototype: "QObject" name: "QtQuick.Controls/Menu" exports: ["QtQuick.Controls/Menu 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "items" Property { name: "__selfComponent"; type: "QQmlComponent"; isPointer: true } Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__usingDefaultStyle"; type: "bool" } Property { name: "__currentIndex"; type: "int" } - Property { name: "__menuComponent"; type: "QQmlComponent"; isPointer: true } - Property { name: "__menuBar"; type: "QVariant" } + Property { name: "__parentContentItem"; type: "QVariant" } Method { name: "addMenu" type: "QVariant" @@ -1142,8 +1400,12 @@ Module { Property { name: "__font"; type: "QFont" } Property { name: "__xOffset"; type: "double" } Property { name: "__yOffset"; type: "double" } + Property { name: "__action"; type: "QQuickAction"; isReadonly: true; isPointer: true } + Property { name: "__popupGeometry"; type: "QRect"; isReadonly: true } Signal { name: "__menuClosed" } Signal { name: "popupVisibleChanged" } + Signal { name: "menuContentItemChanged" } + Signal { name: "minimumWidthChanged" } Method { name: "__closeMenu" } Method { name: "__dismissMenu" } Method { name: "popup" } @@ -1164,11 +1426,6 @@ Module { Parameter { type: "int" } } Method { - name: "insertItem" - Parameter { type: "int" } - Parameter { type: "QQuickMenuBase"; isPointer: true } - } - Method { name: "removeItem" Parameter { type: "QQuickMenuBase"; isPointer: true } } @@ -1184,22 +1441,23 @@ Module { Parameter { name: "x"; type: "double" } Parameter { name: "y"; type: "double" } } - Property { name: "visible"; type: "bool" } - Property { name: "type"; type: "QQuickMenuItemType::MenuItemType"; isReadonly: true } - Property { name: "__parentMenu"; type: "QQuickMenu"; isReadonly: true; isPointer: true } - Property { name: "__isNative"; type: "bool"; isReadonly: true } - Property { name: "__visualItem"; type: "QQuickItem"; isPointer: true } Property { name: "enabled"; type: "bool" } Property { name: "iconSource"; type: "QUrl" } Property { name: "iconName"; type: "string" } Property { name: "__icon"; type: "QVariant"; isReadonly: true } Signal { name: "__textChanged" } + Property { name: "visible"; type: "bool" } + Property { name: "type"; type: "QQuickMenuItemType::MenuItemType"; isReadonly: true } + Property { name: "__parentMenu"; type: "QObject"; isReadonly: true; isPointer: true } + Property { name: "__isNative"; type: "bool"; isReadonly: true } + Property { name: "__visualItem"; type: "QQuickItem"; isPointer: true } } Component { - prototype: "QQuickMenuBar" + prototype: "QObject" name: "QtQuick.Controls/MenuBar" exports: ["QtQuick.Controls/MenuBar 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "menus" Property { name: "style"; type: "QQmlComponent"; isPointer: true } Property { name: "__menuBarComponent"; type: "QQmlComponent"; isPointer: true } @@ -1214,12 +1472,8 @@ Module { name: "QtQuick.Controls/ProgressBar" exports: ["QtQuick.Controls/ProgressBar 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" - Property { name: "style"; type: "QQmlComponent"; isPointer: true } - Property { name: "__style"; type: "QObject"; isPointer: true } - Property { name: "__panel"; type: "QQuickItem"; isPointer: true } - Property { name: "styleHints"; type: "QVariant" } - Property { name: "__styleData"; type: "QObject"; isPointer: true } Property { name: "value"; type: "double" } Property { name: "minimumValue"; type: "double" } Property { name: "maximumValue"; type: "double" } @@ -1232,12 +1486,18 @@ Module { type: "QVariant" Parameter { name: "v"; type: "QVariant" } } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "QObject"; isPointer: true } + Property { name: "__panel"; type: "QQuickItem"; isPointer: true } + Property { name: "styleHints"; type: "QVariant" } + Property { name: "__styleData"; type: "QObject"; isPointer: true } } Component { prototype: "QQuickFocusScope" name: "QtQuick.Controls/RadioButton" exports: ["QtQuick.Controls/RadioButton 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" Property { name: "checked"; type: "bool" } Property { name: "activeFocusOnPress"; type: "bool" } @@ -1258,6 +1518,7 @@ Module { name: "QtQuick.Controls/ScrollView" exports: ["QtQuick.Controls/ScrollView 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "contentItem" Property { name: "frameVisible"; type: "bool" } Property { name: "highlightOnFocus"; type: "bool" } @@ -1269,15 +1530,16 @@ Module { Property { name: "__style"; type: "Style_QMLTYPE_0"; isPointer: true } Property { name: "viewport"; type: "QQuickItem"; isReadonly: true; isPointer: true } Property { name: "flickableItem"; type: "QQuickFlickable"; isReadonly: true; isPointer: true } + Property { name: "__wheelAreaScrollSpeed"; type: "double" } Property { name: "__horizontalScrollBar" - type: "ScrollBar_QMLTYPE_51" + type: "ScrollBar_QMLTYPE_17" isReadonly: true isPointer: true } Property { name: "__verticalScrollBar" - type: "ScrollBar_QMLTYPE_51" + type: "ScrollBar_QMLTYPE_17" isReadonly: true isPointer: true } @@ -1287,12 +1549,8 @@ Module { name: "QtQuick.Controls/Slider" exports: ["QtQuick.Controls/Slider 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" - Property { name: "style"; type: "QQmlComponent"; isPointer: true } - Property { name: "__style"; type: "QObject"; isPointer: true } - Property { name: "__panel"; type: "QQuickItem"; isPointer: true } - Property { name: "styleHints"; type: "QVariant" } - Property { name: "__styleData"; type: "QObject"; isPointer: true } Property { name: "orientation"; type: "int" } Property { name: "updateValueWhileDragging"; type: "bool" } Property { name: "activeFocusOnPress"; type: "bool" } @@ -1305,19 +1563,21 @@ Module { Property { name: "hovered"; type: "bool"; isReadonly: true } Property { name: "stepSize"; type: "double" } Property { name: "value"; type: "double" } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "QObject"; isPointer: true } + Property { name: "__panel"; type: "QQuickItem"; isPointer: true } + Property { name: "styleHints"; type: "QVariant" } + Property { name: "__styleData"; type: "QObject"; isPointer: true } } Component { prototype: "QQuickFocusScope" name: "QtQuick.Controls/SpinBox" exports: ["QtQuick.Controls/SpinBox 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" - Property { name: "style"; type: "QQmlComponent"; isPointer: true } - Property { name: "__style"; type: "QObject"; isPointer: true } - Property { name: "__panel"; type: "QQuickItem"; isPointer: true } - Property { name: "styleHints"; type: "QVariant" } - Property { name: "__styleData"; type: "QObject"; isPointer: true } Property { name: "activeFocusOnPress"; type: "bool" } + Property { name: "horizontalAlignment"; type: "int" } Property { name: "value"; type: "double" } Property { name: "minimumValue"; type: "double" } Property { name: "maximumValue"; type: "double" } @@ -1328,14 +1588,22 @@ Module { Property { name: "font"; type: "QFont" } Property { name: "hovered"; type: "bool"; isReadonly: true } Property { name: "__text"; type: "string" } + Property { name: "__baselineOffset"; type: "double" } + Signal { name: "editingFinished" } Method { name: "__increment"; type: "QVariant" } Method { name: "__decrement"; type: "QVariant" } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "QObject"; isPointer: true } + Property { name: "__panel"; type: "QQuickItem"; isPointer: true } + Property { name: "styleHints"; type: "QVariant" } + Property { name: "__styleData"; type: "QObject"; isPointer: true } } Component { prototype: "QQuickItem" name: "QtQuick.Controls/SplitView" exports: ["QtQuick.Controls/SplitView 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "__contents" Property { name: "orientation"; type: "int" } Property { name: "handleDelegate"; type: "QQmlComponent"; isPointer: true } @@ -1349,9 +1617,10 @@ Module { name: "QtQuick.Controls/StackView" exports: ["QtQuick.Controls/StackView 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" Property { name: "busy"; type: "bool"; isReadonly: true } - Property { name: "delegate"; type: "StackViewDelegate_QMLTYPE_97"; isPointer: true } + Property { name: "delegate"; type: "StackViewDelegate_QMLTYPE_153"; isPointer: true } Property { name: "__currentItem"; type: "QQuickItem"; isPointer: true } Property { name: "__depth"; type: "int" } Property { name: "__guard"; type: "bool" } @@ -1430,6 +1699,7 @@ Module { name: "QtQuick.Controls/StackViewDelegate" exports: ["QtQuick.Controls/StackViewDelegate 1.0"] exportMetaObjectRevisions: [0] + isComposite: true Property { name: "pushTransition"; type: "QQmlComponent"; isPointer: true } Property { name: "popTransition"; type: "QQmlComponent"; isPointer: true } Property { name: "replaceTransition"; type: "QQmlComponent"; isPointer: true } @@ -1449,6 +1719,7 @@ Module { name: "QtQuick.Controls/StackViewTransition" exports: ["QtQuick.Controls/StackViewTransition 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "animations" Property { name: "name"; type: "string" } Property { name: "enterItem"; type: "QQuickItem"; isPointer: true } @@ -1456,10 +1727,11 @@ Module { Property { name: "immediate"; type: "bool" } } Component { - prototype: "QQuickItem" + prototype: "QQuickFocusScope" name: "QtQuick.Controls/StatusBar" exports: ["QtQuick.Controls/StatusBar 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "__content" Property { name: "style"; type: "QQmlComponent"; isPointer: true } Property { name: "__style"; type: "QObject"; isReadonly: true; isPointer: true } @@ -1467,10 +1739,27 @@ Module { Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } } Component { + prototype: "QQuickFocusScope" + name: "QtQuick.Controls/Switch" + exports: ["QtQuick.Controls/Switch 1.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "data" + Property { name: "checked"; type: "bool" } + Property { name: "activeFocusOnPress"; type: "bool" } + Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup"; isPointer: true } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "QObject"; isPointer: true } + Property { name: "__panel"; type: "QQuickItem"; isPointer: true } + Property { name: "styleHints"; type: "QVariant" } + Property { name: "__styleData"; type: "QObject"; isPointer: true } + } + Component { prototype: "QQuickLoader" name: "QtQuick.Controls/Tab" exports: ["QtQuick.Controls/Tab 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "component" Property { name: "title"; type: "string" } Property { name: "__inserted"; type: "bool" } @@ -1481,6 +1770,7 @@ Module { name: "QtQuick.Controls/TabView" exports: ["QtQuick.Controls/TabView 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" Property { name: "currentIndex"; type: "int" } Property { name: "count"; type: "int" } @@ -1527,29 +1817,8 @@ Module { name: "QtQuick.Controls/TableView" exports: ["QtQuick.Controls/TableView 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "__columns" - Property { name: "frameVisible"; type: "bool" } - Property { name: "highlightOnFocus"; type: "bool" } - Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } - Property { name: "__scroller"; type: "QQuickItem"; isPointer: true } - Property { name: "__scrollBarTopMargin"; type: "int" } - Property { name: "__viewTopMargin"; type: "int" } - Property { name: "style"; type: "QQmlComponent"; isPointer: true } - Property { name: "__style"; type: "Style_QMLTYPE_0"; isPointer: true } - Property { name: "viewport"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "flickableItem"; type: "QQuickFlickable"; isReadonly: true; isPointer: true } - Property { - name: "__horizontalScrollBar" - type: "ScrollBar_QMLTYPE_51" - isReadonly: true - isPointer: true - } - Property { - name: "__verticalScrollBar" - type: "ScrollBar_QMLTYPE_51" - isReadonly: true - isPointer: true - } Property { name: "alternatingRowColors"; type: "bool" } Property { name: "headerVisible"; type: "bool" } Property { name: "itemDelegate"; type: "QQmlComponent"; isPointer: true } @@ -1558,6 +1827,7 @@ Module { Property { name: "sortIndicatorColumn"; type: "int" } Property { name: "sortIndicatorVisible"; type: "bool" } Property { name: "sortIndicatorOrder"; type: "int" } + Property { name: "selectionMode"; type: "int" } Property { name: "__activateItemOnSingleClick"; type: "bool" } Property { name: "model"; type: "QVariant" } Property { name: "backgroundVisible"; type: "bool" } @@ -1569,6 +1839,13 @@ Module { Property { name: "section"; type: "QQuickViewSection"; isReadonly: true; isPointer: true } Property { name: "currentRow"; type: "int" } Property { name: "__currentRowItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { name: "__listView"; type: "QQuickListView"; isReadonly: true; isPointer: true } + Property { + name: "selection" + type: "TableViewSelection_QMLTYPE_183" + isReadonly: true + isPointer: true + } Signal { name: "activated" Parameter { name: "row"; type: "int" } @@ -1620,15 +1897,41 @@ Module { type: "QVariant" Parameter { name: "index"; type: "QVariant" } } + Method { name: "resizeColumnsToContents"; type: "QVariant" } Method { name: "__decrementCurrentIndex"; type: "QVariant" } Method { name: "__incrementCurrentIndex"; type: "QVariant" } + Property { name: "frameVisible"; type: "bool" } + Property { name: "highlightOnFocus"; type: "bool" } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + Property { name: "__scroller"; type: "QQuickItem"; isPointer: true } + Property { name: "__scrollBarTopMargin"; type: "int" } + Property { name: "__viewTopMargin"; type: "int" } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "Style_QMLTYPE_0"; isPointer: true } + Property { name: "viewport"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { name: "flickableItem"; type: "QQuickFlickable"; isReadonly: true; isPointer: true } + Property { name: "__wheelAreaScrollSpeed"; type: "double" } + Property { + name: "__horizontalScrollBar" + type: "ScrollBar_QMLTYPE_17" + isReadonly: true + isPointer: true + } + Property { + name: "__verticalScrollBar" + type: "ScrollBar_QMLTYPE_17" + isReadonly: true + isPointer: true + } } Component { prototype: "QObject" name: "QtQuick.Controls/TableViewColumn" exports: ["QtQuick.Controls/TableViewColumn 1.0"] exportMetaObjectRevisions: [0] + isComposite: true Property { name: "__view"; type: "QQuickItem"; isPointer: true } + Property { name: "__index"; type: "int" } Property { name: "title"; type: "string" } Property { name: "role"; type: "string" } Property { name: "width"; type: "int" } @@ -1638,35 +1941,15 @@ Module { Property { name: "elideMode"; type: "int" } Property { name: "horizontalAlignment"; type: "int" } Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + Method { name: "resizeToContents"; type: "QVariant" } } Component { prototype: "QQuickFocusScope" name: "QtQuick.Controls/TextArea" exports: ["QtQuick.Controls/TextArea 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" - Property { name: "frameVisible"; type: "bool" } - Property { name: "highlightOnFocus"; type: "bool" } - Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } - Property { name: "__scroller"; type: "QQuickItem"; isPointer: true } - Property { name: "__scrollBarTopMargin"; type: "int" } - Property { name: "__viewTopMargin"; type: "int" } - Property { name: "style"; type: "QQmlComponent"; isPointer: true } - Property { name: "__style"; type: "Style_QMLTYPE_0"; isPointer: true } - Property { name: "viewport"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "flickableItem"; type: "QQuickFlickable"; isReadonly: true; isPointer: true } - Property { - name: "__horizontalScrollBar" - type: "ScrollBar_QMLTYPE_51" - isReadonly: true - isPointer: true - } - Property { - name: "__verticalScrollBar" - type: "ScrollBar_QMLTYPE_51" - isReadonly: true - isPointer: true - } Property { name: "tabChangesFocus"; type: "bool" } Property { name: "activeFocusOnPress"; type: "bool" } Property { name: "baseUrl"; type: "QUrl" } @@ -1770,18 +2053,37 @@ Module { Method { name: "selectAll"; type: "QVariant" } Method { name: "selectWord"; type: "QVariant" } Method { name: "undo"; type: "QVariant" } + Property { name: "frameVisible"; type: "bool" } + Property { name: "highlightOnFocus"; type: "bool" } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + Property { name: "__scroller"; type: "QQuickItem"; isPointer: true } + Property { name: "__scrollBarTopMargin"; type: "int" } + Property { name: "__viewTopMargin"; type: "int" } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "Style_QMLTYPE_0"; isPointer: true } + Property { name: "viewport"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { name: "flickableItem"; type: "QQuickFlickable"; isReadonly: true; isPointer: true } + Property { name: "__wheelAreaScrollSpeed"; type: "double" } + Property { + name: "__horizontalScrollBar" + type: "ScrollBar_QMLTYPE_17" + isReadonly: true + isPointer: true + } + Property { + name: "__verticalScrollBar" + type: "ScrollBar_QMLTYPE_17" + isReadonly: true + isPointer: true + } } Component { prototype: "QQuickFocusScope" name: "QtQuick.Controls/TextField" exports: ["QtQuick.Controls/TextField 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" - Property { name: "style"; type: "QQmlComponent"; isPointer: true } - Property { name: "__style"; type: "QObject"; isPointer: true } - Property { name: "__panel"; type: "QQuickItem"; isPointer: true } - Property { name: "styleHints"; type: "QVariant" } - Property { name: "__styleData"; type: "QObject"; isPointer: true } Property { name: "acceptableInput"; type: "bool"; isReadonly: true } Property { name: "activeFocusOnPress"; type: "bool" } Property { name: "canPaste"; type: "bool"; isReadonly: true } @@ -1809,7 +2111,9 @@ Module { Property { name: "hovered"; type: "bool"; isReadonly: true } Property { name: "__contentHeight"; type: "double"; isReadonly: true } Property { name: "__contentWidth"; type: "double"; isReadonly: true } + Property { name: "__baselineOffset"; type: "double" } Signal { name: "accepted" } + Signal { name: "editingFinished" } Method { name: "copy"; type: "QVariant" } Method { name: "cut"; type: "QVariant" } Method { name: "deselect"; type: "QVariant" } @@ -1842,12 +2146,18 @@ Module { Method { name: "selectAll"; type: "QVariant" } Method { name: "selectWord"; type: "QVariant" } Method { name: "undo"; type: "QVariant" } + Property { name: "style"; type: "QQmlComponent"; isPointer: true } + Property { name: "__style"; type: "QObject"; isPointer: true } + Property { name: "__panel"; type: "QQuickItem"; isPointer: true } + Property { name: "styleHints"; type: "QVariant" } + Property { name: "__styleData"; type: "QObject"; isPointer: true } } Component { - prototype: "QQuickItem" + prototype: "QQuickFocusScope" name: "QtQuick.Controls/ToolBar" exports: ["QtQuick.Controls/ToolBar 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "__content" Property { name: "style"; type: "QQmlComponent"; isPointer: true } Property { name: "__style"; type: "QObject"; isReadonly: true; isPointer: true } @@ -1859,7 +2169,10 @@ Module { name: "QtQuick.Controls/ToolButton" exports: ["QtQuick.Controls/ToolButton 1.0"] exportMetaObjectRevisions: [0] + isComposite: true defaultProperty: "data" + Property { name: "isDefault"; type: "bool" } + Property { name: "menu"; type: "Menu_QMLTYPE_43"; isPointer: true } Property { name: "checkable"; type: "bool" } Property { name: "checked"; type: "bool" } Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup"; isPointer: true } diff --git a/src/controls/qquickmenu.cpp b/src/controls/qquickmenu.cpp index bb4c79b6..8982b46c 100644 --- a/src/controls/qquickmenu.cpp +++ b/src/controls/qquickmenu.cpp @@ -268,6 +268,9 @@ QQuickMenu::~QQuickMenu() item->setParentMenu(0); } + if (platformItem()) + platformItem()->setMenu(0); + delete m_platformMenu; m_platformMenu = 0; } diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp index ec33b0c1..6a2a03bc 100644 --- a/src/controls/qquickmenupopupwindow.cpp +++ b/src/controls/qquickmenupopupwindow.cpp @@ -45,6 +45,7 @@ #include <qpa/qwindowsysteminterface.h> #include <qquickitem.h> #include <QtGui/QScreen> +#include <QtQuick/private/qquickrendercontrol_p.h> QT_BEGIN_NAMESPACE @@ -84,8 +85,10 @@ void QQuickMenuPopupWindow::setItemAt(QQuickItem *menuItem) void QQuickMenuPopupWindow::setParentWindow(QQuickWindow *parentWindow) { - if (transientParent() != parentWindow) - setTransientParent(parentWindow); + QWindow *proxyWindow = QQuickRenderControl::renderWindowFor(parentWindow); + QWindow *renderWindow = proxyWindow ? proxyWindow : parentWindow; + if (transientParent() != renderWindow) + setTransientParent(renderWindow); if (parentWindow) { connect(parentWindow, SIGNAL(destroyed()), this, SLOT(dismissPopup())); if (QQuickMenuPopupWindow *pw = qobject_cast<QQuickMenuPopupWindow *>(parentWindow)) diff --git a/src/controls/qquickpopupwindow.cpp b/src/controls/qquickpopupwindow.cpp index a9e85ff3..56f4c351 100644 --- a/src/controls/qquickpopupwindow.cpp +++ b/src/controls/qquickpopupwindow.cpp @@ -44,6 +44,7 @@ #include <qguiapplication.h> #include <qpa/qwindowsysteminterface.h> #include <QtQuick/qquickitem.h> +#include <QtQuick/private/qquickrendercontrol_p.h> QT_BEGIN_NAMESPACE @@ -84,6 +85,19 @@ void QQuickPopupWindow::show() posx += parentWindow->geometry().left(); posy += parentWindow->geometry().top(); } + } else if (m_parentItem && m_parentItem->window()) { + QPoint offset; + QQuickWindow *quickWindow = m_parentItem->window(); + QWindow *renderWindow = QQuickRenderControl::renderWindowFor(quickWindow, &offset); + + QPointF pos = m_parentItem->mapToItem(quickWindow->contentItem(), QPointF(posx, posy)); + posx = pos.x(); + posy = pos.y(); + if (renderWindow) { + QPoint parentWindowOffset = renderWindow->mapToGlobal(QPoint()); + posx += offset.x() + parentWindowOffset.x(); + posy += offset.y() + parentWindowOffset.y(); + } } if (m_contentItem) { @@ -95,11 +109,15 @@ void QQuickPopupWindow::show() } emit geometryChanged(); - if (!qobject_cast<QQuickPopupWindow *>(transientParent())) // No need for parent menu windows - if (QQuickWindow *w = qobject_cast<QQuickWindow *>(transientParent())) + if (!qobject_cast<QQuickPopupWindow *>(transientParent())) { // No need for parent menu windows + if (QQuickWindow *w = qobject_cast<QQuickWindow *>(transientParent())) { if (QQuickItem *mg = w->mouseGrabberItem()) mg->ungrabMouse(); - + } else if (m_parentItem && m_parentItem->window()) { + if (QQuickItem *mg = m_parentItem->window()->mouseGrabberItem()) + mg->ungrabMouse(); + } + } QQuickWindow::show(); setMouseGrabEnabled(true); // Needs to be done after calling show() setKeyboardGrabEnabled(true); diff --git a/src/dialogs/DefaultDialogWrapper.qml b/src/dialogs/DefaultDialogWrapper.qml index 0771bdb9..9f295914 100644 --- a/src/dialogs/DefaultDialogWrapper.qml +++ b/src/dialogs/DefaultDialogWrapper.qml @@ -47,19 +47,19 @@ import "qml" AbstractDialog { id: root - default property alias data: contentItem.data + default property alias data: defaultContentItem.data Rectangle { id: content property real spacing: 6 property real outerSpacing: 12 property real buttonsRowImplicitWidth: minimumWidth - property bool buttonsInSingleRow: contentItem.width >= buttonsRowImplicitWidth + property bool buttonsInSingleRow: defaultContentItem.width >= buttonsRowImplicitWidth property real minimumHeight: implicitHeight property real minimumWidth: Screen.pixelDensity * 50 - implicitHeight: contentItem.implicitHeight + spacing + outerSpacing * 2 + buttonsRight.implicitHeight + implicitHeight: defaultContentItem.implicitHeight + spacing + outerSpacing * 2 + buttonsRight.implicitHeight implicitWidth: Math.min(Screen.desktopAvailableWidth * 0.9, Math.max( - contentItem.implicitWidth, buttonsRowImplicitWidth, Screen.pixelDensity * 50) + outerSpacing * 2); + defaultContentItem.implicitWidth, buttonsRowImplicitWidth, Screen.pixelDensity * 50) + outerSpacing * 2); color: palette.window focus: root.visible Keys.onPressed: { @@ -81,7 +81,7 @@ AbstractDialog { SystemPalette { id: palette } Item { - id: contentItem + id: defaultContentItem anchors { left: parent.left right: parent.right @@ -101,10 +101,10 @@ AbstractDialog { } Repeater { - model: standardButtonsLeftModel + id: buttonsLeftRepeater Button { - text: standardButtonsLeftModel[index].text - onClicked: root.click(standardButtonsLeftModel[index].standardButton) + text: (buttonsLeftRepeater.model && buttonsLeftRepeater.model[index] ? buttonsLeftRepeater.model[index].text : index) + onClicked: root.click(buttonsLeftRepeater.model[index].standardButton) } } @@ -127,17 +127,19 @@ AbstractDialog { } Repeater { - model: standardButtonsRightModel + id: buttonsRightRepeater // TODO maybe: insert gaps if the button requires it (destructive buttons only) Button { - text: standardButtonsRightModel[index].text - onClicked: root.click(standardButtonsRightModel[index].standardButton) + text: (buttonsRightRepeater.model && buttonsRightRepeater.model[index] ? buttonsRightRepeater.model[index].text : index) + onClicked: root.click(buttonsRightRepeater.model[index].standardButton) } } } } - function calculateImplicitWidth() { - if (standardButtonsRightModel.length < 2) + function setupButtons() { + buttonsLeftRepeater.model = root.__standardButtonsLeftModel() + buttonsRightRepeater.model = root.__standardButtonsRightModel() + if (!buttonsRightRepeater.model || buttonsRightRepeater.model.length < 2) return; var calcWidth = 0; @@ -157,6 +159,6 @@ AbstractDialog { calculateForButton(i, buttonsLeft.visibleChildren[i]) content.buttonsRowImplicitWidth = calcWidth + content.spacing } - onStandardButtonsChanged: calculateImplicitWidth() - Component.onCompleted: calculateImplicitWidth() + onStandardButtonsChanged: setupButtons() + Component.onCompleted: setupButtons() } diff --git a/src/dialogs/DefaultFileDialog.qml b/src/dialogs/DefaultFileDialog.qml index af5d7b0b..7ebd443a 100644 --- a/src/dialogs/DefaultFileDialog.qml +++ b/src/dialogs/DefaultFileDialog.qml @@ -316,12 +316,11 @@ AbstractFileDialog { x: 4 height: parent.height - 2 source: "images/folder.png" - property var isDir: view.model.get(styleData.row, "fileIsDir") - visible: isDir !== undefined && isDir } Text { id: pathText text: styleData.value + onTextChanged: fileIcon.visible = view.model.isFolder(styleData.row) anchors { left: parent.left right: parent.right diff --git a/src/dialogs/plugins.qmltypes b/src/dialogs/plugins.qmltypes index d5db4b93..1bcebdc3 100644 --- a/src/dialogs/plugins.qmltypes +++ b/src/dialogs/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.1 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -omit-prefix=__ QtQuick.Dialogs 1.1' +// 'qmlplugindump -nonrelocatable QtQuick.Dialogs 1.2' Module { Component { @@ -46,6 +46,56 @@ Module { Component { name: "QQuickAbstractDialog" prototype: "QObject" + Enum { + name: "StandardButton" + values: { + "NoButton": 0, + "Ok": 1024, + "Save": 2048, + "SaveAll": 4096, + "Open": 8192, + "Yes": 16384, + "YesToAll": 32768, + "No": 65536, + "NoToAll": 131072, + "Abort": 262144, + "Retry": 524288, + "Ignore": 1048576, + "Close": 2097152, + "Cancel": 4194304, + "Discard": 8388608, + "Help": 16777216, + "Apply": 33554432, + "Reset": 67108864, + "RestoreDefaults": 134217728, + "NButtons": 134217729 + } + } + Enum { + name: "StandardButtons" + values: { + "NoButton": 0, + "Ok": 1024, + "Save": 2048, + "SaveAll": 4096, + "Open": 8192, + "Yes": 16384, + "YesToAll": 32768, + "No": 65536, + "NoToAll": 131072, + "Abort": 262144, + "Retry": 524288, + "Ignore": 1048576, + "Close": 2097152, + "Cancel": 4194304, + "Discard": 8388608, + "Help": 16777216, + "Apply": 33554432, + "Reset": 67108864, + "RestoreDefaults": 134217728, + "NButtons": 134217729 + } + } Property { name: "visible"; type: "bool" } Property { name: "modality"; type: "Qt::WindowModality" } Property { name: "title"; type: "string" } @@ -86,6 +136,8 @@ Module { Property { name: "folder"; type: "QUrl" } Property { name: "nameFilters"; type: "QStringList" } Property { name: "selectedNameFilter"; type: "string" } + Property { name: "selectedNameFilterExtensions"; type: "QStringList"; isReadonly: true } + Property { name: "selectedNameFilterIndex"; type: "int" } Property { name: "fileUrl"; type: "QUrl"; isReadonly: true } Property { name: "fileUrls"; type: "QList<QUrl>"; isReadonly: true } Signal { name: "filterSelected" } @@ -123,6 +175,10 @@ Module { name: "selectNameFilter" Parameter { name: "f"; type: "string" } } + Method { + name: "setSelectedNameFilterIndex" + Parameter { name: "idx"; type: "int" } + } } Component { name: "QQuickAbstractFontDialog" @@ -132,6 +188,7 @@ Module { Property { name: "monospacedFonts"; type: "bool" } Property { name: "proportionalFonts"; type: "bool" } Property { name: "font"; type: "QFont" } + Property { name: "currentFont"; type: "QFont" } Signal { name: "selectionAccepted" } Method { name: "setVisible" @@ -150,6 +207,10 @@ Module { Parameter { name: "arg"; type: "QFont" } } Method { + name: "setCurrentFont" + Parameter { name: "arg"; type: "QFont" } + } + Method { name: "setScalableFonts" Parameter { name: "arg"; type: "bool" } } @@ -179,61 +240,17 @@ Module { "Question": 4 } } - Enum { - name: "StandardButton" - values: { - "NoButton": 0, - "Ok": 1024, - "Save": 2048, - "SaveAll": 4096, - "Open": 8192, - "Yes": 16384, - "YesToAll": 32768, - "No": 65536, - "NoToAll": 131072, - "Abort": 262144, - "Retry": 524288, - "Ignore": 1048576, - "Close": 2097152, - "Cancel": 4194304, - "Discard": 8388608, - "Help": 16777216, - "Apply": 33554432, - "Reset": 67108864, - "RestoreDefaults": 134217728 - } - } - Enum { - name: "StandardButtons" - values: { - "NoButton": 0, - "Ok": 1024, - "Save": 2048, - "SaveAll": 4096, - "Open": 8192, - "Yes": 16384, - "YesToAll": 32768, - "No": 65536, - "NoToAll": 131072, - "Abort": 262144, - "Retry": 524288, - "Ignore": 1048576, - "Close": 2097152, - "Cancel": 4194304, - "Discard": 8388608, - "Help": 16777216, - "Apply": 33554432, - "Reset": 67108864, - "RestoreDefaults": 134217728 - } - } Property { name: "text"; type: "string" } Property { name: "informativeText"; type: "string" } Property { name: "detailedText"; type: "string" } Property { name: "icon"; type: "Icon" } Property { name: "standardIconSource"; type: "QUrl"; isReadonly: true } - Property { name: "standardButtons"; type: "StandardButtons" } - Property { name: "clickedButton"; type: "StandardButton"; isReadonly: true } + Property { name: "standardButtons"; type: "QQuickAbstractDialog::StandardButtons" } + Property { + name: "clickedButton" + type: "QQuickAbstractDialog::StandardButton" + isReadonly: true + } Signal { name: "buttonClicked" } Signal { name: "discard" } Signal { name: "help" } @@ -271,29 +288,61 @@ Module { } Method { name: "click" - Parameter { name: "button"; type: "QMessageDialogOptions::StandardButton" } - Parameter { type: "QMessageDialogOptions::ButtonRole" } - } - Method { - name: "click" - Parameter { name: "button"; type: "QQuickAbstractMessageDialog::StandardButton" } + Parameter { name: "button"; type: "QQuickAbstractDialog::StandardButton" } } } Component { name: "QQuickColorDialog" - defaultProperty: "implementation" + defaultProperty: "contentItem" prototype: "QQuickAbstractColorDialog" exports: ["QtQuick.Dialogs/AbstractColorDialog 1.0"] exportMetaObjectRevisions: [0] - Property { name: "implementation"; type: "QObject"; isPointer: true } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + } + Component { + name: "QQuickDialog" + defaultProperty: "contentItem" + prototype: "QQuickAbstractDialog" + exports: ["QtQuick.Dialogs/AbstractDialog 1.2"] + exportMetaObjectRevisions: [0] + Property { name: "title"; type: "string" } + Property { name: "standardButtons"; type: "QQuickAbstractDialog::StandardButtons" } + Property { + name: "clickedButton" + type: "QQuickAbstractDialog::StandardButton" + isReadonly: true + } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + Signal { name: "buttonClicked" } + Signal { name: "discard" } + Signal { name: "help" } + Signal { name: "yes" } + Signal { name: "no" } + Signal { name: "apply" } + Signal { name: "reset" } + Method { + name: "setTitle" + Parameter { name: "arg"; type: "string" } + } + Method { + name: "setStandardButtons" + Parameter { name: "buttons"; type: "StandardButtons" } + } + Method { + name: "click" + Parameter { name: "button"; type: "QQuickAbstractDialog::StandardButton" } + } + Method { name: "__standardButtonsLeftModel"; type: "QJSValue" } + Method { name: "__standardButtonsRightModel"; type: "QJSValue" } } Component { name: "QQuickFileDialog" - defaultProperty: "implementation" + defaultProperty: "contentItem" prototype: "QQuickAbstractFileDialog" exports: ["QtQuick.Dialogs/AbstractFileDialog 1.0"] exportMetaObjectRevisions: [0] - Property { name: "implementation"; type: "QObject"; isPointer: true } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + Property { name: "shortcuts"; type: "QJSValue"; isReadonly: true } Method { name: "clearSelection" } Method { name: "addSelection" @@ -303,28 +352,30 @@ Module { } Component { name: "QQuickFontDialog" - defaultProperty: "implementation" + defaultProperty: "contentItem" prototype: "QQuickAbstractFontDialog" exports: ["QtQuick.Dialogs/AbstractFontDialog 1.1"] exportMetaObjectRevisions: [0] - Property { name: "implementation"; type: "QObject"; isPointer: true } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } } Component { name: "QQuickMessageDialog" - defaultProperty: "implementation" + defaultProperty: "contentItem" prototype: "QQuickAbstractMessageDialog" exports: ["QtQuick.Dialogs/AbstractMessageDialog 1.1"] exportMetaObjectRevisions: [0] - Property { name: "implementation"; type: "QObject"; isPointer: true } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } } Component { name: "QQuickStandardButton" exports: ["QtQuick.Dialogs/StandardButton 1.1"] + isCreatable: false exportMetaObjectRevisions: [0] } Component { name: "QQuickStandardIcon" exports: ["QtQuick.Dialogs/StandardIcon 1.1"] + isCreatable: false exportMetaObjectRevisions: [0] } Component { @@ -332,7 +383,11 @@ Module { name: "QtQuick.Dialogs/ColorDialog" exports: ["QtQuick.Dialogs/ColorDialog 1.0"] exportMetaObjectRevisions: [0] - defaultProperty: "implementation" + isComposite: true + defaultProperty: "contentItem" + Property { name: "__valueSet"; type: "bool" } + Method { name: "__setControlsFromColor"; type: "QVariant" } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } Property { name: "showAlphaChannel"; type: "bool" } Property { name: "color"; type: "QColor" } Property { name: "currentColor"; type: "QColor" } @@ -395,17 +450,47 @@ Module { name: "setHeight" Parameter { name: "arg"; type: "int" } } - Property { name: "implementation"; type: "QObject"; isPointer: true } } Component { prototype: "QObject" - name: "QtQuick.Dialogs/FileDialog" - exports: ["QtQuick.Dialogs/FileDialog 1.0"] - exportMetaObjectRevisions: [0] - defaultProperty: "implementation" + name: "QtQuick.Dialogs/Dialog" + exports: ["QtQuick.Dialogs/Dialog 1.2"] + exportMetaObjectRevisions: [2] + isComposite: true + defaultProperty: "data" + Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + Method { name: "setupButtons"; type: "QVariant" } + Property { name: "title"; type: "string" } + Property { name: "standardButtons"; type: "QQuickAbstractDialog::StandardButtons" } + Property { + name: "clickedButton" + type: "QQuickAbstractDialog::StandardButton" + isReadonly: true + } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + Signal { name: "buttonClicked" } + Signal { name: "discard" } + Signal { name: "help" } + Signal { name: "yes" } + Signal { name: "no" } + Signal { name: "apply" } + Signal { name: "reset" } + Method { + name: "setTitle" + Parameter { name: "arg"; type: "string" } + } + Method { + name: "setStandardButtons" + Parameter { name: "buttons"; type: "StandardButtons" } + } + Method { + name: "click" + Parameter { name: "button"; type: "QQuickAbstractDialog::StandardButton" } + } + Method { name: "__standardButtonsLeftModel"; type: "QJSValue" } + Method { name: "__standardButtonsRightModel"; type: "QJSValue" } Property { name: "visible"; type: "bool" } Property { name: "modality"; type: "Qt::WindowModality" } - Property { name: "title"; type: "string" } Property { name: "isWindow"; type: "bool"; isReadonly: true } Property { name: "x"; type: "int" } Property { name: "y"; type: "int" } @@ -433,12 +518,42 @@ Module { name: "setHeight" Parameter { name: "arg"; type: "int" } } + } + Component { + prototype: "QObject" + name: "QtQuick.Dialogs/FileDialog" + exports: ["QtQuick.Dialogs/FileDialog 1.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentItem" + Property { name: "settings"; type: "QQmlSettings"; isPointer: true } + Property { name: "showFocusHighlight"; type: "bool" } + Property { name: "palette"; type: "QQuickSystemPalette"; isPointer: true } + Property { name: "dirUpAction"; type: "QQuickAction"; isPointer: true } + Property { name: "favoriteFolders"; type: "QVariant" } + Method { + name: "dirDown" + type: "QVariant" + Parameter { name: "path"; type: "QVariant" } + } + Method { name: "dirUp"; type: "QVariant" } + Method { name: "acceptSelection"; type: "QVariant" } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + Property { name: "shortcuts"; type: "QJSValue"; isReadonly: true } + Method { name: "clearSelection" } + Method { + name: "addSelection" + type: "bool" + Parameter { name: "path"; type: "QUrl" } + } Property { name: "selectExisting"; type: "bool" } Property { name: "selectMultiple"; type: "bool" } Property { name: "selectFolder"; type: "bool" } Property { name: "folder"; type: "QUrl" } Property { name: "nameFilters"; type: "QStringList" } Property { name: "selectedNameFilter"; type: "string" } + Property { name: "selectedNameFilterExtensions"; type: "QStringList"; isReadonly: true } + Property { name: "selectedNameFilterIndex"; type: "int" } Property { name: "fileUrl"; type: "QUrl"; isReadonly: true } Property { name: "fileUrls"; type: "QList<QUrl>"; isReadonly: true } Signal { name: "filterSelected" } @@ -476,21 +591,10 @@ Module { name: "selectNameFilter" Parameter { name: "f"; type: "string" } } - Property { name: "implementation"; type: "QObject"; isPointer: true } - Method { name: "clearSelection" } Method { - name: "addSelection" - type: "bool" - Parameter { name: "path"; type: "QUrl" } + name: "setSelectedNameFilterIndex" + Parameter { name: "idx"; type: "int" } } - } - Component { - prototype: "QObject" - name: "QtQuick.Dialogs/FontDialog" - exports: ["QtQuick.Dialogs/FontDialog 1.1"] - exportMetaObjectRevisions: [1] - defaultProperty: "implementation" - Property { name: "font"; type: "QFont" } Property { name: "visible"; type: "bool" } Property { name: "modality"; type: "Qt::WindowModality" } Property { name: "title"; type: "string" } @@ -521,11 +625,21 @@ Module { name: "setHeight" Parameter { name: "arg"; type: "int" } } + } + Component { + prototype: "QObject" + name: "QtQuick.Dialogs/FontDialog" + exports: ["QtQuick.Dialogs/FontDialog 1.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "contentItem" + Property { name: "font"; type: "QFont" } + Property { name: "currentFont"; type: "QFont" } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } Property { name: "scalableFonts"; type: "bool" } Property { name: "nonScalableFonts"; type: "bool" } Property { name: "monospacedFonts"; type: "bool" } Property { name: "proportionalFonts"; type: "bool" } - Property { name: "font"; type: "QFont" } Signal { name: "selectionAccepted" } Method { name: "setVisible" @@ -544,6 +658,10 @@ Module { Parameter { name: "arg"; type: "QFont" } } Method { + name: "setCurrentFont" + Parameter { name: "arg"; type: "QFont" } + } + Method { name: "setScalableFonts" Parameter { name: "arg"; type: "bool" } } @@ -559,15 +677,6 @@ Module { name: "setProportionalFonts" Parameter { name: "arg"; type: "bool" } } - Property { name: "implementation"; type: "QObject"; isPointer: true } - } - Component { - prototype: "QObject" - name: "QtQuick.Dialogs/MessageDialog" - exports: ["QtQuick.Dialogs/MessageDialog 1.1"] - exportMetaObjectRevisions: [1] - defaultProperty: "implementation" - Method { name: "calculateImplicitWidth"; type: "QVariant" } Property { name: "visible"; type: "bool" } Property { name: "modality"; type: "Qt::WindowModality" } Property { name: "title"; type: "string" } @@ -598,13 +707,27 @@ Module { name: "setHeight" Parameter { name: "arg"; type: "int" } } + } + Component { + prototype: "QObject" + name: "QtQuick.Dialogs/MessageDialog" + exports: ["QtQuick.Dialogs/MessageDialog 1.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "contentItem" + Method { name: "calculateImplicitWidth"; type: "QVariant" } + Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } Property { name: "text"; type: "string" } Property { name: "informativeText"; type: "string" } Property { name: "detailedText"; type: "string" } Property { name: "icon"; type: "Icon" } Property { name: "standardIconSource"; type: "QUrl"; isReadonly: true } - Property { name: "standardButtons"; type: "StandardButtons" } - Property { name: "clickedButton"; type: "StandardButton"; isReadonly: true } + Property { name: "standardButtons"; type: "QQuickAbstractDialog::StandardButtons" } + Property { + name: "clickedButton" + type: "QQuickAbstractDialog::StandardButton" + isReadonly: true + } Signal { name: "buttonClicked" } Signal { name: "discard" } Signal { name: "help" } @@ -642,13 +765,37 @@ Module { } Method { name: "click" - Parameter { name: "button"; type: "QMessageDialogOptions::StandardButton" } - Parameter { type: "QMessageDialogOptions::ButtonRole" } + Parameter { name: "button"; type: "QQuickAbstractDialog::StandardButton" } + } + Property { name: "visible"; type: "bool" } + Property { name: "modality"; type: "Qt::WindowModality" } + Property { name: "title"; type: "string" } + Property { name: "isWindow"; type: "bool"; isReadonly: true } + Property { name: "x"; type: "int" } + Property { name: "y"; type: "int" } + Property { name: "width"; type: "int" } + Property { name: "height"; type: "int" } + Signal { name: "visibilityChanged" } + Signal { name: "geometryChanged" } + Signal { name: "accepted" } + Signal { name: "rejected" } + Method { name: "open" } + Method { name: "close" } + Method { + name: "setX" + Parameter { name: "arg"; type: "int" } } Method { - name: "click" - Parameter { name: "button"; type: "QQuickAbstractMessageDialog::StandardButton" } + name: "setY" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setWidth" + Parameter { name: "arg"; type: "int" } + } + Method { + name: "setHeight" + Parameter { name: "arg"; type: "int" } } - Property { name: "implementation"; type: "QObject"; isPointer: true } } } diff --git a/src/dialogs/qquickabstractdialog.cpp b/src/dialogs/qquickabstractdialog.cpp index 62d59c19..005d1015 100644 --- a/src/dialogs/qquickabstractdialog.cpp +++ b/src/dialogs/qquickabstractdialog.cpp @@ -57,9 +57,8 @@ QQuickAbstractDialog::QQuickAbstractDialog(QObject *parent) , m_parentWindow(0) , m_visible(false) , m_modality(Qt::WindowModal) - , m_qmlImplementation(0) - , m_dialogWindow(0) , m_contentItem(0) + , m_dialogWindow(0) , m_windowDecoration(0) , m_hasNativeWindows(QGuiApplicationPrivate::platformIntegration()-> hasCapability(QPlatformIntegration::MultipleWindows) && @@ -87,71 +86,64 @@ void QQuickAbstractDialog::setVisible(bool v) helper()->hide(); } } else { - // For a pure QML implementation, there is no helper. - // But m_implementation is probably either an Item or a Window at this point. - if (!m_dialogWindow) { - m_dialogWindow = qobject_cast<QWindow *>(m_qmlImplementation); - if (!m_dialogWindow) { - m_contentItem = qobject_cast<QQuickItem *>(m_qmlImplementation); - if (m_contentItem) { - if (m_hasNativeWindows) - m_dialogWindow = m_contentItem->window(); - // An Item-based dialog implementation doesn't come with a window, so - // we have to instantiate one iff the platform allows it. - if (!m_dialogWindow && m_hasNativeWindows) { - QQuickWindow *win = new QQuickWindow; - ((QObject *)win)->setParent(this); // memory management only - m_dialogWindow = win; - m_contentItem->setParentItem(win->contentItem()); - QSize minSize = QSize(m_contentItem->implicitWidth(), m_contentItem->implicitHeight()); - QVariant minHeight = m_contentItem->property("minimumHeight"); - if (minHeight.isValid()) { - if (minHeight.toInt() > minSize.height()) - minSize.setHeight(minHeight.toDouble()); - connect(m_contentItem, SIGNAL(minimumHeightChanged()), this, SLOT(minimumHeightChanged())); - } - QVariant minWidth = m_contentItem->property("minimumWidth"); - if (minWidth.isValid()) { - if (minWidth.toInt() > minSize.width()) - minSize.setWidth(minWidth.toInt()); - connect(m_contentItem, SIGNAL(minimumWidthChanged()), this, SLOT(minimumWidthChanged())); - } - m_dialogWindow->setMinimumSize(minSize); - connect(win, SIGNAL(widthChanged(int)), this, SLOT(windowGeometryChanged())); - connect(win, SIGNAL(heightChanged(int)), this, SLOT(windowGeometryChanged())); - } + // Pure QML implementation: wrap the contentItem in a window, or fake it + if (!m_dialogWindow && m_contentItem) { + if (m_hasNativeWindows) + m_dialogWindow = m_contentItem->window(); + // An Item-based dialog implementation doesn't come with a window, so + // we have to instantiate one iff the platform allows it. + if (!m_dialogWindow && m_hasNativeWindows) { + QQuickWindow *win = new QQuickWindow; + ((QObject *)win)->setParent(this); // memory management only + m_dialogWindow = win; + m_contentItem->setParentItem(win->contentItem()); + QSize minSize = QSize(m_contentItem->implicitWidth(), m_contentItem->implicitHeight()); + QVariant minHeight = m_contentItem->property("minimumHeight"); + if (minHeight.isValid()) { + if (minHeight.toInt() > minSize.height()) + minSize.setHeight(minHeight.toDouble()); + connect(m_contentItem, SIGNAL(minimumHeightChanged()), this, SLOT(minimumHeightChanged())); + } + QVariant minWidth = m_contentItem->property("minimumWidth"); + if (minWidth.isValid()) { + if (minWidth.toInt() > minSize.width()) + minSize.setWidth(minWidth.toInt()); + connect(m_contentItem, SIGNAL(minimumWidthChanged()), this, SLOT(minimumWidthChanged())); + } + m_dialogWindow->setMinimumSize(minSize); + connect(win, SIGNAL(widthChanged(int)), this, SLOT(windowGeometryChanged())); + connect(win, SIGNAL(heightChanged(int)), this, SLOT(windowGeometryChanged())); + } - QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent()); + QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent()); - // If the platform does not support multiple windows, but the dialog is - // implemented as an Item, then try to decorate it as a fake window and make it visible. - if (parentItem && !m_dialogWindow && !m_windowDecoration) { - if (m_decorationComponent) { - if (m_decorationComponent->isLoading()) - connect(m_decorationComponent, SIGNAL(statusChanged(QQmlComponent::Status)), - this, SLOT(decorationLoaded())); - else - decorationLoaded(); - } - // Window decoration wasn't possible, so just reparent it into the scene - else { - m_contentItem->setParentItem(parentItem); - m_contentItem->setZ(10000); - } - } + // If the platform does not support multiple windows, but the dialog is + // implemented as an Item, then try to decorate it as a fake window and make it visible. + if (parentItem && !m_dialogWindow && !m_windowDecoration) { + if (m_decorationComponent) { + if (m_decorationComponent->isLoading()) + connect(m_decorationComponent, SIGNAL(statusChanged(QQmlComponent::Status)), + this, SLOT(decorationLoaded())); + else + decorationLoaded(); + } + // Window decoration wasn't possible, so just reparent it into the scene + else { + m_contentItem->setParentItem(parentItem); + m_contentItem->setZ(10000); } } - if (m_dialogWindow) { - // "grow up" to the size and position expected to achieve - if (!m_sizeAspiration.isNull()) { - if (m_hasAspiredPosition) - m_dialogWindow->setGeometry(m_sizeAspiration); - else { - if (m_sizeAspiration.width() > 0) - m_dialogWindow->setWidth(m_sizeAspiration.width()); - if (m_sizeAspiration.height() > 0) - m_dialogWindow->setHeight(m_sizeAspiration.height()); - } + } + if (m_dialogWindow) { + // "grow up" to the size and position expected to achieve + if (!m_sizeAspiration.isNull()) { + if (m_hasAspiredPosition) + m_dialogWindow->setGeometry(m_sizeAspiration); + else { + if (m_sizeAspiration.width() > 0) + m_dialogWindow->setWidth(m_sizeAspiration.width()); + if (m_sizeAspiration.height() > 0) + m_dialogWindow->setHeight(m_sizeAspiration.height()); } connect(m_dialogWindow, SIGNAL(visibleChanged(bool)), this, SLOT(visibleChanged(bool))); connect(m_dialogWindow, SIGNAL(xChanged(int)), this, SLOT(setX(int))); @@ -172,7 +164,6 @@ void QQuickAbstractDialog::setVisible(bool v) m_dialogWindow->setVisible(v); } } - emit visibilityChanged(); } @@ -237,10 +228,9 @@ void QQuickAbstractDialog::visibleChanged(bool v) void QQuickAbstractDialog::windowGeometryChanged() { - QQuickItem *content = qobject_cast<QQuickItem*>(m_qmlImplementation); - if (m_dialogWindow && content) { - content->setWidth(m_dialogWindow->width()); - content->setHeight(m_dialogWindow->height()); + if (m_dialogWindow && m_contentItem) { + m_contentItem->setWidth(m_dialogWindow->width()); + m_contentItem->setHeight(m_dialogWindow->height()); } } @@ -264,9 +254,9 @@ QQuickWindow *QQuickAbstractDialog::parentWindow() return m_parentWindow; } -void QQuickAbstractDialog::setQmlImplementation(QObject *obj) +void QQuickAbstractDialog::setContentItem(QQuickItem *obj) { - m_qmlImplementation = obj; + m_contentItem = obj; if (m_dialogWindow) { disconnect(this, SLOT(visibleChanged(bool))); // Can't necessarily delete because m_dialogWindow might have been provided by the QML. diff --git a/src/dialogs/qquickabstractdialog_p.h b/src/dialogs/qquickabstractdialog_p.h index 79283c19..a905b097 100644 --- a/src/dialogs/qquickabstractdialog_p.h +++ b/src/dialogs/qquickabstractdialog_p.h @@ -82,7 +82,7 @@ public: bool isVisible() const { return m_visible; } Qt::WindowModality modality() const { return m_modality; } virtual QString title() const = 0; - QObject* qmlImplementation() { return m_qmlImplementation; } + QQuickItem* contentItem() { return m_contentItem; } int x() const; int y() const; @@ -92,7 +92,7 @@ public: virtual void setVisible(bool v); virtual void setModality(Qt::WindowModality m); virtual void setTitle(const QString &t) = 0; - void setQmlImplementation(QObject* obj); + void setContentItem(QQuickItem* obj); bool isWindow() const { return m_hasNativeWindows; } enum StandardButton { @@ -154,9 +154,8 @@ protected: Qt::WindowModality m_modality; protected: // variables for pure-QML implementations only - QObject *m_qmlImplementation; - QWindow *m_dialogWindow; QQuickItem *m_contentItem; + QWindow *m_dialogWindow; QQuickItem *m_windowDecoration; bool m_hasNativeWindows; QRect m_sizeAspiration; diff --git a/src/dialogs/qquickcolordialog_p.h b/src/dialogs/qquickcolordialog_p.h index c6ae69f8..20549459 100644 --- a/src/dialogs/qquickcolordialog_p.h +++ b/src/dialogs/qquickcolordialog_p.h @@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE class QQuickColorDialog : public QQuickAbstractColorDialog { Q_OBJECT - Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false) - Q_CLASSINFO("DefaultProperty", "implementation") // AbstractColorDialog in QML can have only one child + Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) + Q_CLASSINFO("DefaultProperty", "contentItem") // AbstractColorDialog in QML can have only one child public: explicit QQuickColorDialog(QObject *parent = 0); diff --git a/src/dialogs/qquickdialog.cpp b/src/dialogs/qquickdialog.cpp index 9e726ccd..bed69e7b 100644 --- a/src/dialogs/qquickdialog.cpp +++ b/src/dialogs/qquickdialog.cpp @@ -104,13 +104,13 @@ QQuickDialog::~QQuickDialog() { } -QJSValue QQuickDialog::standardButtonsLeftModel() +QJSValue QQuickDialog::__standardButtonsLeftModel() { updateStandardButtons(); return m_standardButtonsLeftModel; } -QJSValue QQuickDialog::standardButtonsRightModel() +QJSValue QQuickDialog::__standardButtonsRightModel() { updateStandardButtons(); return m_standardButtonsRightModel; diff --git a/src/dialogs/qquickdialog_p.h b/src/dialogs/qquickdialog_p.h index 54718221..d8b95234 100644 --- a/src/dialogs/qquickdialog_p.h +++ b/src/dialogs/qquickdialog_p.h @@ -68,10 +68,8 @@ class QQuickDialog : public QQuickAbstractDialog Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) Q_PROPERTY(QQuickAbstractDialog::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged) Q_PROPERTY(QQuickAbstractDialog::StandardButton clickedButton READ clickedButton NOTIFY buttonClicked) - Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false) - Q_PROPERTY(QJSValue standardButtonsLeftModel READ standardButtonsLeftModel NOTIFY standardButtonsChanged) - Q_PROPERTY(QJSValue standardButtonsRightModel READ standardButtonsRightModel NOTIFY standardButtonsChanged) - Q_CLASSINFO("DefaultProperty", "implementation") // Dialog in QML can have only one child + Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) + Q_CLASSINFO("DefaultProperty", "contentItem") // Dialog in QML can have only one child public: explicit QQuickDialog(QObject *parent = 0); @@ -79,8 +77,8 @@ public: StandardButtons standardButtons() const { return m_enabledButtons; } StandardButton clickedButton() const { return m_clickedButton; } - QJSValue standardButtonsLeftModel(); - QJSValue standardButtonsRightModel(); + Q_INVOKABLE QJSValue __standardButtonsLeftModel(); + Q_INVOKABLE QJSValue __standardButtonsRightModel(); QString title() const { return m_title; } diff --git a/src/dialogs/qquickfiledialog_p.h b/src/dialogs/qquickfiledialog_p.h index 0cfef472..1d2f37ab 100644 --- a/src/dialogs/qquickfiledialog_p.h +++ b/src/dialogs/qquickfiledialog_p.h @@ -62,9 +62,9 @@ QT_BEGIN_NAMESPACE class QQuickFileDialog : public QQuickAbstractFileDialog { Q_OBJECT - Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false) + Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) Q_PROPERTY(QJSValue shortcuts READ shortcuts CONSTANT) - Q_CLASSINFO("DefaultProperty", "implementation") // AbstractFileDialog in QML can have only one child + Q_CLASSINFO("DefaultProperty", "contentItem") // AbstractFileDialog in QML can have only one child public: explicit QQuickFileDialog(QObject *parent = 0); diff --git a/src/dialogs/qquickfontdialog_p.h b/src/dialogs/qquickfontdialog_p.h index c51e1fd9..a6f2ee4e 100644 --- a/src/dialogs/qquickfontdialog_p.h +++ b/src/dialogs/qquickfontdialog_p.h @@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE class QQuickFontDialog : public QQuickAbstractFontDialog { Q_OBJECT - Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false) - Q_CLASSINFO("DefaultProperty", "implementation") + Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) + Q_CLASSINFO("DefaultProperty", "contentItem") public: explicit QQuickFontDialog(QObject *parent = 0); diff --git a/src/dialogs/qquickmessagedialog_p.h b/src/dialogs/qquickmessagedialog_p.h index b21d8cba..80a0b04d 100644 --- a/src/dialogs/qquickmessagedialog_p.h +++ b/src/dialogs/qquickmessagedialog_p.h @@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE class QQuickMessageDialog : public QQuickAbstractMessageDialog { Q_OBJECT - Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false) - Q_CLASSINFO("DefaultProperty", "implementation") // AbstractMessageDialog in QML can have only one child + Q_PROPERTY(QQuickItem* contentItem READ contentItem WRITE setContentItem DESIGNABLE false) + Q_CLASSINFO("DefaultProperty", "contentItem") // AbstractMessageDialog in QML can have only one child public: explicit QQuickMessageDialog(QObject *parent = 0); diff --git a/src/dialogs/qquickplatformfiledialog.cpp b/src/dialogs/qquickplatformfiledialog.cpp index 5a969adb..c4a39060 100644 --- a/src/dialogs/qquickplatformfiledialog.cpp +++ b/src/dialogs/qquickplatformfiledialog.cpp @@ -264,7 +264,7 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper() The value of this property is also updated after the dialog is closed. - By default, this property is false. + By default, the url is empty. */ /*! diff --git a/src/layouts/qquicklinearlayout.cpp b/src/layouts/qquicklinearlayout.cpp index 4af3a76f..ea772225 100644 --- a/src/layouts/qquicklinearlayout.cpp +++ b/src/layouts/qquicklinearlayout.cpp @@ -219,14 +219,14 @@ QSizeF QQuickGridLayoutBase::sizeHint(Qt::SizeHint whichSizeHint) const \since QtQuick.Layouts 1.1 This property holds the layout direction of the grid layout - it controls whether items are - laid out from left ro right or right to left. If \c Qt.RightToLeft is specified, + laid out from left to right or right to left. If \c Qt.RightToLeft is specified, left-aligned items will be right-aligned and right-aligned items will be left-aligned. Possible values: \list \li Qt.LeftToRight (default) - Items are laid out from left to right. - \li Qt.RightToLeft - Items are laid out from right to left + \li Qt.RightToLeft - Items are laid out from right to left. \endlist \sa RowLayout::layoutDirection, ColumnLayout::layoutDirection diff --git a/src/widgets/plugins.qmltypes b/src/widgets/plugins.qmltypes index a67443c5..7265bb05 100644 --- a/src/widgets/plugins.qmltypes +++ b/src/widgets/plugins.qmltypes @@ -46,6 +46,56 @@ Module { Component { name: "QQuickAbstractDialog" prototype: "QObject" + Enum { + name: "StandardButton" + values: { + "NoButton": 0, + "Ok": 1024, + "Save": 2048, + "SaveAll": 4096, + "Open": 8192, + "Yes": 16384, + "YesToAll": 32768, + "No": 65536, + "NoToAll": 131072, + "Abort": 262144, + "Retry": 524288, + "Ignore": 1048576, + "Close": 2097152, + "Cancel": 4194304, + "Discard": 8388608, + "Help": 16777216, + "Apply": 33554432, + "Reset": 67108864, + "RestoreDefaults": 134217728, + "NButtons": 134217729 + } + } + Enum { + name: "StandardButtons" + values: { + "NoButton": 0, + "Ok": 1024, + "Save": 2048, + "SaveAll": 4096, + "Open": 8192, + "Yes": 16384, + "YesToAll": 32768, + "No": 65536, + "NoToAll": 131072, + "Abort": 262144, + "Retry": 524288, + "Ignore": 1048576, + "Close": 2097152, + "Cancel": 4194304, + "Discard": 8388608, + "Help": 16777216, + "Apply": 33554432, + "Reset": 67108864, + "RestoreDefaults": 134217728, + "NButtons": 134217729 + } + } Property { name: "visible"; type: "bool" } Property { name: "modality"; type: "Qt::WindowModality" } Property { name: "title"; type: "string" } @@ -86,6 +136,8 @@ Module { Property { name: "folder"; type: "QUrl" } Property { name: "nameFilters"; type: "QStringList" } Property { name: "selectedNameFilter"; type: "string" } + Property { name: "selectedNameFilterExtensions"; type: "QStringList"; isReadonly: true } + Property { name: "selectedNameFilterIndex"; type: "int" } Property { name: "fileUrl"; type: "QUrl"; isReadonly: true } Property { name: "fileUrls"; type: "QList<QUrl>"; isReadonly: true } Signal { name: "filterSelected" } @@ -123,6 +175,10 @@ Module { name: "selectNameFilter" Parameter { name: "f"; type: "string" } } + Method { + name: "setSelectedNameFilterIndex" + Parameter { name: "idx"; type: "int" } + } } Component { name: "QQuickAbstractFontDialog" @@ -132,6 +188,7 @@ Module { Property { name: "monospacedFonts"; type: "bool" } Property { name: "proportionalFonts"; type: "bool" } Property { name: "font"; type: "QFont" } + Property { name: "currentFont"; type: "QFont" } Signal { name: "selectionAccepted" } Method { name: "setVisible" @@ -150,6 +207,10 @@ Module { Parameter { name: "arg"; type: "QFont" } } Method { + name: "setCurrentFont" + Parameter { name: "arg"; type: "QFont" } + } + Method { name: "setScalableFonts" Parameter { name: "arg"; type: "bool" } } @@ -181,61 +242,17 @@ Module { "Question": 4 } } - Enum { - name: "StandardButton" - values: { - "NoButton": 0, - "Ok": 1024, - "Save": 2048, - "SaveAll": 4096, - "Open": 8192, - "Yes": 16384, - "YesToAll": 32768, - "No": 65536, - "NoToAll": 131072, - "Abort": 262144, - "Retry": 524288, - "Ignore": 1048576, - "Close": 2097152, - "Cancel": 4194304, - "Discard": 8388608, - "Help": 16777216, - "Apply": 33554432, - "Reset": 67108864, - "RestoreDefaults": 134217728 - } - } - Enum { - name: "StandardButtons" - values: { - "NoButton": 0, - "Ok": 1024, - "Save": 2048, - "SaveAll": 4096, - "Open": 8192, - "Yes": 16384, - "YesToAll": 32768, - "No": 65536, - "NoToAll": 131072, - "Abort": 262144, - "Retry": 524288, - "Ignore": 1048576, - "Close": 2097152, - "Cancel": 4194304, - "Discard": 8388608, - "Help": 16777216, - "Apply": 33554432, - "Reset": 67108864, - "RestoreDefaults": 134217728 - } - } Property { name: "text"; type: "string" } Property { name: "informativeText"; type: "string" } Property { name: "detailedText"; type: "string" } Property { name: "icon"; type: "Icon" } Property { name: "standardIconSource"; type: "QUrl"; isReadonly: true } - Property { name: "standardButtons"; type: "StandardButtons" } - Property { name: "clickedButton"; type: "StandardButton"; isReadonly: true } + Property { name: "standardButtons"; type: "QQuickAbstractDialog::StandardButtons" } + Property { + name: "clickedButton" + type: "QQuickAbstractDialog::StandardButton" + isReadonly: true + } Signal { name: "buttonClicked" } Signal { name: "discard" } Signal { name: "help" } @@ -273,12 +290,7 @@ Module { } Method { name: "click" - Parameter { name: "button"; type: "QMessageDialogOptions::StandardButton" } - Parameter { type: "QMessageDialogOptions::ButtonRole" } - } - Method { - name: "click" - Parameter { name: "button"; type: "QQuickAbstractMessageDialog::StandardButton" } + Parameter { name: "button"; type: "QQuickAbstractDialog::StandardButton" } } } Component { |