ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am programming a small app in Qt 4 and I am looking for a way to send data from a dialog..
I have a widget within the mainwindow which opens up a dialog, within the dialog the user is asked to input some data and then the user is supposed to press the Add-button. Now, when this button is pressed the dialog should close and the calling widget should take care of all the data the user gave the dialog and process it.
So my question is: how can I make the dialog send the data to the calling widget / make the calling widget fetch the data from the dialog?
I have connected the button to my own slot called saveAndClose().. This slot will check all QLineEdit and issue a warning if any of them are empty.. but whenever I try to access the text within a lineedit I get a seg fault..
I fixed the problem by connecting the lineedit signal textChanged to update m_name and then use that one instead in the saveAndClose() slot.
But I have a new problem. Now I want the dialog to fetch a QStringList from the calling widget..
I tried to do this in the calling widget
list << "Item1";
list << "Second item";
int ret = dialog.exec();
But it seems that after dialog.exec() gets called the internal property (QStringList m_list) gets cleared. Before I call dialog.exec I can call dialog.list() and I will get back my two strings. But in the constructor of the dialog the QStringList is empty..