[Marble-devel] Problem setting theme with MarbleControlBox

Torsten Rahn Torsten.Rahn at basyskom.de
Sat Jun 6 11:23:59 CEST 2009


Hi,

I bet this is with Marble trunk, right?

I guess this is related to a known regression due to the introduction of the 
planet filter.

I'll try to fix it soonish.

Torsten

Am Mittwoch 03 Juni 2009 17:03:37 schrieb egk865 at yahoo.com:
> 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

-- 
Torsten Rahn
Senior Consultant

basysKom GmbH
Robert-Bosch-Str. 7 | 64293 Darmstadt | Germany
Tel: +49 6151 3969-961 | Fax: -736|
torsten.rahn at basyskom.de | www.basyskom.de

Handelsregister: Darmstadt HRB 9352
Geschaeftsfuehrung: Eva Brucherseifer



More information about the Marble-devel mailing list