Results 1 to 7 of 7

Thread: embedded why error QWSMouseHandler

  1. #1
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default embedded why error QWSMouseHandler

    this is my code use, but it cant build error:cannot declare variable to be of abstract type 'QWSMouseHandler

    can you help me ?



    Qt Code:
    1. #if defined(Q_OS_LINUX)
    2. QPoint qpoint = QWSMouseHandler::pos();
    3. Qt::MouseButtons buttons = Qt::NoButton;
    4. if (qFuzzyCompare(slideValue(), static_cast<qreal>(1.0f)))
    5. {
    6. if (event->key() == Qt::Key_Left)
    7. {
    8. qpoint.setX(qpoint.x() + 30);
    9. }
    10. if (event->key() == Qt::Key_Up)
    11. {
    12. qpoint.setY(qpoint.x() + 30);
    13. }
    14. if (event->key() == Qt::Key_Down)
    15. {
    16. qpoint.setX(qpoint.x() - 30);
    17. }
    18. if (event->key() == Qt::Key_Right)
    19. {
    20. qpoint.setY(qpoint.x() - 30);
    21. }
    22. if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
    23. {
    24. buttons |= Qt::LeftButton;
    25. }
    26. QWSMouseHandler::mouseChanged (qpoint,buttons,0);
    27. //QWSServer::sendMouseEvent( qpoint, 0 );
    28. }
    29. #else
    To copy to clipboard, switch view to plain text mode 


    src/BrowserWindow.cpp:101: error: cannot declare variable 'qwsMouse' to be of abstract type 'QWSMouseHandler'
    ../../../../install/include/QtGui/qmouse_qws.h:67: note: because the following virtual functions are pure within 'QWSMouseHandler':
    ../../../../install/include/QtGui/qmouse_qws.h:77: note: virtual void QWSMouseHandler::resume()
    ../../../../install/include/QtGui/qmouse_qws.h:78: note: virtual void QWSMouseHandler::suspend()
    src/BrowserWindow.cpp:127: error: no matching function for call to 'QWSMouseHandler::mouseChanged(QPoint*, Qt::MouseButtons&, int)'
    ../../../../install/include/QtGui/qmouse_qws.h:81: note: candidates are: void QWSMouseHandler::mouseChanged(const QPoint&, int, int)
    make: *** [BrowserWindow.o] Error 1
    Contact: Skype: sonnh89
    Yahoo: nhs_0702@yahoo.com

    Liên hệ SKype: sonnh89

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: embedded why error QWSMouseHandler

    The error means that the "QWSMouseHandler" is not a complete type, to make it complete you need to implement the pure virtual functions. You need to subclass "QWSMouseHandler" and then implement them, use it.

    The last error is regarding the datatype mismatch, that should be simple

  3. #3
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: embedded why error QWSMouseHandler

    Quote Originally Posted by Santosh Reddy View Post
    The error means that the "QWSMouseHandler" is not a complete type, to make it complete you need to implement the pure virtual functions. You need to subclass "QWSMouseHandler" and then implement them, use it.

    The last error is regarding the datatype mismatch, that should be simple
    yeah, but when i subclass it then error

    Qt Code:
    1. class QMouse : public QWSMouseHandler
    2. {
    3. public:
    4. explicit QMouse(const QString &driver = QString(),const QString &device = QString());
    5. void mouseChanged ( const QPoint & position, int state, int wheel = 0 );
    6. const QPoint & pos () ;
    7. };
    8. void BrowserWindow::keyReleaseEvent(QKeyEvent *event)
    9. {
    10. #if defined(Q_OS_LINUX)
    11. QPoint qpoint = QMouse::pos();
    12. Qt::MouseButtons buttons = Qt::NoButton;
    13. if (qFuzzyCompare(slideValue(), static_cast<qreal>(1.0f)))
    14. {
    15. if (event->key() == Qt::Key_Left)
    16. {
    17. qpoint.setX(qpoint.x() + 30);
    18. }
    19. if (event->key() == Qt::Key_Up)
    20. {
    21. qpoint.setY(qpoint.x() + 30);
    22. }
    23. if (event->key() == Qt::Key_Down)
    24. {
    25. qpoint.setX(qpoint.x() - 30);
    26. }
    27. if (event->key() == Qt::Key_Right)
    28. {
    29. qpoint.setY(qpoint.x() - 30);
    30. }
    31. if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
    32. {
    33. buttons |= Qt::LeftButton;
    34. }
    35. QMouse::mouseChanged (qpoint,buttons,0);
    To copy to clipboard, switch view to plain text mode 

    can you help me ?
    src/BrowserWindow.cpp: In member function 'virtual void BrowserWindow::keyReleaseEvent(QKeyEvent*)':
    src/BrowserWindow.cpp:115: error: cannot call member function 'const QPoint& QMouse:os()' without object
    src/BrowserWindow.cpp:139: error: cannot call member function 'void QMouse::mouseChanged(const QPoint&, int, int)' without object
    make: *** [BrowserWindow.o] Error 1

    Added after 12 minutes:


    Qt Code:
    1. class QMouse : public QWSMouseHandler
    2. {
    3. public:
    4. explicit QMouse(const QString &driver = QString(),const QString &device = QString());
    5. void mouseChanged ( const QPoint & position, int state, int wheel = 0 );
    6. const QPoint & pos () ;
    7. void resume ();
    8. void suspend ();
    9. };
    10.  
    11. #endif
    12. void BrowserWindow::keyReleaseEvent(QKeyEvent *event)
    13. {
    14. #if defined(Q_OS_LINUX)
    15. QMouse* qmouseSonnh;
    16. qmouseSonnh = new QMouse;
    17. QPoint qpoint = qmouseSonnh->pos();
    18. Qt::MouseButtons buttons = Qt::NoButton;
    19. if (qFuzzyCompare(slideValue(), static_cast<qreal>(1.0f)))
    20. {
    21. if (event->key() == Qt::Key_Left)
    22. {
    23. qpoint.setX(qpoint.x() + 30);
    24. }
    25. if (event->key() == Qt::Key_Up)
    26. {
    27. qpoint.setY(qpoint.x() + 30);
    28. }
    29. if (event->key() == Qt::Key_Down)
    30. {
    31. qpoint.setX(qpoint.x() - 30);
    32. }
    33. if (event->key() == Qt::Key_Right)
    34. {
    35. qpoint.setY(qpoint.x() - 30);
    36. }
    37. if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
    38. {
    39. buttons |= Qt::LeftButton;
    40. }
    41. qmouseSonnh->mouseChanged (qpoint,buttons,0);
    42. //QWSServer::sendMouseEvent( qpoint, 0 );
    43. }
    44. #else
    45. int delta = 50;
    46. QPoint pos = QCursor::pos();
    47. switch (event->key())
    48. {
    49. case Qt::Key_Left:
    50. pos.rx() -= delta;
    51. break;
    52. case Qt::Key_Right:
    53. pos.rx() += delta;
    54. break;
    55. case Qt::Key_Up:
    56. pos.ry() -= delta;
    57. break;
    58. case Qt::Key_Down:
    59. pos.ry() += delta;
    60. break;
    61. case Qt::Key_Return:
    62. break;
    63. default:
    64. break;
    65. }
    66. QCursor::setPos(pos);
    67. #endif
    68. QWidget::keyReleaseEvent(event);
    69. switch (event->key())
    70. {
    71. case Qt::Key_Home:
    72. if (m_animation->state() == QAbstractAnimation::Running)
    73. {
    74. const QAbstractAnimation::Direction direction = m_animation->direction() == QAbstractAnimation::Forward
    75. ? QAbstractAnimation::Forward
    76. : QAbstractAnimation::Backward;
    77. m_animation->setDirection(direction);
    78. }
    79. else if (qFuzzyCompare(slideValue(), static_cast<qreal>(1.0f)))
    80. {
    81. showHomeView();
    82. }
    83. else
    84. {
    85. showBrowserView();
    86. }
    87. case Qt::Key_F1:
    88. if (!qFuzzyCompare(slideValue(), static_cast<qreal>(1.0f)))
    89. {
    90. m_homeView->SetBookMark();
    91. }
    92. break;
    93. default:
    94. return;
    95. }
    96. event->accept();
    97. }
    To copy to clipboard, switch view to plain text mode 


    BrowserWindow.o:/tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:106: undefined reference to `QMouse:os()'
    BrowserWindow.o:/tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:106: undefined reference to `QMouse:os()'
    BrowserWindow.o:/tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:130: undefined reference to `QMouse::mouseChanged(QPoint const&, int, int)'
    BrowserWindow.o:/tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:130: undefined reference to `QMouse::mouseChanged(QPoint const&, int, int)'
    BrowserWindow.o: In function `BrowserWindow':
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:35: undefined reference to `QMouse::QMouse(QString const&, QString const&)'
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:35: undefined reference to `QMouse::QMouse(QString const&, QString const&)'
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:35: undefined reference to `QMouse::QMouse(QString const&, QString const&)'
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/web-browser-sonnh89-24-5-2011/src/BrowserWindow.cpp:35: undefined reference to `QMouse::QMouse(QString const&, QString const&)'
    Last edited by Thành Viên Mới; 25th May 2011 at 08:23.
    Contact: Skype: sonnh89
    Yahoo: nhs_0702@yahoo.com

    Liên hệ SKype: sonnh89

  4. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: embedded why error QWSMouseHandler

    Qt Code:
    1. QPoint qpoint = qmouseSonnh->pos();
    2. qmouseSonnh->mouseChanged (qpoint,buttons,0);
    To copy to clipboard, switch view to plain text mode 
    with this modification it should compile, if not try clean build

  5. #5
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: embedded why error QWSMouseHandler

    yeah, i cleaned project, but error:

    BrowserWindow.o: In function `QMouse':
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/123/src/BrowserWindow.h:20: undefined reference to `vtable for QMouse'
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/123/src/BrowserWindow.h:20: undefined reference to `vtable for QMouse'
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/123/src/BrowserWindow.h:20: undefined reference to `vtable for QMouse'
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/123/src/BrowserWindow.h:20: undefined reference to `vtable for QMouse'
    /tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/123/src/BrowserWindow.h:20: undefined reference to `vtable for QMouse'
    BrowserWindow.o:/tango3/qt_SMP8654F_bin_4.5.2-1.1/src/demos/embedded/123/src/BrowserWindow.h:20: more undefined references to `vtable for QMouse' follow
    collect2: ld returned 1 exit status
    Contact: Skype: sonnh89
    Yahoo: nhs_0702@yahoo.com

    Liên hệ SKype: sonnh89

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: embedded why error QWSMouseHandler

    Are you trying to use signals and slots withe QMouse?
    And show the implementation of QMouse.
    Last edited by high_flyer; 25th May 2011 at 10:51.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: embedded why error QWSMouseHandler

    Did you implement the following virtual methods? (just in case, you missed them)

    Qt Code:
    1. class QMouse : public QWSMouseHandler
    2. {
    3. public:
    4. explicit QMouse(const QString &driver = QString(),const QString &device = QString());
    5. void mouseChanged ( const QPoint & position, int state, int wheel = 0 );
    6. const QPoint & pos () ;// ?
    7. void resume ();// ?
    8. void suspend ();// ?
    9. };
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QT-Embedded Symbol Lookup Error
    By augusbas in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 23rd June 2009, 05:01
  2. qt-embedded cross compilation error help
    By aj2903 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 27th October 2008, 08:41
  3. Qt Embedded - error running app on CE
    By fritz.hu in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 26th September 2008, 05:43
  4. Error in Qt/embedded 4.0.0 with qvfb
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 10th December 2007, 11:31
  5. Qt/Embedded Installation error during make
    By mahe2310 in forum Installation and Deployment
    Replies: 5
    Last Post: 7th September 2006, 04:05

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.