Index: src/mainwindow.cpp
===================================================================
--- src/mainwindow.cpp	(revision f44855d99e896e77eaf63a766a930212ca80c747)
+++ src/mainwindow.cpp	(revision 56dca709c9dd62aacfb1a0465cfb82368ee17013)
@@ -40,5 +40,5 @@
 #endif
 #ifndef Q_OS_WINCE
-	printer = new QPrinter();
+	printer = new QPrinter(QPrinter::HighResolution);
 #endif // Q_OS_WINCE
 	groupSettingsLanguageList = new QActionGroup(this);
@@ -59,5 +59,6 @@
 	connect(actionHelpAbout,SIGNAL(triggered()),this,SLOT(actionHelpAboutTriggered()));
 #ifndef Q_OS_WINCE
-	connect(actionFilePrintSetup,SIGNAL(triggered()),this,SLOT(actionFilePrintSetupTriggered()));
+	connect(actionFilePrintPreview,SIGNAL(triggered()),this,SLOT(actionFilePrintPreviewTriggered()));
+	connect(actionFilePrint,SIGNAL(triggered()),this,SLOT(actionFilePrintTriggered()));
 #endif // Q_OS_WINCE
 	connect(buttonSolve,SIGNAL(clicked()),this,SLOT(buttonSolveClicked()));
@@ -84,4 +85,5 @@
 	qsrand(QDateTime().currentDateTime().toTime_t());
 	tspmodel = new CTSPModel();
+	taskView->setModel(tspmodel);
 	connect(tspmodel,SIGNAL(numCitiesChanged(int)),this,SLOT(numCitiesChanged(int)));
 	connect(tspmodel,SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged()));
@@ -92,10 +94,7 @@
 		setFileName();
 		spinCities->setValue(settings->value("NumCities",DEF_NUM_CITIES).toInt());
-		tspmodel->setNumCities(spinCities->value());
-	}
-	taskView->setModel(tspmodel);
+		spinCitiesValueChanged(spinCities->value());
+	}
 	setWindowModified(false);
-	taskView->resizeColumnsToContents();
-	taskView->resizeRowsToContents();
 }
 
@@ -107,4 +106,8 @@
 	if (!enable)
 		output.clear();
+#ifndef Q_OS_WINCE
+	actionFilePrint->setEnabled(enable);
+	actionFilePrintPreview->setEnabled(enable);
+#endif // Q_OS_WINCE
 }
 
@@ -117,5 +120,5 @@
 		lang = settings->value("Language",QLocale::system().name()).toString();
 	}
-static QTranslator *qtTranslator;
+static QTranslator *qtTranslator; // Qt library translator
 	if (qtTranslator) {
 		qApp->removeTranslator(qtTranslator);
@@ -124,5 +127,5 @@
 	}
 	qtTranslator = new QTranslator();
-static QTranslator *translator;
+static QTranslator *translator; // Application translator
 	if (translator) {
 		qApp->removeTranslator(translator);
@@ -139,4 +142,5 @@
 				qApp->installTranslator(qtTranslator);
 			else {
+				// Qt library translation unavailable
 				delete qtTranslator;
 				qtTranslator = NULL;
@@ -147,5 +151,5 @@
 		else {
 			if (!ad)
-				QMessageBox(QMessageBox::Warning,trUtf8("Language change"),trUtf8("Unable to load translation language."),QMessageBox::Ok,this).exec();
+				QMessageBox(QMessageBox::Warning,trUtf8("Language Change"),trUtf8("Unable to load translation language."),QMessageBox::Ok,this).exec();
 			delete translator;
 			translator = NULL;
@@ -346,5 +350,17 @@
 
 #ifndef Q_OS_WINCE
-void MainWindow::actionFilePrintSetupTriggered()
+void MainWindow::printPreview(QPrinter *printer)
+{
+	solutionText->print(printer);
+}
+
+void MainWindow::actionFilePrintPreviewTriggered()
+{
+QPrintPreviewDialog ppd(printer, this);
+    connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *)));
+    ppd.exec();
+}
+
+void MainWindow::actionFilePrintTriggered()
 {
 QPrintDialog pd(printer,this);
@@ -354,5 +370,7 @@
 	pd.setOption(QAbstractPrintDialog::PrintPageRange,false);
 #endif
-	pd.exec();
+	if (pd.exec() != QDialog::Accepted)
+		return;
+	solutionText->document()->print(printer);
 }
 #endif // Q_OS_WINCE
Index: src/mainwindow.h
===================================================================
--- src/mainwindow.h	(revision f44855d99e896e77eaf63a766a930212ca80c747)
+++ src/mainwindow.h	(revision 56dca709c9dd62aacfb1a0465cfb82368ee17013)
@@ -55,5 +55,7 @@
 	void dataChanged();
 #ifndef Q_OS_WINCE
-	void actionFilePrintSetupTriggered();
+	void printPreview(QPrinter *);
+	void actionFilePrintPreviewTriggered();
+	void actionFilePrintTriggered();
 #endif // Q_OS_WINCE
 	void buttonSolveClicked();
