Gnome makes application crash
Hi,
I have made a qt application. It works fine in KDE. The problem I'm having is that in Gnome the application terminates each time the user uses an inputdialog or a colordialog.
Is there something I can do to prevent the application from terminating in Gnome.
As I said in KDE the application behaves correctly.
some examplecode where the program stops in Gnome:
Code:
void EditCSSDlg::changeTitleColor()
{
colpixmap.fill(changed);
this->pushButtonColor->setPixmap(colpixmap);
this->titlecolor = changed.name();
}
the application never gets to the instantiation of the QPixmap.
regix
Re: Gnome makes application crash
What Qt version do you use? Did you upgrade GNOME libraries recently?
Re: Gnome makes application crash
I'm using qt3 (don't know wich version -- version that came with openSuse 10.1)
I used smart upgrade to update all packages so I guess gnome was updated too.
Regix
Re: Gnome makes application crash
update
I found a file named libqt-mt.so.3.3.5 so I guess this is the version of qt.
Regix
Re: Gnome makes application crash
Quote:
Originally Posted by regix
I used smart upgrade to update all packages so I guess gnome was updated too
The crash might be caused by some incompatibility between libraries on your system. Make sure that all GNOME and Qt libraries were updated correctly.
Re: Gnome makes application crash
The same behaviour happened when somebody else tested my application on Ubuntu. He used a version of Ubuntu that is already more than a half year old.
Regix
Re: Gnome makes application crash
I just tried the application under GNOME on Suse 10 and the same strange behaviour happens there. It looks like GNOME is not happy with the Qt dialogs.
regix
Re: Gnome makes application crash
Does this crash?
Code:
#include <qcolordialog.h>
#include <qapplication.h>
int main( int argc, char **argv )
{
return 0;
}
(compile it in debug mode and run from gdb).
Re: Gnome makes application crash
Code:
QMetaObject::findSignal:MagickFontDlgImpl
: Conflict with MagickFontDlg
::fontChosen() teff instantiated
QMetaObject::findSignal:DlgTextEffect
: Conflict with dlgTextEffectBase
::doneTextOnPictures() websitedialogimpl gemaakt
thumbnailgenerator gemaakt en voorzien van achtergrondkleur
themeimpl gemaakt en voorzien van achtergrondkleur
setting htmldestination in makeSite
destroying dlgcssimpl
Destroying websitedialogimpl
deleting teff
Program exited normally.
(gdb)
This is what I get as output from gdb
Re: Gnome makes application crash
Quote:
Originally Posted by regix
Program exited normally.
It looks like it didn't crash.
Quote:
Originally Posted by regix
QMetaObject::findSignal:DlgTextEffect: Conflict with dlgTextEffectBase::doneTextOnPictures()
This is a bit weird, check your code.
Re: Gnome makes application crash
In my code doneTextOnPictures() is a signal
I added the signal in designer under the Members tab of the Object Explorer.
I emit the signal in the implementationfile of the Subclasse and connect to it in another class.
??
The code works in KDE
Re: Gnome makes application crash
Quote:
Originally Posted by regix
I added the signal in designer under the Members tab of the Object Explorer.
Maybe you have declared it in "signals:" section in the subclass too?
Quote:
Originally Posted by regix
The code works in KDE
This doesn't prove anything. Does that small program I've posted earlier crash on GNOME?
Re: Gnome makes application crash
The little application you posted ran fine on Gnome. It terminated like it should. My application also terminates but it shouldn't: after getting the color the program goes on ...
I had declared the signal in the subclass too. I commented this out but the same remark appears when I run the program.... and it still stops on GNOME...
Re: Gnome makes application crash
Quote:
Originally Posted by regix
The little application you posted ran fine on Gnome. It terminated like it should. My application also terminates but it shouldn't: after getting the color the program goes on ...
Either the problem lies in some other place or that example program was too simple.
Try this:
Code:
#include <qapplication.h>
#include <qcolordialog.h>
#include <qpushbutton.h>
{
Q_OBJECT
public:
{
connect( this, SIGNAL( clicked() ), this, SLOT( onClick() ) );
}
private slots:
void onClick()
{
}
};
int main( int argc, char **argv )
{
Test t;
t.show();
app.setMainWidget( &t );
return app.exec();
}
#include "main.moc"
Quote:
Originally Posted by regix
I commented this out but the same remark appears when I run the program....
There were at least two such warnings, so maybe one of them is gone, but you still see the other?
Re: Gnome makes application crash
There seems to an error in the code you posted:
testgnome.cpp:66:21: error: main.moc: Onbekend bestand of map
when I remove the #include "main.moc"
I get following errors:
/home/reginald/projecten/qt/testgnome/testgnome.cpp:18: undefined reference to `vtable for Test'
I removed the signal declarations in de baseclasses and the messages dissapeared
I get another message now:
QObject::connect : no such signal MagickFontDlg::fontChosen()
regix
Re: Gnome makes application crash
update
I solved the errorMessage in my code concerning the signal fontChosen:
the connection was declared in the baseclass
I moved it to the subclass
No errormessages anymore but the program in gnome still ends at the dialog...
regix
Re: Gnome makes application crash
Quote:
Originally Posted by regix
There seems to an error in the code you posted:
testgnome.cpp:66:21: error: main.moc: Onbekend bestand of map
See this post for explanation why you need to include the .moc file. Since your .cpp file is called testgnome.cpp, the moc output will be testgnome.moc.
so change the include to:
Code:
#include "testgnome.moc"
Re: Gnome makes application crash
thanks,
I compiled the little program above with #include "testgnome.moc"
then I ran it with gdb
(gdb) run
Starting program: /home/reginald/projecten/qt/testgnome/testgnome
[Thread debugging using libthread_db enabled]
[New Thread 47458327939440 (LWP 4404)]
QPainter::setClipRegion: Will be reset by begin()
QPainter::setClipping: Will be reset by begin()
QPainter::setPen: Will be reset by begin()
QPainter::setBrush: Will be reset by begin()
QPainter::setBrush: Will be reset by begin()
QPainter::setPen: Will be reset by begin()
QPainter::setClipRegion: Will be reset by begin()
...
The program didn't finish after I chose a color which is a different behaviour than in my own program
regix
Re: Gnome makes application crash
The only possible explanation I see is that I should put the connect statement of my accept slot in the subclass. Right now I defined them in the base class.
Maybe that's why in GNOME the colordialog mimics some behaviour that calls the destructor of all the other dialogs?
Should I not use the connectionsdialog in Designer and put them in the subclass?
Regix
Re: Gnome makes application crash
Quote:
Originally Posted by regix
Should I not use the connectionsdialog in Designer and put them in the subclass?
This shouldn't change anything. Compile your application in debug mode, start it from debugger, place a brakepoint in EditCSSDlg::changeTitleColor() and see what exactly happens when you open that QColorDialog.