0

I have a QTabWidget, and I defined showEvent for one of the child widget.

Now how can I know where the showEvent is from?

It could be:

  1. Switched from other tabs
  2. The current index of tabwidget was not changed, the whole window just become visible

Is that possible?

daisy
  • 22,498
  • 29
  • 129
  • 265

1 Answers1

3

QShowEvent is very generic, so there's no direct way to get information about what triggered it. Depending on your needs either save current value of QTabWidget::currentIndex between show events or move your logic to QTabWidget::currentChanged slot.

Oleg Shparber
  • 2,732
  • 1
  • 18
  • 19