Not completely empty, isn't it?
Yes, it is. This is a completely empty declaration of the class ERPLinux. All you have done here is to say it is a class publicly derived from QWidget. The only actual content is the Q_OBJECT macro.
Q_OBJECT
public:
private:
};
class ERPLinux : public QWidget{
Q_OBJECT
public:
private:
};
To copy to clipboard, switch view to plain text mode
void ERPLinux::bikinmenupos(){
berkaspos = menupos->addMenu("&POS");
}
void ERPLinux::bikinmenupos(){
QMenuBar *menuutama = new QMenuBar();
QMenu *menupos = new QMenu();
berkaspos = menupos->addMenu("&POS");
}
To copy to clipboard, switch view to plain text mode
This is not the way you declare a class member function. It must be declared within the body of the class declaration:
Q_OBJECT
public:
void bikinmenupos();
private:
};
class ERPLinux : public QWidget{
Q_OBJECT
public:
void bikinmenupos();
private:
};
To copy to clipboard, switch view to plain text mode
and then you can define (implement) it, usually in the .cpp file that corresponds to your .h file, or as inline in your .h file.
And this line:
berkaspos = menupos->addMenu("&POS");
berkaspos = menupos->addMenu("&POS");
To copy to clipboard, switch view to plain text mode
won't compile because you have not declared a variable named "berkaspos".
Likewise, your class "POS" is also completely empty.
And this:
ERPLinux->bikinmenupos();
ERPLinux->bikinmenupos();
To copy to clipboard, switch view to plain text mode
is not the way you call a member function of the class ERPLinux. Which is why you need to go back to your C++ book.
Bookmarks