PDA

View Full Version : QTableWidget and DoubleClicked(QtableWidgetItem *) problem



skrzypu
10th August 2007, 10:46
Hi,

When I doubleclick in item of QTableWidget it connect with given slot.
This slot for end of it functionality send signal, there is nothing after this signal.
Siganal run method which delete current class in center of MainWidget and show another.
But my program don't show this another, program close.

When I use button to emit these same signal everythink is ok.

Everything is in deleted widget.

Anybody knows why is that??

aiprober
10th August 2007, 11:08
show some code,
it is not clear what you are talking about.

jpn
10th August 2007, 12:44
Seeing some code would indeed help in understanding the problem. Sounds like QObject::deleteLater() might be required.

skrzypu
11th August 2007, 10:00
Important code:


class1
{
class1
{
...
connect(this->ui.List,SIGNAL(itemDoubleClicked(QTableWidgetItem *)),this,SLOT(slot1(QTableWidgetItem *)));
...less important things
}

...
slot1
{
emit this->anotherView();
}
}

and in main class:


MainClass
{
...
//anotherView run this method:
void changeanotherWidget(){
QWidget *buffor;
buffor = this->centralWidget();
if(buffor)
delete buffor;

this->anotherWidget= new AnotherWidget();
this->setCentralWidget(viewPatient);

...
//some connections
...
}
}

there is no more, i connect to signal anotherView only this slot

QObject::deleteLater -- don't help