当前位置: 首页>>代码示例>>C++>>正文


C++ QMovie类代码示例

本文整理汇总了C++中QMovie的典型用法代码示例。如果您正苦于以下问题:C++ QMovie类的具体用法?C++ QMovie怎么用?C++ QMovie使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QMovie类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QCOMPARE

void tst_QMovie::construction()
{
    QMovie movie;
    QCOMPARE(movie.device(), (QIODevice *)0);
    QCOMPARE(movie.fileName(), QString());
    QCOMPARE(movie.state(), QMovie::NotRunning);
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:7,代码来源:tst_qmovie.cpp

示例2: QMovie

void QtWin::setStatusActive(bool active) {
  if (active == lastStatusActive) return;
  lastStatusActive = active;

  if (active) {
    ui->statusLabel->clear();
    QMovie *movie = new QMovie(":/icons/running.gif");
    ui->statusLabel->setMovie(movie);
    movie->start();

    ui->statusLabel->setToolTip("Simulation is running");
    ui->stopPushButton->setEnabled(true);

  } else {
    QMovie *movie = ui->statusLabel->movie();
    if (movie) {
      ui->statusLabel->clear();
      delete movie;
    }

    ui->statusLabel->setPixmap(QPixmap(":/icons/idle.png"));
    ui->statusLabel->setToolTip("Simulation has ended");
    ui->stopPushButton->setEnabled(false);
  }
}
开发者ID:jwatte,项目名称:OpenSCAM,代码行数:25,代码来源:QtWin.cpp

示例3: QNetworkAccessManager

FtpApp::FtpApp()
{
    manager = new QNetworkAccessManager(this);    
    setWindowTitle("JIGS File Sharing");
    setGeometry(430,300,555,400);

    QMovie *movie = new QMovie(":/images/waiting.gif");
    processLabel = new QLabel(this);
    processLabel->setMovie(movie);
    movie->start();

    splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/images/FtpSplash.png"));
    splash->show();

    createStatusBar();
    createActions();
    createMenus();

    fileList = new QTreeWidget;
    fileList->setEnabled(false);
    fileList->setRootIsDecorated(false);
    fileList->setHeaderLabels(QStringList() << tr("Name") << tr("Size") << tr("Owner") << tr("Group") << tr("Time"));
    fileList->setColumnWidth(0,150);

    connect(fileList,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(downloadFile(QTreeWidgetItem*)));

    getFiles();
}
开发者ID:gauravdeshmukh,项目名称:FileSharing,代码行数:29,代码来源:MainFrame.cpp

示例4: QWidget

QInputOutputPacsWidget::QInputOutputPacsWidget(QWidget *parent)
 : QWidget(parent)
{
    setupUi(this);

    createContextMenuQStudyTreeWidget();

    Settings settings;
    settings.restoreColumnsWidths(InputOutputSettings::PACSStudyListColumnsWidth, m_studyTreeWidget->getQTreeWidget());

    QStudyTreeWidget::ColumnIndex sortByColumn = (QStudyTreeWidget::ColumnIndex) settings.getValue(InputOutputSettings::PACSStudyListSortByColumn).toInt();
    Qt::SortOrder sortOrderColumn = (Qt::SortOrder) settings.getValue(InputOutputSettings::PACSStudyListSortOrder).toInt();
    m_studyTreeWidget->setSortByColumn (sortByColumn, sortOrderColumn);

    m_statsWatcher = new StatsWatcher("QueryInputOutputPacsWidget", this);
    m_statsWatcher->addClicksCounter(m_retrievAndViewButton);
    m_statsWatcher->addClicksCounter(m_retrieveButton);

    // Preparem el QMovie per indicar quan s'estan fent consultes al PACS
    QMovie *operationAnimation = new QMovie(this);
    operationAnimation->setFileName(":/images/loader.gif");
    m_queryAnimationLabel->setMovie(operationAnimation);
    operationAnimation->start();

    setQueryInProgress(false);

    createConnections();
}
开发者ID:151706061,项目名称:starviewer,代码行数:28,代码来源:qinputoutputpacswidget.cpp

示例5: BaseClass

    ExplorerWidget::ExplorerWidget(MainWindow *parentMainWindow) : BaseClass(parentMainWindow),
        _progress(0)
    {
        _treeWidget = new ExplorerTreeWidget(this);

        QHBoxLayout *vlaout = new QHBoxLayout();
        vlaout->setMargin(0);
        vlaout->addWidget(_treeWidget, Qt::AlignJustify);

        VERIFY(connect(_treeWidget, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(ui_itemExpanded(QTreeWidgetItem *))));
        VERIFY(connect(_treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), 
                       this, SLOT(ui_itemDoubleClicked(QTreeWidgetItem *, int))));

        // Temporarily disabling export/import feature
        //VERIFY(connect(_treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
        //               parentMainWindow, SLOT(onExplorerItemSelected(QTreeWidgetItem *))));

        setLayout(vlaout);

        QMovie *movie = new QMovie(":robomongo/icons/loading.gif", QByteArray(), this);
        _progressLabel = new QLabel(this);
        _progressLabel->setMovie(movie);
        _progressLabel->hide();
        movie->start();        
    }
开发者ID:adityavs,项目名称:robomongo,代码行数:25,代码来源:ExplorerWidget.cpp

示例6: QMovie

void LoginWidget::checkLogin()
{
  QString user = _editUsername->text();
  QString pass = _editPassword->text();
  QString ip = _editIp->text();
  QMovie *movie = new QMovie("./gui/ring.gif");
  QLabel *processLabel = new QLabel(this);

  processLabel->setMovie(movie);
  movie->start();

  _userString = user.toUtf8().constData();
  _passString = pass.toUtf8().constData();
  _ipString = ip.toUtf8().constData();

  if (_userString == "" || _passString == "" || _ipString == "")
    {
      QMessageBox *msgBox = new QMessageBox(this);

      msgBox->setText("Please fill the fields");
      msgBox->exec();
    }
  else
    {
      _editPassword->clear();

      this->clearLayout(_mainLayout);
      _mainLayout->addWidget(processLabel, 0, 0, Qt::AlignCenter);

      g_PTUser.logUser(_userString, _passString, _ipString);
    }
}
开发者ID:charvoa,项目名称:cpp_babel,代码行数:32,代码来源:LoginWidget.cpp

示例7: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QMovie *mov = new QMovie(":/img/pics/start.gif");
    QLabel *label = new QLabel("",0);
    label->setGeometry(450,200,500,300);
    label->setMovie(mov);
    mov->start();
    label->setWindowFlags(Qt::FramelessWindowHint);
    label->show();

    QTime t;
    t.start();
    while(t.elapsed() < 1500)
    {
        a.processEvents();
    }


    MainWindow w;
    w.show();
    w.move((QApplication::desktop()->width()-w.width())/2,(QApplication::desktop()->height()-w.height())/2);
    label->close();

    return a.exec();
}
开发者ID:chenliusuo,项目名称:Mobile_Assistant_For_Linux,代码行数:27,代码来源:main.cpp

示例8: QDialog

