Results 1 to 7 of 7

Thread: QT video tutorials on YouTube

  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QT video tutorials on YouTube

    Hello all,

    I have also posted this at the offical QT developer forums...

    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.

    http://www.youtube.com/user/VoidRealms

    PLease let me know if you have any feedback!

  2. The following user says thank you to rootshell for this useful post:

    ladiesfinger (30th January 2011)

  3. #2
    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 video tutorials on YouTube

    I've watched a couple of videos and they are pretty good.
    In fact, they are better than most of the eLearning videos of Nokia. Yesterday I sent a comment to Nokia that they should use native english speakers or at least put subtitles on their videos because the audio is bad and the speakers are hard to understand.

    You seem to be a native english speaker? Your videos are much more comfortable to listen to.

    Now some comments on the videos explaining QThread.
    I don't know if you know this, but the QThread object uses the main event loop.
    In part 4, you got away by not using slots :-)
    Signals usually are not the problem, but slots in another thread are. You must have an event loop running in your thread. And you must make sure that the slot code is executed inside the thread. Otherwise strange problems occur. Recently, someone here on this forum created a multi threaded client/server application and got synchronization problems. It turned out that a slot was defined as a member of the QThread subclass itself. When this slots is being called from within the main event loop, the code in the slot is being run inside the main thread.

    One of the correct ways to solve this is to subclass a QObject, put all the code you want to run in the thread (including signals and slots) inside that QObject subclass.
    In the main thread (in your main dialog or window for example) create an object based on this QObject subclass.
    Create also a QThread object (don't subclass it).
    Connect all your signals and slots.
    Move the QObject based object to the QThread object and start the thread.

    Example: http://www.kdedevelopers.org/node/4377

    Well, this comment is just because I think that part 4 of the QThread tutorial will (involuntary) want people to add a slot like you've added the signal. 90% of the time it'll work and no problems will be seen. But afterwards that's a real nightmare to debug.
    Last edited by tbscope; 30th January 2011 at 05:06.

  4. #3
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: QT video tutorials on YouTube

    Thanks for posting the videos, here is some constructive criticism:

    1. First of all; the way you are using the mutex in your code is wrong. You are creating the QMutex with a local scope. The idea is to guarantee exclusive access between threads -- in your example each thread would just lock its own mutex, it's not mutual at all. What you should do is to declare the mutex as a class member. Besides, defining 'Stop' as a public member is probably not a good idea either.

    2. In your explanation, you seem to confuse deadlocks with race conditions. A race condition can happen when multiple threads access and manipulate some sort of shared resource concurrently. If an operation is not atomic, it can be interrupted in mid-operation; this can lead to undefined behaviour or even the program to crash. Mutual exclusion is therefore necessary to enforce atomicity for a specific code segment.

    A deadlock typically happens when two threads find themselves waiting for each other to release a lock.

    3. Most of the time, it is not necessary to subclass QThread, this article has some interesting points: http://labs.qt.nokia.com/2010/06/17/...oing-it-wrong/

    The only valid reasons I can think of for subclassing QThread is to add functionality that QThread doesn’t have, e.g. perhaps providing a pointer to memory to use as the thread’s stack, or possibly adding real-time interfaces/support. Code to download a file, or to query a database, or to do any other kind of processing should not be added to a subclass of QThread; it should be encapsulated in an object of it’s own.
    There are also many ways to avoid dealing directly with locking primitives altogether in Qt thanks to the QtConcurrent API and by using signals and slots.

  5. #4
    Join Date
    Aug 2010
    Location
    Chennai
    Posts
    21
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT video tutorials on YouTube

    Thanx . I've subscribed to your channel .

    Also if you know somebody who uploads PyQt Tutorials , then specify here . It'll help a lot.

  6. #5
    Join Date
    Oct 2010
    Location
    Porto Alegre
    Posts
    19
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QT video tutorials on YouTube

    Nice videos.

  7. #6
    Join Date
    Jan 2011
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT video tutorials on YouTube

    wow thank you for the feedback!!!

    I learned more about threading from those links then from 3 Qt books.

  8. #7
    Join Date
    Mar 2013
    Posts
    2

    Default Re: QT video tutorials on YouTube

    thanx for the video

Similar Threads

  1. youtube upload
    By ernie in forum Qt Programming
    Replies: 15
    Last Post: 2nd September 2015, 14:29
  2. play a video from youtube
    By graciano in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2011, 07:17
  3. need help youtube APIs with qt
    By doforumda in forum Newbie
    Replies: 5
    Last Post: 18th November 2010, 20:09
  4. Downloading a video from youtube
    By Faster in forum Qt Programming
    Replies: 21
    Last Post: 28th November 2009, 12:46
  5. Video Tutorials or step by step guides?
    By Dumbledore in forum Newbie
    Replies: 2
    Last Post: 10th October 2007, 08:33

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.