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
  • Embedded linux Qt object question

    8
    0 Votes
    8 Posts
    2k Views
    P
    Hello, After my last post I did some coding and would like some comment if this the correct way. I have made 3 widget forms. Named: formOne, formTwo, formThree. On every .ui form I added a listwidget. Which is disabled, because I use a key event to select the items. In the example code, somethings are not there for space savings.. ------------------------------------------------------------------ File: formone.h #include <QWidget> #include <QKeyEvent> #include "formtwo.h" class FromOne : public QWidget { Q_OBJECT public explicit FormOne(QWidget *parent = 0); ~FormOne(); private slots: void myShow(); private: Ui::FormOne *ui; bool event(QEvent *event); void loadItems(); void focusItem(QListWidgetItem *item); }; File: formeone.cpp #include "formone.h" .. FormOne::FormOne(Widget *parent) : QWidget(parent), ui(new Ui::FormOne) { ui->setupUI(this); this->loadItems; } //Private slot void FormOne::myShow() { this->loadItems(); this->setFocus(); this->show(); } void FormOne::focusItem(QlistWidget *item) { if(item->text() == "FormTwo") { FormTwo * fromtwo = new FormTwo; formtwo->setAttribute(Qt::WA_DeleteOnClose); formtwo->setFocus(); formtwo->show(); connect(formtwo, SIGNAL(destroyed(Object *)), this, SLOT(myShow())); } } void FormOne::loadItems() { QListWidgetItem *item; if(ui->listWidget->count() > 0) ui->listWidget->clear(); item = new QListWidgetItem item->setText("FormTwo"); ui->listWidget->additem(item); item = new QListWidgetItem item->setText("Nothing"); ui->listWidget->additem(item); ui->listWidget->setCurrentRow(0); } bool FormOne::event(QEvent *event) { QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); int index=0, size=0; if(event->type() != QEvent::KeyRelease) return QWidget::event(event); switch(keyEvent->key()) { case Qt::Key_N: index = ui->listWidget->currentRow(); size = ui->listWidget->count(); if(index < (size-1)) index++; else index = 0; ui->listWidget->setCurrentRow(index); break; case Qt::Key_O: this->focusItem(ui->listWidget->currentItem()); break; default: break; return QWidget::event(event); } ------------------------------------------------------------------ File: formtwo.h #include <QWidget> #include <QKeyEvent> #include "formthree.h" class FormTwo: public QWidget { Q_OBJECT public explicit FormTwo(QWidget *parent = 0); ~FormTwo(); private slots: void myShow(); private: Ui::FromTwo *ui; bool event(QEvent *event); void loadItems(); void focusItem(QListWidgetItem *item); }; File: formtwo.cpp #include "formtwo.h" .. FormTwo::FormTwo(Widget *parent) : QWidget(parent), ui(new Ui::FromTwo ) { ui->setupUI(this); this->loadItems; } //Private slot void FormTwo::myShow() { this->loadItems(); this->setFocus(); this->show(); } void FormTwo::focusItem(QlistWidget *item) { if(item->text() == "FormThree") { FormThree* formthree= new FormThree; formthree->setAttribute(Qt::WA_DeleteOnClose); formthree->setFocus(); formthree->show(); connect(formthree, SIGNAL(destroyed(Object *)), this, SLOT(myShow())); this->hide(); //hide form two } } void FormTwo::loadItems() { QListWidgetItem *item; if(ui->listWidget->count() > 0) ui->listWidget->clear(); item = new QListWidgetItem item->setText("FormThree"); ui->listWidget->additem(item); item = new QListWidgetItem item->setText("Nothing"); ui->listWidget->additem(item); ui->listWidget->setCurrentRow(0); } bool FormTwo::event(QEvent *event) { QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); int index=0, size=0; if(event->type() != QEvent::KeyRelease) return QWidget::event(event); switch(keyEvent->key()) { case Qt::Key_N: index = ui->listWidget->currentRow(); size = ui->listWidget->count(); if(index < (size-1)) index++; else index = 0; ui->listWidget->setCurrentRow(index); break; case Qt::Key_O: this->focusItem(ui->listWidget->currentItem()); break; case Qt::key_E; this->close(); break; default: break; return QWidget::event(event); } ---------------------------------------------------------- File: formthree.h #include <QWidget> #include <QKeyEvent> class FormThree: public QWidget { Q_OBJECT public explicit FormThree(QWidget *parent = 0); ~FormThree(); private: Ui::FormThree*ui; bool event(QEvent *event); void loadItems(); void focusItem(QListWidgetItem *item); }; File: formthree.cpp #include "formthree.h" .. FormThree::FormThree(Widget *parent) : QWidget(parent), ui(new Ui::FormOne) { ui->setupUI(this); this->loadItems; } void FormThree::focusItem(QlistWidget *item) { if(item->text() == "DoSomething") { .. do something.. } } void FormThree::loadItems() { QListWidgetItem *item; if(ui->listWidget->count() > 0) ui->listWidget->clear(); item = new QListWidgetItem item->setText("DoSomething"); ui->listWidget->additem(item); item = new QListWidgetItem item->setText("Nothing"); ui->listWidget->additem(item); ui->listWidget->setCurrentRow(0); } bool FormThree::event(QEvent *event) { QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); int index=0, size=0; if(event->type() != QEvent::KeyRelease) return QWidget::event(event); switch(keyEvent->key()) { case Qt::Key_N: index = ui->listWidget->currentRow(); size = ui->listWidget->count(); if(index < (size-1)) index++; else index = 0; ui->listWidget->setCurrentRow(index); break; case Qt::Key_O: this->focusItem(ui->listWidget->currentItem()); break; case Qt::key_E; this->close(); break; default: break; return QWidget::event(event); } Is this the way how I canopen and closes forms? Thanks in advance..
  • Qt Embedded linux License costing

    2
    0 Votes
    2 Posts
    647 Views
    K
    @harshavardhan Hi and welcome to devnet This is the open source forum. For questions concerning the licenses you need to contact digia directly.
  • 0 Votes
    5 Posts
    2k Views
    T
    @LouisRyan Hello Louis, I'm using Qt 5.4 . Have you looked at the OpenGL on the BBB? There are two routes to try with BBB development: the community open source project or the TI SDK. Both of them are Linux. The TI SDK gives a nice accelerated development environment for Qt -- their focus is Qt. No need for X. Up until a year ago, you could not use their kernel for LCD's -- it only supported HDMI displays. The issue had to do with TI using an older Linux kernel and lack of support for the "device overlay" feature. I think that issue has since been resolved, though I have not tried it. I can give you download links on TI's site if needed. You can find them on google if you know what you are looking for -- but be careful with old information. Anything older than a year is likely obsolete. I think TI calls it their "Easy Linux SDK". I don't know the status of OpenGL acceleration in the community open source code. Turns out the OpenGL is nice to have, but not entirely necessary either. Cheers Tim
  • Licensing Question

    licensing license mobile
    4
    0 Votes
    4 Posts
    2k Views
    A
    Thanks, I will speak to them soon, the indie license seems promising but I wish they had QtTranasactions ;/, oh well, my new problem is Qt fails to compile my APK, something dealing with java but I don't know much about java, and the console isn't helping me much.
  • Android app deployment failed

    2
    1 Votes
    2 Posts
    2k Views
    uCampaignU
    An update, i do not have readlink on my Samsung S3 phone, it still running 4.1 I found that this commit is the reason: https://github.com/qtproject/qt-creator/commit/81c798930170a88076abd23c5001c91596fab7ab Well, i can changed the QTC(i use modified version anyway with advanced QML/JS outline patch) or somehow install readlink to my phone.
  • iOS not loading some images from the network

    1
    0 Votes
    1 Posts
    291 Views
    No one has replied
  • [Solved] Cannot compile application for iOS simulator on OS X Yosemite

    4
    0 Votes
    4 Posts
    1k Views
    N
    Hi ! I got the same problem but i need declarative, if i simply remove it i have (of course) a lot of undefined symbols. Any Solution for that case ? Greetings, Nils
  • How to add new library to an existing library in qt [Solved]

    9
    0 Votes
    9 Posts
    2k Views
    I
    This is my solution. after I added -qt-mouse-tslib to my configure as I put it in last comment (with title New configuration) and scp entire lib to BBB, I setup my tslib environment and after I calbrated it everything is working. I will put my full steps when I get chance. Thank you Iman
  • QImage::load() returning NULL in embedded qt

    10
    0 Votes
    10 Posts
    3k Views
    K
    @SGaist I think my embedded build qconfig had the macro QT_NO_IMAGEFORMAT_BMP defined. Trying to build the Qt libraries after undefining the macro.
  • Be sure of the creation of an object

    qt5.4.1 qobject
    10
    0 Votes
    10 Posts
    4k Views
    N
    Thanks every body, I'm developing, a Bluetooth application. The bluetooth trames reception should manage the display, and I would like to be sure that nothing is forgotten. So when I receive a Bluetooth trame (after a request), I send an acknowledgement with checksum, and I send an other request when I finish the treatment of this trame. That's why I would like to be sure that the objects are created, to avoid error because of the modification of an object that does not exist.
  • EOF in backquote substitution error when building app

    make backquote
    2
    0 Votes
    2 Posts
    2k Views
    Chris KawaC
    Hi, welcome to devnet. The error is about the ` after DQT_DISABLE_DEPRECATED_BEFORE=0x000000 It doesn't look like it should be there, but I don't know how it got there in your setup.
  • 0 Votes
    1 Posts
    684 Views
    No one has replied
  • psql detect wrong path if cross compiling?

    2
    0 Votes
    2 Posts
    535 Views
    SGaistS
    Hi, Did you install the PostgreSQL dev package on your Raspberry Pi ?
  • State Transition Problem

    state sliding trasition easing loader qml
    4
    0 Votes
    4 Posts
    2k Views
    p3c0P
    @Maxim-DC Yes it is possible. You can find an example here. The exact file in it where it is used.
  • Problem of QT5.3.2 with X11's EGL

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    SGaistS
    Hi and welcome to devnet, Did you try with QCamera and it's friendly classes ?
  • How to get EGLNativeWindowType* handle of QWidget (Android)

    2
    0 Votes
    2 Posts
    2k Views
    W
    Could you say if you found some solution?
  • Qml camera android

    camera qml android
    1
    0 Votes
    1 Posts
    837 Views
    No one has replied
  • Qt Android application running in background

    3
    0 Votes
    3 Posts
    1k Views
    S
    And how can I put the activity in the background? If I overwrite closeEvent(QCloseEvent *) what should I write inside in order to make the application run in the background?
  • Remote debug on i.mx6

    remote debuggin signal sigill qt 5.2.1 i.mx6
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied