PDA

View Full Version : how to add a new c++ class in widget application



rolly4444
22nd December 2016, 18:43
i don't know how to add a new c++ class in qt widget application because i learn qt from some youtube videos but the instructor used qt4 so he added a new c++ class and wrote the base class QThread this version has a type information: inherits QObject section which is not existing in qt 5.7
anyone can help

d_stranz
22nd December 2016, 19:26
Maybe you should start with the Qt for Beginners tutorial (https://wiki.qt.io/Qt_for_Beginners) and working through some of the official Qt tutorials and examples (http://doc.qt.io/qt-5/qtexamplesandtutorials.html) that come with your distribution. And you can refer to the Qt Creator manual (http://doc.qt.io/qtcreator/index.html) to learn how to manage projects and files.

These resources are a much better way to learn Qt than watching YouTube videos.

As for QThread, it hasn't changed much between Qt4 and Qt5, so whatever information you got from the YouTube video is probably wrong. QThread uses QObject as a base class in both Qt versions.

rolly4444
23rd December 2016, 07:03
thank you so much