public class PrecoMur {
ArrayList data=FenetrePrincipale.mursEdit.getNomsMurs();
ArrayList data1=FenetrePrincipale.mursEdit.getEpaisseursMurs();
ArrayList data2=FenetrePrincipale.mursEdit.getSurfacesMurs();
ArrayList data3=FenetrePrincipale.mursEdit.getReMurs();
ArrayList <PrecoMurB> qg=new ArrayList <PrecoMurB> ();
//constructeur
public PrecoMur()
{
ArrayList<String> labels = new ArrayList<String>();
labels.add("Nom");
labels.add("Surface");
labels.add("Epaisseur");
labels.add("Re");
labels.add("Preco");
labels.add("Modifier");
labels.add("");
table.setHorizontalHeaderLabels(labels);
table.setGridStyle(Qt.PenStyle.NoPen);
table.setAlternatingRowColors(true);
this.qg=addLigne();
glayout.addWidget(table);
for (int i=0;i<qg.size();i++)
{
qg.get(i).p.clicked.connect(this, "preconiser()");
qg.get(i).m.clicked.connect(this,"modifier()");
}
//insérer le tableau dans la groupbox infospreco
Preconisations.gb.setLayout(glayout);
}
private ArrayList addLigne() {
// TODO Auto-generated method stub
table.setRowCount(data.size());
ArrayList q= new ArrayList ();
for (int i=0;i<data.size();i++)
{
c.setEnabled(false);
modifierpreco.setMaximumHeight(20);
modifierpreco.setMinimumHeight(20);
modifierpreco.setMaximumWidth(50);
modifierpreco.setMinimumWidth(50);
PrecoMurB b=new PrecoMurB(fairepreco,modifierpreco,c,i);
table.
setCellWidget(i,
0,
new QLabel((String
) data.
get(i
)));
table.
setCellWidget(i,
2,
new QLabel(data1.
get(i
)+" cm"));
table.
setCellWidget(i,
1,
new QLabel(data2.
get(i
)+" m²"));
table.
setCellWidget(i,
3,
new QLabel(data3.
get(i
)+" K.m²/W"));
table.setCellWidget(i, 4, b.p);
table.setCellWidget(i, 5, b.m);
table.setCellWidget(i, 6, b.c);
q.add(b);
}
table.update();
return q;
}
public void preconiser()
{
System.out.println("AAAA");
}
public class PrecoMur {
QTableWidget table = new QTableWidget(0,7);
private QVBoxLayout glayout = new QVBoxLayout();
ArrayList data=FenetrePrincipale.mursEdit.getNomsMurs();
ArrayList data1=FenetrePrincipale.mursEdit.getEpaisseursMurs();
ArrayList data2=FenetrePrincipale.mursEdit.getSurfacesMurs();
ArrayList data3=FenetrePrincipale.mursEdit.getReMurs();
ArrayList <PrecoMurB> qg=new ArrayList <PrecoMurB> ();
//constructeur
public PrecoMur()
{
ArrayList<String> labels = new ArrayList<String>();
labels.add("Nom");
labels.add("Surface");
labels.add("Epaisseur");
labels.add("Re");
labels.add("Preco");
labels.add("Modifier");
labels.add("");
table.setHorizontalHeaderLabels(labels);
table.setGridStyle(Qt.PenStyle.NoPen);
table.setAlternatingRowColors(true);
this.qg=addLigne();
glayout.addWidget(table);
for (int i=0;i<qg.size();i++)
{
qg.get(i).p.clicked.connect(this, "preconiser()");
qg.get(i).m.clicked.connect(this,"modifier()");
}
//insérer le tableau dans la groupbox infospreco
Preconisations.gb.setLayout(glayout);
}
private ArrayList addLigne() {
// TODO Auto-generated method stub
table.setRowCount(data.size());
ArrayList q= new ArrayList ();
for (int i=0;i<data.size();i++)
{
QPushButton fairepreco=new QPushButton("Préconiser");
QPushButton modifierpreco=new QPushButton("Modifier");
QCheckBox c=new QCheckBox();
c.setEnabled(false);
modifierpreco.setMaximumHeight(20);
modifierpreco.setMinimumHeight(20);
modifierpreco.setMaximumWidth(50);
modifierpreco.setMinimumWidth(50);
PrecoMurB b=new PrecoMurB(fairepreco,modifierpreco,c,i);
table.setCellWidget(i, 0, new QLabel((String) data.get(i)));
table.setCellWidget(i, 2, new QLabel(data1.get(i)+" cm"));
table.setCellWidget(i, 1, new QLabel(data2.get(i)+" m²"));
table.setCellWidget(i, 3, new QLabel(data3.get(i)+" K.m²/W"));
table.setCellWidget(i, 4, b.p);
table.setCellWidget(i, 5, b.m);
table.setCellWidget(i, 6, b.c);
q.add(b);
}
table.update();
return q;
}
public void preconiser()
{
System.out.println("AAAA");
}
To copy to clipboard, switch view to plain text mode
Bookmarks