Solved 'QInputDialog' has not been declared - embadded development
-
Hi @ambershark,
Following are the permissions:
gmx@GMX-SDK:~$ ls -l /usr/include/qt4/QtGui/QInputDialog -rw-r--r-- 1 root root 26 Apr 26 2012 /usr/include/qt4/QtGui/QInputDialog gmx@GMX-SDK:~$ gmx@GMX-SDK:~$ gmx@GMX-SDK:~$ gmx@GMX-SDK:~$ gmx@GMX-SDK:~$ ls -l /opt/toolchain/arm-unknown-linux-gnueabi/sysroot/usr/QtopiaSDK/qtopiacore/target/include/QtGui/QInputDialog -rw-r--r-- 1 root root 26 Jun 7 2013 /opt/toolchain/arm-unknown-linux-gnueabi/sysroot/usr/QtopiaSDK/qtopiacore/target/include/QtGui/QInputDialog gmx@GMX-SDK:~$ gmx@GMX-SDK:~$ gmx@GMX-SDK:~$ gmx@GMX-SDK:~$ ls -l /opt/toolchain/arm-unknown-linux-gnueabi/sysroot/usr/QtopiaSDK/qtopiacore/host/include/QtGui/QInputDialog -rw-r--r-- 1 root root 26 Jun 7 2013 /opt/toolchain/arm-unknown-linux-gnueabi/sysroot/usr/QtopiaSDK/qtopiacore/host/include/QtGui/QInputDialog gmx@GMX-SDK:~$ gmx@GMX-SDK:~$
qmake -query results:
gmx@GMX-SDK:~$ qmake -query QT_INSTALL_PREFIX:/usr QT_INSTALL_DATA:/usr/share/qt4 QT_INSTALL_DOCS:/usr/share/qt4/doc QT_INSTALL_HEADERS:/usr/include/qt4 QT_INSTALL_LIBS:/usr/lib/x86_64-linux-gnu QT_INSTALL_BINS:/usr/bin QT_INSTALL_PLUGINS:/usr/lib/x86_64-linux-gnu/qt4/plugins QT_INSTALL_IMPORTS:/usr/lib/x86_64-linux-gnu/qt4/imports QT_INSTALL_TRANSLATIONS:/usr/share/qt4/translations QT_INSTALL_CONFIGURATION:/etc/xdg QT_INSTALL_EXAMPLES:/usr/lib/qt4/examples QT_INSTALL_DEMOS:/usr/lib/qt4/demos QMAKE_MKSPECS:/usr/share/qt4/mkspecs QMAKE_VERSION:2.01a QT_VERSION:4.8.2 gmx@GMX-SDK:~$
Let me try with simple project as you suggested.
Thanks
-
Hi @ambershark,
I altered device vendor's sample gui application, comment all widgets and widget-items. Added the code available in qt documentation to test QInoutDialog:getItem.
Still same error.Thanks
-
Hi @Kashif,
I got the following reply from my device vendor:
I checked on our SDK and QInputDialog is disabled from the toolchain by default in the QtExtended from qtopia, you can look at http://doc.qt.io/archives/qt-4.8 and look for an alternative. the list of disabled elements by qtopia can be found at /opt/toolchain/arm-unknown-linux-gnueabi/sysroot/usr/QtopiaSDK/qtopiacore/qconfig-qpe.h in your toolchain
Can you please suggest an approach to achieve my target:
0> User have Purchase Ticket / Refund Ticket options 1> User selects purchase ticket 2> Application lists types of tickets a> User Selects ticket or cancel (until completion/user selection step 3 should not execute) 3> Do purchase process or exit purchase process
Thanks
-
-
@Kashif said in 'QInputDialog' has not been declared - embadded development:
is disabled from the toolchain by default in the QtExtended from qtopia
Well that makes a lot more sense. :)
Like @SGaist said, just write your own QDialog. Make it modal by calling it with
myDialog->exec()
and test that return code for aQDialog::Accepted
in order to proceed orQDialog::Rejected
in order to exit the process. -
Hi @SGaist and @ambershark,
I am planned to create custom dialog using QDialog class, in parallel I have placed a question to device vendor if I can use QDialog? or if I can use QTCore application. I hope I'll get positive reply for at least one of them.
Thanks for your time and response.
-
@Kashif If you can't use QDialog, there are other ways to simulate it, getting user input from a qwidget and not allowed it to proceed until your widget is closed.
And if you can't use qwidgets, well then you don't really have a gui and none of this matters. :)
-
Hi @ambershark,
PreviouslyI have created secondary widget and called it but my parent widget code was also running this was the reason I moved towards QDialog.
The good new is I have created a custom sample dialog class and it is working as required. Now I have to make it similar to QInputDialog. Following is the code from my custom dialog class:#ifndef APPSELECTIONDIALOG_H #define APPSELECTIONDIALOG_H #include <QtGui/QDialog> #include <QtGui/QVBoxLayout> #include <QtGui/QLineEdit> #include <QtGui/QPushButton> //#include <QtGui/QLabel> class appSelectionDialog: public QDialog { Q_OBJECT public: explicit appSelectionDialog(QWidget *p = 0): QDialog(p) { QVBoxLayout *layout = new QVBoxLayout(this); lineEdit = new QLineEdit(this); QPushButton *button = new QPushButton("Ok", this); layout->addWidget(lineEdit); layout->addWidget(button); setLayout(layout); connect(button, SIGNAL(clicked()), SLOT(accept())); } QString getText() const { return lineEdit->text(); } private: QLineEdit *lineEdit; }; #endif // APPSELECTIONDIALOG_H
Calling function:
appSelectionDialog dialog; // dialog object exists (void) dialog.exec(); // dialog is visible DBGPRINTF(LOG_INFO, CLASS_EMV,"Text [%s]", dialog.getText().toLocal8Bit().constData() ); //This method prints the text on console in c format
If you have reference to make it similar to QInputDialog please share it :)
Thanks
-
Hi @ambershark,
Can you please help me how do I modify the constructor to get the parameters similar to QInputDialog::getItem
Thanks
-
Hi @ambershark,
I have created the constructor successfully and it display the item in comboBox.
Thanks for your help.
-
@Kashif Nice! Glad you got everything working.
Don't forget to mark the topic as solved. :)