Index: src/bb10proxystyle.cpp
===================================================================
--- src/bb10proxystyle.cpp	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
+++ src/bb10proxystyle.cpp	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -0,0 +1,25 @@
+#include "bb10proxystyle.h"
+
+BB10ProxyStyle::BB10ProxyStyle(QStyle *style)
+    : QProxyStyle(style) {}
+
+int BB10ProxyStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
+{
+    switch (metric) {
+    case QStyle::PM_ButtonIconSize:
+        return 42;
+    case QStyle::PM_SmallIconSize:
+        return 42;
+    case QStyle::PM_LargeIconSize:
+        return 64;
+    default:
+        return QProxyStyle::pixelMetric(metric, option, widget);
+    }
+}
+
+int BB10ProxyStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const
+{
+    if (hint == QStyle::SH_UnderlineShortcut)
+        return 0;
+    return QProxyStyle::styleHint(hint, option, widget, returnData);
+}
Index: src/bb10proxystyle.h
===================================================================
--- src/bb10proxystyle.h	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
+++ src/bb10proxystyle.h	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -0,0 +1,72 @@
+#ifndef BB10PROXYSTYLE_H
+#define BB10PROXYSTYLE_H
+
+#include <QProxyStyle>
+
+class BB10ProxyStyle : public QProxyStyle
+{
+public:
+    BB10ProxyStyle(QStyle *style = 0);
+
+    int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const;
+    int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const;
+};
+
+#define CSS_FIX \
+"QMenuBar {"\
+"    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #444 stop:0.65 #333, stop:1 #444);"\
+"    border-bottom: 1px solid darkgray;"\
+"    spacing: 1px;"\
+"}"\
+"QMenuBar::item {"\
+"    padding: 0.3em 0.5em;"\
+"}"\
+"QMenuBar::item:selected {"\
+"    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #00a8df stop:0.65 #00889f, stop:1 #00a8df);"\
+"}"\
+"QMenu {"\
+"    border: 1px solid darkgray;"\
+"}"\
+"QMenu::item {"\
+"    padding: 0.4em 0.5em 0.4em 1.4em;"\
+"    color: white;"\
+"    font-size: 9pt;"\
+"    background-color: #121212;"\
+"}"\
+"QMenu::item:selected {"\
+"    background-color: #00a8df;"\
+"}"\
+"QMenu::item:disabled {"\
+"    color: darkgray;"\
+"    background-color: #121212;"\
+"}"\
+"QMenu::icon {"\
+"    margin-left: 0.85em;"\
+"}"\
+"QTabBar {"\
+"    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #444 stop:0.65 #333, stop:1 #444);"\
+"    border-bottom: 1px solid darkgray;"\
+"    spacing: 1px;"\
+"}"\
+"QTabBar::tab {"\
+"    padding: 0.3em 0.5em;"\
+"}"\
+"QTabBar::tab:selected {"\
+"    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #00a8df stop:0.65 #00889f, stop:1 #00a8df);"\
+"    padding: 0.3em 0.5em;"\
+"}"\
+"QTableView {"\
+"    gridline-color: darkgray;"\
+"}"\
+"QTableView::item {"\
+"    padding: 0 0.5em;"\
+"}"\
+"QComboBox {"\
+"    padding: 0.5em 1.3em 0.5em 0.5em;"\
+"}"\
+"QTextBrowser {"\
+"    background-color: lightgray;"\
+"    color: black;"\
+"}"
+
+#endif // BB10PROXYSTYLE_H
Index: src/defaults.h
===================================================================
--- src/defaults.h	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ src/defaults.h	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -86,6 +86,13 @@
 //! Default for "Embed solution graph into HTML"
 #define DEF_EMBED_GRAPH_INTO_HTML false
-//! Default solution graph size in centimeters (HQ size is this size * HQ_FACTOR)
-#define DEF_GRAPH_WIDTH 4.5
+/*!
+ * \def DEF_GRAPH_WIDTH
+ * \brief Default solution graph size in centimeters (HQ size is this size * HQ_FACTOR)
+ */
+#ifdef Q_OS_BLACKBERRY
+#   define DEF_GRAPH_WIDTH 2.5
+#else
+#   define DEF_GRAPH_WIDTH 4.5
+#endif
 //! Default for "Show solution steps' matrices for every solution step"
 #define DEF_SHOW_MATRIX true
