Results 1 to 2 of 2

Thread: Accessing Dynamically allocated TableWidgets through c++

  1. #1
    Join Date
    Apr 2015
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Accessing Dynamically allocated TableWidgets through c++

    I am having trouble with accessing dynamically allocated table widgets.
    I have a "add table" button that adds tables to a scroll area. I want to be able to click the table (not a cell in the table since the table is empty upon creation) and have my program recognize which table i have clicked on.
    I tried trying to get the parent of a cell I click on, but it doesnt seem like the "parent exists"

    Is there any way i can use the cursor position when clicked inside of the scroll area to set a QTableWidget equal to what is under it?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Accessing Dynamically allocated TableWidgets through c++

    QWidget::childAt() on the scroll area's content widget should get you close.

Similar Threads

  1. Accessing Dynamically created Checkboxe
    By premroxx in forum Newbie
    Replies: 1
    Last Post: 6th November 2012, 08:14
  2. Dynamically allocated objects
    By DmitryNik in forum Newbie
    Replies: 4
    Last Post: 26th September 2011, 13:20
  3. add multiple rows at a time in tablewidgets
    By rk0747 in forum Qt Programming
    Replies: 0
    Last Post: 15th April 2010, 07:54
  4. dragging cellwidgets in tablewidgets
    By hubipet in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2009, 15:54
  5. dynamcly allocated buttons
    By MarkoSan in forum Qt Programming
    Replies: 28
    Last Post: 14th January 2008, 01:08

Tags for this Thread

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.