Fix changing tooltip via wxToolTip::SetTip() in wxQt

Update the actual tool tip used by Qt and not just the internal variable
when SetTip() is called.

Also implement wxToolTip::SetWindow().

Closes https://github.com/wxWidgets/wxWidgets/pull/1175
This commit is contained in:
ali kettab
2019-01-24 15:54:32 +01:00
committed by Vadim Zeitlin
parent 3c369af2e6
commit 84fc5c1714
4 changed files with 25 additions and 6 deletions

View File

@@ -951,14 +951,22 @@ void wxWindowQt::DoMoveWindow(int x, int y, int width, int height)
#if wxUSE_TOOLTIPS
void wxWindowQt::QtApplyToolTip(const wxString& text)
{
GetHandle()->setToolTip(wxQtConvertString(text));
}
void wxWindowQt::DoSetToolTip( wxToolTip *tip )
{
if ( m_tooltip == tip )
return;
wxWindowBase::DoSetToolTip( tip );
if ( tip != NULL )
GetHandle()->setToolTip( wxQtConvertString( tip->GetTip() ));
if ( m_tooltip )
m_tooltip->SetWindow(this);
else
GetHandle()->setToolTip( QString() );
QtApplyToolTip(wxString());
}
#endif // wxUSE_TOOLTIPS