Source

Target

Commits (8)
Showing with 729 additions and 199 deletions
......@@ -55,9 +55,36 @@
QT_BEGIN_NAMESPACE
/*!
\group dialogs
\title Dialogs
*/
/*!
\page qtquickdialogs-index.html
\title Qt Quick Dialogs
\brief Qt Quick Dialogs submodule
The submodule is new in Qt 5.1.
\section1 Dialogs
\annotatedlist dialogs
\section1 Related information
\section2 Reference
\list
\li \l{Qt Quick Dialogs QML Types}{Qt Quick Dialogs QML Types}
\endlist
*/
/*!
\qmlmodule QtQuick.Dialogs 1
\title Qt Quick Dialog QML Types
\title Qt Quick Dialogs QML Types
\ingroup qmlmodules
\brief Provides QML types for standard file, color picker and message dialogs
......
......@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
\qmltype ColorDialog
\instantiates QQuickPlatformColorDialog
\inqmlmodule QtQuick.Dialogs 1
\ingroup qtquick-visual
\ingroup dialogs
\brief Dialog component for choosing a color.
\since Qt 5.1
......
......@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
\qmltype FileDialog
\instantiates QQuickPlatformFileDialog
\inqmlmodule QtQuick.Dialogs 1
\ingroup qtquick-visual
\ingroup dialogs
\brief Dialog component for choosing files from a local filesystem.
\since Qt 5.1
......
This diff is collapsed.
......@@ -3,7 +3,7 @@ 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 '../../../bin/qmlplugindump.app/Contents/MacOS/qmlplugindump QtQuick.Window 2.1 -notrelocatable'.
// This file was auto-generated with the command 'qmlplugindump QtQuick.Window 2.1 -notrelocatable'.
Module {
Component {
......@@ -23,15 +23,23 @@ Module {
name: "QQuickScreen"
prototype: "QObject"
exports: ["QtQuick.Window/Screen 2.0"]
exportMetaObjectRevisions: [0]
attachedType: "QQuickScreenAttached"
}
Component {
name: "QQuickScreenAttached"
prototype: "QObject"
Property { name: "name"; revision: 1; type: "string"; isReadonly: true }
Property { name: "width"; type: "int"; isReadonly: true }
Property { name: "height"; type: "int"; isReadonly: true }
Property { name: "desktopAvailableWidth"; revision: 1; type: "int"; isReadonly: true }
Property { name: "desktopAvailableHeight"; revision: 1; type: "int"; isReadonly: true }
Property { name: "logicalPixelDensity"; revision: 1; type: "double"; isReadonly: true }
Property { name: "primaryOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true }
Property { name: "orientation"; type: "Qt::ScreenOrientation"; isReadonly: true }
Signal { name: "nameChanged"; revision: 1 }
Signal { name: "desktopGeometryChanged"; revision: 1 }
Signal { name: "logicalPixelDensityChanged"; revision: 1 }
Method {
name: "angleBetween"
type: "int"
......@@ -61,6 +69,11 @@ Module {
Signal { name: "beforeSynchronizing" }
Signal { name: "beforeRendering" }
Signal { name: "afterRendering" }
Signal {
name: "closing"
revision: 1
Parameter { name: "close"; type: "QQuickCloseEvent"; isPointer: true }
}
Signal {
name: "colorChanged"
Parameter { type: "QColor" }
......@@ -95,6 +108,7 @@ Module {
Property { name: "maximumWidth"; revision: 1; type: "int" }
Property { name: "maximumHeight"; revision: 1; 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: "opacity"; revision: 1; type: "double" }
......@@ -155,6 +169,7 @@ Module {
revision: 1
Parameter { name: "visibility"; type: "QWindow::Visibility" }
}
Signal { name: "activeChanged"; revision: 1 }
Signal {
name: "contentOrientationChanged"
revision: 1
......@@ -169,6 +184,7 @@ Module {
revision: 1
Parameter { name: "opacity"; type: "double" }
}
Method { name: "requestActivate"; revision: 1 }
Method {
name: "setVisible"
Parameter { name: "visible"; type: "bool" }
......@@ -222,5 +238,9 @@ Module {
revision: 1
Parameter { name: "h"; type: "int" }
}
Method {
name: "alert"
Parameter { name: "msec"; type: "int" }
}
}
}
......@@ -105,7 +105,7 @@ QByteArray QQmlProfilerData::toByteArray() const
case QQmlProfilerService::SceneGraphWindowsRenderShow: ds << subtime_1 << subtime_2 << subtime_3; break;
// WindowsAnimations: update time
case QQmlProfilerService::SceneGraphWindowsAnimations: ds << subtime_1; break;
// WindowsRenderWindow: polish time, sync time, render time, swap time
// WindowsRenderWindow: polish time
case QQmlProfilerService::SceneGraphWindowsPolishFrame: ds << subtime_1; break;
default:break;
}
......
......@@ -64,6 +64,12 @@ information about the concepts which are central to \c QtQuick.
system for QML applications
\li \l{QtQuick.Window 2}{Window} - contains types for creating
top-level windows and accessing screen information
\li \l{QtQuick.Dialogs 1}{Dialogs} - contains types for creating and
interacting with system dialogs
\li \l{QtQuick.Controls 1.0}{Controls} - provides a set of reusable
UI components
\li \l{QtQuick.Layouts 1.0}{Layouts} - contains types that are used
to arrange items in the user interface
\endlist
\section1 Basic Types
......
......@@ -125,6 +125,8 @@ Additional Qt Quick information:
system for Qt Quick
\li \l{QtQuick.Window 2}{Window} - contains types for creating
top-level windows and accessing screen information
\li \l{QtQuick.Dialogs 1}{Dialogs} - contains types for creating and
interacting with system dialogs
\endlist
\li \l{Qt Quick Release Notes} - list of changes and additions in the Qt Quick
\li \l{Qt Quick Code Samples} - list of all Qt Quick examples
......
......@@ -29,7 +29,35 @@
\title Qt Quick Release Notes
\page qtquick-releasenotes.html
\section1 Qt Quick in Qt 5
\section1 Qt Quick in Qt 5.1
\l{Qt Quick} 2.1 is new in Qt 5.1. This is a summary of improvements and new
features introduced by the new import and new classes in Qt 5.1:
\list
\li New threaded render loop for Mac, Linux, and Embedded.
\li New render loop for windows for smoother animations.
\li New \l Window properties: activeFocusItem, minimumWidth, minimumHeight,
maximumWidth, maximumHeight, visibility, contentOrientation, and opacity.
\li New \l Item property: activeFocusOnTab.
\li New \l Grid properties: horizontalAlignment, verticalAlignment, and
effectiveHorizontalAlignment.
\li New \l TextEdit properties: selectByKeyboard and textDocument
\li A \l Window declared inside another Window or \l Item will automatically be
transient for (centered upon) the outer window.
\endlist
\section2 New Submodules
In Qt 5.1, there are several new modules which extend Qt Quick functionalities.
\list
\li \l{Qt Quick Dialogs} - contains types for creating and interacting with system dialogs
\li \l{Qt Quick Controls} - provides a set of reusable UI components
\li \l{Qt Quick Layouts} - contains types that are used to arrange items in the user interface
\endlist
The \l{What's New in Qt 5.1} has more information about the Qt 5.1 release.
\section1 Qt Quick in Qt 5.0
The \l {Qt Quick} module is new in Qt 5. It provides the visual canvas and scenegraph back-end
as well as the \c QtQuick QML module for QML application development.
......
......@@ -2050,7 +2050,10 @@ bool QQuickItemPrivate::canAcceptTabFocus(QQuickItem *item)
{
bool result = true;
if (item->window() && item == item->window()->contentItem())
if (!item->window())
return false;
if (item == item->window()->contentItem())
return true;
#ifndef QT_NO_ACCESSIBILITY
......@@ -2093,7 +2096,6 @@ bool QQuickItemPrivate::focusNextPrev(QQuickItem *item, bool forward)
QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, bool forward)
{
Q_ASSERT(item);
Q_ASSERT(item->activeFocusOnTab());
bool all = QQuickItemPrivate::qt_tab_all_widgets();
......@@ -2107,6 +2109,10 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo
from = item->parentItem();
}
bool skip = false;
const QQuickItem * const contentItem = item->window()->contentItem();
const QQuickItem * const originalItem = item;
QQuickItem * startItem = item;
QQuickItem * firstFromItem = from;
QQuickItem *current = item;
do {
skip = false;
......@@ -2157,8 +2163,25 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo
skip = true;
}
}
from = last;
if (current == startItem && from == firstFromItem) {
// wrapped around, avoid endless loops
if (originalItem == contentItem) {
#ifdef FOCUS_DEBUG
qDebug() << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return contentItem";
#endif
return item->window()->contentItem();
} else {
#ifdef FOCUS_DEBUG
qDebug() << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return " << startItem;
#endif
return startItem;
}
}
if (!firstFromItem) { //start from root
startItem = current;
firstFromItem = from;
}
} while (skip || !current->activeFocusOnTab() || !current->isEnabled() || !current->isVisible()
|| !(all || QQuickItemPrivate::canAcceptTabFocus(current)));
......@@ -4375,7 +4398,8 @@ void QQuickItemPrivate::deliverKeyEvent(QKeyEvent *e)
return;
//only care about KeyPress now
if (q->activeFocusOnTab() && e->type() == QEvent::KeyPress) {
if ((q == q->window()->contentItem() || q->activeFocusOnTab())
&& e->type() == QEvent::KeyPress) {
bool res = false;
if (!(e->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
if (e->key() == Qt::Key_Backtab
......
......@@ -1032,7 +1032,7 @@ void QSGThreadedRenderLoop::polishAndSync()
polishTime,
waitTime - polishTime,
syncTime - waitTime,
timer.elapsed() - syncTime);
timer.nsecsElapsed() - syncTime);
}
#endif
}
......
......@@ -15,9 +15,10 @@
# Each of the module version specifiers can take one of the following values:
# - A specific Git revision.
# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
# - an empty string to use the same branch under test (dependencies will become "refs/heads/master" if we are in the master branch)
#
%dependencies = (
"qtbase" => "refs/heads/stable",
"qtxmlpatterns" => "refs/heads/stable",
"qtjsbackend" => "refs/heads/stable",
"qtbase" => "",
"qtxmlpatterns" => "",
"qtjsbackend" => "",
);
......@@ -283,7 +283,7 @@ void QQmlProfilerClient::messageReceived(const QByteArray &message)
case QQmlProfilerClient::SceneGraphWindowsRenderShow: stream >> subtime_1 >> subtime_2 >> subtime_3; break;
// WindowsAnimations: update time
case QQmlProfilerClient::SceneGraphWindowsAnimations: stream >> subtime_1; break;
// WindowsRenderWindow: polish time, sync time, render time, swap time
// WindowsRenderWindow: polish time
case QQmlProfilerClient::SceneGraphWindowsPolishFrame: stream >> subtime_1; break;
}
break;
......
......@@ -190,6 +190,9 @@ void tst_qquickanimatedimage::mirror_running()
QImage frame0_expected = frame0.transformed(transform);
QImage frame1_expected = frame1.transformed(transform);
#ifdef Q_OS_MAC
QSKIP("QTBUG-31370 - sometimes fails on Mac");
#endif
QCOMPARE(frame0_flipped, frame0_expected);
QCOMPARE(frame1_flipped, frame1_expected);
......@@ -221,6 +224,9 @@ void tst_qquickanimatedimage::mirror_notRunning()
anim->setProperty("mirror", true);
screenshot = QPixmap::fromImage(window.grabWindow());
#ifdef Q_OS_MAC
QSKIP("QTBUG-31370 - sometimes fails on Mac");
#endif
QCOMPARE(screenshot, expected);
// mirroring should not change the current frame or playing status
......
import QtQuick 2.1
Item {
id: main
objectName: "main"
width: 300
height: 300
Item {
id: button1
objectName: "button1"
width: 300
height: 150
activeFocusOnTab: true
Accessible.role: Accessible.Button
Rectangle {
anchors.fill: parent
color: parent.activeFocus ? "red" : "black"
}
anchors.top: parent.top
anchors.left: parent.left
}
Item {
id: button2
objectName: "button2"
width: 300
height: 150
activeFocusOnTab: true
Accessible.role: Accessible.Button
Rectangle {
anchors.fill: parent
color: parent.activeFocus ? "red" : "black"
}
anchors.bottom: parent.bottom
anchors.left: parent.left
}
}
import QtQuick 2.1
Item {
id: main
objectName: "main"
width: 300
height: 300
Item {
id: button1
objectName: "button1"
width: 300
height: 150
activeFocusOnTab: true
Accessible.role: Accessible.Table
Rectangle {
anchors.fill: parent
color: parent.activeFocus ? "red" : "black"
}
anchors.top: parent.top
anchors.left: parent.left
}
Item {
id: button2
objectName: "button2"
width: 300
height: 150
activeFocusOnTab: true
Accessible.role: Accessible.Table
Rectangle {
anchors.fill: parent
color: parent.activeFocus ? "red" : "black"
}
anchors.bottom: parent.bottom
anchors.left: parent.left
}
}
......@@ -71,6 +71,8 @@ private slots:
void activeFocusOnTab4();
void activeFocusOnTab5();
void activeFocusOnTab6();
void activeFocusOnTab7();
void activeFocusOnTab8();
void nextItemInFocusChain();
void nextItemInFocusChain2();
......@@ -747,6 +749,91 @@ void tst_QQuickItem::activeFocusOnTab6()
delete window;
}
void tst_QQuickItem::activeFocusOnTab7()
{
if (qt_tab_all_widgets())
QSKIP("This function doesn't support iterating all.");
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(300,300));
window->setSource(testFileUrl("activeFocusOnTab7.qml"));
window->show();
window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
QQuickItem *item = findItem<QQuickItem>(window->rootObject(), "button1");
QVERIFY(item);
item->forceActiveFocus();
QVERIFY(item->hasActiveFocus());
// Tab: button1->button1
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
QGuiApplication::sendEvent(window, &key);
QVERIFY(!key.isAccepted());
QVERIFY(item->hasActiveFocus());
// BackTab: button1->button1
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
QGuiApplication::sendEvent(window, &key);
QVERIFY(!key.isAccepted());
QVERIFY(item->hasActiveFocus());
delete window;
}
void tst_QQuickItem::activeFocusOnTab8()
{
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(300,300));
window->setSource(testFileUrl("activeFocusOnTab8.qml"));
window->show();
window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
QQuickItem *content = window->contentItem();
QVERIFY(content);
QVERIFY(content->hasActiveFocus());
QQuickItem *button1 = findItem<QQuickItem>(window->rootObject(), "button1");
QVERIFY(button1);
QVERIFY(!button1->hasActiveFocus());
QQuickItem *button2 = findItem<QQuickItem>(window->rootObject(), "button2");
QVERIFY(button2);
QVERIFY(!button2->hasActiveFocus());
// Tab: contentItem->button1
QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
QGuiApplication::sendEvent(window, &key);
QVERIFY(key.isAccepted());
QVERIFY(button1->hasActiveFocus());
// Tab: button1->button2
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
QGuiApplication::sendEvent(window, &key);
QVERIFY(key.isAccepted());
QVERIFY(button2->hasActiveFocus());
QVERIFY(!button1->hasActiveFocus());
// BackTab: button2->button1
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
QGuiApplication::sendEvent(window, &key);
QVERIFY(key.isAccepted());
QVERIFY(button1->hasActiveFocus());
QVERIFY(!button2->hasActiveFocus());
delete window;
}
void tst_QQuickItem::nextItemInFocusChain()
{
if (!qt_tab_all_widgets())
......