Hi, I want to get the current text from line edit and return its containing text to another class without using a signal/slot button. This process needs to happen only once. I can't think of anyway to do it right now.
Thanks in advance.
Hi, I want to get the current text from line edit and return its containing text to another class without using a signal/slot button. This process needs to happen only once. I can't think of anyway to do it right now.
Thanks in advance.
Hi, I want to get the current text from line edit and return its containing text to another class without using a signal/slot button. This process needs to happen only once. I can't think of anyway to do it right now.Qt Code:
void get_the_current_text_from_lineedit_and_return_containing_text_to_another_class_without_using_a_signal_or_slot(QLineEdit* lineedit, AnotherClass* otherClass) { otherClass->DoSomething(text); }To copy to clipboard, switch view to plain text mode
You're welcome.Thanks in advance.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Qt Code:
void get_the_current_text_from_lineedit_and_use_it_in_the_other_classes_method(QLineEdit *lineedit, AnotherClass *otherClass) { otherClass->setTextThatCanBeUsedElsewhere(text); } void AnotherClass::setTextThatCanBeUsedElsewhere(const QString &txt) { m_textThatCanBeUsedElsewhere = txt; } void AnotherClass::doSomethingWithTextSetWithSetTextThatCanBeUsedElsewhere() { doSomethingWith(m_textThatCanBeUsedElsewhere); }To copy to clipboard, switch view to plain text mode
You're welcome.
By the way, how is this problem related to Qt?
Bookmarks