diff options
Diffstat (limited to 'plugin/simplestyle.h')
-rw-r--r-- | plugin/simplestyle.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/plugin/simplestyle.h b/plugin/simplestyle.h new file mode 100644 index 0000000..0b067b2 --- /dev/null +++ b/plugin/simplestyle.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Timothy Pearson. All rights reserved. +** +** This file is part of the TDE Qt4 style interface +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef SIMPLESTYLE_H +#define SIMPLESTYLE_H + +#include <QtGui/QWindowsStyle> + +QT_BEGIN_NAMESPACE +class QPalette; +QT_END_NAMESPACE + +class TQWidget; +class TQTabBar; +class TQRadioButton; +class TQProgressBar; +class TQPopupMenu; +class TQComboBox; + +enum TQt3WidgetType { + TQT3WT_NONE, + TQT3WT_TQProgressBar, + TQT3WT_TQTabBar, + TQT3WT_TQRadioButton, + TQT3WT_TQPopupMenu, + TQT3WT_TQComboBox +}; + +class SimpleStyle : public QWindowsStyle +{ + Q_OBJECT + +public: + SimpleStyle(); + ~SimpleStyle(); + + void polish(QPalette &palette); + void polish(QWidget *widget); + void unpolish(QWidget *widget); + bool eventFilter(QObject *obj, QEvent *ev); + + void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0) const; + void drawControl(ControlElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget = 0) const; + void drawComplexControl(ComplexControl control, const QStyleOptionComplex * option, QPainter * painter, const QWidget * widget = 0) const; + QRect subElementRect(SubElement element, const QStyleOption * option, const QWidget * widget = 0) const; + + int pixelMetric(PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0) const; + +private: + TQWidget* initializeInterfaceWidget(TQt3WidgetType wt, const QWidget * widget) const; + + TQWidget* m_tqt3parent_widget; + TQTabBar* m_tqt3tabbar_widget; + TQRadioButton* m_tqt3radiobutton_widget; + TQProgressBar* m_tqt3progressbar_widget; + TQPopupMenu* m_tqt3popupmenu_widget; + TQComboBox* m_tqt3combobox_widget; +}; + +#endif |