Update row count constants in VedomostTableModel and PDFController for improved PDF export layout. Adjusted background color handling for table rows and enhanced page number display in headers.
This commit is contained in:
@@ -446,7 +446,7 @@ bool PDFController::exportVedomostToPdf(const QString &filePath, MainController
|
||||
|
||||
// Константы для количества строк на страницах (для А5 формата)
|
||||
const int rowsOnFirstPage = 24; // На первой странице 20 строк
|
||||
const int rowsOnOtherPages = 30; // На последующих страницах 25 строк
|
||||
const int rowsOnOtherPages = 29; // На последующих страницах 25 строк
|
||||
|
||||
int totalRows = vedomostModel->rowCount();
|
||||
int currentRow = 0;
|
||||
@@ -721,6 +721,7 @@ bool PDFController::addListRegistrationTable(QPainter &painter, const QRectF &pa
|
||||
bool PDFController::addGostFrameA4FirstPage(QPainter &painter, const QRectF &pageRect, const TitleInscriptionsModel* model, const ProjectParamTableModel* projectParamModel, int currentPage, int totalPages, int docType)
|
||||
{
|
||||
// Загружаем TTF шрифт из QRC ресурсов
|
||||
totalPages++;
|
||||
QString fontPath = ":/assets/GOST_A.TTF";
|
||||
int fontId = QFontDatabase::addApplicationFont(fontPath);
|
||||
|
||||
@@ -1003,7 +1004,7 @@ painter.drawText(mainTableRect.left()+165*mmToPixels, mainTableRect.top()+20*mmT
|
||||
|
||||
bool PDFController::addGostFrameA4(QPainter &painter, const QRectF &pageRect, const TitleInscriptionsModel* model, const ProjectParamTableModel* projectParamModel, int currentPage, int totalPages, int docType)
|
||||
{
|
||||
|
||||
totalPages++;
|
||||
|
||||
// Рисуем только внутреннюю рамку ГОСТ с отступами:
|
||||
// Слева: 20мм, Сверху: 5мм, Справа: 5мм, Снизу: 5мм
|
||||
@@ -2799,7 +2800,7 @@ bool PDFController::addVedomostTableRange(QPainter &painter, VedomostTableModel
|
||||
// Обрабатываем каждую колонку отдельно
|
||||
if (col == 0) {
|
||||
// Первая колонка - номер строки (начиная с 1)
|
||||
painter.drawText(cellRect, QString::number(row + 1), QTextOption(Qt::AlignCenter));
|
||||
painter.drawText(cellRect, QString::number(displayRow + 1), QTextOption(Qt::AlignCenter));
|
||||
} else if (row < totalRows) {
|
||||
// Остальные колонки - данные из модели (смещение на -1, так как первая колонка не входит в модель)
|
||||
QModelIndex cellIndex = vedomostModel->index(row, col - 1);
|
||||
@@ -3266,7 +3267,7 @@ QList<PageInfo> PDFController::getVedomostPagesInfo(MainController *mainControll
|
||||
|
||||
// Константы для количества строк на страницах (должны совпадать с экспортом)
|
||||
const int rowsOnFirstPage = 24; // На первой странице 24 строки (как в экспорте)
|
||||
const int rowsOnOtherPages = 30; // На последующих страницах 30 строк (как в экспорте)
|
||||
const int rowsOnOtherPages = 29; // На последующих страницах 30 строк (как в экспорте)
|
||||
|
||||
int totalRows = vedomostModel->rowCount();
|
||||
int currentRow = 0;
|
||||
@@ -3334,7 +3335,7 @@ bool PDFController::drawVedomostPage(QPainter &painter, const PageInfo &pageInfo
|
||||
|
||||
// Константы для количества строк на страницах (должны совпадать с экспортом)
|
||||
const int rowsOnFirstPage = 24; // На первой странице 24 строки (как в экспорте)
|
||||
const int rowsOnOtherPages = 30; // На последующих страницах 30 строк (как в экспорте)
|
||||
const int rowsOnOtherPages = 29; // На последующих страницах 30 строк (как в экспорте)
|
||||
|
||||
int totalRows = vedomostModel->rowCount();
|
||||
int currentRow = 0;
|
||||
|
||||
Reference in New Issue
Block a user