Fetch text on array of buttons and set it on textbrwoser when clicked on a button.
-
Hello friends,I have created an array of buttons ,can u tell me how shall i interact with each button,i mean when i click any of the buttons,i shouls be able to open a new window,(the same window)..below is my code how created an array of buttons
@for(i=0;i<6;i++)
{
for(j=1;j<=7;j++)
{
cellBut[i][j]=new QPushButton;controlsLayout->addWidget(cellBut[i][j], i, j);
}@regards
imrrk -
Hi,
You can use Signal Mapper.
Take a look at this demo, it can help you: http://doc.qt.nokia.com/qq/qq10-signalmapper.html -
why not just make a loop with a connect in it?
-
Because, i guess, he also want to know which button was pressed, and why to create n SLOT when you can create one, that can handle all buttons?
-
ok thanks i will go through it
-
hello friends i have done it..
-
hello friends,how to fecth the text on array of buttons and set it into a textbrowser..
reagards
imrrk -
hello friends,how to fecth the text on array of buttons,suppose i have a grid of buttons with text 1-10 on it,so when i click on a button with 1 as the text,it should be shown on a textbrowser..
regards
imrrk[merged this here, Tobias]
-
connect the signal of the button to a slot of yours and use QPushButton::text()
-
ok thanks gerolf..