*/
void viewContentChanged(QPoint viewTopLeft);
+ /**
+ * @brief Signal for drawing OSM license
+ *
+ * Signal is emitted when view is resized.
+ * @param width Viewport width
+ * @param height Viewport height
+ */
+ void viewResizedNewSize(int width, int height);
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
connect(mapView, SIGNAL(viewContentChanged(QPoint)),
mapEngine, SLOT(alignImmovableItems(QPoint)));
connect(mapView, SIGNAL(viewZoomFinished()), mapEngine, SLOT(viewZoomFinished()));
+ connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
+ this, SLOT(drawOsmLicense(int, int)));
+
QHBoxLayout *mapViewLayout = new QHBoxLayout;
//DEBUG
// connect(zoomIn, SIGNAL(clicked()), mapEngine, SLOT(zoomIn()));
// connect(zoomOut, SIGNAL(clicked()), mapEngine, SLOT(zoomOut()));
//DEBUG
- QLabel *OsmLicense = new QLabel("© OpenStreetMap contributors, CC-BY-SA",this);
- OsmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
- OsmLicense->resize(OsmLicense->fontMetrics().width("© OpenStreetMap contributors, CC-BY-SA"),
- OsmLicense->fontMetrics().height());
- mapView->stackUnder(OsmLicense);
+
+ osmLicense = new QLabel(this);
+ osmLicense->setAttribute(Qt::WA_TranslucentBackground, true);
+ osmLicense->setAttribute(Qt::WA_TransparentForMouseEvents, true);
+ osmLicense->setText("<font color='black'>"+OSM_LICENSE+"</font>");
+ osmLicense->setFont(QFont("Nokia Sans", 9));
+ osmLicense->resize(osmLicense->fontMetrics().width(OSM_LICENSE),
+ osmLicense->fontMetrics().height());
+ mapView->stackUnder(osmLicense);
mapViewLayout->addWidget(mapView);
setLayout(mapViewLayout);
qDebug() << __PRETTY_FUNCTION__;
mapEngine->receiveFriendLocations(friendsList);
}
+
+void MapViewScreen::drawOsmLicense(int width, int height)
+{
+ qDebug() << __PRETTY_FUNCTION__ << width << "x" << height;
+ osmLicense->move(width-osmLicense->fontMetrics().width(OSM_LICENSE),
+ height-osmLicense->fontMetrics().height());
+}
*/
void friendsLocationsReady(QList<User *> &friendsList);
+ /**
+ * @brief Slot for drawing the Open Street Map license text
+ *
+ * @param width Width of the viewport
+ * @param height Height of the viewport
+ */
+ void drawOsmLicense(int width, int height);
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
private:
MapEngine *mapEngine; ///< MapEngine
//DEBUG
+ QLabel *osmLicense; ///< Label for Open Street Map license
QPushButton *zoomIn; ///< Debug button for zooming in
QPushButton *zoomOut; ///< Debug button for zooming out
QLineEdit latLine; ///< Debug input field for latitude