January 30, 2011

rootshell rootshell
Lab Rat
21 posts

Qt video tutorials on YouTube

Page  
1

Hello all,

I have been a long time reader of these forums, and decided to join and make my first posting.

While in the process of learning QT, I have been creating YouTube videos as a way to give back to the community that has taught me so much.

VoidRealms on Youtube [youtube.com]

I would very much like feedback, and if you guys (and gals) know of any other good video tutorials let me know!

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

62 replies

January 30, 2011

peppe peppe
Ant Farmer
1025 posts

(I think this thread should be moved to the Qt in Education forum…) [done -mariusg]

Wow! That’s some HUGE work! Kudos!

The little problem with video tutorials is that if you do a mistake you can’t fix the video :-)
(Ok, you can add some “baloon” from Youtube or so, but it’s definitely harder rather than just changing some text in a document :-))

For instance, it’s Qt, not QT :-)

Are you planning to collect comments / feedback / bugreports in here?

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

January 30, 2011

rootshell rootshell
Lab Rat
21 posts

I know, videos can be a pain.

have found over the years to be a good learning tool.
I found if I can’t explain it to someone else then I really don’t know it :)
And places like YouTube allow for some nice feedback.

I will collect comments / feedback / bug reports anywhere I can get them, I am just here to learn and share what I learned.

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

January 31, 2011

Alexandra Alexandra
Hobby Entomologist
607 posts

31 video tutorials?!? I’m impressed. o_O

 Signature 

*THE CAKE IS A LIE*
Web Community Manager - Qt Development Frameworks

January 31, 2011

peppe peppe
Ant Farmer
1025 posts

First of all: I do humbly apologize for the nitpicking approach, but, all in all, you asked for feedbacks, so… :-)

So, here’s the first round of reviewing:

General

  • It’s Qt, not QT :-P

1

  • You can develop “Commercial” software (i.e. closed source, not free-as-in-beer) even with the LGPL. But you’re right on insisting on what the biggest difference is (if you modify Qt you have to share the modifications).

2

  • 01:00 add a note about why the two inclusion header are different? <QDebug> vs <QtCore/..:>
  • 01:43 you’re not creating a QString, but using the QDebug::operator<<(const char *)
  • 02:06 QtCore is not a framework but a module/library
  • 03:20 same thing
  • 03:43 TARGET isn’t the name of the project but the name of the executable to build
  • 03:43 CONFIG += console links to the Windows console subsystem, or you won’t be able to see any console output (that’s why a console opens)
  • 04:15 QT += core doesn’t “add” anything to a specific file; you still must #include anything you use, or the compiler will complain (and Creator won’t autocomplete, etc.). The list that pops up is of classes, objects, macros, functions etc. you got by #including QCoreApplication and QDebug, and it does NOT contain EVERYTHING available in the core module (an #include <QtCore> would do that). For instance, QAbstractItemModel is missing from that list.
  • 04:42 Same thing; you get the QString #include “for free” because of other includes, but you’re not including it explicitely (nor including every header from core), which is bad practice

3

  • 02:53 … and it’s different because you’re using QApplication and not QCoreApplication!
  • (Oohh adorable kitten :D)
  • 03:18 Here a lot of clarification is needed, or perhaps it would be best to skip some parts for now and explain better later. You’re not “including the namespace Ui”; that’s a standard forward declaration for the class Ui::MainWindow, which is NOT the ui file but it’s generated from it by uic. The fact that your C++ class in mainwindow.h has the same name of the Ui::MainWindow class is pure coincidence, and it should be stressed that they’re not the same thing
  • 03:42 Q_OBJECT doesn’t “convert” a class into a QObject; that’s done by inheritance itself (but you need to inherit from QObject to be able to use Q_OBJECT). Q_OBJECT adds support for signals and slots, translations, qobject_cast and a lot of other things.
  • 03:47 “Everything in Qt”? That’s just plain wrong, all value classes (for instance) don’t inherit from QObject at all.
  • 04:45 You forgot to say that the ui member is initialized with a new on line 6, therefore there’s a delete in the dtor

4

  • 01:05 You must not select anything to successfully apply a layout to a toplevel widget! In fact, your layout does not make the widgets expand to fill the available space like they should, but you must resize the layout manually
  • 03:22 Q_OBJECT macro has nothing to do with the fact you can use the connect method (it doesn’t “provide” it or so), and connect is not a macro but a method of the QObject class

