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


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

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


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

示例1: setButtonIcon

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

示例2: 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

示例3: getCurrentIcon

QIcon getCurrentIcon() {
    QMovie* movie = getMovie();
    int idx = movie->currentFrameNumber();
    QString key = QString("%1").arg(idx);
    if (!icons.contains(key)) {
        QPixmap pm = movie->currentPixmap();
        QIcon retval(pm);
        icons[key] = retval;
    }
    return icons[key];
}
开发者ID:FlavioFalcao,项目名称:Intro-Design-Patterns-Cpp-Qt5,代码行数:11,代码来源:activity.cpp

示例4: setEmoticons

void ChatEmoticonMenu::setEmoticons(QHash<QString, QStringList> list)
{
	clearList();
	m_widget = new QWidget;
	m_grid_layout = new QGridLayout(m_widget);
	m_grid_layout->setSpacing(1);
	m_widget->setLayout(m_grid_layout);
	int max_len_size = 0;

	m_desktop_geometry = QSize();

	QHash<int, QString> emotOrder;
	{
		QHashIterator<QString, QStringList> i(list);
		while (i.hasNext())
		{
			i.next();
			QString key = i.key();
			list.remove(key);
			int index = key.indexOf("|");
			int num = key.mid(0, index).toInt();
			key.remove(0, index+1);
			emotOrder.insert(num, key);
			list.insert(key, i.value());
		}
	}

        QHashIterator<int, QString> i(emotOrder);
	while (i.hasNext())
	{
		i.next();
		QStringList values = list.value(i.value());
		if(!values.size())
			continue;

		movieLabel *label = new movieLabel;
		labelList << label;
		QMovie *movie = new QMovie(i.value());
		movieList << movie;
		label->setMovie(movie);
		movie->setCacheMode(QMovie::CacheAll);
		movie->start();
                QSize size = movie->currentPixmap().size();
                label->setMinimumSize(size);
                sizeList << size;
		label->setToolTip(values.first());
		connect(label, SIGNAL(sendMovieTip(const QString &)), this, SIGNAL(insertSmile(const QString &)));
                label->setInsOnUp(m_insonup);
		movie->stop();
	}
//
//	int sq  = std::ceil(std::sqrt((float)list.count()));
//
//	int i = 0, j = 0;
//
//	foreach(const QString &path, emotList)
//	{
//		QStringList values = list.value(path);
//		if(!values.size())
//			continue;
//		movieLabel *l = new movieLabel;
////		QMovie *movie = new QMovie(path + "/" + list.key(name));
//		QMovie *movie = new QMovie(path);
//		movieList.append(movie);
//		l->setMovie(movie);
//		movie->setCacheMode(QMovie::CacheAll);
//		movie->start();
//		QSize movie_size = movie->currentPixmap().size();
//		l->setMinimumSize(movie_size);
//		labelList.append(l);
//		l->setToolTip(values.first());
//		connect(l, SIGNAL(sendMovieTip(const QString &)), this, SIGNAL(insertSmile(const QString &)));
//		m_grid_layout->addWidget(l,i,j);
//		if ( j < sq )
//			j++;
//		else
//		{
//			i++;
//			j = 0;
//		}
//		movie->stop();
//	}
	setWidget(m_widget);
}
开发者ID:veksha,项目名称:vekshas-qutim,代码行数:84,代码来源:chatemoticonmenu.cpp


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