2016-02-27 21:24:45 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright 2016 David Rosca <nowrep@gmail.com> *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QQuickItem>
|
|
|
|
#include <QQuickView>
|
|
|
|
#include <QtTest/QtTest>
|
|
|
|
|
2016-02-27 19:40:54 +01:00
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
class Svg;
|
2016-02-29 22:28:58 +01:00
|
|
|
class Theme;
|
2016-02-27 19:40:54 +01:00
|
|
|
}
|
|
|
|
|
2016-02-27 21:24:45 +01:00
|
|
|
class IconItemTest : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void initTestCase();
|
2016-03-04 23:44:57 +01:00
|
|
|
void cleanupTestCase();
|
2016-07-12 10:01:29 +02:00
|
|
|
void init();
|
2016-02-27 21:24:45 +01:00
|
|
|
void cleanup();
|
|
|
|
|
2016-03-04 01:20:29 +01:00
|
|
|
void loadPixmap();
|
|
|
|
void loadImage();
|
|
|
|
|
2016-02-27 21:24:45 +01:00
|
|
|
void invalidIcon();
|
|
|
|
void usesPlasmaTheme();
|
|
|
|
void animation();
|
|
|
|
void animationAfterHide();
|
|
|
|
void bug_359388();
|
2016-02-27 19:40:54 +01:00
|
|
|
void loadSvg();
|
2016-02-29 22:28:58 +01:00
|
|
|
void themeChange();
|
2016-03-04 23:44:57 +01:00
|
|
|
void qiconFromTheme();
|
2016-03-10 12:58:18 +01:00
|
|
|
void changeColorGroup();
|
2016-03-11 14:07:44 +01:00
|
|
|
void animatingActiveChange();
|
|
|
|
void animatingEnabledChange();
|
2016-03-12 13:01:07 +01:00
|
|
|
void windowChanged();
|
2017-01-05 15:15:14 +01:00
|
|
|
void paintedSize();
|
2017-01-08 16:16:59 +01:00
|
|
|
void implicitSize();
|
2018-01-15 10:22:18 +01:00
|
|
|
void nonSquareImplicitSize();
|
2017-02-26 11:27:58 +01:00
|
|
|
void roundToIconSize();
|
2016-02-27 21:24:45 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
QQuickItem *createIconItem();
|
|
|
|
QImage grabImage(QQuickItem *item);
|
2016-02-27 19:40:54 +01:00
|
|
|
Plasma::Svg *findPlasmaSvg(QQuickItem *item);
|
2016-02-29 22:28:58 +01:00
|
|
|
void changeTheme(Plasma::Theme *theme, const QString &themeName);
|
2016-02-27 21:24:45 +01:00
|
|
|
|
|
|
|
QQuickView *m_view;
|
|
|
|
};
|
|
|
|
|