forked from qt-creator/qt-creator
Editor: add log for printing
Task-number: QTCREATORBUG-24110 Change-Id: Ic4fef2e268cf3adf852a3ce7b229cb98356bbc5e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -96,6 +96,7 @@
|
|||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
#include <QLoggingCategory>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -1147,6 +1148,8 @@ static void printPage(int index, QPainter *painter, const QTextDocument *doc,
|
|||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(printLog, "qtc.editor.print", QtWarningMsg)
|
||||||
|
|
||||||
void TextEditorWidgetPrivate::print(QPrinter *printer)
|
void TextEditorWidgetPrivate::print(QPrinter *printer)
|
||||||
{
|
{
|
||||||
QTextDocument *doc = q->document();
|
QTextDocument *doc = q->document();
|
||||||
@@ -1256,6 +1259,13 @@ void TextEditorWidgetPrivate::print(QPrinter *printer)
|
|||||||
ascending = false;
|
ascending = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qCDebug(printLog) << "Printing " << m_document->filePath() << ":\n"
|
||||||
|
<< " number of copies:" << printer->numCopies() << '\n'
|
||||||
|
<< " from page" << fromPage << "to" << toPage << '\n'
|
||||||
|
<< " document page count:" << doc->pageCount() << '\n'
|
||||||
|
<< " page rectangle:" << pageRect << '\n'
|
||||||
|
<< " title box:" << titleBox << '\n';
|
||||||
|
|
||||||
for (int i = 0; i < docCopies; ++i) {
|
for (int i = 0; i < docCopies; ++i) {
|
||||||
|
|
||||||
int page = fromPage;
|
int page = fromPage;
|
||||||
|
Reference in New Issue
Block a user