@@ -104,9 +111,18 @@
 #ifdef Q_OS_SYMBIAN
 #   define DEF_FONT_SIZE 8
+#elif defined(Q_OS_BLACKBERRY)
+#   define DEF_FONT_SIZE 7
 #else
 #   define DEF_FONT_SIZE 10
 #endif // Q_OS_SYMBIAN
-//! Default solution text color
-#define DEF_TEXT_COLOR QApplication::palette().color(QPalette::Text)
+/*!
+ * \def DEF_TEXT_COLOR
+ * \brief Default solution text color
+ */
+#ifdef Q_OS_BLACKBERRY
+#   define DEF_TEXT_COLOR Qt::black
+#else
+#   define DEF_TEXT_COLOR QApplication::palette().color(QPalette::Text)
+#endif
 //! Default selected candidate color
 #define DEF_SELECTED_COLOR "#008000"
Index: src/globals.h
===================================================================
--- src/globals.h	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ src/globals.h	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -120,5 +120,5 @@
 #ifndef DOXYGEN_EXCLUDE
 
-#ifdef HANDHELD
+#if defined(HANDHELD) && !defined(Q_OS_BLACKBERRY)
 #   define ICON_SIZE "48x48"
 #   define ICON_FORMAT "png"
Index: src/main.cpp
===================================================================
--- src/main.cpp	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ src/main.cpp	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -23,4 +23,9 @@
 
 #include "mainwindow.h"
+#include "version.h"
+
+#ifdef Q_OS_BLACKBERRY
+#   include "bb10proxystyle.h"
+#endif // Q_OS_BLACKBERRY
 
 #include <QDateTime>
@@ -28,5 +33,4 @@
 #include <QTextCodec>
 #include <QTranslator>
-#include "version.h"
 
 #if QT_VERSION < QT_VERSION_CHECK(4,6,0)
@@ -64,4 +68,10 @@
     app.setApplicationName("TSP Solver and Generator");
     app.setApplicationVersion(BUILD_VERSION);
+
+#ifdef Q_OS_BLACKBERRY
+    QApplication::setStartDragDistance(42);
+    QApplication::setStyle(new BB10ProxyStyle);
+    app.setStyleSheet(CSS_FIX);
+#endif // Q_OS_BLACKBERRY
 
     // Seeding random number generator
Index: src/mainwindow.cpp
===================================================================
--- src/mainwindow.cpp	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ src/mainwindow.cpp	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -149,4 +149,8 @@
     setAcceptDrops(true);
 
+#ifdef Q_OS_BLACKBERRY
+    taskView->setEditTriggers(QAbstractItemView::AllEditTriggers);
+#endif
+
     initDocStyleSheet();
 
@@ -182,5 +186,5 @@
     connect(actionFileSaveAsTask, SIGNAL(triggered()), SLOT(actionFileSaveAsTaskTriggered()));
     connect(actionFileSaveAsSolution, SIGNAL(triggered()), SLOT(actionFileSaveAsSolutionTriggered()));
-#ifndef QT_NO_PRINTER
+#ifndef QT_NO_PRINTDIALOG
     connect(actionFilePrintPreview, SIGNAL(triggered()), SLOT(actionFilePrintPreviewTriggered()));
     connect(actionFilePageSetup, SIGNAL(triggered()), SLOT(actionFilePageSetupTriggered()));
@@ -483,5 +487,5 @@
 }
 
-#ifndef QT_NO_PRINTER
+#ifndef QT_NO_PRINTDIALOG
 void MainWindow::actionFilePrintPreviewTriggered()
 {
@@ -541,5 +545,5 @@
     QApplication::restoreOverrideCursor();
 }
-#endif // QT_NO_PRINTER
+#endif // QT_NO_PRINTDIALOG
 
 void MainWindow::actionSettingsPreferencesTriggered()
@@ -744,4 +748,7 @@
     txtAbout->moveCursor(QTextCursor::Start);
     txtAbout->setFrameShape(QFrame::NoFrame);
+#ifdef Q_OS_BLACKBERRY
+    txtAbout->setAttribute(Qt::WA_InputMethodEnabled, false);
+#endif
 
 //	txtCredits->setWordWrapMode(QTextOption::NoWrap);
@@ -750,4 +757,7 @@
     txtCredits->moveCursor(QTextCursor::Start);
     txtCredits->setFrameShape(QFrame::NoFrame);
