[Marble-devel] Beginner problem

Konrad Enzensberger e.konrad at mpegcode.com
Thu Aug 25 15:06:56 UTC 2011


hi,

>> mapWidget->setMapThemeId("C:\\openstreetmap.dgml");
i think this will not work, you have to use something like:
QString qsThemeId = "earth/openstreetmap/openstreetmap.dgml";
mapWidget->setMapThemeId(qsThemeId);

also from marble git, copy the data folder without changes to e.g. 
C:\maps\

If you start from VisualStudio, add a command argument to your settings
to set the data path to marblewidget: 

--marbledatapath c:\maps\data 

this works for me,

regards, konrad

----- Original Message ----- 
  From: M.Ozeau 
  To: marble-devel at kde.org 
  Sent: Thursday, August 25, 2011 4:27 PM
  Subject: [Marble-devel] Beginner problem


  I'm on Windows and Visual studio and i want to realise this :

  http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

  I compile Marble with Visual Studio to get the include (headers files .h) the lib (marblewidget.lib) and the dll (marblewidget.dll) i needed.

  I create a new project, i place the dll respectively in the release and the debug folder and i place the marbleInclude folder and the marblewidget.lib next to the release and debug one.

  I also place some other dll that the application needed :

  QtCore4.dll
  QtGui4.dll
  QtNetwork4.dll
  QtSvg4.dll
  QtWebKit4.dll
  QtXml4.dll

  I place them in the debug and release folder.

  There is my .pro file :


    TEMPLATE = app
    TARGET = 
    DEPENDPATH += . marble
    INCLUDEPATH += .
    LIBS += -lmarblewidget

    SOURCES += Main.cpp


  Here my Main.cpp :


    #include <QtGui>
    #include <QtGui/qapplication.h>
    #include <marble/MarbleWidget.h>
     
    using namespace Marble;
     
    int main(int argc, char** argv)
    {
        QApplication app(argc,argv);
        
        // Create a Marble QWidget without a parent
        MarbleWidget *mapWidget = new MarbleWidget();
        
        // Load the OpenStreetMap map
        mapWidget->setMapThemeId("C:\\openstreetmap.dgml");
     
        mapWidget->show();

        return app.exec();
    }


  With this i'm able to launch my application (no build error) but :

  In release, the widget is a black windows where i can right click and "add mesure point" "set home location" (so the widget is working right ?) but there is no background, no map at all. (the file "openstreetmap.dgml" is on the right place)

  In debug, the programme just stop at this line :


    MarbleWidget *mapWidget = new MarbleWidget();


  I'm a bit new to C++ and Qt but any help should be apprecied !!


  -- 
  Cordialement Morgan Ozeau




------------------------------------------------------------------------------


  _______________________________________________
  Marble-devel mailing list
  Marble-devel at kde.org
  https://mail.kde.org/mailman/listinfo/marble-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20110825/bb1c9b64/attachment.html>


More information about the Marble-devel mailing list