Results 1 to 20 of 71

Thread: Application crashes at launch-time

Hybrid View

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

    Default Re: Application crashes at launch-time

    I'll ask you once more, why my application doesn't have functionality?
    We don't even know what functionality you are talking about.
    Do you know how to use signals and slots?
    ==========================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.

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

    Default Re: Application crashes at launch-time

    Quote Originally Posted by high_flyer View Post
    We don't even know what functionality you are talking about.
    Objects on which I was doing:
    Qt Code:
    1. ui.element->hide();
    To copy to clipboard, switch view to plain text mode 
    doesn't work, nextStepButton does nothing and so on. Maybe It'll b e better if you can see my code. I'll attach dialog.cpp

    Quote Originally Posted by high_flyer View Post
    Do you know how to use signals and slots?
    Your kidding me? Of course, I know.
    edit:
    The problem isn't that I don't know how to connect signals to slots, I have functions which do something, connected to something and all should work, but it doesn't. Look at my file
    Attached Files Attached Files
    Last edited by Salazaar; 13th June 2007 at 20:06.

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

    Default Re: Application crashes at launch-time

    well, settingUp() is a bunch of if() clauses.
    Probably none of them gets to be true, so nothing happens.
    Put a debug statement in and see if its being printed:
    Qt Code:
    1. bool Dialog::settingUp()
    2. {
    3. qDebug()<<"Dialog::settingUp()";
    4. //the rest of your code.
    5. }
    To copy to clipboard, switch view to plain text mode 

    In addition make sure you get no signal/slot warnings when you execute the application.
    ==========================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.

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

    Default Re: Application crashes at launch-time

    Quote Originally Posted by high_flyer View Post
    well, settingUp() is a bunch of if() clauses.
    Probably none of them gets to be true, so nothing happens.
    None?? If I, let's say' check checkbox in one group, and second in second grop and if nextStep Button is clicked one if() clause sure returns true and all instructions in if() should be done. But even if is a problem (which I think it isn't a problem) some widgets should be hidden, and we can type any value (even string) to lineEdit, although I have a validator.

    Quote Originally Posted by high_flyer View Post
    In addition make sure you get no signal/slot warnings when you execute the application.
    No, I don't have any signal/slots warning when executing application.
    Last edited by Salazaar; 14th June 2007 at 12:13.

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

    Default Re: Application crashes at launch-time

    did you try the code I gave you in the last post?
    ==========================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.

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

    Default Re: Application crashes at launch-time

    Yes, I tried it, application compiled with no errors, and no errors at launching.

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

    Default Re: Application crashes at launch-time

    Amm... yes, I expected as much, but the point was to see if you ar getting the debug message...

    EDIT:
    you should start the application from the console
    ==========================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. #8
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Application crashes at launch-time

    Debug message? What do you mean? I tried to type make all instead of make, and reached message that it cannot find file somename.dll. And if it's not the answer you were expecting, how can I reach debugg message?

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

    Default Re: Application crashes at launch-time

    Am... look at the code I gave you.
    there is a line:
    Qt Code:
    1. qDebug()<<"Dialog::settingUp()";
    To copy to clipboard, switch view to plain text mode 

    This will print 'Dialog::settingUp()' in the console if you run the application in the console, and if the slot will get executed.
    If the slot will not get executed, the message will not be printed.
    This will tell you if the problem is IN the slot, or that the problem is that the slot is not being called.

    Just start the program in the console, and see what ouput you get.

    No need for 'make all' or any other thing.
    ==========================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.

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

    Default Re: Application crashes at launch-time

    He's using Windows, so adding CONFIG+=console and rerunning qmake is advised.

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

    Default Re: Application crashes at launch-time

    I added this, rebuild application, console window opened (and also normal windows application with GUI opened) but the console was clear. What does it mean?

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

    Default Re: Application crashes at launch-time

    it means the slot is not being called.
    But at the moment I don't have the time to review you code again...
    So check every thing that has to do with the signal/slot connection.
    ==========================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.

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

    Default Re: Application crashes at launch-time

    post ALL your code.
    The one file yo posted looks ok.
    ==========================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.

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

    Default Re: Application crashes at launch-time

    Quote Originally Posted by high_flyer View Post
    post ALL your code.
    Sure. Unfortunately my files are too big to attach them, I'll post it in rar file
    http://download.yousendit.com/049347421EAD445D

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

    Default Re: Application crashes at launch-time

    you should really read and try SIMPLE examples untill you get how the ui aproach works in Qt.
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication app(argc, argv);
    4. QApplication::setStyle ( new QPlastiqueStyle() );
    5. QDialog *window = new QDialog;
    6. //Ui::Dialog ui;
    7. //ui.setupUi(window);
    8. app.setMainWindow(window);
    9. window->show();
    10. return app.exec();
    11. }
    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.

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

    Default Re: Application crashes at launch-time

    Do you know how to use signals and slots?
    Your kidding me? Of course, I know.
    I am starting to think you are kidding me...

    Qt Code:
    1. class Dialog : public QDialog/*, public Ui::Dialog*/ //what was that for??
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. Dialog(QWidget *parent = 0);
    7.  
    8.  
    9. public slots: //<<----this is needed
    10. bool settingUp();
    11. void previousStep();
    12.  
    13. private:
    14.  
    15. Ui::Dialog ui;
    16. };
    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.

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

    Default Re: Application crashes at launch-time

    I think public Ui:ialog is needed to access gui elements

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

    Default Re: Application crashes at launch-time

    as I said, READ about it more.
    You have a private ui elements which you use in your Dialog class.
    If you use that approach you don't need to sublcass, one of the nice things about Qt4 ui way.
    ==========================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.

Similar Threads

  1. Replies: 5
    Last Post: 27th May 2006, 13: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
  •  
Qt is a trademark of The Qt Company.