PDA

View Full Version : Programming patterns, code structure? C++, Qt & wxwidgets



nardev
2nd December 2010, 06:14
Basically i would like to see hod the classes are organized and how GUI functions with code behind.

I need good, tutorial, document or book where i can read/learn more about code design patterns for desktop applications in C++.

Also if there is good open source project to learn more about that it would be very very helpful.

Preferable type of application is app that works with database, enter some data to database and give some output.

I prefered Qt but also wxwidgets would be great.

Platform preferable for Linux.

Thank you very much.

tbscope
2nd December 2010, 07:03
http://cartan.cas.suffolk.edu/oopdocbook/html/

nardev
2nd December 2010, 07:05
i have that book for Qt3 but it's not what i'm looking for :(

tbscope
2nd December 2010, 07:13
What do you want?

nardev
2nd December 2010, 07:14
as i asked:



Basically i would like to see hod the classes are organized and how GUI functions with code behind.
or if there is good open source project to learn more about that.

Preferable type of application is app that works with database, enter some data to database and give some output.

tbscope
2nd December 2010, 07:19
http://doc.qt.nokia.com/

nardev
2nd December 2010, 07:20
Bro, i know for all of those but i need "short cut"

practical example how is that done.

tbscope
2nd December 2010, 07:44
What is a "short cut"?

nardev
2nd December 2010, 08:33
forget about everything

if someone can help me and provide me with good practical tutorial and/or example of C++ Qt or wxwidgets application that works with database, has 3 or more forms for editing data and few outputs i would be very grateful.

I need pattern and practical example how classes are organize in such a project.

I want to see full, working project where i can see good uses of container classes and child classes + GUI

I would be very very grateful for this.

wysota
2nd December 2010, 08:54
You can find lots of applications at qt-apps.org.

You are very unclear about what you want, it's highly unlikely you will get what you want with such attitude. If you want to learn gui programming, you can't do it based upon one application. There are C++ patterns you can use and they are valid for GUI as well, that's what I'd start with if I were you.

nardev
2nd December 2010, 09:06
Ok,

you are right i think.

i'm sorry about that, the best would be to erase this topic, i was very unclear :(

i'm sorry

marcvanriet
2nd December 2010, 12:08
If you want examples, there are a lot of them provided with Qt. Also about database programming.

And I would definitively choose Qt over wxwidgets ;)

Best regards,
Marc

nardev
2nd December 2010, 12:09
but i like wxwidgets licence more :)

wysota
2nd December 2010, 16:23
but i like wxwidgets licence more :)

Correct me if I'm wrong but both wxWidgets and Qt are licenced under LGPL.

nardev
2nd December 2010, 16:28
The way those two projects are maintained/built are quite different.

wysota
2nd December 2010, 16:31
The way those two projects are maintained/built are quite different.

What does the licence have to do with this?

Architecture of Qt is light years ahead of that of wxWidgets, that's what counts most.

nardev
2nd December 2010, 16:40
Compare:

http://qt.nokia.com/products/licensing

http://www.wxwidgets.org/about/newlicen.htm


The wxWindows Licence is essentially the L-GPL (Library General Public Licence), with an exception stating that derived works in binary form may be distributed on the user's own terms. This is a solution that satisfies those who wish to produce GPL'ed software using wxWidgets, and also those producing proprietary software.

where Qt does this:



Must provide source code changes to Qt:
Source code must be provided

Can create proprietary applications:
LGPL: Yes, in accordance with the LGPL v. 2.1 terms
OR
GPL: No, applications are subject to the GPL and source code must be made available


It's not exactly the same i think.

wysota
2nd December 2010, 16:40
Do you intend to modify Qt or wxWidgets?

nardev
2nd December 2010, 16:49
I understand that Qt is way in front with capabilities i just said that i prefer more wxwidgets model of licencing.

wysota
2nd December 2010, 16:49
Again, have you ever modified a single line of code from wxWidgets?

nardev
2nd December 2010, 16:50
No!
But i Qt i did.

Although i'm not on that level.

wysota
2nd December 2010, 16:52
No!
So in what way is the licensing of wxwidgets better?


But i Qt i did.
And you wanted to keep those changes only for yourself, yes?

nardev
2nd December 2010, 16:56
Imagine that one day you have to maintain so complex application that exceed libraries/toolkits that you use. That is not so rear if you have application that you develop for 4-5 years and have complex structure. Often even switching to next version of toolkit that you use it painful.

wysota
2nd December 2010, 17:01
Imagine that one day you have to maintain so complex application that exceed libraries/toolkits that you use. That is not so rear if you have application that you develop for 4-5 years and have complex structure. Often even switching to next version of toolkit that you use it painful.

I don't see how this has anything to do with the subject.

Timoteo
2nd December 2010, 17:06
Look for "Advanced Qt Programming" by Mark Summerfield at your local bookstore. It is a decent read.

nardev
2nd December 2010, 17:15
Look for "Advanced Qt Programming" by Mark Summerfield at your local bookstore. It is a decent read.

Thank you, i'll

marcvanriet
2nd December 2010, 18:13
About the licensing : what wysota is trying to say is that you don't have to disclose the source code of your own program if you create something in Qt. "You're own program" includes any custom Qt widgets that you may have written.

Only if you modify something of Qt library iitself, you must provide the code. I can't imagine that you would want to modify something of the Qt library and don't want to share that with the world.

And for that other topic you raised : if your application gets really really really big and complex, then I think it is also better to use Qt because of its (IMHO) cleaner architecture. If a next revision of Qt or WxWidgets is released that requires modifications to your application, you can stick with the older version or bite your tongue and implement the changes. WxWidgets or Qt won't be any different in this matter.

Best regards,
Marc

frank100
10th December 2010, 11:40
Going back to the original question.

I think that the spreadsheet example of QT can show you the most important stuff at once. If you are interested in databases you should go for model/view examples.

Start using QT Designer from day 0. That way you can delay learning layout, menus... and focus on what you want.

nardev
10th December 2010, 12:30
Going back to the original question.

I think that the spreadsheet example of QT can show you the most important stuff at once. If you are interested in databases you should go for model/view examples.

Start using QT Designer from day 0. That way you can delay learning layout, menus... and focus on what you want.

Thnx, i did that. How ever tbank you.

franz
10th December 2010, 13:06
Thnx, i did that. How ever tbank you.

Push the "Thanks" button below his post ;)

nardev
10th December 2010, 15:48
:D sorry i was on my mobile :D i didn't see it..