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


C++ QTextStream::reset方法代码示例

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


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

示例1: messageCleared

QList<QXmppMessage> UnreadMessageModel::take(QString jid)
{
    QString resource = QXmppUtils::jidToResource(jid);
    QString bareJid = QXmppUtils::jidToBareJid(jid);
    QList<QXmppMessage> results;

    if (resource.isEmpty()) {
        results = m_messageStore.take(bareJid);
    } else {
        QList<QXmppMessage> mid = m_messageStore.take(bareJid);
        foreach (QXmppMessage message, mid) {
            if (QXmppUtils::jidToResource(message.from()) == resource) {
                results << message;
            } else {
                add(message);
            }
        }
    }
    if (m_messageStore.isEmpty()) {
        emit messageCleared();
    } else {
        qDebug("no empty");
    }
    //modification to reset() function, to match qt5, I don't know what really reset() does, to improve
    QTextStream newclass;
    newclass.reset();
//////////
    return results;
}
开发者ID:gentooza,项目名称:QueTalk,代码行数:29,代码来源:UnreadMessageModel.cpp

示例2: add

void UnreadMessageModel::add(const QXmppMessage &message)
{
    m_messageStore[QXmppUtils::jidToBareJid(message.from())] << message;
    //modification to reset() function, to match qt5, I don't know what really reset() does, to improve
    QTextStream newclass;
    newclass.reset();
//////////
}
开发者ID:gentooza,项目名称:QueTalk,代码行数:8,代码来源:UnreadMessageModel.cpp

示例3: clearJob

void TransferManagerModel::clearJob()
{
    QList<QXmppTransferJob *> unfinished;
    foreach (QXmppTransferJob *job, m_jobList) {
        if (job->state() != QXmppTransferJob::FinishedState)
            unfinished << job;
    }
    m_jobList = unfinished;
        //modification to reset() function, to match qt5, I don't know what really reset() does, to improve
    QTextStream newclass;
    newclass.reset();
//////////
}
开发者ID:gentooza,项目名称:QueTalk,代码行数:13,代码来源:TransferManagerModel.cpp

示例4: embed

void nVIDIAEmbedder::embed( const char *name )
{
	QFileInfo   fileinfo( name );
	QString     basename( fileinfo.baseName() );
	QString     codename( basename );
	QImage      image( name );
	
	codename = codename.replace( QRegExp("[^a-zA-Z0-9]"), "_" );
	
	stream << "static const QRgb " << codename << "_data[] = {" << endl << "\t";
	stream.setf( QTextStream::hex | QTextStream::right );
	stream.fill( '0' );
	
	int pixels = image.width() * image.height();
	Q_UINT32 *data = reinterpret_cast<Q_UINT32*>( image.bits() );
	bool hasAlpha = false;

	
	for ( int i = 0, j = 0; i < pixels; i++ ) {
		if ( qAlpha( *data ) && qAlpha( *data ) != 0xff )
			hasAlpha = true;
		
		stream << "0x" << qSetW(8) << *(data++);
		
		if ( i != pixels-1 ) {
			stream << ',';
		
			if ( j++ > 4 ) {
				j = 0;
				stream << endl << "\t";
			} else
				stream << ' ';
		}
	}

	stream.reset();
	
	stream << endl << "}; // " << codename << "_data" << endl << endl;

	EmbedImage *imginfo = new EmbedImage;
	imginfo->width = image.width();
	imginfo->height = image.height();
	imginfo->alpha = hasAlpha;
	imginfo->name = codename;
	imginfo->string = basename;
	index->append( imginfo ); 
}
开发者ID:,项目名称:,代码行数:47,代码来源:


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