Commit 5ae0e6cd authored by Sebastian Kügler's avatar Sebastian Kügler Committed by Daniel Vrátil
Browse files

add small testapp for osd classes

parent 3a3e60e2
add_subdirectory(kded)
\ No newline at end of file
add_subdirectory(kded)
add_subdirectory(osd)
include_directories(${CMAKE_SOURCE_DIR}/kcm/src)
add_executable(osdtest main.cpp osdtest.cpp ../../kded/osd.cpp ../../kded/osdmanager.cpp ../../kcm/src/utils.cpp)
target_link_libraries(osdtest Qt5::Core
Qt5::DBus
Qt5::Quick
Qt5::Qml
KF5::Screen
KF5::PlasmaQuick
KF5::I18n
KF5::Declarative
KF5::IconThemes
KF5::QuickAddons
)
/*************************************************************************************
* Copyright 2014-2016 by Sebastian Kügler <sebas@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#include "osdtest.h"
#include <QGuiApplication>
#include <QCommandLineParser>
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
KScreen::OsdTest osdtest;
QCommandLineOption config = QCommandLineOption(QStringList() << QStringLiteral("c") << "config",
QStringLiteral("Config file"), "config");
QCommandLineParser parser;
parser.addHelpOption();
parser.addOption(config);
parser.process(app);
osdtest.start();
return app.exec();
}
/*************************************************************************************
* Copyright 2016 Sebastian Kügler <sebas@kde.org> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
*************************************************************************************/
#include "osdtest.h"
#include "../../kded/osd.h"
#include "../../kded/osdmanager.h"
#include "../../kcm/src/utils.h"
#include <KScreen/Config>
#include <KScreen/GetConfigOperation>
#include <KScreen/Output>
#include <QCoreApplication>
#include <QStandardPaths>
#include <QTimer>
#include <QRect>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(KSCREEN_KDED, "kscreen.kded")
namespace KScreen {
OsdTest::OsdTest(QObject *parent)
: QObject(parent)
{
}
OsdTest::~OsdTest()
{
}
void OsdTest::start()
{
QTimer::singleShot(5500, qApp, &QCoreApplication::quit);
auto osdManager = new KScreen::OsdManager(this);
osdManager->showOutputIdentifiers();
}
} // ns
\ No newline at end of file
/*************************************************************************************
* Copyright 2016 Sebastian Kügler <sebas@kde.org> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
*************************************************************************************/
#ifndef KSCREEN_OSDTEST_H
#define KSCREEN_OSDTEST_H
#include <QObject>
namespace KScreen
{
class OsdTest : public QObject
{
Q_OBJECT
public:
explicit OsdTest(QObject *parent = nullptr);
virtual ~OsdTest();
void start();
};
} // namespace
#endif // KSCREEN_OSDTEST_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment