It's not easy, but I try to explain:
The window is created as a library that is used as object in the main application.
Before the arrival of a message from the main aplicacatio, updated a number of areas of the window:
switch (consoleId) {
case 1:
{
itsRoleWindow->writeTF_roleConsole01(strdup(static_cast<char*> (roleActiveName[consoleId - 1])));
break;
}
case 2:
{
itsRoleWindow->writeTF_roleConsole02(strdup(static_cast<char*> (roleActiveName[consoleId - 1])));
break;
}
[...]
switch (consoleId) {
case 1:
{
itsRoleWindow->writeTF_roleConsole01(strdup(static_cast<char*> (roleActiveName[consoleId - 1])));
break;
}
case 2:
{
itsRoleWindow->writeTF_roleConsole02(strdup(static_cast<char*> (roleActiveName[consoleId - 1])));
break;
}
[...]
To copy to clipboard, switch view to plain text mode
Let's see what happens in the window:
void roleWindow::writeTF_roleConsole01(char* c)
{
GetForm()->setText(c,1);
}
void roleWindow::writeTF_roleConsole01(char* c)
{
GetForm()->setText(c,1);
}
To copy to clipboard, switch view to plain text mode
The class that receives it does this:
void impl_role::setText(char* c, int i)
{
emit(signalSetText(c,i));
}
void impl_role::setText(char* c, int i)
{
emit(signalSetText(c,i));
}
To copy to clipboard, switch view to plain text mode
connect( this, SIGNAL(signalSetText(char*, int)), this, SLOT(slotSetText(char*, int)) );
connect( this, SIGNAL(signalSetText(char*, int)), this, SLOT(slotSetText(char*, int)) );
To copy to clipboard, switch view to plain text mode
void impl_role::slotSetText(char* c, int i)
{
switch(i) {
case 1: TF_roleConsole01->setText(c); break;
case 2: TF_roleConsole02->setText(c); break;
case 3: TF_roleConsole03->setText(c); break;
case 4: TF_roleConsole04->setText(c); break;
case 5: TF_roleConsole05->setText(c); break;
case 6: TF_roleConsole06->setText(c); break;
case 7: TF_roleConsole07->setText(c); break;
default: break;
};
delete (c);
}
void impl_role::slotSetText(char* c, int i)
{
switch(i) {
case 1: TF_roleConsole01->setText(c); break;
case 2: TF_roleConsole02->setText(c); break;
case 3: TF_roleConsole03->setText(c); break;
case 4: TF_roleConsole04->setText(c); break;
case 5: TF_roleConsole05->setText(c); break;
case 6: TF_roleConsole06->setText(c); break;
case 7: TF_roleConsole07->setText(c); break;
default: break;
};
delete (c);
}
To copy to clipboard, switch view to plain text mode
with each TF_roleConsole0x really is ui-> TF_roleConsole0x;
Therefore, writes directly to each window Textfield.
I hope I explained more or less.
Bookmarks