Skip to content

Commit

Permalink
fix customwidgets build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 19, 2014
1 parent d522059 commit 7127e58
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -509,6 +509,7 @@ ADD_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")

#############################################################
# user-changeable settings which can be used to customize
Expand All @@ -535,7 +536,6 @@ SET (QGIS_LIBEXEC_DIR ${QGIS_LIBEXEC_SUBDIR})
SET (QGIS_DATA_DIR ${QGIS_DATA_SUBDIR})
SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})
SET (QGIS_CUSTOMWIDGETS_DIR ${QT_PLUGINS_DIR}/designer)

# set the default locations where the targets (executables, libraries) will land when compiled
# this is to allow running qgis from the source tree without having to actually do a "make install"
Expand Down
1 change: 1 addition & 0 deletions ms-windows/osgeo4w/package-nightly.cmd
Expand Up @@ -230,6 +230,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS
bin/%PACKAGENAME%-browser.bat.tmpl ^
apps/qt4/plugins/sqldrivers/qsqlocispatial.dll ^
apps/qt4/plugins/sqldrivers/qsqlspatialite.dll ^
apps/qt4/plugins/designer/qgis_customwidgets.dll ^
etc/postinstall/%PACKAGENAME%.bat ^
etc/preremove/%PACKAGENAME%.bat
if errorlevel 1 (echo tar failed & goto error)
Expand Down
28 changes: 13 additions & 15 deletions src/app/CMakeLists.txt
Expand Up @@ -406,9 +406,19 @@ ENDIF (WIN32)

IF(PEDANTIC)
# disable deprecation warnings
IF(NOT MSVC)
SET_SOURCE_FILES_PROPERTIES(qgisappinterface.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated)
ENDIF(NOT MSVC)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(
qgisappinterface.cpp
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "/wd4996"
)
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(
qgisappinterface.cpp
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations"
)
ENDIF(MSVC)
ENDIF(PEDANTIC)

INCLUDE_DIRECTORIES(
Expand Down Expand Up @@ -498,18 +508,6 @@ if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET_TARGET_PROPERTIES(qgis_app PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
ENDIF(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)

# disable deprecation warnings for classes re-exporting deprecated methods
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-wd4996")
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated-declarations")
ENDIF(MSVC)


TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
${QWT_LIBRARY}
${QT_QTSQL_LIBRARY}
Expand Down
6 changes: 4 additions & 2 deletions src/core/CMakeLists.txt
Expand Up @@ -392,9 +392,11 @@ ENDIF (QT_MOBILITY_LOCATION_FOUND)

QT4_WRAP_CPP(QGIS_CORE_MOC_SRCS ${QGIS_CORE_MOC_HDRS})

IF(UNIX)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "/wd4996" )
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)
ENDIF(MSVC)

# install headers
# install qgsconfig.h and plugin.h here so they can get into
Expand Down
7 changes: 2 additions & 5 deletions src/core/composer/qgscomposerattributetablemodel.cpp
Expand Up @@ -210,7 +210,7 @@ bool QgsComposerAttributeTableColumnModel::setData( const QModelIndex& index, co
emit dataChanged( index, index );
return true;
default:
return false;
break;
}

return false;
Expand Down Expand Up @@ -584,14 +584,11 @@ bool QgsComposerTableSortColumnsProxyModel::setData( const QModelIndex& index, c
return false;
}

