0

quick Explanation, im still in HS and trying to put together a little project, basically its some kind of messenger app using our school's servers.

Of course, for that, you need a login window, with account management and stuff. The account management part is already done, leaving only the part where i put everything together, connecting the buttons to actions and etc.

So i made slots for that :

Slots :

The problem is that my whole app crashes as soon as i try to read the text in the QLineEdits from the window's slot

(m_nickname and m_password are the two QLineEdit where the username and password are typed in) (m_login and m_signup are the two buttons to login and signup)

Also, here is my whole class definition if that helps : .cpp .h

Thanks in advance to anyone who tries to help me :-)

Anthony
  • 97
  • 5
  • 1
    Welcome! Please see [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask), specifically, the section on [why you shouldn't post images of code](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557). – Lucan May 10 '21 at 10:01

1 Answers1

0

It crash's cause of segmentation fault. you didn't assign an address for this two QLineEdits. what you actually did in constructor is defining another QLineEdit m_nickname and m_password and your class member variable did not locate in memmory
change your constructor where you define these QLineEdits like this:

instead of

QLineEdit *m_nickname = new QLineEdit();

write

m_nickname = new QLineEdit();

and instead of

QLineEdit *m_password = new QLineEdit();

write

m_password = new QLineEdit();
Pouya Imani
  • 182
  • 8