Source

Target

Showing with 515 additions and 127 deletions
......@@ -45,66 +45,51 @@ import "drawables"
DrawableLoader {
id: delegate
property bool active: false
property bool hasText: !!editor.text || !!editor.displayText
styleDef: styleData.hasSelection ? AndroidStyle.styleDef.textViewStyle.TextView_textSelectHandleRight
: AndroidStyle.styleDef.textViewStyle.TextView_textSelectHandle
x: styleData.hasSelection ? -width / 4 : -width / 2
y: styleData.lineHeight
opacity: 1.0
pressed: styleData.pressed
focused: control.activeFocus
window_focused: focused && control.Window.active
Connections {
target: editor
ignoreUnknownSignals: true
onDisplayTextChanged: {
delegate.state = "hidden"
}
opacity: hasText && (styleData.hasSelection || styleData.pressed || idle.running) ? 1.0 : 0.0
Timer {
id: idle
repeat: false
interval: 4000
}
Connections {
target: styleData
onActivated: {
if (editor.text) {
delegate.active = true
delegate.opacity = 1.0
delegate.state = ""
if (!styleData.hasSelection)
delegate.state = "idle"
}
onActivated: idle.restart()
onPressedChanged: {
if (!styleData.pressed)
idle.restart()
}
}
state: "hidden"
states: [
State {
name: "hidden"
when: editor.inputMethodComposing && !delegate.active && !editor.text
},
State {
name: "idle"
when: !styleData.hasSelection && !styleData.pressed
}
]
// Hide the cursor handle on textual changes, unless the signals are
// indirectly triggered by activating/tapping/moving the handle. When
// text prediction is enabled, the textual content may change when the
// cursor moves and the predicted text is committed.
Connections {
target: editor
ignoreUnknownSignals: true
onTextChanged: if (!ignore.running) idle.stop()
onDisplayTextChanged: if (!ignore.running) idle.stop()
onInputMethodComposing: if (!ignore.running) idle.stop()
}
transitions: [
Transition {
to: "hidden"
SequentialAnimation {
PauseAnimation { duration: 100 }
PropertyAction { target: delegate; property: "opacity"; value: 0.0 }
}
},
Transition {
to: "idle"
SequentialAnimation {
PauseAnimation { duration: 4000 }
NumberAnimation { target: delegate; property: "opacity"; to: 0.0 }
PropertyAction { target: delegate; property: "active"; value: false }
}
}
]
Timer {
id: ignore
repeat: false
interval: 250
running: idle.running
}
}
......@@ -37,7 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Private 1.0
......@@ -58,7 +58,7 @@ Style {
readonly property real contentWidth: Math.max(styleDef.View_minWidth || 0, styleData.contentWidth)
readonly property real contentHeight: Math.max(styleDef.View_minHeight || 0, styleData.contentHeight)
readonly property real labelWidth: label.implicitWidth + bg.padding.left + bg.padding.right
readonly property real labelWidth: Math.max(label.implicitWidth, metrics.width) + bg.padding.left + bg.padding.right
readonly property real labelHeight: label.implicitHeight + bg.padding.top + bg.padding.bottom
implicitWidth: Math.max(contentWidth, Math.max(bg.implicitWidth, labelWidth))
......@@ -88,6 +88,11 @@ Style {
readonly property int horizontalAlignment: Qt.AlignLeft
readonly property int verticalAlignment: Qt.AlignVCenter
TextMetrics {
id: metrics
text: "12345678901234567890"
}
LabelStyle {
id: label
visible: false
......
......@@ -79,18 +79,26 @@ SwitchStyle {
Item {
id: thumb
readonly property bool hideText: AndroidStyle.styleDef.switchStyle.Switch_showText === false
x: control.checked ? max : min
FontMetrics {
id: metrics
TextMetrics {
id: onMetrics
font: label.font
text: panel.styleDef.Switch_textOn
}
TextMetrics {
id: offMetrics
font: label.font
text: panel.styleDef.Switch_textOff
}
readonly property real maxTextWidth: Math.max(metrics.boundingRect(panel.styleDef.Switch_textOn).width,
metrics.boundingRect(panel.styleDef.Switch_textOff).width)
readonly property real maxTextWidth: Math.max(onMetrics.width, offMetrics.width)
implicitWidth: Math.max(loader.implicitWidth, maxTextWidth + 2 * panel.styleDef.Switch_thumbTextPadding)
implicitHeight: Math.max(loader.implicitHeight, metrics.height)
implicitHeight: Math.max(loader.implicitHeight, onMetrics.height, offMetrics.height)
anchors.top: parent.top
anchors.bottom: parent.bottom
......@@ -120,6 +128,7 @@ SwitchStyle {
LabelStyle {
id: label
visible: !thumb.hideText
text: control.checked ? panel.styleDef.Switch_textOn : panel.styleDef.Switch_textOff
pressed: control.pressed
......
......@@ -37,7 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Private 1.0
......@@ -56,7 +56,7 @@ Style {
readonly property real minWidth: styleDef.View_minWidth || 0
readonly property real minHeight: styleDef.View_minHeight || 0
readonly property real labelWidth: label.implicitWidth + bg.padding.left + bg.padding.right
readonly property real labelWidth: Math.max(label.implicitWidth, metrics.width) + bg.padding.left + bg.padding.right
readonly property real labelHeight: label.implicitHeight + bg.padding.top + bg.padding.bottom
implicitWidth: Math.max(minWidth, Math.max(bg.implicitWidth, labelWidth))
......@@ -81,10 +81,15 @@ Style {
readonly property alias selectionColor: label.selectionColor
readonly property color selectedTextColor: label.selectedTextColor
TextMetrics {
id: metrics
text: "12345678901234567890"
}
LabelStyle {
id: label
visible: false
text: control.text
text: control.text || control.placeholderText
focused: control.activeFocus
window_focused: focused && control.Window.active
styleDef: panel.styleDef
......
......@@ -52,5 +52,33 @@ Drawable {
anchors.fill: parent
fillMode: Image.TileHorizontally
source: AndroidStyle.filePath(styleDef.path)
layer.enabled: !!styleDef && !!styleDef.tintList
layer.effect: ShaderEffect {
property variant source: image
property color color: AndroidStyle.colorValue(styleDef.tintList[state])
state: {
var states = []
if (pressed) states.push("PRESSED")
if (enabled) states.push("ENABLED")
if (focused) states.push("FOCUSED")
if (selected) states.push("SELECTED")
if (window_focused) states.push("WINDOW_FOCUSED")
if (!states.length)
states.push("EMPTY")
return states.join("_") + "_STATE_SET"
}
// QtGraphicalEffects/ColorOverlay:
fragmentShader: "
varying mediump vec2 qt_TexCoord0;
uniform highp float qt_Opacity;
uniform lowp sampler2D source;
uniform highp vec4 color;
void main() {
highp vec4 pixelColor = texture2D(source, qt_TexCoord0);
gl_FragColor = vec4(mix(pixelColor.rgb/max(pixelColor.a, 0.00390625), color.rgb/max(color.a, 0.00390625), color.a) * pixelColor.a, pixelColor.a) * qt_Opacity;
}
"
}
}
}
......@@ -109,8 +109,8 @@ Style {
elementType: "itemrow"
selected: styleData.selected
implicitWidth: textItem.contentWidth
implicitHeight: textItem.contentHeight
implicitWidth: textItem.implicitWidth
implicitHeight: textItem.implicitHeight
StyleItem {
id: textItem
......
......@@ -45,6 +45,7 @@ Item {
y: -20
width: 80
height: knob.height + knobLine.height + 60
visible: styleData.hasSelection
Rectangle {
id: knob
......
......@@ -770,7 +770,7 @@ ScrollView {
wrapMode: TextEdit.WordWrap
textMargin: __style && __style.textMargin !== undefined ? __style.textMargin : 4
selectByMouse: area.selectByMouse && (!cursorHandle.delegate || !selectionHandle.delegate)
selectByMouse: area.selectByMouse && (!Settings.isMobile || !cursorHandle.delegate || !selectionHandle.delegate)
readOnly: false
Keys.forwardTo: area
......@@ -885,7 +885,7 @@ ScrollView {
control: area
z: 1 // above scrollbars
parent: Qt.platform.os === "ios" ? editor : __scroller // no clip
active: area.selectByMouse
active: area.selectByMouse && Settings.isMobile
delegate: __style.__selectionHandle
maximum: cursorHandle.position - 1
......@@ -921,7 +921,7 @@ ScrollView {
control: area
z: 1 // above scrollbars
parent: Qt.platform.os === "ios" ? editor : __scroller // no clip
active: area.selectByMouse
active: area.selectByMouse && Settings.isMobile
delegate: __style.__cursorHandle
minimum: edit.hasSelection ? selectionHandle.position + 1 : -1
......@@ -933,7 +933,7 @@ ScrollView {
property var posInViewport: flickableItem.contentX !== flickableItem.contentY !== Number.MAX_VALUE ?
parent.mapToItem(viewport, handleX, handleY) : -1
visible: pressed || (edit.hasSelection
visible: pressed || ((edit.cursorVisible || edit.hasSelection)
&& posInViewport.y + handleHeight >= -1
&& posInViewport.y <= viewport.height + 1
&& posInViewport.x + handleWidth >= -1
......
src/controls/doc/images/qtquickcontrols-android.png

20.9 KB

src/controls/doc/images/qtquickcontrols-example-gallery-android.png

25.7 KB

src/controls/doc/images/qtquickcontrols-example-gallery-osx.png

23.6 KB

src/controls/doc/images/qtquickcontrols-example-gallery.png

33.3 KB

src/controls/doc/images/qtquickcontrols-example-splitview.png

398 Bytes

src/controls/doc/images/qtquickcontrols-example-tableview.png

37.6 KB | W: 0px | H: 0px

src/controls/doc/images/qtquickcontrols-example-tableview.png

35.4 KB | W: 0px | H: 0px

src/controls/doc/images/qtquickcontrols-example-tableview.png
src/controls/doc/images/qtquickcontrols-example-tableview.png
src/controls/doc/images/qtquickcontrols-example-tableview.png
src/controls/doc/images/qtquickcontrols-example-tableview.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -40,7 +40,22 @@
\title Qt Quick Controls - Gallery
\ingroup qtquickcontrols_examples
\brief A collection of components for a classic desktop-style UI.
\image qtquickcontrols-example-gallery.png
\raw HTML
<div class="table"><table style="background:transparent; border:0px">
<tr><td style="border:0px">
\endraw
\image qtquickcontrols-example-gallery-osx.png
\caption OS X
\raw HTML
</td><td style="border:0px">
\endraw
\image qtquickcontrols-example-gallery-android.png
\caption Android - Nexus 5
\raw HTML
</td></tr>
</table></div>
\endraw
This example project demonstrates the various UI components provided by
\l{Qt Quick Controls}.
......@@ -62,20 +77,6 @@
\include examples-run.qdocinc
*/
/*!
\example splitview
\title Qt Quick Controls - Split View Example
\ingroup qtquickcontrols_examples
\brief An example for the SplitView UI control.
\image qtquickcontrols-example-splitview.png
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
*/
/*!
\example tableview
\title Qt Quick Controls - Table View Example
......@@ -83,10 +84,34 @@
\brief An example for the TableView control.
\image qtquickcontrols-example-tableview.png
This example shows how a \l{TableView} from \l{Qt Quick Controls}
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.
This example project demonstrates the usage of \l {TableView} from
\l{Qt Quick Controls} - a control to display one or more columns of
information from a data list model. The example includes a model
that supports sorting and filtering.
The C++ class, SortFilterProxyModel, is registered as a QML type
under the namespace, "\c{org.qtproject.example 1.0}".
The following snippets show how the type is registered under
a namespace and later imported by \e main.qml.
QML type registration:
\code
#include <QtQml/qqml.h>
...
qmlRegisterType<SortFilterProxyModel>("org.qtproject.example", 1, 0, "SortFilterProxyModel");
...
\endcode
QML namespace import:
\qml
import org.qtproject.example 1.0
\endqml
For more information about registering C++ classses as QML types, see
\l {Defining QML Types from C++}.
\include examples-run.qdocinc
*/
......
......@@ -33,16 +33,15 @@
This page contains platform specific notes for creating applications
that use \l{Qt Quick Controls}.
\section1 Android
\section1 Android Style
Qt 5.4 introduced a native Android style for Qt Quick Controls.
\image qtquickcontrols-android.png
\image qtquickcontrols-example-gallery-android.png
\note The Android style requires Android 3.0 (API level 11) or later.
No special actions are required to use the Android style. It is
automatically selected and deployed on Android. See \l{Getting Started
It is automatically selected and deployed on Android. See \l{Getting Started
with Qt for Android} and \l{Deploying an Application on Android} for
more details on the Android essentials.
......@@ -62,8 +61,8 @@
items declared in QML. Just to name a few possibilities:
\list
\li ToolButton actions,
\li A TextField as a search field,
\li A ComboBox for navigation, and
\li A ProgressBar for displaying progress.
\li a TextField as a search field,
\li a ComboBox for navigation, and
\li a ProgressBar for displaying progress.
\endlist
*/
......@@ -41,6 +41,8 @@
import QtQuick 2.2
import QtTest 1.0
import QtQuickControlsTests 1.0
import QtQuick.Controls 1.2
import QtQuick.Controls.Private 1.0
Item {
id: container
......@@ -305,5 +307,28 @@ Item {
compare(slider.__handlePos, 50)
slider.destroy()
}
function test_dragThreshold() {
var control = Qt.createQmlObject('import QtQuick.Controls 1.2; Slider {x: 20; y: 20; width: 100; height: 50}', container, '')
var pt = { x: control.width/2, y: control.height/2 }
mousePress(control, pt.x, pt.y)
compare(control.value, 0.5)
// drag less than the threshold distance
mouseMove(control, pt.x + Settings.dragThreshold - 1, pt.y)
compare(control.value, 0.5)
// drag over the threshold
mouseMove(control, pt.x + Settings.dragThreshold + 1, pt.y)
verify(control.value > 0.5)
// move back close to the original press point, less than the threshold distance away
mouseMove(control, pt.x - Settings.dragThreshold / 2, pt.y)
verify(control.value < 0.5)
control.destroy()
}
}
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Dialogs 1.1
MessageDialog {
icon: StandardIcon.Information
title: "Qt Quick Controls Workshop"
text: "Qt Quick Controls Workshop"
detailedText: "A manual test for most of the available Qt Quick Controls"
}
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
Item {
id: flickable
anchors.fill: parent
enabled: enabledCheck.checked
property int tabPosition: tabPositionGroup.current === r2 ? Qt.BottomEdge : Qt.TopEdge
property string loremIpsum:
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+
"incididunt ut labore et dolore magna aliqua.\n Ut enim ad minim veniam, quis nostrud "+
"exercitation ullamco laboris nisi ut aliquip ex ea commodo cosnsequat. ";
ListModel {
id: choices
ListElement { text: "Banana" }
ListElement { text: "Orange" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
}
RowLayout {
id: contentRow
anchors.fill:parent
anchors.margins: 8
spacing: 16
ColumnLayout {
id: firstColumn
Layout.minimumWidth: implicitWidth
Layout.fillWidth: false
RowLayout {
id: buttonrow
Button {
id: button1
text: "Button 1"
tooltip:"This is an interesting tool tip"
Layout.fillWidth: true
}
Button {
id:button2
text:"Button 2"
Layout.fillWidth: true
menu: Menu {
MenuItem { text: "This Button" }
MenuItem { text: "Happens To Have" }
MenuItem { text: "A Menu Assigned" }
}
}
}
ComboBox {
id: combo
model: choices
currentIndex: 2
Layout.fillWidth: true
}
ComboBox {
model: Qt.fontFamilies()
Layout.fillWidth: true
currentIndex: 47
}
ComboBox {
id: editableCombo
editable: true
model: choices
Layout.fillWidth: true
currentIndex: 2
onAccepted: {
if (editableCombo.find(currentText) === -1) {
choices.append({text: editText})
currentIndex = editableCombo.find(editText)
}
}
}
RowLayout {
SpinBox {
id: t1
Layout.fillWidth: true
minimumValue: -50
value: -20
}
SpinBox {
id: t2
Layout.fillWidth: true
}
}
TextField {
id: t3
placeholderText: "This is a placeholder for a TextField"
Layout.fillWidth: true
}
ProgressBar {
// normalize value [0.0 .. 1.0]
value: (slider.value - slider.minimumValue) / (slider.maximumValue - slider.minimumValue)
Layout.fillWidth: true
}
ProgressBar {
indeterminate: true
Layout.fillWidth: true
}
Slider {
id: slider
value: 0.5
Layout.fillWidth: true
tickmarksEnabled: tickmarkCheck.checked
stepSize: tickmarksEnabled ? 0.1 : 0
}
MouseArea {
id: busyCheck
Layout.fillWidth: true
Layout.fillHeight: true
hoverEnabled:true
Layout.preferredHeight: busyIndicator.height
BusyIndicator {
id: busyIndicator
running: busyCheck.containsMouse
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
ColumnLayout {
id: rightcol
Layout.fillWidth: true
anchors {
top: parent.top
bottom: parent.bottom
}
GroupBox {
id: group1
title: "CheckBox"
Layout.fillWidth: true
RowLayout {
Layout.fillWidth: true
CheckBox {
id: frameCheckbox
text: "Text frame"
checked: true
Layout.minimumWidth: 100
}
CheckBox {
id: tickmarkCheck
text: "Tickmarks"
checked: false
Layout.minimumWidth: 100
}
CheckBox {
id: wrapCheck
text: "Word wrap"
checked: true
Layout.minimumWidth: 100
}
}
}
GroupBox {
id: group2
title:"Tab Position"
Layout.fillWidth: true
RowLayout {
ExclusiveGroup { id: tabPositionGroup }
RadioButton {
id: r1
text: "Top"
checked: true
exclusiveGroup: tabPositionGroup
Layout.minimumWidth: 100
}
RadioButton {
id: r2
text: "Bottom"
exclusiveGroup: tabPositionGroup
Layout.minimumWidth: 100
}
}
}
TextArea {
id: area
frameVisible: frameCheckbox.checked
text: loremIpsum + loremIpsum
textFormat: Qt.RichText
wrapMode: wrapCheck.checked ? TextEdit.WordWrap : TextEdit.NoWrap
Layout.fillWidth: true
Layout.fillHeight: true
menu: editmenu
}
}
}
ExclusiveGroup {
id: textFormatGroup
Action {
id: a1
text: "Align &Left"
checkable: true
Component.onCompleted: checked = true
}
Action {
id: a2
text: "&Center"
checkable: true
}
Action {
id: a3
text: "Align &Right"
checkable: true
}
}
Component {
id: editmenu
Menu {
MenuItem { action: cutAction }
MenuItem { action: copyAction }
MenuItem { action: pasteAction }
MenuSeparator {}
Menu {
title: "Text &Format"
MenuItem { action: a1 }
MenuItem { action: a2 }
MenuItem { action: a3 }
MenuSeparator { }
MenuItem { text: "Allow &Hyphenation"; checkable: true }
}
Menu {
title: "Font &Style"
MenuItem { text: "&Bold"; checkable: true }
MenuItem { text: "&Italic"; checkable: true }
MenuItem { text: "&Underline"; checkable: true }
}
}
}
}
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
......@@ -38,45 +38,22 @@
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.0
ApplicationWindow {
visible: true
width: 600
height: 400
SplitView {
anchors.fill: parent
Rectangle {
id: column
width: 200
Layout.minimumWidth: 100
Layout.maximumWidth: 300
color: "lightsteelblue"
}
SplitView {
orientation: Qt.Vertical
Layout.fillWidth: true
Rectangle {
id: row1
height: 200
color: "lightblue"
Layout.minimumHeight: 1
}
Rectangle {
id: row2
color: "lightgray"
}
}
import QtQuick.Window 2.1
Window {
id: imageViewer
minimumWidth: viewerImage.width
minimumHeight: viewerImage.height
function open(source) {
viewerImage.source = source
width = viewerImage.implicitWidth + 20
height = viewerImage.implicitHeight + 20
title = source
visible = true
}
Image {
id: viewerImage
anchors.centerIn: parent
}
}