FACT++  1.0
void MainWindow::MakeLEDs ( QPushButton **  arr,
QGridLayout *  lay,
const char *  slot 
) const
private

Definition at line 16 of file MainWindow.cc.

References i, and str.

Referenced by MainWindow().

17 {
18  arr[0]->setToolTip("Crate 0, Board 0, Index 0");
19 
20  for (int i=1; i<40; i++)
21  {
22  QPushButton *b = new QPushButton(static_cast<QWidget*>(arr[0]->parent()));
23 
24  b->setEnabled(arr[0]->isEnabled());
25  b->setSizePolicy(arr[0]->sizePolicy());
26  b->setMaximumSize(arr[0]->maximumSize());
27  b->setIcon(arr[0]->icon());
28  b->setIconSize(arr[0]->iconSize());
29  b->setCheckable(arr[0]->isCheckable());
30  b->setFlat(arr[0]->isFlat());
31 
32  ostringstream str;
33  str << "Crate " << i/10 << ", Board " << i%10 << ", Index " << i;
34  b->setToolTip(str.str().c_str());
35 
36  lay->addWidget(b, i/10+1, i%10+1, 1, 1);
37 
38  arr[i] = b;
39  }
40 
41  const QString name = arr[0]->objectName();
42 
43  for (int i=0; i<40; i++)
44  {
45  arr[i]->setObjectName(name+QString::number(i));
46  QObject::connect(arr[i], SIGNAL(clicked()), this, slot);
47  }
48 }
int i
Definition: db_dim_client.c:21
char str[80]
Definition: test_client.c:7

+ Here is the caller graph for this function: