createBtn(row2, 1, 'q', 'Q', 'Q', 0xE5, 0xC5);
createBtn(row2, 1, 'w', 'W', 'W', 0xE6, 0xC6);
createBtn(row2, 1, 'e', 'E', 'E', 0xE7, 0xC7);
createBtn(row2, 1, 'r', 'R', 'R', 0xE8, 0xC8);
createBtn(row2, 1, 't', 'T', 'T', 0xE9, 0xC9);
createBtn(row2, 1, 'y', 'Y', 'Y', 0xEA, 0xCA);
createBtn(row2, 1, 'u', 'U', 'U', 0xEB, 0xCB);
createBtn(row2, 1, 'i', 'I', 'I', 0xEC, 0xCC);
createBtn(row2, 1, 'o', 'O', 'O', 0xED, 0xCD);
createBtn(row2, 1, 'p', 'P', 'P', 0xEE, 0xCE);
QString KeyboardWidget
::c2s(char value
) const {
// Correct for automatic mnemonics.
}
int span,
ushort normal,
ushort shift,
ushort caps,
ushort alt,
ushort capAlt,
bool autoRepeat)
{
int id = m_allButtons.count();
KeyboardWidgetButton* btn = new KeyboardWidgetButton(this,
id,
normal,
shift,
caps,
alt,
capAlt);
row->addWidget(btn, span);
btn->setAutoRepeat(autoRepeat);
VERIFY(connect(btn, SIGNAL(takeAction(int)),
this, SLOT(buttonClicked(int))));
m_allButtons.append(btn);
return id;
}
int span,
bool checkable,
int key,
const char* text,
bool autoRepeat)
{
int id = m_allButtons.count();
KeyboardWidgetButton
* btn
= new KeyboardWidgetButton
(this, id, key,
QLatin1String(text
));
row->addWidget(btn, span);
btn->setCheckable(checkable);
btn->setAutoRepeat(autoRepeat);
VERIFY(connect(btn, SIGNAL(takeAction(int)),
this, SLOT(buttonClicked(int))));
m_allButtons.append(btn);
return id;
}
QHBoxLayout* row2 = new QHBoxLayout();
createBtn(row2, 1, 'q', 'Q', 'Q', 0xE5, 0xC5);
createBtn(row2, 1, 'w', 'W', 'W', 0xE6, 0xC6);
createBtn(row2, 1, 'e', 'E', 'E', 0xE7, 0xC7);
createBtn(row2, 1, 'r', 'R', 'R', 0xE8, 0xC8);
createBtn(row2, 1, 't', 'T', 'T', 0xE9, 0xC9);
createBtn(row2, 1, 'y', 'Y', 'Y', 0xEA, 0xCA);
createBtn(row2, 1, 'u', 'U', 'U', 0xEB, 0xCB);
createBtn(row2, 1, 'i', 'I', 'I', 0xEC, 0xCC);
createBtn(row2, 1, 'o', 'O', 'O', 0xED, 0xCD);
createBtn(row2, 1, 'p', 'P', 'P', 0xEE, 0xCE);
QString KeyboardWidget::c2s(char value) const
{
// Correct for automatic mnemonics.
if (value=='&') return QLatin1String("&&");
else return QString(static_cast<QChar>(QLatin1Char(value)));
}
int KeyboardWidget::createBtn(QHBoxLayout* row,
int span,
ushort normal,
ushort shift,
ushort caps,
ushort alt,
ushort capAlt,
bool autoRepeat)
{
int id = m_allButtons.count();
KeyboardWidgetButton* btn = new KeyboardWidgetButton(this,
id,
normal,
shift,
caps,
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;
}
int KeyboardWidget::createBtn(QHBoxLayout* row,
int span,
bool checkable,
int key,
const char* text,
bool autoRepeat)
{
int id = m_allButtons.count();
KeyboardWidgetButton* btn = new KeyboardWidgetButton(this, id, key, QLatin1String(text));
row->addWidget(btn, span);
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
btn->setCheckable(checkable);
btn->setAutoRepeat(autoRepeat);
VERIFY(connect(btn, SIGNAL(takeAction(int)),
this, SLOT(buttonClicked(int))));
m_allButtons.append(btn);
return id;
}
To copy to clipboard, switch view to plain text mode
Bookmarks