mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Render the table print in curves.
We can use QPicture to record the painting done by a QPainter and it will be saved in vector format, then we can simply paint that. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									e18f4dfdee
								
							
						
					
					
						commit
						8cd4a5f3d1
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		|  | @ -6,6 +6,8 @@ | |||
| #include <QTableView> | ||||
| #include <QHeaderView> | ||||
| #include <QPointer> | ||||
| #include <QPicture> | ||||
| 
 | ||||
| #include "mainwindow.h" | ||||
| #include "../dive.h" | ||||
| #include "../display.h" | ||||
|  | @ -136,6 +138,9 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) | |||
| 	painter.setRenderHint(QPainter::SmoothPixmapTransform); | ||||
| 	painter.scale(scaleX, scaleY); | ||||
| 
 | ||||
| 	QPicture pic; | ||||
| 	QPainter picPainter; | ||||
| 
 | ||||
| 	// setup the profile widget
 | ||||
| 	QPointer<ProfileWidget2> profile = MainWindow::instance()->graphics(); | ||||
| 	const int profileFrameStyle = profile->frameStyle(); | ||||
|  | @ -196,7 +201,10 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) | |||
| 		// draw a table
 | ||||
| 		painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetTable); | ||||
| 		model.setDive(dive); | ||||
| 		table->render(&painter); | ||||
| 		picPainter.begin(&pic); | ||||
| 		table->render(&picPainter); | ||||
| 		picPainter.end(); | ||||
| 		painter.drawPicture(QPoint(0,0), pic); | ||||
| 		painter.setTransform(origTransform); | ||||
| 		col++; | ||||
| 		printed++; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue