Hi,

I have a QWizardPage that has a combo box on it. I have inherited ChartComboBox from QComboBox to modify mouseMoveEvent in order to show a tooltip over it. It is working at the moment:

Qt Code:
  1. void ChartComboBox::mouseMoveEvent(QMouseEvent *e)
  2. {
  3. QToolTip::showText(e->globalPos(), "TEST", this);
  4. }
To copy to clipboard, switch view to plain text mode 

I can get data for combo box in QWizardPage object via wizard->caller->getData() function, where

- wizard is the internal pointer to QWizard provided by Qt,
- caller is a pointer to the main class, and it is stored as public in QWizard constructor,
- getData() is a function in main class.

Now, I a want to display a specific text in tooltip based on the current item in ChartComboBox if mouse moves over it. I don't know how to do it as ChartComboBox doesn't have a pointer to main class to call a "getData()" function, and I don't know how to do this.

The question is, how to get this text from a QList<struct> variable residing in main class as public and how to know which item is the currently selected when the mouse moves over the combo box.

Thank you in advance!