Thank you for your answer :
here is a modification of the Fenprincipale.cpp , but it is still not working:



//FenPrincipale.cpp


#include "qDebug.h"
#include "FenPrincipale.h"


FenPrincipale::FenPrincipale()
{
int o,p;

tableWidget = new QTableWidget(2,2,this);
element = new QTableWidgetItem (1000);
for (o=0; o<2; o++)
{
for (p=0; p<2; p++)
{
(M[o][p])=false;

}
}

for (o=0; o<2; o++)
{
for (p=0; p<2; p++)
{
element=(tableWidget->item((o+1),(p+1)));
if ((element->text())=="1")
{
M[o][p]=true;
}
else
{
M[o][p]=false;
}
}
}

}




Thank you in advance for your help.