Hm.. it is not working!
I write some app which show, that we can't using tab for move focus
#include <QtGui>
class Widget : public QWidget
{
public:
Widget()
{
buttons = new QPushButton[5];
QButtonGroup *buttonGroup = new QButtonGroup;
QVBoxLayout *buttonsLayout = new QVBoxLayout;
buttonGroup->setExclusive(false);
for (int i = 0; i < 5; i++) {
buttons[i].setAutoExclusive(false);
buttons[i].setCheckable(true);
buttonGroup->addButton(&buttons[i]);
buttonsLayout->addWidget(&buttons[i]);
buttons[i].setText("button#" + QString().setNum(i));
}
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addLayout(buttonsLayout);
setLayout(mainLayout);
setFixedSize(sizeHint());
};
private:
QPushButton *buttons;
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
Widget *widget = new Widget;
widget->show();
return app.exec();
};
#include <QtGui>
class Widget : public QWidget
{
public:
Widget()
{
buttons = new QPushButton[5];
QButtonGroup *buttonGroup = new QButtonGroup;
QVBoxLayout *buttonsLayout = new QVBoxLayout;
buttonGroup->setExclusive(false);
for (int i = 0; i < 5; i++) {
buttons[i].setAutoExclusive(false);
buttons[i].setCheckable(true);
buttonGroup->addButton(&buttons[i]);
buttonsLayout->addWidget(&buttons[i]);
buttons[i].setText("button#" + QString().setNum(i));
}
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addLayout(buttonsLayout);
setLayout(mainLayout);
setFixedSize(sizeHint());
};
private:
QPushButton *buttons;
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
Widget *widget = new Widget;
widget->show();
return app.exec();
};
To copy to clipboard, switch view to plain text mode
Any ideas?
Bookmarks