November 17, 2010

vasylp vasylp
Lab Rat
4 posts

QTextEdit and predictive input mode, part 2

 

This post continues the discussion, started in my previous post [developer.qt.nokia.com]

I’ve found some other issues, regarding this problem. To be concrete, I wrote some test code, and you could download the sources and binaries from here [bit.ly]

This test shows the fullscreen QTextEdit widget, where you can type any sort of text and the ‘Show’ softkey. This softkey shows the message box with the text, from the editor widget. The code is simple, and doesn’t set up any widget’s properties.

Now, ensure that T9 is on and try to do with this application the following:

  • Write A Sentence Where Each Word Starts From Capital Letter (I can’t do this)
  • Start the new sentence from the lowercase letter (Ensure you’ve typed dot and space before)
  • Start the first word in the editor from the uppercase letter.
  • Write a single word, without the trailing spaces and press ‘Show’ button (It shows me nothing, only the second press on ‘Show’ shows me the word).

This code was tested on Nokia 5800 XpressMusic and N8 against Qt 4.6.3 library. And I also couldn’t find any opened bugs related to this issue.

And here is the code:

main.h
  1. #include <QTextEdit>
  2. #include <QMainWindow>
  3.  
  4. class T9Test : public QMainWindow
  5. {
  6.   Q_OBJECT
  7. public:
  8.   T9Test(QWidget* parent = 0);
  9.  
  10. private slots:
  11.   void showText();
  12.  
  13. private:
  14.   QTextEdit* textField_;
  15. };

main.cpp

  1. #include "main.h"
  2. #include <QMessageBox>
  3. #include <QAction>
  4. #include <QApplication>
  5.  
  6. T9Test::T9Test(QWidget* parent):QMainWindow(parent)
  7. {
  8.   textField_ = new QTextEdit;
  9.   setCentralWidget(textField_);
  10.  
  11.   QAction* show = new QAction("Show", this);
  12.   show->setSoftKeyRole(QAction::PositiveSoftKey);
  13.   connect(show, SIGNAL(triggered()), this, SLOT(showText()));
  14.   addAction(show);
  15. }
  16.  
  17. void T9Test::showText()
  18. {
  19.   QMessageBox::information(this, "Text", textField_->toPlainText());
  20. }
  21.  
  22.  
  23. int main (int argc, char** argv)
  24. {
  25.   QApplication app(argc, argv);
  26.  
  27.   T9Test wnd;
  28.  
  29.   wnd.showMaximized();
  30.  
  31.   return app.exec();
  32. }

1 reply

November 18, 2010

Fuzzbender Fuzzbender
Lab Rat
71 posts

For auto-capitalization there seems to be some indication that there will be new input hints for it in Qt4.8.0:

 
  ‹‹ pkg_prerules for smartinstaller wrapper package      Qt for WinCE 6 ››

You must log in to post a reply. Not a member yet? Register here!