• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ qint32函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中qint32函数的典型用法代码示例。如果您正苦于以下问题:C++ qint32函数的具体用法?C++ qint32怎么用?C++ qint32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: clean

void BrowserApplication::saveSession()
{
    if (quiting)
        return;
    QSettings settings;
    settings.beginGroup(QLatin1String("MainWindow"));
    settings.setValue(QLatin1String("restoring"), false);
    settings.endGroup();

    QWebSettings *globalSettings = QWebSettings::globalSettings();
    if (globalSettings->testAttribute(QWebSettings::PrivateBrowsingEnabled))
        return;

    clean();

    settings.beginGroup(QLatin1String("sessions"));

    int version = 2;

    QByteArray data;
    QBuffer buffer(&data);
    QDataStream stream(&buffer);
    buffer.open(QIODevice::WriteOnly);

    stream << qint32(BrowserApplicationMagic);
    stream << qint32(version);

    stream << qint32(m_mainWindows.count());
    for (int i = 0; i < m_mainWindows.count(); ++i)
        stream << m_mainWindows.at(i)->saveState();
    settings.setValue(QLatin1String("lastSession"), data);
    settings.endGroup();
}
开发者ID:lmax,项目名称:arora,代码行数:33,代码来源:browserapplication.cpp


示例2: in

void MyServer::sendFriendGroup(const QVector<groupInfo>& groups,socketClients* client)
{
    int size = groups.count();
   QTcpSocket* socket = client->getSocket();

   QByteArray data;
   QDataStream in(&data,QIODevice::WriteOnly);
   in.setVersion(QDataStream::Qt_5_0);

   in<<qint32(0)<<qint8(respondType::friendGroup);
    QVector<int> friendsID;
    for (int i=0;i<size;i++) {
        in<<groups[i].name;
        // 将每一个分组下的所有好友信息封装在一起,再发送出去
        if (groups[i].total<=0) continue;
        model.getFriendsID(friendsID, groups[i].id);
        for (int j=0;j<friendsID.count();j++) {
            userInfo* info = model.getFriendsInfo(friendsID[j]);
            if ( hx.contains(info->account) ) {
                makeFriendInfo(in,info,clients.at( hx[ info->account ] )->getUserState() );
            }
            else {
                makeFriendInfo(in,info,userStateType::offline );
            }
            delete info;
        }
    }
    in.device()->seek(0);
    in<<qint32(data.size()-sizeof(qint32));
    socket->write(data);
}
开发者ID:lsj754039701,项目名称:QQserver,代码行数:31,代码来源:tcpserver.cpp


示例3: QBrush

void QNodeViewCanvas::drawBackground(QPainter* painter, const QRectF& rect)
{
    // GW-TODO: Expose this to QStyle
    painter->fillRect(rect, QBrush(QColor(50, 50, 50)));

    const qint32 gridInterval = 50;
    painter->setWorldMatrixEnabled(true);

    // GW-TODO: Expose this to QStyle
    QPen linePen(QColor(80, 80, 80), 1, Qt::DotLine, Qt::FlatCap, Qt::RoundJoin);
    linePen.setCosmetic(true); // Performance optimization
    painter->setPen(linePen);

    const qreal left = qint32(rect.left()) - (qint32(rect.left()) % gridInterval);
    const qreal top  = qint32(rect.top())  - (qint32(rect.top())  % gridInterval);

    QVarLengthArray<QLineF, 100> linesX;
    for (qreal x = left; x < rect.right(); x += gridInterval)
        linesX.append(QLineF(x, rect.top(), x, rect.bottom()));

    QVarLengthArray<QLineF, 100> linesY;
    for (qreal y = top; y < rect.bottom(); y += gridInterval)
        linesY.append(QLineF(rect.left(), y, rect.right(), y));

    painter->drawLines(linesX.data(), linesX.size());
    painter->drawLines(linesY.data(), linesY.size());
}
开发者ID:BrandonTheHamm,项目名称:QNodeView,代码行数:27,代码来源:QNodeViewCanvas.cpp


示例4: qint32

QDataStream &operator<<(QDataStream &stream, const Stitch &stitch)
{
    stream << qint32(stitch.version);
    stream << qint32(stitch.type);
    stream << qint32(stitch.colorIndex);
    return stream;
}
开发者ID:KDE,项目名称:kxstitch,代码行数:7,代码来源:Stitch.cpp


示例5: writeDraftPositions

	void writeDraftPositions(const PeerId &peer, const MessageCursor &cur) {
		if (!_working()) return;

		if (cur.position == 0 && cur.anchor == 0 && cur.scroll == 0) {
			DraftsMap::iterator i = _draftsPositionsMap.find(peer);
			if (i != _draftsPositionsMap.cend()) {
				clearKey(i.value());
				_draftsPositionsMap.erase(i);
				_mapChanged = true;
				_writeMap();
			}
		} else {
			DraftsMap::const_iterator i = _draftsPositionsMap.constFind(peer);
			if (i == _draftsPositionsMap.cend()) {
				i = _draftsPositionsMap.insert(peer, genKey());
				_mapChanged = true;
				_writeMap(WriteMapFast);
			}
			QString to = _basePath + toFilePart(i.value());
			EncryptedDescriptor data(sizeof(quint64) + sizeof(qint32) * 3);
			data.stream << quint64(peer) << qint32(cur.position) << qint32(cur.anchor) << qint32(cur.scroll);
			FileWriteDescriptor file(i.value());
			file.writeEncrypted(data);
		}
	}
开发者ID:AmesianX,项目名称:tdesktop,代码行数:25,代码来源:localstorage.cpp


示例6: DcOptions

QByteArray DcOptions::serialize() const {
	if (_immutable) {
		// Don't write the overriden options to our settings.
		return DcOptions().serialize();
	}

	QReadLocker lock(&_mutex);

	auto size = sizeof(qint32);
	for (auto &item : _data) {
		size += sizeof(qint32) + sizeof(qint32) + sizeof(qint32); // id + flags + port
		size += sizeof(qint32) + item.second.ip.size();
	}

	auto result = QByteArray();
	result.reserve(size);
	{
		QBuffer buffer(&result);
		if (!buffer.open(QIODevice::WriteOnly)) {
			LOG(("MTP Error: Can't open data for DcOptions::serialize()"));
			return result;
		}

		QDataStream stream(&buffer);
		stream.setVersion(QDataStream::Qt_5_1);
		stream << qint32(_data.size());
		for (auto &item : _data) {
			stream << qint32(item.second.id) << qint32(item.second.flags) << qint32(item.second.port);
			stream << qint32(item.second.ip.size());
			stream.writeRawData(item.second.ip.data(), item.second.ip.size());
		}
	}
	return result;
}
开发者ID:VBelozyorov,项目名称:tdesktop,代码行数:34,代码来源:dc_options.cpp


示例7: qint32

QDataStream& operator<<(QDataStream& s, const CommandlineOptions& a) {
  s << qint32(a.player_action_) << qint32(a.url_list_action_) << a.set_volume_
    << a.volume_modifier_ << a.seek_to_ << a.seek_by_ << a.play_track_at_
    << a.show_osd_ << a.urls_ << a.log_levels_ << a.toggle_pretty_osd_;

  return s;
}
开发者ID:ConfusedGiant,项目名称:Clementine,代码行数:7,代码来源:commandlineoptions.cpp


示例8: qint32

void BattleCommunicator::spectatingChat(int player, int battle, const QString &chat)
{
    if (!contains(battle)) {
        return;
    }

    relay->notify(SpectatingBattleChat, qint32(battle), qint32(player), chat);
}
开发者ID:coyotte508,项目名称:pokemon-online,代码行数:8,代码来源:battlecommunicator.cpp


示例9: out

void QCacheItem::writeHeader(QFile *device) const
{
    QDataStream out(device);

    out << qint32(CacheMagic);
    out << qint32(CurrentCacheVersion);
    out << metaData;
    bool compressed = canCompress();
    out << compressed;
}
开发者ID:FlavioFalcao,项目名称:qt5,代码行数:10,代码来源:qnetworkdiskcache.cpp


示例10: in

QByteArray *sql::sendDescriptor(int descrip)
{
    QByteArray *data=new QByteArray;
    QDataStream in(data,QIODevice::WriteOnly);
    in.setVersion(QDataStream::Qt_5_0);
    in<<qint32(0)<<qint8(respondType::descriptor)<<qint32(descrip);
    in.device()->seek(0);
    in<<qint32(data->size() - sizeof(qint32));
    return data;
}
开发者ID:lsj754039701,项目名称:QQserver,代码行数:10,代码来源:SQL.cpp


示例11: qFatal

void BattleCommunicator::removeSpectator(int idOfBattle, int id)
{
    if (!contains(idOfBattle)) {
        qFatal("Critical bug needing to be solved: BattleCommunicator::removeSpectator, player %d and non-existent battle %d", id, idOfBattle);
    } else {
        mybattles[idOfBattle]->spectators.remove(id);

        relay->notify(SpectateBattle, qint32(idOfBattle), false, qint32(id));
    }
}
开发者ID:coyotte508,项目名称:pokemon-online,代码行数:10,代码来源:battlecommunicator.cpp


示例12: stream

