View Full Version : Firefox crush when try to show dialog from Qt GUI library (Linux ubuntu)
barak
25th July 2010, 06:42
Hello,
I have Qt GUI library which shows dialogs such as login. We use it with Firefox which calls the Qt library that should show a dialog. But at this point Firefox is closed with segmantation error.
I can use my Qt GUI library from non-Qt application by providing the QApplication inside the library and it works. I have the GTK 2.0 installed.
Thanks for any help you provide.
Barak
tbscope
25th July 2010, 08:28
That's way too few information to give a good answer.
So, install and/or rebuild the respective packages (firefox, qt, etc...) with debug information.
Then run it all through gdb and get a backtrace. Using the backtrace you can already see where the problem might be. If not, use the information to step through the program and look at the registers and variables.
A segmentation fault happens when you try to access memory you're not supposed to access (like in an uninitialized pointer)
barak
25th July 2010, 08:34
Thanks. How do I add debug information to my Qt library? Could it be related to the gtk-qt?
barak
25th July 2010, 09:22
OK it is crashing when I create the QApplication object:
QApplication * a = new QApplication(NULL,NULL);
wysota
25th July 2010, 09:58
Passing it two nulls is probably what's causing the crash. You can't pass arbitrary values to objects and expect them to work.
barak
25th July 2010, 10:58
The full code is:
QApplication * a = 0;
if (!qApp){
int argc = 1;
char *argv[] = { "asePinDialog", NULL };
a = new QApplication(argc,argv);
//QApplication b(argc,argv);
}
m_iLastSlotId = aseData.slotID;
ChangePin *pinDlg = new ChangePin(aseData);
m_pOpenDialog = pinDlg;
pinDlg->exec();
//pinDlg->show();
bool bRet = (pinDlg->result() == QDialog::Accepted);
delete pinDlg;
m_pOpenDialog = NULL;
m_iLastSlotId = 0;
if(a){
a->exit();
delete a;
a = 0;
}
return bRet;
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.