PDA

View Full Version : Constructor Error, please assist



ayanda83
13th March 2014, 15:18
Hi everyone, I keep on getting the error below when I try to modify the default constructor for a dialogue box. Here is the constructor
explicit NewAccount(QWidget *parent = 0); I want to add a QSqlDatabase object in the constructor so that it looks like this
explicit NewAccount(QWidget *parent = 0, QSqlDatabase db); but I keep on getting this error. Am I doing something wrong?
10128

stampede
13th March 2014, 15:42
This is pretty basic C++ : default arguments (http://msdn.microsoft.com/en-us/library/91563f79.aspx). Your compiler pointed out the error - define a default value just for second parameter or both. Or change the order of constructor parameters.