diff --git a/examples/osguserdata/osguserdata.cpp b/examples/osguserdata/osguserdata.cpp index 52e25c927..dabc51431 100644 --- a/examples/osguserdata/osguserdata.cpp +++ b/examples/osguserdata/osguserdata.cpp @@ -192,7 +192,7 @@ int main(int argc, char** argv) std::string testString("All seems fine"); node->setUserValue("Status",testString); - node->setUserValue("Height",1.4); + node->setUserValue("Height",float(1.4)); osg::ref_ptr drawable = new osg::Geometry; drawable->setName("myDrawable"); @@ -201,7 +201,7 @@ int main(int argc, char** argv) node->setUserValue("fred",12); node->setUserValue("john",1.1); node->setUserValue("david",1.9f); - node->setUserValue("char",65); + node->setUserValue("char",char(65)); node->setUserValue("matrixd",osg::Matrixd::translate(1.0,2.0,3.0)); node->setUserValue("flag-on",true); node->setUserValue("flag-off",false); diff --git a/include/osg/Object b/include/osg/Object index 2411a7389..4f7ae19e1 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -41,74 +41,6 @@ class State; virtual const char* libraryName() const { return #library; }\ virtual const char* className() const { return #name; } -template -T* clone(const T* t, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) -{ - if (t) - { - osg::ref_ptr obj = t->clone(copyop); - - T* ptr = dynamic_cast(obj.get()); - if (ptr) - { - obj.release(); - return ptr; - } - else - { - OSG_WARN<<"Warning: osg::clone(const T*, osg::CopyOp&) cloned object not of type T, returning NULL."< -T* clone(const T* t, const std::string& name, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) -{ - T* newObject = osg::clone(t, copyop); - if (newObject) - { - newObject->setName(name); - return newObject; - } - else - { - OSG_WARN<<"Warning: osg::clone(const T*, const std::string&, const osg::CopyOp) passed null object to clone, returning NULL."< -T* cloneType(const T* t) -{ - if (t) - { - osg::ref_ptr obj = t->cloneType(); - - T* ptr = dynamic_cast(obj.get()); - if (ptr) - { - obj.release(); - return ptr; - } - else - { - OSG_WARN<<"Warning: osg::cloneType(const T*) cloned object not of type T, returning NULL."< +T* clone(const T* t, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) +{ + if (t) + { + osg::ref_ptr obj = t->clone(copyop); + + T* ptr = dynamic_cast(obj.get()); + if (ptr) + { + obj.release(); + return ptr; + } + else + { + OSG_WARN<<"Warning: osg::clone(const T*, osg::CopyOp&) cloned object not of type T, returning NULL."< +T* clone(const T* t, const std::string& name, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) +{ + T* newObject = osg::clone(t, copyop); + if (newObject) + { + newObject->setName(name); + return newObject; + } + else + { + OSG_WARN<<"Warning: osg::clone(const T*, const std::string&, const osg::CopyOp) passed null object to clone, returning NULL."< +T* cloneType(const T* t) +{ + if (t) + { + osg::ref_ptr obj = t->cloneType(); + + T* ptr = dynamic_cast(obj.get()); + if (ptr) + { + obj.release(); + return ptr; + } + else + { + OSG_WARN<<"Warning: osg::cloneType(const T*) cloned object not of type T, returning NULL."< searchPath.size()) + if(iter->first.size() > searchPath.size()) { - size_t endSubElement = ze.first.find(searchPath); + size_t endSubElement = iter->first.find(searchPath); //we match the whole string in the beginning of the path if(endSubElement == 0) { - std::string remainingFile = ze.first.substr(searchPath.size() + 1, std::string::npos); + std::string remainingFile = iter->first.substr(searchPath.size() + 1, std::string::npos); size_t endFileToken = remainingFile.find_first_of('/'); if(endFileToken == std::string::npos) diff --git a/src/osgQt/GraphicsWindowQt.cpp b/src/osgQt/GraphicsWindowQt.cpp index 1d89d4e4b..01417baf1 100644 --- a/src/osgQt/GraphicsWindowQt.cpp +++ b/src/osgQt/GraphicsWindowQt.cpp @@ -342,7 +342,11 @@ bool GraphicsWindowQt::init( QWidget* parent, const QGLWidget* shareWidget, Qt:: // WindowFlags Qt::WindowFlags flags = f | Qt::Window | Qt::CustomizeWindowHint; if ( _traits->windowDecoration ) - flags |= Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; + flags |= Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint +#if (QT_VERSION_CHECK(4, 5, 0) <= QT_VERSION) + | Qt::WindowCloseButtonHint +#endif + ; // create widget _widget = new GLWidget( traits2qglFormat( _traits.get() ), parent, shareWidget, flags );