Qt 4.8.7 Optimized code coredump at ApplicationPrivate::notify_helper
-
Hi:
My application's main window inherites QMainwow. As soon as I call setWindowTile(), qt crashes at QApplicationPrivate::notify_helper() However, debug code does not crash.
The following is the stack trace.
Any suggestion will be appreciated.-Todd
Program received signal SIGSEGV, Segmentation fault.
0x00002aaaaac76fec in QApplicationPrivate::notify_helper (this=0x6b37c0, receiver=0x6ea5e0, e=0x7fffffffd520)
at kernel/qapplication.cpp:4065
4065 bool consumed = receiver->event(e);
(gdb) where
#0 0x00002aaaaac76fec in QApplicationPrivate::notify_helper (this=0x6b37c0, receiver=0x6ea5e0,
e=0x7fffffffd520) at kernel/qapplication.cpp:4065
#1 0x00002aaaaac7bc3e in QApplication::notify (this=0x7fffffffd6c0, receiver=0x6ea5e0, e=0x7fffffffd520)
at kernel/qapplication.cpp:3961
#2 0x00002aaaab7eb3f4 in QCoreApplication::notifyInternal (this=0x7fffffffd6c0, receiver=0x6ea5e0,
event=0x7fffffffd520) at kernel/qcoreapplication.cpp:610
#3 0x00002aaaaacc6d67 in sendEvent (this=0x6ea5e0, title=...)
at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:213
#4 QWidget::setWindowTitle (this=0x6ea5e0, title=...) at kernel/qwidget.cpp:5409
#5 0x00000000004154dd in guMainWindow::guMainWindow (this=0x6ea5e0) at guMainWindow.cpp:25
#6 0x0000000000414e95 in getGuMainWindow (this=<value optimized out>) at libguMainWindow.h:43
#7 guMain::run (this=<value optimized out>) at guMain.cpp:14
#8 0x0000000000414d94 in main (argc=<value optimized out>, argv=0x7fffffffd520) at ./src/main.cpp:9 -
There is no such version of Qt (4.8.7).
When are you calling setWindowsTitle()? Please provide a bit more code.
-
It's 4.8.4
more code. Thanks.
-Todd@#include <string>
#include <vector>#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QToolBar>
#include <QAction>
#include "guCanvasEditor.h"
#include "libdwFile.h"
#include "guDWdisplay.h"
#include "guDesignDisplay.h"
#include "libioDspf.h"// forms
#include "guFormFiles.h"#define STRING_SIZE 1024
using namespace std;//---------------------------------------------------
class guMainWindow : public QMainWindow
{Q_OBJECT
//--- Qt stuffs
public slots:
void dwDisplay();
void designDisplay();
void displayIRdrop();
void showViewFileForm();
void viewFiles(vector<string> *);
void exitOCXviewer();//---
public:
static guMainWindow *getGuMainWindow() { // Singleton
if (_guMainWindow == NULL) { // is it the first call?
_guMainWindow = new guMainWindow; // create sole instance
}
return _guMainWindow; // address of sole instance
}
~guMainWindow();//
bool viewPopupMenu();
void configureStyleSheets();
void computeDesignBBox();
bool readXtShapes(const char *fileName);protected:
guMainWindow(); // declare constructor here so no one can instantiate it.
void resizeEvent (QResizeEvent *);//
private:
static guMainWindow *_guMainWindow;//
QMenu *_view;
QMenu *_exit;
guFormFiles _formViewFiles;QToolBar *_toolbar;
//
//QMenu *_ruler;
//
guCanvasEditor *_canvasEditor;
guDesignDisplay *_designDisplay;
// dw
guDWdisplay *_dwDisplay;
dwFile *_dw;QSize _oldSize;
//
geBox _bbox; // design bounding box};
#include "libguMainWindow.h"
#include "libdbBinPart.h"
#include <tcl.h>
#include <QResizeEvent>
#include <QFileDialog>
#include <QPixmap>
#include <QTreeWidget>
#include "libioViewFiles.h"
#include <boost/algorithm/string/predicate.hpp>
#include "libioXtQshape.h"
#include "libutTokens.h"
#include "libioStNetworkStitch.h"// sigleton, a global variable.
guMainWindow *guMainWindow::_guMainWindow = NULL;
//-----------------------------------------------------------------------------
guMainWindow::guMainWindow() : // QMainWindow(NULL),
_designDisplay( NULL),
_dwDisplay(NULL),
_dw(NULL)
{
// NOTE :
// The two main objects in main window are _canvasEditor and _designDisplay
//
setWindowTitle("OCX viewer 13.1");
setGeometry(30,20, 900,700);@
-
You have commented out the initialisation of the base class, so it crashes when you try running a method from that base class. Also, you are creating a singleton, but your destructor is public. It's not an error, just a unusual way of doing it.