Qt 5.9에서 SLOT 대신 C++ 키워드를 사용하려고합니다. 그게 가능합니까 (별도의 방법없이)?연결 신호/슬롯에 C++ 키워드 사용
뭔가 같은 : 연결 샘플에서
QImage *image_ptr = new QImage(3, 3, QImage::Format_Indexed8);
QEventLoop evt;
QFutureWatcher<QString> watcher;
QTimer timer(this);
timer.setSingleShot(true);
QObject::connect(&watcher, &QFutureWatcher<QString>::finished, &evt, &QEventLoop::quit);
QObject::connect(&timer, SIGNAL(timeout()), &watcher, SLOT(cancel()));
QObject::connect(&timer, SIGNAL(timeout()), &evt, SLOT(quit));
QObject::connect(&timer, SIGNAL(timeout()), this, (delete image_ptr));
QFuture<QString> future = QtConcurrent::run(this,&myClass::myMethod,*image_ptr);
watcher.setFuture(future);
timer.start(100);
evt.exec();
람다를 사용하십시오. https://artandlogic.com/2013/09/qt-5-and-c11-lambdas-are-your-friend/ – drescherjm
그 말로는 위험 해 보입니다. 제 말은 동시 실행이 여전히 실행 중이고 이미지를 해제하면 나쁜 일이 발생한다는 것입니다. – drescherjm