Changeset 5354a01311 in tspsg for src
- Timestamp:
- Jun 15, 2009, 5:10:25 PM (16 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 5fce561905
- Parents:
- bcfd415fe2
- Location:
- src
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cpp
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 46 46 return app.exec(); 47 47 } 48 -
src/mainwindow.cpp
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 23 23 24 24 #include <QtGui> 25 #ifndef Q_OS_WINCE 26 #include <QPrintDialog> 27 #endif // Q_OS_WINCE 25 28 #include "mainwindow.h" 26 29 … … 32 35 setupUi(this); 33 36 connect(actionSettingsSettings,SIGNAL(triggered()),this,SLOT(ChangeSettings())); 37 #ifndef Q_OS_WINCE 38 connect(actionFilePrintSetup,SIGNAL(triggered()),this,SLOT(PrintSetup())); 39 #endif // Q_OS_WINCE 34 40 connect(buttonSolve,SIGNAL(clicked()),this,SLOT(Solve())); 35 41 connect(buttonRandom,SIGNAL(clicked()),this,SLOT(Random())); 36 42 connect(spinCities,SIGNAL(valueChanged(int)),this,SLOT(CitiesNumberChanged(int))); 43 QRect rect = geometry(); 44 #ifdef Q_OS_WINCE 45 // HACK: Fix for all tabWidget elements becoming "unclickable" if making it central widget. 46 rect.setSize(QApplication::desktop()->availableGeometry().size()); 47 rect.setHeight(rect.height() - (QApplication::desktop()->screenGeometry().height() - QApplication::desktop()->availableGeometry().height())); 48 tabWidget->resize(rect.width(),rect.height() - toolBar->size().height()); 49 #else 37 50 // Centering MainWindow 38 51 // TODO: Loading of saved window state 39 QRect rect = geometry();40 rect.moveCenter(QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen()).center()); 52 rect.moveCenter(QApplication::desktop()->availableGeometry().center()); 53 #endif // Q_OS_WINCE 41 54 setGeometry(rect); 42 55 qsrand(QDateTime().currentDateTime().toTime_t()); … … 63 76 } 64 77 } 78 79 #ifndef Q_OS_WINCE 80 void MainWindow::PrintSetup() 81 { 82 QPrintDialog pd; 83 pd.exec(); 84 } 85 #endif // Q_OS_WINCE 65 86 66 87 void MainWindow::Random() … … 93 114 // tabWidget->setCurrentIndex(1); 94 115 } 95 -
src/mainwindow.h
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 26 26 27 27 #include <QMainWindow> 28 #include "ui_mainwindow.h" 28 #ifdef Q_OS_WINCE 29 #include "ui_mainwindow.ce.h" 30 #else 31 #include "ui_mainwindow.h" 32 #endif // Q_OS_WINCE 29 33 #include "settingsdialog.h" 30 34 #include "tspsolver.h" … … 38 42 private slots: 39 43 void ChangeSettings(); 44 #ifndef Q_OS_WINCE 45 void PrintSetup(); 46 #endif // Q_OS_WINCE 40 47 void Solve(); 41 48 void Random(); … … 48 55 49 56 #endif // MAINWINDOW_H 50 -
src/settingsdialog.cpp
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 24 24 #include <QMessageBox> 25 25 #include <QStatusTipEvent> 26 #include <QFontDialog> 26 27 #include "settingsdialog.h" 27 28 … … 33 34 connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject())); 34 35 connect(spinRandMin,SIGNAL(valueChanged(int)),this,SLOT(spinRandMinValueChanged(int))); 36 connect(buttonFont,SIGNAL(clicked()),this,SLOT(buttonFontClicked())); 35 37 // setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint); 36 38 setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint); 37 39 layout()->setSizeConstraint(layout()->SetFixedSize); 40 #ifndef Q_OS_WINCE 38 41 // Setting initial text of dialog hint label to own status tip 39 42 // text. … … 43 46 labelHint->setMaximumHeight(labelHint->height()); 44 47 labelHint->setMinimumHeight(labelHint->height()); 48 #endif // Q_OS_WINCE 45 49 } 46 50 51 #ifndef Q_OS_WINCE 47 52 bool SettingsDialog::event(QEvent *ev) 48 53 { … … 60 65 return QDialog::event(ev); 61 66 } 67 #endif // Q_OS_WINCE 62 68 69 void SettingsDialog::buttonFontClicked() 70 { 71 // TODO: Pass current font to dialog and save selected. 72 QFontDialog fd; 73 fd.exec(); 74 } -
src/settingsdialog.h
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 26 26 27 27 #include <QDialog> 28 #include "ui_settingsdialog.h" 28 #ifdef Q_OS_WINCE 29 #include "ui_settingsdialog.ce.h" 30 #else 31 #include "ui_settingsdialog.h" 32 #endif // Q_OS_WINCE 29 33 30 34 class SettingsDialog: public QDialog, public Ui::SettingsDialog … … 35 39 36 40 private: 41 #ifndef WINCE 37 42 bool event(QEvent *); 43 #endif 38 44 39 45 private slots: 40 46 void spinRandMinValueChanged(int val) { spinRandMax->setMinimum(val + 1); } 47 void buttonFontClicked(); 41 48 }; 42 49 43 50 #endif // SETTINGSDIALOG_H 44 -
src/tspmodel.cpp
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 45 45 } 46 46 47 QVariant CTSPModel::headerData(int section, Qt::Orientation , int role) const47 QVariant CTSPModel::headerData(int section, Qt::Orientation orientation, int role) const 48 48 { 49 49 if (role == Qt::DisplayRole) 50 return trUtf8("Город %1").arg(section + 1); 50 if (orientation == Qt::Vertical) 51 return trUtf8("Город %1").arg(section + 1); 52 else 53 return trUtf8("%1").arg(section + 1); 51 54 return QVariant(); 52 55 } … … 143 146 emit dataChanged(index(0,0),index(nCities - 1,nCities - 1)); 144 147 } 145 -
src/tspmodel.h
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 60 60 61 61 #endif // TSPMODEL_H 62 -
src/tspsolver.cpp
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 L¸ppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 58 58 return step; 59 59 } 60 -
src/tspsolver.h
rbcfd415fe2 r5354a01311 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 L¸ppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 4 * 5 5 * $Id$ … … 53 53 54 54 #endif // TSPSOLVER_H 55
Note: See TracChangeset
for help on using the changeset viewer.