Easiest is to provide a pointer to the widget(s) in the dialog constructor and, for example, save the pointer in a member variable of your class which is derived from QDialog. This way all methods of your dialog class can access the widget(s).
Header file
{
Q_OBJECT
public: // Operations
// ctor
private: // Attributes
....
class MyDialog : public QDialog
{
Q_OBJECT
public: // Operations
// ctor
MyDialog(QWidget* parent, QWidget* myOtherWidget);
private: // Attributes
QWidget* m_otherWidget;
....
To copy to clipboard, switch view to plain text mode
Implementation file
m_otherWidget(myOtherWidget)
{
...
m_otherWidget->callWhateverMethodIsAccessibleFromThatWidget();
...
}
MyDialog::MyDialog(QWidget* parent, QWidget* myOtherWidget)
: QDialog(parent),
m_otherWidget(myOtherWidget)
{
...
m_otherWidget->callWhateverMethodIsAccessibleFromThatWidget();
...
}
To copy to clipboard, switch view to plain text mode
Ernst
Bookmarks