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


C++ QMovie::isValid方法代码示例

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


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

示例1: setani

bool anibutton::setani(QString sRes)
{
    QMovie* pMovie = new QMovie(sRes);
    connect(pMovie,SIGNAL(frameChanged(int)),this,SLOT(setButtonIcon(int)));
    if (pMovie->loopCount() != -1) //if movie doesn't loop forever, force it to
        connect(pMovie,SIGNAL(finished()),pMovie,SLOT(start()));
    pMovie->start();
    if(!pMovie->isValid())
    {
        helpers::log("anibutton:setani NOT.ok("+sRes+"):"+QString::number(pMovie->isValid()), LOG_WRN, qApp, 0);
        qDebug()<<QImageReader::supportedImageFormats();
        return false;
    }
    return true;
}
开发者ID:privet56,项目名称:qWebTest,代码行数:15,代码来源:anibutton.cpp

示例2: fnt

Connecting::Connecting(QWidget *parent) :
	QWidget(parent), m_client(NULL), m_task(NULL), state(0), tries(0)
{
	ui.setupUi(this);

	connect(&m_timer, SIGNAL(timeout()), this, SLOT(proceed()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(abort()));

	QMovie* movie = new QMovie(":/preloader/cube");

	// Make sure the GIF was loaded correctly
	if (!movie->isValid())
	{
	    // Something went wrong :(
		ui.preloader->setText("Loading");
	} else {
		// Play GIF
		ui.preloader->setMovie(movie);
		movie->start();
	}

	m_try_limit = 6;

	QFont fnt(ui.btnCancel->font());
    fnt.setFamily("Ubuntu Light");
    fnt.setPointSize(16);
    ui.btnCancel->setFont(fnt);
}
开发者ID:oleszczy,项目名称:DisCODe,代码行数:28,代码来源:Connecting.cpp

示例3: setImage

void AutoResizeImageLabel::setImage( QString fileName, int frameCount ) {
    _nativeUsed = false;
    _frameCount = frameCount;
    QMovie* movie = new QMovie( fileName );

    if ( movie->isValid() && //image files have FrameCount -1
            ( movie->frameCount() == 0 || movie->frameCount() > 1 ) ) { //PLease Do not Leave out this line of Code Crucial for Pixture animated gif differentiation
        connect( movie, SIGNAL( frameChanged( int ) ), this, SLOT( animationFrameChanged( int ) ) );
        setMovie_internal( movie );
    }  else {
开发者ID:baoping,项目名称:Red-Bull-Media-Player,代码行数:10,代码来源:AutoResizeImageLabel.cpp

示例4: showBuyGuldenDialog

void ReceiveCoinsDialog::showBuyGuldenDialog()
{
#ifdef WIN32
    if (WIN32) {

        QDesktopServices::openUrl(QUrl("https://gulden.com/purchase"));
        return;
    }
#endif

#if defined(HAVE_WEBENGINE_VIEW) || defined(HAVE_WEBKIT)
    ui->receiveCoinsStackedWidget->setCurrentIndex(1);

    ui->accountRequestPaymentButtonComposite->setVisible(false);
    ui->accountBuyGuldenButton->setVisible(false);
    ui->accountSaveQRButtonComposite->setVisible(false);
    ui->accountCopyToClipboardButtonComposite->setVisible(false);
    ui->cancelButton->setVisible(true);
    ui->closeButton->setVisible(false);
    ui->cancelButtonGroup->setVisible(true);
    ui->generateRequestButton->setVisible(false);
    ui->generateAnotherRequestButton->setVisible(false);
    ui->accountBuyButton->setVisible(true);

    QMovie* movie = new QMovie(":/Gulden/loading_animation");
    if (movie && movie->isValid()) {
        ui->loadingAnimationLabel->setVisible(true);
        buyView->setVisible(false);
        movie->setScaledSize(QSize(30, 30));
        ui->loadingAnimationLabel->setMovie(movie);
        movie->start();
    } else {
        ui->loadingAnimationLabel->setVisible(false);
        buyView->setVisible(true);
        if (movie)
            delete movie;
    }

    buyView->load(QUrl("https://gulden.com/purchase"));

#if defined(HAVE_WEBENGINE_VIEW)
    buyView->page()->setBackgroundColor(Qt::transparent);
#else
    QPalette palette = buyView->palette();
    palette.setBrush(QPalette::Base, Qt::transparent);
    buyView->page()->setPalette(palette);
    buyView->setAttribute(Qt::WA_OpaquePaintEvent, false);
    buyView->page()->setLinkDelegationPolicy(QWebPage::DontDelegateLinks);
#endif

    connect(buyView, SIGNAL(loadFinished(bool)), this, SLOT(loadBuyViewFinished(bool)));
#endif
}
开发者ID:strataghyst,项目名称:gulden-official,代码行数:53,代码来源:receivecoinsdialog.cpp

示例5: setImageContentType

void VideoStackedWidget::setImageContentType( QString imageUrl ) {
    if( imageUrl.isEmpty() )
        return;

    QMovie *animatedImage = new QMovie( imageUrl );
    _origPixmap = QPixmap( imageUrl );

    if( animatedImage->isValid() && ( animatedImage->frameCount() == 0 || animatedImage->frameCount() > 1 ) )
        setAnimatedImage( animatedImage, false );
    else
        setPixmap( _origPixmap, false );
}
开发者ID:baoping,项目名称:Red-Bull-Media-Player,代码行数:12,代码来源:VideoStackedWidget.cpp

示例6: setBufferingAnimation

void VideoStackedWidget::setBufferingAnimation( QString animationUrl, int frameCount ) {
    if( animationUrl.isEmpty() )
        return;

    QMovie *animatedImage = new QMovie( animationUrl );
    _origPixmap = QPixmap( animationUrl );

    if( animatedImage->isValid() ) {
        _currentBufferingAnimation = animatedImage;
        _currentBufferingAnimationFrameCount = frameCount;
        connect( _currentBufferingAnimation, SIGNAL( frameChanged( int ) ), this, SLOT( animationFrameChangedSlot( int ) ) );
        setAnimatedImage( animatedImage, true );
    }
开发者ID:baoping,项目名称:Red-Bull-Media-Player,代码行数:13,代码来源:VideoStackedWidget.cpp

示例7: updateWidget

bool DataMediaWidget::updateWidget(const IDataMediaURI &AUri, const QByteArray &AData)
{
    bool success = false;
    if (AUri.type == MEDIAELEM_TYPE_IMAGE)
    {
        QBuffer *buffer = new QBuffer(this);
        buffer->setData(AData);
        buffer->open(QIODevice::ReadOnly);

        QImageReader reader(buffer);
        if (reader.supportsAnimation())
        {
            QMovie *movie = new QMovie(buffer,reader.format(),this);
            if (movie->isValid())
            {
                success = true;
                setMovie(movie);
                movie->start();
            }
            else
            {
                delete movie;
            }
        }
        else
        {
            QPixmap pixmap;
            pixmap.loadFromData(AData,reader.format());
            if (!pixmap.isNull())
            {
                success = true;
                setPixmap(pixmap);
            }
        }
        if (success)
        {
            setFrameShape(QLabel::NoFrame);
            setFrameShadow(QLabel::Plain);
            disconnect(FDataForms->instance());
            emit mediaShown();
        }
        else
        {
            delete buffer;
        }
    }
    return success;
}
开发者ID:Nikoli,项目名称:vacuum-im,代码行数:48,代码来源:datamediawidget.cpp

示例8: QDialog

phoneInfo::phoneInfo(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::phoneInfo)
{
    setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
    setWindowOpacity(1);

    ui->setupUi(this);
    ui->label_show_gif->setHidden(true);
    ui->label_show_info->setHidden(true);
    QMovie *movie = new QMovie(":/wizard/pic/res/loading1.gif");
    ui->label_show_gif->setMovie(movie);
    qDebug()<<movie->isValid();
//    ui->label->setMinimumSize();
    movie->start();
 //   ui->label->setHidden(true);
}
开发者ID:godvmxi,项目名称:mobile,代码行数:17,代码来源:phoneinfo.cpp


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