From 221b573287dd24ca504f924b4a62380c20553bce Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 1 Jun 2018 09:45:02 +0200 Subject: [PATCH] input context changes --- src/inputpanel/QskInputContext.cpp | 1 - src/inputpanel/QskInputEngine.cpp | 4 +- src/inputpanel/QskInputPanel.cpp | 111 +++++++---------------------- 3 files changed, 25 insertions(+), 91 deletions(-) diff --git a/src/inputpanel/QskInputContext.cpp b/src/inputpanel/QskInputContext.cpp index 9c935e72..b1f84019 100644 --- a/src/inputpanel/QskInputContext.cpp +++ b/src/inputpanel/QskInputContext.cpp @@ -5,7 +5,6 @@ #include "QskInputContext.h" #include "QskInputPanel.h" -#include "QskInputPanel.h" #include "QskInputEngine.h" #include "QskLinearBox.h" diff --git a/src/inputpanel/QskInputEngine.cpp b/src/inputpanel/QskInputEngine.cpp index 40749f09..29ee2ffa 100644 --- a/src/inputpanel/QskInputEngine.cpp +++ b/src/inputpanel/QskInputEngine.cpp @@ -39,9 +39,7 @@ static inline QString qskKeyString( int keyCode ) static inline bool qskUsePrediction( Qt::InputMethodHints hints ) { constexpr Qt::InputMethodHints mask = - Qt::ImhNoPredictiveText | Qt::ImhHiddenText - | Qt::ImhDialableCharactersOnly | Qt::ImhEmailCharactersOnly - | Qt::ImhUrlCharactersOnly; + Qt::ImhNoPredictiveText | Qt::ImhExclusiveInputMask; return ( hints & mask ) == 0; } diff --git a/src/inputpanel/QskInputPanel.cpp b/src/inputpanel/QskInputPanel.cpp index 7246f073..70be6fb5 100644 --- a/src/inputpanel/QskInputPanel.cpp +++ b/src/inputpanel/QskInputPanel.cpp @@ -430,100 +430,37 @@ void QskInputPanel::processInputMethodQueries( Qt::InputMethodQueries queries ) echoMode = QskTextInput::NoEcho; } - if ( hints & Qt::ImhSensitiveData ) - { - } + /* + - Qt::ImhSensitiveData + - Qt::ImhNoAutoUppercase + - Qt::ImhMultiLine - if ( hints & Qt::ImhNoAutoUppercase ) - { - } + // we should start in a specific mode - if ( hints & Qt::ImhPreferNumbers ) - { - // we should start with having the number keys being visible - } + - Qt::ImhPreferNumbers + - Qt::ImhPreferUppercase + - Qt::ImhPreferLowercase + - Qt::ImhPreferLatin - if ( hints & Qt::ImhPreferUppercase ) - { - // we should start with having the upper keys being visible - } + // we should lock all other modes - if ( hints & Qt::ImhPreferLowercase ) - { - // we should start with having the upper keys being visible - } + - Qt::ImhFormattedNumbersOnly + - Qt::ImhUppercaseOnly + - Qt::ImhDialableCharactersOnly + - Qt::ImhEmailCharactersOnly + - Qt::ImhUrlCharactersOnly + - Qt::ImhLatinOnly - if ( hints & Qt::ImhNoPredictiveText ) - { - hasPrediction = false; - } + // we should have specific input panels - if ( hints & Qt::ImhDate ) - { - // we should have a date/time input - } + - Qt::ImhDate + - Qt::ImhTime + - Qt::ImhDigitsOnly + - Qt::ImhFormattedNumbersOnly + */ - if ( hints & Qt::ImhTime ) - { - // we should have a date/time input - } - - if ( hints & Qt::ImhPreferLatin ) - { - // conflicts with our concept of using the locale - } - - if ( hints & Qt::ImhMultiLine ) - { - // we need an implementation of QskTextEdit for this - } - - if ( hints & Qt::ImhDigitsOnly ) - { - // using a numpad instead of our virtual keyboard - hasPrediction = false; - } - - if ( hints & Qt::ImhFormattedNumbersOnly ) - { - // a numpad with decimal point and minus sign - hasPrediction = false; - } - - if ( hints & Qt::ImhUppercaseOnly ) - { - // locking all other keys - } - - if ( hints & Qt::ImhLowercaseOnly ) - { - // locking all other keys - } - - if ( hints & Qt::ImhDialableCharactersOnly ) - { - // characters suitable for phone dialing - hasPrediction = false; - } - - if ( hints & Qt::ImhEmailCharactersOnly ) - { - // characters suitable for email addresses - hasPrediction = false; - } - - if ( hints & Qt::ImhUrlCharactersOnly ) - { - // characters suitable for URLs - hasPrediction = false; - } - - if ( hints & Qt::ImhLatinOnly ) - { - // locking all other keys - } - - m_data->hasPrediction = hasPrediction; + m_data->hasPrediction = + !( hints & ( Qt::ImhNoPredictiveText | Qt::ImhExclusiveInputMask ) ); m_data->predictionBar->setVisible( hasPrediction && m_data->engine && m_data->engine->predictor() );