[Qt-interest] Q_INTERFACES(QDesignerCustomWidgetInterface)

Jason Kolbenheyer jason at dropdeadcreative.com
Fri Sep 25 02:17:36 CEST 2009


Hi All. Trying to build my application with QT4.5 and I'm getting the  
error:

/usr/local/Trolltech/QT-4.5.2-static/bin/moc -DQT_NO_DEBUG - 
DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/local/Trolltech/ 
QT-4.5.2-static/mkspecs/macx-g++ -I. -I/usr/local/Trolltech/QT-4.5.2- 
static/include/QtCore -I/usr/local/Trolltech/QT-4.5.2-static/include/ 
QtCore -I/usr/local/Trolltech/QT-4.5.2-static/include/QtGui -I/usr/ 
local/Trolltech/QT-4.5.2-static/include/QtGui -I/usr/local/Trolltech/ 
QT-4.5.2-static/include/QtXml -I/usr/local/Trolltech/QT-4.5.2-static/ 
include/QtXml -I/usr/local/Trolltech/QT-4.5.2-static/include -I. -I/ 
usr/local/include/taglib -I/usr/local/include/boost-1_35 -I/usr/local/ 
include -I/Developer/FMOD\ Programmers\ API/api/inc -I../tools -I/usr/ 
local/Trolltech/QT-4.5.2-static/include -I/usr/local/Trolltech/ 
QT-4.5.2-static/include -I/usr/local/Trolltech/QT-4.5.2-static/ 
include/QtCore -I/usr/local/Trolltech/QT-4.5.2-static/include/QtGui - 
I/usr/local/Trolltech/QT-4.5.2-static/include/QtXml -I.moc -I.ui - 
D__APPLE__ -D__GNUC__ Gui/Widgets/Plugins/BackgroundLabelPlugin.hpp - 
o .moc/moc_BackgroundLabelPlugin.cpp
Gui/Widgets/Plugins/BackgroundLabelPlugin.hpp:14: Error: Undefined  
interface
make: *** [.moc/moc_BackgroundLabelPlugin.cpp] Error 1

I assume the "14" refers to the line #? (yes you guessed it, total  
newbie here), if so, what could possibly be wrong with this?:

Q_INTERFACES(QDesignerCustomWidgetInterface)

Here's the entire contents of BackgroundLabelPlugin.hpp:

#ifndef BACKGROUNDLABELPLUGIN_H
#define BACKGROUNDLABELPLUGIN_H

#include <QtDesigner/QDesignerCustomWidgetInterface>
#include <Gui/Widgets/BackgroundLabel.hpp>

namespace Test {
namespace Gui {
namespace Plugin {
//---------------------------------------------------------------------- 
--------
class BackgroundLabelPlugin : public QObject, public  
QDesignerCustomWidgetInterface
{
	Q_OBJECT
	Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
	BackgroundLabelPlugin(QObject *parent) : QObject(parent)  
{ initialized = false; }

	bool isContainer() const { return true; }
	bool isInitialized() const { return initialized; }
	void initialize(QDesignerFormEditorInterface *) { initialized = true; }
	QIcon icon() const { return QIcon(); }
	QString toolTip() const { return QString(); }
	QString whatsThis() const { return QString(); }
	QString group() const { return QLatin1String("Test Widgets"); }
	QString includeFile() const { return QLatin1String("<Gui/Widgets/ 
BackgroundLabel.hpp>"); }
	QString name() const { return QLatin1String 
("Test::Gui::BackgroundLabel"); }
	QWidget *createWidget(QWidget *parent) { return new BackgroundLabel 
(parent); }
	QString domXml() const
	{
		return QLatin1String(
			"<widget class=\"Test::Gui::BackgroundLabel\" name=\"label\">\n"
			" <property name=\"geometry\">\n"
			"  <rect>\n"
			"   <x>0</x>\n"
			"   <y>0</y>\n"
			"   <width>100</width>\n"
			"   <height>100</height>\n"
			"  </rect>\n"
			" </property>\n"
			"<property name=\"text\">\n"
			"   <string>TextLabel</string>\n"
			"</property>\n"
			"</widget>\n"
		);
	}
private:
	bool initialized;
};
//---------------------------------------------------------------------- 
--------
} //namespace Plugin
} //namespace Gui
} //namespace Test

#endif // BACKGROUNDLABELPLUGIN_H


I'm on Mac OS X 10.4.11 with QT 4.5.2. This was working ok with QT  
4.4.0, no changes have been made to this file. Thanks in advance for  
any assistance.

-jason

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090924/037bb9e9/attachment.html 


More information about the Qt-interest-old mailing list