Skip to content
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 <>
  • 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

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


OTHER_FILES += gtk2.json
@@ -0,0 +1,57 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact:
** This file is part of the QtWidgets module of the Qt Toolkit.
** 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 For further
** information use the contact form at
** 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: and
** 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.

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


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

QStyle *create(const QString &key);

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


#include "plugin.moc"

0 comments on commit 102da7d

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