Skip to content
Permalink
Browse files

Import gtk2 style from qtbase

We are going to drop gtk2 support from qtbase, so move that style plugin
from qtbase to here.

As a bonus, we can now link directly to the libraries we use, instead
of loading them dynamically (in qtbase this style was part of QtWidgets
library, and we didn't want it to link against gtk2).

Change-Id: I2fc3325fbc0a9f2588b99e94aa906eebbe76d45c
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
  • Loading branch information...
mitya57 committed Jul 30, 2015
1 parent cce2a53 commit 102da7d50231fc5723dba6e72340bef3d29471aa
@@ -0,0 +1,3 @@
{
"Keys": [ "gtk2" ]
}
@@ -0,0 +1,16 @@
TARGET = qgtk2style
PLUGIN_TYPE = styles
load(qt_plugin)

QT = core-private gui-private widgets-private

CONFIG += link_pkgconfig
PKGCONFIG += gconf-2.0 gtk+-2.0 x11

HEADERS += qgtk2painter_p.h qgtkglobal_p.h qgtkpainter_p.h qgtkstyle_p.h qgtkstyle_p_p.h
SOURCES += qgtk2painter.cpp qgtkpainter.cpp qgtkstyle.cpp qgtkstyle_p.cpp plugin.cpp
DEFINES += QT_NO_ANIMATION

include(../shared/shared.pri)

OTHER_FILES += gtk2.json
@@ -0,0 +1,57 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include <QStylePlugin>
#include "qgtkstyle_p.h"

QT_BEGIN_NAMESPACE

class QGtk2StylePlugin : public QStylePlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "gtk2.json")

public:
QStyle *create(const QString &key);
};

QStyle *QGtk2StylePlugin::create(const QString &key)
{
if (key == "gtk2")
return new QGtkStyle;
return 0;
}

QT_END_NAMESPACE

#include "plugin.moc"

0 comments on commit 102da7d

Please sign in to comment.
You can’t perform that action at this time.