everybody, I'm beginner in programming, I've just finished my course on C++, I want to train my skills and try to write some programs on C++ with graphic windows (not console programs, I did it during all my course), I want to start working with QT, is it good idea, or I need to begin with something simplier, thanks in advance
Qt is, among other things, a great framework for developing applications with GUIs. The only way to know if it is appropriate is to try it out. I suggest going through this Qt tutorial, which involves creating a simple game.
To begin with Qt is an excellent idea. Qt is already simpler.
You should begin with these official tutorials: http://doc.qt.nokia.com/4.7-snapshot/tutorials.html
GUI program is a big change from a console app - the difference is that you don't know when things are going to happen and in what order.
But Qt is a very good place to start, the signal/slot mechanism is much clearer (IMHO) than the hidden macros of MFC or some other gui toolkits.
Related
I am making an interface for a free-and-open project I'm working on. I know that eventually I'll need it to do some heavy lifting with 3D graphics, so I'll need access to the GPU. I stumbled upon the Qt framework and its use of OpenGL. Their cross-platform properties are very appealing to me, and I've learned a lot about building run of the mill / plumbing kinda stuff on Qt, but using OpenGL is more challenging than I'd have hoped.
I've rooted around in several books and on Google for good tutorials, but they jump around, or don't seem to quite work when I try to implement them. The examples presented in the IDE have a lot of bells and whistles, and almost none of it is explained. When I tried implementing the example from "C++ GUI Programming with Qt 4", it didn't compile properly. There are a set of somewhat famous "NeHe" tutorials on OpenGL, but they are not implemented with Qt and the companion series on made by "The Independent Qt Tutorial" is very brief.
I would be very grateful for an example that goes very slowly and introduces Qt and OpenGL together. There is a blog entry that made things a lot clearer when I read it from a man named Daniel Eder. But he hasn't actually written code in that part of the discussion.
Specifically, if I could just get something really simple working in Qt like a cube I could rotate or maybe something more sophisticated like a sphere, I'd have enough traction to understand other tutorials. I definitely want to do the coding myself, but I'm having trouble even getting to the place where I can fool around, haha.
Here are some places with tutorials and examples:
There is also a Wiki in the Qt Dev network that you may find useful. I particularly suggest Wesley Stessens's blog that helped me personally a lot.
Nehe website provide a good tutorial where you can find some of the examples given ported to Qt.
There are also many QtOpenGL examples in Qt Creator/SDK that can be handy. I strongly suggest you take a look at them as they are very simple to understand and to play around with.
With that my next step was to read these two books:
C++ GUI Programming with Qt 4, 3rd edition
OpenGL Programming Guide: The Official Guide to Learning OpenGL, 7th edition
I have also been very happy when looking for help in the related Doc's/Reference manuals, etc.:
Qt Documentation
QtOpenGL module
OpenGL Documentation
At this level, you may solve your implementation problem straight away : )
Good luck.
I have to port a project from Borland C++ Builder 5.0 under Windows XP to Qt 4.7.1 using g++ under Windows 7/mingw. The libraries and command-line utilities are done, and now I have to tackle the GUI applications, which use Borland VCL.
Can anybody recommend any tools or libraries to make this task easier?
Does anybody have any experience of this?
Edited to add: Well, I took the bull by the horns, and implemented the GUI from scratch. And I have to say, the commentators were right: I can't see any way of using the existing Borland GUI to ease the process.
There are several big differences between VCL and Qt that will make an automatic conversion process quite difficult.
Qt uses signals and slots and inheritance where VCL uses events.
VCL components use absolute coordinates and Qt uses layouts. Of course, you could use absolute coordinates also with Qt, but the GUIs would be quite awful then.
VCL's TListBox and TTreeView classes are quite different from Qt's View and Model classes (although you could use QListWidget and QTreeWidget instead).
I guess it is much faster to design totally new GUIs with Qt than to create even a mediocre VCL-to-Qt converter. And the code will be much easier to maintain. I suggest that you take one VCL form of medium complexity and recreate that with Qt. After that you can make an estimation of the total recreation work. Also you will have a better understanding about the feasibility of a conversion tool, which you most probably would need to make by yourself.
Someone has written a tool to convert dfm's to qt ui files:
http://sourceforge.net/projects/dfm2qt4ui/
Its has a few small bugs but it can save several hours of time porting form designs. In some cases redesigning specific forms is preferable - but in many cases, having labels and roughly equivalent controls positioned for you saves a lot of point-and-click action.
I agree with the current consensus that automatic conversion from VCL to QT is not a good idea because the concept behind both is very different, and you are much better off learning "the QT way" and using that from the start.
However there is one major step that nobody has yet mentioned: refactoring! Before starting, make sure you refactor the original forms to remove as much business logic as possible and leave only what is really GUI code. It depends on how good your architecture already is of course, but the VCL designer tends to encourage putting as much as possible in forms (even going as far as having invisible "data forms" with non-visual components!), so you often find a lot of stuff in the form that shouldn't be there.
Im new to this website, and mostly to any type of programming. Recently Im trying to learn C++(Game Programming), and my father wants me to make him a web-based application, that flashes the window wether there is any sound playing(I believe it's called an audio visualization), I talked to my brother, and he said that I should do an external application in C++ or Java. He lend me a book about GUI with QT, but the problem is I don't know how or where to start with, Im installing the QT, although I dont know how to add a library to Microsoft Visual C++(I tried but I had some problems, hopefully qt will do everything automatically), but I wanted to know if anyone has any advice,suggestion or any help to give me. Im pretty much a beginner, this will be my 1st application ever made(with C++ at least) and Im really scared. Thank you for the time wasted reading this, I know I wrote a lot, but I wanted to be the more descriptive I could.
Thank you beforehand.
This might be a bit late, but they are right.
Though, if you really want to, I would look into FMOD.
Here's an example using FMOD & OpenGL.
http://segfaultlabs.com/devlogs/sound-equalizer-with-fmod-and-opengl
If that's what you're looking for, if not, email me I am sure I could help you out!
Is there a terse introduction to GUI programming with Qt, meant for programmers with a decade's worth of experience (but who don't have any exposure to Qt). I am looking for something that gets one started quickly, and covers all the advanced stuff (including best-practices and patterns). Was looking for something like this book - Advanced Qt Programming - which alas, isn't out yet.
I would start with Qt Architecture, Graphics if you need it, IO and Networking, Model/View (learn and love it), Various other APIs, and finally How To's and Best Practices. The Qt Documentation is one of the major strengths of the toolkit. In many cases you won't need other resources. They even give a quick overview of tips for learning here.
Note: I'm linking you to the next release documentation since I think it looks better, the current release is here. When reading things over, just look for the comment on when the feature was introduced to make sure it will be available for the release you are using.
Programming with Qt, Second Edition
In the past I've had some experience of Qt in C++. I've now started using PyQt, and finding it a bit bewildering. There doesn't seem to be any definitive source of documentation, apart from a small amount at Riverbank. I guess the first thing I'd like to know is that there's an initial hump with PyQt, and it does get easier. [Edit: The main problem I was having was due to a typo - init not __init__. I'm not finding it so hard now :P]
The PyQt docs talk about new style signals and slots for PyQt, as well as old style. They suggest that the new style is better, but I was wondering if that is what most users of PyQt do.
Yes, that is. New syntax is more clear, so why not?
Note, that when you trying to connect slots by name, you must call connectSlotsByName explicitly, since there no preprocessor that will work before execution and connect them.
PS: Beside, C++ syntax for signal/slot connnection is just ugly, and old PyQt syntax was pretty similar without any reason, so I was glad to see this change in PyQt.
PS2: There was the question here recently about this, check it out.
For reference see: PyQt Class Reference - it's quite comprehensive and goes into details with examples. Most of the examples are in C++ and although I'm something of a Python newbee, I didn't find it difficult to translate into Python.
If you're an experienced developer and starting to use Python and PyQt, this is a pretty good book - about the only full scale book on the subject that I know of: Rapid GUI Programming with Python and Qt.
Signals and Slots: I always use the new syntax for signals and slots in PyQt, which is simple and elegant - much more 'pythonic'. PyQt is great, but in many respects it's still very C++ like - the more they do to 'pythonate' it, the better.