+#ifdef Q_OS_BLACKBERRY
+    txtCredits->setAttribute(Qt::WA_InputMethodEnabled, false);
+#endif
 
     txtLicense->setWordWrapMode(QTextOption::NoWrap);
@@ -756,4 +766,7 @@
     txtLicense->moveCursor(QTextCursor::Start);
     txtLicense->setFrameShape(QFrame::NoFrame);
+#ifdef Q_OS_BLACKBERRY
+    txtLicense->setAttribute(Qt::WA_InputMethodEnabled, false);
+#endif
 
     bb->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
@@ -807,5 +820,5 @@
 #ifndef HANDHELD
     dlg->resize(450, 350);
-#elif defined(Q_OS_SYMBIAN)
+#elif defined(Q_OS_SYMBIAN) || defined(Q_OS_BLACKBERRY)
     dlg->setWindowState(Qt::WindowMaximized);
 #endif
@@ -857,4 +870,5 @@
     pd.setCancelButton(cancel);
     pd.setMaximum(n);
+    pd.setAutoClose(false);
     pd.setAutoReset(false);
     pd.setLabelText(tr("Calculating optimal route..."));
@@ -1737,8 +1751,12 @@
         Ui_MainWindow::retranslateUi(this);
 
+#ifdef Q_OS_BLACKBERRY
+    menuSettings->removeAction(menuSettingsStyle->menuAction());
+#else
     loadStyleList();
+#endif
     loadToolbarList();
 
-#ifndef QT_NO_PRINTER
+#ifndef QT_NO_PRINTDIALOG
     actionFilePrintPreview->setText(tr("P&rint Preview..."));
 #ifndef QT_NO_TOOLTIP
@@ -1764,6 +1782,8 @@
     actionFilePrint->setStatusTip(tr("Print current solution results"));
 #endif // QT_NO_STATUSTIP
+#ifndef QT_NO_SHORTCUT
     actionFilePrint->setShortcut(tr("Ctrl+P"));
-#endif // QT_NO_PRINTER
+#endif // QT_NO_SHORTCUT
+#endif // QT_NO_PRINTDIALOG
 
 #ifndef QT_NO_STATUSTIP
@@ -1846,10 +1866,10 @@
     actionFileOpen->setIcon(GET_ICON("document-open"));
     actionFileSave->setIcon(GET_ICON("document-save"));
-#ifndef HANDHELD
+#if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY)
     menuFileSaveAs->setIcon(GET_ICON("document-save-as"));
 #endif
     actionFileExit->setIcon(GET_ICON("application-exit"));
     // Settings Menu
-#ifndef HANDHELD
+#if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY)
     menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale"));
 #if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
@@ -1862,5 +1882,5 @@
     actionSettingsPreferences->setIcon(GET_ICON("preferences-system"));
     // Help Menu
-#ifndef HANDHELD
+#if !defined(HANDHELD) || defined(Q_OS_BLACKBERRY)
     actionHelpContents->setIcon(GET_ICON("help-contents"));
     actionHelpContextual->setIcon(GET_ICON("help-contextual"));
@@ -1868,9 +1888,15 @@
     actionHelpReportBug->setIcon(GET_ICON("tools-report-bug"));
     actionHelpAbout->setIcon(GET_ICON("help-about"));
