From: Steve I. <st...@in...> - 2008-07-23 09:52:30
|
Hi again Fabien, I checked and the appropriate lines were already there (I used the HelloStelModule files and changed for my filenames): # Add here all the files which require moc compilation # that is, all the headers with SIGNAL/SLOTS/PLUGIN_INTERFACE etc.. SET(ScanDisplayModule_MOC_HDRS ScanDisplayModule.hpp) # After this call, ScanDisplayModule_MOC_SRCS = moc_ScanDisplayModule.cxx QT4_WRAP_CPP(ScanDisplayModule_MOC_SRCS ${ScanDisplayModule_MOC_HDRS}) I ran cmake and rebuilt again but it hasn't made any difference :( Back to square one... Best regards, Steve -----Original Message----- From: ste...@li... [mailto:ste...@li...] On Behalf Of Steve Ingamells Sent: 23 July 2008 10:40 To: 'Fabien Chéreau'; 'Stellarium developers public mailing list' Subject: Re: [Stellarium-pubdevel] Plugin / slots question. Hello Fabien, Thank you very much for that information - I will try that and let you know! All the best, Steve (learning more about QT than I ever wanted!) -----Original Message----- From: Fabien Chéreau [mailto:fab...@go...] Sent: 23 July 2008 10:15 To: St...@in...; Stellarium developers public mailing list Subject: Re: [Stellarium-pubdevel] Plugin / slots question. Hi Steve, You have to include the "ScanDisplayModule.hpp" file into the src/CMakeList.txt in the section were you declare the file to be preprocessed by the moc compiler. For example in HelloStelModule, this is done with the following lines: # Add here all the files which require moc compilation # that is, all the headers with SIGNAL/SLOTS/PLUGIN_INTERFACE etc.. SET(HelloStelModule_MOC_HDRS HelloStelModule.hpp MyFile2.hpp) # After this call, HelloStelModule_MOC_SRCS = moc_HelloStelModule.cxx QT4_WRAP_CPP(HelloStelModule_MOC_SRCS ${HelloStelModule_MOC_HDRS}) You'll have to add each files which contain a class using Q_OBJECT macro in this section. Cheers, Fabien On Wed, Jul 23, 2008 at 11:05 AM, Steve Ingamells <st...@in...> wrote: > Hello again, gentlemen.. > > I have a strange problem with my plug-in. I realise this is probably a > QT matter rather than Stellarium as such, but as you are the only > bunch of experienced QT programmers I know, I figured I would ask here first! > > Platform: Windows XP, build environment is MSYS, set up as per wiki > instructions. > > I want to use a QTimer to trigger data updates from my Stallarium > plug-in to our server. So I read up on timers, slots and signals. > > I added the Q_OBJECT macro to the main class in the plug-in: > > //////////////////// > class ScanDisplayModule : public StelModule { > > Q_OBJECT; > > public: > ScanDisplayModule(); > virtual ~ScanDisplayModule(); > > //////////////////// > > and also added a blank slot function > > /////////////////// > > public slots: > void onTimer(); > > /////////////////// > > with an empty function in the cpp file. The Qtimer is not yet coded, > so it's just a skeleton. > > It compiles and links fine - I get link info messages: > > Linking CXX shared module libScanDisplayModule.dll > Info: resolving StelApp::singleton by linking to > __imp___ZN7StelApp9singletonE (auto-import) > Info: resolving vtable for StelModuleby linking to > __imp___ZTV10StelModule > (auto-import) > Info: resolving StelModule::staticMetaObject by linking to > __imp___ZN10StelModule16staticMetaObjectE (auto-import) [100%] Built > target ScanDisplayModule > > (the last link info message started to appear after adding the > Q_OBJECT > macro) > > but when I run Stellarium with the plug-in all set-up, I get the following: > > Couldn't load the dynamic library: > "./modules/ScanDisplayModule/libScanDisplayM > odule.dll" : "QLibrary::load_sys: Cannot load C:/Program > Files/Stellarium/modul es/ScanDisplayModule/libScanDisplayModule.dll > (Invalid access to memory location .)" > Module "ScanDisplayModule" will not be loaded. > > The problem seems to be the Q_OBJECT macro - it's needed to support > slots, but with the macro in the header (even with the slots functions > removed) I get the error loading the DLL. > > If I remove the Q_OBJECT macro and the slots code, it works fine. > > I have looked at the code in VirGO and you are using slots and the > Q_OBJECT macro there, so I believe it will work, unless it's a Windows problem. > > Any ideas? > > Thanks, > Steve Ingamells > > > ---------------------------------------------------------------------- > --- This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge Build the coolest Linux based applications with Moblin SDK & > win great prizes Grand prize is a trip for two to an Open Source event > anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Stellarium-pubdevel mailing list > Ste...@li... > https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel > No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.5.2/1562 - Release Date: 7/19/2008 2:01 PM ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Stellarium-pubdevel mailing list Ste...@li... https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.5.2/1562 - Release Date: 7/19/2008 2:01 PM |