{
QObject::connect(findbox,
SIGNAL(clicked
()),
this,
SLOT(defaults
()));
}
void CPT::defaults()
{
//setting values for some variables (of integer type)
createFind();
fwin->show();
}
void CPT::createFind()
{
//QWidget *fwin is made as a member variable
fwin->setCaption("CP Trace Debug Tool : FIND");
fwin->setFixedSize(320,125);
fwin
->setFont
(QFont("SansSerif",
9));
fwin->setBackgroundColor(c1);
fvbox->setMargin(2);
fvbox->setSpacing(6);
fhbox1->setMargin(2);
fhbox1->setSpacing(8);
fl1->setBackgroundColor(c1);
fch
=new QCheckBox("Regular Expression",fwin
);
fch->setBackgroundColor(c1);
fhbox1->addWidget(fl1);
fhbox1->addWidget(fedit1);
fhbox1->addWidget(fch);
fhbox2->setMargin(2);
fhbox2->setSpacing(6);
fb1->setPaletteBackgroundColor(c1);
fb2->setPaletteBackgroundColor(c1);
fb3->setPaletteBackgroundColor(c1);
QObject::connect(fb1,
SIGNAL(clicked
()),
this,
SLOT(result_for
()));
QObject::connect(fb2,
SIGNAL(clicked
()),
this,
SLOT(result_bck
()));
QObject::connect(fb3,
SIGNAL(clicked
()),fwin,
SLOT(close
()));
fhbox2->addWidget(fb1);
fhbox2->addWidget(fb2);
fhbox2->addWidget(fb3);
// fwin->show();
}
CPT::CPT(QWidget *parent):QWidget(parent)
{
QPushButton *findbox=new QPushButton();
QObject::connect(findbox,SIGNAL(clicked()),this,SLOT(defaults()));
}
void CPT::defaults()
{
//setting values for some variables (of integer type)
createFind();
fwin->show();
}
void CPT::createFind()
{
//QWidget *fwin is made as a member variable
fwin=new QWidget;
fwin->setCaption("CP Trace Debug Tool : FIND");
fwin->setFixedSize(320,125);
fwin->setFont(QFont("SansSerif",9));
fwin->setBackgroundColor(c1);
QVBoxLayout *fvbox=new QVBoxLayout(fwin);
fvbox->setMargin(2);
fvbox->setSpacing(6);
QHBoxLayout *fhbox1=new QHBoxLayout(fvbox);
fhbox1->setMargin(2);
fhbox1->setSpacing(8);
QLabel *fl1=new QLabel("Find:",fwin);
fl1->setBackgroundColor(c1);
fedit1=new QLineEdit(fwin);
fch=new QCheckBox("Regular Expression",fwin);
fch->setBackgroundColor(c1);
fhbox1->addWidget(fl1);
fhbox1->addWidget(fedit1);
fhbox1->addWidget(fch);
QHBoxLayout *fhbox2=new QHBoxLayout(fvbox);
fhbox2->setMargin(2);
fhbox2->setSpacing(6);
QPushButton *fb1=new QPushButton("Forward",fwin);
fb1->setPaletteBackgroundColor(c1);
QPushButton *fb2=new QPushButton("Backward",fwin);
fb2->setPaletteBackgroundColor(c1);
QPushButton *fb3=new QPushButton("Close",fwin);
fb3->setPaletteBackgroundColor(c1);
QObject::connect(fb1,SIGNAL(clicked()),this,SLOT(result_for()));
QObject::connect(fb2,SIGNAL(clicked()),this,SLOT(result_bck()));
QObject::connect(fb3,SIGNAL(clicked()),fwin,SLOT(close()));
fhbox2->addWidget(fb1);
fhbox2->addWidget(fb2);
fhbox2->addWidget(fb3);
// fwin->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks