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. How can I control the InputMethod alternative words position on a custom widget.
QtWS25 Last Chance

How can I control the InputMethod alternative words position on a custom widget.

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.2k 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.
  • fasixF Offline
    fasixF Offline
    fasix
    wrote on last edited by fasix
    #1

    Here is what I have done:

    1. I written a custom widget,which can accept input messages.
    2. I enabled input method by setAttribute(Qt:WA_InputMethodEnabled), so i can get the KeyPressEvent and InputMethodEvent.
    3. use my own engine to paint the input words.

    There is a question in the case above. when I input Asian characters, the InputMethod will prompt a window, which display some alternative words. but I can not find a way to move the window to where I wanted to.

    Anyone knows how to due this?

    jsulmJ 1 Reply Last reply
    0
    • fasixF fasix

      Here is what I have done:

      1. I written a custom widget,which can accept input messages.
      2. I enabled input method by setAttribute(Qt:WA_InputMethodEnabled), so i can get the KeyPressEvent and InputMethodEvent.
      3. use my own engine to paint the input words.

      There is a question in the case above. when I input Asian characters, the InputMethod will prompt a window, which display some alternative words. but I can not find a way to move the window to where I wanted to.

      Anyone knows how to due this?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @fasix What window is it? Is it your own? If so then take a look at http://doc.qt.io/qt-5/qwidget.html#pos-prop

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      fasixF 1 Reply Last reply
      2
      • jsulmJ jsulm

        @fasix What window is it? Is it your own? If so then take a look at http://doc.qt.io/qt-5/qwidget.html#pos-prop

        fasixF Offline
        fasixF Offline
        fasix
        wrote on last edited by
        #3

        @jsulm the window is not mine, It is the InputMethod prompted, here is a screen shot:

        0_1499218121684_11.png

        I tryied to use InputMethodQueryEvent, but it seems to helpless.

        jsulmJ 1 Reply Last reply
        0
        • fasixF fasix

          @jsulm the window is not mine, It is the InputMethod prompted, here is a screen shot:

          0_1499218121684_11.png

          I tryied to use InputMethodQueryEvent, but it seems to helpless.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @fasix OK, you mean a pop-up. I don't know how you can influence its position, maybe somebody else can help.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          fasixF 1 Reply Last reply
          1
          • jsulmJ jsulm

            @fasix OK, you mean a pop-up. I don't know how you can influence its position, maybe somebody else can help.

            fasixF Offline
            fasixF Offline
            fasix
            wrote on last edited by
            #5

            @jsulm thank you all the same.

            1 Reply Last reply
            1

            • Login

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