Add QPushButton to QTableWidget cell without using QTableWidget::setCellWidget
-
I need to add button to table cells and I have been using
setCellWidget
but it's a very slow operation and I need an alternative. I have been able to use a delegate but the problem is I haven't been able to add things like icons, stylesheet, connect signals the way I do with QPushButton. -
So why not simply use a QStyledItemDelegate as already said. There are a lot of examples around how to use this...
-
@Christian-Ehrlicher I couldn't one example that handled signals mentioned in the OP.
-
What's wrong with QAIM::activated() or clicked() ?
-
@Christian-Ehrlicher isn't that for the table cells instead of a widget like QPushButton?
I don't understand how that would work to solve the OP issue. -
-
@JonB said in Add QPushButton to QTableWidget cell without using QTableWidget::setCellWidget:
@VRonin
You are also wanted pretty desperately over at https://forum.qt.io/topic/131508/avoid-not-responding-when-adding-rows-to-qtablewidget/28, though I fear we may be fighting a losing battle, but it's funny/instructional to read....Given the same OP and very similar problem I'd say https://forum.qt.io/post/687439 addresses it too