HI,
i have a problem with my qt program.
first of all i have a QTextBrowser and a Button. when the button is clicked it should call a method from a c++ class like this:

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6.  
  7. }
  8.  
  9. MainWindow::~MainWindow()
  10. {
  11. delete ui;
  12. }
  13.  
  14. void MainWindow::on_Button_clicked()
  15. {
  16. try{
  17. GUIController guiController;
  18. guiController.somemethode();
  19.  
  20. }
  21. catch (char const* err){
  22. cout << err << endl;
  23.  
  24. }
  25.  
  26. }
To copy to clipboard, switch view to plain text mode 

This called methode should do something and then call a method from mainwindow class which should set Text to the textBrowser like this:

Qt Code:
  1. GUIController::GUIController()
  2. {
  3.  
  4. }
  5.  
  6. GUIController::~GUIController()
  7. {
  8.  
  9. }
  10.  
  11. void GUIController::somemethode{
  12. ...
  13. ...
  14. mainwindow.printToOutput(("text"));
  15.  
  16. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6.  
  7. }
  8.  
  9. MainWindow::~MainWindow()
  10. {
  11. delete ui;
  12. }
  13.  
  14. void MainWindow::printToOutput(QString text){
  15.  
  16. ui->outputText->append(text);
  17.  
  18. }
To copy to clipboard, switch view to plain text mode 

But the problem is that the text doesn't appear in the QTextBrowser.
Has anybody an idea whats the problem?
i googled a long time and i think the problem is something with the "render loop" of the gui but i don't know how to fix it.

Thanks for help!