我正在使用 Qt 创建一个 GUI 应用程序;我尝试hello world
使用 Qt 并且它运行良好,但是当我创建自定义列表小部件undefined reference to vtable
时,我在编译它时出现错误:
我正在使用 Eclipse 和 C++
#ifndef QMENUFILTER_H_
#define QMENUFILTER_H_
#include <qmenu.h>
class CustomMenuFilter : QMenu
{
Q_OBJECT
public:
CustomMenuFilter () ;
~CustomMenuFilter() ;
private:
QMenu FilterMenu;
QAction *AddFilterAct ;
QAction *DeleteFilterAct ;
Q_SLOT
void contextMenuEvent(QContextMenuEvent *event);
};
#endif /* QMENUFILTER_H_ */
#include "QMenuFilter.h"
CustomMenuFilter::CustomMenuFilter():QMenu()
{
DeleteFilterAct = new QAction("DeleteFilter" , this);
AddFilterAct = new QAction("AddFilter" , this);
AddFilterAct->setText("AddFilter");
DeleteFilterAct->setText("DeleteFilter");
}