Page 2 of 2 FirstFirst 12
Results 21 to 36 of 36

Thread: virtual keyboard in QT Application

  1. #21
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    Instead of taking the address of a temporary QVariant, make it a local variable and take its address.

    In the second error, you are required to pass a reference to a QString. You are trying to pass the return value of a function, which is also a temporary.
    Again, make a local variable, initialiize it with the result of the function and then pass the variable to the validate method.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    srm (24th March 2015)

  3. #22
    Join Date
    Mar 2015
    Posts
    2
    Thanks
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Re: virtual keyboard in QT Application

    Thanks for the pointers. I was able to fix the error messages as per your suggestion.
    For example
    emit dataSet(&QVariant(ui->edValue->text()));
    became
    QVariant qv = QVariant(ui->edValue->text());
    emit dataSet(&qv);
    But now I'm stuck on how to actually use it. I have absolutely no clue on how to incorporate that into my own app. I did a make install but neither do I know how to activate it, nor how to ensure cross platform functionality.

    So I moved over to give http://qt-apps.org/content/show.php/...content=107388 a try, which was mentioned in earlier in this thread.

    Would be great if you could explain/give a sample app on how to actually use such an extra inputcontext, for the total noobs

  4. #23
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    There is a howto on the first page of this thread

  5. #24
    Join Date
    May 2015
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    Quote Originally Posted by srm View Post
    Hi, thanks for the update.
    I'm pretty new to Qt (and to C++) and I'm having trouble using your project. Running Qt-Creator 3.3.0 and Qt5.4.
    I can open your project, but compiling it yields errors.

    This was running qmake && make in the project dir.
    What am I doing wrong? Do you need any more information?

    EDIT: running on OSX 10.10.2
    Looks like signatures changed here and there in Qt 5.4,
    your problem can get around easily as
    QString editedText = ui->edValue->text();
    if (validator->validate(editedText, pos) == QValidator::Acceptable)

    I also changes dataSet(QVariant*) to plain value call dataSet(QVariant)

    but my problem is that I never got the virtual keyboard working on Linux/X11/Qt 5.4.1

    I compiled the library, did sudo make install so it got copied into the right plugin directory
    I set the proper spellword "keyboard" property, hell, I even removed all property checks in the plugin to be sure this is not the problem.

    But on my test application the virtual keyboard never appeared.
    Actually I wonder how "magically" it could appear - currently I am missing some plugin activation on QLineEdit.

    I attach my test project if anyone could see what is the reason of virtual keyboard not showing up...
    Many thanks in advance

    Jan Struhar
    Attached Files Attached Files

  6. #25
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    Hi @ all.

    I've tried to use the keyboard in Qt 4. I included the InputDevice.h in my main file and created an intance of the InputDevice like you've posted it.
    But every time I want to build by project it says "undefined reference to 'InputDevice::InputDevice()'".

    Have I need to link something else or include on another place?

    Thanks in advance.

  7. #26
    Join Date
    Jul 2015
    Posts
    8
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    Hi all
    I hava the same problem
    I cant compile my test app, it is fail in <include "inputdevice.h">
    Does anyone actually succeeded to run it ??

  8. #27
    Join Date
    Jul 2015
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Android

    Default Re: virtual keyboard in QT Application

    I am using this in on an embedded arm and the compiler is telling me they cannot find <QtDesigner/QDesignerExportWidget>.

    Any way either not to use this or where I can find this file?

    Thanks

  9. #28
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    kovis did you try to add the plugin to your application build directory?
    what to do:
    * create a folder named platforminputcontexts in next to your executable
    * place the plugin in this directory
    * start the application

    Also important is that the plugin is build in the sameway as your application (debug/release)
    Last edited by StrikeByte; 29th October 2015 at 13:35.

  10. #29
    Join Date
    Nov 2015
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: virtual keyboard in QT Application

    hi,thanks for the virtual keyboard
    Last edited by kiran prabhu; 25th November 2015 at 09:18.

  11. #30
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: virtual keyboard in QT Application

    This looks very useful. I've been trying out the latest VIInputContext class. Any chance you can add some clarification on usage with a mainwindow widget?
    I put this in my mainwindow.h
    VIInputContext inputdevice;
    and in the constructor I do this
    ui->lineEdit->setProperty("keyboard",true);


    But, I must be missing something as when I click in the lineEdit box nothing happens.

  12. #31
    Join Date
    Sep 2015
    Posts
    1
    Thanks
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: virtual keyboard in QT Application

    Quote Originally Posted by sonulohani View Post
    OK create one keyboard and create an instance of it in your class and use it. Or simple is that create one lineedit with keyboard having pushbuttons. and connect all the push button to your lineEdit. If you want to use your keyboard in differents gui then you have to create a different class for keyboard. if you want some help in keyboard tutorial then you're welcome to query.
    I have a doubt in "If you want to use your keyboard in differents gui then you have to create a different class for keyboard": for each GUI I need create another "InputDevice" or create another "keyboard"? In this case, do I need to create another "installEventFilter". I create a tested app that in mainwindow I have some qlineedit that is working fine and a button to open a new QDialog. In this dialog, I have also some qlineedit. When I select this object, the keyboard is showed but no key pressed is accepted (I believe that slot-signal is defined to mainwindow). Could you help me ?
    Last edited by evandropadrao; 27th April 2016 at 03:51.

  13. #32
    Join Date
    May 2015
    Posts
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: virtual keyboard in QT Application

    Hello, StrikeByte.
    Great thanks for you project. I used many time your keyboard for my Qt4 application. It worked nice.
    But now I want to migrate my app to Qt5 and, of course, I planned to use your virtual keyboard adopted to Qt5.
    But, sorry, I had epic fail((
    My environment: embedded device, Qt5.4.2, X11.
    I don't understand how to load plugin to app.
    I used QT_DEBUG_PLUGINS=1 and I saw that plugin was found, but it's not loaded.

    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt/qt542-ti-qml/plugins/platforminputcontexts/libVirtualInput.so"
    Found metadata in lib /usr/local/qt/qt542-ti-qml/plugins/platforminputcontexts/libVirtualInput.so, metadata=
    {
    "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface",
    "MetaData": {
    "Keys": [
    "virtualinput"
    ]
    },
    "className": "VIPlatformInputContextPlugin",
    "debug": false,
    "version": 328706
    }


    Got keys from plugin meta data ("virtualinput")

    I tried to add DEFINES += VIRTUALINPUT_LIBRARY to .pro file.
    I tried to add VIPlatformInputContextPlugin virtualKeyboard; or VIInputContext virtualKeyboard; to my main.cpp.

    I saw that similar questions were above. Please give us simple project for Qt5 with your keyboard.

    Thanks.
    Last edited by titan83; 30th April 2016 at 12:34.

  14. #33
    Join Date
    May 2015
    Posts
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: virtual keyboard in QT Application

    Ok. I answer to my question myself.

    First: I don't know how to change input context plugins order. So I delete all other pluging from my plugins/platforminputcontexts folder. Virtual keybord plugin starts to load.
    Second: I should to work under X11, not with EGLFS or LinuxFB, unfortunately( And when I pressed on QLineEdit I see nothing. But from debug output I saw that show() method is called, hide() is too. So I add | Qt::X11BypassWindowManagerHint to numpad and keyboard constructors. Also I add call raise() method after show() in both files.
    Now virtual keyboard is working.

    Hope it will useful.

  15. #34
    Join Date
    Feb 2017
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: virtual keyboard in QT Application

    Hi StrikeByte,

    I really appreciate the work you've done with the virtual keyboard, but I notice you haven't added a license to the code. I hope this can be placed in the public doman (so anyone can use it for anything, even relicensing) or LGPL, so it can be used in projects using a LGPL licensed Qt.

    Thanks,

    Henrik

  16. #35
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    Hey HenrikSkott,

    You can do with it whatever you want.

    I havn't used this keyboard for a while, but it seems Qt has changed something in the platforminputcontext loader

    if you want to use it you need to add this to your main
    qputenv("QT_IM_MODULE", QByteArray("virtualinput"));

  17. #36
    Join Date
    Aug 2018
    Posts
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: virtual keyboard in QT Application

    I just created a project on github based on StrikeByte's code. https://github.com/mazj/VirtualInput

Similar Threads

  1. virtual keyboard application : errror during cross-compile
    By sanjeet in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 31st August 2011, 09:48
  2. How to get the virtual keyboard?
    By ramesh.bs in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd June 2010, 12:58
  3. Virtual Keyboard?
    By augusbas in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 14th July 2009, 09:55
  4. Virtual Keyboard
    By Micawber in forum Qt Programming
    Replies: 1
    Last Post: 3rd September 2007, 20:59
  5. virtual keyboard
    By sar_van81 in forum Qt Programming
    Replies: 5
    Last Post: 22nd December 2006, 14:40

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.