Mercurial > projects > qtd
comparison examples/mainwindows/sdi/mainwindow.d @ 350:31520b2c0b3c
Removed dependency on parent trait and stringof
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Thu, 20 May 2010 15:49:08 +0300 |
parents | 7a3c43424dca |
children |
comparison
equal
deleted
inserted
replaced
349:925386e0e780 | 350:31520b2c0b3c |
---|---|
55 import qt.gui.QFileDialog; | 55 import qt.gui.QFileDialog; |
56 import qt.gui.QMessageBox; | 56 import qt.gui.QMessageBox; |
57 import qt.core.QSettings; | 57 import qt.core.QSettings; |
58 import qt.core.QTextStream; | 58 import qt.core.QTextStream; |
59 | 59 |
60 version(Tango) | 60 //import std.string; |
61 { | 61 import std.conv; |
62 import tango.text.Util; | 62 |
63 import Int = tango.text.convert.Integer; | |
64 } | |
65 else | |
66 { | |
67 import std.string; | |
68 import std.conv; | |
69 } | |
70 class MainWindow : public QMainWindow | 63 class MainWindow : public QMainWindow |
71 { | 64 { |
72 // Q_OBJECT | 65 // Q_OBJECT |
73 | 66 |
74 public: | 67 public: |
369 { | 362 { |
370 static int sequenceNumber = 1; | 363 static int sequenceNumber = 1; |
371 | 364 |
372 isUntitled = fileName == null; | 365 isUntitled = fileName == null; |
373 if (isUntitled) { | 366 if (isUntitled) { |
374 version(Tango) | |
375 curFile = tr("document" ~ Int.toString(sequenceNumber++) ~ ".txt"); | |
376 else | |
377 curFile = tr("document" ~ to!(string)(sequenceNumber++) ~ ".txt"); | 367 curFile = tr("document" ~ to!(string)(sequenceNumber++) ~ ".txt"); |
378 } else { | 368 } else { |
379 scope qfi = new QFileInfo(fileName); | 369 scope qfi = new QFileInfo(fileName); |
380 curFile = qfi.canonicalFilePath; | 370 curFile = qfi.canonicalFilePath; |
381 } | 371 } |
424 QAction cutAct; | 414 QAction cutAct; |
425 QAction copyAct; | 415 QAction copyAct; |
426 QAction pasteAct; | 416 QAction pasteAct; |
427 QAction aboutAct; | 417 QAction aboutAct; |
428 QAction aboutQtAct; | 418 QAction aboutQtAct; |
429 | 419 |
430 mixin Q_OBJECT; | 420 mixin Q_OBJECT; |
431 }; | 421 }; |