Tweaking test dialog and adding browser test

This commit is contained in:
Brad Davis 2015-04-17 09:53:40 -07:00
parent fd0c130dc2
commit 781abdd047
2 changed files with 59 additions and 26 deletions

View file

@ -0,0 +1,45 @@
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Controls.Styles 1.3
import QtWebKit 3.0
CustomDialog {
title: "Test Dlg"
id: testDialog
objectName: "Browser"
width: 1280
height: 720
Item {
id: clientArea
// The client area
anchors.fill: parent
anchors.margins: parent.margins
anchors.topMargin: parent.topMargin
ScrollView {
anchors.fill: parent
WebView {
id: webview
url: "http://slashdot.org"
anchors.fill: parent
}
}
}
}
/*
// This is the behavior, and it applies a NumberAnimation to any attempt to set the x property
MouseArea {
anchors.fill: parent
}
*/

View file

@ -4,34 +4,20 @@ import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Controls.Styles 1.3
Item {
objectName: "TestDialog"
CustomDialog {
title: "Test Dlg"
id: testDialog
width: 384
height: 384
objectName: "TestDialog"
width: 512
height: 512
scale: 0.0
onEnabledChanged: {
scale = enabled ? 1.0 : 0.0
}
onScaleChanged: {
visible = (scale != 0.0);
}
Component.onCompleted: {
scale = 1.0
}
Behavior on scale {
NumberAnimation {
//This specifies how long the animation takes
duration: 400
//This selects an easing curve to interpolate with, the default is Easing.Linear
easing.type: Easing.InOutBounce
}
}
CustomDialog {
title: "Test Dlg"
Item {
id: clientArea
// The client area
anchors.fill: parent
anchors.margins: parent.margins
anchors.topMargin: parent.topMargin
Rectangle {
property int d: 100
@ -55,16 +41,18 @@ Item {
anchors.top: parent.top
anchors.topMargin: parent.titleSize + 12
}
CustomButton {
x: 128
y: 192
text: "Test"
anchors.bottom: parent.bottom
anchors.bottomMargin: 12
anchors.right: parent.right
anchors.rightMargin: 12
onClicked: {
console.log("Click");
if (square.visible) {
square.visible = false
} else {
@ -76,7 +64,7 @@ Item {
CustomButton {
id: customButton2
y: 192
text: "Close"
text: "Move"
anchors.left: parent.left
anchors.leftMargin: 12
anchors.bottom: parent.bottom