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. Qt5 and QInputContext
Forum Updated to NodeBB v4.3 + New Features

Qt5 and QInputContext

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 14.0k Views 1 Watching
  • 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.
  • W Offline
    W Offline
    WeX.tmpvar
    wrote on last edited by
    #1

    Hello. In my Qt4 projects I'm used QInputContext class implementation to trap RequestSoftwareInputPanel event from widgets, and then send a signal to application for further action. With the release of Qt5 alpha I want to convert my Qt4 applications to Qt5, but I do not know how to convert this part of applications to Qt5 =(

    In Qt4:

    @class myInputContext : public QInputContext
    {
    Q_OBJECT
    public:
    myInputContext();
    ~myInputContext();

        bool filterEvent(const QEvent* event);
    
    signals:
        void calledSoftwareInputOpen();
        void calledSoftwareInputClose();
    

    };@

    @myInputContext::myInputContext()
    {
    }

    myInputContext::~myInputContext()
    {
    }

    bool myInputContext::filterEvent(const QEvent* event)
    {
    if (event->type() == QEvent::RequestSoftwareInputPanel) {
    emit calledSoftwareInputOpen();
    return true;
    } else if (event->type() == QEvent::CloseSoftwareInputPanel) {
    emit calledSoftwareInputClose();
    return true;
    }
    return false;
    }@

    and in main file:
    @QApplication a(argc, argv);
    myInputContext *aic = new myInputContext;
    a.setInputContext(aic);@

    How I can implement it in Qt5? Thanks.

    Sorry for my english =)

    1 Reply Last reply
    0
    • W Offline
      W Offline
      WeX.tmpvar
      wrote on last edited by
      #2

      Or how to use new classes QPlatformInputContext and QInputPanel. I need to add virtual keyboard support into my desktop application. In Qt4 I've used QInputContext to emit signal from widgets and then open my keyboard, but in Qt5 I don't know how to implement it =(

      Sorry for my english =)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sihonm
        wrote on last edited by
        #3

        Did you ever find out anything more about this - Converting QInputContext to Qt5?

        1 Reply Last reply
        0
        • W Offline
          W Offline
          WeX.tmpvar
          wrote on last edited by
          #4

          No =(

          Sorry for my english =)

          1 Reply Last reply
          0
          • N Offline
            N Offline
            ntquy99
            wrote on last edited by
            #5

            do we have any hints?

            1 Reply Last reply
            0
            • W Offline
              W Offline
              WeX.tmpvar
              wrote on last edited by
              #6

              Hmm, we can use qt5 with maliit framework for use on-screen keyboard in our applications =) If we need custom keyboard, we can write custom plugin for maliit =)

              Sorry for my english =)

              1 Reply Last reply
              0
              • N Offline
                N Offline
                ntquy99
                wrote on last edited by
                #7

                I had a project using QInputContext. Now I want to port to QPlatformInputContext. How can we do with QPlatformINputContext?

                My project is pretty urgent :(

                1 Reply Last reply
                0
                • W Offline
                  W Offline
                  WeX.tmpvar
                  wrote on last edited by
                  #8

                  I don't know =((

                  Sorry for my english =)

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    ntquy99
                    wrote on last edited by
                    #9

                    Hi WeX - I'd like to try this approach 'Hmm, we can use qt5 with maliit framework for use on-screen keyboard in our applications =) If we need custom keyboard, we can write custom plugin for maliit =)'. Do you have examples for using on-screen keyboard and custom keyboard (plugin) with Maliit on Windows? Linux may be ok as well.

                    1 Reply Last reply
                    0
                    • W Offline
                      W Offline
                      WeX.tmpvar
                      wrote on last edited by
                      #10

                      No, I haven't tried to use maliit on windows. I use linux for my projects =) You can find linux examples in maliit repository =)

                      Sorry for my english =)

                      1 Reply Last reply
                      0
                      • N Offline
                        N Offline
                        ntquy99
                        wrote on last edited by
                        #11

                        Thanks WeX. I look over Maliit doc and find it seems Maliit keyboard need connect to Maliit server via network...Is it possible to only work with the input method in local?
                        We need port input method framework onto a linux board running QT. We don't want to connect to any server.

                        I used QPlatformInputContext but when I focus on a field, there is no platform event sent to our input method (in filterEvent function) to show up our keyboard. I had to call explicitly in the application code (in focusIn event of each field) to show up the keyboard, not use QPlatformInputContext. But this approach is not good because I have many fields in the application and cannot catch all events focusIn of all these fields :(. I wonder whether Maliit can do or not? It means when I focus on any field in any application in the board, I can receive an event automatically from platform/maliit to show up the keyboard?

                        BTW I just look over master QT code and find there is a iBus and Maliit framework. iBus uses QPlatformInputContext and D-Bus.

                        1 Reply Last reply
                        0
                        • W Offline
                          W Offline
                          WeX.tmpvar
                          wrote on last edited by
                          #12

                          To connect with maliit server You can use D-Bus =)

                          Sorry for my english =)

                          1 Reply Last reply
                          0

                          • Login

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