Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
If you need dynamic dialogs, then you can do this:
QUiLoader uiLoader;
QFile file("sortdialog.ui");
QWidget *sortDialog = uiLoader.load(&file);
if (sortDialog) {
....
}
#ifndef TESTCLASS_H
#define TESTCLASS_H
#include "ui_MainWindow.h"
class TestClass
{
public:
TestClass();
void changeTextOnForm(Ui_MainWindow *mainWindow);
};
#endif // TESTCLASS_H
#include "TestClass.h"
TestClass::TestClass()
{
}
void TestClass::changeTextOnForm(Ui_MainWindow *mainWindow)
{
mainWindow->label_2->setText(QString("Text from ") + Q_FUNC_INFO);
mainWindow->textBrowser->append(mainWindow->label_2->text());
}
...
void MainWindow::on_pushButton_clicked()
{
TestClass testClass;
testClass.changeTextOnForm(this->ui);
}
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question