input context changes

This commit is contained in:
Uwe Rathmann 2018-06-01 09:45:02 +02:00
parent b97a43008c
commit 221b573287
3 changed files with 25 additions and 91 deletions

View File

@ -5,7 +5,6 @@
#include "QskInputContext.h" #include "QskInputContext.h"
#include "QskInputPanel.h" #include "QskInputPanel.h"
#include "QskInputPanel.h"
#include "QskInputEngine.h" #include "QskInputEngine.h"
#include "QskLinearBox.h" #include "QskLinearBox.h"

View File

@ -39,9 +39,7 @@ static inline QString qskKeyString( int keyCode )
static inline bool qskUsePrediction( Qt::InputMethodHints hints ) static inline bool qskUsePrediction( Qt::InputMethodHints hints )
{ {
constexpr Qt::InputMethodHints mask = constexpr Qt::InputMethodHints mask =
Qt::ImhNoPredictiveText | Qt::ImhHiddenText Qt::ImhNoPredictiveText | Qt::ImhExclusiveInputMask;
| Qt::ImhDialableCharactersOnly | Qt::ImhEmailCharactersOnly
| Qt::ImhUrlCharactersOnly;
return ( hints & mask ) == 0; return ( hints & mask ) == 0;
} }

View File

@ -430,100 +430,37 @@ void QskInputPanel::processInputMethodQueries( Qt::InputMethodQueries queries )
echoMode = QskTextInput::NoEcho; 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 ) - Qt::ImhPreferNumbers
{ - Qt::ImhPreferUppercase
// we should start with having the number keys being visible - Qt::ImhPreferLowercase
} - Qt::ImhPreferLatin
if ( hints & Qt::ImhPreferUppercase ) // we should lock all other modes
{
// we should start with having the upper keys being visible
}
if ( hints & Qt::ImhPreferLowercase ) - Qt::ImhFormattedNumbersOnly
{ - Qt::ImhUppercaseOnly
// we should start with having the upper keys being visible - Qt::ImhDialableCharactersOnly
} - Qt::ImhEmailCharactersOnly
- Qt::ImhUrlCharactersOnly
- Qt::ImhLatinOnly
if ( hints & Qt::ImhNoPredictiveText ) // we should have specific input panels
{
hasPrediction = false;
}
if ( hints & Qt::ImhDate ) - Qt::ImhDate
{ - Qt::ImhTime
// we should have a date/time input - Qt::ImhDigitsOnly
} - Qt::ImhFormattedNumbersOnly
*/
if ( hints & Qt::ImhTime ) m_data->hasPrediction =
{ !( hints & ( Qt::ImhNoPredictiveText | Qt::ImhExclusiveInputMask ) );
// 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->predictionBar->setVisible( m_data->predictionBar->setVisible(
hasPrediction && m_data->engine && m_data->engine->predictor() ); hasPrediction && m_data->engine && m_data->engine->predictor() );