void AutoAppMart::init() { qRegisterMetaType<QModelIndex>("QModelIndex"); api = new AAMApi(this); connect(api,SIGNAL(appList(QList<App>)),this,SLOT(appList(QList<App>))); connect(api,SIGNAL(fileDownloadComplete(App,QString)),this,SLOT(fileDownloadComplete(App,QString))); //appListModel = new ComplexModel(); QHash<int,QByteArray> roles; roles[0] = "."; roles[1] = "app_name"; roles[2] = "date_added"; roles[3] = "date_modified"; roles[4] = "description"; roles[5] = "dev_id"; roles[6] = "dev_name"; roles[7] = "image"; roles[8] = "price"; roles[9] = "product_id"; roles[10] = "requirements"; roles[11] = "support_url"; roles[12] = "thread"; roles[13] = "version"; roles[14] = "whats_new"; appListModel = new StandardModel(roles); /*appListModel->setRoles(list); QList<QList<QString> > data; appListModel->setData(data); */ }
ImageProcessing::ImageProcessing(QWidget *parent) : QMainWindow(parent) { iImageIndex = 0; m_NetTimeout = 0; m_ImageTimeout = 0; lbImage = new QLabel(this); bTurnOff = false; m_notRunning = true; setWindowState(Qt::WindowFullScreen); player = new QMediaPlayer(this); playlist = new QMediaPlaylist(); player->setPlaylist(playlist); m_contentList = new FileDownload(this); m_imageFile = new FileDownload(this); pNextImage = new QTimer(); connect(pNextImage, SIGNAL(timeout()), this, SLOT(timeout())); connect(m_contentList, SIGNAL(downloaded()), this, SLOT(contentListDownloadComplete())); connect(m_contentList, SIGNAL(downloadError(QNetworkReply::NetworkError)), this, SLOT(fileDownloadError(QNetworkReply::NetworkError))); connect(m_imageFile, SIGNAL(downloaded()), this, SLOT(fileDownloadComplete())); connect(m_imageFile, SIGNAL(downloadError(QNetworkReply::NetworkError)), this, SLOT(fileDownloadError(QNetworkReply::NetworkError))); connect(player, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64))); connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64))); connect(player, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged())); connect(player, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(displayErrorMessage())); connect(this, SIGNAL(fileDownloadsComplete()), this, SLOT(unlockShowEvent())); videoWidget = new QVideoWidget(this); player->setVideoOutput(videoWidget); videoWidget->hide(); }