Skip to content

Commit

Permalink
Qt4/Qt5 neutral changes:
Browse files Browse the repository at this point in the history
+ move meta types to own header to avoid double declaration
  • Loading branch information
wwmayer committed Dec 12, 2016
1 parent d2cb4e4 commit 07943d2
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Gui/CMakeLists.txt
Expand Up @@ -1046,6 +1046,7 @@ SET(FreeCADGui_SRCS
InventorAll.h
Macro.h
MergeDocuments.h
MetaTypes.h
PreCompiled.cpp
PreCompiled.h
Qt4All.h
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/InputField.h
Expand Up @@ -28,7 +28,7 @@
#include <App/Property.h>
#include <App/Expression.h>
#include <Base/Parameter.h>
#include <Base/Quantity.h>
#include <Gui/MetaTypes.h>
#include "Widgets.h"
#include "Window.h"
#include "SpinBox.h"
Expand Down
38 changes: 38 additions & 0 deletions src/Gui/MetaTypes.h
@@ -0,0 +1,38 @@
/***************************************************************************
* Copyright (c) 2016 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/

#ifndef GUI_METATYPES_H
#define GUI_METATYPES_H

#include <Base/Vector3D.h>
#include <Base/Matrix.h>
#include <Base/Placement.h>
#include <Base/Quantity.h>

Q_DECLARE_METATYPE(Base::Vector3f)
Q_DECLARE_METATYPE(Base::Vector3d)
Q_DECLARE_METATYPE(Base::Matrix4D)
Q_DECLARE_METATYPE(Base::Placement)
Q_DECLARE_METATYPE(Base::Quantity)
Q_DECLARE_METATYPE(QList<Base::Quantity>)

#endif // GUI_METATYPES_H
2 changes: 1 addition & 1 deletion src/Gui/QuantitySpinBox.h
Expand Up @@ -25,7 +25,7 @@
#define GUI_QUANTITYSPINBOX_H

#include <QAbstractSpinBox>
#include <Base/Quantity.h>
#include <Gui/MetaTypes.h>
#include "ExpressionBinding.h"

#ifdef Q_MOC_RUN
Expand Down
3 changes: 3 additions & 0 deletions src/Gui/propertyeditor/PropertyItem.h
Expand Up @@ -38,13 +38,16 @@
#include <App/PropertyStandard.h>
#include <Gui/Widgets.h>
#include <Gui/ExpressionBinding.h>
#include <Gui/MetaTypes.h>

#ifdef Q_MOC_RUN
Q_DECLARE_METATYPE(Base::Vector3f)
Q_DECLARE_METATYPE(Base::Vector3d)
Q_DECLARE_METATYPE(Base::Matrix4D)
Q_DECLARE_METATYPE(Base::Placement)
Q_DECLARE_METATYPE(Base::Quantity)
Q_DECLARE_METATYPE(QList<Base::Quantity>)
#endif

namespace Gui {
namespace Dialog { class TaskPlacement; }
Expand Down
2 changes: 0 additions & 2 deletions src/Mod/Part/Gui/DlgFilletEdges.cpp
Expand Up @@ -76,8 +76,6 @@

using namespace PartGui;

Q_DECLARE_METATYPE(Base::Quantity)

FilletRadiusDelegate::FilletRadiusDelegate(QObject *parent) : QItemDelegate(parent)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp
Expand Up @@ -28,15 +28,15 @@

#include <Base/Tools.h>

#include <Gui/propertyeditor/PropertyItem.h>
#include <Gui/MetaTypes.h>
#include "../App/PropertyConstraintList.h"
#include "PropertyConstraintListItem.h"


using namespace SketcherGui;
using namespace Gui::PropertyEditor;

TYPESYSTEM_SOURCE(SketcherGui::PropertyConstraintListItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(SketcherGui::PropertyConstraintListItem, Gui::PropertyEditor::PropertyItem)

PropertyConstraintListItem::PropertyConstraintListItem()
{
Expand Down

0 comments on commit 07943d2

Please sign in to comment.