Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Classes  ·  Annotées  ·  Hiérarchie  ·  Fonctions  ·  Structure  · 

QWSInputMethod Class Reference


The QWSInputMethod class provides international input methods for Qt/Embedded. More...

#include <qwindowsystem_qws.h>

Inherits QObject.

List of all member functions.

Public Members

  • QWSInputMethod () 
  • virtual ~QWSInputMethod () 
  • virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) 
  • virtual void reset () 
  • virtual void setMicroFocus ( int x, int y ) 
  • virtual void mouseHandler ( int, int ) 
  • QFont font () const
  • QRect inputRect () const

Protected Members

  • void sendIMEvent ( QWSServer::IMState state, const QString & txt, int cpos, int selLen = 0 ) 

Detailed Description

The QWSInputMethod class provides international input methods for Qt/Embedded.

Subclass this to implement your own input method

An input methods consists of a keyboard filter and optionally a graphical interface. The keyboard filter intercepts key events from physical or virtual keyboards by implementing the filter() function.

Use sendIMEvent() to send composition events. Composition starts with the input method sending the first IMCompose event. This can be followed by a number of IMCompose events and ending with an IMEnd event.

The function setMicroFocus() is called when the focus widget changes its cursor position.

The functions font() and inputRect() provide more information about the state of the focus widget.

Use QWSServer::setCurrentInputMethod() to install an input method.


Member Function Documentation

QWSInputMethod::QWSInputMethod ()

Constructs a new input method.

QWSInputMethod::~QWSInputMethod () [virtual]

Destructs the input method uninstalling it if it is currently installed.

bool QWSInputMethod::filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) [virtual]

Must be implemented in subclasses to handle key input from physical or virtual keyboards. Returning TRUE will block the event from further processing.

All normal key events should be blocked while in compose mode (between IMCompose and IMEnd).

QFont QWSInputMethod::font () const

Returns the font of the current input widget.

QRect QWSInputMethod::inputRect () const

Returns the input rectangle of the current input widget. The input rectangle covers the width of the input widget, and may extend below it. This can be used to determine the geometry of an input widget for over-the-spot input methods.

void QWSInputMethod::mouseHandler ( int x, int state ) [virtual]

Implemented in subclasses to handle mouse presses/releases within the on-the-spot text. The parameter x is the offset within the string that was sent with the IMCompose event. state is either QWSServer::MousePress or QWSServer::MouseRelease

void QWSInputMethod::reset () [virtual]

Implemented in subclasses to reset the state of the input method.

void QWSInputMethod::sendIMEvent ( QWSServer::IMState state, const QString & txt, int cpos, int selLen = 0 ) [protected]

Causes a QIMEvent to be sent to the focus widget. state may be either QWSServer::IMCompose or QWSServer::IMEnd.

txt is the text being composed (or the finished text if state is IMEnd). cpos is the current cursor position.

If state is IMCompose, selLen is the number of characters in the composition string ( starting at cpos ) that should be marked as selected by the input widget receiving the event.

void QWSInputMethod::setMicroFocus ( int x, int y ) [virtual]

Implemented in subclasses to handle microFocusHint changes in the focus widget. x and y are the global coordinates of the cursor position.


Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 7
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 2.3
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web