That error message does not match the code lines you posted (it implies you used strings of 5 and 8 characters).
The error arises because you have put the attempt to initialize "settings" inside the constructor (where it is already default constructed) rather than in the constructor initialization list (where you have the opportunity to dictate how to construct it).
Q_OBJECT
public:
settings("Contemposoft", "SimpleTextEdit")
{
// up there ^^^^ , not in here
}
...
private:
};
class MainWindow: public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *p = 0): QMainWindow(p),
settings("Contemposoft", "SimpleTextEdit")
{
// up there ^^^^ , not in here
}
...
private:
QSettings settings;
};
To copy to clipboard, switch view to plain text mode
Bookmarks