code format
This commit is contained in:
@@ -20,7 +20,7 @@ void TouchButtFrame::addButton(const QString & caption) {
|
||||
butt->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
butt->setCheckable(true);
|
||||
butt->setAutoExclusive(true);
|
||||
//butt->setAutoFillBackground(true);
|
||||
// butt->setAutoFillBackground(true);
|
||||
lay->addWidget(butt);
|
||||
this->setLayout(lay);
|
||||
connect(butt, SIGNAL(clickedID(int)), SLOT(butt_click(int)));
|
||||
@@ -49,8 +49,10 @@ void TouchButtFrame::setButtons(const QStringList & captions) {
|
||||
deleteButtons();
|
||||
for (int i = 0; i < captions.size(); ++i)
|
||||
addButton(QString(captions.at(i)).replace("\\n", "\n"));
|
||||
if (button(cur) != 0) button(cur)->setChecked(true);
|
||||
else if (!captions.isEmpty()) button(0)->setChecked(true);
|
||||
if (button(cur) != 0)
|
||||
button(cur)->setChecked(true);
|
||||
else if (!captions.isEmpty())
|
||||
button(0)->setChecked(true);
|
||||
resetColors();
|
||||
}
|
||||
|
||||
@@ -79,7 +81,6 @@ QStringList TouchButtFrame::buttons() {
|
||||
|
||||
|
||||
TouchButton * TouchButtFrame::button(int index) {
|
||||
if (index >= 0 && index < lay->count())
|
||||
return (qobject_cast<TouchButton * >(lay->itemAt(index)->widget()));
|
||||
if (index >= 0 && index < lay->count()) return (qobject_cast<TouchButton *>(lay->itemAt(index)->widget()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user