|
|
On Thursday 08 March 2007 12:18 pm, clinton@xxxxxxxxxxxx wrote:
> You need to add
> SET(QT_USE_QTDESIGNER ON)
> before
> include(${QT_USE_FILE})
>
> So the designer include paths can be added to your project. By default,
> QtGui and QtCore are the only two included.
Or
INCLUDE_DIRECTORIES(${QT_QTDESIGNER_INCLUDE_DIR})
so you don't link with the QtDesigner library.
Clint
>
> Clint
>
> On Thursday 08 March 2007 12:13 pm, Nicolas FÃte wrote:
> > 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/browser
> >Pi leImagesPlugin.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 interface
> >
> > Q_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
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/
--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/
|
|