call a function in another function
-
Hi
move test and testa to class definition.
then you can use it for the call
moveLine(test);
moveLine(testa);to be clear
in tabWidget .h
class tabWidget : xxxxxx {
...
QTextEdit *test;
QTextEdit *testa;
}and then in .cpp
you new them
testa=new QTextEdit(this);
...and PLEASE post real code and not images. its annoying to use for answering.
-
@Zunneh
Hi
Why do you want to give it a QLineEdit when you call it from
main program ?
It seems a bit messy.
Also what is the lineEdit ? You have some in tabWidget so i guess
a good question is what you plan to do with them? -
@mrjj
i created a QLineEdit in main program to move it with moveLine , now i want to add some conditions in moveH to callMoveLine(QLineEdit *test )
my objective is to minimise the code , i created the method moveLine(QLineEdit *test) and i want to call it in another methods ,
so my question is , how to call a method in another method in the same class ? -
@Zunneh
hiso function1 get a lineEdit
and later when you call function2, it must know the line
you got in function1?If you need to remember the QLineEdit, you must store it in the class.
- how to call a method in another method in the same class ?
you just call it. nothing extra. simply call it.
- how to call a method in another method in the same class ?