make tooltipdialog a singleton

This commit is contained in:
Sebastian Kügler 2013-04-05 00:30:17 +02:00
parent e48908eb70
commit feda4f5013
3 changed files with 19 additions and 0 deletions

View File

@ -41,6 +41,9 @@
#include "dialog.h"
#include "iconitem.h"
#include "tooltipwindow.h"
#include "tooltip.h"
// #include "dataenginebindings_p.h"
#include "plasmanamespace.h"
@ -90,6 +93,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
qmlRegisterType<DialogProxy>(uri, 2, 0, "Dialog");
qmlRegisterType<ToolTipWindow>(uri, 2, 0, "ToolTipWindow");
qmlRegisterType<ToolTip>(uri, 2, 0, "ToolTipProxy");
qmlRegisterInterface<Plasma::Service>("Service");
qRegisterMetaType<Plasma::Service*>("Service");

View File

@ -22,13 +22,26 @@
#include <QQuickItem>
#include <QDebug>
#include "framesvgitem.h"
Q_GLOBAL_STATIC(ToolTipDialog, toolTipDialogInstance)
ToolTipDialog::ToolTipDialog(QQuickItem *parent)
: DialogProxy(parent)
{
setFlags(Qt::ToolTip);
m_frameSvgItem->setImagePath("widgets/tooltip");
qDebug() << "XXX TOolTip ctor'ed";
}
ToolTipDialog::~ToolTipDialog()
{
}
ToolTipDialog* ToolTipDialog::instance()
{
return toolTipDialogInstance();
}

View File

@ -43,6 +43,8 @@ public:
ToolTipDialog(QQuickItem *parent = 0);
~ToolTipDialog();
static ToolTipDialog* instance();
Q_SIGNALS:
private: