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


  • Moderators

    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.



  • Yes for


  • Moderators

    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.gradientvar

    the 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=1

    If 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



  • I forgot ,,,, also , QtDesigner (inside QtCreator) is unable to show a correct view of the test project.
    I know it has runtime conditions , but it is right to decide between false or true to show one of the colors of the conditions at least.



  • 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.7

    Item {
    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 :

    1. Where did you learn it ? ( i want to know where to study and follow QML and its future features.)

    2. 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 ?

    3. 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.html

    Thanks 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).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.