0

As the title stands I get this error within content of this snippet:

class NewTaskDialog : public QDialog 

It was working just fine earlier, but error started showing up when I added method:

void MainWindow::saveButtonClicked(NewTaskDialog dialogWindow) 
1
  • 1
    You should not be passing a dialog by value use a pointer instead. Commented Dec 6, 2012 at 19:12

2 Answers 2

0

Your syntax for saveButtonClicked creates a copy of the NewTaskDialog that's passed to it. You can't copy QWidgets unless you create a cloning function that explicitly provides the exact functionality you seek. QWidget's constructor is private.

You must pass a pointer

void MainWindow::saveButtonClicked(NewTaskDialog* dialogWindow) 

or a reference. Using the pointer is the standard Qt way.

Sign up to request clarification or add additional context in comments.

Comments

0

Use a pointer to the QDialog instead. The QDialog class has the copy constructor defined as private to try prevent you from passing a QDialog by value since you should never do that.

What's the use of the private copy constructor in c++

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.