| Subject: | QT + Cmake -> plugin |
|---|---|
| From: | Nicolas Fête |
| Date: | Thu, 8 Mar 2007 20:13:42 +0100 |
|
Hello,
I'm actually trying to compile a QT application with .ui as a plugin for designer. The Qmake version works fine, my custom widget appears in Designer and I can use it. I'm trying actually to make it work with CMake, because want to use itk too. When I try to compile under VS2005 Pro, I get this error: 1>I:/Projets/These/Programmation/src/browserPileImagesPlugin/code/browserPileImagesPlugin.h(10): Error: Undefined interface 1>Project : error PRJ0019: A tool returned an error code from "Generating moc_browserPileImagesPlugin.cxx" I changed my CMakeLists.txt according this page (http://qtnode.net/wiki/Qt_with_cmake), here's the code: Did someone get success to compile a qt custom
widget as plugin with CMake ?
nicolas ______________________________________________________________________________________
PROJECT(browserPileImagesPlugin)
cmake_minimum_required(VERSION 2.4.0) SET(SOURCES_CPP
../code/main.cpp ../code/browserPileImages.cpp ../code/browserPileImagesPlugin.cpp) MESSAGE( STATUS ${SOURCES_CPP} ) SET(SOURCES_H
../code/browserPileImages.h ../code/browserPileImagesPlugin.h) MESSAGE( STATUS ${SOURCES_H} ) SET(SOURCES_UI
../code/browserPileImages.ui) MESSAGE( STATUS ${SOURCES_UI} ) # Find QT4
# attention à la casse de Qt4 !! FIND_PACKAGE(Qt4 REQUIRED) include(${QT_USE_FILE})
# exécute uic sur les fichier .ui -> génération des .h associés
# ne pas oublier de rajouter les .h générés à add_exectuable QT4_WRAP_UI(SOURCES_UI_H ${SOURCES_UI}) # pour la macro Q_OBJECT..
#qt4_automoc(${SOURCES_H}) QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} ) # pour trouver le ui_h
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) #IF(WIN32)
# ADD_DEFINITIONS(-DQT_DLL) #ENDIF(WIN32) ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_LIBRARY(browserPileImagesPlugin SHARED ${SOURCES_CPP} ${SOURCES_UI_H}
${SOURCES_H_MOC})
#ADD_EXECUTABLE(browserPileImagesPlugin ${SOURCES_CPP} ${SOURCES_UI_H}
${SOURCES_H_MOC})
#TARGET_LINK_LIBRARIES(browserPileImagesPlugin ${QT_LIBRARIES} ) _____________________________________________________________________________________
#ifndef BROWSERPILEIMAGESPLUGIN_H#define BROWSERPILEIMAGESCUSTOMWIDGETPLUGIN_H#include <QDesignerCustomWidgetInterface>class BrowserPileImagesPlugin : public QObject, public QDesignerCustomWidgetInterface{ Q_OBJECT // tell moc that the second base class is a plugin interfaceQ_INTERFACES(QDesignerCustomWidgetInterface) public :BrowserPileImagesPlugin(QObject *parent = 0); bool isContainer() const;QIcon icon() const;QString domXml() const;QString group() const;QString includeFile() const;QString name() const;QString toolTip() const;QString whatsThis() const;QWidget *createWidget(QWidget *parent); }; #endif _____________________________________________________________________________________ --
Nicolas FÊTE, PhD student biotech EPFL Computer Science Engineer Ecole Polytechnique Fédérale de Lausanne Faculté des Sciences de la Vie Laboratoire de Dynamique des Cellules Souches Bâtiment AAB Station 15 CH-1015 Lausanne Tél:+41 21 693 16 33 Fax:+41 21 693 16 30 HomePage: http://barrandon.eu, http://cellules-souches.eu, http://stem-cells.ch, http://stemcells.ch |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [linux] display pictures with framerate greater than 25F/s, Justin Noel |
|---|---|
| Next by Date: | Re: QT + Cmake -> plugin, clinton |
| Previous by Thread: | Re: [linux] display pictures with framerate greater than 25F/s, Andrew Medico |
| Next by Thread: | Re: QT + Cmake -> plugin, clinton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |