erichong81
26th March 2010, 01:38
hi there!
when i have made a application with imagebutton which come from Qpushbutton.
and I have just made stackedWidget in QtDesigner.
and i put my button widget in editor. like this...
QPixmap *sImg1 = new QPixmap("images/go_contact.png");
QPixmap *sImg2 = new QPixmap("images/go_contact_press.png");
QString *startTitle = new QString("Start");
startBtn = new CImageButton(startTitle, this);
startBtn->setGeometry((width()-373)/2, 200, 373, 71);
startBtn->setImage(sImg1, sImg2);
ui.stackedWidget->insertWidget(0, startBtn);
startBtn->show();
connect(startBtn, SIGNAL(clicked()), this, SLOT(clicked_start_btn())
nomally most widget is show state in QtDesigner.
the button is my own button so i realized that i need show() method to draw button on screen.
so that i can see the button.. but the button doesn't work.. no event.... what happen~~~
please give me a hint as soon as possible.. thank you!
when i have made a application with imagebutton which come from Qpushbutton.
and I have just made stackedWidget in QtDesigner.
and i put my button widget in editor. like this...
QPixmap *sImg1 = new QPixmap("images/go_contact.png");
QPixmap *sImg2 = new QPixmap("images/go_contact_press.png");
QString *startTitle = new QString("Start");
startBtn = new CImageButton(startTitle, this);
startBtn->setGeometry((width()-373)/2, 200, 373, 71);
startBtn->setImage(sImg1, sImg2);
ui.stackedWidget->insertWidget(0, startBtn);
startBtn->show();
connect(startBtn, SIGNAL(clicked()), this, SLOT(clicked_start_btn())
nomally most widget is show state in QtDesigner.
the button is my own button so i realized that i need show() method to draw button on screen.
so that i can see the button.. but the button doesn't work.. no event.... what happen~~~
please give me a hint as soon as possible.. thank you!