Qt C++ QDataStream和QBuffer

  • QBuffer用法
#include "mywidget.h"
#include "ui_mywidget.h"
#include 
mywidget::mywidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::mywidget)
{
    ui->setupUi(this);
    QBuffer memfile;
    memfile.open(QIODevice::WriteOnly);
    memfile.write("青春时光多美妙热情奔放多欢笑");//写入缓冲区
    memfile.close();
    ui->textEdit->setText(memfile.buffer());//从缓冲区读取
}

 

你可能感兴趣的:(Qt C++ QDataStream和QBuffer)