[Marble-devel] Problem setting theme with MarbleControlBox

egk865 at yahoo.com egk865 at yahoo.com
Wed Jun 3 17:03:37 CEST 2009


Hi,

I have a marble widget along with a MarbleControlBox, as in the following code. I'd like to set the theme to "plain" but instead the Atlas theme shows. Is there a way to set the theme of a marble widget programmatically when using the Control Box (It works fine without it)?

Here's the code


#include "marble/MarbleWidget.h"
#include "marble/MarbleControlBox.h"
#include "marble/MapThemeManager.h"
#include <QtGui>

using namespace Marble;


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

    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->setMargin(0);

    QSplitter* m_splitter = new QSplitter ();
    vlayout->addWidget( m_splitter );

    MarbleControlBox* m_control = new
 MarbleControlBox();
    m_splitter->addWidget( m_control );
    m_splitter->setStretchFactor(m_splitter->indexOf(m_control), 0);

    MarbleWidget* m_marbleWidget = new MarbleWidget();
    m_marbleWidget->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding,
                                                QSizePolicy::MinimumExpanding ) );

    m_splitter->addWidget( m_marbleWidget );
    m_splitter->setStretchFactor(m_splitter->indexOf(m_marbleWidget), 1);

    m_control->addMarbleWidget( m_marbleWidget );

    MapThemeManager*
 m_mapThemeManager = new MapThemeManager;

    app.processEvents();

    m_control->setMapThemeModel( m_mapThemeManager->mapThemeModel() );

    m_control->updateMapThemeView();

   // Why does this line not work?
    m_marbleWidget->setMapThemeId("earth/plain/plain.dgml");

    m_splitter->show();

    app.exec();
}


Any help would be greatly appreciated.
Thanks!

Eli



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/marble-devel/attachments/20090603/5c112de5/attachment.htm 


More information about the Marble-devel mailing list