c++ - Hide text in column as password dots in QtTableWidget -
I have a table (created by QTableWidget).
My table has 3 columns
#. User |
text and password appear nearby i.e. "user", "password"
I want to hide the text nearby:
"********" & lt; It means "password"
QLineEdit has a good option called "echomode" but it is only for QLineEdit.
I can change the text for * manually, but how do I read this text later in a table (in the classroom)?
I will set the table item " ***** "
, and store the real password as an item data with a special password. For example:
// Get the first line password items QTableWidgetItem * passwordItem = tableWidget- & gt; Items (0, 2); PasswordItem-> SetText ("*****"); PasswordItem-> SetData (QT :: UserRoll, "the_actual_password");
The actual password can be done in the same way:
real password = password item-> data (QT :: userroll) .stustring ();
Comments
Post a Comment