Mercurial > projects > qtd
changeset 213:26036621830e
more D2 examples fixes
author | SokoL_SD |
---|---|
date | Tue, 14 Jul 2009 13:22:48 +0000 |
parents | bc1525b955d8 |
children | 11f1760d1700 |
files | examples/itemviews/customsortfiltermodel/CMakeLists.txt examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d examples/itemviews/customsortfiltermodel/window.d examples/layouts/basiclayouts/dialog.d |
diffstat | 4 files changed, 17 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/itemviews/customsortfiltermodel/CMakeLists.txt Tue Jul 14 13:05:55 2009 +0000 +++ b/examples/itemviews/customsortfiltermodel/CMakeLists.txt Tue Jul 14 13:22:48 2009 +0000 @@ -1,1 +1,1 @@ -build_example(mysortfilterproxymodel main.d window.d mysortfilterproxymodel.d) +build_example(mysortfilterproxymodel DETECT_DEPENDS main.d)
--- a/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d Tue Jul 14 13:05:55 2009 +0000 +++ b/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.d Tue Jul 14 13:22:48 2009 +0000 @@ -82,7 +82,7 @@ protected: - bool filterAcceptsRow(int sourceRow, QModelIndex sourceParent) + override bool filterAcceptsRow(int sourceRow, const QModelIndex sourceParent) { QModelIndex index0 = sourceModel().index(sourceRow, 0, sourceParent); QModelIndex index1 = sourceModel().index(sourceRow, 1, sourceParent); @@ -99,7 +99,7 @@ && dateInRange(sourceModel().data(index2).toDate()); } - bool lessThan(QModelIndex left, QModelIndex right) + override bool lessThan(const QModelIndex left, const QModelIndex right) { QVariant leftData = sourceModel().data(left); QVariant rightData = sourceModel().data(right);
--- a/examples/itemviews/customsortfiltermodel/window.d Tue Jul 14 13:05:55 2009 +0000 +++ b/examples/itemviews/customsortfiltermodel/window.d Tue Jul 14 13:22:48 2009 +0000 @@ -54,8 +54,10 @@ import qt.gui.QVBoxLayout; import qt.gui.QGridLayout; -import mysortfilterproxymodel; - +version(D_Version2) + import mysortfilterproxymodel; +else + import mysortfilterproxymodel_d1; class Window : public QWidget {
--- a/examples/layouts/basiclayouts/dialog.d Tue Jul 14 13:05:55 2009 +0000 +++ b/examples/layouts/basiclayouts/dialog.d Tue Jul 14 13:22:48 2009 +0000 @@ -110,7 +110,11 @@ QHBoxLayout layout = new QHBoxLayout; for (int i = 0; i < NumButtons; ++i) { - buttons[i] = new QPushButton(format(tr("Button {}"), i + 1)); + version(Tango) + const string str = tr("Button {}:"); + else + const string str = tr("Button %s:"); + buttons[i] = new QPushButton(format(str, i + 1)); layout.addWidget(buttons[i]); } horizontalGroupBox.setLayout(layout); @@ -122,7 +126,11 @@ QGridLayout layout = new QGridLayout; for (int i = 0; i < NumGridRows; ++i) { - labels[i] = new QLabel(format(tr("Line {}:"), i + 1)); + version(Tango) + const string str = tr("Line {}:"); + else + const string str = tr("Line %s:"); + labels[i] = new QLabel(format(str, i + 1)); lineEdits[i] = new QLineEdit; layout.addWidget(labels[i], i + 1, 0); layout.addWidget(lineEdits[i], i + 1, 1);