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