I'm new to Qt and have some bare (console) c++ experience, so I expect this is some small error of mine, but for the life of me, I can't figure it out.

I can call myTextEdit->append() just fine in static code, but connecting a signal to it doesn't seem to work:

Qt Code:
  1. #include <QApplication>
  2. #include <QObject>
  3. #include <QWidget>
  4. #include <QTextEdit>
  5. #include <QPushButton>
  6. #include <QVBoxLayout>
  7.  
  8. int main(int argc, char *argv[]) {
  9.  
  10. QApplication app(argc, argv);
  11.  
  12. QWidget* window = new QWidget;
  13. QPushButton* aButton = new QPushButton("A Button");
  14. QTextEdit* aTextEdit = new QTextEdit();
  15. QTextDocument* aDocument = new QTextDocument("Text");
  16.  
  17. aButton->setFont(QFont("Impact", 18, QFont::Bold));
  18. aButton->setGeometry(10, 40, 180, 40);
  19. aTextEdit->setDocument(aDocument);
  20. aTextEdit->append("\nSome more text");
  21.  
  22. QObject::connect(aButton, SIGNAL(clicked()), aTextEdit, SLOT(append("\nSome Dynamic Text")));
  23.  
  24. QVBoxLayout* layout = new QVBoxLayout;
  25. layout->addWidget(aTextEdit);
  26. layout->addWidget(aButton);
  27.  
  28. window->resize(300, 300);
  29. window->setLayout(layout);
  30. window->show();
  31.  
  32. return app.exec();
  33. }
To copy to clipboard, switch view to plain text mode 

Other slots I connect to seem to work fine (Such as clear(), cut(), paste(), etc.) but append(), setPlainText(), etc... basically anything that would achieve what I want, doesn't do anything. I've tried these commands on the QDocument the QTextEdit contains as well-- both automatic and self-created. I've tried using QStrings and blocks of static test for the append() function (Both work fine in static code) and still no luck.

I hate to think that this could be a result of my relative newness to c++, but the other slots work, so I don't think that's it...

Appending QListWidgets seems to have the same problem, but I haven't done extensive testing.