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
    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 read classes chapter of my book and I think that there's something wrong with calling just e.g. hide():
    Qt Code:
    1. ui.convertButton->hide();
    To copy to clipboard, switch view to plain text mode 
    But I don't know what.
    edit:
    or maybe no. In docs it was something like this:
    Qt Code:
    1. ui.colorDepthCombo->addItem(tr("2 colors (1 bit per pixel)"));
    To copy to clipboard, switch view to plain text mode 
    Could you tell me, what's wrong? I understand classes, but don't know why application doesn't have any functionality (the only working thing is exit button which closes dialog. But connection was made in designer)
    Last edited by Salazaar; 12th June 2007 at 19:42.

  2. #2
    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

    provided that 'ui' is a valid member variable, that has accessible member pointer 'convertButton' that has an accessible member function 'hide()' - your code is correct.
    With correct syntax your code will compile.
    But correct systax is not enough for correct functionality.
    Why your program does not function the way you expect it is another question, which has to do with your programs design.
    But that is another story, which I suggest you leave at the moment.
    Concentrate on C++ first.
    Do some simple example programs and learn the concept.
    Just readin one chapter in the book, does not make you REALLY know object oriented programming.
    ==========================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. #3
    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

    Do you really think that all I know about C++ is how to access class member?? I know C++ quite well, but I didn't use classes in my problem, that's the reason why I didn't understand "accessing GUI elements", and it doesn't mean that I don't know C++. What is wrong in my code? I really don't know... Regards

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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

    Quote Originally Posted by Salazaar View Post
    I know C++ quite well, but I didn't use classes in my problem,
    If you didn't use classes, what did you use then? Is the code of any of your programs available for download? I'd like to take a look at it.

  5. #5
    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 used combination of functions. No, the code isn't availible because as I said once my console programs are histroy. I'll ask you once more, why my application doesn't have functionality? Regards

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 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

    Quote Originally Posted by Salazaar View Post
    I used combination of functions.
    So where was C++ in that? Maybe it was C then?

    No, the code isn't availible because as I said once my console programs are histroy.
    That's a pitty... Were they some school projects or something you did for fun?

    I'll ask you once more, why my application doesn't have functionality?
    Define "functionality". Does it contain widgets? Are they connected using signals and slots? Give us more details (be warned though, we'll still be assuming you know what you're doing regarding C++ syntax and semantics).

  7. #7
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application crashes at launch-time

    You are being very forceful and expecting the good people on here just to fix your problem.

    You have been told to read more on C++ and I believe you should do. The best way to learn and fix your problems is by sitting down and trying to do it yourself first.

    I'm sorry to sound hard, but having read lots of your posts, it seems you are just expecting to post your code on here and expect it to be fixed for you.

  8. #8
    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'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.

  9. #9
    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

    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.

  10. #10
    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

    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.

  11. #11
    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

    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.

  12. #12
    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

    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.

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.