diff --git a/src/App/CMakeLists.txt b/src/App/CMakeLists.txt index 00b7b41b1c..7c6906793b 100644 --- a/src/App/CMakeLists.txt +++ b/src/App/CMakeLists.txt @@ -49,12 +49,11 @@ include_directories( set(FreeCADApp_LIBS FreeCADBase ${Boost_LIBRARIES} - ${QT_QTCORE_LIBRARY} - ${QT_QTXML_LIBRARY} ) if (BUILD_QT5) include_directories( + ${Qt5Core_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ) list(APPEND FreeCADApp_LIBS @@ -64,9 +63,11 @@ if (BUILD_QT5) else() include_directories( ${QT_QTCORE_INCLUDE_DIR} + ${QT_QTXML_INCLUDE_DIR} ) list(APPEND FreeCADApp_LIBS - ${QT_QTCORE_LIBRARY} + ${QT_QTCORE_LIBRARY} + ${QT_QTXML_LIBRARY} ) endif() diff --git a/src/App/FeaturePython.cpp b/src/App/FeaturePython.cpp index bafd32767d..f521622ed0 100644 --- a/src/App/FeaturePython.cpp +++ b/src/App/FeaturePython.cpp @@ -222,4 +222,5 @@ template<> const char* App::GeometryPython::getViewProviderName(void) const { return "Gui::ViewProviderPythonGeometry"; } // explicit template instantiation -template class AppExport FeaturePythonT;} +template class AppExport FeaturePythonT; +} diff --git a/src/App/Property.cpp b/src/App/Property.cpp index aadacf2841..d495a4224a 100644 --- a/src/App/Property.cpp +++ b/src/App/Property.cpp @@ -161,7 +161,7 @@ std::string Property::encodeAttribute(const std::string& str) for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) { if (*it == '<') tmp += "<"; - else if (*it == '"') + else if (*it == '\"') tmp += """; else if (*it == '\'') tmp += "'"; @@ -170,9 +170,11 @@ std::string Property::encodeAttribute(const std::string& str) else if (*it == '>') tmp += ">"; else if (*it == '\r') - tmp += " "; + tmp += " "; else if (*it == '\n') - tmp += " "; + tmp += " "; + else if (*it == '\t') + tmp += " "; else tmp += *it; } diff --git a/src/App/PropertyContainer.cpp b/src/App/PropertyContainer.cpp index 8251d69d35..5186b32fcd 100644 --- a/src/App/PropertyContainer.cpp +++ b/src/App/PropertyContainer.cpp @@ -51,7 +51,7 @@ TYPESYSTEM_SOURCE(App::PropertyContainer,Base::Persistence); // here the implemataion! description should take place in the header file! PropertyContainer::PropertyContainer() { - propertyData.parentPropertyData = 0; + propertyData.parentPropertyData = 0; } PropertyContainer::~PropertyContainer() diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index 6ba5c02b4a..847c696471 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -42,7 +42,6 @@ include_directories( ${COIN3D_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${XercesC_INCLUDE_DIRS} - ${QT_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${3DCONNEXION_INCLUDE_DIR} ) @@ -785,6 +784,7 @@ set(qsint_MOC_HDRS QSint/actionpanel/actionpanel.h QSint/actionpanel/taskheader_p.h ) + if(BUILD_QT5) qt5_wrap_cpp(qsint_MOC_SRCS ${qsint_MOC_HDRS}) else() diff --git a/src/Gui/GLPainter.cpp b/src/Gui/GLPainter.cpp index b80a36d7b5..f788cf145f 100644 --- a/src/Gui/GLPainter.cpp +++ b/src/Gui/GLPainter.cpp @@ -81,6 +81,7 @@ bool GLPainter::begin(QPaintDevice * device) glLineWidth(1.0f); glColor4f(1.0, 1.0, 1.0, 0.0); glViewport(0, 0, this->width, this->height); + #if !defined(HAVE_QT5_OPENGL) glDrawBuffer(GL_FRONT); #endif diff --git a/src/Gui/InventorAll.h b/src/Gui/InventorAll.h index f9455726ba..0e45d3db63 100644 --- a/src/Gui/InventorAll.h +++ b/src/Gui/InventorAll.h @@ -58,19 +58,19 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -118,7 +118,7 @@ #include #include #include -#include +#include #include #include #include @@ -153,6 +153,4 @@ #include #include - - -#endif +#endif diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index 2d3bc7afea..a64c6e8b89 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -28,7 +28,6 @@ # include # include # include -# include # include # include # include diff --git a/src/Gui/ManualAlignment.h b/src/Gui/ManualAlignment.h index f1edb5f255..ebfdc58713 100644 --- a/src/Gui/ManualAlignment.h +++ b/src/Gui/ManualAlignment.h @@ -217,7 +217,7 @@ public: void slotDeletedObject(const Gui::ViewProvider& Obj); protected: - bool computeAlignment(const std::vector& unnavPts, const std::vector& fixPts); + bool computeAlignment(const std::vector& movPts, const std::vector& fixPts); void continueAlignment(); void showInstructions(); /** @name Probe picking */ diff --git a/src/Gui/MouseSelection.h b/src/Gui/MouseSelection.h index 2ad4830b0d..1fb3aa59a6 100644 --- a/src/Gui/MouseSelection.h +++ b/src/Gui/MouseSelection.h @@ -143,6 +143,7 @@ protected: virtual void draw(); virtual int popupMenu(); +protected: Gui::Polyline polyline; bool lastConfirmed; }; diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index 9bfb1d8ef9..c65da1c2df 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -64,11 +64,11 @@ struct NavigationStyleP { { this->animationsteps = 0; this->animationdelta = 0; + this->animsensor = 0; this->sensitivity = 2.0f; this->resetcursorpos = false; this->dragPointFound = false; this->dragAtCursor = false; - this->animsensor = 0; } static void viewAnimationCB(void * data, SoSensor * sensor); }; diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index 9090d8c529..c3f79ecf18 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -416,6 +416,7 @@ PythonConsole::PythonConsole(QWidget *parent) : TextEdit(parent), WindowParameter( "Editor" ), _sourceDrain(NULL) { d = new PythonConsoleP(); + d->interactive = false; // create an instance of InteractiveInterpreter try { diff --git a/src/Gui/SoFCSelection.cpp b/src/Gui/SoFCSelection.cpp index eefc7804aa..2eec373bbd 100644 --- a/src/Gui/SoFCSelection.cpp +++ b/src/Gui/SoFCSelection.cpp @@ -803,7 +803,7 @@ SoFCSelection::redrawHighlighted(SoAction * action , SbBool doHighlight ) //void* window; //void* context; //void *display; - QGLWidget* window; + QtGLWidget* window; SoGLRenderAction *glAction; //SoWindowElement::get(state, window, context, display, glAction); SoGLWidgetElement::get(state, window); diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index d756f152db..7698e89ced 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -666,7 +666,6 @@ void View3DInventorViewer::removeViewProvider(ViewProvider* pcProvider) _ViewProviderSet.erase(pcProvider); } - SbBool View3DInventorViewer::setEditingViewProvider(Gui::ViewProvider* p, int ModNum) { if (this->editViewProvider) @@ -1746,7 +1745,6 @@ bool View3DInventorViewer::processSoEvent(const SoEvent* ev) case SoKeyboardEvent::ESCAPE: case SoKeyboardEvent::Q: // ignore 'Q' keys (to prevent app from being closed) return inherited::processSoEvent(ev); - default: break; } @@ -2631,51 +2629,7 @@ void View3DInventorViewer::drawArrow(void) } // ************************************************************************ -#if 0 -#define HAND_WITH 24 -#define HAND_HEIGHT 24 -#define HAND_HOT_X 9 -#define HAND_HOT_Y 0 -static unsigned char hand_bitmap[] = { - 0x00,0x03,0x00,0x80,0x04,0x00,0x80,0x04,0x00,0x80,0x04,0x00,0x80,0x04,0x00, - 0x80,0x1c,0x00,0x80,0xe4,0x00,0x80,0x24,0x01,0x80,0x24,0x07,0x8e,0x24,0x09, - 0x92,0x24,0x09,0xa4,0x00,0x09,0xc4,0x00,0x08,0x08,0x00,0x08,0x08,0x00,0x08, - 0x10,0x00,0x08,0x10,0x00,0x04,0x20,0x00,0x04,0x20,0x00,0x04,0x40,0x00,0x02, - 0x80,0x00,0x02,0x00,0x01,0x01,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0xab,0xab, - 0xab,0xab,0xab,0xab,0xab,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, - 0x00,0x1b,0x00,0xee,0x04,0xee -}; - -static unsigned char hand_mask_bitmap[] = { - 0x00,0x03,0x00,0x80,0x07,0x00,0x80,0x07,0x00,0x80,0x07,0x00,0x80,0x07,0x00, - 0x80,0x1f,0x00,0x80,0xff,0x00,0x80,0xff,0x01,0x80,0xff,0x07,0x8e,0xff,0x0f, - 0x9e,0xff,0x0f,0xbc,0xff,0x0f,0xfc,0xff,0x0f,0xf8,0xff,0x0f,0xf8,0xff,0x0f, - 0xf0,0xff,0x0f,0xf0,0xff,0x07,0xe0,0xff,0x07,0xe0,0xff,0x07,0xc0,0xff,0x03, - 0x80,0xff,0x03,0x00,0xff,0x01,0x00,0xff,0x01,0x00,0x00,0x00,0x00,0xab,0xab, - 0xab,0xab,0xab,0xab,0xab,0xab,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05, - 0x00,0x1b,0x00,0xd5,0x07,0x1c -}; - -#define CROSS_WIDTH 16 -#define CROSS_HEIGHT 16 -#define CROSS_HOT_X 7 -#define CROSS_HOT_Y 7 - -static unsigned char cross_bitmap[] = { - 0xc0, 0x03, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, - 0x40, 0x02, 0x40, 0x02, 0x7f, 0xfe, 0x01, 0x80, - 0x01, 0x80, 0x7f, 0xfe, 0x40, 0x02, 0x40, 0x02, - 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0xc0, 0x03 -}; - -static unsigned char cross_mask_bitmap[] = { - 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, - 0xc0, 0x03, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xc0, 0x03, 0xc0, 0x03, - 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03 -}; -#endif // Set cursor graphics according to mode. void View3DInventorViewer::setCursorRepresentation(int modearg) { @@ -2705,7 +2659,6 @@ void View3DInventorViewer::setCursorRepresentation(int modearg) this->getWidget()->setCursor(this->editCursor); else this->getWidget()->setCursor(QCursor(Qt::ArrowCursor)); - break; case NavigationStyle::DRAGGING: @@ -2896,6 +2849,7 @@ PyObject *View3DInventorViewer::getPyObject(void) Py_INCREF(_viewerPy); return _viewerPy; } + /** * Drops the event \a e and loads the files into the given document. */ diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 15761214ff..a43a5bd40f 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -1116,7 +1116,7 @@ Py::Object View3DInventorPy::getStereoType(const Py::Tuple& args) throw Py::Exception(); try { - int mode = (int)(_view->getViewer()->stereoMode()); + int mode = (int)(_view->getViewer()->stereoMode()); return Py::String(StereoTypeEnums[mode]); } catch (const Base::Exception& e) { @@ -2163,49 +2163,49 @@ Py::Object View3DInventorPy::addDraggerCallback(const Py::Tuple& args) Py::Object View3DInventorPy::removeDraggerCallback(const Py::Tuple& args) { - PyObject* dragger; - char* type; - PyObject* method; - if (!PyArg_ParseTuple(args.ptr(), "OsO", &dragger, &type, &method)) - throw Py::Exception(); + PyObject* dragger; + char* type; + PyObject* method; + if (!PyArg_ParseTuple(args.ptr(), "OsO", &dragger, &type, &method)) + throw Py::Exception(); - //Check if dragger is a SoDragger object and cast - void* ptr = 0; - try { - Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoDragger *", dragger, &ptr, 0); - } - catch (const Base::Exception&) { - throw Py::Exception("The first argument must be of type SoDragger"); - } + //Check if dragger is a SoDragger object and cast + void* ptr = 0; + try { + Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoDragger *", dragger, &ptr, 0); + } + catch (const Base::Exception&) { + throw Py::Exception("The first argument must be of type SoDragger"); + } - SoDragger* drag = reinterpret_cast(ptr); - try { - if (strcmp(type, "addFinishCallback") == 0) { - drag->removeFinishCallback(draggerCallback, method); - } - else if (strcmp(type, "addStartCallback") == 0) { - drag->removeStartCallback(draggerCallback, method); - } - else if (strcmp(type, "addMotionCallback") == 0) { - drag->removeMotionCallback(draggerCallback, method); - } - else if (strcmp(type, "addValueChangedCallback") == 0) { - drag->removeValueChangedCallback(draggerCallback, method); - } - else { - std::string s; - std::ostringstream s_out; - s_out << type << " is not a valid dragger callback type"; - throw Py::Exception(s_out.str()); - } + SoDragger* drag = reinterpret_cast(ptr); + try { + if (strcmp(type, "addFinishCallback") == 0) { + drag->removeFinishCallback(draggerCallback, method); + } + else if (strcmp(type, "addStartCallback") == 0) { + drag->removeStartCallback(draggerCallback, method); + } + else if (strcmp(type, "addMotionCallback") == 0) { + drag->removeMotionCallback(draggerCallback, method); + } + else if (strcmp(type, "addValueChangedCallback") == 0) { + drag->removeValueChangedCallback(draggerCallback, method); + } + else { + std::string s; + std::ostringstream s_out; + s_out << type << " is not a valid dragger callback type"; + throw Py::Exception(s_out.str()); + } - callbacks.remove(method); - Py_DECREF(method); - return Py::Callable(method, false); - } - catch (const Py::Exception&) { - throw; - } + callbacks.remove(method); + Py_DECREF(method); + return Py::Callable(method, false); + } + catch (const Py::Exception&) { + throw; + } } Py::Object View3DInventorPy::setActiveObject(const Py::Tuple& args) diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index 54059b962a..fdd4c5f7fa 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -281,7 +281,7 @@ void ViewProvider::addDisplayMaskMode(SoNode *node, const char* type) void ViewProvider::setDisplayMaskMode(const char* type) { - std::map::const_iterator it = _sDisplayMaskModes.find( type ); + std::map::const_iterator it = _sDisplayMaskModes.find(type); if (it != _sDisplayMaskModes.end()) _iActualMode = it->second; else @@ -339,7 +339,6 @@ vector ViewProvider::getDisplayModes(void) const { return modes; } - std::string ViewProvider::getActiveDisplayMode(void) const { return _sCurrentMode; @@ -381,7 +380,7 @@ bool ViewProvider::isVisible() const } void ViewProvider::setOverrideMode(const std::string &mode) -{ +{ if (mode == "As Is") { viewOverrideMode = -1; overrideMode = mode; diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index 0e282d90a9..56d8ecc6e9 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -470,7 +470,7 @@ void ViewProviderGeometryObject::setSelectable(bool selectable) SoSearchAction sa; sa.setInterest(SoSearchAction::ALL); - sa.setSearchingAll(TRUE); + sa.setSearchingAll(true); sa.setType(Gui::SoFCSelection::getClassTypeId()); sa.apply(pcRoot); diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 9beb7abf24..ab7bce2a5a 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -58,7 +58,7 @@ # undef _POSIX_C_SOURCE # undef _XOPEN_SOURCE # include -# include +# include # include # include # include @@ -75,7 +75,7 @@ PyTypeObject** SbkPySide_QtGuiTypes=NULL; # undef _POSIX_C_SOURCE # undef _XOPEN_SOURCE # include -# include +# include # include # include # include @@ -1254,8 +1254,8 @@ void PyResource::load(const char* name) /** * Makes a connection between the sender widget \a sender and its signal \a signal * of the created resource and Python callback function \a cb. - * If the sender widget does not exist or no resource has been loaded this method returns FALSE, - * otherwise it returns TRUE. + * If the sender widget does not exist or no resource has been loaded this method returns false, + * otherwise it returns true. */ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb) { diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 733c96831c..e19da7aeb9 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -439,7 +439,7 @@ QVariant PropertyItem::data(int column, int role) const } bool PropertyItem::setData (const QVariant& value) -{ +{ cleared = false; // This is the basic mechanism to set the value to @@ -447,12 +447,10 @@ bool PropertyItem::setData (const QVariant& value) // it delegates it to its parent which sets then the // property or delegates again to its parent... if (propertyItems.empty()) { - PropertyItem* parent = this->parent(); if (!parent || !parent->parent()) return false; parent->setProperty(qPrintable(objectName()),value); - return true; } else { @@ -461,7 +459,6 @@ bool PropertyItem::setData (const QVariant& value) } } - Qt::ItemFlags PropertyItem::flags(int column) const { Qt::ItemFlags basicFlags = Qt::ItemIsEnabled | Qt::ItemIsSelectable; @@ -2001,7 +1998,7 @@ void PropertyPlacementItem::setValue(const QVariant& value) } QWidget* PropertyPlacementItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const -{ +{ PlacementEditor *pe = new PlacementEditor(this->propertyName(), parent); QObject::connect(pe, SIGNAL(valueChanged(const QVariant &)), receiver, method); pe->setDisabled(isReadOnly()); diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index 3a7628d223..fef7d42e4d 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -192,9 +192,15 @@ int main( int argc, char ** argv ) catch (const Base::ProgramInformation& e) { QApplication app(argc,argv); QString appName = QString::fromLatin1(App::Application::Config()["ExeName"].c_str()); - QString msg = QString::fromLatin1(e.what()); + QString msg = QString::fromUtf8(e.what()); QString s = QLatin1String("
") + msg + QLatin1String("
"); - QMessageBox::information(0, appName, s); + + QMessageBox msgBox; + msgBox.setIcon(QMessageBox::Information); + msgBox.setWindowTitle(appName); + msgBox.setDetailedText(msg); + msgBox.setText(s); + msgBox.exec(); exit(0); } catch (const Base::Exception& e) {