5

  • 02:08 An action triggers a signal, not an event
  • 02:20 How about spending some words on what that automatically create method is (a slot) and how’s gonna get connected to the action triggered signal?
  • 06:40 setModal(true) + exec() is nonsense; exec() always shows the dialog as modal
  • 09:15 “When the qmainwindow closes the dialog will also be destroyed” is incorrect, s/closes/is destroyed/ would be better (or you should explain what the DeleteOnClose flag does); if your mainwindow is kept open (and usually mainwindows are long-lived windows), you’re leaking memory!

6

  • 01:58 Actually, a QLabel and a QLineEdit call for a form layout, not a horizontal layout
  • 02:34 You can also introduce the “Preview” designer feature, to avoid to recompile every time
  • 03:50 Better practice: connect Cancel to reject() slot
  • 04:12 Buddies don’t accept “input” for other widgets —- it accepts the input focus on behalf of a QLabel when the user presses the label’s shortcut key sequence. It is therefore wrong to state that the focus is transferred to the buddy widget (a QLabel can accept focus because of its text interaction flags, and you can for instance select text or activate links).

7

  • 02:16 Why a QLabel on the heap? (which’ll produce garbage?)
  • 02:58 “Haven’t created a window” is misleading —- just any widget without a parent becomes a window.
  • 04:55 “All Qt widgets are HTML aware” is a quite strong assertion :-) They aren’t. Just QLabel, QText* and some other are.
  • 05:40 Well, the fact that the Qt engine is smart enough is not a good reason to teach people bad habits :P

9

  • 00:40 1) typo on QtCore (you typed QTCore) 2) QtGui includes QApplication, so nonsense to bring it in as well 3) QtGui includes QtCore, samething
 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

February 1, 2011

peppe peppe
Ant Farmer
1025 posts

11

  • foreach is not a method, but a Qt (not standard C++!) macro
  • 06:40 When you build a QDir object with the default ctor, the current working directory of the process is used, not the “system” one (which doesn’t exist)
  • 06:25 The explaination is incorrect; you can create with mkdir an arbitrary directory, but it’ll just create THAT directory and not all the parent directories that are necessary to create that one (which is what mkpath does). Mkdir does not enforce the directory to be a subdirectory of the CWD.
  • 11:16 Dot and dot-dot do not refer to the parent and the parent-parent, but the directory itself and its parent.

12

  • 03:10 WriteOnly and Text are actually defined in QIODevice; a better style is to prefix the enum with the scope of the class that declared them, rather than an arbitrary subclass.
  • 03:36 Minor typo on “writting”
  • 03:48 Since you’re teaching good practice, it is important to stress that. (Calling close() isn’t mandatory since the QFile object will be destroyed at the end of scope, closing it. The explicit call to close() becomes therefore a matter of “style”/“habit”).
  • 04:38 The QTextStream is called “out” instead of “mOut”. Why not keeping your naming convention for variables?
  • 04:44 Not a reference, but a pointer to
  • 05:05 This is an error: the explaination is correct, but you actually want to call “out.flush()”, not (only) “mFile.flush()” there, otherwise you’re not flushing the QTextStream’s internal buffer but QFile’s one. After out.flush() you can call mFile.flush(). Again, it should be stressed that you’re introducing flush() just for the sake of argument, because QTextStream automatically flushes when it’s destroyed (and QFile automatically flushes when it’s closed, and it automatically closes when it’s destroyed => you can remove the last two lines altogether and have a correct behaviour). Instead, you call mFile.close() without flushing the QTextStream, which is an error!
  • 06:00 Why QString and readAll()? For consistency, you wrote a char array, then you read back a char array, or create a QString in the write method and read back a QString.
 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

February 1, 2011

rootshell rootshell
Lab Rat
21 posts

WOW… awesome feedback!

Can I have permission to re-post your comments on you tube until I have time to go back and re-do the videos with corrections? That way someone stumbling across the video will have the same corrections….for both Qt and C++ as I am still new with both.

As a side note, I did watch the Qt video tutorials
Official Videos Link [qt.nokia.com]

And found them very helpful, but they seemed more a marketing tool for people to take the training classes – I was really looking for the “how to get things done” videos which is why I started making my own, not only does it help me learn by doing, but also helps me find my own flaws :)

Unfortunately my time and resources are limited which is why the videos have a very “home made” style…any chance we can get more official videos from the Qt staff?

