mirror of
https://github.com/QtExcel/QXlsx.git
synced 2025-01-30 05:02:52 +08:00
Add a methon to class Document
Add a methon to class Document in order to set sheet to be actived by the index.
This commit is contained in:
parent
296e01a3db
commit
9ae0d17acb
@ -100,6 +100,7 @@ public:
|
|||||||
bool insertSheet(int index, const QString &name = QString(),
|
bool insertSheet(int index, const QString &name = QString(),
|
||||||
AbstractSheet::SheetType type = AbstractSheet::ST_WorkSheet);
|
AbstractSheet::SheetType type = AbstractSheet::ST_WorkSheet);
|
||||||
bool selectSheet(const QString &name);
|
bool selectSheet(const QString &name);
|
||||||
|
bool selectSheet(int index);
|
||||||
bool renameSheet(const QString &oldName, const QString &newName);
|
bool renameSheet(const QString &oldName, const QString &newName);
|
||||||
bool copySheet(const QString &srcName, const QString &distName = QString());
|
bool copySheet(const QString &srcName, const QString &distName = QString());
|
||||||
bool moveSheet(const QString &srcName, int distIndex);
|
bool moveSheet(const QString &srcName, int distIndex);
|
||||||
|
@ -1204,6 +1204,16 @@ bool Document::selectSheet(const QString &name)
|
|||||||
return d->workbook->setActiveSheet(sheetNames().indexOf(name));
|
return d->workbook->setActiveSheet(sheetNames().indexOf(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Set worksheet whose index is \a index to be active sheet.
|
||||||
|
* Returns true if success.
|
||||||
|
*/
|
||||||
|
bool Document::selectSheet(int index)
|
||||||
|
{
|
||||||
|
Q_D(Document);
|
||||||
|
return d->workbook->setActiveSheet(index);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Returns the names of worksheets contained in current document.
|
* Returns the names of worksheets contained in current document.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user