2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 #include <QPushButton>
23 #include <QVBoxLayout>
25 #include "mainwindow.h"
26 #include "mapfetcher.h"
28 MainWindow::MainWindow(QWidget *parent)
31 this->setWindowTitle(tr("Situare"));
33 connect(&mapFetcher, SIGNAL(mapImageReceived(QUrl,QPixmap)), this, SLOT(imageReceived(QUrl,QPixmap)));
35 QPushButton *button = new QPushButton("Fetch");
36 QLabel *label = new QLabel(this);
37 connect(button, SIGNAL(clicked()), this, SLOT(debug()));
39 QWidget *widget = new QWidget(this);
40 QVBoxLayout *vbox = new QVBoxLayout;
41 vbox->addWidget(button);
42 vbox->addWidget(label);
43 widget->setLayout(vbox);
44 this->setLayout(vbox);
47 void MainWindow::imageReceived(const QUrl &url, const QPixmap &image)
49 qDebug() << url.path();
50 QLabel *label = new QLabel();
51 label->setPixmap(image);
55 void MainWindow::debug()
57 qDebug() << "debug()";
58 for (int j = 0; j < 10; ++j) {
59 mapFetcher.fetchMapImage(QUrl(QString("http://tile.openstreetmap.org/mapnik/13/4675/213%1.png").arg(j)));
63 MainWindow::~MainWindow()