July 21, 2011

goosebumps4 goosebumps4
Lab Rat
34 posts

QLineEdit is not editable - error

 

I want to use a QLineEdit in order to input some text from the user, in an application designed for symbian. I am currently using a part of the Maps Demo example found in Qt Mobility, from the Qt Creator. I use a layout on top of the view on which the map is placed to display the QLineEdit. The problem is that I cannot input any text from the simulator. I have checked and the QLineEdit variable isn’t readOnly. What could be the problem?
Thank you.

5 replies

July 21, 2011

Chuck Gao Chuck Gao
Lab Rat
342 posts

Can not identify what was happened. Does your QLineEdit have focus? You can try set placeHolder text first, and see when you pressed your lineEdit widget, if there has focus or cursor.

 Signature 

Chuck

July 21, 2011

goosebumps4 goosebumps4
Lab Rat
34 posts

I can click on in and select the default text set previous, if that is what you mean.

Funny thing, is that i tried the same thing in a very simplified scenario: a map, loaded onto a scene, loaded onto a QGraphicsView and in the layout of the QGraphicsView the QLineEdit. The QLineEdit could be modified in this case. Somewhere something is wrong.

July 21, 2011

goosebumps4 goosebumps4
Lab Rat
34 posts
Chuck Gao wrote:
Can not identify what was happened. Does your QLineEdit have focus? You can try set placeHolder text first, and see when you pressed your lineEdit widget, if there has focus or cursor.

There is no focus or cursor …

July 21, 2011

goosebumps4 goosebumps4
Lab Rat
34 posts

I have even tried to set focus manually …. but nothing:

  1. void MapsWidget::showEvent(QShowEvent* e){
  2.     this->activateWindow();
  3.     this->userAnswer->setFocus();
  4.     QWidget::showEvent(e);
  5. }

July 21, 2011

goosebumps4 goosebumps4
Lab Rat
34 posts

I had along with the QLineEdit a QLabel and a QPushButton. When I added all of them on the layout, i should not specify label.setVisible(true), and pushButton.setVisible(true). This was the problem

 
  ‹‹ Get absoluto position of a widget in the framebuffer      [SOLVED] qml and qt: pressing buttons ››

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