1 /* This file is part of the dbusmenu-qt library
2 Copyright 2010 Canonical
3 Author: Aurelien Gateau <aurelien.gateau@canonical.com>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License (LGPL) as published by the Free Software Foundation;
8 either version 2 of the License, or (at your option) any later
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
25 #include <QApplication>
28 #include "dbusmenuexporter.h"
31 static const char *TEST_SERVICE = "org.kde.dbusmenu-qt-test";
32 static const char *TEST_OBJECT_PATH = "/TestMenuBar";
37 connect(this, SIGNAL(aboutToShow()), SLOT(slotAboutToShow()));
40 void SlowMenu::slotAboutToShow()
42 qDebug() << __FUNCTION__ << "Entering";
45 while (time.elapsed() < 2000) {
46 qApp->processEvents();
48 qDebug() << __FUNCTION__ << "Leaving";
51 int main(int argc, char** argv)
53 QApplication app(argc, argv);
54 QDBusConnection::sessionBus().registerService(TEST_SERVICE);
55 SlowMenu* inputMenu = new SlowMenu;
56 inputMenu->addAction("Test");
57 DBusMenuExporter exporter(TEST_OBJECT_PATH, inputMenu);
58 qDebug() << "Looping";
62 #include "moc_slowmenu.cpp"