mirror of
https://github.com/rodamaral/lsnes.git
synced 2025-04-02 10:42:15 -04:00
30 lines
684 B
C++
Executable file
30 lines
684 B
C++
Executable file
Geometry pButton::minimumGeometry() {
|
|
Geometry geometry = pFont::geometry(qtWidget->font(), button.state.text);
|
|
return { 0, 0, geometry.width + 20, geometry.height + 12 };
|
|
}
|
|
|
|
void pButton::setText(const string &text) {
|
|
qtButton->setText(QString::fromUtf8(text));
|
|
}
|
|
|
|
void pButton::constructor() {
|
|
qtWidget = qtButton = new QPushButton;
|
|
connect(qtButton, SIGNAL(released()), SLOT(onActivate()));
|
|
|
|
pWidget::synchronizeState();
|
|
setText(button.state.text);
|
|
}
|
|
|
|
void pButton::destructor() {
|
|
delete qtButton;
|
|
qtWidget = qtButton = 0;
|
|
}
|
|
|
|
void pButton::orphan() {
|
|
destructor();
|
|
constructor();
|
|
}
|
|
|
|
void pButton::onActivate() {
|
|
if(button.onActivate) button.onActivate();
|
|
}
|