src/hbplugins/inputmethods/touchinput/hbinputqwertynumerictouchkeyboard.cpp
changeset 34 ed14f46c0e55
parent 7 923ff622b8b9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
   188             if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) {
   188             if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) {
   189                 HbInputButton *item = buttons.at(i);
   189                 HbInputButton *item = buttons.at(i);
   190                 if (charKeyCount < 10) {
   190                 if (charKeyCount < 10) {
   191                     item->setText(numberCharacterBoundToKey((charKeyCount + 1) % 10),
   191                     item->setText(numberCharacterBoundToKey((charKeyCount + 1) % 10),
   192                     HbInputButton::ButtonTextIndexPrimary);  
   192                     HbInputButton::ButtonTextIndexPrimary);  
   193                     charKeyCount++;					
   193                     charKeyCount++;                 
   194                 } else {
   194                 } else {
   195                     if (key < characters.count()) {
   195                     if (key < characters.count()) {
   196                         item->setText(characters.at(key), HbInputButton::ButtonTextIndexPrimary);
   196                         item->setText(characters.at(key), HbInputButton::ButtonTextIndexPrimary);
   197                     } else {
   197                     } else {
   198                         item->setText(QString(), HbInputButton::ButtonTextIndexPrimary);
   198                         item->setText(QString(), HbInputButton::ButtonTextIndexPrimary);
   199                     }
   199                     }
   200                     ++key;
   200                     ++key;
   201                 }					
   201                 }                   
   202             }
   202             }
   203         }
   203         }
   204         buttonGroup->setButtons(buttons);
   204         buttonGroup->setButtons(buttons);
   205     }
   205     }
   206 }
   206 }
   211         const HbKeyboardMap* keyboardMap = mKeymap->keyboard(HbKeyboardSctLandscape);
   211         const HbKeyboardMap* keyboardMap = mKeymap->keyboard(HbKeyboardSctLandscape);
   212         if (!keyboardMap) {
   212         if (!keyboardMap) {
   213             return;
   213             return;
   214         }
   214         }
   215         QString chars;
   215         QString chars;
   216 		
   216         
   217         foreach (const HbMappedKey* mappedKey, keyboardMap->keys) {
   217         foreach (const HbMappedKey* mappedKey, keyboardMap->keys) {
   218             chars.append(mappedKey->characters(HbModifierNone));
   218             chars.append(mappedKey->characters(HbModifierNone));
   219         }          
   219         }          
   220             HbInputFocusObject *focusedObject = mOwner->focusObject();
   220             HbInputFocusObject *focusedObject = mOwner->focusObject();
   221             QString allowedChars;
   221             QString allowedChars;
   223                 focusedObject->filterStringWithEditorFilter(chars, allowedChars);
   223                 focusedObject->filterStringWithEditorFilter(chars, allowedChars);
   224             }
   224             }
   225             // Remove digits from it ( digits always come in the first row )
   225             // Remove digits from it ( digits always come in the first row )
   226             for (int i=0; i < 10; i++) {
   226             for (int i=0; i < 10; i++) {
   227                 allowedChars.remove(numberCharacterBoundToKey(i));
   227                 allowedChars.remove(numberCharacterBoundToKey(i));
   228             }	
   228             }   
   229 			
   229             
   230             foreach (QChar sctChar, allowedChars) {
   230             foreach (QChar sctChar, allowedChars) {
   231                 if (!characters.contains(sctChar)) {
   231                 if (!characters.contains(sctChar)) {
   232                     characters.append(sctChar);
   232                     characters.append(sctChar);
   233                 }
   233                 }
   234             }
   234             }