mirror of
https://github.com/QtExcel/QXlsx.git
synced 2025-01-16 04:42:53 +08:00
issue #162
This commit is contained in:
parent
1018fe6e33
commit
46e6d41b7b
@ -10,6 +10,7 @@
|
||||
#include <QColor>
|
||||
#include <QImage>
|
||||
#include <QRgb>
|
||||
#include <QRandomGenerator>
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
@ -21,42 +22,23 @@ using namespace std;
|
||||
#include "xlsxrichstring.h"
|
||||
#include "xlsxworkbook.h"
|
||||
|
||||
int test95( QVector<QVariant> params );
|
||||
int test162( QVector<QVariant> params );
|
||||
|
||||
int test( QVector<QVariant> params )
|
||||
{
|
||||
qDebug() << "[debug] current path : " << QDir::currentPath();
|
||||
return test95( params );
|
||||
return test162( params );
|
||||
}
|
||||
|
||||
int test95( QVector<QVariant> params )
|
||||
int test162( QVector<QVariant> params )
|
||||
{
|
||||
using namespace QXlsx;
|
||||
|
||||
Document xlsx;
|
||||
|
||||
for (int i=0; i<10; ++i)
|
||||
{
|
||||
QImage image(40, 30, QImage::Format_RGB32);
|
||||
image.fill( uint(qrand() % 16581375) );
|
||||
|
||||
int index = xlsx.insertImage( 10*i, 5, image );
|
||||
|
||||
QImage img;
|
||||
if ( xlsx.getImage( index, img ) )
|
||||
{
|
||||
QString filename;
|
||||
filename = QString("image %1.png").arg( index );
|
||||
img.save( filename );
|
||||
|
||||
qDebug() << " [image index] " << index;
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << " image count : " << xlsx.getImageCount();
|
||||
xlsx.saveAs("image1.xlsx");
|
||||
|
||||
QXlsx::Document xlsx2("image1.xlsx");
|
||||
Document xlsx2("image1.xlsx");
|
||||
qDebug() << "xlsx2" ;
|
||||
qDebug() << " image count : " << xlsx.getImageCount();
|
||||
xlsx2.saveAs("image2.xlsx");
|
||||
|
@ -374,7 +374,7 @@ bool Workbook::copySheet(int index, const QString &newName)
|
||||
d->sheets.append(QSharedPointer<AbstractSheet> (sheet));
|
||||
d->sheetNames.append(sheet->sheetName());
|
||||
|
||||
return false;
|
||||
return true; // #162
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user