Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
5.2.0
-
None
-
mac OS X 10.8.5
Qt5.2
tried api 10,14,15,19
compile with armeabi
Description
error message
F/libc (30728): Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1), thread 30752 (ple.androidTest) .hpp @ #ifndef SCREENCAPTURE_HPP #define SCREENCAPTURE_HPP #include <QObject> class QQuickView; class screenCapture : public QObject { Q_OBJECT public: explicit screenCapture(QQuickView *parent = 0); screenCapture& operator=(screenCapture const&) = delete; screenCapture(screenCapture const&) = delete; Q_INVOKABLE void capture(); private: //QtQuick2ApplicationViewer *currentView_; QQuickView *currentView_; QString previous_name_; }; #endif // SCREENCAPTURE_HPP @ .cpp @ #include <QQuickView> #include "screenCapture.hpp" screenCapture::screenCapture(QQuickView *parent) : QObject(nullptr), currentView_(parent) { } /** * @brief capture screen */ void screenCapture::capture() { currentView_->grabWindow(); } @ main.cpp @ #include <QtGui/QGuiApplication> #include "qtquick2applicationviewer.h" #include <QQuickPaintedItem> #include "screenCapture.hpp" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); qmlRegisterType<screenCapture>("ScreenCapture", 1, 0, "ScreenCap"); QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile(QStringLiteral("qml/androidTest/main.qml")); viewer.showExpanded(); return app.exec(); } @ main.qml @ import QtQuick 2.0 import ScreenCapture 1.0 Rectangle { width: 360 height: 360 ScreenCap{id: cap} MouseArea { id: mouseArea anchors.fill: parent onClicked: { cap.capture() } } }
@
I upload the full example(androidTest.zip)
Attachments
Issue Links
- relates to
-
QTBUG-34846 Android don't have grab windows
- Closed