Skeleton DPI test app
This commit is contained in:
parent
bdc2ad2a84
commit
ff1d062b47
@ -1 +1,2 @@
|
||||
add_subdirectory(kplugins)
|
||||
add_subdirectory(dpi)
|
||||
|
13
src/plasma/tests/dpi/CMakeLists.txt
Normal file
13
src/plasma/tests/dpi/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
project("dpitest")
|
||||
|
||||
add_executable(dpitest
|
||||
main.cpp
|
||||
dpitest.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(dpitest KF5::Plasma KF5::I18n Qt5::Gui)
|
||||
|
||||
message("INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS}")
|
||||
|
||||
install(TARGETS dpitest ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
63
src/plasma/tests/dpi/dpitest.cpp
Normal file
63
src/plasma/tests/dpi/dpitest.cpp
Normal file
@ -0,0 +1,63 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2013 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 Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 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 *
|
||||
* Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public License *
|
||||
* along with this library; see the file COPYING.LIB. If not, write to *
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
|
||||
* Boston, MA 02110-1301, USA. *
|
||||
*******************************************************************************/
|
||||
|
||||
#include "dpitest.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <plasma/theme.h>
|
||||
|
||||
#include <qcommandlineparser.h>
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
class DPITestPrivate {
|
||||
public:
|
||||
QString pluginName;
|
||||
QCommandLineParser *parser;
|
||||
};
|
||||
|
||||
DPITest::DPITest(int& argc, char** argv, QCommandLineParser *parser) :
|
||||
QApplication(argc, argv)
|
||||
{
|
||||
d = new DPITestPrivate;
|
||||
d->parser = parser;
|
||||
QTimer::singleShot(0, this, SLOT(runMain()));
|
||||
}
|
||||
|
||||
DPITest::~DPITest()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
void DPITest::runMain()
|
||||
{
|
||||
qDebug() << "DPI test runs: ";
|
||||
exit(0);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_dpitest.cpp"
|
50
src/plasma/tests/dpi/dpitest.h
Normal file
50
src/plasma/tests/dpi/dpitest.h
Normal file
@ -0,0 +1,50 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2012 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 Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 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 *
|
||||
* Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public License *
|
||||
* along with this library; see the file COPYING.LIB. If not, write to *
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
|
||||
* Boston, MA 02110-1301, USA. *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef PLUGINTEST_H
|
||||
#define PLUGINTEST_H
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QApplication>
|
||||
|
||||
class QCommandLineParser;
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
class DPITestPrivate;
|
||||
|
||||
class DPITest : public QApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DPITest(int& argc, char** argv, QCommandLineParser *parser);
|
||||
virtual ~DPITest();
|
||||
|
||||
public Q_SLOTS:
|
||||
void runMain();
|
||||
|
||||
private:
|
||||
DPITestPrivate* d;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
46
src/plasma/tests/dpi/main.cpp
Normal file
46
src/plasma/tests/dpi/main.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2008 Aaron Seigo <aseigo@kde.org>
|
||||
* Copyright 2013 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,
|
||||
* 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 Library 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 <QScreen>
|
||||
#include <plasma/theme.h>
|
||||
#include <qcommandlineparser.h>
|
||||
#include <qcommandlineoption.h>
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include "dpitest.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QCommandLineParser *parser = new QCommandLineParser;
|
||||
Plasma::DPITest app(argc, argv, parser);
|
||||
|
||||
const QString description = i18n("DPI test app");
|
||||
const char version[] = "2.0";
|
||||
|
||||
app.setApplicationVersion(version);
|
||||
parser->addVersionOption();
|
||||
parser->setApplicationDescription(description);
|
||||
|
||||
parser->addOption(QCommandLineOption(QStringList() << "s" << "show", i18nc("Do not translate <name>", "Show icon sizes"), "name"));
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user