[Please recommend] Tutorial on how to use Widgets
-
In Qt Demos are many program using Widgets, look at there :) For me (I'm to new with Qt) this is the best form of lerning, because you can see source code and model on him :)
-
There are many examples in the "Qt documentation":http://doc.qt.nokia.com/4.7/all-examples.html . One group ("Main Window Examples":http://doc.qt.nokia.com/4.7/examples-mainwindow.html ) contains all stuff of main windows, dock windows, statusbars, toolbars etc.
The first onw ("Application Example":http://doc.qt.nokia.com/4.7/mainwindows-application.html ) contains a custom status bar. I would look at this example and start there.
-
Thanks Zlatomir, I was quite confused about slots (and only know a little about signals), I'll be sure to read the docs on them tomorrow.
BlackDante: I've been through a lot of them, but really the "Application Example" Gerolf mentioned was the only one I found useful. The Rich Text and Normal Text [with svg] were interesting, but not as helpful as the aforementioned.
Gerolf: Thanks, my project so far is pretty much that application, minus the menubar and using QScintilla2 instead of TextEdit... in the screenshot in the bottom right-corner it says "MOD", however the actual program only has the other (temporary) text... because the example function only contains;
@void MainWindow::createStatusBar() { statusBar()->showMessage(tr("Ready")); }@And the documentation for the "createStatusBar()" function was extremely difficult to follow, pretty much useless. I've ended up spending hours going through text-editor source-code (written with Qt) to try and find the few lines for columns, rows and filesize... to no avail.
If you could recommend a statusBar tutorial it would be greatly appreciated !http://i52.tinypic.com/r1lq51.png!
Also the "Main Windows Examples" I only found a few hours ago, the dock examples especially look useful =]
Thanks again for your continual advice,
Alec Taylor
-
Maybe it's time to step back a bit. You try to make a quite big application for a beginner - both in C++ an Qt. I'm quite sure you will stumble over a big bunch of problems. It would be much more easier for you if you start with the tutorials (e.g. the "Getting Started with Qt":http://doc.qt.nokia.com/stable/gettingstartedqt.html) and then look at the examples. They are documented and commented in Qt Assistant (and in the online docs, which are identical). After that you have a more thorough understanding of all the concepts behind Qt and things will much more easier for you.
If you were a craftsman you would not build a cathedral in the very beginning too, why should it be different in software engineering?
-
Hi,
I builded your app completly from the examples of "Application Example":http://doc.qt.nokia.com/4.7/mainwindows-application.html .
It's just a quick prototype, no guarantee for anything :-) Here is the "link to the source...":https://docs.google.com/uc?id=0B8PL33_OKajLMTkwNjYxOGItYmYzMC00ZDYzLWEyODItYjQzZDJiMTNkOTMy&export=download&authkey=CJ-BvdAC&hl=en!http://lh6.ggpht.com/_m1PNLlZctqY/TR-zz3ubLkI/AAAAAAAAADk/0BtWxOVXhdM/s640/TreeEditor.jpg(Example image)!
-
Thanks, it seems really quite good. A few off by one errors [in the status-bar] etc., but all in all, tis pretty great!
I've only made a few modifications (the dock is now movable/closable/floatable)...
The only bad thing about this is; I only designed it, I didn't code it :(
I'm sure I've learned a lot by reading the code, but I'm sure I could've learned more by coding it myself...
On the other hand, I've now got quite a solid grounding to begin work on the IDE... so I suppose it isn't all bad!
A quick question though; are all Qt applications this slow to startup? — It's taking around 10 seconds to startup on my computer [quad-core, 4GB of RAM, 64-bit Windows]... I was thinking maybe moving to a different cross-platform UI framework... I'm sure it's the QFileSystemModel, so maybe that can be reordered to allow the whole application to start and a message saying "Loading..." in that dock for the first 10 seconds...
Thanks again,
Alec Taylor
-
No I never experienced a slow startup for Qt applications.
-
Alec, you should start the application and delay the folder scan and display a "QProgressDialog":http://doc.qt.nokia.com/stable/qprogressdialog.html
Or do it at startup and show the user a "QSplashScreen":http://doc.qt.nokia.com/stable/qsplashscreen.html
-
The folders are displayed with QFileSystemModel, which is in fact an asynchronous model.
On mymachine, when I start the release version from the explorer, it takes about 0.5 - 1 sec till the window is there. If you start it from QtCreator, it takes longer, that's correct.