[Marble] Selectable DataPluginItem
Carl Gleisner
carl.gleisner at gmail.com
Thu Aug 12 08:31:29 CEST 2010
While creating a online service I've been trying to make my items selectable by reimplementing QAction* action and connecting 'triggered' to my 'openBrowser'. However, this does not work. I even tried setFlag on the Items passing the ItemIsSelectable.
Reviewing the code for weather and wikipedia I do not see any differences. What could be the problem?
MolayItem.h:
QAction* action();
public Q_SLOTS:
void test();
MolayItem.cpp
MolayItem::MolayItem( QObject *parent )
: AbstractDataPluginItem( parent )
{
symbol = new Symbol;
setSize( symbol->getSize() );
m_action = new QAction( this );
connect( m_action, SIGNAL( triggered() ), this, SLOT( test() ) );
m_initialized = true;
}
...
QAction *MolayItem::action()
{
m_action->setText( id() );
return m_action;
}
void MolayItem::test()
{
qDebug() << id();
}
MolayParser.cpp
MolayItem * item = new MolayItem( m_parent );
m_list->append( item );
QXmlStreamAttributes attribs = attributes();
item->setId( attribs.value( "id" ).toString() );
item->setSidc( attribs.value("sidc").toString() );
Regards, Carl Gleisner
More information about the Marble
mailing list