--- infoscreen/pictureview.cpp 2010/01/06 22:18:52 528 +++ infoscreen/pictureview.cpp 2010/04/08 05:50:48 641 @@ -1,7 +1,7 @@ #include "pictureview.h" #include - +#include #include "httpwrapper.h" @@ -10,6 +10,9 @@ { } + +// TODO: if the picture doesn't fill the screen, fill the canvas with black before drawing the picture and +// place the image mid-screen void PictureView::paintEvent ( QPaintEvent* event) { Q_UNUSED(event); @@ -25,10 +28,15 @@ image = it.value(); this->repaint(); } else { - QByteArray data = HttpWrapper::getSyncData(source); + qDebug() << "Loading file " << source; QPixmap pixmap; - pixmap.loadFromData( data ); + if (source.at(0) == '/') { //local file + pixmap = QPixmap(source); + } else { + QByteArray data = HttpWrapper::getSyncData(source); + pixmap.loadFromData( data ); + } QPixmap scaledImage = pixmap.scaledToHeight(size().height(), Qt::SmoothTransformation );