Ejemplo n.º 1
0
void ReportDialog::showPreview()
{
    if ( m_page )
        return;

    QPrinter* printer = application->printer();
    printer->setFromTo( 0, 0 );

    QString html = generateHtmlReport( false );

    m_page = new QWebPage( this );

    connect( m_page->mainFrame(), SIGNAL( loadFinished( bool ) ), this, SLOT( previewReady() ) );

    m_page->mainFrame()->setHtml( html );
}
Ejemplo n.º 2
0
void ReportDialog::print()
{
    if ( m_page )
        return;

    QPrinter* printer = application->printer();
    printer->setFromTo( 0, 0 );

    QPrintDialog dialog( printer, this );

    if ( dialog.exec() != QDialog::Accepted )
        return;

    QString html = generateHtmlReport( false );

    m_page = new QWebPage( this );

    connect( m_page->mainFrame(), SIGNAL( loadFinished( bool ) ), this, SLOT( printReady() ) );

    m_page->mainFrame()->setHtml( html );
}
Ejemplo n.º 3
0
void QPrinterProto::setFromTo(int from, int to)
{
  QPrinter *item = qscriptvalue_cast<QPrinter*>(thisObject());
  if (item)
    item->setFromTo(from, to);
}
Ejemplo n.º 4
0
int Printer::setFromTo(lua_State * L) // ( int from, int to )
{
	QPrinter* lhs = ValueBinding<MyQPrinter>::check( L, 1 );
	lhs->setFromTo( Util::toInt( L, 2 ), Util::toInt( L, 3 ) );
	return 0;
}