SlideShare a Scribd company logo
Qt5のInput Method
      朝木卓見




                   1
Qt4からQt5へ
•   Qt4では各プラットフォームでIMに(も)個別対応

    •   QPAによる抽象化

    •   QWidget依存からの脱却が必要

•   デスクトップ全盛期はIMの重要度が低かった

    •   ユーザーが入力するだけ(アプリから制御出来ない)

    •   旧APIは自由度・拡張性・抽象度が低い

•   モバイルの躍進でIMへの需要が高まる

    •   アプリからの制御・アプリとの連携が必要に

                                   2
Qt4のInput Method

                 Application

                                              QtGui
QInputMethodEvent

               QInputContext
                  Qt GUI
 Windows    Mac OS X         X11            QWS
 IMM32     NSTextInput     immodule    QWSInputMethod




                    scim    ibus      uim



                                                        3
Qt4のAPI
• Qt::WA_InputMethodEnabled

• QInputContext

• QInputMethodEvent

• QWidget::inputMethodQuery()
                                            IMの制御は
• QWidget::inputMethodHints (4.6)            4.6から


• QEvent::RequestSoftwareInputPanel (4.6)

• QEvent::CloseSoftwareInputPanel (4.6)

                                                     4
Qt5の主な変化

• QInputContextクラスを整理

  • QPlatformInputContextとQInputMethodに分割

  • システム向けとアプリ向け

  • QWidget依存を取り除く

  • アプリとの連携を視野に


                                            5