I will take time to go through all your feed back as I am going to keep making videos (I am in love with Qt) and want them to be as accurate as possible.

Thanks again!

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

February 1, 2011

tbscope tbscope
Lab Rat
26 posts

There are some comments about the videos about threading here:
http://www.qtcentre.org/threads/38256-QT-video-tutorials-on-YouTube

 Signature 

 

February 1, 2011

peppe peppe
Ant Farmer
1025 posts

rootshell wrote:
WOW… awesome feedback!

Can I have permission to re-post your comments on you tube until I have time to go back and re-do the videos with corrections? That way someone stumbling across the video will have the same corrections….for both Qt and C++ as I am still new with both.

Of course you can! Since redoing the screencasts can take a lot of time, you can simply set up an errata page, or add the comments in each video’s description and use the “notes” feature that Youtube provides to add references to them.

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

February 3, 2011

rootshell rootshell
Lab Rat
21 posts

lol blizzard here in the states, have not had time to do anything but snow blow the driveway :)

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

February 3, 2011

Alexandra Alexandra
Hobby Entomologist
607 posts

This is turning into an epic thread. Wow! Thanks peppe for the great feedback on the videos. And of course the videos themselves are pretty neat!

I was wondering if it made sense to move all of this to the wiki for easier discovery and edits on the feedback itself…

rootshell wrote:

As a side note, I did watch the Qt video tutorials
Official Videos Link [qt.nokia.com]

And found them very helpful, but they seemed more a marketing tool for people to take the training classes – I was really looking for the “how to get things done” videos which is why I started making my own, not only does it help me learn by doing, but also helps me find my own flaws :)

Really? Which videos did you watch? I didn’t have the same impression but I’m curious to hear how we could improve. As you already mentioned video production needs humongous efforts if you want to reach a professional result.

We could try though. ;)

 Signature 

*THE CAKE IS A LIE*
Web Community Manager - Qt Development Frameworks

February 3, 2011

gpreddy gpreddy
Lab Rat
1 posts

Superb Work… These Videos will help a lot for a newbie to learn the things in Qt…

 Signature 

br,
GPReddy,
.(JavaScript must be enabled to view this email address).

February 4, 2011

rootshell rootshell
Lab Rat
21 posts

@peppe

Have been taking your comments and posting them to the notes of the videos:
http://www.youtube.com/watch?v=JtyCM4BTbYo [youtube.com]

Pretty neat how it jumps right to the spot in the video

Thank you SO much for your feedback I am learning a lot!

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

February 4, 2011

rootshell rootshell
Lab Rat
21 posts

@ Alexandra

Don’t misunderstand, I loved the official videos, and even purchased both official Qt books because of them, those official videos are what sparked my interest in Qt…I actually wish there was a complete set of those videos online (the entire KDAB training course)

Like many programmers, I was faced with a problem…make a multi-platform application. After researching Python, Java, Mono, and C++ (Qt vs others), I came to the conclusion that many others before me have – Qt wins, no contest. I found the official videos and from the moment I watched Mirko Boehm explain a basic “hello world”, I was hooked.

Unlike others, I was not bothered by the trainers accents.

My only comments about the official videos:

Keep things simple, I am very new to C++ and Qt, some of the concepts went by so fast I had to re-watch it a few times. But one thing I love about Qt is how it makes working with C++ very easy!

Perhaps explain things in a manner that a new student with no experience would need.

But keep in mind these comments are coming from someone that is struggling with a new language (C++), a new IDE (Qt Creator), and a new lib (Qt) – I have over a decade of experience with other languages (C#, VB, Pascal, a bit of Java and Python), but three new things at once is a bit of a learning curve, and honestly I have avoided C++ all these years because of it’s complexities :)

Admittedly most of my comments and frustrations with Qt and C++ come from my general lack of understanding of both :)

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

February 5, 2011

tbscope tbscope
Lab Rat
26 posts

34

  • If you don’t want to block the main thread while waiting for another thread to finish, you can of course use the finished signal.
 Signature 

 

February 5, 2011

l.v.p l.v.p
Lab Rat
31 posts

that’s really nice job. And because I’m beginner in Qt I will definitely watch your videos.

Page  
1

  ‹‹ How to use Qt to call C++ standard library?      Learning Qt & QML : What path to follow? ››

You must log in to post a reply. Not a member yet? Register here!