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
  • QT ImagePicker using JNI

    jni android image
    3
    0 Votes
    3 Posts
    3k Views
    benlauB
    The next version of QuickAndroid will come with a Image Picker using native code. You may use it directly or just check learn how its handle image picking. In fact, it is a bit troublesome to do it in Android. There has several way of passing image data. (e.g clip data, content url , file url). It depends on the photo application. quickandroid/ImagePicker.java at DEV · benlau/quickandroid quickandroid/ImagePicker.qml at DEV · benlau/quickandroid p.s Daily build of apk with image picker is available at : Downloads | quickandroid
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • Qt5 on BeagleBone: windows have no title and border

    8
    0 Votes
    8 Posts
    5k Views
    K
    I am using the same setup (BeagleBone Black with eglfs2, QT5.5) and found another solution that might work depending on how you want the title presented. In my case, the QT project is a customized touchscreen-only app that does need the classic window looking frame. I found out if I use QMessageBox::setText() it puts the text to the right of the icon. If I use QMessageBox::setInformativeText() it places the text in the center of the window as expected. QMessageBox::setWindowTitle() never shows up. So I wrote a derived class and overrode setWindowTitle() to call setText(). Made sure it was setup for Qt::AutoText so I could center and bold the title. I also overrode the static information, critical, question and alert methods so I wouldn't have to modify (too much) existing code written for qt 4.X. Source: MessageBox::MessageBox(QWidget *parent) : QMessageBox(parent) { setTextFormat(Qt::AutoText); } MessageBox::~MessageBox() { } void MessageBox::setWindowTitle(QString titleStr) { setText("<center><b>" + titleStr + "</b></center>"); } MessageBox::StandardButton MessageBox::messageBox(QWidget *parent, const QString &title, const QString &text, MessageBox::StandardButtons buttons, MessageBox::StandardButton defaultButton, QMessageBox::Icon icon) { MessageBox msgBox(parent); msgBox.setWindowTitle(title); msgBox.setInformativeText(text); msgBox.setIcon(icon); msgBox.setStandardButtons(buttons); msgBox.setDefaultButton(defaultButton); if (msgBox.exec() == -1) return QMessageBox::Cancel; return msgBox.standardButton(msgBox.clickedButton()); } MessageBox::StandardButton MessageBox::information(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) { return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Information); } MessageBox::StandardButton MessageBox::question(QWidget *parent, const QString &title, const QString &text,MessageBox::StandardButtons buttons,MessageBox::StandardButton defaultButton) { return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Question); } MessageBox::StandardButton MessageBox::warning(QWidget *parent, const QString &title, const QString &text,MessageBox::StandardButtons buttons,MessageBox::StandardButton defaultButton) { return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Warning); } MessageBox::StandardButton MessageBox::critical(QWidget *parent, const QString &title, const QString &text,MessageBox::StandardButtons buttons,MessageBox::StandardButton defaultButton) { return messageBox(parent, title, text, buttons, defaultButton, QMessageBox::Critical); } Header: class MessageBox : public QMessageBox { public: MessageBox(QWidget *parent = NULL); ~MessageBox(); void setWindowTitle(QString titleStr); static MessageBox::StandardButton information(QWidget *parent, const QString &title, const QString &text, MessageBox::StandardButtons buttons = Ok, MessageBox::StandardButton defaultButton = NoButton); static MessageBox::StandardButton question(QWidget *parent, const QString &title, const QString &text, MessageBox::StandardButtons buttons = MessageBox::StandardButtons(Yes | No), MessageBox::StandardButton defaultButton = NoButton); static MessageBox::StandardButton warning(QWidget *parent, const QString &title, const QString &text, MessageBox::StandardButtons buttons = Ok, MessageBox::StandardButton defaultButton = NoButton); static MessageBox::StandardButton critical(QWidget *parent, const QString &title, const QString &text, MessageBox::StandardButtons buttons = Ok, MessageBox::StandardButton defaultButton = NoButton); private: static MessageBox::StandardButton messageBox(QWidget *parent, const QString &title, const QString &text, MessageBox::StandardButtons buttons, MessageBox::StandardButton defaultButton, QMessageBox::Icon icon); };
  • Android app based on QMainWindow fails to restart

    2
    0 Votes
    2 Posts
    1k Views
    S
    More info - It appears that this is unique to pyqtdeploy code and not a generic QT issue. If I try and of the example applications they stop and start OK. If I try anything with python it does not. I can see that the jave code QtNative.finish() is called from the native code after the native code has returned with exit code 0. After this The activity calls finish. At some point later QtApplication.invokeDelegateMethod() makes a call to the QtActivityDelegate.OnPause handler, which calls QtNative.updateApplicationState(2); which never returns......Is this because the native thread is no more? As a workaround I've overloaded finish within QtActivity.java @Override public void finish() { super.finish(); /* force kill the app */ android.os.Process.killProcess(android.os.Process.myPid()); } Any suggestions on a real fix would be welcome.
  • Sysroot in QT4

    1
    0 Votes
    1 Posts
    641 Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    J
    So I finally found a part in the documentation saying: PRE_TARGETDEPS Lists libraries that the target depends on. Some backends, such as the generators for Visual Studio and Xcode project files, do not support this variable. Generally, this variable is supported internally by these build tools, and it is useful for explicitly listing dependent static libraries. Apparently I have to include the lib manually in the .xcodeproj file. That worked, but isn't Add Library... supposed to add the necessary commands to the .pro file?
  • Touch don't works in QT5 desktop

    touch
    1
    0 Votes
    1 Posts
    661 Views
    No one has replied
  • This topic is deleted!

    Locked
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • This topic is deleted!

    Locked
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • This topic is deleted!

    Locked
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • This topic is deleted!

    Locked
    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • display Transformed:Rot180 changes colors

    2
    0 Votes
    2 Posts
    935 Views
    D
    Hi, sorry replying kind of late and with vague answer, but anyway: we had similar issues on a system with Vybrid vf610 processor and Timesys Factory Linux build - Qt 4.8.5. The colours were swapped in the same way for rotated display with 24 bits, so we switched to 16-bit (also for performance reasons, the difference is significant). But recently I have found this patch from Timesys, which seems to be addressing this issue for Vybrid framebuffer (didn't need to try in now, though). Maybe it could point you in the right direction. diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenl inuxfb_qws.cpp index 91f1207..d4453ed 100644 --- a/src/gui/embedded/qscreenlinuxfb_qws.cpp +++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp @@ -306,7 +306,6 @@ bool QLinuxFbScreen::connect(const QString &displaySpec) #endif QScreen::setFrameBufferLittleEndian(true); #endif - QString dev = QLatin1String("/dev/fb0"); foreach(QString d, args) { if (d.startsWith(QLatin1Char('/'))) { @@ -1312,10 +1311,17 @@ void QLinuxFbScreen::setPixelFormat(struct fb_var_screen info info) break; } case 24: { + /* + This is modified for Vybrid framebuffer (rgb and bgr swi tched) const fb_bitfield rgb888[4] = {{16, 8, 0}, {8, 8, 0}, {0, 8, 0}, {0, 0, 0}}; const fb_bitfield bgr888[4] = {{0, 8, 0}, {8, 8, 0}, {16, 8, 0}, {0, 0, 0}}; + */ + const fb_bitfield bgr888[4] = {{16, 8, 0}, {8, 8, 0}, + {0, 8, 0}, {0, 0, 0}}; + const fb_bitfield rgb888[4] = {{0, 8, 0}, {8, 8, 0}, + {16, 8, 0}, {0, 0, 0}}; if (memcmp(rgba, rgb888, 3 * sizeof(fb_bitfield)) == 0) { format = QImage::Format_RGB888; } else if (memcmp(rgba, bgr888, 3 * sizeof(fb_bitfield)) == 0) { D.W.
  • Clear Android Bluetooth cache

    bluetooth low e bluetooth android
    2
    0 Votes
    2 Posts
    2k Views
    K
    Maybe you should just do bluetooth turn off/on programmaticaly from your app, before using of an BLE.
  • Telephony Manager Device Id Access from Qt

    android telepho
    2
    0 Votes
    2 Posts
    773 Views
    SGaistS
    Hi, From a quick look to Android's API, would QtAndroidExtras' JNI + TelephonyManager do the trick ?
  • Graphics Glitch - IMX6 Qt5.2

    1
    0 Votes
    1 Posts
    406 Views
    No one has replied
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] Qt Raspi : Segmentation fault in paint function

    4
    0 Votes
    4 Posts
    1k Views
    A
    @SGaist Thanks ... The case you mentioned was my problem. It is solved by using copy() of QImage. :)
  • ios ipad grid flicker when dragging

    ios ipad grid d
    1
    0 Votes
    1 Posts
    340 Views
    No one has replied
  • 0 Votes
    4 Posts
    5k Views
    Chris KawaC
    Qt has a bug! I would not jump to such conclusions right away. It sounds like your application does not terminate correctly. The methods you describe to "solve the problem" don't really solve it. You're just killing your app process this way. You should focus on fixing the app so that it really closes instead of just hiding the window. If you close its window and the process in the task manager is still there that's a bug in your program, not in Qt.
  • [Solved] iOS, xCode 7 and Qt

    xcode
    9
    0 Votes
    9 Posts
    4k Views
    mrdebugM
    Solved by upgrading Qt Creator to 3.5.0 Many thanks.