PDA

View Full Version : Marble as Qt Designer Plugin on WindowsXP



peirenjun
29th October 2009, 06:58
Hi:
I downloaded the source code of Marble(version 0.8.0) and use CMAKE(vesion 2.6.2) to create a VisualStdio2005 solution,then built it with VS2005 on WindowsXP.And,My QT Libs(Version 4.5.1) were built by VS2005,too.

"cmake -DQTONLY=ON -DWITH_DESIGNER_PLUGIN=ON ../marble"

It's fine.I can startup Marble as a independency desktop application,but "marblewidget" wasn't found in Qt Designer.

I only found three dlls("MarbleWidgetPlugin.dll" , "LatLonEditPlugin.dll", "MarbleNavigatorPlugin.dll") in "$QTDIR\plugins\designer" after built project of "install", so I tried to copy "MarbleWidget.dll" to directory "$QTDIR\bin", and then I could't startup qtdesigner.

I also built the solution by "release", no surprise!

Any suggestions?

Thanks in advance!

Pei

wysota
29th October 2009, 09:31
Open Designer and look at the "About plugins" box, there should be an error description there although in the end you will need to make sure the plugin sees MarbleWidget.dll as well.

peirenjun
30th October 2009, 01:51
wysota,thanks for your advice!

So I opend "About plugins" box, it showed me that " Could not load the library 'LatLonEditPlugin.dll', Could not find the appointed module", and for the other two dlls (MarbleWidgetPlugin.dll , MarbleNavigatorPlugin.dll"),the error descriptions were same.

Maybe the "appointed module" is "MarbleWidget.dll", but the qtdesigner could not startup as sonn as I copyed the DLL(marblewidget.dll) to directory "$QTDIR\bin".

I have no idea!

wysota
30th October 2009, 03:39
Check the dependencies using Dependency Walker. Also check the dependencies of MarbleWidget.dll - i.e. make sure it uses release version of Qt libraries.

peirenjun
30th October 2009, 04:44
Dependency Walker show me a warning:Since delay load dependency module import function is lost, and at least one module can not be resolved with the import.

The other dependency dlls or libs all are release version!

wysota
30th October 2009, 09:35
Can you use MarbleWidget.dll outside Designer? I mean can you link with it and use its functionality from hand written code?

peirenjun
30th October 2009, 10:19
The application "marble" could run well with the dll "marblewidget.dll". does not it mean the dll is useful?

wysota
30th October 2009, 12:32
If it links with marblewidget.dll then yes. I think it might be easiest to just call one of the authors of marble and ask them directly.

peirenjun
31st October 2009, 00:34
hehe

thanks very much! I will try!

pierreRFT
17th December 2009, 13:43
Hi,


I try to add the MarbleWidget in my application with Qt creator V1.3.0 based on Qt 4.6.0 running on Windows XP.

I had try the 2 ways :
- Add a MarbleWidget with Qt Designer like explained here : http://techbase.kde.org/Projects/Marble/MarbleDesigner
- Using Marble API like explained here : http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

But the 2 ways failed!

I understand that to use MarbleWidget or Marble API on Windows I had to rebuild it.

- I downloaded the source code from : http://edu.kde.org/marble/download.php
- I installed CMake.
- I follow the instructions from "Build Marble as a Qt only application" : http://edu.kde.org/marble/obtain.php and http://techbase.kde.org/Projects/Marble/MarbleDesigner
1) Launch Qt Command prompt
2) Add cmake and mingw-32 (C:\Qt\2009.05\mingw\bin) to the PATH
3) Put Marble sources in D:\marble, and create a D:\marble-plugin directory
4) command "cmake -DQTONLY=ON -DWITH_DESIGNER_PLUGIN=ON -G "MinGW Makefiles" ../marble"
5) command "mingw32-make"
6) command "mingw32-make install"

Until now, no problem.

C:\Program files\marble is created and I can found libMarbleWidgetPlugin.dll, libMarbleNavigatorPlugin.dll , libLatLonEditPlugin.dll in C:\Qt\2009.05\qt\plugins\designer directory.

But I don't have the file libMarbleWidgetPlugin.so or MarbleWidgetPlugin.so in my Qt's designer directory like explained here : http://techbase.kde.org/Projects/Marble/MarbleDesigner

Perhaps this file exists only on any linux OS ?

When I launch Qt designer, to add a MarbleWidget (my first way), I don't have the Mable Widget in my Widget Box.
And in the Help==>Plugins Infos window of Qt designer menu, I can see that the C:/Qt/2009.05/qt/plugins/designer/libLatLonEditPlugin.dll (and others Marble plugins) are in the Failed Plugins directory !
(You can see attached file : "Plugins_Info_QtDesigner_screenshot.png").
It seems that there is a mix with debug and release library ??


I try the 2nd way using the API marble :
In my .pro file I had :

INCLUDEPATH += ../marble-plugin/src/lib
INCLUDEPATH += "C:/Program Files/marble/include/marble"
QMAKE_LIBDIR += ../marble-plugin/src/lib
win32:LIBS += libmarblewidget.dll


In main.cpp is :

...

#include <MarbleWidget.h>

using namespace Marble;

....

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

// Create a Marble QWidget without a parent
MarbleWidget *mapWidget = new MarbleWidget();

// Load the OpenStreetMap map
mapWidget->setMapThemeId("earth/openstreetmap/openstreetmap.dgml");

// Set a server for downloading map data, if needed
// mapWidget->setDownloadUrl("http://download.kde.org/apps/marble/");
mapWidget->show();

return a.exec();
}

The program build but when I start the program, I've a runtime error window !! (See "Runtime_Error_screenshot.png" attached file).


Another thing :
When I start the marble.exe in C:\Program FIles\marble, I have a error window (see "Error_Window_MarbleExe" attached file).
Is it normal ??
For information, before compiling marble I've install Marble-Qt 0.8 for MS_Windows from http://edu.kde.org/marble/download.php.
The Marble.exe in C:\Program Files\Marble 0.8.0 works well.

Any help will be greatly appreciated.

Bests regards.