Results 1 to 3 of 3

Thread: how to add a new c++ class in widget application

  1. #1
    Join Date
    Dec 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default how to add a new c++ class in widget application

    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

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to add a new c++ class in widget application

    Maybe you should start with the Qt for Beginners tutorial and working through some of the official Qt tutorials and examples that come with your distribution. And you can refer to the Qt Creator manual 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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Dec 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to add a new c++ class in widget application

    thank you so much

Similar Threads

  1. Accessing GUI widget from different class
    By Mobility in forum Qt Programming
    Replies: 8
    Last Post: 5th December 2012, 20:29
  2. show object (scene) in widget in class class mainwindow
    By rimie23 in forum Qt Programming
    Replies: 8
    Last Post: 1st May 2012, 16:15
  3. Replies: 7
    Last Post: 18th August 2011, 14:43
  4. Linking C++ Dll containing class in QT Application
    By ujwala in forum Qt Programming
    Replies: 4
    Last Post: 9th May 2011, 08:32
  5. Not accessing widget outside the class
    By santosh.kumar in forum Qt Programming
    Replies: 6
    Last Post: 18th May 2007, 12:57

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.