资源简介

本来是想学着做动态按键的,方法很多,可以很简单的。不过我复杂化了,当中在为自定义控件添加事件处理的。遇到了纠结的问题,为了实现信号槽,需要加上Q_Object宏,此后又出现了undefined reference vtable for xxx的情况,最后发现了问题所在,以此作为经验吧。

资源截图

代码片段和文件信息

/****************************************************************************
** meta object code from reading C++ file ‘mainwindow.h‘
**
** Created by: The Qt meta object Compiler version 67 (Qt 5.2.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include “../../qtpro/mainwindow.h“
#include 
#include tatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error “The header file ‘mainwindow.h‘ doesn‘t include ject>.“
#elif Q_MOC_OUTPUT_REVISION != 67
#error “This file was generated using the moc from 5.2.0. It“
#error “cannot be used with the include files from this version of Qt.“
#error “(The moc has changed too much.)“
#endif

QT_BEGIN_MOC_NAMESPACE

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-01-28 22:42  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\
     目录           0  2014-01-28 22:47  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\
     文件      134359  2014-01-28 22:42  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\main.o
     文件      288433  2014-01-28 22:47  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\mainwindow.o
     文件        3352  2014-01-28 22:42  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\moc_mainwindow.cpp
     文件      167702  2014-01-28 22:42  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\moc_mainwindow.o
     文件        3281  2014-01-28 22:47  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\moc_mybutton.cpp
     文件      170097  2014-01-28 22:47  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\moc_mybutton.o
     文件      140487  2014-01-28 22:47  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\mybutton.o
     文件     1017621  2014-01-28 22:47  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\qtpro.exe
     文件       18126  2014-01-28 22:45  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\Makefile
     文件       49965  2014-01-28 22:45  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\Makefile.Debug
     文件       50065  2014-01-28 22:45  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\Makefile.Release
     目录           0  2014-01-28 00:56  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\release\
     文件        1876  2014-01-28 22:42  build-qtpro-Desktop_Qt_5_2_0_MinGW_32bit-Debug\ui_mainwindow.h
     目录           0  2014-01-28 22:48  qtpro\
     文件         183  2014-01-28 00:45  qtpro\main.cpp
     文件         761  2014-01-28 22:26  qtpro\mainwindow.cpp
     文件         360  2014-01-28 22:13  qtpro\mainwindow.h
     文件         826  2014-01-28 17:57  qtpro\mainwindow.ui
     文件         374  2014-01-28 22:23  qtpro\mybutton.cpp
     文件         847  2014-01-28 22:47  qtpro\mybutton.h
     文件         437  2014-01-28 11:43  qtpro\qtpro.pro
     文件       18051  2014-01-28 22:48  qtpro\qtpro.pro.user

评论

共有 条评论