ImportDialog::ImportDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ImportDialog)
{
    ui->setupUi(this);

    ui->stackedWidget->setAnimation(QEasingCurve::Linear);
    ui->stackedWidget->setSpeed(200);
    ui->badgeSuccess->setActive(true);
    ui->badgeSuccess->setBadgeType(Badge::LabelSuccess);
    ui->badgeSuccess->setShowActiveMark(true);

    QMovie *loadingMovie = new QMovie(":/img/spinner.gif");
    loadingMovie->start();
    ui->loading->setMovie(loadingMovie);

    m_timer.setInterval(500);

    m_posterDownloadManager = new DownloadManager(this);
    connect(m_posterDownloadManager, SIGNAL(downloadFinished(DownloadManagerElement)), this, SLOT(onEpisodeDownloadFinished(DownloadManagerElement)));

    connect(ui->movieSearchWidget, SIGNAL(sigResultClicked()), this, SLOT(onMovieChosen()));
    connect(ui->concertSearchWidget, SIGNAL(sigResultClicked()), this, SLOT(onConcertChosen()));
    connect(ui->tvShowSearchEpisode, SIGNAL(sigResultClicked()), this, SLOT(onTvShowChosen()));
    connect(ui->btnImport, SIGNAL(clicked()), this, SLOT(onImport()));
    connect(&m_timer, SIGNAL(timeout()), this, SLOT(onFileWatcherTimeout()));
}
开发者ID:dhead666,项目名称:MediaElch,代码行数:27,代码来源:ImportDialog.cpp

示例9: info

//使用数据函数
void MainWindow::httpReadyRead() //有可用数据
{
    if(reply->error() == QNetworkReply::NoError)
    {
        //获取字节流构造 QPixmap 对象
        currentPicture->loadFromData(reply->readAll());
        QFileInfo info(url.path());//分解出文件名
        qDebug() << "url.path" << url.path();
        QString fileName(info.fileName());//获取文件名
        //如果文件名为空,则使用“index.html” ,例如使用“http://www.yafeilinux.com” 时,文件名就为空
        if (fileName.isEmpty())
        {
           fileName = "index.html";//因为地址中可能没有文件名,这时我们就使用一个默认的文件名。
        }
        fileName.append(".jpg");
        qDebug() << "fileName" << fileName;
        //QDateTime now;
        //QString filename = now.currentDateTime().toString("yyMMddhhmmss.jpg");
        currentPicture->save(fileName);//保存图片
        //qDebug()<<"picture saved as "<<filename;
        currentFileName = fileName;

        //可以在onpaint中 用QPixmap 显示currentPicture,则这种方法则不需要保存

        //显示图片,
        QMovie *move = new QMovie(currentFileName);
        //label自动适应图片大小显示
        ui->labelVerificationCode->resize(QPixmap(fileName).width(), QPixmap(fileName).height());
        ui->labelVerificationCode->setMovie(move);
        move->start();
    }
}
开发者ID:elinuxboy,项目名称:QtProject,代码行数:33,代码来源:mainwindow.cpp

示例10: Q_UNUSED

void anibutton::setButtonIcon(int frame)   // member function that catches the frameChanged signal of the QMovie
{
    if(!this->isChecked())return;
    Q_UNUSED(frame)
    QMovie* pMovie = (QMovie*)sender();
    this->setIcon(QIcon(pMovie->currentPixmap()));
}
开发者ID:privet56,项目名称:qWebTest,代码行数:7,代码来源:anibutton.cpp

示例11: setPixmap

void Tank::deleteTank()
{
    alive = false;
    head->setPixmap(QPixmap(":/images/images/empty.png").scaled(pixsize,pixsize));
    setPixmap(QPixmap(":/images/images/empty.png").scaled(pixsize,pixsize));

    int stime;
    long ltime;
    int random;
    ltime = time(NULL);
    stime = (unsigned) ltime/2;
    srand(stime);
    random = rand()%3 +1;

    QMediaPlayer *explode = new QMediaPlayer();
    explode->setMedia(QUrl("qrc:/sounds/sounds/tank/explode" + QString::number(random) + ".mp3"));
    explode->play();

    // анимация
    gif_anim = new QLabel();
    gif_anim->setStyleSheet("background-color: transparent;");
    QMovie *movie = new QMovie(":/images/images/anim/Explo.gif");
    gif_anim->setMovie(movie);
    gif_anim->move(x()-25,y()-25);
    movie->setScaledSize(QSize(250,250));
    movie->start();
    QGraphicsProxyWidget *proxy = game->scene->addWidget(gif_anim);
    QTimer::singleShot(2500, this, SLOT(deleteGif()));
}
开发者ID:Lonsofore,项目名称:TankBattles,代码行数:29,代码来源:tank.cpp

