2
2
File : TitlePicker.cpp
4
4
--------------------------------------------------------------------
5
Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen
6
Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
5
Copyright : (C) 2007 by Ion Vasilief
6
Email (use @ for *) : ion_vasilief*yahoo.fr
7
7
Description : Title picker
9
9
***************************************************************************/
11
11
/***************************************************************************
47
49
if (object != (QObject *)title)
50
if ( object->inherits("QwtTextLabel") && e->type() == QEvent::MouseButtonDblClick)
52
if ( object->inherits("QwtTextLabel") && e->type() == QEvent::MouseButtonDblClick){
52
53
emit doubleClicked();
56
if ( object->inherits("QwtTextLabel") && e->type() == QEvent::MouseButtonPress )
58
const QMouseEvent *me = (const QMouseEvent *)e;
58
if ( object->inherits("QwtTextLabel") && e->type() == QEvent::MouseButtonPress ){
59
const QMouseEvent *me = (const QMouseEvent *)e;
61
if (me->button()==Qt::RightButton)
63
if (me->button() == Qt::RightButton)
65
else if (me->button() == Qt::LeftButton)
63
68
return !(me->modifiers() & Qt::ShiftModifier);
66
if ( object->inherits("QwtTextLabel") &&
67
e->type() == QEvent::KeyPress)
69
switch (((const QKeyEvent *)e)->key())
71
if ( object->inherits("QwtTextLabel") &&
72
e->type() == QEvent::KeyPress){
73
switch (((const QKeyEvent *)e)->key())
77
81
return QObject::eventFilter(object, e);
84
void TitlePicker::setSelected(bool select)
86
if (!title || d_selected == select)
91
QwtText text = title->text();
93
text.setBackgroundPen(QPen(Qt::blue));
95
text.setBackgroundPen(QPen(Qt::NoPen));
97
((QwtPlot *)parent())->setTitle(text);