MapWidget::MapWidget(QQuickItem* parent) : QQuickPaintedItem(parent), center(0.0,0.0), angle(0.0), magnification(64), requestNewMap(true) { setOpaquePainting(true); setAcceptedMouseButtons(Qt::LeftButton); DBThread *dbThread=DBThread::GetInstance(); //setFocusPolicy(Qt::StrongFocus); connect(dbThread,SIGNAL(InitialisationFinished(DatabaseLoadedResponse)), this,SLOT(initialisationFinished(DatabaseLoadedResponse))); connect(this,SIGNAL(TriggerMapRenderingSignal()), dbThread,SLOT(TriggerMapRendering())); connect(dbThread,SIGNAL(HandleMapRenderingResult()), this,SLOT(redraw())); connect(dbThread,SIGNAL(Redraw()), this,SLOT(redraw())); }
QmlWebViewWidget::QmlWebViewWidget(QQuickItem *parent) : QQuickPaintedItem(parent) { setOpaquePainting(true); setAcceptHoverEvents(true); setAcceptedMouseButtons(Qt::AllButtons); setFlag(QQuickItem::ItemAcceptsDrops, true); setFlag(QQuickItem::ItemHasContents, true); m_widget = new QmlWebViewInternalWidget(this); connect(m_widget, SIGNAL(urlChanged(QUrl)), this, SIGNAL(urlChanged(QUrl)) ); connect(m_widget, SIGNAL(loadStarted()), this, SIGNAL(loadStarted())); connect(m_widget, SIGNAL(loadFinished(bool)), this, SIGNAL(loadFinished(bool))); connect(m_widget, SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress(int))); QObject::connect(this, &QQuickPaintedItem::widthChanged, this, [this]{ QQuickWindow *w = this->window(); if(w){ QObject::connect(w, &QQuickWindow::xChanged, this, &QmlWebViewWidget::updateGeometry, (Qt::ConnectionType)(Qt::AutoConnection|Qt::UniqueConnection)); } }); }
QmlMapControl::QmlMapControl (QQuickItem *parent) : QQuickPaintedItem(parent) { setOpaquePainting(true); setAcceptHoverEvents(true); setAcceptedMouseButtons(Qt::AllButtons); layermanager = new LayerManager(this, size); screen_middle = QPoint(size.width()/2, size.height()/2); mousepressed = false; scaleVisible = true; crosshairsVisible = true; mymousemode = Panning; mouse_wheel_events = true; connect(ImageManager::instance(), SIGNAL(imageReceived()), this, SLOT(updateRequestNew())); connect(ImageManager::instance(), SIGNAL(loadingFinished()), this, SLOT(loadingFinished())); setWidth(size.width()+1); setHeight(size.height()+1); connect( this, SIGNAL(widthChanged()) , SLOT(sizeChanged()) ); connect( this, SIGNAL(heightChanged()), SLOT(sizeChanged()) ); }
WoWItemBase::WoWItemBase(QQuickItem *parent) : QQuickPaintedItem(parent), reply(NULL), m_itemClass(WoWItemBase::Consumable), m_itemSubClass(0) { resetImage(); setOpaquePainting(true); am = new QNetworkAccessManager(this); }