diff --git a/.qmake.conf b/.qmake.conf new file mode 100644 index 0000000..2f68d35 --- /dev/null +++ b/.qmake.conf @@ -0,0 +1,3 @@ +load(qt_build_config) + +MODULE_VERSION = 0.0.1 diff --git a/examples/examples.pro b/examples/examples.pro index 8492073..13479a4 100755 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,6 +1,3 @@ TEMPLATE = subdirs -SUBDIRS = hello - -SUBDIRS += \ - style +SUBDIRS = xlsx diff --git a/examples/hello/hello.pro b/examples/hello/hello.pro deleted file mode 100755 index 75736ae..0000000 --- a/examples/hello/hello.pro +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = hello - -include(../../src/qtxlsxwriter.pri) - -SOURCES += main.cpp diff --git a/examples/style/style.pro b/examples/style/style.pro deleted file mode 100644 index 7308607..0000000 --- a/examples/style/style.pro +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = style - -include(../../src/qtxlsxwriter.pri) - -SOURCES += main.cpp diff --git a/examples/xlsx/hello/hello.pro b/examples/xlsx/hello/hello.pro new file mode 100755 index 0000000..ed45049 --- /dev/null +++ b/examples/xlsx/hello/hello.pro @@ -0,0 +1,6 @@ +TARGET = hello + +#include(../../../src/xlsx/qtxlsx.pri) +QT+=xlsx + +SOURCES += main.cpp diff --git a/examples/hello/main.cpp b/examples/xlsx/hello/main.cpp similarity index 100% rename from examples/hello/main.cpp rename to examples/xlsx/hello/main.cpp diff --git a/examples/style/main.cpp b/examples/xlsx/style/main.cpp similarity index 100% rename from examples/style/main.cpp rename to examples/xlsx/style/main.cpp diff --git a/examples/xlsx/style/style.pro b/examples/xlsx/style/style.pro new file mode 100644 index 0000000..d249a5b --- /dev/null +++ b/examples/xlsx/style/style.pro @@ -0,0 +1,6 @@ +TARGET = style + +#include(../../../src/xlsx/qtxlsx.pri) +QT += xlsx + +SOURCES += main.cpp diff --git a/examples/xlsx/xlsx.pro b/examples/xlsx/xlsx.pro new file mode 100644 index 0000000..a3a011e --- /dev/null +++ b/examples/xlsx/xlsx.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS = hello style + diff --git a/qtxlsx.pro b/qtxlsx.pro new file mode 100755 index 0000000..58c33f2 --- /dev/null +++ b/qtxlsx.pro @@ -0,0 +1 @@ +load(qt_parts) diff --git a/qtxlsxwriter.pro b/qtxlsxwriter.pro deleted file mode 100755 index e69de29..0000000 diff --git a/src/qxlsxwriter.cpp b/src/qxlsxwriter.cpp deleted file mode 100755 index f8b50f6..0000000 --- a/src/qxlsxwriter.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "qxlsxwriter.h" - -QXlsxWriter::QXlsxWriter(QObject *parent) : - QObject(parent) -{ -} diff --git a/src/qxlsxwriter.h b/src/qxlsxwriter.h deleted file mode 100755 index f75bdc2..0000000 --- a/src/qxlsxwriter.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef QXLSXWRITER_H -#define QXLSXWRITER_H - -#include - -class QXlsxWriter : public QObject -{ - Q_OBJECT -public: - explicit QXlsxWriter(QObject *parent = 0); - -// void worksheets(); - -signals: - -public slots: -// void addWorksheet(QString name); -// void addFormat(); -// void addChart(); -// void setProperties(); -}; - -#endif // QXLSXWRITER_H diff --git a/src/src.pro b/src/src.pro new file mode 100644 index 0000000..07d244c --- /dev/null +++ b/src/src.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs + +SUBDIRS = xlsx diff --git a/src/qtxlsxwriter.pri b/src/xlsx/qtxlsx.pri similarity index 91% rename from src/qtxlsxwriter.pri rename to src/xlsx/qtxlsx.pri index 3d5e032..e60e091 100755 --- a/src/qtxlsxwriter.pri +++ b/src/xlsx/qtxlsx.pri @@ -2,6 +2,7 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD QT += core gui gui-private +!build_xlsx_lib:DEFINES += XLSX_NO_LIB HEADERS += $$PWD/xlsxdocprops_p.h \ $$PWD/xlsxrelationships_p.h \ @@ -18,7 +19,8 @@ HEADERS += $$PWD/xlsxdocprops_p.h \ $$PWD/xlsxpackage_p.h \ $$PWD/xlsxworkbook_p.h \ $$PWD/xlsxworksheet_p.h \ - $$PWD/xlsxformat_p.h + $$PWD/xlsxformat_p.h \ + $$PWD/xlsxglobal.h SOURCES += $$PWD/xlsxdocprops.cpp \ $$PWD/xlsxrelationships.cpp \ diff --git a/src/xlsx/xlsx.pro b/src/xlsx/xlsx.pro new file mode 100644 index 0000000..d2ccca6 --- /dev/null +++ b/src/xlsx/xlsx.pro @@ -0,0 +1,13 @@ +TARGET = QtXlsx + +#QMAKE_DOCS = $$PWD/doc/qtxlsx.qdocconf + +load(qt_module) + +CONFIG += build_xlsx_lib +include(qtxlsx.pri) + +QMAKE_TARGET_COMPANY = "Debao Zhang" +QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2013 Debao Zhang " +QMAKE_TARGET_DESCRIPTION = ".Xlsx file wirter for Qt5" + diff --git a/src/xlsxcontenttypes.cpp b/src/xlsx/xlsxcontenttypes.cpp similarity index 100% rename from src/xlsxcontenttypes.cpp rename to src/xlsx/xlsxcontenttypes.cpp diff --git a/src/xlsxcontenttypes_p.h b/src/xlsx/xlsxcontenttypes_p.h similarity index 100% rename from src/xlsxcontenttypes_p.h rename to src/xlsx/xlsxcontenttypes_p.h diff --git a/src/xlsxdocprops.cpp b/src/xlsx/xlsxdocprops.cpp similarity index 100% rename from src/xlsxdocprops.cpp rename to src/xlsx/xlsxdocprops.cpp diff --git a/src/xlsxdocprops_p.h b/src/xlsx/xlsxdocprops_p.h similarity index 100% rename from src/xlsxdocprops_p.h rename to src/xlsx/xlsxdocprops_p.h diff --git a/src/xlsxformat.cpp b/src/xlsx/xlsxformat.cpp similarity index 100% rename from src/xlsxformat.cpp rename to src/xlsx/xlsxformat.cpp diff --git a/src/xlsxformat.h b/src/xlsx/xlsxformat.h similarity index 99% rename from src/xlsxformat.h rename to src/xlsx/xlsxformat.h index ae646af..e1af588 100755 --- a/src/xlsxformat.h +++ b/src/xlsx/xlsxformat.h @@ -25,6 +25,7 @@ #ifndef QXLSX_FORMAT_H #define QXLSX_FORMAT_H +#include "xlsxglobal.h" #include #include #include @@ -37,7 +38,7 @@ class Worksheet; class WorksheetPrivate; class FormatPrivate; -class Format +class Q_XLSX_EXPORT Format { Q_DECLARE_PRIVATE(Format) public: diff --git a/src/xlsxformat_p.h b/src/xlsx/xlsxformat_p.h similarity index 100% rename from src/xlsxformat_p.h rename to src/xlsx/xlsxformat_p.h diff --git a/src/xlsx/xlsxglobal.h b/src/xlsx/xlsxglobal.h new file mode 100644 index 0000000..10cf0ba --- /dev/null +++ b/src/xlsx/xlsxglobal.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** Copyright (c) 2013 Debao Zhang +** All right reserved. +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +****************************************************************************/ +#ifndef XLSXGLOBAL_H +#define XLSXGLOBAL_H +#include + +namespace QXlsx { + +#if !defined(QT_STATIC) && !defined(XLSX_NO_LIB) +# if defined(QT_BUILD_XLSX_LIB) +# define Q_XLSX_EXPORT Q_DECL_EXPORT +# else +# define Q_XLSX_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_XLSX_EXPORT +#endif + +} + +#endif // XLSXGLOBAL_H diff --git a/src/xlsxpackage.cpp b/src/xlsx/xlsxpackage.cpp similarity index 100% rename from src/xlsxpackage.cpp rename to src/xlsx/xlsxpackage.cpp diff --git a/src/xlsxpackage_p.h b/src/xlsx/xlsxpackage_p.h similarity index 100% rename from src/xlsxpackage_p.h rename to src/xlsx/xlsxpackage_p.h diff --git a/src/xlsxrelationships.cpp b/src/xlsx/xlsxrelationships.cpp similarity index 100% rename from src/xlsxrelationships.cpp rename to src/xlsx/xlsxrelationships.cpp diff --git a/src/xlsxrelationships_p.h b/src/xlsx/xlsxrelationships_p.h similarity index 100% rename from src/xlsxrelationships_p.h rename to src/xlsx/xlsxrelationships_p.h diff --git a/src/xlsxsharedstrings.cpp b/src/xlsx/xlsxsharedstrings.cpp similarity index 100% rename from src/xlsxsharedstrings.cpp rename to src/xlsx/xlsxsharedstrings.cpp diff --git a/src/xlsxsharedstrings_p.h b/src/xlsx/xlsxsharedstrings_p.h similarity index 100% rename from src/xlsxsharedstrings_p.h rename to src/xlsx/xlsxsharedstrings_p.h diff --git a/src/xlsxstyles.cpp b/src/xlsx/xlsxstyles.cpp similarity index 100% rename from src/xlsxstyles.cpp rename to src/xlsx/xlsxstyles.cpp diff --git a/src/xlsxstyles_p.h b/src/xlsx/xlsxstyles_p.h similarity index 100% rename from src/xlsxstyles_p.h rename to src/xlsx/xlsxstyles_p.h diff --git a/src/xlsxtheme.cpp b/src/xlsx/xlsxtheme.cpp similarity index 100% rename from src/xlsxtheme.cpp rename to src/xlsx/xlsxtheme.cpp diff --git a/src/xlsxtheme_p.h b/src/xlsx/xlsxtheme_p.h similarity index 100% rename from src/xlsxtheme_p.h rename to src/xlsx/xlsxtheme_p.h diff --git a/src/xlsxutility.cpp b/src/xlsx/xlsxutility.cpp similarity index 100% rename from src/xlsxutility.cpp rename to src/xlsx/xlsxutility.cpp diff --git a/src/xlsxutility_p.h b/src/xlsx/xlsxutility_p.h similarity index 100% rename from src/xlsxutility_p.h rename to src/xlsx/xlsxutility_p.h diff --git a/src/xlsxworkbook.cpp b/src/xlsx/xlsxworkbook.cpp similarity index 100% rename from src/xlsxworkbook.cpp rename to src/xlsx/xlsxworkbook.cpp diff --git a/src/xlsxworkbook.h b/src/xlsx/xlsxworkbook.h similarity index 97% rename from src/xlsxworkbook.h rename to src/xlsx/xlsxworkbook.h index d41f2d8..85f1afc 100755 --- a/src/xlsxworkbook.h +++ b/src/xlsx/xlsxworkbook.h @@ -25,6 +25,7 @@ #ifndef XLSXWORKBOOK_H #define XLSXWORKBOOK_H +#include "xlsxglobal.h" #include #include class QIODevice; @@ -38,7 +39,7 @@ class Styles; class Package; class WorkbookPrivate; -class Workbook : public QObject +class Q_XLSX_EXPORT Workbook : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(Workbook) diff --git a/src/xlsxworkbook_p.h b/src/xlsx/xlsxworkbook_p.h similarity index 100% rename from src/xlsxworkbook_p.h rename to src/xlsx/xlsxworkbook_p.h diff --git a/src/xlsxworksheet.cpp b/src/xlsx/xlsxworksheet.cpp similarity index 100% rename from src/xlsxworksheet.cpp rename to src/xlsx/xlsxworksheet.cpp diff --git a/src/xlsxworksheet.h b/src/xlsx/xlsxworksheet.h similarity index 97% rename from src/xlsxworksheet.h rename to src/xlsx/xlsxworksheet.h index 55587bb..40fe2e6 100755 --- a/src/xlsxworksheet.h +++ b/src/xlsx/xlsxworksheet.h @@ -25,6 +25,7 @@ #ifndef XLSXWORKSHEET_H #define XLSXWORKSHEET_H +#include "xlsxglobal.h" #include #include #include @@ -39,7 +40,7 @@ class XmlStreamWriter; class Format; class WorksheetPrivate; -class Worksheet : public QObject +class Q_XLSX_EXPORT Worksheet : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(Worksheet) diff --git a/src/xlsxworksheet_p.h b/src/xlsx/xlsxworksheet_p.h similarity index 100% rename from src/xlsxworksheet_p.h rename to src/xlsx/xlsxworksheet_p.h diff --git a/src/xmlstreamwriter.cpp b/src/xlsx/xmlstreamwriter.cpp similarity index 100% rename from src/xmlstreamwriter.cpp rename to src/xlsx/xmlstreamwriter.cpp diff --git a/src/xmlstreamwriter_p.h b/src/xlsx/xmlstreamwriter_p.h similarity index 100% rename from src/xmlstreamwriter_p.h rename to src/xlsx/xmlstreamwriter_p.h diff --git a/src/zipwriter.cpp b/src/xlsx/zipwriter.cpp similarity index 100% rename from src/zipwriter.cpp rename to src/xlsx/zipwriter.cpp diff --git a/src/zipwriter_p.h b/src/xlsx/zipwriter_p.h similarity index 100% rename from src/zipwriter_p.h rename to src/xlsx/zipwriter_p.h diff --git a/sync.profile b/sync.profile new file mode 100644 index 0000000..349ef35 --- /dev/null +++ b/sync.profile @@ -0,0 +1,7 @@ +%modules = ( + "QtXlsx" => "$basedir/src/xlsx", +); + +%dependencies = ( + "qtbase" => "", +);