.h:
class Note : public QWidget
{
Q_OBJECT
public:
explicit Note(Traymenu *trayMenuIn, int i = 0, QWidget *parent = 0);
.cpp:
Note::Note(Traymenu *trayMenuIn, int i, QWidget *parent) :
I am creating a new Note by this:
void Traymenu::newNote(){
QSharedPointer<Note> note(new Note(this));
m_noteList << note;
What do I have to write instead of int i = 0
and int i
, if I want to pass a struct
?
Before creating the note, I am building a structure like
struct properties {
std::string title;
int posX, posY;
}noteProp;
noteProp.title="name";
I tried passing that structure with struct properties notePropIn = 0
in the prototype, but I get the error cannot convert int 0 to struct
. I need the 0 because this parameter is only used if a note gets loaded, not created the 1st time.
Then a new note should be created with
void Traymenu::newNote(){
QSharedPointer<Note> note(new Note(this, noteProp));
m_noteList << note;