Eneboo - Documentación para desarrolladores
|
#include <bluecurve.h>
Clases | |
struct | BluecurveColorData |
Métodos públicos | |
BluecurveStyle () | |
virtual | ~BluecurveStyle () |
void | polish (QWidget *widget) |
void | unPolish (QWidget *widget) |
void | polishPopupMenu (QPopupMenu *) |
void | drawPrimitive (PrimitiveElement, QPainter *, const QRect &, const QColorGroup &, SFlags=Style_Default, const QStyleOption &=QStyleOption::Default) const |
void | drawControl (ControlElement, QPainter *, const QWidget *, const QRect &, const QColorGroup &, SFlags=Style_Default, const QStyleOption &=QStyleOption::Default) const |
void | drawControlMask (ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &=QStyleOption::Default) const |
QRect | subRect (SubRect, const QWidget *) const |
void | drawComplexControl (ComplexControl, QPainter *, const QWidget *, const QRect &, const QColorGroup &, SFlags=Style_Default, SCFlags=SC_All, SCFlags=SC_None, const QStyleOption &=QStyleOption::Default) const |
QRect | querySubControlMetrics (ComplexControl, const QWidget *, SubControl, const QStyleOption &=QStyleOption::Default) const |
SubControl | querySubControl (ComplexControl, const QWidget *, const QPoint &, const QStyleOption &data=QStyleOption::Default) const |
int | pixelMetric (PixelMetric, const QWidget *=0) const |
QSize | sizeFromContents (ContentsType, const QWidget *, const QSize &, const QStyleOption &=QStyleOption::Default) const |
int | styleHint (StyleHint, const QWidget *=0, const QStyleOption &=QStyleOption::Default, QStyleHintReturn *=0) const |
QPixmap | stylePixmap (StylePixmap stylepixmap, const QWidget *widget=0, const QStyleOption &=QStyleOption::Default) const |
Métodos protegidos | |
bool | eventFilter (QObject *object, QEvent *event) |
void | drawGradientBox (QPainter *p, QRect const &r, const QColorGroup &cg, const BluecurveColorData *cdata, bool horiz, double shade1, double shade2) const |
void | drawGradient (QPainter *p, QRect const &r, const QColorGroup &cg, double shade1, double shade2, bool horiz) const |
void | getShade (const QColorGroup &cg, int shadenr, QColor &res) const |
void | drawTextRect (QPainter *p, const QRect &r, const QColorGroup &cg, QStyle::SFlags flags, const QBrush *fill=0) const |
void | drawLightBevel (QPainter *p, const QRect &r, const QColorGroup &cg, QStyle::SFlags flags, const QBrush *fill=0) const |
BluecurveColorData * | realizeData (const QColorGroup &cg) const |
const BluecurveColorData * | lookupData (const QColorGroup &cg) const |
Atributos protegidos | |
QIntCache< BluecurveColorData > | m_dataCache |
Atributos protegidos estáticos | |
static const double | shadeFactors [8] = {1.065, 0.963, 0.896, 0.85, 0.768, 0.665, 0.4, 0.205} |
BluecurveStyle::BluecurveStyle | ( | ) |
BluecurveStyle::~BluecurveStyle | ( | ) | [virtual] |
void BluecurveStyle::drawComplexControl | ( | ComplexControl | control, |
QPainter * | p, | ||
const QWidget * | widget, | ||
const QRect & | r, | ||
const QColorGroup & | cg, | ||
SFlags | flags = Style_Default , |
||
SCFlags | controls = SC_All , |
||
SCFlags | active = SC_None , |
||
const QStyleOption & | opt = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
void BluecurveStyle::drawControl | ( | ControlElement | element, |
QPainter * | p, | ||
const QWidget * | widget, | ||
const QRect & | r, | ||
const QColorGroup & | cg, | ||
SFlags | flags = Style_Default , |
||
const QStyleOption & | opt = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
void BluecurveStyle::drawControlMask | ( | ControlElement | control, |
QPainter * | p, | ||
const QWidget * | widget, | ||
const QRect & | r, | ||
const QStyleOption & | opt = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
void BluecurveStyle::drawGradient | ( | QPainter * | p, |
QRect const & | r, | ||
const QColorGroup & | cg, | ||
double | shade1, | ||
double | shade2, | ||
bool | horiz | ||
) | const [protected] |
void BluecurveStyle::drawGradientBox | ( | QPainter * | p, |
QRect const & | r, | ||
const QColorGroup & | cg, | ||
const BluecurveColorData * | cdata, | ||
bool | horiz, | ||
double | shade1, | ||
double | shade2 | ||
) | const [protected] |
void BluecurveStyle::drawLightBevel | ( | QPainter * | p, |
const QRect & | r, | ||
const QColorGroup & | cg, | ||
QStyle::SFlags | flags, | ||
const QBrush * | fill = 0 |
||
) | const [protected] |
void BluecurveStyle::drawPrimitive | ( | PrimitiveElement | pe, |
QPainter * | p, | ||
const QRect & | r, | ||
const QColorGroup & | cg, | ||
SFlags | flags = Style_Default , |
||
const QStyleOption & | opt = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
void BluecurveStyle::drawTextRect | ( | QPainter * | p, |
const QRect & | r, | ||
const QColorGroup & | cg, | ||
QStyle::SFlags | flags, | ||
const QBrush * | fill = 0 |
||
) | const [protected] |
Filters events if this object has been installed as an event filter for the watched object.
In your reimplementation of this function, if you want to filter the event e, out, i.e. stop it being handled further, return TRUE; otherwise return FALSE.
Example:
class MyMainWindow : public QMainWindow { public: MyMainWindow( QWidget *parent = 0, const char *name = 0 ); protected: bool eventFilter( QObject *obj, QEvent *ev ); private: QTextEdit *textEdit; }; MyMainWindow::MyMainWindow( QWidget *parent, const char *name ) : QMainWindow( parent, name ) { textEdit = new QTextEdit( this ); setCentralWidget( textEdit ); textEdit->installEventFilter( this ); } bool MyMainWindow::eventFilter( QObject *obj, QEvent *ev ) { if ( obj == textEdit ) { if ( e->type() == QEvent::KeyPress ) { QKeyEvent *k = (QKeyEvent*)ev; qDebug( "Ate key press %d", k->key() ); return TRUE; } else { return FALSE; } } else { // pass the event on to the parent class return QMainWindow::eventFilter( obj, ev ); } }
Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.
Reimplementado de QObject.
void BluecurveStyle::getShade | ( | const QColorGroup & | cg, |
int | shadenr, | ||
QColor & | res | ||
) | const [protected] |
const BluecurveStyle::BluecurveColorData * BluecurveStyle::lookupData | ( | const QColorGroup & | cg | ) | const [protected] |
int BluecurveStyle::pixelMetric | ( | PixelMetric | m, |
const QWidget * | widget = 0 |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
void BluecurveStyle::polish | ( | QWidget * | ) | [virtual] |
Initializes the appearance of a widget.
This function is called for every widget at some point after it has been fully created but just before it is shown the very first time.
Reasonable actions in this function might be to call QWidget::setBackgroundMode() for the widget. An example of highly unreasonable use would be setting the geometry! Reimplementing this function gives you a back-door through which you can change the appearance of a widget. With Qt 3.0's style engine you will rarely need to write your own polish(); instead reimplement drawItem(), drawPrimitive(), etc.
The QWidget::inherits() function may provide enough information to allow class-specific customizations. But be careful not to hard-code things too much because new QStyle subclasses are expected to work reasonably with all current and future widgets.
Reimplementado de QStyle.
void BluecurveStyle::polishPopupMenu | ( | QPopupMenu * | ) | [virtual] |
Polishes the popup menu according to the GUI style. This usually means setting the mouse tracking ({QPopupMenu::setMouseTracking()}) and whether the menu is checkable by default ({QPopupMenu::setCheckable()}).
Implementa QStyle.
QStyle::SubControl BluecurveStyle::querySubControl | ( | ComplexControl | control, |
const QWidget * | widget, | ||
const QPoint & | pos, | ||
const QStyleOption & | opt = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
QRect BluecurveStyle::querySubControlMetrics | ( | ComplexControl | control, |
const QWidget * | widget, | ||
SubControl | sc, | ||
const QStyleOption & | opt = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
BluecurveStyle::BluecurveColorData * BluecurveStyle::realizeData | ( | const QColorGroup & | cg | ) | const [protected] |
QSize BluecurveStyle::sizeFromContents | ( | ContentsType | contents, |
const QWidget * | widget, | ||
const QSize & | contentsSize, | ||
const QStyleOption & | opt = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
int BluecurveStyle::styleHint | ( | StyleHint | sh, |
const QWidget * | w = 0 , |
||
const QStyleOption & | = QStyleOption::Default , |
||
QStyleHintReturn * | = 0 |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
QPixmap BluecurveStyle::stylePixmap | ( | StylePixmap | sp, |
const QWidget * | widget = 0 , |
||
const QStyleOption & | = QStyleOption::Default |
||
) | const [virtual] |
Reimplementado de QCommonStyle.
Reimplementado de QCommonStyle.
void BluecurveStyle::unPolish | ( | QWidget * | ) | [virtual] |
Undoes the initialization of a widget's appearance.
This function is the counterpart to polish. It is called for every polished widget when the style is dynamically changed. The former style has to unpolish its settings before the new style can polish them again.
Reimplementado de QStyle.
QIntCache<BluecurveColorData> BluecurveStyle::m_dataCache [protected] |
const double BluecurveStyle::shadeFactors = {1.065, 0.963, 0.896, 0.85, 0.768, 0.665, 0.4, 0.205} [static, protected] |