aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Fix a crash in JSON.parseLars Knoll2013-12-041-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properly set members that are actually array indices and don't crash when trying to set those. Task-number: QTBUG-35383 Change-Id: I04d4b65c27e97a2e9db19541ed46ee1bb202f780 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| | * QQmlImport: Don't try use a dangling pointer.Robin Burchell2013-12-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | toUtf8 would return a temporary, and constData would hold a pointer inside that temporary. This isn't even remotely safe. Move the pointer use down to the initializeEngine call so it is kept around long enough for us to do our stuff. This is a backport of cf51cdb8fb002ae3602a4c886e7c67913d77373a. Task-number: QTBUG-35355 Task-number: QTBUG-35343 Change-Id: I338ad7f4d4137445ed9a311a293ea82bf023aafd Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| | * Revert "Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614"Alan Alpert2013-12-0410-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 27052dcad9810869a9065da4c06e9f14379411d7. While the additional flexibility would be nice, I've been reminded that we already did commit to it back in July. Change-Id: Iaf990dda98ee46eb028b4737bdeeafd050d9513f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
| * | Fix regression in QML string list concatenationsSimon Hausmann2013-12-111-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String lists and other QList property types (wrapped as QQmlSequence) should behave like arrays and have the Array prototype. Therefore it should be possible to pass them also as parameter to concat and they get composed correctly, i.e. the individual items get appended instead of the list being appened as one item. In the spec for concat this "special" casing should be applied if the "class internal property" is "Array", and concat appears to be the only place where this check is done. Therefore this patch adds another exception to match the expected behavior in QML and extends the "internal class is Array" meaning to QML list types. This is a regression from Qt <= 5.1.x Task-number: QTBUG-33149 Change-Id: Iab9522ac3c4ae6b746e790a99d87501b1cc1b655 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Use qCpuHasFeature because the check can be optimized out of existenceThiago Macieira2013-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | qCpuHasFeature also checks the compiler flags of this particular build. If the feature was enabled by the compiler in this .cpp, then no runtime check is performed and the test becomes an unconditional true. Change-Id: Ibb7d333e59a0f4ed06b7d0056547177fd69658a0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Fix broken Maroon game / regression in PropertyChanges {} elementSimon Hausmann2013-12-105-23/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the expressions in PropertyChanges {} introduced a regression in where the evaluation context was incorrect and thus bindings would not be able to access the correct properties. For example PropertyChanges { target: someObject y: height / 2 } Here height should be looked up in the context of "someObject", not of the PropertyChanges element. This patch introduces an auto-test that verifies that the lookup context is correct and fixes the bug by disabling accelerated compile time property lookups for binding expressions that are requested from a custom parser. Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | V4: change variable renumbering algorithm from recursive to iterative.Erik Verbruggen2013-12-101-89/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the recursive calls and subsequent clean-ups by pushing actions on a to-do stack, and processing that stack in a loop. Change-Id: I83536e88d400592b6e9f5fda3d795e41711a131a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
| * | Windows: Use Shell API for checking file case correctness.Friedemann Kleint2013-12-102-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | The old method of converting to short 8.3 name and back does not work for drives where this is disabled. Change-Id: Ia0a46331a31eeb61578c31ba063a80665d5fc25c Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * | Correctly profile the size of loaded pixmapsUlf Hermann2013-12-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only set the sizes when they're known, prefer request size to implicit size (as the request size is what ends up in the cache), and don't set the size twice. Task-number: QTBUG-35337 Change-Id: Ie516a1cae2d9050f61362ee99cf8a6a9dd8ea3bb Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * | Remove unused function isUnicodeNonCharacterThiago Macieira2013-12-081-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | Found by ICC 14.0: qhashedstring.cpp(199): warning #177: function "isUnicodeNonCharacter" was declared but never referenced Change-Id: I62b113e41197dac12f73db8347e22c825e404627 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Avoid warnings on cast from char* to QStringThiago Macieira2013-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Why isn't QtQml being built with those functions disabled, so they produce errors? Change-Id: I2c0cf945523142800982f100a61a6c10e1929632 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
| * | Clean up property dependency data structuresSimon Hausmann2013-12-057-141/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a follow-up to the previous commit, this patch cleans up the data structures used to track dependencies of QML binding expressions and functions to context and scope properties, determined at compile time. Instead of "collecting" these depending properties upfront (codegen time), we propagate the information that a property is a context or scope property into the IR at codegen time and later in the isel collect these properties and their notify signal index in a hash in the IR functions. The CompileData structure generator then can read these hashes directly when writing out the dependency information. Change-Id: I32134706e2d24bf63d1b1abad0259ab072460173 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Fix dependency calculation for context and scope propertiesSimon Hausmann2013-12-053-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were incorrectly calculating writing to a context or scope property as a dependency for an expression. We don't know whether a property is being written only or also being read from at lookup time, but we can make that decision in the isel then when generating the move instructions. So initially context and scope properties end up in a candidate set first and get promoted to real dependencies when they're being used in reading moves. Task-number: QTBUG-35210 Change-Id: Ia67057abafc2d611e1e6605327b4965ebe91cbed Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Fix data layout of Managed classLars Knoll2013-12-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The internal class should really be the first member. The flags should go away over time. Change-Id: Id2373a438e2af63a55704819c9dd5569c3895080 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Fix dynamic properties in QQmlPropertyMap not always being visible in QMLSimon Hausmann2013-12-053-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQmlPropertyMap is a fully dynamic class that can add properties at any point in time. In order for these properties to be visible inside QML, we must disable the property cache (instead of trying to unsuccessfully re-fresh it). What happened in this particular case is that the QQmlPropertyMap derived type was instantiated and the VME instruction for creating it would also assign the property cache the compiler determined. There's no way for QQmlPropertyMap itself to access this property cache instance (stored in output->types[id].typePropertyCache) or invalidate it, so instead don't use the compiler's property cache when instantiating the type. This patch also disallows the adding properties to QQmlPropertyMap when it is used as base type for a new QML type, as we cannot provide the derived type to the QQmlPropertyMap constructor - this is only possible in C++. Task-number: QTBUG-35233 Change-Id: I7fa9e4a2224ccfdd7ccb3fd9f73919ecd46058a8 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | V4 IR: reverse propagate int32 truncation.Erik Verbruggen2013-12-044-139/+363
| | | | | | | | | | | | | | | Change-Id: I5cb0c7798d0e530f3137710bf0e723bd7b64dc89 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | QQmlMemoryProfiler: Fix dangling pointer use.Robin Burchell2013-12-041-2/+1
| | | | | | | | | | | | | | | | | | | | | toUtf8 returns a temporary, accessing constData isn't safe Change-Id: I3c4d077f24cee0eaf1df230c4d8079619967b51a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Remove unused memberLars Knoll2013-12-044-6/+4
| | | | | | | | | | | | | | | Change-Id: I9926f1ab10ea04387f17794944dcc11f4a2a9054 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Fix some header guardsLars Knoll2013-12-043-4/+4
| | | | | | | | | | | | | | | Change-Id: Ib696c79754cc238e3f4fa356c461a07d9f06d6e7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Encapsulate the current context and fix it's usageLars Knoll2013-12-0443-219/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encapsulate accesses to the current context, and rework the way we push and pop this context from the context stack. Largely a cleanup, but simplifies the code in the long term Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Remove setVTable calls in performance critical areasLars Knoll2013-12-0421-75/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all the calls to setVTable that were in performance critical parts of the code. This now brings performance back to the level we had with the vtable inlined in the Managed objects. Change-Id: I76317cc5c53b5b700d1d3883b954407142a4c424 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Move the vtable pointer from the object to the internal classLars Knoll2013-12-0449-248/+303
| | | | | | | | | | | | | | | | | | | | | | | | This saves one pointer per object, and willmake other optimizations easier in the future. Change-Id: I1324cad31998896b5dc76af3c8a7ee9d86283bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Fix a bug in the code for evalLars Knoll2013-12-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When eval was being used as an indirect call, the code didn't reset the current context properly before returning from the eval call. Change-Id: Id5c7e9a897101d25593ef0f3b9945adaf19360b3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Add a static toArrayIndex() method to QV4::StringLars Knoll2013-12-043-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | This avoids a hack in QV4::Codegen where we created a V4::String on the stack to convert to an array index. Change-Id: I9a88d45817bbcde52a4037a52fbae299b8c9cb1a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Fixup the implementation mess for QJSValue(QString)Lars Knoll2013-12-043-10/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now we were using a QV4::String without engine to represent this case. But this leads to lots of quirks, where we ended up trying to access the engine (or the internalclass/vtable) of this string anyway. Now just represent it by using an QString in QJSValuePrivate, and use an empty value to represent it. This adds a little bit of code to QJSValue and QJSEngine, but is more stable and maintainable in the longer term. Change-Id: I3358165ee64e788274225743a95dfb13346225cc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Optimize ExecutionContext::setPropertyLars Knoll2013-12-041-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need to call hasProperty followed by put. Instead get the property descriptor and call putValue for it. Improves v8-bench by 5%. Change-Id: Ied047126c651c033f7ad4c27deaeec08e5fee7f9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Use an internalClass to represent formals and locals in CallContextsLars Knoll2013-12-047-67/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | formals and locals in a CallContext where so far accessed through a linear search in ExecutionContext::getProperty. Fix this by introducing an internalClass for the Function used by the call context. Change-Id: I1141efa12b19d6de4a354bfd6e769c5ffcb8898b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Remove unused inline wrapperLars Knoll2013-12-045-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | The wrapper method for Function::code() was still there from the times we used C++ exceptions. It's not needed any more, so get rid of it. Change-Id: I2ec25fbca71eeef9d7a94a38b5adfa42e4de3a84 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Speedup JS instanceof operatorLars Knoll2013-12-047-58/+50
| | | | | | | | | | | | | | | | | | | | | | | | Cache the prototype of the functionobject, and inline hasInstance. This removes a vtbl method and speeds things up quite a bit. Change-Id: Ic68f301f7e09763d445a98bffa2cd201303f902e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Initialize variableLars Knoll2013-12-041-0/+1
| | | | | | | | | | | | | | | Change-Id: I37b14a406ebb9cf87fef20426a94725a2441b7cd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Fix qsTr() in .js contextJ-P Nurmi2013-12-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't assume a four characters long file name suffix (.qml) Task-number: QTBUG-32850 Change-Id: I522c06b71bf1b38f32f2947a6c06017f83eb50be Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * | QQmlImport: Don't try use a dangling pointer.Robin Burchell2013-12-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | toUtf8 would return a temporary, and constData would hold a pointer inside that temporary. This isn't even remotely safe. Move the pointer use down to the initializeEngine call so it is kept around long enough for us to do our stuff. Task-number: QTBUG-35355 Task-number: QTBUG-35343 Change-Id: Ie816d0d1a37e42607f26d9ad02cf999f3d459cd9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-032-16/+33
| |\| | | | | | | | | | Change-Id: I894ad7b4888744833f487b481950c087fa960a5c
| | * Doc: Update examples used in Writing QML Extensions tutorialTopi Reinio2013-11-302-16/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the examples to use Qt's resource file system to store the qml files in, enabling them to run unmodified in any platform/build configuration. Also, - Chapter 6: Move the plugin code to a subproject and create a C++ application to use the plugin - Update documentation related to above chapter - Add thumbnails for the examples so they will appear in Qt Creators example list. Task-number: QTBUG-35001 Change-Id: I29122af11bb11c7e5e17993438e5fc18c7f96f89 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
| * | Fix build in release mode with forced assertsKonstantin Ritt2013-12-031-1/+1
| | | | | | | | | | | | | | | Change-Id: I0e35533af7f65200a8bc3c4024c29344fa6f4b7a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | V4 IR: remove common toInt32 casts.Erik Verbruggen2013-12-031-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g.: a | 0 b & 0xffffffff These operations force the operands to be converted to int32 without changing their value. At this point we already added convert calls to the IR, so we can safely get rid of these operations. Change-Id: Ic4d3b989e13439eccd2c878fa7bf5030acae7630 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | V4 IR: change the worklist to a QSet for block scheduling.Erik Verbruggen2013-12-031-4/+4
| | | | | | | | | | | | | | | | | | | | | Fixes a crash in octane. Change-Id: Ib72ac0b7a2941230a87543f30fcf7e55d7094886 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | V4: remove invalid assert.Erik Verbruggen2013-12-031-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Both the base and the index of a subscript can (and are allowed to) be other things than temporaries. Change-Id: If073e262712bab488f18eac5ebe097be99c40359 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Add a namespace for a global variable in a public headerThiago Macieira2013-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Qml" prefix should suffice. This was found by ICC 14.0 in a bogus warning: qqml.h(470): error #2415: variable "CurrentSingletonTypeRegistrationVersion" of static storage duration was declared but never referenced Change-Id: I604cd712529b1c4553457c1ea0904182ac4a9e80 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
| * | Fix change-of-sign warning in the new QML compilerThiago Macieira2013-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The m_line and m_column members are of type quint16, so -1 is not valid. BTW, aren't 65535 possible lines too few? qqmlboundsignal.cpp(92): error #68: integer conversion resulted in a change of sign Change-Id: I2f73c276c5fc9b6988b5fa4274f7fa3f6bb85c4b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * | Allow QtQml to compile with ICC 14.0 with -WerrorThiago Macieira2013-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Third-party source contains a static variable that is only used in debugging code (an ASSERT). cached-powers.cc(134): warning #2415: variable "double_conversion::kCachedPowersLength" of static storage duration was declared but never referenced static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); Change-Id: I97ea9ada8f03d9fd45149fbc4bfdf61877498339 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * | Add support pre-compiled bindings for QML custom parsersSimon Hausmann2013-11-294-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example the x property in PropertyChanges { target: foo x: someItem.x - other.width / 2 } was compiled at run-time dynamically, which produces slower code (no type information available) and slows down the type instantiation, because the compilation happens every time at instantiation time (or later). With this change, when the custom parser behind PropertyChanges requests a binding ID for "x", the right hand side will be added to the bindings to compile, then compiled and later at run-time the QQmlBinding constructor that takes a QQmlBinding::Identifier can retrieve the correct compiled function from the QV4::CompiledData::CompilationUnit. Change-Id: I857fb2d39e82714b225bc9394b9904b795c6662b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | QQmlMetaType: adapt to upcoming MOC format changeMarc Mutz2013-12-041-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | A change is pending on qtbase that turns relatedMetaObjects into a const pointer-to-const in order to make the relocation a read-only one. Adapt. Change-Id: I503eca13c1fe80d070e3078620fa3fd5ecdef0b0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Some documentation for the VME profilerUlf Hermann2013-11-291-0/+76
| | | | | | | | | | Change-Id: Ifa36166e803e81484c6a96c732b72f0ee2412c28 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Use the new object creation profiler in qqmlvmeUlf Hermann2013-11-292-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 3 ways to create objects: "Simple", "Cpp" and "Qml". This patch starts a new profiler whenever a new object is created. It's assumed that everything the interpreter main loop does between two creation instructions is related to the object just created. The componentComplete calls are profiled by restoring saved states of the profilers used during the creation of the respective objects. Task-number: QTCREATORBUG-10631 Change-Id: I2645eab7ba32dfb8749cb51ec888d0f0e8fef188 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add a stack-based object creation profilerUlf Hermann2013-11-292-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The simple instantiate-in-context way of profiling object creation doesn't work anymore because the VME's contexts don't necessarily map to C++ contexts anymore. The new profiler introduces two stacks of contexts, one for currently running ranges (such as components) and one for ranges that will be revived later to profile componentComplete() and similar things. Task-number: QTCREATORBUG-10631 Change-Id: Idf19b2adf062bc9c185b3bb5ff5229381f577645 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove old qml object creation profilingUlf Hermann2013-11-294-62/+1
| | | | | | | | | | | | | | | | | | | | The old way the object creation profiler works is unsuitable for detailed profiling as it only tracks top level components. Task-number: QTCREATORBUG-10631 Change-Id: I502d0e144f2965f5e09af8461b50b56c61de5b4b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix accelerated property lookup on id addressed objectsSimon Hausmann2013-11-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | For properties on id referenced objects, we can ignore the lack of the FINAL keyword on properties, as we want the same "lexical" lookup rules like for properties on the scope or context objects. In addition we need to initialize the resolver on the returned temp, to ensure a successful type determination in the use of the id object afterwards. Change-Id: I496c942ade55aa331e6972f06b21c2c86d4b00a4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix JavaScript signal connect on alias without other handlersSimon Hausmann2013-11-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The changed handlers for aliases are connected lazily in the engine. QQmlPropertyPrivate::flushSignal is responsible for that and called in other places, for example when installing a onSomeAliasPropertyChanged handler. However we were missing a call to flushSignal when doing onSomeAliasPropertyChanged.connect(...), i.e. using the JavaScript connect API. Task-number: QTBUG-30493 Change-Id: Ia3f008626fd7af3f2cfbdd30d13fb83158bed4d5 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix warnings: initialize Instruction variables created on the stackThiago Macieira2013-11-292-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.7-4.9 are right that the "code" member is used uninitialized. In fact, GCC 4.9 was quite assertive about it: qqmlinstruction_p.h:538:102: error: ‘def.QQmlInstructionData<8>::<anonymous>.QQmlInstruction::instr_common::code’ is used uninitialized in this function [-Werror=uninitialized] static void setData(QQmlInstruction &instr, const DataType &v) { memcpy(&instr.FMT, &v, Size); } \ ^ (It says "is used uninitialized" for this particular case; the "may be used uninitialized" appears in other places) The analysis is as follows: - variable declared on qqmlcompiler.cpp:1467: Instruction::SetDefault def; - type is POD, so no initialization is performed (def contains garbage) - on qqmlcompiler.cpp:1468 we use the variable: output->addInstruction(def); - QQmlCompiledData::addInstruction is inlined and does: QQmlInstructionMeta<Instr>::setData(genericInstr, data); - which is the call above, doing a memcpy with a source (&v) equal to the uninitialized "def" variable - result: memcpy is copying uninitialized bytes Valgrind doesn't report this because it doesn't care about copying uninitialized data. It will only complain if a decision is made based on it, which we don't since the first thing we do after the memcpy is initialize the member. The solution is simple to not copy the common part of the instructions. This way, we save 8 bytes of unnecessary copying and we still keep the warning if a member of an extended instruction isn't set. Change-Id: I940b40ea9aa61c7386e5cced4a7865be7bfddb5d Reviewed-by: Lars Knoll <lars.knoll@digia.com>