....and you are still creating the dialog again and again.
You do not want to create a new instance of the dialog every time the button is pressed.
{
createFind(); // create the dialog ONLY ONCE
QObject::connect(findbox,
SIGNAL(clicked
()),
this,
SLOT(find
()));
}
void CPT::find()
{
// set your defaults here
fwin->show();
fwin->activateWindow();
fwin->raise();
}
void CPT::createFind()
{
// ...
}
CPT::CPT(QWidget *parent):QWidget(parent)
{
createFind(); // create the dialog ONLY ONCE
QPushButton *findbox=new QPushButton();
QObject::connect(findbox,SIGNAL(clicked()),this,SLOT(find()));
}
void CPT::find()
{
// set your defaults here
fwin->show();
fwin->activateWindow();
fwin->raise();
}
void CPT::createFind()
{
fwin = new QWidget;
// ...
}
To copy to clipboard, switch view to plain text mode
Bookmarks