Skip to content

Commit

Permalink
https://github.com/QtExcel/QXlsx/pull/172/files
Browse files Browse the repository at this point in the history
  • Loading branch information
j2doll committed Aug 8, 2021
1 parent 14e7ef7 commit 8817bb9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions QXlsx/source/xlsxstyles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ Styles::Styles(CreateFlag flag)

//!Fix me! Where should we put these register code?

// issue #89
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
if (QMetaType::type("XlsxColor") == QMetaType::UnknownType)
// issue #172, #89
#if QT_VERSION >= 0x060000 // Qt 6.0 or over
if (QMetaType::fromName("XlsxColor").isRegistered())
#else
if (QMetaType::type("XlsxColor") == 0
|| !QMetaType::isRegistered(QMetaType::type("XlsxColor")))
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) // Qt 5 or higher
if (QMetaType::type("XlsxColor") == QMetaType::UnknownType)
#else
if (QMetaType::type("XlsxColor") == 0
|| !QMetaType::isRegistered(QMetaType::type("XlsxColor")))
#endif
#endif


{
qRegisterMetaType<XlsxColor>("XlsxColor");

Expand All @@ -52,9 +54,9 @@ Styles::Styles(CreateFlag flag)

qRegisterMetaTypeStreamOperators<XlsxColor>("XlsxColor");

#if QT_VERSION >= 0x050200 // 5.2 or higher
QMetaType::registerDebugStreamOperator<XlsxColor>();
#endif
#if QT_VERSION >= 0x050200 // 5.2 or higher
QMetaType::registerDebugStreamOperator<XlsxColor>();
#endif

#endif
}
Expand Down

0 comments on commit 8817bb9

Please sign in to comment.