Results 1 to 7 of 7

Thread: MVC problem parameter handover

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2016
    Location
    Oberhausen, Germany
    Posts
    5
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default MVC problem parameter handover

    Hello forum

    I tries for the first time at the Model View Controller programming.

    I create three classes one for the logic, one for the Gui
    and one for the controlling.

    But i have a problem by the parameter handover in the logic class.

    The application crashed after click button.

    My test programm.

    Header:

    Qt Code:
    1. #ifndef LOGIC_H
    2. #define LOGIC_H
    3.  
    4. #include <QDebug>
    5. #include "gui.h"
    6.  
    7. class Gui;
    8.  
    9. class logic
    10. {
    11.  
    12. Gui *testgui;
    13.  
    14. public:
    15. logic(Gui *myGui);
    16.  
    17. void writeTEST();
    18. };
    19.  
    20. #endif // LOGIC_H
    To copy to clipboard, switch view to plain text mode 

    CPP:

    Qt Code:
    1. #include "logic.h"
    2.  
    3.  
    4. logic::logic(Gui *myGui)
    5. {
    6. testgui = myGui;
    7. }
    8.  
    9. void logic::writeTEST()
    10. {
    11. testgui->testTE->setText("test"); //application crashed
    12. //testgui->testTE->setText("test"); //application run if it comment out
    13. }
    To copy to clipboard, switch view to plain text mode 


    Since the proplem is unmistakable by the function call exist.
    I don't to see the wood for the trees.


    I hope anybody can help me.

    I do apologize for my bad english

    best regards

    Basti1990
    Attached Files Attached Files

Similar Threads

  1. QAxObject, problem with VARIANT* parameter
    By jack_0x666 in forum Qt Programming
    Replies: 0
    Last Post: 10th June 2015, 13:41
  2. Replies: 3
    Last Post: 12th March 2012, 01:45
  3. Sql problem - parameter mismatch count
    By Marina K. in forum Qt Programming
    Replies: 1
    Last Post: 20th June 2011, 18:27
  4. application parameter problem..
    By triperzonak in forum Newbie
    Replies: 7
    Last Post: 9th February 2009, 01:56
  5. Problem with unused parameter
    By devilj in forum Qt Programming
    Replies: 5
    Last Post: 4th July 2007, 18:48

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.