+#ifdef Q_OS_BLACKBERRY
+    // Qt about dialog is too big for the screen
+    // and it's impossible to close it.
+    menuHelp->removeAction(actionHelpAboutQt);
+#else // Q_OS_BLACKBERRY
 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
     actionHelpAboutQt->setIcon(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"));
-#else
+#else // QT_VERSION < QT_VERSION_CHECK(5,0,0)
     actionHelpAboutQt->setIcon(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
 #endif // QT_VERSION < QT_VERSION_CHECK(5,0,0)
+#endif // Q_OS_BLACKBERRY
 #endif // HANDHELD
     // Buttons
@@ -1922,5 +1948,5 @@
     solutionText->setWordWrapMode(QTextOption::WordWrap);
 
-#ifndef QT_NO_PRINTER
+#ifndef QT_NO_PRINTDIALOG
     actionFilePrintPreview = new QAction(this);
     actionFilePrintPreview->setObjectName("actionFilePrintPreview");
@@ -1948,5 +1974,5 @@
 
     toolBarMain->insertAction(actionSettingsPreferences, actionFilePrint);
-#endif // QT_NO_PRINTER
+#endif // QT_NO_PRINTDIALOG
 
     groupSettingsLanguageList = new QActionGroup(this);
@@ -2021,8 +2047,8 @@
     actionFileSaveAsSolution->setEnabled(enable);
     solutionText->setEnabled(enable);
-#ifndef QT_NO_PRINTER
+#ifndef QT_NO_PRINTDIALOG
     actionFilePrint->setEnabled(enable);
     actionFilePrintPreview->setEnabled(enable);
-#endif // QT_NO_PRINTER
+#endif // QT_NO_PRINTDIALOG
 }
 
Index: src/mainwindow.h
===================================================================
--- src/mainwindow.h	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ src/mainwindow.h	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -71,9 +71,9 @@
     void actionFileSaveAsTaskTriggered();
     void actionFileSaveAsSolutionTriggered();
-#ifndef QT_NO_PRINTER
+#ifndef QT_NO_PRINTDIALOG
     void actionFilePrintPreviewTriggered();
     void actionFilePageSetupTriggered();
     void actionFilePrintTriggered();
-#endif // QT_NO_PRINTER
+#endif // QT_NO_PRINTDIALOG
     void actionSettingsPreferencesTriggered();
     void actionSettingsLanguageAutodetectTriggered(bool checked);
@@ -118,7 +118,9 @@
 #ifndef QT_NO_PRINTER
     QPrinter *printer;
+#ifndef QT_NO_PRINTDIALOG
     QAction *actionFilePrintPreview;
     QAction *actionFilePageSetup;
     QAction *actionFilePrint;
+#endif // QT_NO_PRINTDIALOG
 #endif // QT_NO_PRINTER
     QAction *actionHelpCheck4Updates;
Index: src/settingsdialog.cpp
===================================================================
--- src/settingsdialog.cpp	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ src/settingsdialog.cpp	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -546,14 +546,23 @@
 void SettingsDialog::buttonFontClicked()
 {
-bool ok;
-QFont font = QFontDialog::getFont(&ok, this->font, this);
-    if (ok && (this->font != font)) {
-        this->font = font;
-        QFont f = font;
-        f.setPointSize(labelFontExample->font().pointSize());
-        labelFontExample->setFont(f);
-        labelFontExample->setText(font.family());
-        _fontChanged = true;
-    }
+    QFont newFont;
+#ifdef Q_OS_BLACKBERRY
+    QFontDialog fd(font, this);
+    fd.setWindowState(Qt::WindowMaximized);
+    if ((fd.exec() != QDialog::Accepted) || (fd.selectedFont() == font))
+        return;
+    newFont = fd.selectedFont();
+#else
+    bool ok;
+    newFont = QFontDialog::getFont(&ok, font, this);
+    if (!ok || (font == newFont))
+        return;
+#endif
+    font = newFont;
+    QFont f = font;
+    f.setPointSize(labelFontExample->font().pointSize());
+    labelFontExample->setFont(f);
+    labelFontExample->setText(font.family());
+    _fontChanged = true;
 }
 
Index: tspsg.pri
===================================================================
--- tspsg.pri	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ tspsg.pri	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -32,4 +32,9 @@
     src/qtwin.cpp
 
+blackberry {
+    HEADERS += src/bb10proxystyle.h
+    SOURCES += src/bb10proxystyle.cpp
+}
+
 #Forms
 FORMS += ui/mainwindow.ui \
@@ -40,5 +45,7 @@
     l10n/l10n.qrc
 
-handheld {
+blackberry {
+    RESOURCES += resources/desktop.qrc
+} else:handheld {
     RESOURCES += resources/handheld.qrc
 } else {
Index: tspsg.pro
===================================================================
--- tspsg.pro	(revision 1241232377a4b2410dbae7c90864eec2f15a3279)
+++ tspsg.pro	(revision 7ed8b57eea1113272fa18cf2d867190a7ae56df7)
@@ -23,4 +23,9 @@
 wincewm*|symbian|maemo*|simulator|blackberry {
     CONFIG += handheld
+}
+blackberry {
+#    DEFINES += QT_NO_SHORTCUT
+    DEFINES += QT_NO_PRINTDIALOG
+    DEFINES += QT_NO_PRINTPREVIEWDIALOG
 }
 
