Page 1 of 2 12 LastLast
Results 1 to 20 of 36

Thread: Gnome makes application crash

  1. #1
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question 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:
    Qt Code:
    1. void EditCSSDlg::changeTitleColor()
    2. {
    3. QColor changed = QColorDialog::getColor(Qt::white);
    4. QPixmap colpixmap(30,30);
    5. colpixmap.fill(changed);
    6. this->pushButtonColor->setPixmap(colpixmap);
    7. this->titlecolor = changed.name();
    8. }
    To copy to clipboard, switch view to plain text mode 

    the application never gets to the instantiation of the QPixmap.

    regix

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gnome makes application crash

    What Qt version do you use? Did you upgrade GNOME libraries recently?

  3. #3
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  4. #4
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  6. #6
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  7. #7
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gnome makes application crash

    Does this crash?
    Qt Code:
    1. #include <qcolordialog.h>
    2. #include <qapplication.h>
    3.  
    4. int main( int argc, char **argv )
    5. {
    6. QApplication app( argc, argv );
    7. QColorDialog::getColor();
    8. return 0;
    9. }
    To copy to clipboard, switch view to plain text mode 
    (compile it in debug mode and run from gdb).

  9. #9
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Gnome makes application crash

    Qt Code:
    1. QMetaObject::findSignal:MagickFontDlgImpl: Conflict with MagickFontDlg::fontChosen()
    2. teff instantiated
    3. QMetaObject::findSignal:DlgTextEffect: Conflict with dlgTextEffectBase::doneTextOnPictures()
    4. websitedialogimpl gemaakt
    5. thumbnailgenerator gemaakt en voorzien van achtergrondkleur
    6. themeimpl gemaakt en voorzien van achtergrondkleur
    7. setting htmldestination in makeSite
    8. destroying dlgcssimpl
    9. Destroying websitedialogimpl
    10. deleting teff
    11.  
    12. Program exited normally.
    13. (gdb)
    To copy to clipboard, switch view to plain text mode 

    This is what I get as output from gdb

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  11. #11
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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?

  13. #13
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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...

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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:
    Qt Code:
    1. #include <qapplication.h>
    2. #include <qcolordialog.h>
    3. #include <qpushbutton.h>
    4.  
    5. class Test : public QPushButton
    6. {
    7. Q_OBJECT
    8. public:
    9. Test() : QPushButton( "test", 0 )
    10. {
    11. connect( this, SIGNAL( clicked() ), this, SLOT( onClick() ) );
    12. }
    13.  
    14. private slots:
    15. void onClick()
    16. {
    17. QColorDialog::getColor();
    18. }
    19. };
    20.  
    21. int main( int argc, char **argv )
    22. {
    23. QApplication app( argc, argv );
    24.  
    25. Test t;
    26. t.show();
    27.  
    28. app.setMainWidget( &t );
    29.  
    30. return app.exec();
    31. }
    32.  
    33. #include "main.moc"
    To copy to clipboard, switch view to plain text mode 

    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?

  15. #15
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  16. #16
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  17. #17
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default 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:
    Qt Code:
    1. #include "testgnome.moc"
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  18. #18
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  19. #19
    Join Date
    Jan 2006
    Posts
    45
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  20. #20
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2006, 18:51
  2. Replies: 5
    Last Post: 24th April 2006, 15:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.