Results 1 to 2 of 2

Thread: QT GUI Thread

  1. #1
    Join Date
    Sep 2017
    Posts
    23
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QT GUI Thread

    I have a problem with assigning a parent to the thread in the constructor of the dialog constructor:
    Qt Code:
    1. Dialog::Dialog(QWidget *parent) :
    2. QDialog(parent),
    3. ui(new Ui::Dialog)
    4. {
    5. ui->setupUi(this);
    6. thread_ptr=new Mythread(this); // <------------ here is the problem
    7. connect(thread_ptr,SIGNAL(valueChanged(int)),this,SLOT(On_value_changed(int)));
    8.  
    9. }
    To copy to clipboard, switch view to plain text mode 
    The error as follows:

    Qt Code:
    1. error: no matching function for call to 'Mythread::Mythread(Dialog*)'
    2. thread_ptr=new Mythread(this);
    3. ^
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT GUI Thread

    Show the definition of Mythread class.

Similar Threads

  1. Replies: 1
    Last Post: 26th November 2016, 20:01
  2. Replies: 1
    Last Post: 6th December 2015, 17:12
  3. Replies: 4
    Last Post: 17th October 2013, 12:12
  4. Replies: 1
    Last Post: 25th October 2012, 16:10
  5. Replies: 5
    Last Post: 22nd February 2011, 22:21

Tags for this Thread

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.