QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgstooltipcombobox.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgscheckablecombobox.cpp
3
------------------------
4
begin : May 25, 2023
5
copyright : (C) 2017 by Mathieu Pellerin
6
email : mathieu at opengis dot ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#include "
qgstooltipcombobox.h
"
19
20
#include <QEvent>
21
#include <QHelpEvent>
22
#include <QPoint>
23
#include <QToolTip>
24
25
#include "moc_qgstooltipcombobox.cpp"
26
27
QgsToolTipComboBox::QgsToolTipComboBox
( QWidget *parent )
28
: QComboBox( parent )
29
{}
30
31
bool
QgsToolTipComboBox::event
( QEvent *
event
)
32
{
33
if
(
event
->type() == QEvent::ToolTip )
34
{
35
const
QString description = currentData( Qt::ToolTipRole ).toString();
36
if
( !description.isEmpty() )
37
{
38
QHelpEvent *helpEvent =
static_cast<
QHelpEvent *
>
(
event
);
39
QPoint pos = mapToGlobal( helpEvent->pos() );
40
QToolTip::showText( pos, description );
41
}
42
return
true
;
43
}
44
return
QComboBox::event(
event
);
45
}
QgsToolTipComboBox::event
bool event(QEvent *event) override
Definition
qgstooltipcombobox.cpp:31
QgsToolTipComboBox::QgsToolTipComboBox
QgsToolTipComboBox(QWidget *parent=nullptr)
Constructor for QgsToolTipComboBox.
Definition
qgstooltipcombobox.cpp:27
qgstooltipcombobox.h
Generated on
for QGIS API Documentation by
1.17.0