本文整理汇总了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;
}
示例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);
}
示例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 {
示例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
}
示例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 );
}
示例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 );
}
示例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;
}
示例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);
}