Results 1 to 9 of 9

Thread: Button Table

  1. #1
    Join Date
    Jan 2010
    Location
    Bhubaneswar, Odisha
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Button Table

    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:
    Qt Code:
    1. frame = new QFrame(this, Qt::Widget);
    2. tableWidget = new QTableWidget(row, column, frame);
    3. tableWidget->setStyleSheet(QString::fromUtf8("background-color: rgb(170, 255, 127);"));
    4. frame->setGeometry(300, 250, 250, 200);
    5. tableWidget->resize(200, 150);
    6. tableWidget->verticalHeader()->hide();
    7. tableWidget->horizontalHeader()->hide();
    8. QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg((row+1)*(column+1)));
    9. tableWidget->setItem(row, column, newItem);
    10. tableWidget->setVisible(true);
    11. frame->show();
    To copy to clipboard, switch view to plain text mode 

    I am sending you all an attachment what i require.
    Thanks for your suggestion.
    With regards
    vinod
    Attached Images Attached Images
    Last edited by wysota; 10th May 2010 at 08:58. Reason: missing [code] tags

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Button Table

    So what are you getting instead of what you are expecting?

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    509
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Button Table

    Quote Originally Posted by vinod sharma View Post
    (...) 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

  4. #4
    Join Date
    Jan 2010
    Location
    Bhubaneswar, Odisha
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Button Table

    I am sending you what i got "join1".

    thanks for your reply
    vinod
    Attached Images Attached Images

  5. #5
    Join Date
    Jan 2010
    Location
    Bhubaneswar, Odisha
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Button Table

    i attached what i am getting from above code "join1". What i want is "join".

  6. #6
    Join Date
    Jan 2010
    Location
    Bhubaneswar, Odisha
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Button Table

    Quote Originally Posted by Ginsengelf View Post
    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

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Button Table

    So the problem is?

  8. #8
    Join Date
    Jan 2010
    Location
    Bhubaneswar, Odisha
    Posts
    25
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Button Table

    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.

  9. #9
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Button Table

    I would suggest you subclass QTableView into a custom widget.

  10. The following user says thank you to squidge for this useful post:

    vinod sharma (11th May 2010)

Similar Threads

  1. Accessing the Table Corner Button
    By jmc in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2010, 20:40
  2. Replies: 5
    Last Post: 3rd April 2010, 04:07
  3. Custom widget: a button within a button
    By Gnurou in forum Qt Programming
    Replies: 7
    Last Post: 18th June 2009, 09:03
  4. Table Widget Vs. Table View
    By winston2020 in forum Qt Programming
    Replies: 2
    Last Post: 19th October 2008, 09:56
  5. Replies: 9
    Last Post: 21st June 2007, 10:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.