You are not logged in.

1

Friday, June 21st 2013, 2:19pm

creating one string from multiple line edits

i have a project im working on in which i have to have 8 line edits in which to get 8 different hex values which will all be turned into one single value that will get sent over a tcp connection. Im having difficulty finding a way to get the values from the line edits into a variable such as a QStringList and then being able to print out that String list to see that all of them are there. The order of them is also important because if someone edits the fifth value then the fifth element of that list must change. If i could see a basic example of taking the value from a line edit and putting it into a variable or list as well as another line edit also sending a value to that same list and a way to print out the list that would be great. Since its hex values both numbers and letters are used.

Thanks in advance

_Blueman

Intermediate

  • "_Blueman" celebrates his birthday today
  • "_Blueman" is male

Posts: 196

Location: Poland

  • Send private message

2

Friday, June 21st 2013, 4:28pm

take text from lineEdit

Source code

1
lineEdit->text()


put to QStringList

Quoted

QStringList list;
list << lineEdit->text();


check what is in list

Quoted

qDebug() << "list elements:"<< list;


more details in class documentation.