Unsolved Similar reference for different tabs in tabwidget (Strange problem )
-
Hello,
I want to add an attribute in my class InterfaceTemplateDialog which is index so I can after perform actions on every tab by his index. Example :
currentIndex = self.tabs.currentIndex() InterfaceTemplateDialog(currentIndex).run_btn_start()
and run_btn_start() will be implemented in InterfaceTemplateDialog
Getting the same reference for different tabs make me doubt about a strange problem.
-
Hello again,
I think the correct way to get the correct reference is to use :
currentTabWidget = self.tabs.currentWidget()
with self.tabs = self.findChild(QtGui.QTabWidget, 'tabWidget')
I tested, it works well. Thanks.
-
That's pretty convoluted.
You seem to be creating
InterfaceTemplateDialog
for each tab in your QTabWidget and then in youronChange
method you seem to create a newInterfaceTemplateDialog
to call a function on it. That doesn't make much sense.What exactly do you want to do ? And when ?
-
My tabs have the same content (widget) with same buttons, checkboxes, .. What I want to do exactly is to execute actions (button click ..) on a selectioned tab .
-
Then create your widget, then the connections for that widget and finally add it to your QTabWidget.
However, why do you need a QTabWidget that contains the exact same widget several times ?
-
Hello,
Actually, there is a table with serveral columns. Now, we want to transform this table to a tabwidget beacause, may be we can have many columns so the size of the table will be not sufficient.
-
@EJWA If the table is too big how can tab widget help?
You should put your table into QScrollArea http://doc.qt.io/qt-5.8/qscrollarea.html -
Hi, this is what my client want. I think tabs are more beautiful in design than tables.
-
What kind of table ? Showing what ?
-
Table with different scenarios (use cases) : every column has many checkboxes to check to run the program selected
-
Then why don't you put the active logic directly in your InterfaceTemplateDialog ?