I'm having some trouble, I'm fairly new to Qt and C++ and was testing the waters so to say. Ill try to describe my problem as follows. I have a LineEdit QLineEdit
and this edit has a connection which looks like this:
connect(my_lineedit, SIGNAL (textEdited(QString)),this, SLOT (handleEdits()));
The handleEdits()
method gets called and does the following:
- Disconnect the previous Signal from
my_lineedit
- Create a new
QLineEdit
which gets a new signal and callshandleAddedEdits()
- Adds the newely created Edit to my layout.
The stated above works fine Im just telling you this so you get the picture.
Now in the new method which I called handleAddedEdits()
I want kinda the same procedure to happen again.
- Disconnect the Signal which calls
handleAddedEdits()
from the Edit which invoked this method in the first place. - Create a fresh
QLineEdit
- Add this to my layout.
The problem is: in the first case my_lineedit
is declared in my class so I can freely refer to it and and remove the signal as I wish. In the second case I have a QLineEdit
which was created dynamically in the handleEdits()
method and is the "Sender". My Question is, how can I refer to the "Sender Object" ro remove the Signal from the dynamically created edit?