I am not quite sure I understand the problem.
Lets say you have a custom widget MyWidget and in your MainForm you have that as a child (promoted in designer).
So you can access the MyWidget instance something like this
ui->myWidget
ui->myWidget
To copy to clipboard, switch view to plain text mode
MyWidget has, as an implementation details, a label and you want to set its text. Since the label is a internal detal of MyWidget and this encapsulated in MyWidget, you need a way to access it through the MyWidget API (see basic OOP principles).
void MyWidget
::setText(const QString &text
) {
// set text on label
}
void MyWidget::setText(const QString &text)
{
// set text on label
}
To copy to clipboard, switch view to plain text mode
You can make that a slot and connect to it from MainForm
connect(someSource,
SIGNAL(someSignal
(QString)), ui
->myWidget,
SLOT(setText
(QString)));
connect(someSource, SIGNAL(someSignal(QString)), ui->myWidget, SLOT(setText(QString)));
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks