Results 1 to 7 of 7

Thread: driver plugin help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default driver plugin help

    Hi, I've been following the plugin guide from qt assistant, but there doesn't seem to be any examples for device driver plugins, so I tried to write one but only to find it not compilable for reasons beyond my understanding.

    here's the header

    Qt Code:
    1. #include <QKbdDriverPlugin>
    2. #include <QtPlugin>
    3. #include <QtCore>
    4. #include <QWSKeyboardHandler>
    5. class CustomKBPlugin : public QKbdDriverPlugin
    6. {
    7. public:
    8. QWSKeyboardHandler* create(const QString &key, const QString &device);
    9. QStringList keys() const;
    10. };
    To copy to clipboard, switch view to plain text mode 

    the implementation...
    Qt Code:
    1. #include "ckplugin.h"
    2. #include <QDebug>
    3. #include <QtPlugin>
    4. QWSKeyboardHandler* CustomKBPlugin::create(const QString &key, const QString &device)
    5. {
    6. qDebug() << "creating device";
    7. return new QWSKeyboardHandler("/dev/tty");
    8. return 0;
    9. }
    10.  
    11. QStringList CustomKBPlugin::keys() const
    12. {
    13. return QStringList() << "sample keys";
    14. }
    15.  
    16. Q_EXPORT_PLUGIN2(ckbplugin, CustomKBPlugin)
    To copy to clipboard, switch view to plain text mode 

    the .pro
    Qt Code:
    1. TEMPLATE = lib
    2. TARGET = ckplugin
    3. DEPENDPATH += .
    4. INCLUDEPATH += .
    5. CONFIG += plugin
    6.  
    7. # Input
    8. HEADERS += ckplugin.h
    9. SOURCES += ckplugin.cpp
    To copy to clipboard, switch view to plain text mode 

    the error...
    ..../qtopia-core-opensource-src-4.2.0/include -I. -I. -I. -o ckplugin.o ckplugin.cpp
    ckplugin.cpp:6: warning: unused parameter 'key'
    ckplugin.cpp:6: warning: unused parameter 'device'
    ckplugin.cpp: In function `QObject* qt_plugin_instance()':
    ckplugin.cpp:16: error: cannot allocate an object of type `CustomKBPlugin'
    ckplugin.cpp:16: error: because the following virtual functions are abstract:
    ..../qtopia-core-opensource-src-4.2.0/include/QtGui/../../src/gui/embedded/qkbddriverplugin_qws.h:40: error: virtual QWSKeyboardHandler* QWSKeyboardHandlerFactoryInterface::create(const QString&)
    {standard input}: Assembler messages:
    {standard input}:582: Error: displacement to undefined symbol .LTHUNK1 overflows 12-bit field
    {standard input}:591: Error: displacement to undefined symbol .LTHUNK2 overflows 12-bit field
    I know I didn't include the actual driver implmentations here, but this sample code alone causes the compilation problem.
    If I added Q_Object, it would remove the last few assembly errors, but still doesn't solve the problem with virtual function of QWSKeyboardHandlerFactoryInterface

    Any help is welcome, thank you.
    Last edited by jacek; 14th November 2006 at 09:43. Reason: changed [code] to [quote]

Similar Threads

  1. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  2. Testing a custom Plugin
    By maluta in forum Qt Programming
    Replies: 5
    Last Post: 31st October 2006, 15:09
  3. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 13:45
  4. Managing widget plugin in Qt Designer
    By yellowmat in forum Newbie
    Replies: 8
    Last Post: 31st January 2006, 09:58

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
  •  
Qt is a trademark of The Qt Company.