Skip to content

Mobile and Embedded

The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
14.0k Topics 62.0k Posts
  • QT Creator fails to download Android SDKs [Ubuntu 24.10]

    Solved
    3
    0 Votes
    3 Posts
    184 Views
    D

    SOLVED: I had to type this command:
    sudo chmod $USER:$USER $ANDROID_SDK_ROOT
    I hope this will help unfortunate people like me, who couldn't figure this out for days or even months.

  • Failed to Call java function from C++ on Android

    Solved
    10
    0 Votes
    10 Posts
    908 Views
    A

    @jsulm , Thank you so much. Now I understood. You got a new follower now.

  • 0 Votes
    1 Posts
    139 Views
    No one has replied
  • 0 Votes
    2 Posts
    204 Views
    LucasYuenL

    I have resolved the issue, as the /usr/share directory was not included in the sysroot.

  • How to use relative path on SQLite .db file on iOS

    Solved
    19
    0 Votes
    19 Posts
    730 Views
    K

    Here is the same code using appDataLocation

    void DatabaseManager::OpenConnection() { // Configure the database connection parameters for SQLite m_db = QSqlDatabase::addDatabase("QSQLITE"); // Use QStandardPaths to get the application data location QString dbName = "identifier.sqlite"; QString dbLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); QString fullDbPath = dbLocation + "/" + dbName; QDir dbDir(dbLocation); if (!dbDir.exists()) { if (dbDir.mkpath(dbLocation)) { qDebug() << "Created application data directory:" << dbLocation; } else { qDebug() << "Failed to create application data directory:" << dbLocation; return; // Exit if the directory cannot be created } } // Set the SQLite database file location m_db.setDatabaseName(fullDbPath); // Check if the database file exists in the application data location if (!QFile::exists(fullDbPath)) { qDebug() << "Database does not exist in AppDataLocation, copying from resources."; // Path to the resource database file QString resourceDbPath = ":/resources/identifier.sqlite"; // Adjust the path to your resource file // Attempt to copy the database from resources to the writable location if (QFile::copy(resourceDbPath, fullDbPath)) { qDebug() << "Database copied successfully to AppDataLocation."; // Set file permissions to writable (necessary for some platforms) QFile::setPermissions(fullDbPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner); } else { qDebug() << "Failed to copy database from resources."; return; // Exit if the database cannot be copied } } // Open the database connection and handle success or failure if (m_db.open()) { qDebug() << "Database opened successfully."; // Sample query to verify the database contents } else { // Handle connection error qDebug() << "Database failed to open."; qDebug() << m_db.lastError().text(); } }
  • Qt 6.8.0 - Replacement for QtNative.activity()

    Solved
    5
    0 Votes
    5 Posts
    600 Views
    NaLogoN

    My workaround for the time being is as follows:

    Construct the Java class when the related C++ class is constructed Set Activity for the class Call static methods like before

    Java:

    private static Activity m_activity = null; public void setActivity(Activity activity) { m_activity = activity; return; }

    also change all methods that previously called QtNative.activity() to now check for and use m_activity instead.

    C++:

    mJNIInstance = QJniObject("the/qualified/ClassPath"); if (mJNIInstance.isValid()) { mJNIInstance.callMethod<void>("setActivity", "(Landroid/app/Activity;)V", QNativeInterface::QAndroidApplication::context().object()); } else { // output a warning or error }
  • Xcode build fails for ios 17.6

    Solved
    5
    0 Votes
    5 Posts
    329 Views
    K

    I needed to add developer mode and trust the developer on my iphone

  • Socketcan , Qt, Instrument Cluster

    Unsolved
    2
    0 Votes
    2 Posts
    153 Views
    aha_1980A

    @Qreator35 Are you aware of Qt's CAN support?

  • 0 Votes
    3 Posts
    187 Views
    D

    Hi, jsulm,

    Thanks for your reply.

    Yeap, I want the app to always stay on top.
    Because the Android system have a Activate Window always on the top of the screen.
    My program app must be in front of the Activate Window. And I must.
    I implemented a demo in Android Studio by using TYPE_SYSTEM_ALERT to on the top.
    But my full program is implemented using Qt.

    Need your advice.
    Daniel

  • Show Qt layout from Android (Dream)Service?

    Unsolved
    2
    0 Votes
    2 Posts
    252 Views
    D

    Hi, AnQuter,

    Is your question solved?
    // setContentView(R.layout.dream); - how to use Qt app layout?

    How can I load Qt mainwindow.ui in java code?
    Thanks a lot.

  • 0 Votes
    2 Posts
    125 Views
    SGaistS

    Hi and welcome to devnet,

    From the looks of it, no there's nothing directly in Qt for that.
    You should take a look at the bug report system to see if there's something related to that.

  • 0 Votes
    4 Posts
    229 Views
    K

    I am now facing a problem with NetworkAuth and WebAssembly. I opened another request but got left behind
    https://forum.qt.io/topic/159704/how-to-install-qtnetworkauth-for-webassemby/8?_=1732390034893

  • 0 Votes
    1 Posts
    75 Views
    No one has replied
  • 0 Votes
    3 Posts
    367 Views
    N

    Just as I posted that I found a workaround, but I would still like to know how to correct this.

    For those that are having the same issue and just "want it done" here's what I did: On a fresh bitbake run, when gn-native failed, it showed me the command-line that it ran, which looked something like this:

    cd /home/aaron/yocto/build-raspberrypi-armv8/tmp/work/x86_64-linux/gn-native/6.8.0/build && /home/aaron/yocto/build-raspberrypi-armv8/tmp/work/x86_64-linux/gn-native/6.8.0/recipe-sysroot-native/usr/bin/python3-native/python3 /home/aaron/yocto/build-raspberrypi-armv8/tmp/work/x86_64-linux/gn-native/6.8.0/git/src/3rdparty/gn/build/gen.py --no-last-commit-position --out-path /home/aaron/yocto/build-raspberrypi-armv8/tmp/work/x86_64-linux/gn-native/6.8.0/build/ --cc /home/aaron/yocto/build-raspberrypi-armv8/tmp/hosttools/gcc --cxx /home/aaron/yocto/build-raspberrypi-armv8/tmp/hosttools/g++ --ld /home/aaron/yocto/build-raspberrypi-armv8/tmp/hosttools/g++ --platform linux --ar /home/aaron/yocto/sources/poky/scripts/native-intercept/ar --qt-version 6.8.0.qtwebengine.qt.io && /home/aaron/yocto/build-raspberrypi-armv8/tmp/work/x86_64-linux/gn-native/6.8.0/recipe-sysroot-native/usr/bin/ninja -C /home/aaron/yocto/build-raspberrypi-armv8/tmp/work/x86_64-linux/gn-native/6.8.0/build/ gn

    Right around where it says gen.py notice there's a bunch of flags: --no-commit-position --out-path etc. Somewhere in those flags, add --allow-warnings and re-run that command. gn-native will (hopefully) build successfully, with warnings, and you will be able to proceed with your Yocto build.

  • Blue drop on android with QComboBox using

    Unsolved
    5
    0 Votes
    5 Posts
    618 Views
    P

    Here is my Solve:

    class AndroidItemModel : public QStandardItemModel {
    Q_OBJECT
    public:
    AndroidItemModel(QObject *parent = nullptr): QStandardItemModel(parent) {}
    Qt::ItemFlags flags(const QModelIndex &index) const override {
    if (!index.isValid()) {return Qt::NoItemFlags;}
    return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
    }
    };

    QComboBox * cb = new QComboBox();
    cb ->setModel(new AndroidItemModel());

  • 0 Votes
    4 Posts
    217 Views
    B

    I'm very sorry that I've been busy before.,So I didn't come back to reply.,Then I've found the problem.,Now I'm back to answer the question I hope it can help you.,The main reason is that the default frame rate of my device's camera is the lowest, resulting in the number of frames being too low to cause Caton.,So I increased the number of frames to get it solved.

    void ThreadGetCamPic::run() { bool ret = stVideoCaptrue.open(0); //The code in the horizontal line is currently known to be only valid for the RK35xx series cameras, if there is a problem with the camera turned on, it should be here, just comment it out, and it is also the reason to solve the freeze of the camera acquisition screen /*---------------------------------------------------------------------------------*/ // stVideoCaptrue.set(cv::CAP_PROP_FRAME_WIDTH, 800); // stVideoCaptrue.set(cv::CAP_PROP_FRAME_HEIGHT, 600); // stVideoCaptrue.set(cv::CAP_PROP_FPS, 20); /*---------------------------------------------------------------------------------*/ Mat matTemp; // QImage img; m_bStop = false; while(!m_bStop){ stVideoCaptrue&gt;&gt;matTemp; if(matTemp.empty()){ msleep(50); continue; } img = QImage(matTemp.data,matTemp.cols,matTemp.rows,matTemp.step,QImage::Format_RGB888).copy(); img = convertRGB888toBGR888UsingOpenCV(img); emit sigSendCurImg(img); } }
  • 0 Votes
    7 Posts
    306 Views
    V

    @jsulm ,

    Got it,
    I will check it first
    Very Appreciate your help

  • Free QT usage on embedded devices?

    Unsolved
    8
    0 Votes
    8 Posts
    337 Views
    J.HilkJ

    This is not legal advice. But I can tell you an anecdotal story from my previous company I worked for.

    The company produced heavy duty machines that could, for a better user experience, be equipped with a of the shelf android tablet and a custom app made in Qt.

    We used to own a normal commercial licence there and developed that app with that licence. After some years during a renewal process, the QtC decided that this was an embedded device since the tablet was sold/shipped with the app preinstalled and would like money for each sold unit.

    The end of the story is, the mechanic setting the machine up now has to do the extra step of connecting the tablet to the internet, getting the app from the Appstore and than placing it back into the machine.

    Oh, and the company startet to transition away from Qt.

  • STILL unable to deploy/run on Android

    Unsolved
    11
    0 Votes
    11 Posts
    463 Views
    mzimmersM

    It compiles for me, too, but it doesn’t run.

  • Qt for Batocera

    Unsolved
    1
    0 Votes
    1 Posts
    117 Views
    No one has replied