C++ (Qt)CMaterialTarget * target = (CMaterialTarget *) translator;int count = target->NumberOfChildren();
C++ (Qt)CMaterialTarget * target = dynamic_cast<CMaterialTarget *> (translator);
void on_click(QWidget *clickedWidget){ QString caption(""); QTextEdit *edit = dynamic_cast<QTextEdit *>(clickedWidget); if (edit) caption = edit->toPlainText(): else QBushButton *button = dynamic_cast<QTextEdit *>(clickedWidget); if (button) caption = button->text(); MainWindow->setWindowTitle(caption);}
... else { QPushButton *button = dynamic_cast<QTextEdit *>(clickedWidget); if (button) caption = button->text(); }..}
void on_click(QWidget *clickedWidget){ QString caption(""); QTextEdit *edit = dynamic_cast<QTextEdit *>(clickedWidget); if (edit) caption = edit->toPlainText(): else{ QBushButton *button = dynamic_cast<QBushButton *>(clickedWidget); // ошибка тут была if (button) caption = button->text(); } MainWindow->setWindowTitle(caption);}