Qt vs. WPF
-
Hi ,
First of all this is not a question but somehow I need your advice or idea.I can call myself WPF expert (C# too) but due to a lot of problems like (Anti Alias) or Image quality even on .Net4 , I decided to learn QT.
I found that QML is easy powerful language specially when is mixed with JavaScript but Still a lot of Bugs that need to be fixed but still a programmer can fix them by tricks .I see that QML Variables or combined JS QML , act like WPF static resources. ( I cannot find Dynamic Resource equivalent ).
anyway , WPF looks very nice with Expression blend while QT seeks such a nice and professional graphical editor. (is there any third party ?)
Also , Code completion is not so well in QT but at least with C++ it is working (VS just support CLI based languages since VS2010) .
anyway.... I am a newbie to QML , I need your advice or recommendation for books/sites/articles to read..
Kind Regards
-
Did you look into Qt Creator? It has really good code completion for both C++ and QML. A graphical editor for QML and another one for QWidget based UIs is built in, too.
-
[quote author="Tobias Hunger" date="1299678151"]Did you look into Qt Creator? It has really good code completion for both C++ and QML. A graphical editor for QML and another one for QWidget based UIs is built in, too.[/quote]
Thanks , Yes , I already saw it and used it. I have moved and started to migrate a project from WPF to QML (Even it is better to call it a new project but I am making similar looking UI)it looks nice but not much . the code completion is a bit slow and lazy but still acceptable.
but Graphical editor is very simple... -
I subscribe what has wrote Tobias.
Consider that I tell this as an experienced developer by 40 years (!!!) and in '80-'90 I had been a MS developer, then I worked on some many platforms and environments that I don't remember all. Sure QT is the best choice against VS.
Do you have taken in consideration the idea to publish your projects on the nokia forum community, so you can share work and knowledge with a lot of people? If you do this, and notify me, I can participate (at least as a follower) to this.
I think that best of a lot of books can be the shared experience and knowledge between people, the forums and the on-line and off-line documentation about QT, QML and more. -
@Alicemirror
I am going to publish it , but I just started it in QT , so , I will do it for sure cause it is opensource (except a core C Part of it).
by the way thanks for information and recommendations . -
Well, remember to notify me the project address.
-
Satmosc: Hmmm... is your box really, really slow or are you including lots and lots of code? Qt Creators code completion is actually rather fast.
-
my project include a lot of code but not now , it is currently under Visual Studio. but even the a complex project under VS is still more faster than QT now !!!
did I missed something ?
I just downloaded QT SDK and Installed it !!!! , it was around 1.6GB .... did I missed something else to boost or include other libraries or soft ? -
First Issue....
In Following Gradient ...
@Gradient {
GradientStop { position: 0 ; color: '#e0e1e8' }
GradientStop { position: 0.5; color: '#E0E1E8' }
GradientStop { position: 0.9; color: '#d8dae1' }
}@I want to make it a global variable in .js code...
how can I do it ?
I did this
@var StyleWindowTitlebarActiveColor = "Gradient { GradientStop { position: 0 ; color: '#e0e1e8' } GradientStop { position: 0.5; color: '#E0E1E8' } GradientStop { position: 0.9; color: '#d8dae1' } }"@but I found that when I want to assign it to a Rectange like
gradient : jscode.gradientvarthe Compiler (at QtCreator) returned an error that I cannot convert QStrint to QDecalarativeGradient ?
So , How you do it ? please , this is important ?
in WPF I make a Static Resource for example in App.xaml and as the App.xaml file is the highest level of the search (lower than dictionary) , it will find it. and also it has a type but in Java , I cannot define a Gradient Type of QML !!!!
Wpf Example :
@ <LinearGradientBrush x:Key="BorderTitleBarIsinActive" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStopCollection>
<GradientStop Color="#FFEEF0F2" Offset="0"/>
<GradientStop Color="#FFD8DAE1" Offset="0.9"/>
<GradientStop Color="#FFE0E1E8" Offset="0.5"/>
</GradientStopCollection>
</LinearGradientBrush>
@ -
QtCreators code completion is lightning fast for me and I have used it across a variety of systems. It always performed as fast a VS code completion did.
And it Qt not QT :P -
even this code as a local variable is not working !!!!
@ property gradient StyleWindowTitlebarInactiveColor : {
GradientStop { position: 0 ; color: '#e0e1e8' }
GradientStop { position: 0.5; color: '#E0E1E8' }
GradientStop { position: 0.9; color: '#d8dae1' }
}@ -
[quote author="Alicemirror" date="1299680012"]I subscribe what has wrote Tobias.
Consider that I tell this as an experienced developer by 40 years (!!!) and in '80-'90 I had been a MS developer, then I worked on some many platforms and environments that I don't remember all. Sure QT is the best choice against VS.
Do you have taken in consideration the idea to publish your projects on the nokia forum community, so you can share work and knowledge with a lot of people? If you do this, and notify me, I can participate (at least as a follower) to this.
I think that best of a lot of books can be the shared experience and knowledge between people, the forums and the on-line and off-line documentation about QT, QML and more.[/quote]I just started the project from the state 0.... with new look at the QT
it is in my upload area at "Satmosc QT Test Upload for Gix ":http://209.190.27.10/index.php?nav=display&file=1If you take a look , I made a rectangle that has a Gradient color scheme.
I used runtime.isActiveWindow to determine if the window has active focus or not.
my problem is I cannot make a Global Variable for the Gradient Style using JavaScript.
in JavaScript all imported datas are QString format and I am unable to convert or cast (BOX/Unbox) it to QDecalarativeGradient format. !!!!
Do you (or anybody) know any method ?Thanks
-
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
-