go through this example
http://qt-project.org/doc/qt-4.8/widgets-lineedits.html
especially the echo mode ..
go through this example
http://qt-project.org/doc/qt-4.8/widgets-lineedits.html
especially the echo mode ..
"Behind every great fortune lies a crime" - Balzac
prasad1001 (5th February 2014)
Thanks for the quick reply...
i have set the echoMode to 'password'. And now when i type the password it displays nothing...means only cursor is moving.
Now how to replace those null characters to asterisks or hash symbols..
Thanks in advance...
The password echo mode does that, but the actual visualization depends on the widget style.
Try running your application with a different style if you don't like how the current one works.
Cheers,
_
did u given the echo mode like this . it should work ..
lineEdit->setEchoMode(QLineEdit::Password);
in you code ..
please post a minimal compactible code ..
or follow as anda mentioned in earlier reply. change style ..
"Behind every great fortune lies a crime" - Balzac
i have set the echoMode as stated by you...
mainwindow.h
private:
Ui::MainWindow *ui;
QLabel *labelPass;
mainwindow.cpp
linePass=ui->linePass;
linePass->setEchoMode(QLineEdit::Password);
but it getting a blank line edit even if i type in using password echo mode error.png
as shown in above fig..
and i also tested by setting password option in designer also...
please help me...
i have set the echoMode as stated by you...
mainwindow.h
private:
Ui::MainWindow *ui;
QLabel *labelPass;mainwindow.cpp
linePass=ui->linePass;
linePass->setEchoMode(QLineEdit::Password);but it getting a blank line edit even if i type in using password echo mode Click image for larger version Name: error.png Views: 6 Size: 13.2 KB ID: 10014
as shown in above fig..
and i also tested by setting password option in designer also...
please help me...
Repeating yourself will not change the outcome. Doing something to try to help yourself might.
Here is the complete, small, test case you could have written to confirm the behaviour:
Does it fail with this?Qt Code:
#include <QApplication> #include <QLineEdit> #include <QDebug> int main(int argc, char **argv) { QLineEdit l; l.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
If not then the problem in your program is external to the QLineEdit.
Have you applied a style sheet? Is the text/foreground colour white?
Does your font have a glyph for Unicode code points U+25CF or U+2022 because these are selected in preference to '*' which is the fallback option.
Last edited by ChrisW67; 6th February 2014 at 04:47. Reason: updated contents
prasad1001 (7th February 2014)
Thanks for the reply....
i was tested with ur code also sir..but i am gettting the same result with blank spaces..My Qt creator version is 2.6.1.
and i was not used the stylesheet for the lineEdit..
And i didn't get ur point about the font i.e.."Does your font have a glyph for Unicode code points U+25CF or U+2022"..
Thank you in advance..
Do you see dots the code prints in the debug output?
Sorry for the delay sir...
yes it prints the dots in debug output..
i was tried by changing the font styles also, but same problem i am getting..nothing displaying in the lineEdit...
Thanks in advance..
Have you tried a different widget style? Maybe the one you are currently using is just displaying spaces?
Cheers,
_
Thanks for the quick reply...
I was tried with a new dialog and created every thing new..but same result.....
Thanks in advance..
So the next thing would be to try my suggestion from comment #12
Cheers,
_
Bookmarks