forked from qt-creator/qt-creator
Qt6: Various include, QPrinter, and QFlags adaptations
Task-number: QTCREATORBUG-24098 Change-Id: I7aca7d25a063c84d6eec14c2c5789357ce56a7b3 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QSet>
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
|
@@ -817,7 +817,7 @@ QVariant MacrosModel::data(const QModelIndex &index, int role) const
|
||||
else if (column == MacroColumn)
|
||||
return macro.toString();
|
||||
} else if (role == Qt::TextAlignmentRole) {
|
||||
return Qt::AlignTop + Qt::AlignLeft;
|
||||
return QVariant::fromValue(Qt::AlignTop | Qt::AlignLeft);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
@@ -1067,7 +1067,7 @@ QVariant TokensModel::data(const QModelIndex &index, int role) const
|
||||
else if (column == NewlineColumn)
|
||||
return CMI::Utils::toString(token.newline());
|
||||
} else if (role == Qt::TextAlignmentRole) {
|
||||
return Qt::AlignTop + Qt::AlignLeft;
|
||||
return QVariant::fromValue(Qt::AlignTop | Qt::AlignLeft);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
@@ -851,7 +851,7 @@ void FormEditorData::print()
|
||||
|
||||
QPrinter *printer = ICore::printer();
|
||||
const bool oldFullPage = printer->fullPage();
|
||||
const QPrinter::Orientation oldOrientation = printer->orientation ();
|
||||
const QPageLayout::Orientation oldOrientation = printer->pageLayout().orientation();
|
||||
printer->setFullPage(false);
|
||||
do {
|
||||
// Grab the image to be able to a suggest suitable orientation
|
||||
@@ -863,7 +863,8 @@ void FormEditorData::print()
|
||||
}
|
||||
|
||||
const QSizeF pixmapSize = pixmap.size();
|
||||
printer->setOrientation( pixmapSize.width() > pixmapSize.height() ? QPrinter::Landscape : QPrinter::Portrait);
|
||||
printer->setPageOrientation(pixmapSize.width() > pixmapSize.height() ? QPageLayout::Landscape
|
||||
: QPageLayout::Portrait);
|
||||
|
||||
// Printer parameters
|
||||
QPrintDialog dialog(printer, fw);
|
||||
@@ -895,7 +896,7 @@ void FormEditorData::print()
|
||||
|
||||
} while (false);
|
||||
printer->setFullPage(oldFullPage);
|
||||
printer->setOrientation(oldOrientation);
|
||||
printer->setPageOrientation(oldOrientation);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -1164,7 +1164,7 @@ void TextEditorWidgetPrivate::print(QPrinter *printer)
|
||||
if (!p.isActive())
|
||||
return;
|
||||
|
||||
QRectF pageRect(printer->pageRect());
|
||||
QRectF pageRect(printer->pageLayout().paintRectPixels(printer->resolution()));
|
||||
if (pageRect.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -1236,9 +1236,9 @@ void TextEditorWidgetPrivate::print(QPrinter *printer)
|
||||
int pageCopies;
|
||||
if (printer->collateCopies() == true) {
|
||||
docCopies = 1;
|
||||
pageCopies = printer->numCopies();
|
||||
pageCopies = printer->copyCount();
|
||||
} else {
|
||||
docCopies = printer->numCopies();
|
||||
docCopies = printer->copyCount();
|
||||
pageCopies = 1;
|
||||
}
|
||||
|
||||
@@ -1262,7 +1262,7 @@ void TextEditorWidgetPrivate::print(QPrinter *printer)
|
||||
}
|
||||
|
||||
qCDebug(printLog) << "Printing " << m_document->filePath() << ":\n"
|
||||
<< " number of copies:" << printer->numCopies() << '\n'
|
||||
<< " number of copies:" << printer->copyCount() << '\n'
|
||||
<< " from page" << fromPage << "to" << toPage << '\n'
|
||||
<< " document page count:" << doc->pageCount() << '\n'
|
||||
<< " page rectangle:" << pageRect << '\n'
|
||||
|
Reference in New Issue
Block a user