示例12: while

void DWindowUI::SwitchToProcessUI() {
    QLayoutItem *child;
    while ((child = actionLayout_->takeAt(0)) != 0)  {
        if (child->widget()) {
            child->widget()->setVisible(false);
        }
    }
    while ((child = selectLayout_->takeAt(0)) != 0)  {
        if (child->widget()) {
            child->widget()->setVisible(false);
        }
    }

    QLabel *processHints = new QLabel(tr("<a style='color:#ffffff; font-size:12px'>Please </a>"
                                         "<a style='color:#ebab4c; font-size:12px'>DO NOT</a>"
                                         "<a style='color:#ffffff; font-size:12px'> remove the USB flash drive or shutdown while file is writing.<a>"));
    processHints->setFixedWidth(labelMaxWidth);
    processHints->setWordWrap(true);

    selectLayout_->addStretch();
    selectLayout_->addWidget(processHints);
    selectLayout_->setAlignment(processHints, Qt::AlignVCenter);

    usbLabel_->setText("<p style='color:white; font-size:10px;'>0%  </p>");
    QMovie *processMovie = new QMovie(":/ui/images/process-active.gif");
    processLabel_->setMovie(processMovie);
    processMovie->start();

    processTimer_ = new QTimer(this);
    processTimer_->setInterval(5000);
    connect(processTimer_, SIGNAL(timeout()), this, SLOT(checkProcess()));
    processTimer_->start();

    isoLabel_->start();
}
开发者ID:LightCity,项目名称:deepin-boot-maker,代码行数:35,代码来源:dwindowui.cpp

示例13: setButtonIcon

void TestConnectivity::setButtonIcon(int){
    QMovie* caller = (QMovie*)QObject::sender();
    int id = this->myMovies[caller];
    if(ui->listWidget->count() > 0){
        ui->listWidget->item(id)->setIcon(QIcon(caller->currentPixmap()));
    }
}
开发者ID:anukat2015,项目名称:AdHash,代码行数:7,代码来源:testconnectivity.cpp

示例14: QBuffer

void PixmapListDialog::setMovie( const QByteArray& image )
{
	if ( label->movie() ) delete label->movie();
	if ( movie_buffer ) delete movie_buffer;

	movie_buffer = new QBuffer();
	movie_buffer->buffer() = image;
	movie_buffer->open( QIODevice::ReadOnly );

	QMovie *pm = new QMovie( movie_buffer );

	QBuffer *movie_buffer_tmp = new QBuffer();
	movie_buffer_tmp->buffer() = image;
	movie_buffer_tmp->open( QIODevice::ReadOnly );
	QMovie *pm_tmp = new QMovie( movie_buffer_tmp );
	pm_tmp->jumpToFrame ( 0 );
	QImage background_image = pm_tmp->currentImage();
	QSize scaled_size = pm_tmp->currentImage().size();
	pm_tmp->stop();
	delete pm_tmp;
	delete movie_buffer_tmp;

	scaled_size.scale( background_label->size(), Qt::KeepAspectRatio );
	pm->setScaledSize( scaled_size );
	background_label->setPixmap( QPixmap::fromImage( background_image.scaled( scaled_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ) );
	pm->setCacheMode( QMovie::CacheAll );
	label->setMovie( pm );
	label->movie()->start();
}
开发者ID:pkt,项目名称:plasma-widget-cwp-1.5.14-el,代码行数:29,代码来源:plasma-cwp-pixmap-list-dialog.cpp

示例15: QMovie

void BattleForm::setGif(QString gif, QLabel *label)
{
    QMovie *movie = new QMovie(gif);
    label->setMovie(movie);
    label->setScaledContents(true);
    movie->start();
}
开发者ID:cgarcia019,项目名称:WebMon,代码行数:7,代码来源:battleform.cpp


注:本文中的QMovie类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。