Page 4 of 4 FirstFirst ... 234
Results 61 to 71 of 71

Thread: Application crashes at launch-time

  1. #61
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Application crashes at launch-time

    Salazaar, are you using Qt Assistant? It has nice indexing and searching functions...

  2. #62
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Application crashes at launch-time

    Oh allrgiht...
    Salazar - I had a typo when in the code, and thought it might be a good lesson for you...
    It should be QApplication::setMainWidget ()
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #63
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Application crashes at launch-time

    Actually you shouldn't need that line at all.

  4. #64
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Application crashes at launch-time

    True.
    But it doesn't hurt.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #65
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application crashes at launch-time

    Yes, I'm using assistant. I would check it in docs, but I just written that I don't know what's the problem about

  6. #66
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application crashes at launch-time

    I made this changes you post, but when i launch application, only dialog window appear. I mean, no gui elements are displayed, only empty window. is that a 'typo'?

  7. #67
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Application crashes at launch-time

    I mean, no gui elements are displayed, only empty window. is that a 'typo'?
    Yes, but this time its yours:
    Qt Code:
    1. int main(int argc, char *argv[])
    2.  
    3. {
    4. QApplication app(argc, argv);
    5. QApplication::setStyle ( new QPlastiqueStyle() );
    6. //QDialog *window = new QDialog;
    7. Dialog *window = new Dialog;
    8. window->show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #68
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Application crashes at launch-time

    Salazaar, please read and at least try to understand the code you write. I think you should be able to distinguish between "QDialog" and "Dialog".

  9. #69
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application crashes at launch-time

    It should be new Dialog. Right?

  10. #70
    Join Date
    Jun 2007
    Location
    Louisiana
    Posts
    77
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Application crashes at launch-time

    Debugging an application that crashes on startup is more difficult with designer ui modules than when you make the forms yourself. The designer generates a lot of MOC able code that gets compiled.

    When you are just starting to learn Qt (or C++ for that matter) you may be better off learning how to manually construct the form first (using the examples and tutorials in Qt). Make the smallest runnable code changes that compile clean. For instance, just make a form that has a group box or frame on it. When you get that small amount of code to work, then add other controls to the working code one at a time.

    In this way you narrow the search for the bugs to just the code you added. It is much easier to debug a few lines of code than several hundred generated by the designer. Especially when you don't understand what it all does.

    Hope this helps.

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

    Default Re: Application crashes at launch-time

    Quote Originally Posted by ad5xj View Post
    It is much easier to debug a few lines of code than several hundred generated by the designer.
    Sure, but one can safely assume that the code generated by the Designer is OK (which in fact means that you have less code to debug, if you use Designer). Although one shouldn't use a code generator, if he doesn't understand the generated code, so you are right, that it's better to start with learning how to create GUI in code.

Similar Threads

  1. Replies: 5
    Last Post: 27th May 2006, 14:44

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.