Qt vs. WPF
-
Satmosc,
What can I give you and advice? Please, set the code under version control (git preferable) and setup the project, informations, ideas etc and repository under forum.nokia.com / community / your projects.
Thus, we can not only share but also interact, exchange ideas, I can clone locally your project and see what's strange or wrong etc.
Using this method, complete and useful, we save a lot of time.Tanks.
-
Thanks you very much... yes I will do it. Actually the reason I did it is that it is just a few line of code and nothing so serious.
Something that I am looking to find is Static Resources or Qt model called Global Variables.
How Can I define a Gradient ( including its stops) as a global Variables !!?
thanks . -
I think that a way is to define a property, then set the gradient with the property value. See the gradient doc on how to set values.
Properties can be part of the object definition, then you set them externally when the object is used and instantiated by the program
-
Thank you very much.... I already defined it as a property but I am a bit lazy and I was unable to access it from an other File.
I made an other QML file and inside that QML File I did :
GlobalVariables.qml
///
@import Qt 4.7Item {
property Gradient titleBar_grdnt1: Gradient {
GradientStop {
position: 0
color: '#e0e1e8' }
GradientStop {
position: 0.5
color: '#E0E1E8' }
GradientStop {
position: 0.9
color: '#d8dae1' }
}
}
@and inside main .QML file I used import "qmldir" (the directory containing that file)
then I tried to access that property from the main file but
using GlobalVariables.titleBar_grdnt1 the compiler says it cannot find GlobalVariables !!!! even the file is visible !!!
So , I think as a beginner I am doing it in a wrong way ....
What should I use inside the GlobalVariables.QML file ,,, Item or .... ?
How to instantiate the GlobalVariables ? like C++ ?? using new ? but it failed !!!!:(I am searching the Forum and Documents , that is too hard to find the answer....
Qml really seek a better documantation....
thanks again for your answer sir. -
You should
Please take a look to the code of the project I am working on at https://projects.forum.nokia.com/rchobbystream
In main you should import the files in the format
@import "elements_dir" 1.0 as Name@
Where Name should be a name starting with the Caps. elements_dir should contain a separate qml file for every item you create, with the initial Caps.
Your iten in the qml file should have an id: to reference the object from the parent and inside the object components (the qml file).
Then, in the main.qml file, you can instantiate the object using
@Name.Object {
id: myid
}
@
So, the child properties can be used in the main.qml file. -
oh my god... you rock.... this is exactly what I was looking for and it made me happy that it is possible to have a resource in QML ....
Thank you 1000 times.... still 2 Questions :-
Where did you learn it ? ( i want to know where to study and follow QML and its future features.)
-
how can we explain it ! ? Static Resource or dynamic !? I mean the resource could be changed during runtime ? also , they will be used as a static variable in memory or they will be just assigned as soon as we use them ?
-
in the code 1
import "elements_dir" 1.0 as Name
What is the meaning of 1.0 ? !! version ?
by the way thank you again
-
-
It's strange eh? 1.0 or the number you desire stay for "version number"
To be honest, I have no idea where this will be used by the program but is a symbolic abstraction needed.I understood QML writing programs in QML / Qt-Quick etc.
But it's a long story...Regarding your point 2, you define a sort of global that is not quite a "variable", it's a property.
As a matter of fact, what you create in qml are very well structured classes so you define a property in a child class, then this property is immediately created with the internal event and state managers (if you need you can use or not).
Thus, the property is inherited and become part of the object itself.In the sources, you create the object with their definitions, elements, sub-objects, properties
then in the parent you can manage them. Simple.No?
-
Actually , when the puzzle is solved , it looks simple... but before that it was hard to imagine it.
hey man. you are clever professional and so good man , because you try to help a newbie like me who is a headache for an expert like you. thank you again.regarding 1.0 , use or not it is working , may be it is version of the imported Qt files (QtQuick 1.0)
http://doc.qt.nokia.com/4.7-snapshot/qdeclarativemodules.htmlThanks again
-
Mah, it is possible you are right, I have no idea and I had no time to investigate on this 1.0 clause... If you are sure I take it for right.
Expertisement (if any) doesn't agree with assumption and arrogance. Then, as you me too I'm using intensively knowledge of other good people that are helping me.
SO, go ahead and place this project on the area, update it frequently with git, it's very simple, and ask. The works that can happen is that no-one answer :)
Take me updated on the develop.
-
Dear AliceMirror,
I am so glad to be in touch with you . I just started to put my project on public to share and update , specially with you.
With best wishes... -
Thank you.
Just an advice: after you setup the project on public, I can be a follower as a registered user and get code and modify documents you have already wrote. Then another registered user can ask to you to be a contributor and if you accept him, he became part of the development team for that project.
In the admin area, set as you needs the permissions on the related groups so followers, visitors and contributors can have the right authorizations.
Then, last but not least, add the right licens to the project (at the end of the "categorization" page).