(0,128,255) class PixButton : public QPushButton

Special QPushButton class.

Inheritance:

PixButton


Public Methods

void bDataInit( RawPixData rawdat, float scale=1.0 )
void bRepaint(void)
void bRescale( float scale )
PixButton( QWidget *parent, RawPixData rawdat, float scale=1.0 )
PixButton( QWidget *parent )

Protected Fields

PixData* b_pd
QPixmap b_pm

Documentation

This class is a derivative of QPushButton designed specifically for use with pixmaps drawn by a PixData object. The size of each PixButton is identical to the size of the PixData object associated with it.

I'm sure there's probably a better way to implement this, but this was not only my first attempt at a Qt widget, but also my first attempt at C++!

PixButton( QWidget *parent )
Class constructor. Creates a blank PixButton.

PixButton( QWidget *parent, RawPixData rawdat, float scale=1.0 )
Overloaded class constructor. Equivalent to calling PixButton(parent) followed by a call to bDataInit(rawdat,scale).
See Also:
bDataInit

void bRescale( float scale )
This method rescales the PixData object of the PixButton. This also changes the size of the Pixbutton itself. It implicitly calls bRepaint().

void bDataInit( RawPixData rawdat, float scale=1.0 )
This method associates the PixButton with a PixData object.

The first argument is a RawPixData structure, which bDataInit() converts to a PixData object, rescaling it to scale at the same time. You can define a bunch of constant RawPixData variables in a header file, each of which defines a PixData to use on a PixButton.

See Also:
RawPixData, PixData

void bRepaint(void)
Reconverts the PixData of this PixButton to a QPixmap and redraws the object.

You need to call this if you change any of the properties of a PixButton for those changes to appear. For example, if you changed the background color of a PixButton, you'd need to do a bRepaint().

QPixmap b_pm
Stores the QPixmap displayed on the button.

PixData* b_pd
Pointer to the PixData object that contains the image to draw on the button.


This class has no child classes.
See Also:
RawPixData,PixData

alphabetic index hierarchy of classes


Copyright 1997 by John Weiss [John.Weiss@colorado.edu] "generated by doc++"?! More like mangled ...

generated by doc++