comparison examples/itemviews/customsortfiltermodel/window.d @ 323:7a3c43424dca signals

make all examples compile with new signals/slots
author eldar_ins@eldar-laptop
date Mon, 28 Dec 2009 16:28:55 +0500
parents 256ab6cb8e85
children
comparison
equal deleted inserted replaced
322:7c2cf27391c4 323:7a3c43424dca
100 toDateEdit = new QDateEdit; 100 toDateEdit = new QDateEdit;
101 toDateEdit.setDate(new QDate(2099, 12, 31)); 101 toDateEdit.setDate(new QDate(2099, 12, 31));
102 toLabel = new QLabel(tr("&To:")); 102 toLabel = new QLabel(tr("&To:"));
103 toLabel.setBuddy(toDateEdit); 103 toLabel.setBuddy(toDateEdit);
104 104
105 connect!("textChanged")(filterPatternLineEdit, &this.textFilterChanged); 105 connect(filterPatternLineEdit, "textChanged", this, "textFilterChanged");
106 connect!("currentIndexChanged")(filterSyntaxComboBox, &this.textFilterChanged); 106 connect(filterSyntaxComboBox, "currentIndexChanged", this, "textFilterChanged");
107 connect!("toggled")(filterCaseSensitivityCheckBox, &this.textFilterChanged); 107 connect(filterCaseSensitivityCheckBox, "toggled", this, "textFilterChanged");
108 connect!("dateChanged")(fromDateEdit, &this.dateFilterChanged); 108 connect(fromDateEdit, "dateChanged", this, "dateFilterChanged");
109 connect!("dateChanged")(toDateEdit, &this.dateFilterChanged); 109 connect(toDateEdit, "dateChanged", this, "dateFilterChanged");
110 110
111 proxyView = new QTreeView; 111 proxyView = new QTreeView;
112 proxyView.setRootIsDecorated(false); 112 proxyView.setRootIsDecorated(false);
113 proxyView.setAlternatingRowColors(true); 113 proxyView.setAlternatingRowColors(true);
114 proxyView.setModel(proxyModel); 114 proxyView.setModel(proxyModel);
142 { 142 {
143 proxyModel.setSourceModel(model); 143 proxyModel.setSourceModel(model);
144 sourceView.setModel(model); 144 sourceView.setModel(model);
145 } 145 }
146 146
147 private: 147 private: // slots
148 148
149 void textFilterChanged() 149 void slot_textFilterChanged()
150 { 150 {
151 QRegExp.PatternSyntax syntax = cast(QRegExp.PatternSyntax) filterSyntaxComboBox.itemData( 151 QRegExp.PatternSyntax syntax = cast(QRegExp.PatternSyntax) filterSyntaxComboBox.itemData(
152 filterSyntaxComboBox.currentIndex()).toInt(); 152 filterSyntaxComboBox.currentIndex()).toInt();
153 Qt.CaseSensitivity caseSensitivity = 153 Qt.CaseSensitivity caseSensitivity =
154 filterCaseSensitivityCheckBox.isChecked() ? Qt.CaseSensitive 154 filterCaseSensitivityCheckBox.isChecked() ? Qt.CaseSensitive
156 156
157 auto regExp = new QRegExp(filterPatternLineEdit.text(), caseSensitivity, syntax); 157 auto regExp = new QRegExp(filterPatternLineEdit.text(), caseSensitivity, syntax);
158 proxyModel.setFilterRegExp(regExp); 158 proxyModel.setFilterRegExp(regExp);
159 } 159 }
160 160
161 void dateFilterChanged() 161 void slot_dateFilterChanged()
162 { 162 {
163 proxyModel.setFilterMinimumDate(fromDateEdit.date()); 163 proxyModel.setFilterMinimumDate(fromDateEdit.date());
164 proxyModel.setFilterMaximumDate(toDateEdit.date()); 164 proxyModel.setFilterMaximumDate(toDateEdit.date());
165 } 165 }
166
167 mixin Q_OBJECT;
166 168
167 private: 169 private:
168 170
169 MySortFilterProxyModel proxyModel; 171 MySortFilterProxyModel proxyModel;
170 172