---
title: "Qt相关一个编译错误：'staticMetaObject' is not a member of ‘XXXClass’"
author: "johnsmith9th"
date: "2013-11-21T10:45:24Z"
tags: []
categories: ["编程语言"]
slug: "qt-staticmetaobject-is-not-a-member-of-xxxclass"
draft: false
lastmod: "2013-11-21T10:45:24Z"
id: 1978327
url: "https://johnsmith9th.iteye.com/blog/1978327"
---

这个错误是怎么引起的呢？就是如果一个类不是从QObject及其相关子类派生的，但是误用了Q_OBJECT宏，就会报如题所示的错误。