Hai
I have some doubts on data sharing between UI Dialogs or Classes.
I want to get the value of textedit in another window.like that.
suggestion please
suree
Bangalore
Hai
I have some doubts on data sharing between UI Dialogs or Classes.
I want to get the value of textedit in another window.like that.
suggestion please
suree
Bangalore
take a look at the dialogs example which comes with qt
Create the instance of the class wherever you want to get the value of that class and write public function to get the value of controls.
Ex: if classA contains the textedit and you want to access the value in classB use the instance of classA in class B and expose a method in classA to get the value of textedit and use it in classB by calling it.
Store the lineedit value in a variable and call it in the other form using extern below is the code snippet
int input1;
input = lineEdit->text().toInt();
In the next window.cpp use
extern int input1;
ineEdit->setText(QString::number(input1,10 ) );
Hope this helps
This question was asked before. Several times. Please use the search engine of the forum.
Solutions: A signal/slot connection or a pointer to the other dialog.
Bookmarks