Results 1 to 2 of 2

Thread: Displaying tooltip over combobox that reads text from main class for current item?

  1. #1
    Join Date
    May 2010
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Displaying tooltip over combobox that reads text from main class for current item?

    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!

  2. #2
    Join Date
    May 2010
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Displaying tooltip over combobox that reads text from main class for current item

    bounce to get info

Similar Threads

  1. Replies: 0
    Last Post: 10th March 2011, 11:44
  2. Displaying data column into combobox
    By deck99 in forum Qt Programming
    Replies: 9
    Last Post: 9th March 2011, 08:44
  3. Replies: 0
    Last Post: 10th March 2009, 00:55
  4. Displaying tooltip for points in the graph
    By Ankitha Varsha in forum Qt Programming
    Replies: 4
    Last Post: 29th January 2008, 11:08
  5. Replies: 8
    Last Post: 15th May 2007, 09:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.