dialogshadows belongs to tooltipmanager
tooltips are created/destroyed too often, this saves same deletions and recreations
This commit is contained in:
parent
fef6c3b7f5
commit
b5eacc597d
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include "tooltip_p.h"
|
#include "tooltip_p.h"
|
||||||
#include "windowpreview_p.h"
|
#include "windowpreview_p.h"
|
||||||
#include "dialogshadows_p.h"
|
|
||||||
|
|
||||||
#include <QAbstractTextDocumentLayout>
|
#include <QAbstractTextDocumentLayout>
|
||||||
#include <QBitmap>
|
#include <QBitmap>
|
||||||
@ -197,9 +196,6 @@ ToolTip::ToolTip(QWidget *parent)
|
|||||||
mainLayout->addLayout(iconTextHBoxLayout);
|
mainLayout->addLayout(iconTextHBoxLayout);
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
DialogShadows *shadow = new DialogShadows(this);
|
|
||||||
shadow->setImagePath("widgets/tooltip");
|
|
||||||
shadow->addWindow(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolTip::~ToolTip()
|
ToolTip::~ToolTip()
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "plasma/theme.h"
|
#include "plasma/theme.h"
|
||||||
#include "plasma/view.h"
|
#include "plasma/view.h"
|
||||||
#include "plasma/private/tooltip_p.h"
|
#include "plasma/private/tooltip_p.h"
|
||||||
|
#include "plasma/private/dialogshadows_p.h"
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -57,6 +58,7 @@ class ToolTipManagerPrivate
|
|||||||
public :
|
public :
|
||||||
ToolTipManagerPrivate(ToolTipManager *manager)
|
ToolTipManagerPrivate(ToolTipManager *manager)
|
||||||
: q(manager),
|
: q(manager),
|
||||||
|
shadow(new DialogShadows(q, "widgets/tooltip")),
|
||||||
currentWidget(0),
|
currentWidget(0),
|
||||||
showTimer(new QTimer(manager)),
|
showTimer(new QTimer(manager)),
|
||||||
hideTimer(new QTimer(manager)),
|
hideTimer(new QTimer(manager)),
|
||||||
@ -90,6 +92,7 @@ public :
|
|||||||
void hideTipWidget();
|
void hideTipWidget();
|
||||||
|
|
||||||
ToolTipManager *q;
|
ToolTipManager *q;
|
||||||
|
DialogShadows *shadow;
|
||||||
QGraphicsWidget *currentWidget;
|
QGraphicsWidget *currentWidget;
|
||||||
QTimer *showTimer;
|
QTimer *showTimer;
|
||||||
QTimer *hideTimer;
|
QTimer *hideTimer;
|
||||||
@ -298,6 +301,8 @@ void ToolTipManagerPrivate::createTipWidget()
|
|||||||
}
|
}
|
||||||
|
|
||||||
tipWidget = new ToolTip(0);
|
tipWidget = new ToolTip(0);
|
||||||
|
shadow->addWindow(tipWidget);
|
||||||
|
|
||||||
QObject::connect(tipWidget, SIGNAL(activateWindowByWId(WId,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)),
|
QObject::connect(tipWidget, SIGNAL(activateWindowByWId(WId,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)),
|
||||||
q, SIGNAL(windowPreviewActivated(WId,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)));
|
q, SIGNAL(windowPreviewActivated(WId,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)));
|
||||||
QObject::connect(tipWidget, SIGNAL(linkActivated(QString,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)),
|
QObject::connect(tipWidget, SIGNAL(linkActivated(QString,Qt::MouseButtons,Qt::KeyboardModifiers,QPoint)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user