switch ( index.column() )
if ( index.column() == 1 )
{
case 1:
column->setSortOrder(( Qt::SortOrder )value.toInt() );
emit dataChanged( index, index );
return true;
default:
return false;
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposertable.cpp
Expand Up @@ -99,7 +99,7 @@ void QgsComposerTable::paint( QPainter* painter, const QStyleOptionGraphicsItem*
cell = QRectF( currentX, currentY, mMaxColumnWidthMap[col], cellHeaderHeight );

//calculate alignment of header
Qt::AlignmentFlag headerAlign;
Qt::AlignmentFlag headerAlign = Qt::AlignLeft;
switch ( mHeaderHAlignment )
{
case FollowColumn:
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgspallabeling.h
Expand Up @@ -737,7 +737,9 @@ class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface

//! called when we're going to start with rendering
//! @deprecated since 2.4 - use override with QgsMapSettings
Q_NOWARN_DEPRECATED_PUSH
Q_DECL_DEPRECATED virtual void init( QgsMapRenderer* mr );
Q_NOWARN_DEPRECATED_POP
//! called when we're going to start with rendering
virtual void init( const QgsMapSettings& mapSettings );
//! called to find out whether the layer is used for labeling
Expand Down Expand Up @@ -765,12 +767,15 @@ class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface
virtual void drawLabeling( QgsRenderContext& context );
//! called when we're done with rendering
virtual void exit();

Q_NOWARN_DEPRECATED_PUSH
//! return infos about labels at a given (map) position
//! @deprecated since 2.4 - use takeResults() and methods of QgsLabelingResults
Q_DECL_DEPRECATED virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p );
//! return infos about labels within a given (map) rectangle
//! @deprecated since 2.4 - use takeResults() and methods of QgsLabelingResults
Q_DECL_DEPRECATED virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r );
Q_NOWARN_DEPRECATED_POP

//! Return pointer to recently computed results (in drawLabeling()) and pass the ownership of results to the caller
//! @note added in 2.4
Expand Down
19 changes: 14 additions & 5 deletions src/customwidgets/CMakeLists.txt
Expand Up @@ -2,6 +2,13 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

IF (WIN32)
IF (MSVC)
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLEXPORT}")
ELSE (MSVC)
ADD_DEFINITIONS("-UCUSTOMWIDGETS_EXPORT \"-DCUSTOMWIDGETS_EXPORT=${DLLEXPORT}\"")
ENDIF (MSVC)
ENDIF (WIN32)

########################################################
# Files
Expand Down Expand Up @@ -30,9 +37,11 @@ SET (QGIS_CUSTOMWIDGETS_MOC_HDRS

QT4_WRAP_CPP(QGIS_CUSTOMWIDGETS_MOC_SRCS ${QGIS_CUSTOMWIDGETS_MOC_HDRS})

IF(UNIX)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CUSTOMWIDGETS_MOC_SRCS} PROPERTIES COMPILE_FLAGS "/wd4996" )
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CUSTOMWIDGETS_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)
ENDIF(MSVC)

SET(QGIS_CUSTOMWIDGETS_HDRS
qgiscustomwidgets.h
Expand Down Expand Up @@ -78,6 +87,6 @@ TARGET_LINK_LIBRARIES(qgis_customwidgets qgis_gui)

# install
INSTALL(TARGETS qgis_customwidgets
LIBRARY DESTINATION ${QGIS_CUSTOMWIDGETS_DIR})


RUNTIME DESTINATION ${QT_PLUGINS_DIR}/designer
LIBRARY DESTINATION ${QT_PLUGINS_DIR}/designer
)
2 changes: 1 addition & 1 deletion src/customwidgets/qgscollapsiblegroupboxplugin.h
Expand Up @@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgscolorbuttonplugin.h
Expand Up @@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsColorButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsColorButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgsdatadefinedbuttonplugin.h
Expand Up @@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsDataDefinedButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsDataDefinedButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgsfieldcomboboxplugin.h
Expand Up @@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgsfieldexpressionwidgetplugin.h
Expand Up @@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgsmaplayercomboboxplugin.h
Expand Up @@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgsscalerangewidgetplugin.h
Expand Up @@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsScaleRangeWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsScaleRangeWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
6 changes: 4 additions & 2 deletions src/gui/CMakeLists.txt
Expand Up @@ -287,9 +287,11 @@ qgsunitselectionwidget.h

QT4_WRAP_CPP(QGIS_GUI_MOC_SRCS ${QGIS_GUI_MOC_HDRS})

IF(UNIX)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_GUI_MOC_SRCS} PROPERTIES COMPILE_FLAGS "/wd4996" )
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_GUI_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)
ENDIF(MSVC)

# for installing headers

Expand Down

0 comments on commit 7127e58

Please sign in to comment.