Added Loader, childrenRect and other fixes.
AbandonedPublic

Authored by akreuzkamp on Dec 3 2015, 10:09 PM.

Details

Reviewers
iandruszkiewicz
Summary

Added Loader, ComboBox, Screen, childrenRect property. Fixed positioning ugin Row, Column, Flow (to fix mirrored items). Fixed Repeater. Added number and array modles support.

For some reason items are mirrored by Positioner. Most probably due to lack of parent during creation time.

Diff Detail

Repository
R18 QMLWeb
Branch
loader_and_fixes
Lint
No Linters Available
Unit
No Unit Test Coverage
iandruszkiewicz retitled this revision from to arcconfig.
iandruszkiewicz updated this object.
iandruszkiewicz edited the test plan for this revision. (Show Details)
iandruszkiewicz retitled this revision from arcconfig to Added Loader, childrenRect and other fixes..Dec 3 2015, 10:16 PM
iandruszkiewicz updated this object.
iandruszkiewicz added a reviewer: akreuzkamp.
  • Removing config file.
  • Fixed computing childrenRect basing on implicit width and height of the children
akreuzkamp edited edge metadata.Jan 3 2016, 11:48 AM

For the next time, please create one commit for each change. Adding Loader and fixing repeater are separate changes and don't belong in one review request. But let's accept it for now :)

But at least: Please write a more meaningful commit message:

  • You added something. Is it feature complete? What's supported, what's missing? (It's enough to write like one sentence about it)
  • "Fixed Repeater" simply is not enough. What was wrong about it? What did you change? (please be as accurate as possible)
  • "For some reason items are mirrored by Positioner. Most probably due to lack of parent during creation time." I read that, as an issue you introduce with this commit, but there seems to be some fix for it in the code!? Did I misunderstand it?

Please don't be deterred by the "bad" comments. It's mostly nitpicks, that are needed to reach the desired quality (when I fill review requests and Jan reviews them, they'll always look like that, if not worse ;) ). Thanks a lot for your contributions, they are really valuable! I'm especially glad to finally have a Loader! :) :) :)

src/qtcore/qml/elements/QtQuick/ListModel.js
9

Why do you remove this line?
You're referring to it later...

src/qtcore/qml/elements/QtQuick/MouseArea.js
83

You're overriding line 75. Why?

src/qtcore/qml/elements/QtQuick/Repeater.js
11

I don't understand this. What are you trying to fix?

39

This is wrong. Repeater doesn't add items as it's own children, but adds them to it's parent.

src/qtcore/qml/elements/QtQuick/Row.js
26

Sorry, but this is wrong, too. As already written earlier, Repeaters add their items to their parent. I admit, this is weird behavior, but it's how Qt is doing it.

Please undo this change.

src/qtcore/qml/lib/parser.js
1688

Why did you add that? (You should ideally mention and justify it in the commit message)

src/uglify/parse.js
580

Why did you change this? (You should ideally mention and justify it in the commit message)

iandruszkiewicz updated this revision to Diff 1717.EditedJan 4 2016, 1:54 AM
iandruszkiewicz edited edge metadata.

Column,Row, Flow, Grid: Properly set implicit w/h. Corrected wrong assumption: Parent of created by Repeater Item is not Repeater but parent of Repeater.
Import: new Function in general is faster then eval.
Item: Added root item which geometry is inner Window w/h. Update html element w/h if implicitWidth/implicitHeight changes. Added cache dom.style as css.
ListModel: Fixed defect in clear function (call this.$model.modelReset(); before $item is cleared).
Loader: Added Loader geometry support.
Parser: Fixed parsing error of QML importing JavaScript.
qml: Removed "return" from setters in createSimpleProperty function. Fixed incorrect behavior when created items were trying to use items that weren't created.
qt: Added enum's used by ScrollView.
Repeater: Corrected wrong assumption: Parent of created by Repeater Item is not Repeater but parent of Repeater. Source code clean up and minor performance improvements.
signal: Allow further execution by catching exceptions.

For the next time, please create one commit for each change. Adding Loader and fixing repeater are separate changes and don't belong in one review request. But let's accept it for now :)

But at least: Please write a more meaningful commit message:

  • You added something. Is it feature complete? What's supported, what's missing? (It's enough to write like one sentence about it)
  • "Fixed Repeater" simply is not enough. What was wrong about it? What did you change? (please be as accurate as possible)
  • "For some reason items are mirrored by Positioner. Most probably due to lack of parent during creation time." I read that, as an issue you introduce with this commit, but there seems to be some fix for it in the code!? Did I misunderstand it?

Please don't be deterred by the "bad" comments. It's mostly nitpicks, that are needed to reach the desired quality (when I fill review requests and Jan reviews them, they'll always look like that, if not worse ;) ). Thanks a lot for your contributions, they are really valuable! I'm especially glad to finally have a Loader! :) :) :)

Thanks for the review. I fixed the defects you have found in my commits. Please review one more time :)
One commit for each change is difficult to achieve. However I'll be trying to commit as small pieces as possible.

src/qtcore/qml/elements/QtQuick/ListModel.js
9

Indeed, this variable can't be removed. I don't remember if it was removed by me but I'll revert it.

src/qtcore/qml/elements/QtQuick/MouseArea.js
83

hehe again I feel very weird seeing these two overloaded. Please remove these (onmouseout, onmouseover) without self.dom.style.cursor

src/qtcore/qml/elements/QtQuick/Repeater.js
11

If I remember correctly, created objects don't know own parent until some moment of life. Parent must be set as soon as possible (parent properly is created (?)). I am not sure if this is proper place to do so. This issue also should considered as a global "problem" (all components).

39

You're right. I'll fix it.

Column {
    anchors.fill: parent
    property string name: "column"
    spacing: 10

    Repeater{
        property string name: "Repeater"
        model: 10

        delegate: Rectangle {
            property string name: "Rectangle"
            width: 100
            height: 100
            color: "red"

            Text {
                text: parent.parent.name
            }
        }
    }
}
src/qtcore/qml/elements/QtQuick/Row.js
26

OK

src/qtcore/qml/lib/parser.js
1688

It allows to parse two an extra typed of data models for Repeater (number, array)

src/uglify/parse.js
580

I moved variables to function body due to following error

Uncaught TypeError: UNARY_POSTFIX is not a function

here: while (is("operator") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) {

Problem occurs in QML with imported JavaScript (jason xpath)

ChALkeR added inline comments.
lib/qt.js
11990

There is a mistake here, erroneous new.

akreuzkamp commandeered this revision.Apr 12 2016, 8:13 PM
akreuzkamp edited reviewers, added: iandruszkiewicz; removed: akreuzkamp.