Results 1 to 20 of 20

Thread: Qt against WPF

  1. #1
    Join Date
    May 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Qt against WPF

    hey guys,
    i plan to write an program about timemanagement and the ui of this program is very important.
    that means i need (propably) selfmade calender widgets and so on.

    i'm impressed of the qt forms style system but it seems to be a great affort to write own widgets which were good looking too.
    qml on the other hand looks interessing but half baked - wpf looks to be better.

    what do you think about qt froms or qml and its possibilities to ui's?
    maybe in comparison with wpf


    thanks a lot
    soulbug

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt against WPF

    The major difference is that Qt is cross platform, and wpf is not.
    So if your application only needs to run under windows, I guess the "better" solution would be to use the tool kit you are best familiar with.
    I didn't work with wpf, so I can say.
    But Qt surely has all the power you need.
    If you are new to both tool kits, I would suggest Qt, since I think Qt is much simpler to learn, and you win your app being cross platform for free.
    From what I read wpf is more like QML than the regular Qt.

    But your question is very broad, its hard to say in such a general case.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Mar 2010
    Posts
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Qt against WPF

    When working with WPF, you can build your GUI in a XAML file, which is Micro$oft's response to SVG, and build your application logic in code, or build both the GUI and app logic in code. With Qt you work in a similar way, using both QML and code, or code only.

    If you are only targeting the Windows platform, both solutions are feasible. The problem comes if you plan to deploy your application on platforms other than Windows. While Qt is readily available on multiple platforms, WPF is supported only on Windows (there is a subset of XAML implemented in Silverlight/Moonlight, which is more like Flash and is available on several platforms).

    However, if you are starting the development of your application from scratch, I would suggest Qt too.

  4. #4
    Join Date
    May 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt against WPF

    thanks for your responces.

    can you tell me how difficult it is to create new complex widgets which may also contain other widgets in qt forms?
    for example a calender (table) which contains buttons or labels at every singel day

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt against WPF

    It all depends what you mean by "complex". In Qt "complex" widgets usually mean "composed" widgets - widgets that contain layouts and other widgets inside. They don't necessarily have to be "complex" in term of number of objects inside.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    May 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt against WPF

    widgets which may also contain other widgets
    yes i meant composed widgets.

    i'm quiete sure qt
    has all the power you need
    - but i have to know how much time and effort is needed

  7. #7
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt against WPF

    Can you draw a sketch, or explain in detail what kind of widget you want to achieve.
    A table with buttons isn't very difficult to create.

    If you can't achieve what you want with just composing some widgets, then you need to subclass a widget.
    The abstract model/view classes are ideal to display all kinds of data, but it will take you some effort to do all the painting and data handling.
    Or you could use the QGraphicsView/Scene/Items.

    But if you could explain in more detail what kind of data you want to show, and how you want to show it, it might be easier to give a more correct answer I think.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt against WPF

    It's very easy to build composed widgets in Qt thanks to Designer and the concept of layouts.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    May 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt against WPF

    lets have as example the windows live (or outlook 2007) calender

    windows live cal&#10.jpg

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt against WPF

    So? What about it? It's definitely not a single control but two completely separate controls one besides the other and the one on the right is not composed of subcontrols but rather from items, just like in Qt we'd do with GraphicsView. And it's not WPF (although I don't know much about WPF so I could be wrong but I think WPF was not available in 2006-2007 yet). I don't know if it answers your question, whatever it was
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt against WPF

    Indeed.

    You can do this with QGraphicsView which I think would be the easiest path for you.
    Or, you can write a custom itemmodel and itemview, which I think is the most correct way to handle this widget, but also takes a little bit more work.

  12. #12
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Qt against WPF

    This are two very different frameworks, not only for "presentation" of your data in simple to design/implement way. So we (by "we", i talk about members of this forum) like Qt and will recommend Qt, if you ask on some .NET forum they will recommend .NET (WPF).

    Things to consider: Qt is native (C++ code), WPF/.Net runs in CLI (virtual machine), Qt code runs on Linux and Mac with most likely no modification to code (+ the things mentioned in posts before). There must be some advantages to .NET but i didn't work enough with that to know them (i worked only with C++, not with the CLI implementation, learning to write portable code is my reason for that)

    Instead of Conclusion: Nobody can tell you witch of two different things is better for you ( better can be simple to learn, easy to use, fast enough for your task, etc...) and "better" for you might depend on what language you already know, if you know C++, Qt framework will be very easy to learn (for me it seams easier to learn then C++ standard library)

    So, my advice: "play" with each and choose what you like/ learn easy/ does the job you are trying to do.

  13. #13
    Join Date
    May 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt against WPF

    thanks.

    how much time would you approximately need to develop a widget as the shown windows live clander?

  14. #14
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt against WPF

    Quote Originally Posted by soulbug View Post
    thanks.

    how much time would you approximately need to develop a widget as the shown windows live clander?
    I do not think anyone can answer that correctly.
    I think I would need 2 or 3 days. But I don't know you nor your skills

    I would create a custom itemmodel CalenderModel, which handles CalenderItems.
    Then I would create an itemview CalenderView, which displays the items in CalenderModel. Display those calender items in the model that belong to the selected month or day.
    Then you can use delegates to draw items differently.

    Of course, the more functionalities you need, the more work you need to invest. If you want to have weekviews, dayviews, monthviews, you need to create those.

    It's about the same with using GraphicsView.
    You need to create a container for calender items. Then use that container to draw GraphicsItems. The advantage here is that most of the painting is already done for you as there are several standard graphicsitems for text, rectangles etc...

    But that's just my guess.

  15. The following user says thank you to tbscope for this useful post:

    soulbug (15th May 2010)

  16. #15
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Qt against WPF

    Quote Originally Posted by soulbug View Post
    thanks.

    how much time would you approximately need to develop a widget as the shown windows live clander?
    That's an even harder question, we can't know what you already know and how fast are you learning.

    Take a book on Qt, do the examples, see how "things" are made and then try to do your own, because if you learn just by try/error/re-try/error and so on, you wont become more efficient with Qt (or any other programming framework or language) to really learn and get some knowledge from what you learned, you need to understand how to make things well, and why that aproatch is better than others.

  17. #16
    Join Date
    May 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt against WPF

    thanks guys,
    espicially to tbscope

    i will have a look on this GraphicsView class - the possiblities seem to be easiely available

  18. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt against WPF

    If you are looking at a direct equivalent of WPF, you should pay close attention to QML although if all you are after is implementing a calendar then I doubt QML will have anything extra to offer besides what Graphics View offers.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  19. #18
    Join Date
    May 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt against WPF

    Quote Originally Posted by wysota View Post
    If you are looking at a direct equivalent of WPF, you should pay close attention to QML although if all you are after is implementing a calendar then I doubt QML will have anything extra to offer besides what Graphics View offers.
    you had good expierences with it?

  20. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt against WPF

    I have seen QML in action but didn't yet find time to do anything with it myself. Anyway it is a declarative rectangle and state-machine based language for defining user interfaces and simple interactions between elements that allow you to do some fancy stuff. But I think a calendar doesn't require any fancy stuff so superiority of QML over pure C++ in this case is very limited.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  21. #20
    Join Date
    Mar 2010
    Posts
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Qt against WPF

    You should look for a few samples/tutorials before starting to develop your application. You should also get some books about Qt (you can find a list of books here, and a free online book here).
    Come to the dark side. We have cookies.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.