1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
int KeyboardWidget::createBtn(QHBoxLayout* row,
int span,
char normal,
char shift,
char caps,
char alt,
QString capAlt,
bool autoRepeat)
{
int id = m_allButtons.count();
KeyboardWidgetButton* btn = new KeyboardWidgetButton(this,
id,
c2s(normal),
c2s(shift),
c2s(caps),
c2s(alt),
capAlt);
row->addWidget(btn, span);
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
btn->setAutoRepeat(autoRepeat);
VERIFY(connect(btn, SIGNAL(takeAction(int)),
this, SLOT(buttonClicked(int))));
m_allButtons.append(btn);
return id;
}
|