Hi guys,
This is a for loop of the code positioning and giving sizes to 22 buttons:
for(int i=0; i<texts.size(); ++i)
{
connect(button, SIGNAL(clicked(bool)),
signalMapper, SLOT(map()));
button -> setFixedSize(50,30);
signalMapper -> setMapping(button, texts[i]);
gridLayout -> addWidget(button, i/5, i%5);
}
for(int i=0; i<texts.size(); ++i)
{
QPushButton* button = new QPushButton(texts[i]);
connect(button, SIGNAL(clicked(bool)),
signalMapper, SLOT(map()));
button -> setFixedSize(50,30);
signalMapper -> setMapping(button, texts[i]);
gridLayout -> addWidget(button, i/5, i%5);
}
To copy to clipboard, switch view to plain text mode
The image is in the following link:
http://uploads.im/BCXZu.jpg
First I want to change the position of the buttons. For example arrange them. And make some ones smaller/bigger that other ones.
Then to give the buttons some colors to appear nice.
How to do these please? Should I firstly remove the gridlayout?
I wrote the app only in C++ code and didn't use the Designer.
Bookmarks