- Timestamp:
- Oct 14, 2007, 5:26:42 AM (17 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main.cpp
-
Property
svn:keywords
set to
Id URL
r2 r4 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 L¸ppa <lacontacts[at]gmail[dot]com> 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com> 4 * 5 * $Id$ 6 * $URL$ 4 7 * 5 8 * This file is part of TSPSG. -
Property
svn:keywords
set to
-
trunk/src/mainwindow.cpp
-
Property
svn:keywords
set to
Id URL
r2 r4 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 L¸ppa <lacontacts[at]gmail[dot]com> 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com> 4 * 5 * $Id$ 6 * $URL$ 4 7 * 5 8 * This file is part of TSPSG. … … 29 32 setupUi(this); 30 33 connect(actionSettingsSettings,SIGNAL(triggered()),this,SLOT(ChangeSettings())); 34 connect(spinCities,SIGNAL(valueChanged(int)),this,SLOT(CitiesNumberChanged(int))); 31 35 // Centering MainWindow 32 36 // TODO: Loading of saved window state … … 34 38 rect.moveCenter(QApplication::desktop()->screenGeometry(QApplication::desktop()->primaryScreen()).center()); 35 39 setGeometry(rect); 40 for (int k = 0; k < tableTask->rowCount(); k++) { 41 QTableWidgetItem *item = new QTableWidgetItem(trUtf8("Город ")+QVariant(k + 1).toString()); 42 tableTask->setVerticalHeaderItem(k,item); 43 } 44 for (int k = 0; k < tableTask->columnCount(); k++) { 45 QTableWidgetItem *item = new QTableWidgetItem(trUtf8("Город ")+QVariant(k + 1).toString()); 46 tableTask->setHorizontalHeaderItem(k,item); 47 } 48 tableTask->resizeRowsToContents(); 49 tableTask->resizeColumnsToContents(); 50 } 36 51 52 void MainWindow::CitiesNumberChanged(int n) 53 { 54 // Adding row, setting header and adjusting its size 55 bool increased = tableTask->rowCount() < n ? true : false; 56 tableTask->setRowCount(n); 57 QTableWidgetItem *item = new QTableWidgetItem(trUtf8("Город ")+QVariant(n).toString()); 58 tableTask->setVerticalHeaderItem(n - 1,item); 59 if (increased) 60 tableTask->resizeRowToContents(n - 1); 61 // Adding column, setting header and adjusting its size 62 increased = tableTask->columnCount() < n ? true : false; 63 tableTask->setColumnCount(n); 64 item = new QTableWidgetItem(trUtf8("Город ")+QVariant(n).toString()); 65 tableTask->setHorizontalHeaderItem(n - 1,item); 66 if (increased) 67 tableTask->resizeColumnToContents(n - 1); 68 tableTask->setMinimumSize(tableTask->sizeHint()); 37 69 } 38 70 -
Property
svn:keywords
set to
-
trunk/src/mainwindow.h
-
Property
svn:keywords
set to
Id URL
r1 r4 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 L¸ppa <lacontacts[at]gmail[dot]com> 3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com> 4 * 5 * $Id$ 6 * $URL$ 4 7 * 5 8 * This file is part of TSPSG. … … 33 36 private slots: 34 37 void ChangeSettings(); 38 void CitiesNumberChanged(int n); 35 39 }; 36 40 -
Property
svn:keywords
set to
-
trunk/src/settingsdialog.cpp
r3 r4 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 L ¸ppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com> 4 4 * 5 5 * $Id$ -
trunk/src/settingsdialog.h
r3 r4 1 1 /* 2 2 * TSPSG - TSP Solver and Generator 3 * Copyright (C) 2007 L ¸ppa <lacontacts[at]gmail[dot]com>3 * Copyright (C) 2007 Lёppa <lacontacts[at]gmail[dot]com> 4 4 * 5 5 * $Id$
Note: See TracChangeset
for help on using the changeset viewer.