Hello,
I'm constructing multiple QDialogs from a button on a QMainWindow.
Each dialog gets filled with different data when constructed and I (may) edit this data.
I can find which dialogs have been edited and get the dialogs objectName when I click
the qmainwindow 'save' button.
Is it possible to access, say a QLabel->text() on one of the dialogs only knowing the dialogs objectName?
If 'yes, how?
Perhaps I should adopt a different approach.
Regards
{
Q_OBJECT
public:
...
{
...
class propForm : public QDialog
{
Q_OBJECT
public:
propForm(QWidget *parent = 0);
...
propForm::propForm(QWidget *parent) : QDialog(parent)
{
...
To copy to clipboard, switch view to plain text mode
void myMaiWindow::showDialogButton() // slot
{
cm::formCount += 1;
prop = new propForm(this);
prop
->setObjectName
("prop" + QString::number(cm
::formCount));
qDebug() << "name - " << prop->objectName();
}
void myMainWindow::saveButton() // slot
{
qDebug() << "Save - " << cm::filePath;
qDebug() << "last Lost - " << cm::formLostFocus << "\n";
QList<QDialog *> widgets = findChildren<QDialog *>();
qDebug() << widgets;
for (int i; i < cm::formCount; i++) {
// if edited get data and save the file
// getting the data is the don't know bit.
}
void myMaiWindow::showDialogButton() // slot
{
cm::formCount += 1;
prop = new propForm(this);
prop->setObjectName("prop" + QString::number(cm::formCount));
qDebug() << "name - " << prop->objectName();
}
void myMainWindow::saveButton() // slot
{
qDebug() << "Save - " << cm::filePath;
qDebug() << "last Lost - " << cm::formLostFocus << "\n";
QList<QDialog *> widgets = findChildren<QDialog *>();
qDebug() << widgets;
for (int i; i < cm::formCount; i++) {
// if edited get data and save the file
// getting the data is the don't know bit.
}
To copy to clipboard, switch view to plain text mode
Bookmarks