diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-18 19:17:30 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-18 19:17:30 +0100 |
commit | 9f38956fc9a58a2fdfd83c91d65502964047eda3 (patch) | |
tree | 3156fa78c621e3588b230d8334944d4c9e857d45 | |
parent | 57cd6337a87f4a8a77ea7136c60a32d2825426df (diff) | |
parent | 839d2d3e2368bc8e107d22203b0611c852f54319 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
Change-Id: I9588a3e2c7d590e031dd4c66905a79f0d74d3ac8
74 files changed, 3725 insertions, 96 deletions
diff --git a/src/imports/builtins.qmltypes b/src/imports/builtins.qmltypes new file mode 100644 index 0000000000..cca1c20d54 --- /dev/null +++ b/src/imports/builtins.qmltypes @@ -0,0 +1,1605 @@ +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 -nonrelocatable -builtins' + +Module { + dependencies: [] + Component { + name: "Qt" + Enum { + name: "GlobalColor" + values: { + "color0": 0, + "color1": 1, + "black": 2, + "white": 3, + "darkGray": 4, + "gray": 5, + "lightGray": 6, + "red": 7, + "green": 8, + "blue": 9, + "cyan": 10, + "magenta": 11, + "yellow": 12, + "darkRed": 13, + "darkGreen": 14, + "darkBlue": 15, + "darkCyan": 16, + "darkMagenta": 17, + "darkYellow": 18, + "transparent": 19 + } + } + Enum { + name: "KeyboardModifiers" + values: { + "NoModifier": 0, + "ShiftModifier": 33554432, + "ControlModifier": 67108864, + "AltModifier": 134217728, + "MetaModifier": 268435456, + "KeypadModifier": 536870912, + "GroupSwitchModifier": 1073741824, + "KeyboardModifierMask": -33554432 + } + } + Enum { + name: "MouseButtons" + values: { + "NoButton": 0, + "LeftButton": 1, + "RightButton": 2, + "MidButton": 4, + "MiddleButton": 4, + "BackButton": 8, + "XButton1": 8, + "ExtraButton1": 8, + "ForwardButton": 16, + "XButton2": 16, + "ExtraButton2": 16, + "TaskButton": 32, + "ExtraButton3": 32, + "ExtraButton4": 64, + "ExtraButton5": 128, + "ExtraButton6": 256, + "ExtraButton7": 512, + "ExtraButton8": 1024, + "ExtraButton9": 2048, + "ExtraButton10": 4096, + "ExtraButton11": 8192, + "ExtraButton12": 16384, + "ExtraButton13": 32768, + "ExtraButton14": 65536, + "ExtraButton15": 131072, + "ExtraButton16": 262144, + "ExtraButton17": 524288, + "ExtraButton18": 1048576, + "ExtraButton19": 2097152, + "ExtraButton20": 4194304, + "ExtraButton21": 8388608, + "ExtraButton22": 16777216, + "ExtraButton23": 33554432, + "ExtraButton24": 67108864, + "AllButtons": 134217727, + "MaxMouseButton": 67108864, + "MouseButtonMask": -1 + } + } + Enum { + name: "Orientation" + values: { + "Horizontal": 1, + "Vertical": 2 + } + } + Enum { + name: "Orientations" + values: { + "Horizontal": 1, + "Vertical": 2 + } + } + Enum { + name: "FocusPolicy" + values: { + "NoFocus": 0, + "TabFocus": 1, + "ClickFocus": 2, + "StrongFocus": 11, + "WheelFocus": 15 + } + } + Enum { + name: "TabFocusBehavior" + values: { + "NoTabFocus": 0, + "TabFocusTextControls": 1, + "TabFocusListControls": 2, + "TabFocusAllControls": 255 + } + } + Enum { + name: "SortOrder" + values: { + "AscendingOrder": 0, + "DescendingOrder": 1 + } + } + Enum { + name: "Alignment" + values: { + "AlignLeft": 1, + "AlignLeading": 1, + "AlignRight": 2, + "AlignTrailing": 2, + "AlignHCenter": 4, + "AlignJustify": 8, + "AlignAbsolute": 16, + "AlignHorizontal_Mask": 31, + "AlignTop": 32, + "AlignBottom": 64, + "AlignVCenter": 128, + "AlignBaseline": 256, + "AlignVertical_Mask": 480, + "AlignCenter": 132 + } + } + Enum { + name: "TextElideMode" + values: { + "ElideLeft": 0, + "ElideRight": 1, + "ElideMiddle": 2, + "ElideNone": 3 + } + } + Enum { + name: "WindowType" + values: { + "Widget": 0, + "Window": 1, + "Dialog": 3, + "Sheet": 5, + "Drawer": 7, + "Popup": 9, + "Tool": 11, + "ToolTip": 13, + "SplashScreen": 15, + "Desktop": 17, + "SubWindow": 18, + "ForeignWindow": 33, + "CoverWindow": 65, + "WindowType_Mask": 255, + "MSWindowsFixedSizeDialogHint": 256, + "MSWindowsOwnDC": 512, + "BypassWindowManagerHint": 1024, + "X11BypassWindowManagerHint": 1024, + "FramelessWindowHint": 2048, + "WindowTitleHint": 4096, + "WindowSystemMenuHint": 8192, + "WindowMinimizeButtonHint": 16384, + "WindowMaximizeButtonHint": 32768, + "WindowMinMaxButtonsHint": 49152, + "WindowContextHelpButtonHint": 65536, + "WindowShadeButtonHint": 131072, + "WindowStaysOnTopHint": 262144, + "WindowTransparentForInput": 524288, + "WindowOverridesSystemGestures": 1048576, + "WindowDoesNotAcceptFocus": 2097152, + "MaximizeUsingFullscreenGeometryHint": 4194304, + "CustomizeWindowHint": 33554432, + "WindowStaysOnBottomHint": 67108864, + "WindowCloseButtonHint": 134217728, + "MacWindowToolBarButtonHint": 268435456, + "BypassGraphicsProxyWidget": 536870912, + "NoDropShadowWindowHint": 1073741824, + "WindowFullscreenButtonHint": -2147483648, + "WindowOkButtonHint": 524288, + "WindowCancelButtonHint": 1048576 + } + } + Enum { + name: "WindowFlags" + values: { + "Widget": 0, + "Window": 1, + "Dialog": 3, + "Sheet": 5, + "Drawer": 7, + "Popup": 9, + "Tool": 11, + "ToolTip": 13, + "SplashScreen": 15, + "Desktop": 17, + "SubWindow": 18, + "ForeignWindow": 33, + "CoverWindow": 65, + "WindowType_Mask": 255, + "MSWindowsFixedSizeDialogHint": 256, + "MSWindowsOwnDC": 512, + "BypassWindowManagerHint": 1024, + "X11BypassWindowManagerHint": 1024, + "FramelessWindowHint": 2048, + "WindowTitleHint": 4096, + "WindowSystemMenuHint": 8192, + "WindowMinimizeButtonHint": 16384, + "WindowMaximizeButtonHint": 32768, + "WindowMinMaxButtonsHint": 49152, + "WindowContextHelpButtonHint": 65536, + "WindowShadeButtonHint": 131072, + "WindowStaysOnTopHint": 262144, + "WindowTransparentForInput": 524288, + "WindowOverridesSystemGestures": 1048576, + "WindowDoesNotAcceptFocus": 2097152, + "MaximizeUsingFullscreenGeometryHint": 4194304, + "CustomizeWindowHint": 33554432, + "WindowStaysOnBottomHint": 67108864, + "WindowCloseButtonHint": 134217728, + "MacWindowToolBarButtonHint": 268435456, + "BypassGraphicsProxyWidget": 536870912, + "NoDropShadowWindowHint": 1073741824, + "WindowFullscreenButtonHint": -2147483648, + "WindowOkButtonHint": 524288, + "WindowCancelButtonHint": 1048576 + } + } + Enum { + name: "WindowState" + values: { + "WindowNoState": 0, + "WindowMinimized": 1, + "WindowMaximized": 2, + "WindowFullScreen": 4, + "WindowActive": 8 + } + } + Enum { + name: "WindowStates" + values: { + "WindowNoState": 0, + "WindowMinimized": 1, + "WindowMaximized": 2, + "WindowFullScreen": 4, + "WindowActive": 8 + } + } + Enum { + name: "ApplicationState" + values: { + "ApplicationSuspended": 0, + "ApplicationHidden": 1, + "ApplicationInactive": 2, + "ApplicationActive": 4 + } + } + Enum { + name: "ScreenOrientation" + values: { + "PrimaryOrientation": 0, + "PortraitOrientation": 1, + "LandscapeOrientation": 2, + "InvertedPortraitOrientation": 4, + "InvertedLandscapeOrientation": 8 + } + } + Enum { + name: "ScreenOrientations" + values: { + "PrimaryOrientation": 0, + "PortraitOrientation": 1, + "LandscapeOrientation": 2, + "InvertedPortraitOrientation": 4, + "InvertedLandscapeOrientation": 8 + } + } + Enum { + name: "WidgetAttribute" + values: { + "WA_Disabled": 0, + "WA_UnderMouse": 1, + "WA_MouseTracking": 2, + "WA_ContentsPropagated": 3, + "WA_OpaquePaintEvent": 4, + "WA_NoBackground": 4, + "WA_StaticContents": 5, + "WA_LaidOut": 7, + "WA_PaintOnScreen": 8, + "WA_NoSystemBackground": 9, + "WA_UpdatesDisabled": 10, + "WA_Mapped": 11, + "WA_MacNoClickThrough": 12, + "WA_InputMethodEnabled": 14, + "WA_WState_Visible": 15, + "WA_WState_Hidden": 16, + "WA_ForceDisabled": 32, + "WA_KeyCompression": 33, + "WA_PendingMoveEvent": 34, + "WA_PendingResizeEvent": 35, + "WA_SetPalette": 36, + "WA_SetFont": 37, + "WA_SetCursor": 38, + "WA_NoChildEventsFromChildren": 39, + "WA_WindowModified": 41, + "WA_Resized": 42, + "WA_Moved": 43, + "WA_PendingUpdate": 44, + "WA_InvalidSize": 45, + "WA_MacBrushedMetal": 46, + "WA_MacMetalStyle": 46, + "WA_CustomWhatsThis": 47, + "WA_LayoutOnEntireRect": 48, + "WA_OutsideWSRange": 49, + "WA_GrabbedShortcut": 50, + "WA_TransparentForMouseEvents": 51, + "WA_PaintUnclipped": 52, + "WA_SetWindowIcon": 53, + "WA_NoMouseReplay": 54, + "WA_DeleteOnClose": 55, + "WA_RightToLeft": 56, + "WA_SetLayoutDirection": 57, + "WA_NoChildEventsForParent": 58, + "WA_ForceUpdatesDisabled": 59, + "WA_WState_Created": 60, + "WA_WState_CompressKeys": 61, + "WA_WState_InPaintEvent": 62, + "WA_WState_Reparented": 63, + "WA_WState_ConfigPending": 64, + "WA_WState_Polished": 66, + "WA_WState_DND": 67, + "WA_WState_OwnSizePolicy": 68, + "WA_WState_ExplicitShowHide": 69, + "WA_ShowModal": 70, + "WA_MouseNoMask": 71, + "WA_GroupLeader": 72, + "WA_NoMousePropagation": 73, + "WA_Hover": 74, + "WA_InputMethodTransparent": 75, + "WA_QuitOnClose": 76, + "WA_KeyboardFocusChange": 77, + "WA_AcceptDrops": 78, + "WA_DropSiteRegistered": 79, + "WA_ForceAcceptDrops": 79, + "WA_WindowPropagation": 80, + "WA_NoX11EventCompression": 81, + "WA_TintedBackground": 82, + "WA_X11OpenGLOverlay": 83, + "WA_AlwaysShowToolTips": 84, + "WA_MacOpaqueSizeGrip": 85, + "WA_SetStyle": 86, + "WA_SetLocale": 87, + "WA_MacShowFocusRect": 88, + "WA_MacNormalSize": 89, + "WA_MacSmallSize": 90, + "WA_MacMiniSize": 91, + "WA_LayoutUsesWidgetRect": 92, + "WA_StyledBackground": 93, + "WA_MSWindowsUseDirect3D": 94, + "WA_CanHostQMdiSubWindowTitleBar": 95, + "WA_MacAlwaysShowToolWindow": 96, + "WA_StyleSheet": 97, + "WA_ShowWithoutActivating": 98, + "WA_X11BypassTransientForHint": 99, + "WA_NativeWindow": 100, + "WA_DontCreateNativeAncestors": 101, + "WA_MacVariableSize": 102, + "WA_DontShowOnScreen": 103, + "WA_X11NetWmWindowTypeDesktop": 104, + "WA_X11NetWmWindowTypeDock": 105, + "WA_X11NetWmWindowTypeToolBar": 106, + "WA_X11NetWmWindowTypeMenu": 107, + "WA_X11NetWmWindowTypeUtility": 108, + "WA_X11NetWmWindowTypeSplash": 109, + "WA_X11NetWmWindowTypeDialog": 110, + "WA_X11NetWmWindowTypeDropDownMenu": 111, + "WA_X11NetWmWindowTypePopupMenu": 112, + "WA_X11NetWmWindowTypeToolTip": 113, + "WA_X11NetWmWindowTypeNotification": 114, + "WA_X11NetWmWindowTypeCombo": 115, + "WA_X11NetWmWindowTypeDND": 116, + "WA_MacFrameworkScaled": 117, + "WA_SetWindowModality": 118, + "WA_WState_WindowOpacitySet": 119, + "WA_TranslucentBackground": 120, + "WA_AcceptTouchEvents": 121, + "WA_WState_AcceptedTouchBeginEvent": 122, + "WA_TouchPadAcceptSingleTouchEvents": 123, + "WA_X11DoNotAcceptFocus": 126, + "WA_MacNoShadow": 127, + "WA_AlwaysStackOnTop": 128, + "WA_AttributeCount": 129 + } + } + Enum { + name: "ApplicationAttribute" + values: { + "AA_ImmediateWidgetCreation": 0, + "AA_MSWindowsUseDirect3DByDefault": 1, + "AA_DontShowIconsInMenus": 2, + "AA_NativeWindows": 3, + "AA_DontCreateNativeWidgetSiblings": 4, + "AA_MacPluginApplication": 5, + "AA_DontUseNativeMenuBar": 6, + "AA_MacDontSwapCtrlAndMeta": 7, + "AA_Use96Dpi": 8, + "AA_X11InitThreads": 10, + "AA_SynthesizeTouchForUnhandledMouseEvents": 11, + "AA_SynthesizeMouseForUnhandledTouchEvents": 12, + "AA_UseHighDpiPixmaps": 13, + "AA_ForceRasterWidgets": 14, + "AA_UseDesktopOpenGL": 15, + "AA_UseOpenGLES": 16, + "AA_UseSoftwareOpenGL": 17, + "AA_ShareOpenGLContexts": 18, + "AA_SetPalette": 19, + "AA_EnableHighDpiScaling": 20, + "AA_DisableHighDpiScaling": 21, + "AA_AttributeCount": 22 + } + } + Enum { + name: "ImageConversionFlags" + values: { + "ColorMode_Mask": 3, + "AutoColor": 0, + "ColorOnly": 3, + "MonoOnly": 2, + "AlphaDither_Mask": 12, + "ThresholdAlphaDither": 0, + "OrderedAlphaDither": 4, + "DiffuseAlphaDither": 8, + "NoAlpha": 12, + "Dither_Mask": 48, + "DiffuseDither": 0, + "OrderedDither": 16, + "ThresholdDither": 32, + "DitherMode_Mask": 192, + "AutoDither": 0, + "PreferDither": 64, + "AvoidDither": 128, + "NoOpaqueDetection": 256, + "NoFormatConversion": 512 + } + } + Enum { + name: "BGMode" + values: { + "TransparentMode": 0, + "OpaqueMode": 1 + } + } + Enum { + name: "Key" + values: { + "Key_Escape": 16777216, + "Key_Tab": 16777217, + "Key_Backtab": 16777218, + "Key_Backspace": 16777219, + "Key_Return": 16777220, + "Key_Enter": 16777221, + "Key_Insert": 16777222, + "Key_Delete": 16777223, + "Key_Pause": 16777224, + "Key_Print": 16777225, + "Key_SysReq": 16777226, + "Key_Clear": 16777227, + "Key_Home": 16777232, + "Key_End": 16777233, + "Key_Left": 16777234, + "Key_Up": 16777235, + "Key_Right": 16777236, + "Key_Down": 16777237, + "Key_PageUp": 16777238, + "Key_PageDown": 16777239, + "Key_Shift": 16777248, + "Key_Control": 16777249, + "Key_Meta": 16777250, + "Key_Alt": 16777251, + "Key_CapsLock": 16777252, + "Key_NumLock": 16777253, + "Key_ScrollLock": 16777254, + "Key_F1": 16777264, + "Key_F2": 16777265, + "Key_F3": 16777266, + "Key_F4": 16777267, + "Key_F5": 16777268, + "Key_F6": 16777269, + "Key_F7": 16777270, + "Key_F8": 16777271, + "Key_F9": 16777272, + "Key_F10": 16777273, + "Key_F11": 16777274, + "Key_F12": 16777275, + "Key_F13": 16777276, + "Key_F14": 16777277, + "Key_F15": 16777278, + "Key_F16": 16777279, + "Key_F17": 16777280, + "Key_F18": 16777281, + "Key_F19": 16777282, + "Key_F20": 16777283, + "Key_F21": 16777284, + "Key_F22": 16777285, + "Key_F23": 16777286, + "Key_F24": 16777287, + "Key_F25": 16777288, + "Key_F26": 16777289, + "Key_F27": 16777290, + "Key_F28": 16777291, + "Key_F29": 16777292, + "Key_F30": 16777293, + "Key_F31": 16777294, + "Key_F32": 16777295, + "Key_F33": 16777296, + "Key_F34": 16777297, + "Key_F35": 16777298, + "Key_Super_L": 16777299, + "Key_Super_R": 16777300, + "Key_Menu": 16777301, + "Key_Hyper_L": 16777302, + "Key_Hyper_R": 16777303, + "Key_Help": 16777304, + "Key_Direction_L": 16777305, + "Key_Direction_R": 16777312, + "Key_Space": 32, + "Key_Any": 32, + "Key_Exclam": 33, + "Key_QuoteDbl": 34, + "Key_NumberSign": 35, + "Key_Dollar": 36, + "Key_Percent": 37, + "Key_Ampersand": 38, + "Key_Apostrophe": 39, + "Key_ParenLeft": 40, + "Key_ParenRight": 41, + "Key_Asterisk": 42, + "Key_Plus": 43, + "Key_Comma": 44, + "Key_Minus": 45, + "Key_Period": 46, + "Key_Slash": 47, + "Key_0": 48, + "Key_1": 49, + "Key_2": 50, + "Key_3": 51, + "Key_4": 52, + "Key_5": 53, + "Key_6": 54, + "Key_7": 55, + "Key_8": 56, + "Key_9": 57, + "Key_Colon": 58, + "Key_Semicolon": 59, + "Key_Less": 60, + "Key_Equal": 61, + "Key_Greater": 62, + "Key_Question": 63, + "Key_At": 64, + "Key_A": 65, + "Key_B": 66, + "Key_C": 67, + "Key_D": 68, + "Key_E": 69, + "Key_F": 70, + "Key_G": 71, + "Key_H": 72, + "Key_I": 73, + "Key_J": 74, + "Key_K": 75, + "Key_L": 76, + "Key_M": 77, + "Key_N": 78, + "Key_O": 79, + "Key_P": 80, + "Key_Q": 81, + "Key_R": 82, + "Key_S": 83, + "Key_T": 84, + "Key_U": 85, + "Key_V": 86, + "Key_W": 87, + "Key_X": 88, + "Key_Y": 89, + "Key_Z": 90, + "Key_BracketLeft": 91, + "Key_Backslash": 92, + "Key_BracketRight": 93, + "Key_AsciiCircum": 94, + "Key_Underscore": 95, + "Key_QuoteLeft": 96, + "Key_BraceLeft": 123, + "Key_Bar": 124, + "Key_BraceRight": 125, + "Key_AsciiTilde": 126, + "Key_nobreakspace": 160, + "Key_exclamdown": 161, + "Key_cent": 162, + "Key_sterling": 163, + "Key_currency": 164, + "Key_yen": 165, + "Key_brokenbar": 166, + "Key_section": 167, + "Key_diaeresis": 168, + "Key_copyright": 169, + "Key_ordfeminine": 170, + "Key_guillemotleft": 171, + "Key_notsign": 172, + "Key_hyphen": 173, + "Key_registered": 174, + "Key_macron": 175, + "Key_degree": 176, + "Key_plusminus": 177, + "Key_twosuperior": 178, + "Key_threesuperior": 179, + "Key_acute": 180, + "Key_mu": 181, + "Key_paragraph": 182, + "Key_periodcentered": 183, + "Key_cedilla": 184, + "Key_onesuperior": 185, + "Key_masculine": 186, + "Key_guillemotright": 187, + "Key_onequarter": 188, + "Key_onehalf": 189, + "Key_threequarters": 190, + "Key_questiondown": 191, + "Key_Agrave": 192, + "Key_Aacute": 193, + "Key_Acircumflex": 194, + "Key_Atilde": 195, + "Key_Adiaeresis": 196, + "Key_Aring": 197, + "Key_AE": 198, + "Key_Ccedilla": 199, + "Key_Egrave": 200, + "Key_Eacute": 201, + "Key_Ecircumflex": 202, + "Key_Ediaeresis": 203, + "Key_Igrave": 204, + "Key_Iacute": 205, + "Key_Icircumflex": 206, + "Key_Idiaeresis": 207, + "Key_ETH": 208, + "Key_Ntilde": 209, + "Key_Ograve": 210, + "Key_Oacute": 211, + "Key_Ocircumflex": 212, + "Key_Otilde": 213, + "Key_Odiaeresis": 214, + "Key_multiply": 215, + "Key_Ooblique": 216, + "Key_Ugrave": 217, + "Key_Uacute": 218, + "Key_Ucircumflex": 219, + "Key_Udiaeresis": 220, + "Key_Yacute": 221, + "Key_THORN": 222, + "Key_ssharp": 223, + "Key_division": 247, + "Key_ydiaeresis": 255, + "Key_AltGr": 16781571, + "Key_Multi_key": 16781600, + "Key_Codeinput": 16781623, + "Key_SingleCandidate": 16781628, + "Key_MultipleCandidate": 16781629, + "Key_PreviousCandidate": 16781630, + "Key_Mode_switch": 16781694, + "Key_Kanji": 16781601, + "Key_Muhenkan": 16781602, + "Key_Henkan": 16781603, + "Key_Romaji": 16781604, + "Key_Hiragana": 16781605, + "Key_Katakana": 16781606, + "Key_Hiragana_Katakana": 16781607, + "Key_Zenkaku": 16781608, + "Key_Hankaku": 16781609, + "Key_Zenkaku_Hankaku": 16781610, + "Key_Touroku": 16781611, + "Key_Massyo": 16781612, + "Key_Kana_Lock": 16781613, + "Key_Kana_Shift": 16781614, + "Key_Eisu_Shift": 16781615, + "Key_Eisu_toggle": 16781616, + "Key_Hangul": 16781617, + "Key_Hangul_Start": 16781618, + "Key_Hangul_End": 16781619, + "Key_Hangul_Hanja": 16781620, + "Key_Hangul_Jamo": 16781621, + "Key_Hangul_Romaja": 16781622, + "Key_Hangul_Jeonja": 16781624, + "Key_Hangul_Banja": 16781625, + "Key_Hangul_PreHanja": 16781626, + "Key_Hangul_PostHanja": 16781627, + "Key_Hangul_Special": 16781631, + "Key_Dead_Grave": 16781904, + "Key_Dead_Acute": 16781905, + "Key_Dead_Circumflex": 16781906, + "Key_Dead_Tilde": 16781907, + "Key_Dead_Macron": 16781908, + "Key_Dead_Breve": 16781909, + "Key_Dead_Abovedot": 16781910, + "Key_Dead_Diaeresis": 16781911, + "Key_Dead_Abovering": 16781912, + "Key_Dead_Doubleacute": 16781913, + "Key_Dead_Caron": 16781914, + "Key_Dead_Cedilla": 16781915, + "Key_Dead_Ogonek": 16781916, + "Key_Dead_Iota": 16781917, + "Key_Dead_Voiced_Sound": 16781918, + "Key_Dead_Semivoiced_Sound": 16781919, + "Key_Dead_Belowdot": 16781920, + "Key_Dead_Hook": 16781921, + "Key_Dead_Horn": 16781922, + "Key_Back": 16777313, + "Key_Forward": 16777314, + "Key_Stop": 16777315, + "Key_Refresh": 16777316, + "Key_VolumeDown": 16777328, + "Key_VolumeMute": 16777329, + "Key_VolumeUp": 16777330, + "Key_BassBoost": 16777331, + "Key_BassUp": 16777332, + "Key_BassDown": 16777333, + "Key_TrebleUp": 16777334, + "Key_TrebleDown": 16777335, + "Key_MediaPlay": 16777344, + "Key_MediaStop": 16777345, + "Key_MediaPrevious": 16777346, + "Key_MediaNext": 16777347, + "Key_MediaRecord": 16777348, + "Key_MediaPause": 16777349, + "Key_MediaTogglePlayPause": 16777350, + "Key_HomePage": 16777360, + "Key_Favorites": 16777361, + "Key_Search": 16777362, + "Key_Standby": 16777363, + "Key_OpenUrl": 16777364, + "Key_LaunchMail": 16777376, + "Key_LaunchMedia": 16777377, + "Key_Launch0": 16777378, + "Key_Launch1": 16777379, + "Key_Launch2": 16777380, + "Key_Launch3": 16777381, + "Key_Launch4": 16777382, + "Key_Launch5": 16777383, + "Key_Launch6": 16777384, + "Key_Launch7": 16777385, + "Key_Launch8": 16777386, + "Key_Launch9": 16777387, + "Key_LaunchA": 16777388, + "Key_LaunchB": 16777389, + "Key_LaunchC": 16777390, + "Key_LaunchD": 16777391, + "Key_LaunchE": 16777392, + "Key_LaunchF": 16777393, + "Key_MonBrightnessUp": 16777394, + "Key_MonBrightnessDown": 16777395, + "Key_KeyboardLightOnOff": 16777396, + "Key_KeyboardBrightnessUp": 16777397, + "Key_KeyboardBrightnessDown": 16777398, + "Key_PowerOff": 16777399, + "Key_WakeUp": 16777400, + "Key_Eject": 16777401, + "Key_ScreenSaver": 16777402, + "Key_WWW": 16777403, + "Key_Memo": 16777404, + "Key_LightBulb": 16777405, + "Key_Shop": 16777406, + "Key_History": 16777407, + "Key_AddFavorite": 16777408, + "Key_HotLinks": 16777409, + "Key_BrightnessAdjust": 16777410, + "Key_Finance": 16777411, + "Key_Community": 16777412, + "Key_AudioRewind": 16777413, + "Key_BackForward": 16777414, + "Key_ApplicationLeft": 16777415, + "Key_ApplicationRight": 16777416, + "Key_Book": 16777417, + "Key_CD": 16777418, + "Key_Calculator": 16777419, + "Key_ToDoList": 16777420, + "Key_ClearGrab": 16777421, + "Key_Close": 16777422, + "Key_Copy": 16777423, + "Key_Cut": 16777424, + "Key_Display": 16777425, + "Key_DOS": 16777426, + "Key_Documents": 16777427, + "Key_Excel": 16777428, + "Key_Explorer": 16777429, + "Key_Game": 16777430, + "Key_Go": 16777431, + "Key_iTouch": 16777432, + "Key_LogOff": 16777433, + "Key_Market": 16777434, + "Key_Meeting": 16777435, + "Key_MenuKB": 16777436, + "Key_MenuPB": 16777437, + "Key_MySites": 16777438, + "Key_News": 16777439, + "Key_OfficeHome": 16777440, + "Key_Option": 16777441, + "Key_Paste": 16777442, + "Key_Phone": 16777443, + "Key_Calendar": 16777444, + "Key_Reply": 16777445, + "Key_Reload": 16777446, + "Key_RotateWindows": 16777447, + "Key_RotationPB": 16777448, + "Key_RotationKB": 16777449, + "Key_Save": 16777450, + "Key_Send": 16777451, + "Key_Spell": 16777452, + "Key_SplitScreen": 16777453, + "Key_Support": 16777454, + "Key_TaskPane": 16777455, + "Key_Terminal": 16777456, + "Key_Tools": 16777457, + "Key_Travel": 16777458, + "Key_Video": 16777459, + "Key_Word": 16777460, + "Key_Xfer": 16777461, + "Key_ZoomIn": 16777462, + "Key_ZoomOut": 16777463, + "Key_Away": 16777464, + "Key_Messenger": 16777465, + "Key_WebCam": 16777466, + "Key_MailForward": 16777467, + "Key_Pictures": 16777468, + "Key_Music": 16777469, + "Key_Battery": 16777470, + "Key_Bluetooth": 16777471, + "Key_WLAN": 16777472, + "Key_UWB": 16777473, + "Key_AudioForward": 16777474, + "Key_AudioRepeat": 16777475, + "Key_AudioRandomPlay": 16777476, + "Key_Subtitle": 16777477, + "Key_AudioCycleTrack": 16777478, + "Key_Time": 16777479, + "Key_Hibernate": 16777480, + "Key_View": 16777481, + "Key_TopMenu": 16777482, + "Key_PowerDown": 16777483, + "Key_Suspend": 16777484, + "Key_ContrastAdjust": 16777485, + "Key_LaunchG": 16777486, + "Key_LaunchH": 16777487, + "Key_TouchpadToggle": 16777488, + "Key_TouchpadOn": 16777489, + "Key_TouchpadOff": 16777490, + "Key_MicMute": 16777491, + "Key_Red": 16777492, + "Key_Green": 16777493, + "Key_Yellow": 16777494, + "Key_Blue": 16777495, + "Key_ChannelUp": 16777496, + "Key_ChannelDown": 16777497, + "Key_Guide": 16777498, + "Key_Info": 16777499, + "Key_Settings": 16777500, + "Key_MicVolumeUp": 16777501, + "Key_MicVolumeDown": 16777502, + "Key_New": 16777504, + "Key_Open": 16777505, + "Key_Find": 16777506, + "Key_Undo": 16777507, + "Key_Redo": 16777508, + "Key_MediaLast": 16842751, + "Key_Select": 16842752, + "Key_Yes": 16842753, + "Key_No": 16842754, + "Key_Cancel": 16908289, + "Key_Printer": 16908290, + "Key_Execute": 16908291, + "Key_Sleep": 16908292, + "Key_Play": 16908293, + "Key_Zoom": 16908294, + "Key_Exit": 16908298, + "Key_Context1": 17825792, + "Key_Context2": 17825793, + "Key_Context3": 17825794, + "Key_Context4": 17825795, + "Key_Call": 17825796, + "Key_Hangup": 17825797, + "Key_Flip": 17825798, + "Key_ToggleCallHangup": 17825799, + "Key_VoiceDial": 17825800, + "Key_LastNumberRedial": 17825801, + "Key_Camera": 17825824, + "Key_CameraFocus": 17825825, + "Key_unknown": 33554431 + } + } + Enum { + name: "ArrowType" + values: { + "NoArrow": 0, + "UpArrow": 1, + "DownArrow": 2, + "LeftArrow": 3, + "RightArrow": 4 + } + } + Enum { + name: "PenStyle" + values: { + "NoPen": 0, + "SolidLine": 1, + "DashLine": 2, + "DotLine": 3, + "DashDotLine": 4, + "DashDotDotLine": 5, + "CustomDashLine": 6 + } + } + Enum { + name: "PenCapStyle" + values: { + "FlatCap": 0, + "SquareCap": 16, + "RoundCap": 32, + "MPenCapStyle": 48 + } + } + Enum { + name: "PenJoinStyle" + values: { + "MiterJoin": 0, + "BevelJoin": 64, + "RoundJoin": 128, + "SvgMiterJoin": 256, + "MPenJoinStyle": 448 + } + } + Enum { + name: "BrushStyle" + values: { + "NoBrush": 0, + "SolidPattern": 1, + "Dense1Pattern": 2, + "Dense2Pattern": 3, + "Dense3Pattern": 4, + "Dense4Pattern": 5, + "Dense5Pattern": 6, + "Dense6Pattern": 7, + "Dense7Pattern": 8, + "HorPattern": 9, + "VerPattern": 10, + "CrossPattern": 11, + "BDiagPattern": 12, + "FDiagPattern": 13, + "DiagCrossPattern": 14, + "LinearGradientPattern": 15, + "RadialGradientPattern": 16, + "ConicalGradientPattern": 17, + "TexturePattern": 24 + } + } + Enum { + name: "SizeMode" + values: { + "AbsoluteSize": 0, + "RelativeSize": 1 + } + } + Enum { + name: "CursorShape" + values: { + "ArrowCursor": 0, + "UpArrowCursor": 1, + "CrossCursor": 2, + "WaitCursor": 3, + "IBeamCursor": 4, + "SizeVerCursor": 5, + "SizeHorCursor": 6, + "SizeBDiagCursor": 7, + "SizeFDiagCursor": 8, + "SizeAllCursor": 9, + "BlankCursor": 10, + "SplitVCursor": 11, + "SplitHCursor": 12, + "PointingHandCursor": 13, + "ForbiddenCursor": 14, + "WhatsThisCursor": 15, + "BusyCursor": 16, + "OpenHandCursor": 17, + "ClosedHandCursor": 18, + "DragCopyCursor": 19, + "DragMoveCursor": 20, + "DragLinkCursor": 21, + "LastCursor": 21, + "BitmapCursor": 24, + "CustomCursor": 25 + } + } + Enum { + name: "TextFormat" + values: { + "PlainText": 0, + "RichText": 1, + "AutoText": 2 + } + } + Enum { + name: "AspectRatioMode" + values: { + "IgnoreAspectRatio": 0, + "KeepAspectRatio": 1, + "KeepAspectRatioByExpanding": 2 + } + } + Enum { + name: "DockWidgetArea" + values: { + "LeftDockWidgetArea": 1, + "RightDockWidgetArea": 2, + "TopDockWidgetArea": 4, + "BottomDockWidgetArea": 8, + "DockWidgetArea_Mask": 15, + "AllDockWidgetAreas": 15, + "NoDockWidgetArea": 0 + } + } + Enum { + name: "DockWidgetAreas" + values: { + "LeftDockWidgetArea": 1, + "RightDockWidgetArea": 2, + "TopDockWidgetArea": 4, + "BottomDockWidgetArea": 8, + "DockWidgetArea_Mask": 15, + "AllDockWidgetAreas": 15, + "NoDockWidgetArea": 0 + } + } + Enum { + name: "ToolBarArea" + values: { + "LeftToolBarArea": 1, + "RightToolBarArea": 2, + "TopToolBarArea": 4, + "BottomToolBarArea": 8, + "ToolBarArea_Mask": 15, + "AllToolBarAreas": 15, + "NoToolBarArea": 0 + } + } + Enum { + name: "ToolBarAreas" + values: { + "LeftToolBarArea": 1, + "RightToolBarArea": 2, + "TopToolBarArea": 4, + "BottomToolBarArea": 8, + "ToolBarArea_Mask": 15, + "AllToolBarAreas": 15, + "NoToolBarArea": 0 + } + } + Enum { + name: "DateFormat" + values: { + "TextDate": 0, + "ISODate": 1, + "SystemLocaleDate": 2, + "LocalDate": 2, + "LocaleDate": 3, + "SystemLocaleShortDate": 4, + "SystemLocaleLongDate": 5, + "DefaultLocaleShortDate": 6, + "DefaultLocaleLongDate": 7, + "RFC2822Date": 8 + } + } + Enum { + name: "TimeSpec" + values: { + "LocalTime": 0, + "UTC": 1, + "OffsetFromUTC": 2, + "TimeZone": 3 + } + } + Enum { + name: "DayOfWeek" + values: { + "Monday": 1, + "Tuesday": 2, + "Wednesday": 3, + "Thursday": 4, + "Friday": 5, + "Saturday": 6, + "Sunday": 7 + } + } + Enum { + name: "ScrollBarPolicy" + values: { + "ScrollBarAsNeeded": 0, + "ScrollBarAlwaysOff": 1, + "ScrollBarAlwaysOn": 2 + } + } + Enum { + name: "CaseSensitivity" + values: { + "CaseInsensitive": 0, + "CaseSensitive": 1 + } + } + Enum { + name: "Corner" + values: { + "TopLeftCorner": 0, + "TopRightCorner": 1, + "BottomLeftCorner": 2, + "BottomRightCorner": 3 + } + } + Enum { + name: "Edge" + values: { + "TopEdge": 1, + "LeftEdge": 2, + "RightEdge": 4, + "BottomEdge": 8 + } + } + Enum { + name: "Edges" + values: { + "TopEdge": 1, + "LeftEdge": 2, + "RightEdge": 4, + "BottomEdge": 8 + } + } + Enum { + name: "ConnectionType" + values: { + "AutoConnection": 0, + "DirectConnection": 1, + "QueuedConnection": 2, + "BlockingQueuedConnection": 3, + "UniqueConnection": 128 + } + } + Enum { + name: "ShortcutContext" + values: { + "WidgetShortcut": 0, + "WindowShortcut": 1, + "ApplicationShortcut": 2, + "WidgetWithChildrenShortcut": 3 + } + } + Enum { + name: "FillRule" + values: { + "OddEvenFill": 0, + "WindingFill": 1 + } + } + Enum { + name: "MaskMode" + values: { + "MaskInColor": 0, + "MaskOutColor": 1 + } + } + Enum { + name: "ClipOperation" + values: { + "NoClip": 0, + "ReplaceClip": 1, + "IntersectClip": 2 + } + } + Enum { + name: "ItemSelectionMode" + values: { + "ContainsItemShape": 0, + "IntersectsItemShape": 1, + "ContainsItemBoundingRect": 2, + "IntersectsItemBoundingRect": 3 + } + } + Enum { + name: "ItemSelectionOperation" + values: { + "ReplaceSelection": 0, + "AddToSelection": 1 + } + } + Enum { + name: "TransformationMode" + values: { + "FastTransformation": 0, + "SmoothTransformation": 1 + } + } + Enum { + name: "Axis" + values: { + "XAxis": 0, + "YAxis": 1, + "ZAxis": 2 + } + } + Enum { + name: "FocusReason" + values: { + "MouseFocusReason": 0, + "TabFocusReason": 1, + "BacktabFocusReason": 2, + "ActiveWindowFocusReason": 3, + "PopupFocusReason": 4, + "ShortcutFocusReason": 5, + "MenuBarFocusReason": 6, + "OtherFocusReason": 7, + "NoFocusReason": 8 + } + } + Enum { + name: "ContextMenuPolicy" + values: { + "NoContextMenu": 0, + "DefaultContextMenu": 1, + "ActionsContextMenu": 2, + "CustomContextMenu": 3, + "PreventContextMenu": 4 + } + } + Enum { + name: "InputMethodQuery" + values: { + "ImEnabled": 1, + "ImCursorRectangle": 2, + "ImMicroFocus": 2, + "ImFont": 4, + "ImCursorPosition": 8, + "ImSurroundingText": 16, + "ImCurrentSelection": 32, + "ImMaximumTextLength": 64, + "ImAnchorPosition": 128, + "ImHints": 256, + "ImPreferredLanguage": 512, + "ImAbsolutePosition": 1024, + "ImTextBeforeCursor": 2048, + "ImTextAfterCursor": 4096, + "ImEnterKeyType": 8192, + "ImPlatformData": -2147483648, + "ImQueryInput": 186, + "ImQueryAll": -1 + } + } + Enum { + name: "InputMethodQueries" + values: { + "ImEnabled": 1, + "ImCursorRectangle": 2, + "ImMicroFocus": 2, + "ImFont": 4, + "ImCursorPosition": 8, + "ImSurroundingText": 16, + "ImCurrentSelection": 32, + "ImMaximumTextLength": 64, + "ImAnchorPosition": 128, + "ImHints": 256, + "ImPreferredLanguage": 512, + "ImAbsolutePosition": 1024, + "ImTextBeforeCursor": 2048, + "ImTextAfterCursor": 4096, + "ImEnterKeyType": 8192, + "ImPlatformData": -2147483648, + "ImQueryInput": 186, + "ImQueryAll": -1 + } + } + Enum { + name: "InputMethodHint" + values: { + "ImhNone": 0, + "ImhHiddenText": 1, + "ImhSensitiveData": 2, + "ImhNoAutoUppercase": 4, + "ImhPreferNumbers": 8, + "ImhPreferUppercase": 16, + "ImhPreferLowercase": 32, + "ImhNoPredictiveText": 64, + "ImhDate": 128, + "ImhTime": 256, + "ImhPreferLatin": 512, + "ImhMultiLine": 1024, + "ImhDigitsOnly": 65536, + "ImhFormattedNumbersOnly": 131072, + "ImhUppercaseOnly": 262144, + "ImhLowercaseOnly": 524288, + "ImhDialableCharactersOnly": 1048576, + "ImhEmailCharactersOnly": 2097152, + "ImhUrlCharactersOnly": 4194304, + "ImhLatinOnly": 8388608, + "ImhExclusiveInputMask": -65536 + } + } + Enum { + name: "InputMethodHints" + values: { + "ImhNone": 0, + "ImhHiddenText": 1, + "ImhSensitiveData": 2, + "ImhNoAutoUppercase": 4, + "ImhPreferNumbers": 8, + "ImhPreferUppercase": 16, + "ImhPreferLowercase": 32, + "ImhNoPredictiveText": 64, + "ImhDate": 128, + "ImhTime": 256, + "ImhPreferLatin": 512, + "ImhMultiLine": 1024, + "ImhDigitsOnly": 65536, + "ImhFormattedNumbersOnly": 131072, + "ImhUppercaseOnly": 262144, + "ImhLowercaseOnly": 524288, + "ImhDialableCharactersOnly": 1048576, + "ImhEmailCharactersOnly": 2097152, + "ImhUrlCharactersOnly": 4194304, + "ImhLatinOnly": 8388608, + "ImhExclusiveInputMask": -65536 + } + } + Enum { + name: "EnterKeyType" + values: { + "EnterKeyDefault": 0, + "EnterKeyReturn": 1, + "EnterKeyDone": 2, + "EnterKeyGo": 3, + "EnterKeySend": 4, + "EnterKeySearch": 5, + "EnterKeyNext": 6, + "EnterKeyPrevious": 7 + } + } + Enum { + name: "ToolButtonStyle" + values: { + "ToolButtonIconOnly": 0, + "ToolButtonTextOnly": 1, + "ToolButtonTextBesideIcon": 2, + "ToolButtonTextUnderIcon": 3, + "ToolButtonFollowStyle": 4 + } + } + Enum { + name: "LayoutDirection" + values: { + "LeftToRight": 0, + "RightToLeft": 1, + "LayoutDirectionAuto": 2 + } + } + Enum { + name: "DropAction" + values: { + "CopyAction": 1, + "MoveAction": 2, + "LinkAction": 4, + "ActionMask": 255, + "TargetMoveAction": 32770, + "IgnoreAction": 0 + } + } + Enum { + name: "DropActions" + values: { + "CopyAction": 1, + "MoveAction": 2, + "LinkAction": 4, + "ActionMask": 255, + "TargetMoveAction": 32770, + "IgnoreAction": 0 + } + } + Enum { + name: "CheckState" + values: { + "Unchecked": 0, + "PartiallyChecked": 1, + "Checked": 2 + } + } + Enum { + name: "ItemDataRole" + values: { + "DisplayRole": 0, + "DecorationRole": 1, + "EditRole": 2, + "ToolTipRole": 3, + "StatusTipRole": 4, + "WhatsThisRole": 5, + "FontRole": 6, + "TextAlignmentRole": 7, + "BackgroundColorRole": 8, + "BackgroundRole": 8, + "TextColorRole": 9, + "ForegroundRole": 9, + "CheckStateRole": 10, + "AccessibleTextRole": 11, + "AccessibleDescriptionRole": 12, + "SizeHintRole": 13, + "InitialSortOrderRole": 14, + "DisplayPropertyRole": 27, + "DecorationPropertyRole": 28, + "ToolTipPropertyRole": 29, + "StatusTipPropertyRole": 30, + "WhatsThisPropertyRole": 31, + "UserRole": 256 + } + } + Enum { + name: "ItemFlags" + values: { + "NoItemFlags": 0, + "ItemIsSelectable": 1, + "ItemIsEditable": 2, + "ItemIsDragEnabled": 4, + "ItemIsDropEnabled": 8, + "ItemIsUserCheckable": 16, + "ItemIsEnabled": 32, + "ItemIsAutoTristate": 64, + "ItemIsTristate": 64, + "ItemNeverHasChildren": 128, + "ItemIsUserTristate": 256 + } + } + Enum { + name: "MatchFlags" + values: { + "MatchExactly": 0, + "MatchContains": 1, + "MatchStartsWith": 2, + "MatchEndsWith": 3, + "MatchRegExp": 4, + "MatchWildcard": 5, + "MatchFixedString": 8, + "MatchCaseSensitive": 16, + "MatchWrap": 32, + "MatchRecursive": 64 + } + } + Enum { + name: "WindowModality" + values: { + "NonModal": 0, + "WindowModal": 1, + "ApplicationModal": 2 + } + } + Enum { + name: "TextInteractionFlag" + values: { + "NoTextInteraction": 0, + "TextSelectableByMouse": 1, + "TextSelectableByKeyboard": 2, + "LinksAccessibleByMouse": 4, + "LinksAccessibleByKeyboard": 8, + "TextEditable": 16, + "TextEditorInteraction": 19, + "TextBrowserInteraction": 13 + } + } + Enum { + name: "TextInteractionFlags" + values: { + "NoTextInteraction": 0, + "TextSelectableByMouse": 1, + "TextSelectableByKeyboard": 2, + "LinksAccessibleByMouse": 4, + "LinksAccessibleByKeyboard": 8, + "TextEditable": 16, + "TextEditorInteraction": 19, + "TextBrowserInteraction": 13 + } + } + Enum { + name: "SizeHint" + values: { + "MinimumSize": 0, + "PreferredSize": 1, + "MaximumSize": 2, + "MinimumDescent": 3, + "NSizeHints": 4 + } + } + Enum { + name: "TouchPointStates" + values: { + "TouchPointPressed": 1, + "TouchPointMoved": 2, + "TouchPointStationary": 4, + "TouchPointReleased": 8 + } + } + Enum { + name: "GestureState" + values: { + "NoGesture": 0, + "GestureStarted": 1, + "GestureUpdated": 2, + "GestureFinished": 3, + "GestureCanceled": 4 + } + } + Enum { + name: "GestureType" + values: { + "TapGesture": 1, + "TapAndHoldGesture": 2, + "PanGesture": 3, + "PinchGesture": 4, + "SwipeGesture": 5, + "CustomGesture": 256, + "LastGestureType": -1 + } + } + Enum { + name: "NativeGestureType" + values: { + "BeginNativeGesture": 0, + "EndNativeGesture": 1, + "PanNativeGesture": 2, + "ZoomNativeGesture": 3, + "SmartZoomNativeGesture": 4, + "RotateNativeGesture": 5, + "SwipeNativeGesture": 6 + } + } + Enum { + name: "CursorMoveStyle" + values: { + "LogicalMoveStyle": 0, + "VisualMoveStyle": 1 + } + } + Enum { + name: "TimerType" + values: { + "PreciseTimer": 0, + "CoarseTimer": 1, + "VeryCoarseTimer": 2 + } + } + Enum { + name: "ScrollPhase" + values: { + "ScrollBegin": 1, + "ScrollUpdate": 2, + "ScrollEnd": 3 + } + } + Enum { + name: "MouseEventSource" + values: { + "MouseEventNotSynthesized": 0, + "MouseEventSynthesizedBySystem": 1, + "MouseEventSynthesizedByQt": 2, + "MouseEventSynthesizedByApplication": 3 + } + } + Enum { + name: "MouseEventFlag" + values: { + "MouseEventCreatedDoubleClick": 1, + "MouseEventFlagMask": 255 + } + } + } + Component { name: "QEasingCurve"; prototype: "QQmlEasingValueType" } +} diff --git a/src/imports/imports.pro b/src/imports/imports.pro index d0d47aa38c..f7002f9ed5 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,6 +1,7 @@ TEMPLATE = subdirs SUBDIRS += \ + qtqml \ folderlistmodel \ localstorage \ models \ @@ -16,3 +17,35 @@ qtHaveModule(quick) { } qtHaveModule(xmlpatterns) : SUBDIRS += xmllistmodel + + +QMLTYPEFILE = builtins.qmltypes + +# install rule +builtins.files = $$QMLTYPEFILE +builtins.path = $$[QT_INSTALL_QML] +INSTALLS += builtins + +# copy to build directory +!force_independent:if(!debug_and_release|!build_all|CONFIG(release, debug|release)) { + defineReplace(qmlModStripSrcDir) { + return($$relative_path($$1, $$_PRO_FILE_PWD_)) + } + + qmltypes2build.input = QMLTYPEFILE + qmltypes2build.output = $$[QT_INSTALL_QML]/${QMAKE_FUNC_FILE_IN_qmlModStripSrcDir} + !contains(TEMPLATE, vc.*): qmltypes2build.variable_out = PRE_TARGETDEPS + qmltypes2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + qmltypes2build.name = COPY ${QMAKE_FILE_IN} + qmltypes2build.CONFIG = no_link no_clean + + QMAKE_EXTRA_COMPILERS += qmltypes2build +} + +# qmltypes target +!cross_compile:if(build_pass|!debug_and_release) { + qtPrepareTool(QMLPLUGINDUMP, qmlplugindump) + + qmltypes.commands = $$QMLPLUGINDUMP -builtins > $$PWD/$$QMLTYPEFILE + QMAKE_EXTRA_TARGETS += qmltypes +} diff --git a/src/imports/qtqml/plugins.qmltypes b/src/imports/qtqml/plugins.qmltypes new file mode 100644 index 0000000000..864aca1f32 --- /dev/null +++ b/src/imports/qtqml/plugins.qmltypes @@ -0,0 +1,222 @@ +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 -nonrelocatable QtQml 2.2' + +Module { + dependencies: [] + Component { + name: "QObject" + exports: ["QtQml/QtObject 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "objectName"; type: "string" } + Signal { + name: "objectNameChanged" + Parameter { name: "objectName"; type: "string" } + } + Method { name: "toString" } + Method { name: "destroy" } + Method { + name: "destroy" + Parameter { name: "delay"; type: "int" } + } + } + Component { + name: "QQmlBind" + prototype: "QObject" + exports: ["QtQml/Binding 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "target"; type: "QObject"; isPointer: true } + Property { name: "property"; type: "string" } + Property { name: "value"; type: "QVariant" } + Property { name: "when"; type: "bool" } + } + Component { + name: "QQmlComponent" + prototype: "QObject" + exports: ["QML/Component 1.0", "QtQml/Component 2.0"] + exportMetaObjectRevisions: [0, 0] + attachedType: "QQmlComponentAttached" + Enum { + name: "CompilationMode" + values: { + "PreferSynchronous": 0, + "Asynchronous": 1 + } + } + Enum { + name: "Status" + values: { + "Null": 0, + "Ready": 1, + "Loading": 2, + "Error": 3 + } + } + Property { name: "progress"; type: "double"; isReadonly: true } + Property { name: "status"; type: "Status"; isReadonly: true } + Property { name: "url"; type: "QUrl"; isReadonly: true } + Signal { + name: "statusChanged" + Parameter { type: "QQmlComponent::Status" } + } + Signal { + name: "progressChanged" + Parameter { type: "double" } + } + Method { + name: "loadUrl" + Parameter { name: "url"; type: "QUrl" } + } + Method { + name: "loadUrl" + Parameter { name: "url"; type: "QUrl" } + Parameter { name: "mode"; type: "CompilationMode" } + } + Method { + name: "setData" + Parameter { type: "QByteArray" } + Parameter { name: "baseUrl"; type: "QUrl" } + } + Method { name: "errorString"; type: "string" } + } + Component { + name: "QQmlComponentAttached" + prototype: "QObject" + Signal { name: "completed" } + Signal { name: "destruction" } + } + Component { + name: "QQmlConnections" + prototype: "QObject" + exports: ["QtQml/Connections 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "target"; type: "QObject"; isPointer: true } + Property { name: "ignoreUnknownSignals"; type: "bool" } + } + Component { + name: "QQmlInstanceModel" + prototype: "QObject" + Property { name: "count"; type: "int"; isReadonly: true } + Signal { + name: "modelUpdated" + Parameter { name: "changeSet"; type: "QQmlChangeSet" } + Parameter { name: "reset"; type: "bool" } + } + Signal { + name: "createdItem" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "initItem" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "destroyingItem" + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + } + Component { + name: "QQmlInstantiator" + defaultProperty: "delegate" + prototype: "QObject" + exports: ["QtQml/Instantiator 2.1"] + exportMetaObjectRevisions: [0] + Property { name: "active"; type: "bool" } + Property { name: "asynchronous"; type: "bool" } + Property { name: "model"; type: "QVariant" } + Property { name: "count"; type: "int"; isReadonly: true } + Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + Property { name: "object"; type: "QObject"; isReadonly: true; isPointer: true } + Signal { + name: "objectAdded" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Signal { + name: "objectRemoved" + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Method { + name: "objectAt" + type: "QObject*" + Parameter { name: "index"; type: "int" } + } + } + Component { + name: "QQmlLocale" + exports: ["QtQml/Locale 2.2"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "MeasurementSystem" + values: { + "MetricSystem": 0, + "ImperialSystem": 1, + "ImperialUSSystem": 1, + "ImperialUKSystem": 2 + } + } + Enum { + name: "FormatType" + values: { + "LongFormat": 0, + "ShortFormat": 1, + "NarrowFormat": 2 + } + } + Enum { + name: "CurrencySymbolFormat" + values: { + "CurrencyIsoCode": 0, + "CurrencySymbol": 1, + "CurrencyDisplayName": 2 + } + } + Enum { + name: "DayOfWeek" + values: { + "Sunday": 0, + "Monday": 1, + "Tuesday": 2, + "Wednesday": 3, + "Thursday": 4, + "Friday": 5, + "Saturday": 6 + } + } + } + Component { + name: "QQmlTimer" + prototype: "QObject" + exports: ["QtQml/Timer 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "interval"; type: "int" } + Property { name: "running"; type: "bool" } + Property { name: "repeat"; type: "bool" } + Property { name: "triggeredOnStart"; type: "bool" } + Property { name: "parent"; type: "QObject"; isReadonly: true; isPointer: true } + Signal { name: "triggered" } + Method { name: "start" } + Method { name: "stop" } + Method { name: "restart" } + } + Component { + name: "QQuickMouseEvent" + prototype: "QObject" + Property { name: "x"; type: "double"; isReadonly: true } + Property { name: "y"; type: "double"; isReadonly: true } + Property { name: "button"; type: "int"; isReadonly: true } + Property { name: "buttons"; type: "int"; isReadonly: true } + Property { name: "modifiers"; type: "int"; isReadonly: true } + Property { name: "wasHeld"; type: "bool"; isReadonly: true } + Property { name: "isClick"; type: "bool"; isReadonly: true } + Property { name: "accepted"; type: "bool" } + } +} diff --git a/src/imports/qtqml/qmldir b/src/imports/qtqml/qmldir new file mode 100644 index 0000000000..8175ebb1a1 --- /dev/null +++ b/src/imports/qtqml/qmldir @@ -0,0 +1,2 @@ +module QtQml +typeinfo plugins.qmltypes diff --git a/src/imports/qtqml/qtqml.pro b/src/imports/qtqml/qtqml.pro new file mode 100644 index 0000000000..05ef15a542 --- /dev/null +++ b/src/imports/qtqml/qtqml.pro @@ -0,0 +1,14 @@ +TARGETPATH = QtQml +QML_FILES += plugins.qmltypes + +load(qml_module) + +# qmltypes target +!cross_compile:if(build_pass|!debug_and_release) { + qtPrepareTool(QMLPLUGINDUMP, qmlplugindump) + + # Use QtQml version defined in qmlplugindump source + # TODO: retrieve the correct version from QtQml + qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable QtQml 2.2 > $$PWD/plugins.qmltypes + QMAKE_EXTRA_TARGETS += qmltypes +} diff --git a/src/particles/qquickturbulence.cpp b/src/particles/qquickturbulence.cpp index 11bae1107b..8d5846710a 100644 --- a/src/particles/qquickturbulence.cpp +++ b/src/particles/qquickturbulence.cpp @@ -36,6 +36,7 @@ #include <cmath> #include <cstdlib> #include <QDebug> +#include <QQmlFile> QT_BEGIN_NAMESPACE /*! @@ -108,7 +109,6 @@ void QQuickTurbulenceAffector::initializeGrid() for (int i=0; i<m_gridSize; i++) free(m_field[i]); free(m_field); - m_system = 0; } if (m_vectorField) { for (int i=0; i<m_gridSize; i++) @@ -127,17 +127,17 @@ void QQuickTurbulenceAffector::initializeGrid() QImage image; if (!m_noiseSource.isEmpty()) - image = QImage(m_noiseSource.toLocalFile()).scaled(QSize(m_gridSize, m_gridSize)); + image = QImage(QQmlFile::urlToLocalFileOrQrc(m_noiseSource)).scaled(QSize(m_gridSize, m_gridSize)); if (image.isNull()) image = QImage(QStringLiteral(":particleresources/noise.png")).scaled(QSize(m_gridSize, m_gridSize)); for (int i=0; i<m_gridSize; i++) for (int j=0; j<m_gridSize; j++) - m_field[i][j] = qRed(image.pixel(QPoint(i,j)));//Red as proxy for Value + m_field[i][j] = qGray(image.pixel(QPoint(i,j))); for (int i=0; i<m_gridSize; i++){ for (int j=0; j<m_gridSize; j++){ - m_vectorField[i][j].setX(boundsRespectingField(i,j) - boundsRespectingField(i,j-1)); - m_vectorField[i][j].setY(boundsRespectingField(i-1,j) - boundsRespectingField(i,j)); + m_vectorField[i][j].setX(boundsRespectingField(i-1,j) - boundsRespectingField(i,j)); + m_vectorField[i][j].setY(boundsRespectingField(i,j) - boundsRespectingField(i,j-1)); } } } diff --git a/src/qml/jsruntime/qv4persistent.cpp b/src/qml/jsruntime/qv4persistent.cpp index 4a0f84b685..032ad0d00a 100644 --- a/src/qml/jsruntime/qv4persistent.cpp +++ b/src/qml/jsruntime/qv4persistent.cpp @@ -34,6 +34,7 @@ #include "qv4persistent_p.h" #include <private/qv4mm_p.h> #include "qv4object_p.h" +#include "qv4qobjectwrapper_p.h" #include "PageAllocation.h" using namespace QV4; @@ -204,6 +205,12 @@ void PersistentValueStorage::free(Value *v) Page *p = getPage(v); + // Keep track of QObjectWrapper to release its resources later in MemoryManager::sweep() + if (p->header.engine) { + if (QObjectWrapper *qobjectWrapper = v->as<QObjectWrapper>()) + p->header.engine->memoryManager->m_pendingDestroyedObjectWrappers.push_back(qobjectWrapper->d()); + } + v->setTag(QV4::Value::Empty_Type); v->setInt_32(p->header.freeList); p->header.freeList = v - p->values; diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index ee294b3678..594df67f44 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1019,6 +1019,11 @@ void QObjectWrapper::markObjects(Heap::Base *that, QV4::ExecutionEngine *e) void QObjectWrapper::destroyObject(bool lastCall) { Heap::QObjectWrapper *h = d(); + destroyObject(h, lastCall); +} + +void QObjectWrapper::destroyObject(Heap::QObjectWrapper *h, bool lastCall) +{ if (!h->internalClass) return; // destroyObject already got called diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index 1126013806..29e1263f2d 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -120,6 +120,7 @@ struct Q_QML_EXPORT QObjectWrapper : public Object void setProperty(ExecutionEngine *engine, int propertyIndex, const Value &value); void destroyObject(bool lastCall); + static void destroyObject(Heap::QObjectWrapper *h, bool lastCall); protected: static bool isEqualTo(Managed *that, Managed *o); diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 5181bf912b..053dfb856c 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -41,8 +41,6 @@ #include "StdLibExtras.h" #include <QTime> -#include <QVector> -#include <QVector> #include <QMap> #include <iostream> @@ -437,6 +435,15 @@ void MemoryManager::sweep(bool lastSweep) (*it) = Primitive::undefinedValue(); } + // Some QV4::QObjectWrapper objects will be removed from PersistentValueStorage in WeakValue::~WeakValue() + // before MemoryManager::sweep() is being called, in this case we will never have a chance to call detroyObject() + // on those QV4::QObjectWrapper objects. Here we call detroyObject() for each pending destroyed Heap::QObjectWrapper + // object on the heap to make sure that we can release all the resources held by them + for (QVector<Heap::QObjectWrapper *>::const_iterator it = m_pendingDestroyedObjectWrappers.constBegin(); + it != m_pendingDestroyedObjectWrappers.constEnd(); ++it) + QObjectWrapper::destroyObject(*it, lastSweep); + m_pendingDestroyedObjectWrappers.clear(); + if (MultiplyWrappedQObjectMap *multiplyWrappedQObjects = engine->m_multiplyWrappedQObjects) { for (MultiplyWrappedQObjectMap::Iterator it = multiplyWrappedQObjects->begin(); it != multiplyWrappedQObjects->end();) { if (!it.value().isNullOrUndefined()) diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index 3543da0907..69aae1c5bf 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -49,6 +49,7 @@ #include <private/qv4value_p.h> #include <private/qv4scopedvalue_p.h> #include <private/qv4object_p.h> +#include <QVector> //#define DETAILED_MM_STATS @@ -327,6 +328,7 @@ public: QScopedPointer<Data> m_d; PersistentValueStorage *m_persistentValues; PersistentValueStorage *m_weakValues; + QVector<Heap::QObjectWrapper *> m_pendingDestroyedObjectWrappers; }; } diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index de1e8722fe..fcd05bfb1b 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -125,7 +125,9 @@ bool isPathAbsolute(const QString &path) } // If the type does not already exist as a file import, add the type and return the new type -QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeName, bool isCompositeSingleton, QList<QQmlError> *errors) +QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeName, + bool isCompositeSingleton, QList<QQmlError> *errors, + int majorVersion=-1, int minorVersion=-1) { QUrl url(urlString); QQmlType *ret = QQmlMetaType::qmlType(url); @@ -140,8 +142,8 @@ QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeNa QQmlPrivate::RegisterCompositeSingletonType reg = { url, "", //Empty URI indicates loaded via file imports - -1, - -1, + majorVersion, + minorVersion, buf.constData() }; ret = QQmlMetaType::qmlTypeFromIndex(QQmlPrivate::qmlregister(QQmlPrivate::CompositeSingletonRegistration, ®)); @@ -149,8 +151,8 @@ QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeNa QQmlPrivate::RegisterCompositeType reg = { url, "", //Empty URI indicates loaded via file imports - -1, - -1, + majorVersion, + minorVersion, buf.constData() }; ret = QQmlMetaType::qmlTypeFromIndex(QQmlPrivate::qmlregister(QQmlPrivate::CompositeRegistration, ®)); @@ -416,6 +418,8 @@ void findCompositeSingletons(const QQmlImportNamespace &set, QList<QQmlImports:: QQmlImports::CompositeSingletonReference ref; ref.typeName = cit->typeName; ref.prefix = set.prefix; + ref.majorVersion = cit->majorVersion; + ref.minorVersion = cit->minorVersion; resultList.append(ref); } } @@ -656,7 +660,10 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader, } if (candidate != end) { - QQmlType *returnType = getTypeForUrl(componentUrl, type, isCompositeSingleton, 0); + int major = vmajor ? *vmajor : -1; + int minor = vminor ? *vminor : -1; + QQmlType *returnType = getTypeForUrl(componentUrl, type, isCompositeSingleton, 0, + major, minor); if (type_return) *type_return = returnType; return returnType != 0; diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h index bda87f29b1..951b9752f3 100644 --- a/src/qml/qml/qqmlimport_p.h +++ b/src/qml/qml/qqmlimport_p.h @@ -118,6 +118,8 @@ public: { QString typeName; QString prefix; + int majorVersion; + int minorVersion; }; QList<CompositeSingletonReference> resolvedCompositeSingletons() const; diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index e96e03115a..98c4341e06 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -2320,8 +2320,8 @@ void QQmlTypeData::resolveTypes() m_namespaces.insert(csRef.prefix); } - int majorVersion = -1; - int minorVersion = -1; + int majorVersion = csRef.majorVersion > -1 ? csRef.majorVersion : -1; + int minorVersion = csRef.minorVersion > -1 ? csRef.minorVersion : -1; if (!resolveType(typeName, majorVersion, minorVersion, ref)) return; diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index a4c0f7043f..4b0aa47c63 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -2277,6 +2277,9 @@ QQmlV4Handle QQmlListModel::get(int index) const } else { QObject *object = m_listModel->getOrCreateModelObject(const_cast<QQmlListModel *>(this), index); result = scope.engine->memoryManager->allocObject<QV4::ModelObject>(object, const_cast<QQmlListModel *>(this), index); + // Keep track of the QObjectWrapper in persistent value storage + QV4::Value *val = scope.engine->memoryManager->m_weakValues->allocate(); + *val = result; } } diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index 2612b855bd..279f5e5299 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -135,6 +135,7 @@ public: \l {supportedActions}{drop action} chosen by the recipient of the event, otherwise it will return Qt.IgnoreAction. + \sa {Qt Quick Examples - Drag and Drop}, {Qt Quick Examples - externaldraganddrop} */ void QQuickDragAttachedPrivate::itemGeometryChanged(QQuickItem *, const QRectF &newGeometry, const QRectF &oldGeometry) diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp index e46d546a16..b582433800 100644 --- a/src/quick/items/qquickdroparea.cpp +++ b/src/quick/items/qquickdroparea.cpp @@ -102,6 +102,8 @@ QQuickDropAreaPrivate::~QQuickDropAreaPrivate() The \l drag.source property is communicated to the source of a drag event as the recipient of a drop on the drag target. + + \sa {Qt Quick Examples - Drag and Drop}, {Qt Quick Examples - externaldraganddrop} */ QQuickDropArea::QQuickDropArea(QQuickItem *parent) diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 9d6c51f37a..092d4afdd9 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -344,10 +344,12 @@ bool QQuickFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExt accel = v2 / (2.0f * qAbs(dist)); resetTimeline(data); - if (boundsBehavior & QQuickFlickable::OvershootBounds) - timeline.accel(data.move, v, accel); - else - timeline.accel(data.move, v, accel, maxDistance); + if (!data.inOvershoot) { + if (boundsBehavior & QQuickFlickable::OvershootBounds) + timeline.accel(data.move, v, accel); + else + timeline.accel(data.move, v, accel, maxDistance); + } timeline.callback(QQuickTimeLineCallback(&data.move, fixupCallback, this)); if (&data == &hData) diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index 073fe58e7b..47952d86bd 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -36,6 +36,7 @@ #include <QtGui/qguiapplication.h> #include <QtGui/qscreen.h> +#include <QtGui/qicon.h> #include <QtQml/qqmlinfo.h> #include <QtQml/qqmlfile.h> @@ -338,20 +339,6 @@ void QQuickImageBase::pixmapChange() setImplicitSize(d->pix.width() / d->devicePixelRatio, d->pix.height() / d->devicePixelRatio); } -// /path/to/foo.png -> path/too/foo@2x.png -static QString image2xPath(const QString &path) -{ - const int dotIndex = path.lastIndexOf(QLatin1Char('.')); - if (dotIndex == -1) - return path + QLatin1String("@2x"); - if (path.contains(QLatin1String("@2x."))) - return path; - - QString retinaPath = path; - retinaPath.insert(dotIndex, QStringLiteral("@2x")); - return retinaPath; -} - void QQuickImageBase::resolve2xLocalFile(const QUrl &url, qreal targetDevicePixelRatio, QUrl *sourceUrl, qreal *sourceDevicePixelRatio) { Q_ASSERT(sourceUrl); @@ -369,23 +356,20 @@ void QQuickImageBase::resolve2xLocalFile(const QUrl &url, qreal targetDevicePixe return; // Special case: the url in the QML source refers directly to an "@2x" file. - if (localFile.contains(QLatin1String("@2x"))) { - *sourceDevicePixelRatio = qreal(2.0); - return; + int atLocation = localFile.lastIndexOf(QLatin1Char('@')); + if (atLocation > 0 && atLocation + 3 < localFile.size()) { + if (localFile[atLocation + 1].isDigit() + && localFile[atLocation + 2] == QLatin1Char('x') + && localFile[atLocation + 3] == QLatin1Char('.')) { + *sourceDevicePixelRatio = localFile[atLocation + 1].digitValue(); + return; + } } - // Don't load @2x files non normal-dpi displays. - if (!(targetDevicePixelRatio > qreal(1.0))) - return; - // Look for an @2x version - QString localFile2x = image2xPath(localFile); - if (!QFile::exists(localFile2x)) - return; - - // @2x file found found: Change url and devicePixelRatio - *sourceUrl = QUrl::fromLocalFile(localFile2x); - *sourceDevicePixelRatio = qreal(2.0); + QString localFileX = qt_findAtNxFile(localFile, targetDevicePixelRatio, sourceDevicePixelRatio); + if (localFileX != localFile) + *sourceUrl = QUrl::fromLocalFile(localFileX); } bool QQuickImageBase::autoTransform() const diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index 3b6407a9f5..2b3da20b34 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE -class FxViewItem +class Q_AUTOTEST_EXPORT FxViewItem { public: FxViewItem(QQuickItem *, QQuickItemView *, bool own, QQuickItemViewAttached *attached); @@ -123,7 +123,7 @@ public: }; -class QQuickItemViewPrivate : public QQuickFlickablePrivate, public QQuickItemViewTransitionChangeListener, public QAnimationJobChangeListener +class Q_AUTOTEST_EXPORT QQuickItemViewPrivate : public QQuickFlickablePrivate, public QQuickItemViewTransitionChangeListener, public QAnimationJobChangeListener { Q_DECLARE_PUBLIC(QQuickItemView) public: diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 59ecc0b893..80e4a431a1 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -3146,12 +3146,13 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch int i = 0; qreal from = tempPos - displayMarginBeginning - buffer; - for (i = count-1; i >= 0; --i) { - if (pos > from && insertionIdx < visibleIndex) { - // item won't be visible, just note the size for repositioning - insertResult->sizeChangesBeforeVisiblePos += averageSize + spacing; - pos -= averageSize + spacing; - } else { + if (insertionIdx < visibleIndex) { + if (pos >= from) { + // items won't be visible, just note the size for repositioning + insertResult->sizeChangesBeforeVisiblePos += count * (averageSize + spacing); + } + } else { + for (i = count-1; i >= 0 && pos >= from; --i) { // item is before first visible e.g. in cache buffer FxViewItem *item = 0; if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i)))) @@ -3166,17 +3167,33 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch insertResult->changedFirstItem = true; if (!change.isMove()) { addedItems->append(item); - item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true); + if (transitioner) + item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true); + else + static_cast<FxListItemSG *>(item)->setPosition(pos, true); } insertResult->sizeChangesBeforeVisiblePos += item->size() + spacing; pos -= item->size() + spacing; + index++; + } + } + + int firstOkIdx = -1; + for (int i = 0; i <= insertionIdx && i < visibleItems.count() - 1; i++) { + if (visibleItems.at(i)->index + 1 != visibleItems.at(i + 1)->index) { + firstOkIdx = i + 1; + break; } - index++; } + for (int i = 0; i < firstOkIdx; i++) { + FxViewItem *nvItem = visibleItems.takeFirst(); + addedItems->removeOne(nvItem); + removeItem(nvItem); + } + } else { - int i = 0; qreal to = buffer + displayMarginEnd + tempPos + size(); - for (i = 0; i < count && pos <= to; ++i) { + for (int i = 0; i < count && pos <= to; ++i) { FxViewItem *item = 0; if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i)))) item->index = modelIndex + i; @@ -3196,12 +3213,32 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch movingIntoView->append(MovedItem(item, change.moveKey(item->index))); } else { addedItems->append(item); - item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true); + if (transitioner) + item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::AddTransition, true); + else + static_cast<FxListItemSG *>(item)->setPosition(pos, true); } insertResult->sizeChangesAfterVisiblePos += item->size() + spacing; pos += item->size() + spacing; ++index; } + + if (0 < index && index < visibleItems.count()) { + FxViewItem *prevItem = visibleItems.at(index - 1); + FxViewItem *item = visibleItems.at(index); + if (prevItem->index != item->index - 1) { + int i = index; + qreal prevPos = prevItem->position(); + while (i < visibleItems.count()) { + FxListItemSG *nvItem = static_cast<FxListItemSG *>(visibleItems.takeLast()); + insertResult->sizeChangesAfterVisiblePos -= nvItem->size() + spacing; + addedItems->removeOne(nvItem); + if (nvItem->transitionScheduledOrRunning()) + nvItem->setPosition(prevPos + (nvItem->index - prevItem->index) * averageSize); + removeItem(nvItem); + } + } + } } updateVisibleIndex(); diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp index 4172b83419..c9b5d34cc9 100644 --- a/src/quick/items/qquickpainteditem.cpp +++ b/src/quick/items/qquickpainteditem.cpp @@ -483,7 +483,7 @@ void QQuickPaintedItem::setFillColor(const QColor &c) \brief The item's render target. This property defines which render target the QPainter renders into, it can be either - QSGPaintedItem::Image, QSGPaintedItem::FramebufferObject or QSGPaintedItem::InvertedYFramebufferObject. + QQuickPaintedItem::Image, QQuickPaintedItem::FramebufferObject or QQuickPaintedItem::InvertedYFramebufferObject. Each has certain benefits, typically performance versus quality. Using a framebuffer object avoids a costly upload of the image contents to the texture in graphics memory, diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index cc4cec443a..d00b02c005 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -129,11 +129,6 @@ QQuickRenderControlPrivate::QQuickRenderControlPrivate() rc = new QSGRenderContext(sg); } -QQuickRenderControlPrivate::~QQuickRenderControlPrivate() -{ - delete rc; -} - void QQuickRenderControlPrivate::cleanup() { delete sg; @@ -162,13 +157,25 @@ QQuickRenderControl::~QQuickRenderControl() if (d->window) QQuickWindowPrivate::get(d->window)->renderControl = 0; + + // It is likely that the cleanup in windowDestroyed() is not called since + // the standard pattern is to destroy the rendercontrol before the QQuickWindow. + // Do it here. + d->windowDestroyed(); + + delete d->rc; } void QQuickRenderControlPrivate::windowDestroyed() { - if (window == 0) { + if (window) { rc->invalidate(); QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); + + delete QQuickWindowPrivate::get(window)->animationController; + QQuickWindowPrivate::get(window)->animationController = 0; + + window = 0; } } diff --git a/src/quick/items/qquickrendercontrol_p.h b/src/quick/items/qquickrendercontrol_p.h index 8837ed79dc..6fe475bb93 100644 --- a/src/quick/items/qquickrendercontrol_p.h +++ b/src/quick/items/qquickrendercontrol_p.h @@ -56,7 +56,6 @@ public: Q_DECLARE_PUBLIC(QQuickRenderControl) QQuickRenderControlPrivate(); - ~QQuickRenderControlPrivate(); static QQuickRenderControlPrivate *get(QQuickRenderControl *renderControl) { return renderControl->d_func(); diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h index f8b7100cfa..de72071319 100644 --- a/src/quick/items/qquicktextedit_p.h +++ b/src/quick/items/qquicktextedit_p.h @@ -295,11 +295,11 @@ Q_SIGNALS: void selectionColorChanged(const QColor &color); void selectedTextColorChanged(const QColor &color); void fontChanged(const QFont &font); - void horizontalAlignmentChanged(HAlignment alignment); - void verticalAlignmentChanged(VAlignment alignment); + void horizontalAlignmentChanged(QQuickTextEdit::HAlignment alignment); + void verticalAlignmentChanged(QQuickTextEdit::VAlignment alignment); void wrapModeChanged(); void lineCountChanged(); - void textFormatChanged(TextFormat textFormat); + void textFormatChanged(QQuickTextEdit::TextFormat textFormat); void readOnlyChanged(bool isReadOnly); void cursorVisibleChanged(bool isCursorVisible); void cursorDelegateChanged(); @@ -308,7 +308,7 @@ Q_SIGNALS: void textMarginChanged(qreal textMargin); Q_REVISION(1) void selectByKeyboardChanged(bool selectByKeyboard); void selectByMouseChanged(bool selectByMouse); - void mouseSelectionModeChanged(SelectionMode mode); + void mouseSelectionModeChanged(QQuickTextEdit::SelectionMode mode); void linkActivated(const QString &link); Q_REVISION(2) void linkHovered(const QString &link); void canPasteChanged(); diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 2ba802a19e..8d86dfc96e 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -632,6 +632,15 @@ bool QQuickWindowPrivate::translateTouchToMouse(QQuickItem *item, QTouchEvent *e if (mouseGrabberItem) { QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseButtonRelease, p, event, mouseGrabberItem, false)); QCoreApplication::sendEvent(item, me.data()); + + if (item->acceptHoverEvents() && p.screenPos() != QGuiApplicationPrivate::lastCursorPosition) { + QPointF localMousePos(qInf(), qInf()); + if (QWindow *w = item->window()) + localMousePos = item->mapFromScene(w->mapFromGlobal(QGuiApplicationPrivate::lastCursorPosition.toPoint())); + QMouseEvent mm(QEvent::MouseMove, localMousePos, QGuiApplicationPrivate::lastCursorPosition, + Qt::NoButton, Qt::NoButton, event->modifiers()); + QCoreApplication::sendEvent(item, &mm); + } if (mouseGrabberItem) // might have ungrabbed due to event mouseGrabberItem->ungrabMouse(); return me->isAccepted(); diff --git a/src/quick/scenegraph/shaders/rendernode_core.frag b/src/quick/scenegraph/shaders/rendernode_core.frag index 7c187265df..b29301b058 100644 --- a/src/quick/scenegraph/shaders/rendernode_core.frag +++ b/src/quick/scenegraph/shaders/rendernode_core.frag @@ -4,9 +4,9 @@ uniform sampler2D tex; in vec2 t; -out vec4 color; +out vec4 fragColor; void main() { fragColor = texture(tex, t); -}
\ No newline at end of file +} diff --git a/src/quick/scenegraph/shaders/styledtext_core.frag b/src/quick/scenegraph/shaders/styledtext_core.frag index 50f64c64a2..5480e95a42 100644 --- a/src/quick/scenegraph/shaders/styledtext_core.frag +++ b/src/quick/scenegraph/shaders/styledtext_core.frag @@ -3,7 +3,7 @@ in vec2 sampleCoord; in vec2 shiftedSampleCoord; -out vec4 color; +out vec4 fragColor; uniform sampler2D _qt_texture; uniform vec4 color; @@ -11,8 +11,8 @@ uniform vec4 styleColor; void main() { - float glyph = texture(_qt_texture, sampleCoord).a; + float glyph = texture(_qt_texture, sampleCoord).r; float style = clamp(texture(_qt_texture, shiftedSampleCoord).r - glyph, 0.0, 1.0); fragColor = style * styleColor + glyph * color; -}
\ No newline at end of file +} diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index 1d0dbf64b3..22bfd7aef1 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -178,14 +178,22 @@ void QQuickAbstractAnimationPrivate::commence() } } -QQmlProperty QQuickAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj) +QQmlProperty QQuickAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj, QString *errorMessage) { QQmlProperty prop(obj, str, qmlContext(infoObj)); if (!prop.isValid()) { - qmlInfo(infoObj) << QQuickAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str); + const QString message = QQuickAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str); + if (errorMessage) + *errorMessage = message; + else + qmlInfo(infoObj) << message; return QQmlProperty(); } else if (!prop.isWritable()) { - qmlInfo(infoObj) << QQuickAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str); + const QString message = QQuickAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str); + if (errorMessage) + *errorMessage = message; + else + qmlInfo(infoObj) << message; return QQmlProperty(); } return prop; @@ -2584,18 +2592,28 @@ QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateA if (defaultTarget && targets.isEmpty()) targets << defaultTarget; + bool usingDefaultProperties = false; if (props.isEmpty() && !d->defaultProperties.isEmpty()) { props << d->defaultProperties.split(QLatin1Char(',')); + usingDefaultProperties = true; } bool hasExplicit = false; //an explicit animation has been specified if (d->toIsDefined) { + QVector<QString> errorMessages; + bool successfullyCreatedDefaultProperty = false; + for (int i = 0; i < props.count(); ++i) { for (int j = 0; j < targets.count(); ++j) { QQuickStateAction myAction; - myAction.property = d->createProperty(targets.at(j), props.at(i), this); + QString errorMessage; + const QString propertyName = props.at(i); + myAction.property = d->createProperty(targets.at(j), propertyName, this, &errorMessage); if (myAction.property.isValid()) { + if (usingDefaultProperties) + successfullyCreatedDefaultProperty = true; + if (d->fromIsDefined) { myAction.fromValue = d->from; d->convertVariant(myAction.fromValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()); @@ -2612,9 +2630,16 @@ QQuickStateActions QQuickPropertyAnimation::createTransitionActions(QQuickStateA break; //### any chance there could be multiples? } } + } else { + errorMessages.append(errorMessage); } } } + + if (!successfullyCreatedDefaultProperty) { + foreach (const QString &errorMessage, errorMessages) + qmlInfo(this) << errorMessage; + } } if (!hasExplicit) diff --git a/src/quick/util/qquickanimation_p_p.h b/src/quick/util/qquickanimation_p_p.h index b40e198cc1..a5960f5696 100644 --- a/src/quick/util/qquickanimation_p_p.h +++ b/src/quick/util/qquickanimation_p_p.h @@ -193,7 +193,7 @@ public: QQuickAnimationGroup *group; QAbstractAnimationJob* animationInstance; - static QQmlProperty createProperty(QObject *obj, const QString &str, QObject *infoObj); + static QQmlProperty createProperty(QObject *obj, const QString &str, QObject *infoObj, QString *errorMessage = Q_NULLPTR); }; class QQuickPauseAnimationPrivate : public QQuickAbstractAnimationPrivate diff --git a/src/quick/util/qquickanimatorcontroller.cpp b/src/quick/util/qquickanimatorcontroller.cpp index cfb6037d14..74930fb373 100644 --- a/src/quick/util/qquickanimatorcontroller.cpp +++ b/src/quick/util/qquickanimatorcontroller.cpp @@ -140,6 +140,11 @@ static void qquick_initialize_helper(QAbstractAnimationJob *job, QQuickAnimatorC { if (job->isRenderThreadJob()) { QQuickAnimatorJob *j = static_cast<QQuickAnimatorJob *>(job); + // Note: since a QQuickAnimatorJob::m_target is a QPointer, + // if m_target is destroyed between the time it was set + // as the target of the animator job and before this step, + // (e.g a Loader being set inactive just after starting the animator) + // we are sure it will be NULL and won't be dangling around if (!j->target()) { return; } else if (c->m_deletedSinceLastFrame.contains(j->target())) { diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h index 82c9da1d2e..35057d6278 100644 --- a/src/quick/util/qquickanimatorjob_p.h +++ b/src/quick/util/qquickanimatorjob_p.h @@ -152,7 +152,7 @@ protected: QQuickAnimatorJob(); void debugAnimation(QDebug d) const Q_DECL_OVERRIDE; - QQuickItem *m_target; + QPointer<QQuickItem> m_target; QQuickAnimatorController *m_controller; qreal m_from; diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 6a29dea505..11e7953e93 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -252,8 +252,15 @@ void QQuickWidgetPrivate::renderSceneGraph() } Q_ASSERT(offscreenSurface); + render(true); - q->update(); // schedule composition + +#ifndef QT_NO_GRAPHICSVIEW + if (q->window()->graphicsProxyWidget()) + QWidgetPrivate::nearestGraphicsProxyWidget(q)->update(); + else +#endif + q->update(); // schedule composition } QImage QQuickWidgetPrivate::grabFramebuffer() @@ -717,12 +724,13 @@ void QQuickWidgetPrivate::createContext() context = new QOpenGLContext; context->setFormat(offscreenWindow->requestedFormat()); - if (qt_gl_global_share_context()) - context->setShareContext(qt_gl_global_share_context()); - else - context->setShareContext(QWidgetPrivate::get(q->window())->shareContext()); - context->setScreen(context->shareContext()->screen()); - + QOpenGLContext *shareContext = qt_gl_global_share_context(); + if (!shareContext) + shareContext = QWidgetPrivate::get(q->window())->shareContext(); + if (shareContext) { + context->setShareContext(shareContext); + context->setScreen(shareContext->screen()); + } if (!context->create()) { const bool isEs = context->isOpenGLES(); delete context; @@ -1220,6 +1228,7 @@ bool QQuickWidget::event(QEvent *e) } break; + case QEvent::Show: case QEvent::Move: d->updatePosition(); break; diff --git a/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/Singleton.qml b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/Singleton.qml new file mode 100644 index 0000000000..b47d2e98f4 --- /dev/null +++ b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/Singleton.qml @@ -0,0 +1,6 @@ +pragma Singleton +import QtQuick 2.0 + +QtObject { + property int test: 0 +} diff --git a/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/qmldir b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/qmldir new file mode 100644 index 0000000000..8df57f6d47 --- /dev/null +++ b/tests/auto/qml/qmlplugindump/tests/dumper/CompositeSingleton/qmldir @@ -0,0 +1,3 @@ +module tests.dumper.CompositeSingleton +singleton Singleton 1.0 Singleton.qml +depends QtQuick 2.0 diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp index 28d687bd1c..eb05e8cde7 100644 --- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp +++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp @@ -47,6 +47,7 @@ public: private slots: void initTestCase(); void builtins(); + void singleton(); private: QString qmlplugindumpPath; @@ -102,6 +103,19 @@ void tst_qmlplugindump::builtins() QVERIFY(result.contains(QLatin1String("Module {"))); } +void tst_qmlplugindump::singleton() +{ + QProcess dumper; + QStringList args; + args << QLatin1String("tests.dumper.CompositeSingleton") << QLatin1String("1.0") + << QLatin1String("."); + dumper.start(qmlplugindumpPath, args); + dumper.waitForFinished(); + + const QString &result = dumper.readAllStandardOutput(); + QVERIFY(result.contains(QLatin1String("exports: [\"Singleton 1.0\"]"))); +} + QTEST_MAIN(tst_qmlplugindump) #include "tst_qmlplugindump.moc" diff --git a/tests/auto/quick/qquickanimations/data/animatorInvalidTargetCrash.qml b/tests/auto/quick/qquickanimations/data/animatorInvalidTargetCrash.qml new file mode 100644 index 0000000000..f2c378e4b5 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/animatorInvalidTargetCrash.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.3 +import QtQuick.Window 2.2 + +Window { + visible: true + width: 100 + height: 100 + + OpacityAnimator { + id: anim + from: 1 + to:0 + duration: 5000 + running: false + } + + Loader { + id: loader + sourceComponent: Text { + text: "Hello World" + anchors.centerIn: parent + } + } + + Component.onCompleted: { + anim.target = loader.item; + anim.start(); + loader.active = false; + } +} diff --git a/tests/auto/quick/qquickanimations/data/defaultRotationAnimation.qml b/tests/auto/quick/qquickanimations/data/defaultRotationAnimation.qml new file mode 100644 index 0000000000..94692add60 --- /dev/null +++ b/tests/auto/quick/qquickanimations/data/defaultRotationAnimation.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Rectangle { + id: rect + + RotationAnimation { + target: rect + from: 0 + to: 360 + running: true + duration: 1000 + loops: Animation.Infinite + } +} diff --git a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp index 2b805e9eeb..5cad68b275 100644 --- a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp +++ b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp @@ -104,6 +104,8 @@ private slots: void scriptActionBug(); void groupAnimationNullChildBug(); void scriptActionCrash(); + void animatorInvalidTargetCrash(); + void defaultPropertyWarning(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -1491,7 +1493,40 @@ void tst_qquickanimations::scriptActionCrash() delete obj; } +// QTBUG-49364 +// Test that we don't crash when the target of an Animator becomes +// invalid between the time the animator is started and the time the +// animator job is actually started +void tst_qquickanimations::animatorInvalidTargetCrash() +{ + QQmlEngine engine; + QQmlComponent c(&engine, testFileUrl("animatorInvalidTargetCrash.qml")); + QObject *obj = c.create(); + + //just testing that we don't crash + QTest::qWait(5000); //animator duration + + delete obj; +} + +Q_DECLARE_METATYPE(QList<QQmlError>) +// QTBUG-22141 +void tst_qquickanimations::defaultPropertyWarning() +{ + QQmlEngine engine; + + qRegisterMetaType<QList<QQmlError> >(); + + QSignalSpy warnings(&engine, SIGNAL(warnings(QList<QQmlError>))); + QVERIFY(warnings.isValid()); + + QQmlComponent component(&engine, testFileUrl("defaultRotationAnimation.qml")); + QScopedPointer<QQuickItem> root(qobject_cast<QQuickItem*>(component.create())); + QVERIFY(root); + + QVERIFY(warnings.isEmpty()); +} QTEST_MAIN(tst_qquickanimations) diff --git a/tests/auto/quick/qquicklistview/data/qtbug48870.qml b/tests/auto/quick/qquicklistview/data/qtbug48870.qml new file mode 100644 index 0000000000..217f58af48 --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/qtbug48870.qml @@ -0,0 +1,24 @@ +import QtQuick 2.6 + +Rectangle { + width: 500 + height: 500 + color: "blue" + + ListView { + objectName: "list" + anchors.fill: parent + model: testModel + + delegate: Rectangle { + height: 50 + width: ListView.view ? ListView.view.width : height + color: "green" + + Text { + anchors.centerIn: parent + text: "Item " + index + } + } + } +} diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index ad6c6ec12d..86add7435c 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -40,6 +40,7 @@ #include <QtQml/qqmlcontext.h> #include <QtQml/qqmlexpression.h> #include <QtQml/qqmlincubator.h> +#include <QtQuick/private/qquickitemview_p_p.h> #include <QtQuick/private/qquicklistview_p.h> #include <QtQuick/private/qquicktext_p.h> #include <QtQml/private/qqmlobjectmodel_p.h> @@ -249,6 +250,7 @@ private slots: void contentHeightWithDelayRemove_data(); void QTBUG_48044_currentItemNotVisibleAfterTransition(); + void QTBUG_48870_fastModelUpdates(); void keyNavigationEnabled(); @@ -592,8 +594,7 @@ void tst_QQuickListView::inserted(const QUrl &source) QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); - QCOMPARE(item->y(), 0.); - QTRY_COMPARE(listview->contentY(), qreal(0)); + QTRY_COMPARE(item->y() - listview->contentY(), 0.); delete window; delete testObject; @@ -644,7 +645,8 @@ void tst_QQuickListView::inserted_more(QQuickItemView::VerticalLayoutDirection v QTRY_COMPARE(listview->property("count").toInt(), model.count()); - + // FIXME This is NOT checking anything about visibleItems.first() +#if 0 // check visibleItems.first() is in correct position QQuickItem *item0 = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item0); @@ -652,6 +654,7 @@ void tst_QQuickListView::inserted_more(QQuickItemView::VerticalLayoutDirection v QCOMPARE(item0->y(), -item0->height() - itemsOffsetAfterMove); else QCOMPARE(item0->y(), itemsOffsetAfterMove); +#endif QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper"); int firstVisibleIndex = -1; @@ -667,12 +670,21 @@ void tst_QQuickListView::inserted_more(QQuickItemView::VerticalLayoutDirection v // Confirm items positioned correctly and indexes correct QQuickText *name; QQuickText *number; + const qreal visibleFromPos = listview->contentY() - listview->displayMarginBeginning() - listview->cacheBuffer(); + const qreal visibleToPos = listview->contentY() + listview->height() + listview->displayMarginEnd() + listview->cacheBuffer(); for (int i = firstVisibleIndex; i < model.count() && i < items.count(); ++i) { QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); qreal pos = i*20.0 + itemsOffsetAfterMove; if (verticalLayoutDirection == QQuickItemView::BottomToTop) - pos = -item0->height() - pos; + pos = -item->height() - pos; + // Items outside the visible area (including cache buffer) should be skipped + if (pos > visibleToPos || pos < visibleFromPos) { + QTRY_VERIFY2(QQuickItemPrivate::get(item)->culled || item->y() < visibleFromPos || item->y() > visibleToPos, + QTest::toString(QString("index %5, y %1, from %2, to %3, expected pos %4, culled %6"). + arg(item->y()).arg(visibleFromPos).arg(visibleToPos).arg(pos).arg(i).arg(bool(QQuickItemPrivate::get(item)->culled)))); + continue; + } QTRY_COMPARE(item->y(), pos); name = findItem<QQuickText>(contentItem, "textName", i); QVERIFY(name != 0); @@ -8363,6 +8375,136 @@ void tst_QQuickListView::keyNavigationEnabled() QCOMPARE(listView->currentIndex(), 1); } +static bool testVisibleItems(const QQuickItemViewPrivate *priv, bool *nonUnique, FxViewItem **failItem, int *expectedIdx) +{ + QHash<QQuickItem*, int> uniqueItems; + + int skip = 0; + for (int i = 0; i < priv->visibleItems.count(); ++i) { + FxViewItem *item = priv->visibleItems.at(i); + if (!item) { + *failItem = Q_NULLPTR; + return false; + } +#if 0 + qDebug() << "\t" << item->index + << item->item + << item->position() + << (!item->item || QQuickItemPrivate::get(item->item)->culled ? "hidden" : "visible"); +#endif + if (item->index == -1) { + ++skip; + } else if (item->index != priv->visibleIndex + i - skip) { + *nonUnique = false; + *failItem = item; + *expectedIdx = priv->visibleIndex + i - skip; + return false; + } else if (uniqueItems.contains(item->item)) { + *nonUnique = true; + *failItem = item; + *expectedIdx = uniqueItems.find(item->item).value(); + return false; + } + + uniqueItems.insert(item->item, item->index); + } + + return true; +} + +class QTBUG_48870_Model : public QAbstractListModel +{ + Q_OBJECT + +public: + + QTBUG_48870_Model() + : QAbstractListModel() + , m_rowCount(20) + { + QTimer *t = new QTimer(this); + t->setInterval(500); + t->start(); + + qsrand(qHash(QDateTime::currentDateTime())); + connect(t, &QTimer::timeout, this, &QTBUG_48870_Model::updateModel); + } + + int rowCount(const QModelIndex &) const + { + return m_rowCount; + } + + QVariant data(const QModelIndex &, int) const + { + return QVariant(); + } + +public Q_SLOTS: + void updateModel() + { + if (m_rowCount > 10) { + for (int i = 0; i < 10; ++i) { + int rnum = qrand() % m_rowCount; + beginRemoveRows(QModelIndex(), rnum, rnum); + m_rowCount--; + endRemoveRows(); + } + } + if (m_rowCount < 20) { + for (int i = 0; i < 10; ++i) { + int rnum = qrand() % m_rowCount; + beginInsertRows(QModelIndex(), rnum, rnum); + m_rowCount++; + endInsertRows(); + } + } + } + +private: + int m_rowCount; +}; + +void tst_QQuickListView::QTBUG_48870_fastModelUpdates() +{ + QTBUG_48870_Model model; + + QQuickView *window = createView(); + QVERIFY(window); + QQmlContext *ctxt = window->rootContext(); + QVERIFY(ctxt); + ctxt->setContextProperty("testModel", &model); + + window->setSource(testFileUrl("qtbug48870.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + QQuickListView *listview = findItem<QQuickListView>(window->rootObject(), "list"); + QTRY_VERIFY(listview != 0); + + QQuickItemViewPrivate *priv = QQuickItemViewPrivate::get(listview); + bool nonUnique; + FxViewItem *item = Q_NULLPTR; + int expectedIdx; + QVERIFY(testVisibleItems(priv, &nonUnique, &item, &expectedIdx)); + + for (int i = 0; i < 10; i++) { + QTest::qWait(100); + QVERIFY2(testVisibleItems(priv, &nonUnique, &item, &expectedIdx), + qPrintable(!item ? QString("Unexpected null item") + : nonUnique ? QString("Non-unique item at %1 and %2").arg(item->index).arg(expectedIdx) + : QString("Found index %1, expected index is %3").arg(item->index).arg(expectedIdx))); + if (i % 3 != 0) { + if (i & 1) + flick(window, QPoint(100, 200), QPoint(100, 0), 100); + else + flick(window, QPoint(100, 200), QPoint(100, 400), 100); + } + } + + delete window; +} + QTEST_MAIN(tst_QQuickListView) #include "tst_qquicklistview.moc" diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index c7de73da88..7f454aaa11 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -286,6 +286,9 @@ QList<Key> &operator <<(QList<Key> &keys, Qt::Key key) tst_qquicktextedit::tst_qquicktextedit() { + qRegisterMetaType<QQuickTextEdit::TextFormat>(); + qRegisterMetaType<QQuickTextEdit::SelectionMode>(); + standard << "the quick brown fox jumped over the lazy dog" << "the quick brown fox\n jumped over the lazy dog" << "Hello, world!" @@ -596,7 +599,7 @@ void tst_qquicktextedit::textFormat() QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(object.data()); QVERIFY(edit); - QSignalSpy spy(edit, SIGNAL(textFormatChanged(TextFormat))); + QSignalSpy spy(edit, &QQuickTextEdit::textFormatChanged); QCOMPARE(edit->textFormat(), QQuickTextEdit::PlainText); @@ -2113,7 +2116,7 @@ void tst_qquicktextedit::mouseSelectionMode_accessors() QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(object.data()); QVERIFY(edit); - QSignalSpy spy(edit, SIGNAL(mouseSelectionModeChanged(SelectionMode))); + QSignalSpy spy(edit, &QQuickTextEdit::mouseSelectionModeChanged); QCOMPARE(edit->mouseSelectionMode(), QQuickTextEdit::SelectCharacters); diff --git a/tests/auto/quick/touchmouse/data/hoverMouseAreas.qml b/tests/auto/quick/touchmouse/data/hoverMouseAreas.qml new file mode 100644 index 0000000000..1bdd0b3caf --- /dev/null +++ b/tests/auto/quick/touchmouse/data/hoverMouseAreas.qml @@ -0,0 +1,39 @@ +import QtQuick 2.4 + +Item { + width: 500 + height: 500 + + Rectangle { + width: 300 + height: 90 + color: mouseArea1.containsMouse ? "red" : "grey" + x: 100 + y: 100 + + MouseArea { + id: mouseArea1 + objectName: "mouseArea1" + anchors.fill: parent + hoverEnabled: true + onPressed: parent.border.width = 4 + onReleased: parent.border.width = 0 + } + } + Rectangle { + width: 300 + height: 100 + color: mouseArea2.containsMouse ? "red" : "lightblue" + x: 100 + y: 200 + + MouseArea { + id: mouseArea2 + objectName: "mouseArea2" + anchors.fill: parent + hoverEnabled: true + onPressed: parent.border.width = 4 + onReleased: parent.border.width = 0 + } + } +} diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp index 90ee8215a1..e14b7d7c84 100644 --- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp +++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp @@ -161,6 +161,8 @@ private slots: void touchGrabCausesMouseUngrab(); + void hoverEnabled(); + protected: bool eventFilter(QObject *, QEvent *event) { @@ -1232,6 +1234,93 @@ void tst_TouchMouse::touchGrabCausesMouseUngrab() delete window; } +void tst_TouchMouse::hoverEnabled() +{ + // QTouchDevice *device = new QTouchDevice; + // device->setType(QTouchDevice::TouchScreen); + // QWindowSystemInterface::registerTouchDevice(device); + + QQuickView *window = createView(); + window->setSource(testFileUrl("hoverMouseAreas.qml")); + + window->show(); + window->requestActivate(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + QQuickItem *root = window->rootObject(); + QVERIFY(root != 0); + + QQuickMouseArea *mouseArea1 = root->findChild<QQuickMouseArea*>("mouseArea1"); + QVERIFY(mouseArea1 != 0); + + QQuickMouseArea *mouseArea2 = root->findChild<QQuickMouseArea*>("mouseArea2"); + QVERIFY(mouseArea2 != 0); + + QSignalSpy enterSpy1(mouseArea1, SIGNAL(entered())); + QSignalSpy exitSpy1(mouseArea1, SIGNAL(exited())); + QSignalSpy clickSpy1(mouseArea1, SIGNAL(clicked(QQuickMouseEvent *))); + + QSignalSpy enterSpy2(mouseArea2, SIGNAL(entered())); + QSignalSpy exitSpy2(mouseArea2, SIGNAL(exited())); + QSignalSpy clickSpy2(mouseArea2, SIGNAL(clicked(QQuickMouseEvent *))); + + QPoint p0(50, 50); + QPoint p1(150, 150); + QPoint p2(150, 250); + + // ------------------------- Mouse move to mouseArea1 + QTest::mouseMove(window, p1); + + QVERIFY(enterSpy1.count() == 1); + QVERIFY(mouseArea1->hovered()); + QVERIFY(!mouseArea2->hovered()); + + // ------------------------- Touch click on mouseArea1 + QTest::touchEvent(window, device).press(0, p1, window); + + QVERIFY(enterSpy1.count() == 1); + QVERIFY(enterSpy2.count() == 0); + QVERIFY(mouseArea1->pressed()); + QVERIFY(mouseArea1->hovered()); + QVERIFY(!mouseArea2->hovered()); + + QTest::touchEvent(window, device).release(0, p1, window); + QVERIFY(clickSpy1.count() == 1); + QVERIFY(mouseArea1->hovered()); + QVERIFY(!mouseArea2->hovered()); + + // ------------------------- Touch click on mouseArea2 + QTest::touchEvent(window, device).press(0, p2, window); + + QVERIFY(mouseArea1->hovered()); + QVERIFY(mouseArea2->hovered()); + QVERIFY(mouseArea2->pressed()); + QVERIFY(enterSpy1.count() == 1); + QVERIFY(enterSpy2.count() == 1); + + QTest::touchEvent(window, device).release(0, p2, window); + + QVERIFY(clickSpy2.count() == 1); + QVERIFY(mouseArea1->hovered()); + QVERIFY(!mouseArea2->hovered()); + QVERIFY(exitSpy1.count() == 0); + QVERIFY(exitSpy2.count() == 1); + + // ------------------------- Another touch click on mouseArea1 + QTest::touchEvent(window, device).press(0, p1, window); + + QVERIFY(enterSpy1.count() == 1); + QVERIFY(enterSpy2.count() == 1); + QVERIFY(mouseArea1->pressed()); + QVERIFY(mouseArea1->hovered()); + QVERIFY(!mouseArea2->hovered()); + + QTest::touchEvent(window, device).release(0, p1, window); + QVERIFY(clickSpy1.count() == 2); + QVERIFY(mouseArea1->hovered()); + QVERIFY(!mouseArea1->pressed()); + QVERIFY(!mouseArea2->hovered()); +} + QTEST_MAIN(tst_TouchMouse) #include "tst_touchmouse.moc" diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp index 79ff18011d..bec3de524c 100644 --- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp +++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp @@ -59,6 +59,7 @@ private slots: void engine(); void readback(); void renderingSignals(); + void grabBeforeShow(); }; @@ -297,6 +298,14 @@ void tst_qquickwidget::renderingSignals() QTRY_VERIFY(afterRenderingSpy.size() > 0); } +// QTBUG-49929, verify that Qt Designer grabbing the contents before drag +// does not crash due to missing GL contexts or similar. +void tst_qquickwidget::grabBeforeShow() +{ + QQuickWidget widget; + QVERIFY(!widget.grab().isNull()); +} + QTEST_MAIN(tst_qquickwidget) #include "tst_qquickwidget.moc" diff --git a/tests/manual/qmlplugindump/README b/tests/manual/qmlplugindump/README new file mode 100644 index 0000000000..537afbba6e --- /dev/null +++ b/tests/manual/qmlplugindump/README @@ -0,0 +1,42 @@ +Tests for qmlplugindump +----------------------- + +The test are executed by compiling a series of sample projects and +running qmlplugindump on them, checking the generated plugin.qmltypes +files. Each test, except `builtins`, need a sample project in order +to be executed. A test is defined by: + + - test name + - sample project name + - sample project version + - expected results + +That means that different tests can use the same sample project, but +it is not possible to define a test that use more than one sample. +Test definitions are stored in the folder `definitions` as json files; +the file name is the test name, tests are executed in lexicographical +order on their names, and the contents defines the other properties in +the following format: + + { + "project": <project-name>, + "version": <version>, + "expected": [<regexp-patterns>*], + } + +where _project-name_, _version_, and _regexp-patterns_ are strings. + +The first two parameters are used to invoke qmlplugindump: + + qmlplugindump -nonrelocatable <uri> <version> <path> + +where: + + <uri> = tests.dumper.<project-name> + <path> = <test-root> + +therefore, it is important that the sample projects resides in +a subdirectory of `tests/dumper` named as the project itself. + +The last parameter is a list of regular expression patterns that +must match the `plugin.qmltypes` produced by qmlplugindump. diff --git a/tests/manual/qmlplugindump/definitions/000_dummy.json b/tests/manual/qmlplugindump/definitions/000_dummy.json new file mode 100644 index 0000000000..15f62bbc13 --- /dev/null +++ b/tests/manual/qmlplugindump/definitions/000_dummy.json @@ -0,0 +1,5 @@ +{ + "project": "Dummy", + "version": "1.0", + "expected": ["name: \"Dummy\""] +} diff --git a/tests/manual/qmlplugindump/definitions/001_versions.json b/tests/manual/qmlplugindump/definitions/001_versions.json new file mode 100644 index 0000000000..185057f90d --- /dev/null +++ b/tests/manual/qmlplugindump/definitions/001_versions.json @@ -0,0 +1,8 @@ +{ + "project": "Versions", + "version": "1.0", + "expected": [ + "name: \"Versions\"", + "tests\\.dumper\\.Versions/Versions 1\\.0" + ] +} diff --git a/tests/manual/qmlplugindump/definitions/002_revisions.json b/tests/manual/qmlplugindump/definitions/002_revisions.json new file mode 100644 index 0000000000..7f3d86ffe8 --- /dev/null +++ b/tests/manual/qmlplugindump/definitions/002_revisions.json @@ -0,0 +1,9 @@ +{ + "project": "Versions", + "version": "1.1", + "expected": [ + "name: \"Versions\"", + "tests\\.dumper\\.Versions/Versions 1\\.1", + "exportMetaObjectRevisions: \\[0, 1\\]" + ] +} diff --git a/tests/manual/qmlplugindump/qmlplugindump.pro b/tests/manual/qmlplugindump/qmlplugindump.pro new file mode 100644 index 0000000000..b072cdc0cf --- /dev/null +++ b/tests/manual/qmlplugindump/qmlplugindump.pro @@ -0,0 +1,8 @@ +CONFIG += testcase +TARGET = tst_qmlplugindump +QT += testlib gui-private +osx:CONFIG -= app_bundle +CONFIG += parallel_test + +SOURCES += tst_qmlplugindump.cpp +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.cpp b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.cpp new file mode 100644 index 0000000000..cb5a01c231 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "dummy.h" + +Dummy::Dummy(QQuickItem *parent): + QQuickItem(parent) +{ + // By default, QQuickItem does not draw anything. If you subclass + // QQuickItem to create a visual item, you will need to uncomment the + // following line and re-implement updatePaintNode() + + // setFlag(ItemHasContents, true); +} + +Dummy::~Dummy() +{ +} + diff --git a/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.h b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.h new file mode 100644 index 0000000000..a3a3fe5ee1 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef DUMMY_H +#define DUMMY_H + +#include <QQuickItem> + +class Dummy : public QQuickItem +{ + Q_OBJECT + +public: + Dummy(QQuickItem *parent = 0); + ~Dummy(); +}; + +#endif // DUMMY_H + diff --git a/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.pro b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.pro new file mode 100644 index 0000000000..3e690d389f --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy.pro @@ -0,0 +1,35 @@ +TEMPLATE = lib +TARGET = Dummy +QT += qml quick +CONFIG += qt plugin + +TARGET = $$qtLibraryTarget($$TARGET) +uri = tests.dumper.Dummy + +# Input +SOURCES += \ + dummy_plugin.cpp \ + dummy.cpp + +HEADERS += \ + dummy_plugin.h \ + dummy.h + +DISTFILES = qmldir + +!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + copy_qmldir.target = $$OUT_PWD/qmldir + copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir + copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" + QMAKE_EXTRA_TARGETS += copy_qmldir + PRE_TARGETDEPS += $$copy_qmldir.target +} + +qmldir.files = qmldir +unix { + installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) + qmldir.path = $$installPath + target.path = $$installPath + INSTALLS += target qmldir +} + diff --git a/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy_plugin.cpp b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy_plugin.cpp new file mode 100644 index 0000000000..1596020334 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy_plugin.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "dummy_plugin.h" +#include "dummy.h" + +#include <qqml.h> + +void DummyPlugin::registerTypes(const char *uri) +{ + // @uri tests.dumper.dummy + qmlRegisterType<Dummy>(uri, 1, 0, "Dummy"); +} + + diff --git a/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy_plugin.h b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy_plugin.h new file mode 100644 index 0000000000..8bb1a7bd16 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Dummy/dummy_plugin.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef DUMMY_PLUGIN_H +#define DUMMY_PLUGIN_H + +#include <QQmlExtensionPlugin> + +class DummyPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri); +}; + +#endif // DUMMY_PLUGIN_H + diff --git a/tests/manual/qmlplugindump/tests/dumper/Dummy/qmldir b/tests/manual/qmlplugindump/tests/dumper/Dummy/qmldir new file mode 100644 index 0000000000..a1b2e789ba --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Dummy/qmldir @@ -0,0 +1,3 @@ +module tests.dumper.Dummy +plugin Dummy + diff --git a/tests/manual/qmlplugindump/tests/dumper/Imports/CompositeImports.qml b/tests/manual/qmlplugindump/tests/dumper/Imports/CompositeImports.qml new file mode 100644 index 0000000000..b1055b6992 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Imports/CompositeImports.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +QtObject { + property int test: 0 +} diff --git a/tests/manual/qmlplugindump/tests/dumper/Imports/imports.cpp b/tests/manual/qmlplugindump/tests/dumper/Imports/imports.cpp new file mode 100644 index 0000000000..e4934065fc --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Imports/imports.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "imports.h" + +Imports::Imports(QQuickItem *parent): + QQuickItem(parent) +{ + // By default, QQuickItem does not draw anything. If you subclass + // QQuickItem to create a visual item, you will need to uncomment the + // following line and re-implement updatePaintNode() + + // setFlag(ItemHasContents, true); +} + +Imports::~Imports() +{ +} + diff --git a/tests/manual/qmlplugindump/tests/dumper/Imports/imports.h b/tests/manual/qmlplugindump/tests/dumper/Imports/imports.h new file mode 100644 index 0000000000..77c63073da --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Imports/imports.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef IMPORTS_H +#define IMPORTS_H + +#include <QQuickItem> + +class Imports : public QQuickItem +{ + Q_OBJECT + +public: + Imports(QQuickItem *parent = 0); + ~Imports(); +}; + +#endif // IMPORTS_H + diff --git a/tests/manual/qmlplugindump/tests/dumper/Imports/imports.pro b/tests/manual/qmlplugindump/tests/dumper/Imports/imports.pro new file mode 100644 index 0000000000..fe9caea13a --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Imports/imports.pro @@ -0,0 +1,35 @@ +TEMPLATE = lib +TARGET = Imports +QT += qml quick +CONFIG += qt plugin + +TARGET = $$qtLibraryTarget($$TARGET) +uri = tests.dumper.Imports + +# Input +SOURCES += \ + imports_plugin.cpp \ + imports.cpp + +HEADERS += \ + imports_plugin.h \ + imports.h + +DISTFILES = qmldir + +!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + copy_qmldir.target = $$OUT_PWD/qmldir + copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir + copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" + QMAKE_EXTRA_TARGETS += copy_qmldir + PRE_TARGETDEPS += $$copy_qmldir.target +} + +qmldir.files = qmldir +unix { + installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) + qmldir.path = $$installPath + target.path = $$installPath + INSTALLS += target qmldir +} + diff --git a/tests/manual/qmlplugindump/tests/dumper/Imports/imports_plugin.cpp b/tests/manual/qmlplugindump/tests/dumper/Imports/imports_plugin.cpp new file mode 100644 index 0000000000..c0ee61170d --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Imports/imports_plugin.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "imports_plugin.h" +#include "imports.h" + +#include <qqml.h> + +void ImportsPlugin::registerTypes(const char *uri) +{ + // @uri tests.dumper.imports + qmlRegisterType<Imports>(uri, 1, 0, "Imports"); +} + + diff --git a/tests/manual/qmlplugindump/tests/dumper/Imports/imports_plugin.h b/tests/manual/qmlplugindump/tests/dumper/Imports/imports_plugin.h new file mode 100644 index 0000000000..e48dabd5e0 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Imports/imports_plugin.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef IMPORTS_PLUGIN_H +#define IMPORTS_PLUGIN_H + +#include <QQmlExtensionPlugin> + +class ImportsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri); +}; + +#endif // IMPORTS_PLUGIN_H + diff --git a/tests/manual/qmlplugindump/tests/dumper/Imports/qmldir b/tests/manual/qmlplugindump/tests/dumper/Imports/qmldir new file mode 100644 index 0000000000..efab493dc8 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Imports/qmldir @@ -0,0 +1,3 @@ +module tests.dumper.Imports +plugin Imports +CompositeImports 1.0 CompositeImports.qml diff --git a/tests/manual/qmlplugindump/tests/dumper/Singleton/CompositeSingleton.qml b/tests/manual/qmlplugindump/tests/dumper/Singleton/CompositeSingleton.qml new file mode 100644 index 0000000000..b47d2e98f4 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Singleton/CompositeSingleton.qml @@ -0,0 +1,6 @@ +pragma Singleton +import QtQuick 2.0 + +QtObject { + property int test: 0 +} diff --git a/tests/manual/qmlplugindump/tests/dumper/Singleton/qmldir b/tests/manual/qmlplugindump/tests/dumper/Singleton/qmldir new file mode 100644 index 0000000000..dec4063fda --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Singleton/qmldir @@ -0,0 +1,2 @@ +module tests.dumper.Singleton +singleton CompositeSingleton 1.0 CompositeSingleton.qml diff --git a/tests/manual/qmlplugindump/tests/dumper/Versions/plugin.qmltypes b/tests/manual/qmlplugindump/tests/dumper/Versions/plugin.qmltypes new file mode 100644 index 0000000000..0e09c2cfc7 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Versions/plugin.qmltypes @@ -0,0 +1,21 @@ +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 tests.dumper.versions 1.1 .' + +Module { + dependencies: ["QtQuick 2.0"] + Component { + name: "Versions" + defaultProperty: "data" + prototype: "QQuickItem" + exports: ["Versions 1.0", "Versions 1.1"] + exportMetaObjectRevisions: [0, 1] + Property { name: "foo"; type: "int" } + Property { name: "bar"; revision: 1; type: "int" } + Property { name: "baz"; revision: 2; type: "int" } + } +} diff --git a/tests/manual/qmlplugindump/tests/dumper/Versions/qmldir b/tests/manual/qmlplugindump/tests/dumper/Versions/qmldir new file mode 100644 index 0000000000..382225f517 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Versions/qmldir @@ -0,0 +1,3 @@ +module tests.dumper.Versions +plugin Versions + diff --git a/tests/manual/qmlplugindump/tests/dumper/Versions/versions.cpp b/tests/manual/qmlplugindump/tests/dumper/Versions/versions.cpp new file mode 100644 index 0000000000..ac2698aa53 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Versions/versions.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "versions.h" + +Versions::Versions(QQuickItem *parent): + QQuickItem(parent) +{ + // By default, QQuickItem does not draw anything. If you subclass + // QQuickItem to create a visual item, you will need to uncomment the + // following line and re-implement updatePaintNode() + + // setFlag(ItemHasContents, true); +} + +Versions::~Versions() +{ +} + diff --git a/tests/manual/qmlplugindump/tests/dumper/Versions/versions.h b/tests/manual/qmlplugindump/tests/dumper/Versions/versions.h new file mode 100644 index 0000000000..412f39f5d4 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Versions/versions.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef VERSIONS_H +#define VERSIONS_H + +#include <QQuickItem> + +class Versions : public QQuickItem +{ + Q_OBJECT + Q_PROPERTY(int foo READ foo WRITE setFoo NOTIFY fooChanged) + Q_PROPERTY(int bar READ bar WRITE setBar NOTIFY barChanged REVISION 1) + Q_PROPERTY(int baz READ baz WRITE setBaz NOTIFY bazChanged REVISION 2) + +public: + Versions(QQuickItem *parent = 0); + ~Versions(); + int foo() const { return m_foo; } + void setFoo(int value) { m_foo = value; } + int bar() const { return m_bar; } + void setBar(int value) { m_bar = value; } + int baz() const { return m_baz; } + void setBaz(int value) { m_baz = value; } +signals: + void fooChanged(); + void barChanged(); + void bazChanged(); +private: + int m_foo; + int m_bar; + int m_baz; +}; + +#endif // VERSIONS_H + diff --git a/tests/manual/qmlplugindump/tests/dumper/Versions/versions.pro b/tests/manual/qmlplugindump/tests/dumper/Versions/versions.pro new file mode 100644 index 0000000000..951f886368 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Versions/versions.pro @@ -0,0 +1,35 @@ +TEMPLATE = lib +TARGET = Versions +QT += qml quick +CONFIG += qt plugin + +TARGET = $$qtLibraryTarget($$TARGET) +uri = tests.dumper.Versions + +# Input +SOURCES += \ + versions_plugin.cpp \ + versions.cpp + +HEADERS += \ + versions_plugin.h \ + versions.h + +DISTFILES = qmldir + +!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + copy_qmldir.target = $$OUT_PWD/qmldir + copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir + copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" + QMAKE_EXTRA_TARGETS += copy_qmldir + PRE_TARGETDEPS += $$copy_qmldir.target +} + +qmldir.files = qmldir +unix { + installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) + qmldir.path = $$installPath + target.path = $$installPath + INSTALLS += target qmldir +} + diff --git a/tests/manual/qmlplugindump/tests/dumper/Versions/versions_plugin.cpp b/tests/manual/qmlplugindump/tests/dumper/Versions/versions_plugin.cpp new file mode 100644 index 0000000000..33f59b7f78 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Versions/versions_plugin.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "versions_plugin.h" +#include "versions.h" + +#include <qqml.h> + +void VersionsPlugin::registerTypes(const char *uri) +{ + // @uri tests.dumper.versions + qmlRegisterType<Versions>(uri, 1, 0, "Versions"); + qmlRegisterType<Versions, 1>(uri, 1, 1, "Versions"); +} + + diff --git a/tests/manual/qmlplugindump/tests/dumper/Versions/versions_plugin.h b/tests/manual/qmlplugindump/tests/dumper/Versions/versions_plugin.h new file mode 100644 index 0000000000..8466f6ec63 --- /dev/null +++ b/tests/manual/qmlplugindump/tests/dumper/Versions/versions_plugin.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef VERSIONS_PLUGIN_H +#define VERSIONS_PLUGIN_H + +#include <QQmlExtensionPlugin> + +class VersionsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri); +}; + +#endif // VERSIONS_PLUGIN_H + diff --git a/tests/manual/qmlplugindump/tst_qmlplugindump.cpp b/tests/manual/qmlplugindump/tst_qmlplugindump.cpp new file mode 100644 index 0000000000..8afe051618 --- /dev/null +++ b/tests/manual/qmlplugindump/tst_qmlplugindump.cpp @@ -0,0 +1,376 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qtest.h> +#include <QLibraryInfo> +#include <QDir> +#include <QDirIterator> +#include <QProcess> +#include <QRegularExpression> +#include <QJsonDocument> +#include <QJsonParseError> +#include <QJsonObject> +#include <QJsonArray> +#include <QJsonValue> + +#include <QDebug> + +#include <cstdlib> +#include <algorithm> + + +// System dependent definitions + +#if defined(Q_OS_WIN) + +static const char* systemMakeProgram = "jom"; +static const char* systemQmlplugindumpProgram = "qmlplugindump.exe"; + +static const QString libname(const QString &name) +{ + return name + QLatin1String(".dll"); +} + +#elif defined(Q_OS_DARWIN) + +static const char* systemMakeProgram = "make"; +static const char* systemQmlplugindumpProgram = "qmlplugindump"; + +static const QString libname(const QString &name) +{ + return QLatin1String("lib") + name + QLatin1String(".dynlib"); +} + +#else + +static const char* systemMakeProgram = "make"; +static const char* systemQmlplugindumpProgram = "qmlplugindump"; + +static const QString libname(const QString &name) +{ + return QLatin1String("lib") + name + QLatin1String(".so"); +} + +#endif + + +// Utilities + + +// Functor for matching a list of regular expression on a buffer. +// +class RegexpsChecker +{ +public: + RegexpsChecker(const QStringList &expected) : m_expected(expected) {} + bool operator()(const QByteArray &buffer) const + { + QRegularExpression re; + QRegularExpressionMatch m; + Q_FOREACH (const QString &e, m_expected) { + re.setPattern(e); + m = re.match(QString::fromLatin1(buffer)); + if (!m.hasMatch()) { + qWarning() << "Pattern not found: " << e; + return false; + } + } + return true; + } +private: + const QStringList m_expected; +}; + + +// Run an external process in given path and with given arguments, if presents. +// Optionally run a regexp check on the process standard output. +// +bool run(const QString &path, const QString &cmd, const QStringList &args=QStringList(), + const RegexpsChecker *checker=0) { + QProcess process; + process.setWorkingDirectory(path); + process.start(cmd, args); + process.waitForFinished(); + if (process.error() == QProcess::FailedToStart) { + qWarning() << cmd << args << "failed to start."; + return false; + } + if (process.error() == QProcess::Crashed) { + qWarning() << cmd << args << "crashed."; + return false; + } + if (process.exitStatus() != QProcess::NormalExit) { + qWarning() << cmd << args << "exited with code: " << process.exitCode(); + return false; + } + if (checker) + (*checker)(process.readAllStandardOutput()); + return true; +} + + +// Test Definition +// +// A test is defined by id, project, version and expected patterns that should +// match the output of qmlplugindump. +// +class Test +{ +public: + Test(const QString &testId) : id(testId) {} + Test(const QString &testId, const QString &prjName, const QString &prjVersion, + const QStringList &expectedResult) : + id(testId), project(prjName), version(prjVersion), expected(expectedResult) {} + QString id; + QString project; + QString version; + QStringList expected; + bool isNull() const + { + return project.isEmpty() || version.isEmpty(); + } + friend bool operator<(const Test &t1, const Test &t2) { return t1.id < t2.id; } +}; + + +// Create test from a json document. +// +// The json document must contains these fields: +// +// project: string +// version: string +// expected: [string*] +// +// qmlplugindumper will be invoked with these arguments: +// +// qmlplugindumper tests.dumper.<PROJECT> <VERSION> +// +// PROJECT is the name of the sample project. It is used as a project name +// and as the last components of the URI: tests.dumper.<PROJECT>; the project +// path must be ./test/dumper/<PROJECT>. +// +// EXPECTED is a list of regular expression patterns that must match the +// plugin.qmltypes produced by qmlplugindump. +// +Test createTest(const QString &id, const QJsonObject &def) +{ + QJsonValue project = def.value(QLatin1String("project")); + QJsonValue version = def.value(QLatin1String("version")); + QJsonValue expected = def.value(QLatin1String("expected")); + if (!project.isString() || !version.isString() || !expected.isArray()){ + qWarning() << "Wrong definition for test: " << id << "."; + return Test(id); + } + QStringList patterns; + Q_FOREACH (const QJsonValue &x, expected.toArray()) { + if (!x.isString()) { + qWarning() << "Wrong definition for test: " << id << "."; + return Test(id); + } else { + patterns << x.toString(); + } + } + return Test(id, project.toString(), version.toString(), patterns); +} + +// Read a test definition from a file. +// +// The file must define a json document that `createTest' can understand. +// +Test readTestDefinition(const QFileInfo &file) +{ + const QString path = file.filePath(); + const QString id = file.baseName(); + QFile fd(path); + if (fd.open(QIODevice::ReadOnly)) { + QTextStream in(&fd); + QJsonParseError err; + QJsonDocument doc = QJsonDocument::fromJson(in.readAll().toLatin1(), &err); + fd.close(); + if (err.error != QJsonParseError::NoError) { + qWarning() << "Parse error in test \"" << id << "\":" << err.errorString(); + return Test(id); + } + QJsonObject obj = doc.object(); + return createTest(id, obj); + } + qWarning() << "Cannot open " << path << "."; + return Test(id); +} + +// Read all files in `path' as test definitions. +// +// Returns a list of tests sorted lexicographically. +// +QList<Test> readAllTestDefinitions(const QString &path) +{ + QList<Test> samples; + QDirIterator it(path, QDir::Files); + while (it.hasNext()) { + it.next(); + samples << readTestDefinition(it.fileInfo()); + } + std::sort(samples.begin(), samples.end()); + return samples; +} + + +// TEST SUITE + +class tst_qmlplugindump : public QObject +{ + Q_OBJECT +public: + tst_qmlplugindump(); + +private slots: + void initTestCase(); + void builtins(); + void plugin_data(); + void plugin(); + void cleanupTestCase(); + +private: + static const char *prefix; + QString dumper; + QList<Test> tests; + QString samplePath(const QString &name); + bool compileSample(const QString &name); + bool cleanUpSample(const QString &name); +}; + +const char *tst_qmlplugindump::prefix = "tests.dumper."; + +tst_qmlplugindump::tst_qmlplugindump() +{ +} + +QString tst_qmlplugindump::samplePath(const QString &name) +{ + return QCoreApplication::applicationDirPath() + + QLatin1Char('/') + + QString(QLatin1String(prefix)).replace(QRegularExpression(QLatin1String("\\.")), + QLatin1String("/")).append(name); +} + +bool tst_qmlplugindump::compileSample(const QString &name) +{ + const QString path = samplePath(name); + return run(path, QLatin1String("qmake")) + && run(path, QLatin1String(systemMakeProgram)); +} + +bool tst_qmlplugindump::cleanUpSample(const QString &name) +{ + const QString path = samplePath(name); + const QStringList args(QLatin1String("clean")); + if (!run(path, QLatin1String(systemMakeProgram), args)) + return false; + + const QString libfile = path + QLatin1Char('/') + libname(name); + + if (!QFile::remove(libfile)) { + qWarning() << "Cannot remove" << libfile << "."; + return false; + } + return true; +} + +void tst_qmlplugindump::initTestCase() +{ + dumper = QLibraryInfo::location(QLibraryInfo::BinariesPath); + tests = readAllTestDefinitions(QCoreApplication::applicationDirPath() + + QLatin1String("/definitions")); + + dumper += QLatin1Char('/') + QLatin1String(systemQmlplugindumpProgram); + + if (!QFileInfo(dumper).exists()) { + QString message = QString::fromLatin1("qmlplugindump executable not found (looked for %0)") + .arg(dumper); + QFAIL(qPrintable(message)); + } +} + +void tst_qmlplugindump::builtins() +{ + QStringList args; + args += QLatin1String("-builtins"); + RegexpsChecker check(QStringList(QLatin1String("Module {"))); + QString cwd = QCoreApplication::applicationDirPath(); + QVERIFY(run(cwd, dumper, args, &check)); +} + +void tst_qmlplugindump::plugin_data() +{ + QTest::addColumn<QString>("project"); + QTest::addColumn<QString>("version"); + QTest::addColumn<QStringList>("expected"); + + Q_FOREACH (const Test &t, tests) { + if (t.isNull()) + QSKIP("Errors in test definition."); + QTest::newRow(t.id.toLatin1().data()) << t.project << t.version << t.expected; + } +} + +void tst_qmlplugindump::plugin() +{ + QFETCH(QString, project); + QFETCH(QString, version); + QFETCH(QStringList, expected); + + QVERIFY(compileSample(project)); + + QStringList args; + QString url = QLatin1String("tests.dumper.") + project; + QString cwd = QCoreApplication::applicationDirPath(); + args << QLatin1String("-nonrelocatable") << url << version << cwd; + RegexpsChecker check(expected); + QVERIFY(run(cwd, dumper, args, &check)); +} + +void tst_qmlplugindump::cleanupTestCase() +{ + QSet<const QString> projects; + Q_FOREACH (const Test &t, tests) + projects.insert(t.project); + Q_FOREACH (const QString &p, projects) { + if (!cleanUpSample(p)) + qWarning() << "Error in cleaning up project" << p << "."; + } +} + + +QTEST_MAIN(tst_qmlplugindump) + +#include "tst_qmlplugindump.moc" diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 0f73afcc7b..aa2e8755e6 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -849,6 +849,14 @@ static bool getDependencies(const QQmlEngine &engine, const QString &pluginImpor std::cerr << "failed to proecess output of qmlimportscanner" << std::endl; return false; } + + QStringList aux; + foreach (const QString &str, *dependencies) { + if (!str.startsWith("Qt.test.qtestroot")) + aux += str; + } + *dependencies = aux; + return true; } |