release/main.o:main.cpp:(.text+0xcb): undefined reference to `vtable for MClas'collect2: ld returned 1 exit status
#ifndef _Main_h_#define _Main_h_#include <QObject>class MClas : public QObject { Q_OBJECTpublic: MClas() : QObject() { } QWidget wgt;public slots: void ShowKvadr(); void MClock(); void Pict();};#endif
#include <QtGui>#include "main.h"//------- MClas *Mc;// --------------------------------int main(int argc, char** argv){ QApplication app(argc, argv); Mc = new MClas(); QPushButton B1("1", &Mc->wgt); QPushButton B2("2", &Mc->wgt); QPushButton B3("2", &Mc->wgt); QObject::connect(&B1, SIGNAL(clicked()), Mc, SLOT(ShowKvadr())); QObject::connect(&B2, SIGNAL(clicked()), Mc, SLOT(MClock())); QObject::connect(&B3, SIGNAL(clicked()), Mc, SLOT(Pict())); Mc->wgt.resize(800, 600); Mc->wgt.show(); return app.exec();}/**************/void MClas::ShowKvadr(){}/******************/void MClas::MClock(){}/******************/void MClas::Pict(){}/[code]
C++ (Qt)QPushButton B1("1", &Mc->wgt);QPushButton B2("2", &Mc->wgt);QPushButton B3("2", &Mc->wgt);