diff --git a/libqt-omd/camera.cpp b/libqt-omd/camera.cpp index 25b31c9..2104d8f 100644 --- a/libqt-omd/camera.cpp +++ b/libqt-omd/camera.cpp @@ -34,6 +34,7 @@ #include "image.h" #include "properties.h" #include "camera.h" +#include "helpers.h" using namespace Oi; @@ -41,40 +42,30 @@ const QString Camera::cUserAgent = "libqt-omd v0.1"; Camera::Camera() : mAddress("192.168.0.10"), + mCamProperties(this), mCamMode(MODE_UNKNOWN), mConnectMode(CONNECT_UNKNOWN) { connect(&mNetworkManager, &QNetworkAccessManager::finished, this, &Camera::requestFinished); - - if (isOnline()) - initialize(); - else - qWarning() << "[libqt-omd] Camera is not online"; } void Camera::initialize() { + requestConnectMode(); + requestCamInfo(); + requestCommands(); + switchCamMode(MODE_PLAY); completePendingRequests(); - requestCamInfo(); requestCapacity(); - requestConnectMode(); - requestCommandList(); - requestImageList(); + requestImages(); + switchCamMode(MODE_RECORD); completePendingRequests(); - qDebug() << "[libqt-omd] CamModel: " << mCamModel; - qDebug() << "[libqt-omd] UnusedCapacity: " << mUnusedCapacity; - qDebug() << "[libqt-omd] CamMode: " << mCamMode; - qDebug() << "[libqt-omd] ConnectMode: " << mConnectMode; - -} - -QUrl Camera::getUrl() const -{ - return QUrl("http://192.168.0.10"); + requestProperties(); + completePendingRequests(); } bool Camera::isOnline() @@ -97,6 +88,11 @@ QNetworkRequest Camera::makeRequest(QString cgi, QMap params) for (QString key : params.keys()) paramList.push_back(qMakePair(key, params[key])); + if (cgi == "switch_cammode") { + QPair tmp = paramList.takeFirst(); + paramList.append(tmp); + } + query.setQueryItems(paramList); url.setQuery(query); @@ -146,7 +142,7 @@ void Camera::requestFinished(QNetworkReply *reply) if (contentType == "text/xml" && reply->size() > 0) { QDomDocument body; if (body.setContent(reply->readAll())) { - qDebug() << "[libqt-omd] Content:" << body.toString(); + //qDebug() << "[libqt-omd] Content:" << body.toString(); parseXml(cgi, body); } else @@ -199,9 +195,20 @@ void Camera::powerOff() { get("exec_pwoff"); } void Camera::requestCamInfo() { get("get_caminfo"); } void Camera::requestCapacity() { get("get_unusedcapacity"); } void Camera::requestConnectMode() { get("get_connectmode"); } -void Camera::requestCommandList() { get("get_commandlist"); } +void Camera::requestCommands() { get("get_commandlist"); } -void Camera::requestImageList(QString dir, bool rsv) { +void Camera::requestProperties() +{ + QMap params; + + params["com"] = "desc"; + params["propname"] = "desclist"; + + get("get_camprop", params); + +} + +void Camera::requestImages(QString dir, bool rsv) { QMap params; params["DIR"] = dir.replace('/', "%2F"); @@ -228,13 +235,16 @@ void Camera::switchCamMode(CamMode mode) case MODE_PLAY: params["mode"] = "play"; break; + case MODE_RECORD: params["mode"] = "rec"; - params["lvqty"] = "0640x0480"; // FIXME allow other liveViewQualities + params["lvqty"] = "0320x0240"; // FIXME allow other liveViewQualities break; + case MODE_SHUTTER: params["mode"] = "shutter"; break; + case MODE_UNKNOWN: default: return; @@ -275,6 +285,8 @@ void Camera::parseList(QString cgi, QByteArray body) mImages.insert(img.path(), img); } } + + emit imagesUpdated(mImages); } void Camera::parseImage(QString cgi, QByteArray body) @@ -313,7 +325,7 @@ void Camera::parseCapacity(QDomDocument body) { QDomElement elm = body.firstChildElement("unused"); if (!elm.isNull()) { - mUnusedCapacity = elm.text().toUInt(); + mUnusedCapacity = elm.text().toULong(); emit capacityUpdated(mUnusedCapacity); } @@ -333,15 +345,19 @@ void Camera::parseConnectMode(QDomDocument body) else if (elm.text() == "shared") mConnectMode = CONNECT_SHARED; else - qWarning() << "[libqt-omd] Warning: unknown connectMode:" << elm.text(); - } + mConnectMode = CONNECT_UNKNOWN; + emit connected(mConnectMode); + } } void Camera::parseProperties(QDomDocument body) { - Q_UNUSED(body) - // FIXME implement + QDomElement elm = body.firstChildElement("desclist"); + if (!elm.isNull()) { + mCamProperties.parse(elm); + emit propertiesUpdated(&mCamProperties); + } } void Camera::parseTakeMisc(QDomDocument body) diff --git a/libqt-omd/camera.h b/libqt-omd/camera.h index 76758d1..06f2221 100644 --- a/libqt-omd/camera.h +++ b/libqt-omd/camera.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include "properties.h" #include "image.h" + class QNetworkAccessManager; class QNetworkReply; class QNetworkRequest; @@ -42,6 +44,7 @@ class QNetworkRequest; namespace Oi { class LiveView; class Camera; + class Image; } class Oi::Camera : public QObject @@ -81,26 +84,26 @@ public: void requestCamInfo(); void requestCapacity(); void requestConnectMode(); - void requestCommandList(); - void requestImageList(QString dir = "/DCIM/100OLYMP", bool reserved = false); + void requestCommands(); + void requestProperties(); + void requestImages(QString dir = "/DCIM/100OLYMP", bool reserved = false); void requestImage(QString name = QString(), QSize resolution = QSize(-1, -1)); /* Synchronous getters */ - QString getCamInfo(); - unsigned getCapacity(); - enum ConnectMode getConnectMode(); - void /* FIXME */ getCommandList(); - QList getImageList(bool reserved = false); - QImage getImage(QString name = QString(), QSize resolution = QSize()); - QUrl getUrl() const; + QString camModel() const { return mCamModel; } + unsigned unusedCapacity() const { return mUnusedCapacity; } + QHash images() const { return mImages; } + QImage image(QString name = QString(), QSize resolution = QSize()) const; + QUrl url() const { return QUrl(QString("http://") + mAddress.toString()); } + + bool isOnline(); + enum ConnectMode connectMode() const { return mConnectMode; } + enum CamMode camMode() const { return mCamMode; } + const Oi::Properties * properties() const { return &mCamProperties; } Oi::LiveView * startLiveView(QSize resolution = QSize(640, 480), int port = 22222); void stopLiveView(); - /* Cached getters */ - bool isOnline(); - enum CamMode camMode(); - public slots: void initialize(); void switchCamMode(enum CamMode mode); @@ -112,8 +115,10 @@ public slots: signals: void receivedImage(QImage); - void capacityUpdated(long unsigned); - void changedProperty(QString key, QString value); + void imagesUpdated(QHash); + void capacityUpdated(unsigned long c); + void propertyChanged(Oi::Property *prop); + void propertiesUpdated(Oi::Properties *props); void changedMode(enum CamMode); void modelUpdated(QString); void poweredOff(); @@ -151,16 +156,18 @@ protected: QList mPendingReplies; QNetworkAccessManager mNetworkManager; + Oi::Properties mCamProperties; + /* Properties */ enum CamMode mCamMode; enum ConnectMode mConnectMode; QString mCamModel; - long unsigned mUnusedCapacity; + unsigned long mUnusedCapacity; QDomDocument mCommandList; - QHash mImages; + QHash mImages; /* Constants */ static const QString cUserAgent; diff --git a/libqt-omd/image.cpp b/libqt-omd/image.cpp index 6af8e09..6f8a502 100644 --- a/libqt-omd/image.cpp +++ b/libqt-omd/image.cpp @@ -36,7 +36,6 @@ Image::Image() : Image::Image(const Image &img) : mCam(img.mCam), - mPixels(img.mPixels), mPath(img.mPath), mDate(img.mDate), mAttributes(img.mAttributes), diff --git a/libqt-omd/image.h b/libqt-omd/image.h index 8dc9d75..d263a4d 100644 --- a/libqt-omd/image.h +++ b/libqt-omd/image.h @@ -72,8 +72,6 @@ class Oi::Image : public QImage Oi::Camera *mCam; - QMap mPixels; - QString mPath; QDateTime mDate; diff --git a/libqt-omd/imagelistmodel.cpp b/libqt-omd/imagelistmodel.cpp new file mode 100644 index 0000000..c9ccd87 --- /dev/null +++ b/libqt-omd/imagelistmodel.cpp @@ -0,0 +1,59 @@ +#include "imagelistmodel.h" +#include "image.h" +#include "camera.h" + +using namespace Oi; + +ImageListModel::ImageListModel(Camera *cam, QObject *parent) : + QAbstractTableModel(parent), + mCam(cam) +{ + connect(cam, &Oi::Camera::imagesUpdated, this, [&](QHash) { + emit dataChanged(index(0, 0), index(rowCount()-1, columnCount()-1)); + }); +} + +QVariant ImageListModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + switch (section) { + case 0: return QString(tr("Path")); + case 1: return QString(tr("Size")); + case 2: return QString(tr("Marked")); + case 3: return QString(tr("Date")); + case 4: return QString(tr("Attributes")); + default: return QVariant(); + } +} + +int ImageListModel::rowCount(const QModelIndex &parent) const +{ + return mCam->images().count(); +} + +int ImageListModel::columnCount(const QModelIndex &parent) const +{ + return 5; +} + +QVariant ImageListModel::data(const QModelIndex &index, int role) const +{ +// if (!index.isValid()) +// return QVariant(); + + const Image &img = mCam->images().values().at(index.row()); + + if (role != Qt::DisplayRole) + return QVariant(); + + switch (index.column()) { + case 0: return img.path(); + case 1: return img.size(); + case 2: return img.marked(); + case 3: return img.dateTime().toString(); + case 4: return img.attributes(); + default: return QVariant(); + } +} diff --git a/libqt-omd/imagelistmodel.h b/libqt-omd/imagelistmodel.h new file mode 100644 index 0000000..82c3ad9 --- /dev/null +++ b/libqt-omd/imagelistmodel.h @@ -0,0 +1,33 @@ +#ifndef IMAGETABLEMODEL_H +#define IMAGETABLEMODEL_H + +#include + +namespace Oi { + class Camera; + class ImageListModel; +} + +class Oi::ImageListModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + explicit ImageListModel(Camera *cam, QObject *parent = 0); + + // Header: + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + + // Basic functionality: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + +protected: + Oi::Camera *mCam; + +private: +}; + +#endif // IMAGELISTMODEL_H diff --git a/libqt-omd/libqt-omd.pro b/libqt-omd/libqt-omd.pro index 9732a21..ac2602e 100644 --- a/libqt-omd/libqt-omd.pro +++ b/libqt-omd/libqt-omd.pro @@ -12,13 +12,15 @@ TEMPLATE = lib SOURCES += camera.cpp \ liveview.cpp \ properties.cpp \ - image.cpp + image.cpp \ + imagelistmodel.cpp HEADERS += camera.h \ liveview.h \ properties.h \ image.h \ - helpers.h + helpers.h \ + imagelistmodel.h unix { target.path = /usr/lib diff --git a/libqt-omd/liveview.cpp b/libqt-omd/liveview.cpp index 9e69852..43c673c 100644 --- a/libqt-omd/liveview.cpp +++ b/libqt-omd/liveview.cpp @@ -28,5 +28,66 @@ using namespace Oi; LiveView::LiveView(Camera *c) : - mCam(c) + mCam(c), + mSocket(this) { } + +void LiveView::start() +{ + mSocket->bind(QHostAddress::LocalHost, mPort); + + mCam->get() + + connect(mSocket, &QUdpSocket::readyRead, this, &LiveView::readPendingChunks); +} + +void LiveView::stop() +{ + +} + +void LiveView::readPendingChunks() +{ + while (udpSocket->hasPendingDatagrams()) { + QByteArray datagram; + + datagram.resize(udpSocket->pendingDatagramSize()); + + QHostAddress sender; + quint16 senderPort; + + mSocket->readDatagram(datagram.data(), datagram.size(), &sender, &senderPort); + + processChunk(datagram); + } +} + +void LiveView::processChunk(QByteArray chunk) +{ + const char *data = chunk.constData(); + const char *payload = data + 12; + + const quint16 *packetType = reinterpret_cast(data + 0); + const quint16 *chunkNo = reinterpret_cast(data + 2); + const quint32 *frameId = reinterpret_cast(data + 4); + const quint32 *streamId = reinterpret_cast(data + 8); + + qDebug() << "packetType: " << *packetType << " chunkNo: " << *chunkNo << " frameId: " << *frameId << " streamId: " << *streamId; + + switch (*packetType) { + case 0x9060: /* Start of Frame */ + break; + + case 0x8060: /* Middle of Frame */ + break; + + case 0x80e0: /* End of Frame */ + break; + } +} + +void LiveView::processFrame() +{ + +} + diff --git a/libqt-omd/liveview.h b/libqt-omd/liveview.h index b31852b..7b30980 100644 --- a/libqt-omd/liveview.h +++ b/libqt-omd/liveview.h @@ -27,7 +27,9 @@ #ifndef LIVEVIEW_H #define LIVEVIEW_H +#include #include +#include #include "camera.h" @@ -36,19 +38,30 @@ namespace Oi { class LiveView; } -class Oi::LiveView +class Oi::LiveView : QObject { + Q_OBJECT + public: LiveView(Oi::Camera *c); void start(); void stop(); + signals: + void newFrame(); + protected: + void readPendingChunks(); + void processChunk(QByteArray); + int mPort = 48482; QUdpSocket mSocket; - Camera *mCam; + quint32 mStreamId; + quint32 mFrameId; + + Oi::Camera *mCam; }; #endif // LIVEVIEW_H diff --git a/libqt-omd/properties.cpp b/libqt-omd/properties.cpp index 641a70c..0934b51 100644 --- a/libqt-omd/properties.cpp +++ b/libqt-omd/properties.cpp @@ -29,24 +29,32 @@ using namespace Oi; -Properties::Properties(QDomNode desclist) +Properties::Properties(Camera *c) : + mCam(c) +{ } + +void Properties::parse(QDomNode desclist) { - QDomNode desc = desclist.firstChild(); + QDomNode desc = desclist.firstChildElement("desc"); while (!desc.isNull()) { - Property prop(desc); + Property prop(mCam, desc); if (prop.isValid()) - mProperties[prop.mKey] = prop; + insert(prop.mKey, prop); - desc = desc.nextSibling(); + desc = desc.nextSiblingElement("desc"); } } -Property::Property(QDomNode desc) +Property::Property(Camera *c, QDomNode desc) : + mCam(c) { mKey = desc.firstChildElement("propname").text(); mValue = desc.firstChildElement("value").text(); - mValid = desc.firstChildElement("enum").text().split(' '); + + QDomElement validEnum = desc.firstChildElement("enum"); + if (!validEnum.isNull()) + mValid = validEnum.text().split(' '); QString attr = desc.firstChildElement("attribute").text(); if (attr.contains("set")) diff --git a/libqt-omd/properties.h b/libqt-omd/properties.h index c17fd29..fe1d47e 100644 --- a/libqt-omd/properties.h +++ b/libqt-omd/properties.h @@ -23,32 +23,33 @@ * along with libqt-omd. If not, see . */ - #ifndef PROPERTIES_H #define PROPERTIES_H -#include -#include -#include "camera.h" +#include +#include + #include "image.h" namespace Oi { + class Camera; class Property; class Properties; } -class Oi::Properties +class Oi::Properties : + public QMap { public: - Properties(QDomNode desclist); + Properties(Oi::Camera *c); + void parse(QDomNode desclist); Oi::Property& operator[](const QString &key); protected: Oi::Camera *mCam; - QMap mProperties; }; class Oi::Property @@ -64,15 +65,20 @@ class Oi::Property public: Property() { } - Property(QDomElement desc); Property& operator =(const QString &value); - operator QString(); bool isValid(QString value = QString()); + /* Getter */ + const QString & key() const { return mKey; } + const QString & value() const { return mValue; } + const QStringList & valids() const { return mValid; } + protected: - Property(QDomNode desc); + Property(Oi::Camera *c, QDomNode desc); + + Oi::Camera *mCam; QStringList mValid; diff --git a/test/main.cpp b/test/main.cpp index b12e972..c5500a4 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -3,8 +3,9 @@ #include #include #include +#include -#include "viewer.h" +#include "mainwindow.h" #include "camera.h" int main(int argc, char *argv[]) @@ -13,38 +14,25 @@ int main(int argc, char *argv[]) QSystemTrayIcon tray(&app); QMenu menu; - Viewer viewer; Oi::Camera cam; + MainWindow win(&cam); /* Actions */ - QAction showLiveView("Show Live View", &tray); - QObject::connect(&showLiveView, &QAction::triggered, [&]() { - viewer.show(); - }); - - QAction openBrowser("Open Browser", &tray); - QObject::connect(&openBrowser, &QAction::triggered, [&]() { - QDesktopServices::openUrl(cam.getUrl()); - }); - + QAction openWindow("Open", &tray); QAction closeApp("Quit", &tray); - QObject::connect(&closeApp, &QAction::triggered, [&]() { - app.quit(); - }); + QAction openBrowser("Open Browser", &tray); - /* Camera Signals */ - QAction sizeInfo("Capacity: ?", &tray); - QObject::connect(&cam, &Oi::Camera::capacityUpdated, [&](int cap) { - sizeInfo.setText(QString("Capacity: %1").arg(cap)); - tray.setContextMenu(&menu); + QObject::connect(&closeApp, &QAction::triggered, &win, &QMainWindow::close); + QObject::connect(&openWindow, &QAction::triggered, &win, &QMainWindow::show); + + QObject::connect(&openBrowser, &QAction::triggered, [&]() { + QDesktopServices::openUrl(cam.url()); }); /* Context Menu */ - menu.addAction(&showLiveView); + menu.addAction(&openWindow); menu.addAction(&openBrowser); menu.addSeparator(); - menu.addAction(&sizeInfo); - menu.addSeparator(); menu.addAction(&closeApp); QIcon icon(":/icon/libqt-omd_gray.png"); @@ -52,5 +40,11 @@ int main(int argc, char *argv[]) tray.setContextMenu(&menu); tray.show(); + /* Initialize camera */ + if (cam.isOnline()) + cam.initialize(); + else + QMessageBox::critical(&win, "Error", "Failed to connect to camera!"); + return app.exec(); } diff --git a/test/mainwindow.cpp b/test/mainwindow.cpp new file mode 100644 index 0000000..38aa0b8 --- /dev/null +++ b/test/mainwindow.cpp @@ -0,0 +1,92 @@ +#include + +#include +using std::make_pair; + +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(Oi::Camera *c, QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow), + cam(c), + imageListModel(c, parent) +{ + ui->setupUi(this); + + ui->imgTable->setModel(&imageListModel); + + connect(cam, &Oi::Camera::propertiesUpdated, this, &MainWindow::updateProperties); + connect(cam, &Oi::Camera::modelUpdated, [&](QString model) { + ui->lblModel->setText(QString("Olympus OM-D ") + model); + }); + connect(cam, &Oi::Camera::imagesUpdated, [&](QHash imgs) { + ui->lblImages->setText(QString("%1").arg(imgs.count())); + }); + connect(cam, &Oi::Camera::capacityUpdated, [&](unsigned long c) { + ui->lblCapacity->setText(QString("%1 MB").arg(c / (1 << 20))); + }); + connect(cam, &Oi::Camera::connected, [&](enum Oi::Camera::ConnectMode m) { + QLabel *l = ui->lblConnectMode; + switch (m) { + case Oi::Camera::CONNECT_PRIVATE: l->setText(tr("Private")); break; + case Oi::Camera::CONNECT_SHARED: l->setText(tr("Shared")); break; + case Oi::Camera::CONNECT_UNKNOWN: l->setText(tr("Unknown")); break; + } + }); + + propInfo["touchactiveframe"] = qMakePair(tr(""), tr("")); + propInfo["takemode"] = qMakePair(tr("Shooting Mode"), tr("")); + propInfo["noisereduction"] = qMakePair(tr("Noise Reduction"), tr("")); + propInfo["lowvibtime"] = qMakePair(tr(""), tr("")); + propInfo["bulbtimelimit"] = qMakePair(tr(""), tr("")); + propInfo["digitaltelecon"] = qMakePair(tr("Digital Tele-converter"), tr("")); + propInfo["drivemode"] = qMakePair(tr(""), tr("")); + propInfo["focalvalue"] = qMakePair(tr(""), tr("")); + propInfo["expcomp"] = qMakePair(tr("Exposure Compensation"), tr("")); + propInfo["shuttspeedvalue"] = qMakePair(tr("Shutter Speed"), tr("")); + propInfo["isospeedvalue"] = qMakePair(tr("ISO Sensivity"), tr("")); + propInfo["wbvalue"] = qMakePair(tr("White Balance"), tr("")); + propInfo["artfilter"] = qMakePair(tr("Art Filter"), tr("")); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::updateProperties(Oi::Properties *props) +{ + QGroupBox *wdg = ui->grpProperties; + + /* Create layout if non-existant */ + QFormLayout *layout = qobject_cast(wdg->layout()); + if (!layout) { + layout = new QFormLayout(); + wdg->setLayout(layout); + } + + /* Remove old properties */ + while (layout->count()) { + QLayoutItem *item = layout->takeAt(0); + + delete item->widget(); + delete item; + } + + for (Oi::Property &prop : props->values()) { + QLabel *lbl = new QLabel(wdg); + lbl->setText(propInfo.value(prop.key()).first); + lbl->setToolTip(propInfo.value(prop.key()).second); + + QComboBox *cbox = new QComboBox(wdg); + cbox->addItems(prop.valids()); + cbox->setCurrentText(prop.value()); + + connect(cbox, &QComboBox::currentTextChanged, [&](QString value) { + prop = value; + }); + + layout->addRow(lbl, cbox); + } +} diff --git a/test/mainwindow.h b/test/mainwindow.h new file mode 100644 index 0000000..2dfc9c4 --- /dev/null +++ b/test/mainwindow.h @@ -0,0 +1,32 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +#include +#include +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(Oi::Camera *c, QWidget *parent = 0); + ~MainWindow(); + +protected: + void updateProperties(Oi::Properties *props); + + Ui::MainWindow *ui; + Oi::Camera *cam; + Oi::ImageListModel imageListModel; + + QMap> propInfo; +}; + +#endif // MAINWINDOW_H diff --git a/test/mainwindow.ui b/test/mainwindow.ui new file mode 100644 index 0000000..051cd16 --- /dev/null +++ b/test/mainwindow.ui @@ -0,0 +1,176 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + 0 + + + + Images + + + + + + + + + + + + + + + + + Camera Properties + + + + + + + + + Model + + + + + + + + + + + + + + Unused Capacity + + + + + + + Connection Mode + + + + + + + + + + + + + + + + + + + + + Images + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 345 + + + + + + + + Settings + + + + + + + + Live View + + + + + + + + + + 0 + 0 + 800 + 22 + + + + + File + + + + + + ? + + + + + + + + + + Quit + + + + + About + + + + + + diff --git a/test/test.pro b/test/test.pro index 1e1fcda..a345d35 100644 --- a/test/test.pro +++ b/test/test.pro @@ -13,9 +13,10 @@ TEMPLATE = app SOURCES += main.cpp\ - viewer.cpp + mainwindow.cpp -HEADERS += viewer.h +HEADERS += \ + mainwindow.h win32: CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libqt-omd/release/ -llibqt-omd else:win32: CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libqt-omd/debug/ -llibqt-omd @@ -28,3 +29,6 @@ CONFIG += c++11 RESOURCES += \ images.qrc + +FORMS += \ + mainwindow.ui diff --git a/test/viewer.cpp b/test/viewer.cpp deleted file mode 100644 index 7969170..0000000 --- a/test/viewer.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "viewer.h" - -Viewer::Viewer(QWidget *parent) - : QWidget(parent) -{ -} - -Viewer::~Viewer() -{ - -} diff --git a/test/viewer.h b/test/viewer.h deleted file mode 100644 index 6bc49a7..0000000 --- a/test/viewer.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef VIEWER_H -#define VIEWER_H - -#include - -class Viewer : public QWidget -{ - Q_OBJECT - -public: - Viewer(QWidget *parent = 0); - ~Viewer(); -}; - -#endif // VIEWER_H