Qt4/Qt5 neutral changes:

+ move meta types to own header to avoid double declaration
This commit is contained in:
wmayer 2016-12-12 15:22:34 +01:00
parent d2cb4e4af9
commit 07943d2a9a
7 changed files with 46 additions and 6 deletions

View File

@ -1046,6 +1046,7 @@ SET(FreeCADGui_SRCS
InventorAll.h
Macro.h
MergeDocuments.h
MetaTypes.h
PreCompiled.cpp
PreCompiled.h
Qt4All.h

View File

@ -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"

38
src/Gui/MetaTypes.h Normal file
View File

@ -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

View File

@ -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

View File

@ -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; }

View File

@ -76,8 +76,6 @@
using namespace PartGui;
Q_DECLARE_METATYPE(Base::Quantity)
FilletRadiusDelegate::FilletRadiusDelegate(QObject *parent) : QItemDelegate(parent)
{
}

View File

@ -28,7 +28,7 @@
#include <Base/Tools.h>
#include <Gui/propertyeditor/PropertyItem.h>
#include <Gui/MetaTypes.h>
#include "../App/PropertyConstraintList.h"
#include "PropertyConstraintListItem.h"
@ -36,7 +36,7 @@
using namespace SketcherGui;
using namespace Gui::PropertyEditor;
TYPESYSTEM_SOURCE(SketcherGui::PropertyConstraintListItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(SketcherGui::PropertyConstraintListItem, Gui::PropertyEditor::PropertyItem)
PropertyConstraintListItem::PropertyConstraintListItem()
{