QPlatformInputContext
• 各プラットフォームのInput MethodをQtにインテグ
 レーションするためのクラス

 • qtbase/src/platforms/*
 • qtbase/src/plugins/platforminputcontexts/* (X11)
 • QWidget非依存
 • QPA用API
    • 非アプリ向け
    • ソース・バイナリ互換維持の対象外

                                                      6
QInputMethod


• アプリとInput Methodが連携するためのAPI
   • http://qt-project.org/doc/qt-5.0/qtgui/qinputmethod.html

• show(), hide()
• keyboardRectangle()




                                                                7
InputMethodQuery
• Input Methodからアプリへの問い合わせ

  • カーソル、フォント、サラウンドテキスト等

• Qt4

  • QWidget::inputMethodQuery()

• Qt5

  • QInputMethodQueryEvent


                                  8
Qt5のInput Method

                         Application



QInputMethodEvent                      QInputMethod

                    QPlatformAbstraction
                     QPlatformInputContext


        Windows      Mac OS X
                                    ibus         Mallit
        IMM32       NSTextInput
                      Client


                                                          9
Qt5のAPI
• Qt::WA_InputMethodEnabled

• QPlatformInputContext (QPA API)

• QInputMethod

• QApplication::autoSipEnabled (Software Input Panel)

• QInputMethodEvent

• QInputMethodQueryEvent

• QWidget::inputMethodHints (値の追加あり)

• QEvent::RequestSoftwareInputPanel

• QEvent::CloseSoftwareInputPanel

                                                        10
Qt Quick 2


• inputMethodHintsプロパティの追加
  • TextInput
  • TextEdit
• Qt.inputMethodプロパティ




                             11
まとめ

• APIが大きく変更(主に以下のケースに影響)
 • Input Methodを実装する場合
 • 細かな制御が必要な場合
• 実装は?
 • 要確認



                           12
参考文献

• Create proper input method abstraction and expose
  it through a public API in QTGui

• Expose new QInputPanel API as global property
  Qt.application.inputPanel

• http://qt-project.org/groups/qt-contributors-
  summit-2011/wiki/
  Input_methods_and_Wayland_in_Qt_5

• 注) QInputMethodはQInputPanelという名前でした


                                                      13

More Related Content

PDF
ViT (Vision Transformer) Review [CDM]
PDF
Deep Learning for Computer Vision: Recurrent Neural Networks (UPC 2016)
PDF
Subversion to Git Migration
PDF
Monorepo at Pinterest
PDF
Il Linguaggio Dei Nuovi Media
PDF
210523 swin transformer v1.5
PPTX
Master the Monorepo
PPTX
Myron Krueger
ViT (Vision Transformer) Review [CDM]
Deep Learning for Computer Vision: Recurrent Neural Networks (UPC 2016)
Subversion to Git Migration
Monorepo at Pinterest
Il Linguaggio Dei Nuovi Media
210523 swin transformer v1.5
Master the Monorepo
Myron Krueger

What's hot (17)

PDF
HDR Theory and practicce (JP)
PPT
Prince 2 - Project Management principles
PDF
Redmine 4.0 おすすめ新機能 ピックアップ(第2版)
PPTX
OBS Video filters
PDF
Recurrent Neural Networks
PDF
Git and Github
PDF
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
PDF
シリコンスタジオによる HDR出力対応の理論と実践
PPTX
[Paper review] BERT
PDF
PPTX
Hable John Uncharted2 Hdr Lighting
PPTX
golang_getting_started.pptx
PPTX
Large-scale Video Classification with Convolutional Neural Network
PPTX
DMA Survival Guide
PDF
[데브루키] Color space gamma correction
PDF
Learning Convolutional Neural Networks for Graphs
PDF
Développement d'un client MQTT sur Raspberry Pi
HDR Theory and practicce (JP)
Prince 2 - Project Management principles
Redmine 4.0 おすすめ新機能 ピックアップ(第2版)
OBS Video filters
Recurrent Neural Networks
Git and Github
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)
シリコンスタジオによる HDR出力対応の理論と実践
[Paper review] BERT
Hable John Uncharted2 Hdr Lighting
golang_getting_started.pptx
Large-scale Video Classification with Convolutional Neural Network
DMA Survival Guide
[데브루키] Color space gamma correction
Learning Convolutional Neural Networks for Graphs
Développement d'un client MQTT sur Raspberry Pi
Ad

Viewers also liked (20)

PDF
Touch Android Without Touching
PDF
Qt5 の新機能 2012/12/15
PPTX
A PROXY EFFECT ANALYIS AND FAIR ADATPATION ALGORITHM FOR MULTIPLE COMPETING D...
PDF
Design problem study-Chinese input method using in mobile platform
PDF
Keyboards and Internationalization
PPTX
libdash 2.0
PDF
[社内LT][Debian] お前はもう使っている-2013/05/24
PDF
"Typical" bugs of LibreOffice in Japanese environment
PDF
Kika IME Android Taipei 2016 May
PDF
DebianでFirefoxをカスタマイズするには
PDF
かな漢字変換ソフト「Genji」をつくってみた
PDF
オープンソースオフィススイート「LibreOffice」利用支援およびリナックスパソコン「LibrePC」の販売
PDF
Debian Update: ~ Jessie, Stretch, Buster ~
PDF
リリースされたばかりの『Ubuntu 16.04LTS』のすべて
PDF
Redesigning Input-Method Launcher and Management System
PDF
20141030 html5j-firefox os-deviceapi
PDF
Human Computer Interaction Chapter 2
PDF
Windows ストアアプリから使かえるセンサーAPIとデバイスAPI
PDF
8-9-10=Jessie,Stretch,Buster
PDF
ウェブ標準デバイス系 API 総集編 2014
Touch Android Without Touching
Qt5 の新機能 2012/12/15
A PROXY EFFECT ANALYIS AND FAIR ADATPATION ALGORITHM FOR MULTIPLE COMPETING D...
Design problem study-Chinese input method using in mobile platform
Keyboards and Internationalization
libdash 2.0
[社内LT][Debian] お前はもう使っている-2013/05/24
"Typical" bugs of LibreOffice in Japanese environment
Kika IME Android Taipei 2016 May
DebianでFirefoxをカスタマイズするには
かな漢字変換ソフト「Genji」をつくってみた
オープンソースオフィススイート「LibreOffice」利用支援およびリナックスパソコン「LibrePC」の販売
Debian Update: ~ Jessie, Stretch, Buster ~
リリースされたばかりの『Ubuntu 16.04LTS』のすべて
Redesigning Input-Method Launcher and Management System
20141030 html5j-firefox os-deviceapi
Human Computer Interaction Chapter 2
Windows ストアアプリから使かえるセンサーAPIとデバイスAPI
8-9-10=Jessie,Stretch,Buster
ウェブ標準デバイス系 API 総集編 2014
Ad

Qt5 の Input Method

  • 1. Qt5のInput Method 朝木卓見 1
  • 2. Qt4からQt5へ • Qt4では各プラットフォームでIMに(も)個別対応 • QPAによる抽象化 • QWidget依存からの脱却が必要 • デスクトップ全盛期はIMの重要度が低かった • ユーザーが入力するだけ(アプリから制御出来ない) • 旧APIは自由度・拡張性・抽象度が低い • モバイルの躍進でIMへの需要が高まる • アプリからの制御・アプリとの連携が必要に 2
  • 3. Qt4のInput Method Application QtGui QInputMethodEvent QInputContext Qt GUI Windows Mac OS X X11 QWS IMM32 NSTextInput immodule QWSInputMethod scim ibus uim 3
  • 4. Qt4のAPI • Qt::WA_InputMethodEnabled • QInputContext • QInputMethodEvent • QWidget::inputMethodQuery() IMの制御は • QWidget::inputMethodHints (4.6) 4.6から • QEvent::RequestSoftwareInputPanel (4.6) • QEvent::CloseSoftwareInputPanel (4.6) 4
  • 5. Qt5の主な変化 • QInputContextクラスを整理 • QPlatformInputContextとQInputMethodに分割 • システム向けとアプリ向け • QWidget依存を取り除く • アプリとの連携を視野に 5
  • 6. QPlatformInputContext • 各プラットフォームのInput MethodをQtにインテグ レーションするためのクラス • qtbase/src/platforms/* • qtbase/src/plugins/platforminputcontexts/* (X11) • QWidget非依存 • QPA用API • 非アプリ向け • ソース・バイナリ互換維持の対象外 6
  • 7. QInputMethod • アプリとInput Methodが連携するためのAPI • http://qt-project.org/doc/qt-5.0/qtgui/qinputmethod.html • show(), hide() • keyboardRectangle() 7
  • 8. InputMethodQuery • Input Methodからアプリへの問い合わせ • カーソル、フォント、サラウンドテキスト等 • Qt4 • QWidget::inputMethodQuery() • Qt5 • QInputMethodQueryEvent 8
  • 9. Qt5のInput Method Application QInputMethodEvent QInputMethod QPlatformAbstraction QPlatformInputContext Windows Mac OS X ibus Mallit IMM32 NSTextInput Client 9
  • 10. Qt5のAPI • Qt::WA_InputMethodEnabled • QPlatformInputContext (QPA API) • QInputMethod • QApplication::autoSipEnabled (Software Input Panel) • QInputMethodEvent • QInputMethodQueryEvent • QWidget::inputMethodHints (値の追加あり) • QEvent::RequestSoftwareInputPanel • QEvent::CloseSoftwareInputPanel 10
  • 11. Qt Quick 2 • inputMethodHintsプロパティの追加 • TextInput • TextEdit • Qt.inputMethodプロパティ 11
  • 12. まとめ • APIが大きく変更(主に以下のケースに影響) • Input Methodを実装する場合 • 細かな制御が必要な場合 • 実装は? • 要確認 12
  • 13. 参考文献 • Create proper input method abstraction and expose it through a public API in QTGui • Expose new QInputPanel API as global property Qt.application.inputPanel • http://qt-project.org/groups/qt-contributors- summit-2011/wiki/ Input_methods_and_Wayland_in_Qt_5 • 注) QInputMethodはQInputPanelという名前でした 13