PDA

View Full Version : Button Table



vinod sharma
10th May 2010, 07:13
I'm trying to create a table which will contain 16000 button so that when i press a particular button the number it contain will be triggered, so that i can use that number further use. I am doing it using QTableWidget and QTableWidgetItem but i am not getting my required thing. So please guide me. My OS is Win XP, Qt 4.5
waiting for suggestion.

Here's the code snippet:

frame = new QFrame(this, Qt::Widget);
tableWidget = new QTableWidget(row, column, frame);
tableWidget->setStyleSheet(QString::fromUtf8("background-color: rgb(170, 255, 127);"));
frame->setGeometry(300, 250, 250, 200);
tableWidget->resize(200, 150);
tableWidget->verticalHeader()->hide();
tableWidget->horizontalHeader()->hide();
QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg((row+1)*(column+1)));
tableWidget->setItem(row, column, newItem);
tableWidget->setVisible(true);
frame->show();

I am sending you all an attachment what i require.
Thanks for your suggestion.
With regards
vinod

squidge
10th May 2010, 07:45
So what are you getting instead of what you are expecting?

Ginsengelf
10th May 2010, 09:05
(...) a table which will contain 16000 button (...)
Hi, I think there should be a better way to achieve your goal instead of creating this many buttons. If I understood you correctly you want to use the number the button represents, so I think some simpler input widget would be more suitable.

Ginsengelf

vinod sharma
10th May 2010, 09:32
I am sending you what i got "join1".

thanks for your reply
vinod

vinod sharma
10th May 2010, 09:35
i attached what i am getting from above code "join1". What i want is "join".

vinod sharma
10th May 2010, 10:01
Hi, I think there should be a better way to achieve your goal instead of creating this many buttons. If I understood you correctly you want to use the number the button represents, so I think some simpler input widget would be more suitable.

Ginsengelf

i send what i am getting please check it.
thanks for your reply

squidge
10th May 2010, 12:37
So the problem is?

vinod sharma
11th May 2010, 08:33
thanks for giving your time.
My problem is whenever i click on any widget it will show a popup table containing series of button as shown in attachment "join.png".
Whenever i press on any button present in that table it will give me the value that button poses.

squidge
11th May 2010, 10:44
I would suggest you subclass QTableView into a custom widget.