hello squidge
yeh u r right..its working now by using grid layout..now hw can i decrease the space between each rows..moreever hw can i add textBrowser below..after all buttons are arranged in rows and colums..
my code is:u plz check it..
selectedDate
=QDate::currentDate();
int count=1,i,j;
[B
]QTextBrowser *T
=new QTextBrowser() //how can i add this text browser below after all the array of buttons are set[/B] for(i=0;i<7;i++)
{
for(j=0;j<7;j++)
{
if(count<=42)
{
button[i][j]->resize(40,40);
button[i][j]->move(40*j, 40*i);
button[i][j]->show();
controlsLayout->addWidget(button[i][j],i,j);
controlsLayout->setSpacing(0);
centralWidget->setLayout(controlsLayout);
setCentralWidget(centralWidget);
count++;
}
}
}
QWidget *centralWidget = new QWidget;
selectedDate=QDate::currentDate();
int count=1,i,j;
QPushButton *button[10][10];
QGridLayout *controlsLayout = new QGridLayout;
[B]QTextBrowser *T=new QTextBrowser() //how can i add this text browser below after all the array of buttons are set[/B]
for(i=0;i<7;i++)
{
for(j=0;j<7;j++)
{
if(count<=42)
{
button[i][j] = new QPushButton(QString::number(count));
button[i][j]->resize(40,40);
button[i][j]->move(40*j, 40*i);
button[i][j]->show();
controlsLayout->addWidget(button[i][j],i,j);
controlsLayout->setSpacing(0);
centralWidget->setLayout(controlsLayout);
setCentralWidget(centralWidget);
count++;
}
}
}
To copy to clipboard, switch view to plain text mode
with regards
Anshuman
Bookmarks