From ab34bbfa7a89c7104817847fdf27fb15d1202b56 Mon Sep 17 00:00:00 2001 From: zedamota Date: Fri, 28 May 2010 19:39:51 +0000 Subject: [PATCH] OP-37 GCS/MapPlugin Some fixes to core, fixed sqlite multi-thread access, changed some things from being created on the stack to the heap (I'm starting to sound like a C++ developer...lol) Continued work on the widget stuff git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@678 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../OPMapWidget/core/cacheitemqueue.cpp | 1 + .../experimental/OPMapWidget/core/core.pro | 2 - .../experimental/OPMapWidget/core/gmaps.cpp | 4 +- .../OPMapWidget/core/pureimagecache.cpp | 23 ++-- .../OPMapWidget/core/pureimagecache.h | 10 +- .../OPMapWidget/core/threadpool.cpp | 39 ------ .../OPMapWidget/core/threadpool.h | 28 ---- .../OPMapWidget/core/tilecachequeue.h | 1 + .../OPMapWidget/gettilestest/main.cpp | 2 +- .../OPMapWidget/internals/core.cpp | 41 +++--- .../experimental/OPMapWidget/internals/core.h | 7 +- .../OPMapWidget/internals/loadtask.h | 2 +- .../OPMapWidget/internals/tile.cpp | 1 + .../experimental/OPMapWidget/internals/tile.h | 1 + .../OPMapWidget/internals/tilematrix.cpp | 22 +-- .../OPMapWidget/internals/tilematrix.h | 6 +- .../OPMapWidget/mapwidget/opmapcontrol.cpp | 127 +++++++++++++++++- .../OPMapWidget/mapwidget/opmapcontrol.h | 16 ++- .../experimental/OPMapWidget/teste/main.cpp | 1 - .../OPMapWidget/widgettest/main.cpp | 3 +- 20 files changed, 216 insertions(+), 121 deletions(-) delete mode 100644 ground/src/experimental/OPMapWidget/core/threadpool.cpp delete mode 100644 ground/src/experimental/OPMapWidget/core/threadpool.h diff --git a/ground/src/experimental/OPMapWidget/core/cacheitemqueue.cpp b/ground/src/experimental/OPMapWidget/core/cacheitemqueue.cpp index b2283d3a4..fb38c5136 100644 --- a/ground/src/experimental/OPMapWidget/core/cacheitemqueue.cpp +++ b/ground/src/experimental/OPMapWidget/core/cacheitemqueue.cpp @@ -41,6 +41,7 @@ CacheItemQueue& CacheItemQueue::operator =(const CacheItemQueue &cSource) pos=cSource.pos; type=cSource.type; zoom=cSource.zoom; + return *this; } bool CacheItemQueue::operator ==(const CacheItemQueue &cSource) { diff --git a/ground/src/experimental/OPMapWidget/core/core.pro b/ground/src/experimental/OPMapWidget/core/core.pro index 72ad17667..6011de9b6 100644 --- a/ground/src/experimental/OPMapWidget/core/core.pro +++ b/ground/src/experimental/OPMapWidget/core/core.pro @@ -12,7 +12,6 @@ SOURCES += gmaps.cpp \ alllayersoftype.cpp \ urlfactory.cpp \ placemark.cpp \ - threadpool.cpp \ point.cpp \ size.cpp \ kibertilecache.cpp @@ -33,6 +32,5 @@ HEADERS += gmaps.h \ urlfactory.h \ geodecoderstatus.h \ placemark.h \ - threadpool.h \ point.h \ kibertilecache.h diff --git a/ground/src/experimental/OPMapWidget/core/gmaps.cpp b/ground/src/experimental/OPMapWidget/core/gmaps.cpp index 128635e6d..32afdf174 100644 --- a/ground/src/experimental/OPMapWidget/core/gmaps.cpp +++ b/ground/src/experimental/OPMapWidget/core/gmaps.cpp @@ -10,10 +10,10 @@ GMaps* GMaps::Instance() } GMaps::GMaps():useMemoryCache(true),MaxZoom(19),RetryLoadTile(2) { - accessmode=AccessMode::ServerOnly; + accessmode=AccessMode::ServerAndCache; Language=LanguageType::PortuguesePortugal; LanguageStr=LanguageType().toString(Language); - Cache::Instance()->ImageCache=PureImageCache(); + // Cache::Instance()->ImageCache=PureImageCache(); } diff --git a/ground/src/experimental/OPMapWidget/core/pureimagecache.cpp b/ground/src/experimental/OPMapWidget/core/pureimagecache.cpp index d2d272f1a..1315ebb03 100644 --- a/ground/src/experimental/OPMapWidget/core/pureimagecache.cpp +++ b/ground/src/experimental/OPMapWidget/core/pureimagecache.cpp @@ -24,6 +24,7 @@ bool PureImageCache::CreateEmptyDB(const QString &file) QDir dir=File.absoluteDir(); QString path=dir.absolutePath(); QString filename=File.fileName(); + if(File.exists()) QFile(filename).remove(); if(!dir.exists()) { qDebug()<<"CreateEmptyDB: Cache path doesn't exist, try to create"; @@ -35,7 +36,7 @@ bool PureImageCache::CreateEmptyDB(const QString &file) } QSqlDatabase db; - db = QSqlDatabase::addDatabase("QSQLITE",QLatin1String("MapsConnection")); + db = QSqlDatabase::addDatabase("QSQLITE",QLatin1String("CreateConn")); db.setDatabaseName(file); if (!db.open()) { @@ -99,14 +100,14 @@ bool PureImageCache::CreateEmptyDB(const QString &file) db.close(); return true; } -bool PureImageCache::PutImageToCache(const QByteArray &tile, const MapType::Types &type,const Point &pos,const int &zoom) const +bool PureImageCache::PutImageToCache(const QByteArray &tile, const MapType::Types &type,const Point &pos,const int &zoom) { qDebug()<<"PutImageToCache Start:";//< #include "pureimage.h" #include +#include + + + class PureImageCache { + public: PureImageCache(); static bool CreateEmptyDB(const QString &file); - bool PutImageToCache(const QByteArray &tile,const MapType::Types &type,const Point &pos, const int &zoom) const; + bool PutImageToCache(const QByteArray &tile,const MapType::Types &type,const Point &pos, const int &zoom); QByteArray GetImageFromCache(MapType::Types type, Point pos, int zoom); QString GtileCache(); void setGtileCache(const QString &value); static bool ExportMapDataToDB(QString sourceFile, QString destFile); private: QString gtilecache; + QMutex Mcounter; }; - +static qlonglong ConnCounter=0; #endif // PUREIMAGECACHE_H diff --git a/ground/src/experimental/OPMapWidget/core/threadpool.cpp b/ground/src/experimental/OPMapWidget/core/threadpool.cpp deleted file mode 100644 index ed18d9de7..000000000 --- a/ground/src/experimental/OPMapWidget/core/threadpool.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "threadpool.h" - -threadpool::threadpool() -{ -// m.lock(); - threadpool::count=0; - mm.lock(); - count2=0; - mm.unlock(); -// qDebug()<<"Thread constructor"; -// m.unlock(); -} -void threadpool::run() -{ - mm.lock(); - ++count2; - int countt=count2; - mm.unlock(); - QByteArray tmp; - QImage im; - qDebug()<<"Thread start"; - tmp=GMaps::Instance()->GetImageFrom(MapType::GoogleMap,Point(1,0),2); - // im.load("C:/Users/Xapo/Pictures/x.jpg"); - //tmp=QPixmap::fromImage(im); - // qDebug()<<"WWWWWWWW="< -#include "gmaps.h" -#include - -class threadpool: public QRunnable -{ - -public: - threadpool(); - QList pix; - QByteArray GetPic(int i); - int count; - int count2; - QMutex m; -private: - void run(); - -QMutex mm; - - QPixmap temp; - -}; - -#endif // THREADPOOL_H diff --git a/ground/src/experimental/OPMapWidget/core/tilecachequeue.h b/ground/src/experimental/OPMapWidget/core/tilecachequeue.h index 3b68c71df..66696ee31 100644 --- a/ground/src/experimental/OPMapWidget/core/tilecachequeue.h +++ b/ground/src/experimental/OPMapWidget/core/tilecachequeue.h @@ -16,6 +16,7 @@ class TileCacheQueue:public QThread Q_OBJECT public: TileCacheQueue(); + void EnqueueCacheTask(CacheItemQueue &task); protected: diff --git a/ground/src/experimental/OPMapWidget/gettilestest/main.cpp b/ground/src/experimental/OPMapWidget/gettilestest/main.cpp index d35da6f8b..b07f0b6f5 100644 --- a/ground/src/experimental/OPMapWidget/gettilestest/main.cpp +++ b/ground/src/experimental/OPMapWidget/gettilestest/main.cpp @@ -17,7 +17,6 @@ #include "../core/alllayersoftype.h" #include "geodecoderstatus.h" //#include "QTest" -#include "threadpool.h" #include "../internals/core.h" #include "../core/size.h" #include "../internals/rectangle.h" @@ -30,6 +29,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + PureImageCache* p=new PureImageCache(); QPixmap pixmap; //Tile Polling test pixmap=PureImageProxy::FromStream(GMaps::Instance()->GetImageFrom(MapType::GoogleSatellite,Point(1,0),1)); diff --git a/ground/src/experimental/OPMapWidget/internals/core.cpp b/ground/src/experimental/OPMapWidget/internals/core.cpp index 34742f57b..d0cb63911 100644 --- a/ground/src/experimental/OPMapWidget/internals/core.cpp +++ b/ground/src/experimental/OPMapWidget/internals/core.cpp @@ -4,10 +4,14 @@ Core::Core():currentPosition(0,0),currentPositionPixel(0,0),LastLocationInBounds ,minOfTiles(0,0),maxOfTiles(0,0),started(false),isDragging(false),TooltipTextPadding(10,10),MouseWheelZooming(false),loaderLimit(5) { mousewheelzoomtype=MouseWheelZoomType::MousePositionAndCenter; + SetProjection(new MercatorProjection()); this->setAutoDelete(false); + renderOffset=Point(0,0); + dragPoint=Point(0,0); } void Core::run() { + qDebug()<<"core:run"; bool last = false; LoadTask task; @@ -19,24 +23,25 @@ void Core::run() task = tileLoadQueue.dequeue(); { last = tileLoadQueue.count() == 0; - qDebug()<<"TileLoadQueue: " << tileLoadQueue.count(); + qDebug()<<"TileLoadQueue: " << tileLoadQueue.count()<<" Point:"<Timeout)) { + if(task.HasValue()) { - + qDebug()<<"AKI"; { - Tile m = Matrix.TileAt(task.Pos); + Tile* m = Matrix.TileAt(task.Pos); - if(m.Overlays.count() == 0) + if(m==0 || m->Overlays.count() == 0) { qDebug()<<"Fill empty TileMatrix: " + task.ToString(); - Tile t = Tile(task.Zoom, task.Pos); + Tile* t = new Tile(task.Zoom, task.Pos); QVector layers= GMaps::Instance()->GetAllLayersOfType(GetMapType()); foreach(MapType::Types tl,layers) @@ -54,14 +59,17 @@ void Core::run() else // ok { img = GMaps::Instance()->GetImageFrom(tl, task.Pos, task.Zoom); + qDebug()<<"Core::run:gotimage size:"<Overlays.append(img); + qDebug()<<"Core::run append img:"<GetPos().ToString()<<" now has "<Overlays.count()<<" overlays"; + + } Moverlays.unlock(); break; } @@ -79,14 +87,16 @@ void Core::run() while(++retry < GMaps::Instance()->RetryLoadTile); } - if(t.Overlays.count() > 0) + if(t->Overlays.count() > 0) { Matrix.SetTileAt(task.Pos,t); + qDebug()<<"Core::run add tile "<GetPos().ToString()<<" to matrix index "<Overlays.count(); } else { - t.Clear(); - //t = null; + delete t; + t = 0; } // layers = null; @@ -185,7 +195,7 @@ void Core::SetMapType(const MapType::Types &value) { if(Projection()->Type()!="PlateCarreeProjection") { - projection = new PlateCarreeProjection(); + SetProjection(new PlateCarreeProjection()); } } break; @@ -197,7 +207,7 @@ void Core::SetMapType(const MapType::Types &value) { if(Projection()->Type()!="LKS94Projection") { - projection = new LKS94Projection(); + SetProjection(new LKS94Projection()); } } break; @@ -206,7 +216,7 @@ void Core::SetMapType(const MapType::Types &value) { if(Projection()->Type()!="PlateCarreeProjectionPergo") { - projection = new PlateCarreeProjectionPergo(); + SetProjection(new PlateCarreeProjectionPergo()); } } break; @@ -215,7 +225,7 @@ void Core::SetMapType(const MapType::Types &value) { if(Projection()->Type()!="MercatorProjectionYandex") { - projection = new MercatorProjectionYandex(); + SetProjection(new MercatorProjectionYandex()); } } break; @@ -224,7 +234,7 @@ void Core::SetMapType(const MapType::Types &value) { if(Projection()->Type()!="MercatorProjection") { - projection = new MercatorProjection(); + SetProjection(new MercatorProjection()); } } break; @@ -476,6 +486,7 @@ void Core::CancelAsyncTasks() tileLoadQueue.clear(); } MtileLoadQueue.unlock(); + ProcessLoadTaskCallback.waitForDone(); } } void Core::UpdateBounds() diff --git a/ground/src/experimental/OPMapWidget/internals/core.h b/ground/src/experimental/OPMapWidget/internals/core.h index c51ccf35c..dc103d10e 100644 --- a/ground/src/experimental/OPMapWidget/internals/core.h +++ b/ground/src/experimental/OPMapWidget/internals/core.h @@ -143,6 +143,10 @@ public: void FindTilesAround(QList &list); void UpdateGroundResolution(); + + TileMatrix Matrix; + + Rectangle tileRect; signals: void OnCurrentPositionChanged(PointLatLng point); void OnTileLoadComplete(); @@ -171,13 +175,12 @@ private: Size minOfTiles; Size maxOfTiles; - Rectangle tileRect; + Point tilePoint; Rectangle CurrentRegion; - TileMatrix Matrix; QQueue tileLoadQueue; diff --git a/ground/src/experimental/OPMapWidget/internals/loadtask.h b/ground/src/experimental/OPMapWidget/internals/loadtask.h index 47c2b8c97..7483de272 100644 --- a/ground/src/experimental/OPMapWidget/internals/loadtask.h +++ b/ground/src/experimental/OPMapWidget/internals/loadtask.h @@ -24,7 +24,7 @@ struct LoadTask } bool HasValue() { - return Zoom==-1; + return !(Zoom==-1); } QString ToString()const diff --git a/ground/src/experimental/OPMapWidget/internals/tile.cpp b/ground/src/experimental/OPMapWidget/internals/tile.cpp index c3cea801d..672a21e8b 100644 --- a/ground/src/experimental/OPMapWidget/internals/tile.cpp +++ b/ground/src/experimental/OPMapWidget/internals/tile.cpp @@ -24,5 +24,6 @@ Tile& Tile::operator =(const Tile &cSource) { this->zoom=cSource.zoom; this->pos=cSource.pos; + return *this; } diff --git a/ground/src/experimental/OPMapWidget/internals/tile.h b/ground/src/experimental/OPMapWidget/internals/tile.h index 550d317ac..2e6a2b3c6 100644 --- a/ground/src/experimental/OPMapWidget/internals/tile.h +++ b/ground/src/experimental/OPMapWidget/internals/tile.h @@ -22,6 +22,7 @@ public: this->zoom=cSource.zoom; this->pos=cSource.pos; } + bool HasValue(){return !(zoom==0);} QList Overlays; protected: diff --git a/ground/src/experimental/OPMapWidget/internals/tilematrix.cpp b/ground/src/experimental/OPMapWidget/internals/tilematrix.cpp index d40e24339..dffc7ca96 100644 --- a/ground/src/experimental/OPMapWidget/internals/tilematrix.cpp +++ b/ground/src/experimental/OPMapWidget/internals/tilematrix.cpp @@ -6,9 +6,10 @@ TileMatrix::TileMatrix() void TileMatrix::Clear() { mutex.lock(); - foreach(Tile t,matrix.values()) + foreach(Tile* t,matrix.values()) { - t.Clear(); + delete t; + t=0; } matrix.clear(); mutex.unlock(); @@ -28,12 +29,12 @@ void TileMatrix::ClearPointsNotIn(QListlist) mutex.unlock(); foreach(Point p,removals) { - Tile t=TileAt(p); - if(t.GetZoom()!=0) + Tile* t=TileAt(p); + if(t!=0) { mutex.lock(); - t.Clear(); - t.SetZoom(NULL); + delete t; + t=0; matrix.remove(p); mutex.unlock(); } @@ -41,15 +42,16 @@ void TileMatrix::ClearPointsNotIn(QListlist) } removals.clear(); } -Tile TileMatrix::TileAt(const Point &p) +Tile* TileMatrix::TileAt(const Point &p) { - Tile ret; + qDebug()<<"TileMatrix:TileAt:"< list); - Tile TileAt(const Point &p); - void SetTileAt(const Point &p,const Tile &tile); + Tile* TileAt(const Point &p); + void SetTileAt(const Point &p,Tile* tile); protected: - QHash matrix; + QHash matrix; QList removals; QMutex mutex; }; diff --git a/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.cpp b/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.cpp index 00e8090be..968df7ba2 100644 --- a/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.cpp +++ b/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.cpp @@ -1,14 +1,124 @@ #include "opmapcontrol.h" -OPMapControl::OPMapControl(QWidget *parent):QWidget(parent) +OPMapControl::OPMapControl(QWidget *parent):QWidget(parent),MapRenderTransform(1) { + EmptytileBrush = Qt::blue; + MissingDataFont =QFont ("Times",10,QFont::Bold); + EmptyTileText = "We are sorry, but we don't\nhave imagery at this zoom\nlevel for this region."; + EmptyTileBorders = QPen(Qt::white); + ShowTileGridLines=true; + core.SetCurrentRegion(Rectangle(-50, -50, this->width()+100, this->height()+100)); + core.SetMapType(MapType::GoogleMap); + resize(); + core.SetZoom(2); + connect(&core,SIGNAL(OnNeedInvalidation()),this,SLOT(Core_OnNeedInvalidation())); + core.StartSystem(); } +void OPMapControl::Core_OnNeedInvalidation() +{ + this->repaint(); +} + void OPMapControl::paintEvent(QPaintEvent* evnt) { QWidget::paintEvent(evnt); QPainter painter(this); + + if(MapRenderTransform!=1) + { + QTransform transform; + transform.scale(MapRenderTransform,MapRenderTransform); + painter.setWorldTransform(transform); + { + DrawMap2D(painter); + } + painter.resetTransform(); + } + else + { + DrawMap2D(painter); + } + painter.drawText(10,10,"TESTE"); +} + +void OPMapControl::DrawMap2D(QPainter &painter) +{ painter.drawText(10,10,"TESTE"); + for(int i = -core.GetsizeOfMapArea().Width(); i <= core.GetsizeOfMapArea().Width(); i++) + { + for(int j = -core.GetsizeOfMapArea().Height(); j <= core.GetsizeOfMapArea().Height(); j++) + { + core.SettilePoint (core.GetcenterTileXYLocation()); + core.SettilePoint(Point(core.GettilePoint().X()+ i,core.GettilePoint().Y()+j)); + + + + { + Tile* t = core.Matrix.TileAt(core.GettilePoint()); + //qDebug()<<"OPMapControl::DrawMap2D tile:"<GetPos().ToString()<<" as "<Overlays.count()<<" overlays"; + //Tile t = Core.Matrix[tileToDraw]; + if(t!=0) + { + qDebug()<< "opmapcontrol:draw2d TileHasValue:"<GetPos().ToString(); + core.tileRect.SetX(core.GettilePoint().X()*core.tileRect.Width()); + core.tileRect.SetY(core.GettilePoint().Y()*core.tileRect.Height()); + core.tileRect.Offset(core.GetrenderOffset()); + + if(core.GetCurrentRegion().IntersectsWith(core.tileRect)) + { + bool found = false; + + // render tile + //lock(t.Overlays) + { + foreach(QByteArray img,t->Overlays) + { + if(img.count()!=0) + { + if(!found) + found = true; + { + painter.drawPixmap(core.tileRect.X(), core.tileRect.Y(), core.tileRect.Width(), core.tileRect.Height(),PureImageProxy::FromStream(img)); + + } + } + } + } + + if(ShowTileGridLines) + { + painter.setPen(EmptyTileBorders); + painter.drawRect(core.tileRect.X(), core.tileRect.Y(), core.tileRect.Width(), core.tileRect.Height()); + { + painter.setFont(MissingDataFont); + painter.setPen(Qt::red); + painter.drawText(QRectF(core.tileRect.X(), core.tileRect.Y(), core.tileRect.Width(), core.tileRect.Height()),Qt::AlignCenter,(core.GettilePoint() == core.GetcenterTileXYLocation()? "CENTER: " :"TILE: ")+core.GettilePoint().ToString()); + + } + } + + // add text if tile is missing + if(!found) + { + + painter.fillRect(QRectF(core.tileRect.X(), core.tileRect.Y(), core.tileRect.Width(), core.tileRect.Height()),EmptytileBrush); + painter.setFont(MissingDataFont); + painter.drawText(QRectF(core.tileRect.X(), core.tileRect.Y(), core.tileRect.Width(), core.tileRect.Height()),EmptyTileText); + + + + painter.setPen(EmptyTileBorders); + painter.drawRect(core.tileRect.X(), core.tileRect.Y(), core.tileRect.Width(), core.tileRect.Height()); + + // raise error + + } + } + } + } + } + } } void OPMapControl::mousePressEvent ( QMouseEvent* evnt ) @@ -25,3 +135,18 @@ void OPMapControl::mouseMoveEvent ( QMouseEvent* evnt ) { } +void OPMapControl::resizeEvent ( QResizeEvent * event ) +{ + QWidget::resizeEvent(event); + resize(); +} +void OPMapControl::resize() +{ + + core.OnMapSizeChanged(this->width(),this->height()); + core.SetCurrentRegion(Rectangle(-50, -50, this->width()+100, this->height()+100)); + if(isVisible()) + { + core.GoToCurrentPosition(); + } +} diff --git a/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.h b/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.h index fda0b416b..051cc1b05 100644 --- a/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.h +++ b/ground/src/experimental/OPMapWidget/mapwidget/opmapcontrol.h @@ -3,22 +3,34 @@ #include "../internals/core.h" #include - +#include #include +#include +#include class OPMapControl:public QWidget { Q_OBJECT public: OPMapControl(QWidget *parent=0); + QBrush EmptytileBrush; + QString EmptyTileText; + QPen EmptyTileBorders; + bool ShowTileGridLines; protected: void paintEvent ( QPaintEvent* evnt ); void mousePressEvent ( QMouseEvent* evnt ); void mouseReleaseEvent ( QMouseEvent* evnt ); void mouseMoveEvent ( QMouseEvent* evnt ); + void resizeEvent ( QResizeEvent * event ); private: Core core; - + qreal MapRenderTransform; + void DrawMap2D(QPainter &painter); + QFont MissingDataFont; + void resize(); +private slots: + void Core_OnNeedInvalidation(); }; #endif // OPMAPCONTROL_H diff --git a/ground/src/experimental/OPMapWidget/teste/main.cpp b/ground/src/experimental/OPMapWidget/teste/main.cpp index f9fb166a9..4093b8e69 100644 --- a/ground/src/experimental/OPMapWidget/teste/main.cpp +++ b/ground/src/experimental/OPMapWidget/teste/main.cpp @@ -16,7 +16,6 @@ #include "../core/alllayersoftype.h" #include "geodecoderstatus.h" //#include "QTest" -#include "threadpool.h" #include "../internals/core.h" #include "../core/size.h" #include "../internals/rectangle.h" diff --git a/ground/src/experimental/OPMapWidget/widgettest/main.cpp b/ground/src/experimental/OPMapWidget/widgettest/main.cpp index 6e55ec19c..2fc2cf02c 100644 --- a/ground/src/experimental/OPMapWidget/widgettest/main.cpp +++ b/ground/src/experimental/OPMapWidget/widgettest/main.cpp @@ -6,8 +6,9 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); map * mw = new map(); - mw->resize(400,590); + // mw->resize(400,590); mw->setWindowTitle("Map"); + mw->adjustSize(); mw->show(); return app.exec(); }