mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Print: setup for a new profile table layout
- Adjust the new rows and column count - Set new row and column spans Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
d668f5dc8e
commit
3b7500fd33
2 changed files with 15 additions and 24 deletions
|
@ -1593,12 +1593,12 @@ void ProfilePrintModel::setDive(struct dive *divePtr)
|
||||||
|
|
||||||
int ProfilePrintModel::rowCount(const QModelIndex &parent) const
|
int ProfilePrintModel::rowCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
return 11;
|
return 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProfilePrintModel::columnCount(const QModelIndex &parent) const
|
int ProfilePrintModel::columnCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
return 7;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
|
QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
|
||||||
|
|
|
@ -36,14 +36,12 @@ PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct op
|
||||||
tablePrintColumnWidths.append(15);
|
tablePrintColumnWidths.append(15);
|
||||||
tablePrintColumnWidths.append(33);
|
tablePrintColumnWidths.append(33);
|
||||||
// profile print settings
|
// profile print settings
|
||||||
const int dw = 15; // base percentage
|
const int dw = 20; // base percentage
|
||||||
profilePrintColumnWidths.append(dw);
|
profilePrintColumnWidths.append(dw);
|
||||||
profilePrintColumnWidths.append(dw);
|
profilePrintColumnWidths.append(dw);
|
||||||
profilePrintColumnWidths.append(dw);
|
profilePrintColumnWidths.append(dw);
|
||||||
profilePrintColumnWidths.append(dw);
|
profilePrintColumnWidths.append(dw);
|
||||||
profilePrintColumnWidths.append(dw - 5);
|
profilePrintColumnWidths.append(dw); // fit to 100%
|
||||||
profilePrintColumnWidths.append(dw + 5);
|
|
||||||
profilePrintColumnWidths.append(dw - 5); // fit to 100%
|
|
||||||
const int sr = 9; // smallest row height in pixels
|
const int sr = 9; // smallest row height in pixels
|
||||||
profilePrintRowHeights.append(sr + 2);
|
profilePrintRowHeights.append(sr + 2);
|
||||||
profilePrintRowHeights.append(sr + 7);
|
profilePrintRowHeights.append(sr + 7);
|
||||||
|
@ -55,7 +53,8 @@ PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct op
|
||||||
profilePrintRowHeights.append(sr);
|
profilePrintRowHeights.append(sr);
|
||||||
profilePrintRowHeights.append(sr);
|
profilePrintRowHeights.append(sr);
|
||||||
profilePrintRowHeights.append(sr);
|
profilePrintRowHeights.append(sr);
|
||||||
profilePrintRowHeights.append(sr + 12);
|
profilePrintRowHeights.append(sr);
|
||||||
|
profilePrintRowHeights.append(sr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintLayout::print()
|
void PrintLayout::print()
|
||||||
|
@ -211,23 +210,15 @@ QTableView *PrintLayout::createProfileTable(ProfilePrintModel *model, const int
|
||||||
* changes made here reflect on ProfilePrintModel::data(). */
|
* changes made here reflect on ProfilePrintModel::data(). */
|
||||||
const int cols = model->columnCount();
|
const int cols = model->columnCount();
|
||||||
const int rows = model->rowCount();
|
const int rows = model->rowCount();
|
||||||
// top section
|
// info on top
|
||||||
table->setSpan(0, 0, 1, cols - 2);
|
table->setSpan(0, 0, 1, 4);
|
||||||
table->setSpan(1, 0, 1, cols - 2);
|
table->setSpan(1, 0, 1, 4);
|
||||||
table->setSpan(10, 0, 1, cols);
|
// gas used
|
||||||
table->setSpan(0, 5, 1, 2);
|
table->setSpan(2, 0, 1, 2);
|
||||||
table->setSpan(1, 5, 1, 12);
|
table->setSpan(3, 0, 1, 2);
|
||||||
// sac, cns, otu
|
// notes
|
||||||
table->setSpan(2, 3, 2, 1);
|
table->setSpan(6, 0, 1, 5);
|
||||||
table->setSpan(4, 3, 2, 1);
|
table->setSpan(7, 0, 5, 5);
|
||||||
table->setSpan(6, 3, 2, 1);
|
|
||||||
table->setSpan(8, 3, 2, 1);
|
|
||||||
table->setSpan(2, 4, 2, 1);
|
|
||||||
table->setSpan(4, 4, 2, 1);
|
|
||||||
table->setSpan(6, 4, 2, 1);
|
|
||||||
table->setSpan(8, 4, 2, 1);
|
|
||||||
// weights
|
|
||||||
table->setSpan(2, 5, 1, 2);
|
|
||||||
|
|
||||||
/* resize row heights to the 'profilePrintRowHeights' indexes.
|
/* resize row heights to the 'profilePrintRowHeights' indexes.
|
||||||
* profilePrintTableMaxH will then hold the table height. */
|
* profilePrintTableMaxH will then hold the table height. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue