git-svn-id: svn://db.shs.com.ru/libs@465 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -553,6 +553,14 @@ Graphic::GraphicsData Graphic::graphicsData() const {
|
||||
}
|
||||
|
||||
|
||||
QByteArray Graphic::graphicsDataRaw() const {
|
||||
QByteArray ret;
|
||||
QDataStream s(&ret, QIODevice::WriteOnly);
|
||||
s << graphicsData();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void Graphic::setGraphicsData(const Graphic::GraphicsData & gd) {
|
||||
setGraphicsCount(gd.size());
|
||||
for (int i = 0; i < gd.size(); ++i)
|
||||
@@ -561,6 +569,18 @@ void Graphic::setGraphicsData(const Graphic::GraphicsData & gd) {
|
||||
}
|
||||
|
||||
|
||||
void Graphic::setGraphicsDataRaw(const QByteArray & ba) {
|
||||
if (ba.isEmpty()) {
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
Graphic::GraphicsData gd;
|
||||
QDataStream s(ba);
|
||||
s >> gd;
|
||||
setGraphicsData(gd);
|
||||
}
|
||||
|
||||
|
||||
void Graphic::setButtons(Graphic::Buttons b) {
|
||||
buttons_ = b;
|
||||
ui->buttonAutofit->setVisible(b.testFlag(Autofit));
|
||||
|
||||
Reference in New Issue
Block a user