Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Custom Input Method

Custom Input Method

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 2.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deu439
    wrote on 14 Jul 2014, 10:23 last edited by
    #1

    Hello,
    I would like to create a custom input method for applications that use the Qt for gui.
    What I have learned so far is that I have to subclass the QInputContext (in QT4) and I found this example http://qt-project.org/doc/qt-4.8/tools-inputpanel.html which kind of helps. But is it possible to make other applications use this custom input context without altering the source code?
    Thanks for any replies.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 14 Jul 2014, 11:37 last edited by
      #2

      Hi and welcome to devnet,

      AFAIK yes, this will require you to create a QInputContextPlugin and then store that plugin in the proper places so Qt can load it.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        deu439
        wrote on 14 Jul 2014, 11:52 last edited by
        #3

        Thank you, but how do I make all the desktop applications build on Qt use this plugin and the input context it represents?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 14 Jul 2014, 12:00 last edited by
          #4

          Can you describe your use case with OS and Qt version ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deu439
            wrote on 14 Jul 2014, 12:14 last edited by
            #5

            Well I would like to create input method that would automatically substitute abbreviated words with full lenght words. It should work as implementation of "zavpis" which is a system of abbreviations developed for quicker keyboard input in the czech language.
            OS: Slackware 14.0
            Qt 4.8.2

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 14 Jul 2014, 22:00 last edited by
              #6

              Then you can install the plugin in your distribution Qt's and all application will use it

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • D Offline
                D Offline
                deu439
                wrote on 15 Jul 2014, 11:01 last edited by
                #7

                So I have built a simple input context plugin and put it into QT4DIR/plugins/inputmethods
                How do I find out if qt has loaded the plugin? I cant get any application use this plugin. Cant find any qt setting which would make it use this plugin.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 15 Jul 2014, 22:03 last edited by
                  #8

                  start your application with the environment variable: QT_DEBUG_PLUGINS=1 to see what is happening with the plugins

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    deu439
                    wrote on 16 Jul 2014, 09:59 last edited by
                    #9

                    Oh thank you for your patience, QT_DEBUG_PLUGINS=1 revealed that the applications look for implementation of reset() method in the QInputContext subclass which they didnt find. So I just put there simple void reset(){} and it works fine now.
                    Anyway I think there is a little gap in the documentation as I never read anywhere that the input method plugins would get loaded in any application that has an input widget. I was near thinking that only implementation of XIM protocol would meet my requirements.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 16 Jul 2014, 11:59 last edited by
                      #10

                      Something strange here, reset is a pure virtual function, so to build your QInputContext inherited class you should have implemented this method.

                      Did you read the "Plugin Classes" page in the documentation ? Might contain more information.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      10/10

                      16 Jul 2014, 11:59

                      • Login

                      • Login or register to search.
                      10 out of 10
                      • First post
                        10/10
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved