QPixmap px = QPixmap::grabWindow(QApplication::desktop()->winId()); px.save(currentFile.at(0) + "/" + currentFile.at(1) + ".png");
QMetaObject::invokeMethod(this, "your_function", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QImage, frame));
QImage frame;QMetaObject::invokeMethod(this, "your_function", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QImage, frame));frame.save(currentFile.at(0) + "/" + currentFile.at(1) + ".png");
QImage your_function() { return QPixmap::grabWindow(QApplication::desktop()->winId()).toImage();}
class CThreadSaveScreen : public QThread{ Q_OBJECT private: QString pathScreen; public: CThreadSaveScreen() : QThread() { pathScreen = ""; } protected: void run(); private slots: void setPathScreen(QString path);};
[quote author=kibsoft link=topic=25451.msg182211#msg182211 date=1376397980][code]QImage frame;QMetaObject::invokeMethod(this, "your_function", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QImage, frame));frame.save(currentFile.at(0) + "/" + currentFile.at(1) + ".png");
QImage frame;QMetaObject::invokeMethod(this, "[b]your_function[/b]", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QImage, frame));frame.save(currentFile.at(0) + "/" + currentFile.at(1) + ".png");
QImage frame;QMetaObject::invokeMethod(this, "your_slot", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QImage, frame));frame.save(currentFile.at(0) + "/" + currentFile.at(1) + ".png");
private slots:QImage your_slot() { return QPixmap::grabWindow(QApplication::desktop()->winId()).toImage();}