Skip to content

Commit

Permalink
Refactor: Follow Qt5 module's file directories style
Browse files Browse the repository at this point in the history
Xlsx Shared library can be used now
  • Loading branch information
dbzhang800 committed Aug 29, 2013
1 parent a563809 commit 929db3d
Show file tree
Hide file tree
Showing 47 changed files with 95 additions and 47 deletions.
3 changes: 3 additions & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load(qt_build_config)

MODULE_VERSION = 0.0.1
5 changes: 1 addition & 4 deletions examples/examples.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
TEMPLATE = subdirs
SUBDIRS = hello

SUBDIRS += \
style
SUBDIRS = xlsx

5 changes: 0 additions & 5 deletions examples/hello/hello.pro

This file was deleted.

5 changes: 0 additions & 5 deletions examples/style/style.pro

This file was deleted.

6 changes: 6 additions & 0 deletions examples/xlsx/hello/hello.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TARGET = hello

#include(../../../src/xlsx/qtxlsx.pri)
QT+=xlsx

SOURCES += main.cpp
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions examples/xlsx/style/style.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TARGET = style

#include(../../../src/xlsx/qtxlsx.pri)
QT += xlsx

SOURCES += main.cpp
3 changes: 3 additions & 0 deletions examples/xlsx/xlsx.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TEMPLATE = subdirs
SUBDIRS = hello style

1 change: 1 addition & 0 deletions qtxlsx.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
load(qt_parts)
Empty file removed qtxlsxwriter.pro
Empty file.
6 changes: 0 additions & 6 deletions src/qxlsxwriter.cpp

This file was deleted.

23 changes: 0 additions & 23 deletions src/qxlsxwriter.h

This file was deleted.

3 changes: 3 additions & 0 deletions src/src.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TEMPLATE = subdirs

SUBDIRS = xlsx
4 changes: 3 additions & 1 deletion src/qtxlsxwriter.pri → src/xlsx/qtxlsx.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
13 changes: 13 additions & 0 deletions src/xlsx/xlsx.pro
Original file line number Diff line number Diff line change
@@ -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 <hello@debao.me>"
QMAKE_TARGET_DESCRIPTION = ".Xlsx file wirter for Qt5"

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/xlsxformat.h → src/xlsx/xlsxformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#ifndef QXLSX_FORMAT_H
#define QXLSX_FORMAT_H

#include "xlsxglobal.h"
#include <QFont>
#include <QColor>
#include <QByteArray>
Expand All @@ -37,7 +38,7 @@ class Worksheet;
class WorksheetPrivate;

class FormatPrivate;
class Format
class Q_XLSX_EXPORT Format
{
Q_DECLARE_PRIVATE(Format)
public:
Expand Down
File renamed without changes.
43 changes: 43 additions & 0 deletions src/xlsx/xlsxglobal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/****************************************************************************
** Copyright (c) 2013 Debao Zhang <hello@debao.me>
** 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 <QtGlobal>

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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/xlsxworkbook.h → src/xlsx/xlsxworkbook.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#ifndef XLSXWORKBOOK_H
#define XLSXWORKBOOK_H

#include "xlsxglobal.h"
#include <QObject>
#include <QList>
class QIODevice;
Expand All @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/xlsxworksheet.h → src/xlsx/xlsxworksheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#ifndef XLSXWORKSHEET_H
#define XLSXWORKSHEET_H

#include "xlsxglobal.h"
#include <QObject>
#include <QStringList>
#include <QMap>
Expand All @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions sync.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
%modules = (
"QtXlsx" => "$basedir/src/xlsx",
);

%dependencies = (
"qtbase" => "",
);

0 comments on commit 929db3d

Please sign in to comment.