PDA

View Full Version : Accessing Dynamically allocated TableWidgets through c++



ckendir
8th April 2015, 18:32
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?

ChrisW67
8th April 2015, 23:32
QWidget::childAt() on the scroll area's content widget should get you close.