I'm trying to set text of a push button by invoking its method via QMetaObject::invokeMethod but failing to achieve any successful results. I have tried it with some other widgets and they seem to work fine. Would appropriate any suggestions, kinda stuck here and googling is not helping. Here is the code:

Qt Code:
  1. // w is QMainWindow
  2.  
  3. QWidget* label = w.findChild<QLabel*>("label");
  4. ((QLabel*)label)->setText("text old"); // works fine
  5. bool res_label = QMetaObject::invokeMethod(label, "setText", Q_ARG(QString, "text new")); // works fine, returns true
  6.  
  7. QWidget* lineEdit = w.findChild<QLineEdit*>("lineEdit");
  8. ((QLineEdit*)lineEdit)->setText("text old"); // works fine
  9. bool res_line_edit = QMetaObject::invokeMethod(lineEdit, "setText", Q_ARG(QString, "text new")); // works fine, returns true
  10.  
  11. QWidget* textBrowser = w.findChild<QTextBrowser*>("textBrowser");
  12. ((QTextBrowser*)textBrowser)->setText("text old"); // works fine
  13. bool res_text_browser = QMetaObject::invokeMethod(textBrowser, "setText", Q_ARG(QString, "text new")); // works fine, returns true
  14.  
  15. QWidget* pushButton = w.findChild<QPushButton*>("pushButton");
  16. ((QPushButton*)pushButton)->setText("text old"); // works fine
  17. bool res_push_button = QMetaObject::invokeMethod(pushButton, "setText", Q_ARG(QString, "text new")); // NOT WORKING, RETURNS FALSE
To copy to clipboard, switch view to plain text mode 

I tried all connection types (Qt::DirectConnection, Qt::QueuedConnection, Qt::BlockingQueuedConnection, Qt::AutoConnection). Also setText is defined as a public slot in the first three widgets but is defined as a public function in the QPushButton, is it possible that it might be the cause of the problem?