Skip to content

Mobile and Embedded

The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
14.2k Topics 62.7k Posts
  • what is way to use array in qt like c ?

    Solved
    4
    0 Votes
    4 Posts
    399 Views
    SGaistS
    Since it's a fixed size array, just declare it with the right size and then initialize it in the constructor.
  • QML camera on android via Loader

    Solved
    1
    0 Votes
    1 Posts
    240 Views
    No one has replied
  • QMAKE variables list related to iOS/MacOS. Where?

    Unsolved
    3
    0 Votes
    3 Posts
    386 Views
    M
    @bogong These sorts of variables? QMAKE_MAC_XCODE_SETTINGS QMAKE_MAC_SDK_PLATFORM_PATH QMAKE_XCODEBUILD_PATH QMAKE_APPLE_CC QMAKE_OBJECTIVE_CFLAGS QMAKE_XCODE_DEVELOPER_PATH QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_MAC_SDK_PATH QMAKE_XCODE_DEVELOPER_PATH QMAKE_APPLE_DEVICE_ARCHS QMAKE_INFO_PLIST QMAKE_IOS_DEVICE_ARCHS QMAKE_IOS_DEPLOYMENT_TARGET QMAKE_APPLE_TARGETED_DEVICE_FAMILY QMAKE_TARGET_BUNDLE_PREFIX QMAKE_BUNDLE QMAKE_BUNDLE_DATA QMAKE_ASSET_CATALOGS Above are all the variables I've used in a previous project. I have also struggled to find a definitive list. I often resort to googling var names with the hope of discovering some more along the way!
  • variables at AndroidManifest.xml

    Unsolved
    3
    0 Votes
    3 Posts
    266 Views
    KroMignonK
    @morte I don't know if they are documented. You can find them in androiddeployqt tool source code. Take a look here ==> https://forum.qt.io/post/591597
  • How to use the webcam

    Unsolved qcamera
    4
    0 Votes
    4 Posts
    753 Views
    SGaistS
    I might be wrong but I think 5.6.3 was still using gstreamer 0.1. Note that this version is really outdated, can you update to a more recent LTS version ? Current is 5.15.
  • Compiling Qt/QML 6 app for Android error: Unknown bits set in runtime_flags: 0x8000

    Unsolved
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Android QR Code Scanner

    3
    0 Votes
    3 Posts
    4k Views
    lukas_kosinskiL
    You should try SCodes. SCodes is library, which allows not only scanning QR/Barcodes, but also generating them. It's based on, mentioned above, ZXing. You can find tutorial and examples on SCodes GitHub page.
  • Creating EGLImageKHR image from render buffer

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    E
    Hello, There is an update. Currently I manage to get correct values from glGetRenderbufferParameteriv for width,height and internal format by changing some of the files as the following: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// main.qml import QtQuick 2.0 import QtQuick.Window 2.0 import QtWayland.Compositor 1.0 import WaylandEgl 1.0 Window { id:mainWindow visible: true width: 640 height: 480 title: qsTr("Hello World") Rectangle { color: "blue" anchors.fill: parent width: parent.width height: parent.height } Text { id: name text: qsTr("Hello jii") } WaylandEgl { id:wegl } //onAfterRendering: wegl.performEglSetup(mainWindow) //Component.onCompleted: wegl.performEglSetup(mainWindow) /*onFrameSwapped: wegl.performEglSetup(mainWindow) Component.onCompleted: wegl.performEglSetup(mainWindow)*/ } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// wl_egl.h #ifndef WL_EGL_H #define WL_EGL_H #include <QWindow> #include <QWaylandCompositor> #include <QQuickWindow> #include <QOpenGLFunctions> #include <QQuickItem> #include <errno.h> #include <fcntl.h> #include <stdbool.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #define EGL_EGLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES #include <gbm.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include <drm_fourcc.h> #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <xf86drm.h> #include <xf86drmMode.h> #include <wayland-client.h> #include <QObject> class WaylandEgl : public QQuickItem { Q_OBJECT public: explicit WaylandEgl(QObject* parent = nullptr) ; //WaylandEgl(); Q_INVOKABLE int performEglSetup(); QQuickWindow * mwindow; private slots: void handleWindowChanged(QQuickWindow *win); public slots: void paint(); void cleanup(); void sync(); }; #endif // WL_EGL_H ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "wl_egl.h" #include <stdio.h> #include <QWaylandSurface> #include <QGuiApplication> #include <qpa/qplatformnativeinterface.h> #include <QDebug> #include <QScreen> #include <QWindow> #include <QQuickWindow> //#include <QOpenGLContext> #include <QOpenGLFunctions> #include <QGLFormat> #include <QtWaylandClient/QWaylandClientExtension> #include <EGL/egl.h> #include <gbm.h> #include <EGL/eglplatform.h> #include <wayland-client.h> #include <errno.h> #include <fcntl.h> #include <stdbool.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #define EGL_EGLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES #include <gbm.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include <drm_fourcc.h> #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <xf86drm.h> #include <xf86drmMode.h> #include <wayland-client.h> #include <wayland-server.h> #include <wayland-client-protocol.h> #include <wayland-egl.h> static EGLDisplay m_display = nullptr; static EGLConfig m_config = nullptr; static EGLContext m_context = nullptr; static PFNEGLCREATEIMAGEKHRPROC CreateImageKHR; //static struct zwp_linux_dmabuf_v1 *dmabuf = nullptr; static const char *get_egl_error() { switch (eglGetError()) { case EGL_SUCCESS: return "EGL_SUCCESS"; case EGL_NOT_INITIALIZED: return "EGL_NOT_INITIALIZED"; case EGL_BAD_ACCESS: return "EGL_BAD_ACCESS"; case EGL_BAD_ALLOC: return "EGL_BAD_ALLOC"; case EGL_BAD_ATTRIBUTE: return "EGL_BAD_ATTRIBUTE"; case EGL_BAD_CONTEXT: return "EGL_BAD_CONTEXT"; case EGL_BAD_CONFIG: return "EGL_BAD_CONFIG"; case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE"; case EGL_BAD_DISPLAY: return "EGL_BAD_DISPLAY"; case EGL_BAD_SURFACE: return "EGL_BAD_SURFACE"; case EGL_BAD_MATCH: return "EGL_BAD_MATCH"; case EGL_BAD_PARAMETER: return "EGL_BAD_PARAMETER"; case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP"; case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW"; case EGL_CONTEXT_LOST: return "EGL_CONTEXT_LOST"; default: return "EGL_???"; } } WaylandEgl::WaylandEgl(QObject* parent ) { connect(this, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(handleWindowChanged(QQuickWindow*))); } void WaylandEgl::handleWindowChanged(QQuickWindow *win) { qDebug() << "function" << FUNCTION << "line " << LINE; if (win) { qDebug() << "function" << FUNCTION << "line " << LINE << "win" << win; connect(win, SIGNAL(afterRendering()), this, SLOT(paint()), Qt::DirectConnection); //connect(win, SIGNAL(beforeSynchronizing()), this, SLOT(sync()), Qt::DirectConnection); win->setClearBeforeRendering(false); mwindow = win; } } void WaylandEgl::paint() { qDebug() << "function" << FUNCTION << "line " << LINE << "win" << mwindow; performEglSetup(); } void WaylandEgl::sync() { qDebug() << "function" << FUNCTION << "line " << LINE; } void WaylandEgl::cleanup() { qDebug() << "function" << FUNCTION << "line " << LINE; } int WaylandEgl::performEglSetup() { QPlatformNativeInterface * nativeInterface = QGuiApplication::platformNativeInterface(); if (nativeInterface) { qDebug() << "App is running on:" << QGuiApplication::platformName() ; if (mwindow->handle()) { qDebug() << "Window:" << mwindow; qDebug() << "Window Surface Type:" << mwindow->surfaceType(); m_display = reinterpret_cast<EGLDisplay> (reinterpret_cast<void*>(nativeInterface->nativeResourceForIntegration("egldisplay"))); if (m_display) { qDebug() << "Egl Display is " << m_display; } else { qDebug() << "Egl Display not get"; //return -1; } QOpenGLContext * openglContext; if (mwindow->openglContext()) { qDebug() << "Opengl context " ; openglContext = mwindow->openglContext(); } else { qDebug() << "No openglt context"; openglContext = QOpenGLContext::currentContext(); qDebug() << "Open gl contex"<< openglContext; if (!openglContext) { openglContext = QOpenGLContext::globalShareContext(); qDebug() << "Open gl contex after null"<< openglContext; } } if (openglContext) { m_config = nativeInterface->nativeResourceForContext("eglconfig",openglContext); qDebug() << "EGL config" << m_config; m_context = nativeInterface->nativeResourceForContext("eglcontext", openglContext); qDebug() << "EGL eglcontext" << m_context; } else { qDebug() << "No opengl context"; return -1; } } else { qDebug() << "No Window sheet" ; return -1; } GLuint source; glGenRenderbuffers(1,&source); glBindRenderbuffer(GL_RENDERBUFFER, source); if (glGetError()==GL_NO_ERROR) { qDebug() << "Render buff storage is OK" << glGetError(); } else { qDebug() << "Render buff storage error is " << glGetError(); } if (glIsRenderbuffer(source)) { qDebug() << "Source is Render buffer"; } else { qDebug() << "Source is not Render buffer"; } glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, static_cast<GLsizei>(mwindow->width()), static_cast<GLsizei>(mwindow->height())); if (glGetError()==GL_NO_ERROR) { qDebug() << "Render buff storage is OK" << glGetError(); } else { qDebug() << "Render buff storage error is " << glGetError(); } GLint samples, format , width, height; glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, &samples); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_INTERNAL_FORMAT, &format); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height); qDebug() << "Buff width " << width; qDebug() << "Buff height " << height; qDebug() << "Buff format " << format; qDebug() << "Buff samples " << samples; GLuint framebuffer; glGenFramebuffers(1, &framebuffer); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, source); if (glGetError()==GL_NO_ERROR) { qDebug() << "Frame buff storage is OK" << glGetError(); } else { qDebug() << "Frame buff storage error is " << glGetError(); } GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); switch(status) { case GL_FRAMEBUFFER_COMPLETE: qDebug("Framebuffer verified complete."); break; case GL_FRAMEBUFFER_UNSUPPORTED: qDebug("GL_FRAMEBUFFER_UNSUPPORTED"); break; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: qDebug("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT "); break; default: qDebug("Other framebuffer error: %i", status); break; } glDeleteFramebuffers(1, &framebuffer); CreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR"); if (!CreateImageKHR) { qDebug() << "No image khr"; return -1; } EGLImageKHR image = CreateImageKHR(m_display, m_context, EGL_GL_RENDERBUFFER_KHR, reinterpret_cast<EGLClientBuffer>(source), nullptr); if (image == EGL_NO_IMAGE_KHR) { qDebug("failed to make image from target buffer: %s", get_egl_error()); return -1; } qDebug() << "Image is "<< image; glEGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, image); if (glGetError()==GL_NO_ERROR) { qDebug() << "glEGLImageTargetRenderbufferStorageOES buff is OK" << glGetError(); } else { qDebug() << "glEGLImageTargetRenderbufferStorageOES buff error is " << glGetError(); } } return 0; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// So at that point now I can successfully create EGLImageKHR image successfully. It seems to me it is a 2D array(do not have more information) but for now I could not find a way to create some .png file from it. Is there any idea how to manage it ? Regards
  • Render EGLImageKHR into QOpenGLFramebufferObject

    Solved
    4
    0 Votes
    4 Posts
    664 Views
    E
    Hello @zhangzheng , I tried to do similar example and having some trouble.I posted a question to : https://forum.qt.io/topic/122310/creating-eglimagekhr-image-from-render-buffer. Could you please check and lemme know if you have an idea ? Regards
  • @seyed: how too tilt the Map using this plugin

    Unsolved
    1
    0 Votes
    1 Posts
    144 Views
    No one has replied
  • Connection problem with secured WebSocket on embedded linux

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    KutyusK
    Hi! The same problem occurred to me in 5.11.3 framework, maybe there is a solution to it?
  • Android backbutton

    15
    2 Votes
    15 Posts
    33k Views
    K
    Does anyone know of a full example of an app that captures the back button? Maybe a github repo? None of these code snippets are working for me and I'm not sure why.
  • QT Virtual Keyboard compile errors

    Solved
    12
    0 Votes
    12 Posts
    2k Views
    SGaistS
    @madhug said in QT Virtual Keyboard compile errors: One last question. How can i use or run virtual keyboard. I did all above steps (make, make install). The use of Qt Virtual Keyboard is explained here.
  • why my dynamic label text get overlap ? what i need to do avoid this?

    Solved
    5
    0 Votes
    5 Posts
    904 Views
    sierdzioS
    That sounds like a very wasteful approach... If you need a label there, just insert it upfront. If it does not need to be visible - hide it. If it needs to be visible - show it. If it's text needs to be changed, call setText() in your slot. There is no need to keep adding/ deleting labels, or clearing a global one etc.
  • why i am not able to see text data on dynamic label ?

    Solved
    6
    0 Votes
    6 Posts
    488 Views
    sierdzioS
    @Qt-embedded-developer said in why i am not able to see text data on dynamic label ?: when i wrote below part in constructor it shows label data without label->show() why this happen ? Because then your Widget already has this label created when you call Widget->show() elsewhere in your code.
  • how to handel multiple touch event on Qscroller ?

    Solved
    4
    0 Votes
    4 Posts
    480 Views
    Q
    @Qt-embedded-developer below code helped me to avoid multi touch while scroll QScrollerProperties qScrollerProperties; QVariant overshootPolicy = QVariant::fromValueQScrollerProperties::OvershootPolicy(QScrollerProperties::OvershootAlwaysOff); qScrollerProperties.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, overshootPolicy); QScroller* qScroller = QScroller::scroller(ui->treeWidgetSession); qScroller->grabGesture(ui->treeWidgetSession, QScroller::LeftMouseButtonGesture); qScroller->setScrollerProperties(qScrollerProperties);
  • when Z-order assignment Warning comes ?

    Unsolved
    5
    0 Votes
    5 Posts
    723 Views
    Q
    @jsulm no
  • How to handle set reset event using qt ?

    Solved
    4
    0 Votes
    4 Posts
    486 Views
    Q
    @SGaist 1] i2c read give status charger connected or not 2] they come from fuel gauge ic of my board
  • Qt virtual keyboard for embedded linuxfb backend

    Unsolved
    1
    0 Votes
    1 Posts
    299 Views
    No one has replied
  • Apk Build Failure

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    N
    I solved this problem. I was delete the android folder and remake this folder with the CREATE TEMPLATE button from Project->Multi-Api->Build APK section. The problem is because a deprecated xml file of the other API, for example android/res/.xml or android/libs/.xml. The CREATE TEMPLATES button make a correct android folder. I was copy only the icons folder into the folder android/res of my previus compilers and when i pressed the compiles button all running correct. PD: Into the Build Apk section i was checked the BUILD BUNDLE .AAB FILE and OPEN THE FOLDER BUILD. This bundle file is aceptted for the Google Play Store with the valid ABIS too checked in the QMAKE/CMAKE compiler options. All running very good!!.