Results 1 to 9 of 9

Thread: My project works on Qt Simulator, but not on my real device.

  1. #1
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default My project works on Qt Simulator, but not on my real device.

    Here is my project:

    clean.h

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "qmlapplicationviewer.h"
    3. #include <QObject>
    4. #include <QApplication>
    5. #include <QDeclarativeView>
    6. #include <QDeclarativeContext>
    7.  
    8. #ifndef CLEAN_H
    9. #define CLEAN_H
    10.  
    11.  
    12. class Clean : public QObject {
    13. Q_OBJECT
    14. public:
    15. explicit Clean(QObject *parent = 0); ~Clean();
    16.  
    17. //void deleteDir();
    18. //void deleteFile();
    19.  
    20. Q_INVOKABLE void clean1();
    21. };
    22.  
    23. #endif // CLEAN_H
    To copy to clipboard, switch view to plain text mode 

    clean.cpp

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "qmlapplicationviewer.h"
    3. #include <QObject>
    4. #include <QApplication>
    5. #include <QDeclarativeView>
    6. #include <QDeclarativeContext>
    7. #include <QFile>
    8. #include <QDir>
    9. #include "clean.h"
    10.  
    11. void deleteDir(const std::string& foldername) {
    12. QDir dir;
    13. dir.remove(foldername.c_str());
    14. }
    15.  
    16. void deleteFile(const std::string& filename) {
    17. QFile file;
    18. file.remove(filename.c_str());
    19. }
    20.  
    21. Clean::Clean(QObject *parent) : QObject(parent) {
    22. }
    23.  
    24. Clean::~Clean() {
    25. }
    26.  
    27. void Clean::clean1() {
    28. deleteDir(e:/data);
    29. deleteFile(e:/qf)
    30. }
    To copy to clipboard, switch view to plain text mode 


    main.cpp

    Qt Code:
    1. #include "clean.h"
    2.  
    3. int main(int argc, char *argv[])
    4. {
    5. QApplication app(argc, argv);
    6.  
    7. Clean clean;
    8.  
    9. QDeclarativeView view;
    10. view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    11. view.rootContext()->setContextProperty("Clean", &clean);
    12. view.setSource(QUrl("qml/GCleaner/main.qml"));
    13.  
    14. return app.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

    main.qml

    Qt Code:
    1. Button {
    2. id:button
    3. onClicked: Clean.clean1()
    4. }
    To copy to clipboard, switch view to plain text mode 


    It works very well on Qt Simulator, but not work on my mobile device. I also tried to add qdir.h and qfile.h but it exited with code -1073741819.

    What should I do? Thank you so much for your help.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: My project works on Qt Simulator, but not on my real device.

    What kind of device? What exactly happens?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    GeorgeDao123 (9th April 2013)

  4. #3
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: My project works on Qt Simulator, but not on my real device.

    My device is Nokia E6, OS is Belle.

    When I open this app on phone from Main Menu, it does not show anything. The screen goes blank then the Main Menu is refreshed.

    Thanks for your help.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: My project works on Qt Simulator, but not on my real device.

    I think your program simply crashes. You need to debug it and see what's wrong.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    GeorgeDao123 (14th April 2013)

  7. #5
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: My project works on Qt Simulator, but not on my real device.

    It says that:

    Debugging starts
    QDeclarativeDebugServer: Ignoring "-qmljsdebugger=port:3768,block". Debugging has not been enabled.
    Debugging has finished.

  8. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: My project works on Qt Simulator, but not on my real device.

    Try harder
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. The following user says thank you to wysota for this useful post:

    GeorgeDao123 (14th April 2013)

  10. #7
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: My project works on Qt Simulator, but not on my real device.

    I have tried all things I know but it's still not solved.

    I study Qt myself and no one in my region can help me, sir. Should I go to Qt4.8? The current Qt version that I am using is 4.7.4.

  11. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: My project works on Qt Simulator, but not on my real device.

    You should make sure that you build your project in debug mode and that you have prepared your device for debugging. I'm sure there are documents about it in the internet.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. The following user says thank you to wysota for this useful post:

    GeorgeDao123 (14th April 2013)

  13. #9
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: My project works on Qt Simulator, but not on my real device.

    Okay sir. I shall try again then tell everything here. Thank you so much for your help.

    Sincerely.

Similar Threads

  1. simulator for embedded device for testing user application
    By sanjeet in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th August 2012, 06:02
  2. Replies: 0
    Last Post: 3rd May 2012, 11:33
  3. Replies: 0
    Last Post: 30th May 2011, 06:14
  4. Different behaviour for Simulator and Device
    By lyhoanghai in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 20th October 2010, 12:47
  5. Font in simulator and S60 device don't look the same
    By Erazem in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 20th August 2010, 20:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.