本文整理汇总了C++中DRect::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ DRect::toString方法的具体用法?C++ DRect::toString怎么用?C++ DRect::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DRect
的用法示例。
在下文中一共展示了DRect::toString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convert
KoFilter::ConversionStatus PdfImport::convert(const QCString& from,
const QCString& to)
{
// check for proper conversion
if ( to!="application/x-kword" || from!="application/pdf" )
return KoFilter::NotImplemented;
// read file
KoFilter::ConversionStatus result
= _doc.init(m_chain->inputFile(), QString::null, QString::null);
if ( result!=KoFilter::OK ) return result;
// options dialog
{
Dialog dialog(_doc.nbPages(), _doc.isEncrypted(), 0);
dialog.exec();
if ( dialog.result()==QDialog::Rejected )
return KoFilter::UserCancelled;
_options = dialog.options();
}
// progress dialog
KProgressDialog pd(0, "progress_dialog", i18n("PDF Import"),
i18n("Initializing..."), true);
pd.setMinimumDuration(0);
pd.progressBar()->setTotalSteps( _options.range.nbPages()*2 );
pd.progressBar()->setValue(1);
qApp->processEvents();
// if passwords : reread file
if ( !_options.ownerPassword.isEmpty()
|| !_options.userPassword.isEmpty() ) {
result = _doc.init(m_chain->inputFile(), _options.ownerPassword,
_options.userPassword);
if ( result!=KoFilter::OK ) return result;
}
// data
KoPageLayout page;
DRect rect = _doc.paperSize(page.format);
kdDebug(30516) << "paper size: " << rect.toString() << endl;
page.orientation = _doc.paperOrientation();
Data data(m_chain, rect, page, _options);
_doc.initDevice(data);
// treat pages
QTime time;
time.start();
SelectionRangeIterator it(_options.range);
for (uint k=0; k<2; k++) {
bool first = ( k==0 );
data.pageIndex = 0;
if ( !first ) _doc.init();
for (it.toFirst(); it.current()!=it.end(); it.next()) {
QString s = (first ? i18n("First pass: page #%1...")
: i18n("Second pass: page #%1..."));
pd.setLabel( s.arg(it.current()) );
qApp->processEvents();
if (pd.wasCancelled()) return KoFilter::UserCancelled;
kdDebug(30516) << "-- " << "pass #" << k
<< " treat page: " << it.current()
<< "----------------" << endl;
if (first) _doc.treatPage( it.current() );
else _doc.dumpPage(data.pageIndex);
pd.progressBar()->advance(1);
data.pageIndex++;
}
}
data.endDump();
kdDebug(30516) << "treatement elapsed=" << time.elapsed() << endl;
// output
KoStoreDevice* out = m_chain->storageFile("root", KoStore::Write);
if( !out ) {
kdError(30516) << "Unable to open output file!" << endl;
return KoFilter::StorageCreationError;
}
// kdDebug(30516) << data.document().toCString() << endl;
QCString cstr = data.document().toCString();
out->writeBlock(cstr, cstr.length());
out->close();
treatInfoDocument();
return KoFilter::OK;
}