input method stuff

This commit is contained in:
Uwe Rathmann 2018-06-05 11:20:54 +02:00
parent b17d8dcb68
commit e300755027
3 changed files with 12 additions and 6 deletions

View File

@ -162,9 +162,12 @@ QQuickItem* qskInputContextItem()
without losing the connected input item without losing the connected input item
*/ */
if ( inputContext->metaObject()->indexOfMethod( "inputItem()" ) >= 0 )
{
QMetaObject::invokeMethod( inputContext, "inputItem", QMetaObject::invokeMethod( inputContext, "inputItem",
Qt::DirectConnection, Q_RETURN_ARG( QQuickItem*, inputItem ) ); Qt::DirectConnection, Q_RETURN_ARG( QQuickItem*, inputItem ) );
} }
}
return inputItem; return inputItem;
} }

View File

@ -401,11 +401,14 @@ void QskInputContext::setActive( bool on )
bool QskInputContext::isActive() const bool QskInputContext::isActive() const
{ {
if ( auto panel = inputPanel() ) if ( m_data->inputEngine )
{ {
return panel && panel->isVisible() if ( auto panel = m_data->inputEngine->panel( false ) )
{
return panel->isVisible()
&& panel->window() && panel->window()->isVisible(); && panel->window() && panel->window()->isVisible();
} }
}
return false; return false;
} }

View File

@ -51,11 +51,11 @@ protected:
virtual void setPredictionEnabled( bool on ); virtual void setPredictionEnabled( bool on );
virtual void showPrediction( const QStringList& ); virtual void showPrediction( const QStringList& );
private:
void applyInput( bool success ); void applyInput( bool success );
void applyText( const QString&, bool isFinal ); void applyText( const QString&, bool isFinal );
void applyKey( int keyCode ); void applyKey( int keyCode );
private:
void resetPredictor( const QLocale& ); void resetPredictor( const QLocale& );
void updatePrediction(); void updatePrediction();