• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Plasma

label.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2008 Aaron Seigo <aseigo@kde.org>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details
00013  *
00014  *   You should have received a copy of the GNU Library General Public
00015  *   License along with this program; if not, write to the
00016  *   Free Software Foundation, Inc.,
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 
00020 #ifndef PLASMA_LABEL_H
00021 #define PLASMA_LABEL_H
00022 
00023 #include <QtGui/QGraphicsProxyWidget>
00024 
00025 #include <plasma/plasma_export.h>
00026 #include <plasma/dataengine.h>
00027 
00028 class QLabel;
00029 
00030 namespace Plasma
00031 {
00032 
00033 class LabelPrivate;
00034 
00040 class PLASMA_EXPORT Label : public QGraphicsProxyWidget
00041 {
00042     Q_OBJECT
00043 
00044     Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget)
00045     Q_PROPERTY(QString text READ text WRITE setText)
00046     Q_PROPERTY(QString image READ image WRITE setImage)
00047     Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
00048     Q_PROPERTY(bool hasScaledContents READ hasScaledContents WRITE setScaledContents)
00049     Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
00050     Q_PROPERTY(QLabel *nativeWidget READ nativeWidget)
00051 
00052 public:
00058     explicit Label(QGraphicsWidget *parent = 0);
00059     ~Label();
00060 
00066     void setText(const QString &text);
00067 
00071     QString text() const;
00072 
00078     void setImage(const QString &path);
00079 
00083     QString image() const;
00084 
00090     void setAlignment(Qt::Alignment alignment);
00091 
00095     Qt::Alignment alignment() const;
00096 
00102     void setScaledContents(bool scaled);
00103 
00107     bool hasScaledContents() const;
00108 
00114     void setStyleSheet(const QString &stylesheet);
00115 
00119     QString styleSheet();
00120 
00124     QLabel *nativeWidget() const;
00125 
00126 Q_SIGNALS:
00127     void linkActivated(const QString &link);
00128     void linkHovered(const QString &link);
00129 
00130 public Q_SLOTS:
00131     void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
00132 
00133 protected:
00134     void resizeEvent(QGraphicsSceneResizeEvent *event);
00135 
00136 private:
00137     Q_PRIVATE_SLOT(d, void setPalette())
00138     Q_PRIVATE_SLOT(d, void setPixmap())
00139 
00140     LabelPrivate * const d;
00141 };
00142 
00143 } // namespace Plasma
00144 
00145 #endif // multiple inclusion guard

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal