D
Size: a a a
AS
M
Вキ
AM
class Player: public QObjectВ методе run, просто для примера, while(true).
{
Q_OBJECT
public:
Player();
public slots:
void run();
};
...
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
myThread=new Thread();
myPlayer->moveToThread(myThread);
myThread->start();
}
void MainWindow::on_runButton_clicked()
{
player->run();
}
A
class Player: public QObjectВ методе run, просто для примера, while(true).
{
Q_OBJECT
public:
Player();
public slots:
void run();
};
...
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
myThread=new Thread();
myPlayer->moveToThread(myThread);
myThread->start();
}
void MainWindow::on_runButton_clicked()
{
player->run();
}
M
class Player: public QObjectВ методе run, просто для примера, while(true).
{
Q_OBJECT
public:
Player();
public slots:
void run();
};
...
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
myThread=new Thread();
myPlayer->moveToThread(myThread);
myThread->start();
}
void MainWindow::on_runButton_clicked()
{
player->run();
}
AM
A
AM
connect(myThread, SIGNAL(started()), my, SLOT(run()));типа такого ?
M
A
connect(myThread, SIGNAL(started()), my, SLOT(run()));типа такого ?