growing tired of being asked about how to get at the font used in widgets, here's a cute little accessor that provides the answer for now and gives us a way to support font settings in the future much in the way qwidget itself does.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712158
This commit is contained in:
parent
45fe956407
commit
d20c9a010f
@ -23,7 +23,8 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include <QtCore/QList>
|
#include <QApplication>
|
||||||
|
#include <QList>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPixmapCache>
|
#include <QPixmapCache>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
@ -238,6 +239,18 @@ QSizeF Widget::size() const
|
|||||||
{
|
{
|
||||||
return geometry().size();
|
return geometry().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFont Widget::font() const
|
||||||
|
{
|
||||||
|
return QApplication::font();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
void Widget::setFont(const QFront& font)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
QRectF Widget::boundingRect() const
|
QRectF Widget::boundingRect() const
|
||||||
{
|
{
|
||||||
return QRectF(QPointF(0,0),geometry().size());
|
return QRectF(QPointF(0,0),geometry().size());
|
||||||
|
@ -169,6 +169,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
QSizeF size() const;
|
QSizeF size() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the font currently set for this widget
|
||||||
|
**/
|
||||||
|
QFont font() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the font for this widget
|
||||||
|
*
|
||||||
|
* @param font the new font
|
||||||
|
**
|
||||||
|
TODO: implement once we decide how to handle the font system
|
||||||
|
void setFont(const QFont& font);
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reimplemented from QGraphicsItem
|
* Reimplemented from QGraphicsItem
|
||||||
* @return the bounding rectangle for this Plasma::Widget
|
* @return the bounding rectangle for this Plasma::Widget
|
||||||
|
Loading…
x
Reference in New Issue
Block a user