hi to all
I m trying to create a form and on click on a button that data from QLine Edit should be submitted to the Database . but that is not working .
![]()
hi to all
I m trying to create a form and on click on a button that data from QLine Edit should be submitted to the Database . but that is not working .
![]()
Could you provide any details on what you actually did?
I have created 3 files as app.h,app.cpp,main.cpp
to create a form with submit and cancel button .
But after compliling it is showing:--
"app1.h:13: Error: Class contains Q_OBJECT macro but does not inherit from QObje
t"
So did you make it inherit QObject?
i m writing the code as in:-
#ifndef APP1_H
#define APP1_H
class QPushButton;
class QLineEdit;
class QLabel;
class QGridLayout;
class QWindow;
class app1
{
Q_OBJECT
public:
app1(QWidget *parent=0);
private:
QLabel *cust_id;
QLineEdit *tcust;
QPushButton *sub;
QPushButton *can;
QGridLayout *lay2;
QWidget *window;
};
#endif
But why did you use Q_OBJECT without inheriting QObject? The compiler told you what is wrong. Either remove the macro or inherit QObject.
but i m refering a book as "c++ GUI Programming with QT -4.1.1"
its is given there and more over.
i have created a form in which there was no problem but now its is giving that Error
I'm sure the book doesn't tell you to create a class which doesn't inherit QObject and use Q_OBJECT macro with it. You probably wanted:
Qt Code:
//... };To copy to clipboard, switch view to plain text mode
Bookmarks