QByteArray NetworkCookieJar::saveState () const
{
    int version = 1;
    QByteArray data;
    QDataStream stream(&data, QIODevice::WriteOnly);

    stream << qint32(NetworkCookieJarMagic);
    stream << qint32(version);
    stream << d->tree;
    return data;
}
开发者ID:3dfxmadscientist,项目名称:arora,代码行数:11,代码来源:networkcookiejar.cpp


示例13: stream

QByteArray QRecentFilesMenu::saveState() const
{
    int version = 0;
    QByteArray data;
    QDataStream stream(&data, QIODevice::WriteOnly);

    stream << qint32(RecentFilesMenuMagic);
    stream << qint32(version);
    stream << m_files;

    return data;
}
开发者ID:elemem,项目名称:ExMplayer,代码行数:12,代码来源:QRecentFilesMenu.cpp


示例14: sendOut

void DouyuTcpSocket::messageWrite(QString &content)
{
    const char *content_ptr = content.toStdString().c_str();
    QDataStream sendOut(&outBlock,QIODevice::WriteOnly);
    qint32 length = 4 + 4 + content.length() + 1;// 2个uint32字段长度+内容长度+'\0'
    sendOut<<qint32(hexReverse_qint32(length))<<qint32(hexReverse_qint32(length))<<qint32(_Douyu_CTS_Num);
    outBlock.append(content_ptr);
    outBlock.append('\0');
    tcpDanmuSoc.write(outBlock);
    outBlock.resize(0);
    delete content_ptr;
}
开发者ID:castnime,项目名称:douyu_danmu_QtDemo,代码行数:12,代码来源:douyutcpsocket.cpp


示例15: qint32

QDataStream&operator<<(QDataStream& out, const Slab& slab)
{
    out << qint32(slab.typeID());
    out << slab.name();
    out << qint32(slab.width());
    out << qint32(slab.height());
    out << slab.colour();
    out << slab.isCollided();
    out << qint32(slab.zValue());

    return out;
}
开发者ID:thomashampson,项目名称:patioDesignerQt,代码行数:12,代码来源:slab.cpp


示例16: qint8

QDataStream &operator<<(QDataStream &out, const GameState::State &data)
{
   out << qint8(data.eastPosition)
       << qint8(data.winnerPosition);

   for (int i = 0; i < 4; ++i)
   {
       out <<        data.playersSet[i]
           << qint32(data.scores    [i])
           << qint32(data.overall   [i]);
   }
   return out;
}
开发者ID:sukhmel,项目名称:experiments.cpp11,代码行数:13,代码来源:gamestate.cpp


示例17: qint32

/*******************************************************************************
    QDataStream operator
*******************************************************************************/
QDataStream& operator<<(QDataStream& s, const CommandlineOptions& a)
{
    s << qint32(a._player_action)
      << qint32(a._playlist_action)
      << a._set_volume
      << a._volume_modifier
      << a._seek_to
      << a._seek_by
      << a._play_track_at
      << a._urls;

    return s;
}
开发者ID:kehugter,项目名称:Yarock,代码行数:16,代码来源:commandlineoptions.cpp


示例18: qint32

QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data)
{
    const QScriptScriptDataPrivate *d = data.d_ptr.data();
    if (d) {
        out << d->contents;
        out << d->fileName;
        out << qint32(d->baseLineNumber);
    } else {
        out << QString();
        out << QString();
        out << qint32(0);
    }
    return out;
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:14,代码来源:qscriptscriptdata.cpp


示例19: Q_Q

void KeyboardPrivate::keyboard_repeat_info(int32_t rate, int32_t delay)
{
    Q_Q(Keyboard);

    if (qint32(repeatRate) != rate) {
        repeatRate = qMax(rate, 0);
        Q_EMIT q->repeatRateChanged();
    }

    if (qint32(repeatDelay) != delay) {
        repeatDelay = qMax(delay, 0);
        Q_EMIT q->repeatDelayChanged();
    }
}
开发者ID:comicfans,项目名称:greenisland,代码行数:14,代码来源:keyboard.cpp


示例20: data

QDataStream &operator<<(QDataStream &out, const ImageContainer &container)
{
    out << container.instanceId();

    const QImage image = container.image();
    const QByteArray data(reinterpret_cast<const char*>(image.constBits()), image.byteCount());

    out << qint32(image.bytesPerLine());
    out << image.size();
    out << qint32(image.format());
    out << qint32(image.byteCount());
    out.writeRawData(reinterpret_cast<const char*>(image.constBits()), image.byteCount());

    return out;
}
开发者ID:anchowee,项目名称:QtCreator,代码行数:15,代码来源:imagecontainer.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qint64函数代码示例发布时间:2022-05-30
下一篇:
C++ qib_dev_err函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap