Changeset 003e4193be in tspsg
- Timestamp:
- Oct 14, 2007, 5:26:42 AM (17 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 7672bc895b
- Parents:
- f99964aa0b
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cpp
rf99964aa0b r003e4193be 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. -
src/mainwindow.cpp
rf99964aa0b r003e4193be 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 -
src/mainwindow.h
rf99964aa0b r003e4193be 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 -
src/settingsdialog.cpp
rf99964aa0b r003e4193be 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$ -
src/settingsdialog.h
rf99964aa0b r003e4193be 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$ -
ui/mainwindow.ui
rf99964aa0b r003e4193be 6 6 <x>0</x> 7 7 <y>0</y> 8 <width>5 89</width>9 <height> 460</height>8 <width>506</width> 9 <height>396</height> 10 10 </rect> 11 </property>12 <property name="minimumSize" >13 <size>14 <width>589</width>15 <height>460</height>16 </size>17 11 </property> 18 12 <property name="windowTitle" > … … 93 87 <number>3</number> 94 88 </property> 89 <property name="maximum" > 90 <number>5</number> 91 </property> 92 <property name="value" > 93 <number>5</number> 94 </property> 95 95 </widget> 96 96 </item> … … 111 111 </item> 112 112 <item> 113 <widget class="QTableView" name="tableTask" /> 113 <widget class="QTableWidget" name="tableTask" > 114 <property name="selectionMode" > 115 <enum>QAbstractItemView::NoSelection</enum> 116 </property> 117 <property name="rowCount" > 118 <number>5</number> 119 </property> 120 <property name="columnCount" > 121 <number>5</number> 122 </property> 123 <row/> 124 <row/> 125 <row/> 126 <row/> 127 <row/> 128 <column/> 129 <column/> 130 <column/> 131 <column/> 132 <column/> 133 </widget> 114 134 </item> 115 135 <item> … … 200 220 <x>0</x> 201 221 <y>0</y> 202 <width>5 89</width>222 <width>506</width> 203 223 <height>21</height> 204 224 </rect>
Note: See TracChangeset
for help on using the changeset viewer.