Browse Source

Make Format() constructed as fast as possible.

QMetaType::type("XlsxColor") is not fast.
master
Debao Zhang 11 years ago
parent
commit
60f27c79a0
  1. 8
      src/xlsx/xlsxformat.cpp
  2. 9
      src/xlsx/xlsxstyles.cpp

8
src/xlsx/xlsxformat.cpp

@ -180,14 +180,6 @@ FormatPrivate::~FormatPrivate()
*/ */
Format::Format() Format::Format()
{ {
if (QMetaType::type("XlsxColor") == QMetaType::UnknownType) {
//Fix me! Where should we put these register code?
qRegisterMetaType<XlsxColor>("XlsxColor");
qRegisterMetaTypeStreamOperators<XlsxColor>("XlsxColor");
#if QT_VERSION >= 0x050200
QMetaType::registerDebugStreamOperator<XlsxColor>();
#endif
}
//The d pointer is initialized with a null pointer //The d pointer is initialized with a null pointer
} }

9
src/xlsx/xlsxstyles.cpp

@ -47,6 +47,15 @@ Styles::Styles(CreateFlag flag)
{ {
//!Fix me. Should the custom num fmt Id starts with 164 or 176 or others?? //!Fix me. Should the custom num fmt Id starts with 164 or 176 or others??
//!Fix me! Where should we put these register code?
if (QMetaType::type("XlsxColor") == QMetaType::UnknownType) {
qRegisterMetaType<XlsxColor>("XlsxColor");
qRegisterMetaTypeStreamOperators<XlsxColor>("XlsxColor");
#if QT_VERSION >= 0x050200
QMetaType::registerDebugStreamOperator<XlsxColor>();
#endif
}
if (flag == F_NewFromScratch) { if (flag == F_NewFromScratch) {
//Add default Format //Add default Format
Format defaultFmt; Format defaultFmt;

Loading…
Cancel
Save