ICS

QicsTable Documentation Set

QicsPrintPreviewPage Class Reference

Page class used for WYSIWYG printing. More...

#include <QicsPrintPreviewPage.h>

Inherits QFrame.

List of all members.

Signals

void drawPage (QicsPrintPreviewPage *page)

Public Member Functions

 QicsPrintPreviewPage (int num, QicsPrintPreviewWidget *widget, QWidget *parent)
virtual ~QicsPrintPreviewPage ()
int number () const
const QRect & pageRect () const
const QRect & realPageRect () const
const QRect & realPaperRect () const
bool isActive () const
void setSelected (bool yes=true)
bool isSelected () const
void setEnabled (bool yes=true)
bool isEnabled () const
double widthMM () const
double heightMM () const
void reinit ()

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
virtual void resizeEvent (QResizeEvent *event)

Protected Attributes

QRect m_pageRect
QRect m_realPageRect
QRect m_realPaperRect
int m_num
bool m_selected
bool m_enabled
QicsPrintPreviewWidgetm_widget
double mmWidth
double mmHeight


Detailed Description

Page class used for WYSIWYG printing.

QicsPrintPreviewPage represents single page of the document being previewed/printed. Every page is responcible to paint its common parts (such as frame, logical number, and so on) and its content by emitting drawPage() signal which is handled by QicsPrintPreviewWidget and passed to the own preview program.

A page has its logical number which is 0-based and always in the range of 0...QicsPrintPreviewWidget::pagesCount()-1. However, method number() will return 1-based number as it is more convenient for the user.

Also, a page keeps its metrics, returned by pageRect(), realPageRect() and realPaperRect() methods in pixels, and also widthMM() and heightMM() in metrical units.

Page can have active (returned by isActive()), selected (isSelected()) and enabled (isEnabled()) state set to true or false. These states are used mostly during printing, see QicsPrintPreviewWidget description for the reference.

Typically, there is no need to explicitly create QicsPrintPreviewPage objects as they are always created by the framework.


Constructor & Destructor Documentation

QicsPrintPreviewPage::QicsPrintPreviewPage ( int  num,
QicsPrintPreviewWidget widget,
QWidget *  parent 
)

Constructor.

Parameters:
num 0-based logical number of the page.
widget Parent QicsPrintPreviewWidget.
parent Parent QWidget (it is the real parent widget of the page).

virtual QicsPrintPreviewPage::~QicsPrintPreviewPage (  )  [virtual]

Destructor.


Member Function Documentation

int QicsPrintPreviewPage::number (  )  const [inline]

Returns 1-based logical number of the page in the range of 1...QicsPrintPreviewWidget::pagesCount().

const QRect& QicsPrintPreviewPage::pageRect (  )  const [inline]

Returns visual dimensions of the page (in pixels) according to current scale (i.e. as it is currently visible on the screen).

See also:
realPageRect()

const QRect& QicsPrintPreviewPage::realPageRect (  )  const [inline]

Returns actual dimensions of the page (in pixels) as it is will be sent to printer. See QPrinter::pageRect().

See also:
pageRect()

const QRect& QicsPrintPreviewPage::realPaperRect (  )  const [inline]

Returns actual dimensions of the paper (in pixels). See QPrinter::paperRect().

See also:
realPageRect()

bool QicsPrintPreviewPage::isActive (  )  const

Returns true if the page is active, false if not. See QicsPrintPreviewWidget::activePage().

void QicsPrintPreviewPage::setSelected ( bool  yes = true  ) 

Sets page selected state to yes. See QicsPrintPreviewWidget::selectAll().

See also:
isSelected()

bool QicsPrintPreviewPage::isSelected (  )  const [inline]

Returns true if the page is selected, false if not.

See also:
setSelected()

void QicsPrintPreviewPage::setEnabled ( bool  yes = true  ) 

Sets page enabled state to yes. See QicsPrintPreviewWidget::enableAll().

See also:
isEnabled()

bool QicsPrintPreviewPage::isEnabled (  )  const [inline]

Returns true if the page is enabled, false if not.

See also:
setEnabled()

double QicsPrintPreviewPage::widthMM (  )  const [inline]

Returns width of the page in millimeters.

See also:
heightMM()

double QicsPrintPreviewPage::heightMM (  )  const [inline]

Returns height of the page in millimeters.

See also:
widthMM()

void QicsPrintPreviewPage::reinit (  ) 

Reinitialized page dimensions from the QicsPrintPreviewWidget's current printer. Called internally when printer/paper parameters were changed.

void QicsPrintPreviewPage::drawPage ( QicsPrintPreviewPage page  )  [signal]

Emitted when page needs to be drawn. Handled in QicsPrintPreviewWidget.


The documentation for this class was generated from the following file:

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright ©1999-2006 Integrated Computer Solutions, Inc.