[Marble-commits] KDE/kdeedu/marble/src
Andrew Manson
g.real.ate at gmail.com
Thu Jul 16 18:22:19 CEST 2009
SVN commit 997921 by mansona:
Implementing default implementation of GeoLineStringGraphicsItem. Inproving the
UI of the Text Editor Widget. Starting the OSM way parsing and rendering
implementation.
A lib/geodata/graphicsitem/GeoLineStringGraphicsItem.cpp [License: LGPL]
A lib/geodata/graphicsitem/GeoLineStringGraphicsItem.h [License: LGPL]
M +2 -1 plugins/render/osmannotate/GeoWidgetBubble.cpp
M +10 -8 plugins/render/osmannotate/OsmAnnotatePlugin.cpp
M +1 -1 plugins/render/osmannotate/PlacemarkTextAnnotation.cpp
M +13 -1 plugins/render/osmannotate/TextEditor.cpp
M +7 -7 plugins/render/osmannotate/TmpGraphicsItem.cpp
M +4 -4 plugins/render/osmannotate/TmpGraphicsItem.h
M +1 -0 plugins/render/osmannotate/osm/OsmElementDictionary.cpp
M +1 -0 plugins/render/osmannotate/osm/OsmElementDictionary.h
A plugins/render/osmannotate/osm/OsmWayTagHandler.cpp [License: LGPL]
A plugins/render/osmannotate/osm/OsmWayTagHandler.h [License: LGPL]
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/GeoWidgetBubble.cpp #997920:997921
@@ -52,7 +52,8 @@
painter->save();
//draw the border
- painter->setBrush( QBrush( Qt::lightGray, Qt::SolidPattern ));
+ painter->setPen( QPen( QColor( 125, 125, 125) ) );
+ painter->setBrush( QBrush( QColor( 255, 255, 255) , Qt::SolidPattern ));
painter->drawRoundedRect( QRect( position + borderOffset, widgetSize + borderSize ),
30, 30 );
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/OsmAnnotatePlugin.cpp #997920:997921
@@ -95,6 +95,8 @@
widgetInitalised= false;
m_tmp_lineString = 0;
m_itemModel = 0;
+ m_addingPlacemark = false;
+ m_drawingPolygon = false;
}
bool OsmAnnotatePlugin::isInitialized () const
@@ -323,8 +325,8 @@
QAction* m_addPlacemark;
QAction* m_drawPolygon;
QAction* m_drawLine;
- QAction* m_beginSeperator;
- QAction* m_endSeperator;
+ QAction* m_beginSeparator;
+ QAction* m_endSeparator;
QAction* m_loadOsmFile;
QAction* m_enableInputAction;
@@ -345,10 +347,10 @@
connect( m_loadOsmFile, SIGNAL(triggered()),
this, SLOT(loadOsmFile()) );
- m_beginSeperator = new QAction( this );
- m_beginSeperator->setSeparator( true );
- m_endSeperator = new QAction ( this );
- m_endSeperator->setSeparator( true );
+ m_beginSeparator = new QAction( this );
+ m_beginSeparator->setSeparator( true );
+ m_endSeparator = new QAction ( this );
+ m_endSeparator->setSeparator( true );
m_enableInputAction = new QAction(this);
m_enableInputAction->setToolTip(tr("Enable Marble Input"));
@@ -359,12 +361,12 @@
widget, SLOT( setInputEnabled(bool)) );
initial->addAction( m_enableInputAction );
- initial->addAction( m_beginSeperator );
+ initial->addAction( m_beginSeparator );
group->addAction( m_addPlacemark );
group->addAction( m_drawPolygon );
group->addAction( m_loadOsmFile );
- group->addAction( m_endSeperator );
+ group->addAction( m_endSeparator );
result.append( initial );
result.append( group );
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/PlacemarkTextAnnotation.cpp #997920:997921
@@ -94,7 +94,7 @@
//Parent - Child relationship should only be used in the paint function to decide
//if the coordinate of the object should be an offset of the parent or an actual
//coordinate.
- QListIterator<TmpGraphicsItem*> it(getChildren());
+ QListIterator<TmpGraphicsItem*> it(children());
if( it.hasNext() ) {
TmpGraphicsItem* p = it.next();
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/TextEditor.cpp #997920:997921
@@ -23,13 +23,22 @@
TextEditor::TextEditor() : QWidget()
{
- setMaximumWidth( 250 );
setCursor( Qt::ArrowCursor );
m_buttonLayout = new QHBoxLayout;
m_layout = new QVBoxLayout;
+ /*
+ *Note: these widgets do not need to be constructed with a parent
+ *as adding them to a layout automatically sets the parent. If a
+ *parent is already set it will mess up the layouts.
+ */
m_description = new QTextEdit;
+ m_description->setMinimumHeight( 50 );
+ m_description->setSizePolicy( QSizePolicy::Fixed,
+ QSizePolicy::MinimumExpanding );
+ m_description->viewport()->setSizePolicy( QSizePolicy::Fixed,
+ QSizePolicy::MinimumExpanding );
m_description->viewport()->setAutoFillBackground( true );
QApplication::setPalette( QPalette() );
m_description->setBackgroundRole( QPalette::Window );
@@ -63,6 +72,9 @@
m_layout->addWidget( m_description );
setLayout( m_layout );
+ setMaximumWidth( 250 );
+ setMinimumHeight( 50 );
+ setSizePolicy( QSizePolicy::Fixed, QSizePolicy::MinimumExpanding );
}
TextEditor::~TextEditor()
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/TmpGraphicsItem.cpp #997920:997921
@@ -16,7 +16,7 @@
TmpGraphicsItem::TmpGraphicsItem()
{
- parent = 0;
+ m_parent = 0;
//sensible default?
geoOffset = false;
@@ -37,24 +37,24 @@
return QList<QRegion>( m_regions );
}
-QList<TmpGraphicsItem*> TmpGraphicsItem::getChildren()
+QList<TmpGraphicsItem*> TmpGraphicsItem::children()
{
- return QList<TmpGraphicsItem*>(children);
+ return QList<TmpGraphicsItem*>(m_children);
}
void TmpGraphicsItem::addChild(TmpGraphicsItem* c)
{
- children.append(c);
+ m_children.append(c);
}
-TmpGraphicsItem* TmpGraphicsItem::getParent()
+TmpGraphicsItem* TmpGraphicsItem::parent()
{
- return parent;
+ return m_parent;
}
void TmpGraphicsItem::setParent( TmpGraphicsItem* p )
{
- parent = p;
+ m_parent = p;
}
bool TmpGraphicsItem::sceneEvent( QEvent* event )
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/TmpGraphicsItem.h #997920:997921
@@ -49,10 +49,10 @@
QList<QRegion> regions();
- QList<TmpGraphicsItem*> getChildren();
+ QList<TmpGraphicsItem*> children();
void addChild(TmpGraphicsItem* c);
- TmpGraphicsItem* getParent();
+ TmpGraphicsItem* parent();
void setParent( TmpGraphicsItem* p );
//Start dealing with the event stuff
@@ -70,13 +70,13 @@
private:
//intended to go in the private class
- QList<TmpGraphicsItem*> children;
+ QList<TmpGraphicsItem*> m_children;
QList<QRegion> m_regions;
//Allows for the implementation of local coordinate systems
//for children objects
- TmpGraphicsItem* parent;
+ TmpGraphicsItem* m_parent;
bool geoOffset;
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmElementDictionary.cpp #997920:997921
@@ -19,6 +19,7 @@
const char* osmTag_bounds = "bounds";
const char* osmTag_node = "node";
+ const char* osmTag_way = "way";
}
--- trunk/KDE/kdeedu/marble/src/plugins/render/osmannotate/osm/OsmElementDictionary.h #997920:997921
@@ -20,6 +20,7 @@
extern const char* osmTag_bounds;
extern const char* osmTag_node;
+ extern const char* osmTag_way;
}
More information about the Marble-commits
mailing list