Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 |
#include
#include "CompositeViewerQT.h"
#include
using namespace std;
int main( int argc, char **argv ){
cout << "1";
QApplication app(argc, argv);
cout << "2";
CompositeViewerQT viewer;
cout << "3";
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include "AdapterWidget.h"
#include
#include
#include
using namespace std;
class CompositeViewerQT: public osgViewer::CompositeViewer, public AdapterWidget{
public:
CompositeViewerQT(QWidget * parent = 0, const QGLWidget * shareWidget = 0, WindowFlags f = 0): AdapterWidget( parent, shareWidget, f ) {
cout << "a";
}
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 |
#include #include #include
using namespace std;
class AdapterWidget : public QGLWidget {
public:
AdapterWidget( QWidget * parent = 0, const QGLWidget * shareWidget = 0, WindowFlags f = 0 ):QGLWidget(parent, shareWidget, f) {
cout << "b";
}
}
|
|
|
Source code |
1 2 |
QWidget window; window.show(); |
This post has been edited 1 times, last edit by "Gix" (Apr 6th 2012, 8:41am)
|
|
Source code |
1 |
QApplication app(argc, argv); |
|
|
Source code |
1 2 |
#include <osgViewer/Viewer>#include <QtCore/QString>#include <QtCore/QTimer>#include <QtGui/QKeyEvent>#include <QtGui/QApplication>#include <QtOpenGL/QGLWidget>#include <osgViewer/CompositeViewer>#include <iostream> using Qt::WindowFlags; |
|
|
Source code |
1 |
#include <osgViewer/Viewer>#include <QtCore/QString>#include <QtCore/QTimer>#include <QtGui/QKeyEvent>#include <QtGui/QApplication>#include <QtOpenGL/QGLWidget>#include <osgViewer/CompositeViewer>#include "AdapterWidget.h"using Qt::WindowFlags; |
|
|
Source code |
1 2 |
#include <iostream>#include <osgUtil/Optimizer>#include <osgDB/ReadFile>#include <osgSim/OverlayNode>#include <osgSim/SphereSegment>#include <osgSim/ScalarsToColors>#include <osgSim/ColorRange>#include <osgSim/ScalarBar>#include <osg/Material>#include <osg/Geode>#include <osg/BlendFunc>#include <osg/Depth>#include <osg/Projection>#include <osg/PolygonOffset>#include <osg/MatrixTransform>#include <osg/Camera>#include <osg/FrontFace>#include <osg/Fog>#include <osg/PolygonMode>#include <osgText/Text>#include <osgGA/TrackballManipulator>#include <osgGA/FlightManipulator>#include <osgGA/StateSetManipulator>#include <osgGA/NodeTrackerManipulator>#include <osgViewer/ViewerEventHandlers>#include <osg/ShapeDrawable>#include <osgDB/FileUtils>#include <osgDB/fstream>#include <osgDB/ReadFile>#include <osgViewer/CompositeViewer>#include <osg/io_utils>#include <QtGui/QApplication>#include <QtGui/QGridLayout>#include <osgQt/GraphicsWindowQt>#include "QtGui/qtextlist.h"#include "CompositeViewerQT.h" using namespace std; |
This post has been edited 1 times, last edit by "Gix" (Apr 12th 2012, 1:05pm)
|
|
Source code |
1 |
if (!qApp) { qFatal("QWidget: Must construct a QApplication before a QPaintDevice"); return; }
|
|
|
Source code |
1 |
#define qApp (static_cast<QApplication *>(QCoreApplication::instance())) |
|
|
Source code |
1 |
{ return self; }
|
|
|
Source code |
1 |
QCoreApplication::self = this; |
|
|
Source code |
1 |
QCoreApplication::QCoreApplication(QCoreApplicationPrivate &p) : QObject(p, 0) |
|
|
Source code |
1 |
QCoreApplication::QCoreApplication(int &argc, char **argv) : QObject(*new QCoreApplicationPrivate(argc, argv)) |
|
|
Source code |
1 2 |
QApplication app; app.exec(); |
|
|
Source code |
1 2 3 |
QApplication app(argc, argv); CompositeViewerQT viewer; app.exec(); |
I'm afraid I'm on Windows (xp) right now., are there any similar coherence checks that can be done on Windows?if you are on linux
try
ldd your_executable
to verify coherence of found libraries
you can also remove the creation of th widget to allow app.exec(), launch your application and try
cat /proc/xxxx/ maps
where xxxx is the pid of your running application
As far as I'm aware the libraries are all built with the same version. The install had been done by someone else who I can't contact anymore, so I'm not 100% sure, but as far as I've heard and from what I can see, only one version of Qt has ever been installed (4.7.3). All Qt libraries are also found within the source folders of this Qt version. After many attempts with just the libraries which I expected to be needed, I currently have every single .lib found within Qt imported, just to be sure I wasn't missing anything.are you using libraries that have been built with a different version of Qt than what you are using?
Quoted
You say that this is fine
![]()
Source code
1 2 QApplication app; app.exec();
but this isnt
![]()
Source code
1 2 3 QApplication app(argc, argv); CompositeViewerQT viewer; app.exec();
Quoted
Therefore you need to step into CompositeViewer ctor (and its base classes ctors)
Quoted
It should also be easy to attach at the point of the assert simply by clicking 'retry' when the assert happens?
This post has been edited 1 times, last edit by "Gix" (Apr 13th 2012, 10:22am)