diff options
33 files changed, 818 insertions, 229 deletions
diff --git a/.qmake.conf b/.qmake.conf index e543981..66a0241 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,3 @@ load(qt_build_config) -MODULE_VERSION = 5.5.1 +MODULE_VERSION = 5.6.0 diff --git a/src/imports/winextras/plugins.qmltypes b/src/imports/winextras/plugins.qmltypes index 8a00138..92f68da 100644 --- a/src/imports/winextras/plugins.qmltypes +++ b/src/imports/winextras/plugins.qmltypes @@ -1,12 +1,13 @@ -import QtQuick.tooling 1.1 +import QtQuick.tooling 1.2 // This file describes the plugin-supplied types contained in the library. // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump.exe -nonrelocatable QtWinExtras 1.0' +// 'qmlplugindump -nonrelocatable QtWinExtras 1.0' Module { + dependencies: [] Component { name: "QQuickDwmFeatures" defaultProperty: "data" @@ -27,6 +28,160 @@ Module { Property { name: "flip3DPolicy"; type: "QQuickWin::WindowFlip3DPolicy" } } Component { + name: "QQuickItem" + defaultProperty: "data" + prototype: "QObject" + Enum { + name: "TransformOrigin" + values: { + "TopLeft": 0, + "Top": 1, + "TopRight": 2, + "Left": 3, + "Center": 4, + "Right": 5, + "BottomLeft": 6, + "Bottom": 7, + "BottomRight": 8 + } + } + Property { name: "parent"; type: "QQuickItem"; isPointer: true } + Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } + Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } + Property { name: "x"; type: "double" } + Property { name: "y"; type: "double" } + Property { name: "z"; type: "double" } + Property { name: "width"; type: "double" } + Property { name: "height"; type: "double" } + Property { name: "opacity"; type: "double" } + Property { name: "enabled"; type: "bool" } + Property { name: "visible"; type: "bool" } + Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } + Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } + Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } + Property { name: "state"; type: "string" } + Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } + Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } + Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } + Property { name: "baselineOffset"; type: "double" } + Property { name: "clip"; type: "bool" } + Property { name: "focus"; type: "bool" } + Property { name: "activeFocus"; type: "bool"; isReadonly: true } + Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } + Property { name: "rotation"; type: "double" } + Property { name: "scale"; type: "double" } + Property { name: "transformOrigin"; type: "TransformOrigin" } + Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } + Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } + Property { name: "smooth"; type: "bool" } + Property { name: "antialiasing"; type: "bool" } + Property { name: "implicitWidth"; type: "double" } + Property { name: "implicitHeight"; type: "double" } + Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } + Signal { + name: "childrenRectChanged" + Parameter { type: "QRectF" } + } + Signal { + name: "baselineOffsetChanged" + Parameter { type: "double" } + } + Signal { + name: "stateChanged" + Parameter { type: "string" } + } + Signal { + name: "focusChanged" + Parameter { type: "bool" } + } + Signal { + name: "activeFocusChanged" + Parameter { type: "bool" } + } + Signal { + name: "activeFocusOnTabChanged" + revision: 1 + Parameter { type: "bool" } + } + Signal { + name: "parentChanged" + Parameter { type: "QQuickItem"; isPointer: true } + } + Signal { + name: "transformOriginChanged" + Parameter { type: "TransformOrigin" } + } + Signal { + name: "smoothChanged" + Parameter { type: "bool" } + } + Signal { + name: "antialiasingChanged" + Parameter { type: "bool" } + } + Signal { + name: "clipChanged" + Parameter { type: "bool" } + } + Signal { + name: "windowChanged" + revision: 1 + Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } + } + Method { name: "update" } + Method { + name: "grabToImage" + revision: 2 + type: "bool" + Parameter { name: "callback"; type: "QJSValue" } + Parameter { name: "targetSize"; type: "QSize" } + } + Method { + name: "grabToImage" + revision: 2 + type: "bool" + Parameter { name: "callback"; type: "QJSValue" } + } + Method { + name: "contains" + type: "bool" + Parameter { name: "point"; type: "QPointF" } + } + Method { + name: "mapFromItem" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "mapToItem" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { name: "forceActiveFocus" } + Method { + name: "forceActiveFocus" + Parameter { name: "reason"; type: "Qt::FocusReason" } + } + Method { + name: "nextItemInFocusChain" + revision: 1 + type: "QQuickItem*" + Parameter { name: "forward"; type: "bool" } + } + Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } + Method { + name: "childAt" + type: "QQuickItem*" + Parameter { name: "x"; type: "double" } + Parameter { name: "y"; type: "double" } + } + } + Component { name: "QQuickJumpList" defaultProperty: "data" prototype: "QObject" diff --git a/src/imports/winextras/qquickdwmfeatures_p.h b/src/imports/winextras/qquickdwmfeatures_p.h index 1535326..0c67086 100644 --- a/src/imports/winextras/qquickdwmfeatures_p.h +++ b/src/imports/winextras/qquickdwmfeatures_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKDWMFEATURES_P_H #define QQUICKDWMFEATURES_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QQuickItem> #include <QtWin> #include <QColor> diff --git a/src/imports/winextras/qquickdwmfeatures_p_p.h b/src/imports/winextras/qquickdwmfeatures_p_p.h index 5734696..13de46a 100644 --- a/src/imports/winextras/qquickdwmfeatures_p_p.h +++ b/src/imports/winextras/qquickdwmfeatures_p_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKDWMFEATURES_P_P_H #define QQUICKDWMFEATURES_P_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickdwmfeatures_p.h" QT_BEGIN_NAMESPACE diff --git a/src/imports/winextras/qquickiconloader_p.h b/src/imports/winextras/qquickiconloader_p.h index 121ff3f..0c08e2d 100644 --- a/src/imports/winextras/qquickiconloader_p.h +++ b/src/imports/winextras/qquickiconloader_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKICONLOADER_P_H #define QQUICKICONLOADER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QVariant> #include <QUrl> diff --git a/src/imports/winextras/qquickjumplist_p.h b/src/imports/winextras/qquickjumplist_p.h index 4947c9d..c36ad7b 100644 --- a/src/imports/winextras/qquickjumplist_p.h +++ b/src/imports/winextras/qquickjumplist_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKJUMPLIST_P_H #define QQUICKJUMPLIST_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QQmlParserStatus> #include <QQmlListProperty> diff --git a/src/imports/winextras/qquickjumplistcategory_p.h b/src/imports/winextras/qquickjumplistcategory_p.h index 73af259..629c9bb 100644 --- a/src/imports/winextras/qquickjumplistcategory_p.h +++ b/src/imports/winextras/qquickjumplistcategory_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKJUMPLISTCATEGORY_P_H #define QQUICKJUMPLISTCATEGORY_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickjumplistitem_p.h" #include <QObject> diff --git a/src/imports/winextras/qquickjumplistitem_p.h b/src/imports/winextras/qquickjumplistitem_p.h index 5ed7368..f0f59b3 100644 --- a/src/imports/winextras/qquickjumplistitem_p.h +++ b/src/imports/winextras/qquickjumplistitem_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKJUMPLISTITEM_P_H #define QQUICKJUMPLISTITEM_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QWinJumpListItem> diff --git a/src/imports/winextras/qquicktaskbarbutton_p.h b/src/imports/winextras/qquicktaskbarbutton_p.h index 226ec14..56a1b4a 100644 --- a/src/imports/winextras/qquicktaskbarbutton_p.h +++ b/src/imports/winextras/qquicktaskbarbutton_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKTASKBARBUTTON_P_H #define QQUICKTASKBARBUTTON_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QQuickItem> #include <QWinTaskbarButton> #include <QWinTaskbarProgress> diff --git a/src/imports/winextras/qquickthumbnailtoolbar_p.h b/src/imports/winextras/qquickthumbnailtoolbar_p.h index 6b9d00c..c6a648b 100644 --- a/src/imports/winextras/qquickthumbnailtoolbar_p.h +++ b/src/imports/winextras/qquickthumbnailtoolbar_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKTHUMBNAILTOOLBAR_P_H #define QQUICKTHUMBNAILTOOLBAR_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QQuickItem> #include <QWinThumbnailToolBar> #include <QUrl> diff --git a/src/imports/winextras/qquickthumbnailtoolbutton_p.h b/src/imports/winextras/qquickthumbnailtoolbutton_p.h index bf8d1a0..351f850 100644 --- a/src/imports/winextras/qquickthumbnailtoolbutton_p.h +++ b/src/imports/winextras/qquickthumbnailtoolbutton_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKTHUMBNAILTOOLBUTTON_P_H #define QQUICKTHUMBNAILTOOLBUTTON_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QQuickItem> #include <QWinThumbnailToolBar> #include <QUrl> diff --git a/src/imports/winextras/qquickwin_p.h b/src/imports/winextras/qquickwin_p.h index 5c8d5d1..50f1d82 100644 --- a/src/imports/winextras/qquickwin_p.h +++ b/src/imports/winextras/qquickwin_p.h @@ -35,6 +35,17 @@ #ifndef QQUICKWIN_P_H #define QQUICKWIN_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QtWin> diff --git a/src/winextras/doc/qtwinextras.qdocconf b/src/winextras/doc/qtwinextras.qdocconf index 27b991a..46c3e95 100644 --- a/src/winextras/doc/qtwinextras.qdocconf +++ b/src/winextras/doc/qtwinextras.qdocconf @@ -7,7 +7,7 @@ version = $QT_VERSION exampledirs += ../../../examples/winextras \ snippets -examplesinstallpath = winextras +examplesinstallpath = qtwinextras/winextras headerdirs = .. ../../imports/winextras sourcedirs = .. ../../imports/winextras diff --git a/src/winextras/qwineventfilter_p.h b/src/winextras/qwineventfilter_p.h index 87b55c3..b4a4f51 100644 --- a/src/winextras/qwineventfilter_p.h +++ b/src/winextras/qwineventfilter_p.h @@ -34,6 +34,17 @@ #ifndef QWINEVENTFILTER_H #define QWINEVENTFILTER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWinExtras/qwinextrasglobal.h> #include <QAbstractNativeEventFilter> #include <qt_windows.h> diff --git a/src/winextras/qwinfunctions_p.h b/src/winextras/qwinfunctions_p.h index 4e97afe..715a997 100644 --- a/src/winextras/qwinfunctions_p.h +++ b/src/winextras/qwinfunctions_p.h @@ -34,6 +34,17 @@ #ifndef QWINFUNCTIONS_P_H #define QWINFUNCTIONS_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QString> #include <qt_windows.h> #include <uxtheme.h> diff --git a/src/winextras/qwinjumplist.cpp b/src/winextras/qwinjumplist.cpp index 28b4fdc..9caebdc 100644 --- a/src/winextras/qwinjumplist.cpp +++ b/src/winextras/qwinjumplist.cpp @@ -41,6 +41,7 @@ #include "winpropkey_p.h" #include <QDir> +#include <QtCore/QDebug> #include <QCoreApplication> #include <qt_windows.h> #include <propvarutil.h> @@ -563,6 +564,27 @@ void QWinJumpList::clear() d->destroy(); } +#ifndef QT_NO_DEBUG_STREAM + +QDebug operator<<(QDebug debug, const QWinJumpList *jumplist) +{ + QDebugStateSaver saver(debug); + debug.nospace(); + debug.noquote(); + debug << "QWinJumpList("; + if (jumplist) { + debug << "(identifier=\"" << jumplist->identifier() << "\", recent=" + << jumplist->recent() << ", frequent=" << jumplist->frequent() + << ", tasks=" << jumplist->tasks() + << ", categories=" << jumplist->categories(); + } else { + debug << '0'; + } + debug << ')'; + return debug; +} +#endif // !QT_NO_DEBUG_STREAM + QT_END_NAMESPACE #include "moc_qwinjumplist.cpp" diff --git a/src/winextras/qwinjumplist.h b/src/winextras/qwinjumplist.h index 5350588..732742c 100644 --- a/src/winextras/qwinjumplist.h +++ b/src/winextras/qwinjumplist.h @@ -77,6 +77,10 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_rebuild()) }; +#ifndef QT_NO_DEBUG_STREAM +Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug, const QWinJumpList *); +#endif + QT_END_NAMESPACE #endif // QWINJUMPLIST_H diff --git a/src/winextras/qwinjumplist_p.h b/src/winextras/qwinjumplist_p.h index 95d707e..bce382d 100644 --- a/src/winextras/qwinjumplist_p.h +++ b/src/winextras/qwinjumplist_p.h @@ -35,6 +35,17 @@ #ifndef QWINJUMPLIST_P_H #define QWINJUMPLIST_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qwinjumplist.h" #include "winshobjidl_p.h" diff --git a/src/winextras/qwinjumplistcategory.cpp b/src/winextras/qwinjumplistcategory.cpp index 77903dd..2f26e1a 100644 --- a/src/winextras/qwinjumplistcategory.cpp +++ b/src/winextras/qwinjumplistcategory.cpp @@ -40,6 +40,8 @@ #include "winshobjidl_p.h" #include "windowsguidsdefs_p.h" +#include <QtCore/QDebug> + #include <shlobj.h> #if defined(_MSC_VER) && _MSC_VER < 1600 @@ -343,4 +345,28 @@ void QWinJumpListCategory::clear() } } +#ifndef QT_NO_DEBUG_STREAM + +QDebug operator<<(QDebug debug, const QWinJumpListCategory *category) +{ + QDebugStateSaver saver(debug); + debug.nospace(); + debug.noquote(); + debug << "QWinJumpListCategory("; + if (category) { + debug << "type=" << category->type() << ", isVisible=" + << category->isVisible() << ", title=\"" << category->title() + << "\", items=" << category->items(); + } else { + debug << '0'; + } + debug << ')'; + return debug; + + + return debug; +} + +#endif // !QT_NO_DEBUG_STREAM + QT_END_NAMESPACE diff --git a/src/winextras/qwinjumplistcategory.h b/src/winextras/qwinjumplistcategory.h index a5de402..9cc684b 100644 --- a/src/winextras/qwinjumplistcategory.h +++ b/src/winextras/qwinjumplistcategory.h @@ -55,7 +55,6 @@ public: Frequent, Tasks }; - explicit QWinJumpListCategory(const QString &title = QString()); ~QWinJumpListCategory(); @@ -85,6 +84,10 @@ private: QScopedPointer<QWinJumpListCategoryPrivate> d_ptr; }; +#ifndef QT_NO_DEBUG_STREAM +Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug d, const QWinJumpListCategory *); +#endif + QT_END_NAMESPACE #endif // QWINJUMPLISTCATEGORY_H diff --git a/src/winextras/qwinjumplistcategory_p.h b/src/winextras/qwinjumplistcategory_p.h index 8a73be6..bce93d5 100644 --- a/src/winextras/qwinjumplistcategory_p.h +++ b/src/winextras/qwinjumplistcategory_p.h @@ -35,6 +35,17 @@ #ifndef QWINJUMPLISTCATEGORY_P_H #define QWINJUMPLISTCATEGORY_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qwinjumplistcategory.h" QT_BEGIN_NAMESPACE diff --git a/src/winextras/qwinjumplistitem.cpp b/src/winextras/qwinjumplistitem.cpp index a5d0a39..daf5456 100644 --- a/src/winextras/qwinjumplistitem.cpp +++ b/src/winextras/qwinjumplistitem.cpp @@ -36,6 +36,9 @@ #include "qwinjumplistitem_p.h" #include "qwinjumplistcategory_p.h" +#include <QtCore/QDebug> +#include <QtCore/QDir> + QT_BEGIN_NAMESPACE /*! @@ -256,4 +259,31 @@ QStringList QWinJumpListItem::arguments() const return d->arguments; } +#ifndef QT_NO_DEBUG_STREAM + +QDebug operator<<(QDebug debug, const QWinJumpListItem *item) +{ + QDebugStateSaver saver(debug); + debug.nospace(); + debug.noquote(); + debug << "QWinJumpListItem("; + if (item) { + debug << "type=" << item->type() << ", title=\"" << item->title() + << "\", description=\"" << item->description() + << "\", filePath=\"" << QDir::toNativeSeparators(item->filePath()) + << "\", arguments="; + debug.quote(); + debug << item->arguments(); + debug.noquote(); + debug << ", workingDirectory=\"" << QDir::toNativeSeparators(item->workingDirectory()) + << "\", icon=" << item->icon(); + } else { + debug << '0'; + } + debug << ')'; + return debug; +} + +#endif // !QT_NO_DEBUG_STREAM + QT_END_NAMESPACE diff --git a/src/winextras/qwinjumplistitem.h b/src/winextras/qwinjumplistitem.h index 9e57748..3fffa85 100644 --- a/src/winextras/qwinjumplistitem.h +++ b/src/winextras/qwinjumplistitem.h @@ -78,6 +78,10 @@ private: QScopedPointer<QWinJumpListItemPrivate> d_ptr; }; +#ifndef QT_NO_DEBUG_STREAM +Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug, const QWinJumpListItem *); +#endif + QT_END_NAMESPACE #endif // QWINJUMPLISTITEM_H diff --git a/src/winextras/qwinjumplistitem_p.h b/src/winextras/qwinjumplistitem_p.h index f51171e..4341b1f 100644 --- a/src/winextras/qwinjumplistitem_p.h +++ b/src/winextras/qwinjumplistitem_p.h @@ -35,6 +35,17 @@ #ifndef QWINJUMPLISTITEM_P_H #define QWINJUMPLISTITEM_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qwinjumplistitem.h" QT_BEGIN_NAMESPACE diff --git a/src/winextras/qwintaskbarbutton_p.h b/src/winextras/qwintaskbarbutton_p.h index 51bbe6b..dff1e26 100644 --- a/src/winextras/qwintaskbarbutton_p.h +++ b/src/winextras/qwintaskbarbutton_p.h @@ -34,6 +34,17 @@ #ifndef QWINTASKBARBUTTON_P_H #define QWINTASKBARBUTTON_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qwintaskbarbutton.h" #include <QWindow> diff --git a/src/winextras/qwinthumbnailtoolbar_p.h b/src/winextras/qwinthumbnailtoolbar_p.h index 87df367..908e847 100644 --- a/src/winextras/qwinthumbnailtoolbar_p.h +++ b/src/winextras/qwinthumbnailtoolbar_p.h @@ -34,6 +34,17 @@ #ifndef QWINTHUMBNAILTOOLBAR_P_H #define QWINTHUMBNAILTOOLBAR_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qwinthumbnailtoolbar.h" #include <QtCore/QHash> diff --git a/src/winextras/qwinthumbnailtoolbutton_p.h b/src/winextras/qwinthumbnailtoolbutton_p.h index 4647b11..706b7ec 100644 --- a/src/winextras/qwinthumbnailtoolbutton_p.h +++ b/src/winextras/qwinthumbnailtoolbutton_p.h @@ -34,6 +34,17 @@ #ifndef QWINTHUMBNAILTOOLBUTTON_P_H #define QWINTHUMBNAILTOOLBUTTON_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qicon.h> #include <QtCore/qstring.h> diff --git a/src/winextras/winshobjidl_p.h b/src/winextras/winshobjidl_p.h index d10cb85..224150d 100644 --- a/src/winextras/winshobjidl_p.h +++ b/src/winextras/winshobjidl_p.h @@ -34,6 +34,17 @@ #ifndef WINSHOBJIDL_P_H #define WINSHOBJIDL_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <shobjidl.h> #ifndef __ITaskbarList_INTERFACE_DEFINED__ diff --git a/tests/auto/qwinjumplist/tst_qwinjumplist.cpp b/tests/auto/qwinjumplist/tst_qwinjumplist.cpp index 1944646..df7a366 100644 --- a/tests/auto/qwinjumplist/tst_qwinjumplist.cpp +++ b/tests/auto/qwinjumplist/tst_qwinjumplist.cpp @@ -60,6 +60,8 @@ static inline QByteArray msgFileNameMismatch(const QString &f1, const QString &f void tst_QWinJumpList::testRecent() { + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10) + QSKIP("QTBUG-48751: Recent items do not work on Windows 10", Continue); QScopedPointer<QWinJumpList> jumplist(new QWinJumpList); QWinJumpListCategory *recent1 = jumplist->recent(); QVERIFY(recent1); @@ -107,6 +109,8 @@ void tst_QWinJumpList::testRecent() void tst_QWinJumpList::testFrequent() { + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10) + QSKIP("QTBUG-48751: Frequent items do not work on Windows 10", Continue); QScopedPointer<QWinJumpList> jumplist(new QWinJumpList); QWinJumpListCategory *frequent1 = jumplist->frequent(); QVERIFY(frequent1); diff --git a/tests/manual/jumplist/main.cpp b/tests/manual/jumplist/main.cpp index f2bb7f8..78d101c 100644 --- a/tests/manual/jumplist/main.cpp +++ b/tests/manual/jumplist/main.cpp @@ -34,42 +34,93 @@ #include "testwidget.h" #include <QApplication> -#include <QSettings> +#include <QCommandLineParser> +#include <QCommandLineOption> #include <QDir> +#include <QDebug> +#include <QMimeDatabase> +#include <QSettings> +#include <QStatusBar> -void associateFileType() -{ - QString exeFileName = QCoreApplication::applicationFilePath(); - exeFileName = exeFileName.right(exeFileName.length() - exeFileName.lastIndexOf("/") - 1); - QString appName = "QtWinExtras JumpList Test"; +#include <algorithm> +#include <iterator> +static bool associateFileType() +{ + const QString applicationBinary = QCoreApplication::applicationFilePath(); + QString exeFileName = applicationBinary; + const int lastSlashPos = exeFileName.lastIndexOf(QLatin1Char('/')); + exeFileName.remove(0, lastSlashPos + 1); QSettings regApplications("HKEY_CURRENT_USER\\Software\\Classes\\Applications\\" + exeFileName, QSettings::NativeFormat); - regApplications.setValue("FriendlyAppName", appName); + regApplications.setValue("FriendlyAppName", QGuiApplication::applicationDisplayName()); regApplications.beginGroup("SupportedTypes"); - regApplications.setValue(".txt", QString()); + QMimeDatabase mimeDatabase; + foreach (const QString &t, TestWidget::supportedMimeTypes()) { + foreach (const QString &s, mimeDatabase.mimeTypeForName(t).suffixes()) + regApplications.setValue('.' + s, QString()); + } regApplications.endGroup(); regApplications.beginGroup("shell"); regApplications.beginGroup("open"); - regApplications.setValue("FriendlyAppName", appName); + regApplications.setValue("FriendlyAppName", QGuiApplication::applicationDisplayName()); regApplications.beginGroup("command"); - regApplications.setValue(".", '"' + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()) + "\" \"%1\""); + regApplications.setValue(".", '"' + QDir::toNativeSeparators(applicationBinary) + "\" \"%1\""); regApplications.endGroup(); regApplications.endGroup(); regApplications.endGroup(); + return regApplications.status() == QSettings::NoError; } int main(int argc, char *argv[]) { - QApplication a(argc, argv); - associateFileType(); + QStringList allArgs; // Show all arguments including style. + std::copy(argv + 1, argv + argc, std::back_inserter(allArgs)); + + QApplication app(argc, argv); + QGuiApplication::setApplicationDisplayName(QStringLiteral("QtWinExtras JumpList Test")); + if (!associateFileType()) { + qWarning() << "Unable to create registry entries."; + return -1; + } + + QCoreApplication::setOrganizationName("QtProject"); + QCoreApplication::setApplicationVersion(QT_VERSION_STR); + QCommandLineParser parser; + parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions); + parser.setApplicationDescription(QGuiApplication::applicationDisplayName()); + parser.addHelpOption(); + parser.addVersionOption(); + QCommandLineOption textOption("text", "Show some text"); + parser.addOption(textOption); + QCommandLineOption fullScreenOption("fullscreen", "Show fullscreen"); + parser.addOption(fullScreenOption); + QCommandLineOption idOption("id", "Jump list identifier", "id"); + parser.addOption(idOption); + parser.addPositionalArgument("file", "The file to open."); + parser.process(app); TestWidget w; - if (QCoreApplication::arguments().contains("-fullscreen")) + + if (parser.isSet(idOption)) + w.setId(parser.value(idOption)); + + if (parser.isSet(fullScreenOption)) w.showFullScreen(); else w.show(); - return a.exec(); + if (parser.isSet(textOption)) + w.setText("Hello, world!"); + + if (!parser.positionalArguments().isEmpty()) + w.showFile(parser.positionalArguments().first()); + + if (allArgs.isEmpty()) + w.statusBar()->showMessage("Remember to run windeployqt"); + else + w.statusBar()->showMessage("Arguments: " + allArgs.join(' ')); + + return app.exec(); } diff --git a/tests/manual/jumplist/testwidget.cpp b/tests/manual/jumplist/testwidget.cpp index e6660e4..15982a6 100644 --- a/tests/manual/jumplist/testwidget.cpp +++ b/tests/manual/jumplist/testwidget.cpp @@ -38,34 +38,27 @@ #include <QStyle> #include <QFile> #include <QFileDialog> +#include <QDesktopServices> #include <QMessageBox> +#include <QProcess> +#include <QStatusBar> +#include <QUrl> #include <QWinJumpList> #include <QWinJumpListItem> #include <QWinJumpListCategory> #include <QDebug> TestWidget::TestWidget(QWidget *parent) : - QWidget(parent), + QMainWindow(parent), ui(new Ui::TestWidget) { ui->setupUi(this); - if (QCoreApplication::arguments().contains("-text")) - ui->text->setPlainText("Hello, world!"); - if (!QCoreApplication::arguments().contains("-fullscreen")) - ui->btnClose->hide(); - - for (int i = 1; i < QCoreApplication::arguments().size(); i++) { - const QString arg = QCoreApplication::arguments().at(i); - if (!arg.isEmpty() && arg.at(0) != '-' && QFile(arg).exists()) { - showFile(arg); - break; - } - } - - connect(ui->btnUpdate, &QAbstractButton::clicked, this, &TestWidget::updateJumpList); - connect(ui->btnOpenFile, &QAbstractButton::clicked, this, &TestWidget::openFile); - connect(ui->btnClose, &QAbstractButton::clicked, QCoreApplication::quit); + connect(ui->actionUpdate, &QAction::triggered, this, &TestWidget::updateJumpList); + connect(ui->actionOpen, &QAction::triggered, this, &TestWidget::openFile); + connect(ui->actionExit, &QAction::triggered, QCoreApplication::quit); + connect(ui->actionShow_in_Explorer, &QAction::triggered, this, &TestWidget::showInExplorer); + connect(ui->actionRun_JumpListView, &QAction::triggered, this, &TestWidget::runJumpListView); } TestWidget::~TestWidget() @@ -73,6 +66,12 @@ TestWidget::~TestWidget() delete ui; } +QStringList TestWidget::supportedMimeTypes() +{ + return QStringList() << "text/x-c++src" << "text/x-csrc" << "text/x-chdr" + << "text/x-c++hdr" << "text/x-qml" << "text/plain"; +} + void TestWidget::changeEvent(QEvent *e) { QWidget::changeEvent(e); @@ -88,40 +87,73 @@ void TestWidget::changeEvent(QEvent *e) void TestWidget::showFile(const QString &path) { QFile file(path); - if (file.open(QIODevice::ReadOnly|QIODevice::Text)) - ui->text->setPlainText(QString::fromUtf8(file.readAll())); - else - QMessageBox::warning(this, "Error", "Failed to open file"); + if (!file.open(QIODevice::ReadOnly|QIODevice::Text)) { + const QString error = "Failed to open file " + QDir::toNativeSeparators(path) + + ": " + file.errorString(); + QMessageBox::warning(this, "Error", error); + return; + } + setText(QString::fromUtf8(file.readAll())); +} + +void TestWidget::setText(const QString &text) +{ + ui->text->setPlainText(text); } void TestWidget::updateJumpList() { QWinJumpList jumplist; + if (!m_id.isEmpty()) + jumplist.setIdentifier(m_id); + const QString applicationBinary = QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); jumplist.recent()->setVisible(ui->cbShowRecent->isChecked()); jumplist.frequent()->setVisible(ui->cbShowFrequent->isChecked()); if (ui->cbRunFullscreen->isChecked()) { QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Link); item->setTitle(ui->cbRunFullscreen->text()); - item->setFilePath(QDir::toNativeSeparators(QCoreApplication::applicationFilePath())); + item->setFilePath(applicationBinary); item->setArguments(QStringList("-fullscreen")); item->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton)); jumplist.tasks()->addItem(item); } if (ui->cbRunFusion->isChecked()) { - jumplist.tasks()->addLink(style()->standardIcon(QStyle::SP_DesktopIcon), ui->cbRunFusion->text(), QDir::toNativeSeparators(QCoreApplication::applicationFilePath()), (QStringList() << "-style" << "fusion")); + jumplist.tasks()->addLink(style()->standardIcon(QStyle::SP_DesktopIcon), + ui->cbRunFusion->text(), + applicationBinary, + (QStringList() << "-style" << "fusion")); } if (ui->cbRunText->isChecked()) { jumplist.tasks()->addSeparator(); - jumplist.tasks()->addLink(ui->cbRunText->text(), QDir::toNativeSeparators(QCoreApplication::applicationFilePath()), QStringList("-text")); + jumplist.tasks()->addLink(ui->cbRunText->text(), + applicationBinary, + QStringList("-text")); } jumplist.tasks()->setVisible(!jumplist.tasks()->isEmpty()); } void TestWidget::openFile() { - QString filePath = QFileDialog::getOpenFileName(this, "Open a text file", QString(), "Text files (*.txt)"); - if (filePath.isEmpty()) - return; - else - showFile(filePath); + QFileDialog fileDialog(this, "Open a Text File"); + fileDialog.setAcceptMode(QFileDialog::AcceptOpen); + fileDialog.setMimeTypeFilters(TestWidget::supportedMimeTypes()); + // Note: The native file dialog creates the frequent/recent entries. + if (!ui->actionUse_Native_File_Dialog->isChecked()) + fileDialog.setOption(QFileDialog::DontUseNativeDialog); + if (fileDialog.exec() == QDialog::Accepted) + showFile(fileDialog.selectedFiles().first()); +} + +void TestWidget::showInExplorer() +{ + const QString path = QFile::decodeName(qgetenv("APPDATA")) + + "/Microsoft/Windows/Recent/Automaticdestinations"; + QDesktopServices::openUrl(QUrl::fromLocalFile(path)); +} + +void TestWidget::runJumpListView() +{ + const char binary[] = "JumpListsView"; + if (!QProcess::startDetached(binary)) + statusBar()->showMessage(QLatin1String("Unable to run ") + binary); } diff --git a/tests/manual/jumplist/testwidget.h b/tests/manual/jumplist/testwidget.h index 71287c5..defb541 100644 --- a/tests/manual/jumplist/testwidget.h +++ b/tests/manual/jumplist/testwidget.h @@ -34,7 +34,7 @@ #ifndef TESTWIDGET_H #define TESTWIDGET_H -#include <QWidget> +#include <QMainWindow> QT_BEGIN_NAMESPACE namespace Ui { @@ -46,24 +46,34 @@ QT_END_NAMESPACE namespace Ui = QT_NAMESPACE::Ui; #endif -class TestWidget : public QWidget +class TestWidget : public QMainWindow { Q_OBJECT public: - explicit TestWidget(QWidget *parent = 0); + explicit TestWidget(QWidget *parent = Q_NULLPTR); ~TestWidget(); -protected: - void changeEvent(QEvent *e); - -private: - Ui::TestWidget *ui; void showFile(const QString &path); + void setText(const QString &text); + + static QStringList supportedMimeTypes(); + + QString id() const { return m_id; } + void setId(const QString &id) { m_id = id; } + +protected: + void changeEvent(QEvent *e) Q_DECL_OVERRIDE; private slots: void updateJumpList(); + void showInExplorer(); + void runJumpListView(); void openFile(); + +private: + Ui::TestWidget *ui; + QString m_id; }; #endif // TESTWIDGET_H diff --git a/tests/manual/jumplist/testwidget.ui b/tests/manual/jumplist/testwidget.ui index 82b9a0d..abcb078 100644 --- a/tests/manual/jumplist/testwidget.ui +++ b/tests/manual/jumplist/testwidget.ui @@ -1,196 +1,235 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>TestWidget</class> - <widget class="QWidget" name="TestWidget"> + <widget class="QMainWindow" name="TestWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>695</width> - <height>394</height> + <width>800</width> + <height>600</height> </rect> </property> - <property name="windowTitle"> - <string>QtWinExtras JumpList</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1"> - <property name="spacing"> - <number>3</number> - </property> - <property name="margin"> - <number>3</number> + <widget class="QWidget" name="centralwidget"> + <property name="windowTitle"> + <string>QtWinExtras JumpList</string> </property> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Known categories</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="margin"> - <number>3</number> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Known categories</string> </property> - <item> - <widget class="QCheckBox" name="cbShowFrequent"> - <property name="text"> - <string>Frequent</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="cbShowRecent"> - <property name="text"> - <string>Recent</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>Tasks</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <property name="spacing"> - <number>3</number> - </property> - <property name="margin"> - <number>3</number> - </property> - <item> - <widget class="QCheckBox" name="cbRunFullscreen"> - <property name="text"> - <string>Run in fullscreen</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="cbRunFusion"> - <property name="text"> - <string>Run with Fusion style</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="cbRunText"> - <property name="text"> - <string>Run with some text displayed</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>3</number> + </property> + <property name="leftMargin"> + <number>3</number> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="topMargin"> + <number>3</number> </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="btnUpdate"> - <property name="text"> - <string>Update</string> + <property name="rightMargin"> + <number>3</number> </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="bottomMargin"> + <number>3</number> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <item> + <widget class="QCheckBox" name="cbShowFrequent"> + <property name="text"> + <string>Frequent</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbShowRecent"> + <property name="text"> + <string>Recent</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Tasks</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>3</number> </property> - </spacer> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <property name="spacing"> - <number>3</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QPushButton" name="btnOpenFile"> - <property name="text"> - <string>Open a file</string> + <property name="leftMargin"> + <number>3</number> </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="topMargin"> + <number>3</number> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="rightMargin"> + <number>3</number> </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="btnClose"> - <property name="text"> - <string>Close</string> + <property name="bottomMargin"> + <number>3</number> </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QTextEdit" name="text"> - <property name="font"> - <font> - <family>Consolas</family> - <pointsize>10</pointsize> - </font> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> + <item> + <widget class="QCheckBox" name="cbRunFullscreen"> + <property name="text"> + <string>Run in fullscreen</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbRunFusion"> + <property name="text"> + <string>Run with Fusion style</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="cbRunText"> + <property name="text"> + <string>Run with some text displayed</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QTextEdit" name="text"> + <property name="font"> + <font> + <family>Consolas</family> + <pointsize>10</pointsize> + </font> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menuBar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>21</height> + </rect> + </property> + <widget class="QMenu" name="menuFile"> + <property name="title"> + <string>File</string> + </property> + <addaction name="actionOpen"/> + <addaction name="actionExit"/> + </widget> + <widget class="QMenu" name="menuJumplist"> + <property name="title"> + <string>Jumplist</string> + </property> + <addaction name="actionUpdate"/> + <addaction name="actionShow_in_Explorer"/> + <addaction name="actionRun_JumpListView"/> + </widget> + <widget class="QMenu" name="menuSettings"> + <property name="title"> + <string>Settings</string> + </property> + <addaction name="actionUse_Native_File_Dialog"/> + </widget> + <addaction name="menuFile"/> + <addaction name="menuJumplist"/> + <addaction name="menuSettings"/> + </widget> + <action name="actionOpen"> + <property name="text"> + <string>Open</string> + </property> + <property name="shortcut"> + <string>Ctrl+O</string> + </property> + </action> + <action name="actionExit"> + <property name="text"> + <string>Exit</string> + </property> + <property name="shortcut"> + <string>Ctrl+Q</string> + </property> + </action> + <action name="actionUpdate"> + <property name="text"> + <string>Update</string> + </property> + <property name="shortcut"> + <string>Ctrl+U</string> + </property> + </action> + <action name="actionShow_in_Explorer"> + <property name="text"> + <string>Show in Explorer</string> + </property> + <property name="shortcut"> + <string>Ctrl+E</string> + </property> + </action> + <action name="actionRun_JumpListView"> + <property name="text"> + <string>Run JumpListView</string> + </property> + <property name="toolTip"> + <string>Run JumpListView utility</string> + </property> + </action> + <action name="actionUse_Native_File_Dialog"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="text"> + <string>Use Native File Dialog</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <resources/> |