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