comparison widgets/InteractiveFileFinder.cpp @ 616:d632a1e87018 qt5

Build fixes for Qt5
author Chris Cannam
date Mon, 11 Mar 2013 14:23:52 +0000
parents 4806715f7a19
children ee99f5c0050c
comparison
equal deleted inserted replaced
615:156a120345ae 616:d632a1e87018
128 QString path = ""; 128 QString path = "";
129 129
130 // Use our own QFileDialog just for symmetry with getSaveFileName below 130 // Use our own QFileDialog just for symmetry with getSaveFileName below
131 131
132 QFileDialog dialog; 132 QFileDialog dialog;
133 dialog.setFilters(filter.split('\n')); 133 dialog.setNameFilters(filter.split('\n'));
134 dialog.setWindowTitle(title); 134 dialog.setWindowTitle(title);
135 dialog.setDirectory(lastPath); 135 dialog.setDirectory(lastPath);
136 136
137 dialog.setAcceptMode(QFileDialog::AcceptOpen); 137 dialog.setAcceptMode(QFileDialog::AcceptOpen);
138 dialog.setFileMode(QFileDialog::ExistingFile); 138 dialog.setFileMode(QFileDialog::ExistingFile);
252 252
253 // Use our own QFileDialog instead of static functions, as we may 253 // Use our own QFileDialog instead of static functions, as we may
254 // need to adjust the file extension based on the selected filter 254 // need to adjust the file extension based on the selected filter
255 255
256 QFileDialog dialog; 256 QFileDialog dialog;
257 dialog.setFilters(filter.split('\n')); 257 dialog.setNameFilters(filter.split('\n'));
258 dialog.setWindowTitle(title); 258 dialog.setWindowTitle(title);
259 dialog.setDirectory(lastPath); 259 dialog.setDirectory(lastPath);
260 260
261 dialog.setAcceptMode(QFileDialog::AcceptSave); 261 dialog.setAcceptMode(QFileDialog::AcceptSave);
262 dialog.setFileMode(QFileDialog::AnyFile); 262 dialog.setFileMode(QFileDialog::AnyFile);
287 std::cerr << "type = " << type << ", suffix = " << fi.suffix() << std::endl; 287 std::cerr << "type = " << type << ", suffix = " << fi.suffix() << std::endl;
288 288
289 if ((type == LayerFile || type == LayerFileNoMidi) 289 if ((type == LayerFile || type == LayerFileNoMidi)
290 && fi.suffix() == "") { 290 && fi.suffix() == "") {
291 QString expectedExtension; 291 QString expectedExtension;
292 QString selectedFilter = dialog.selectedFilter(); 292 QString selectedFilter = dialog.selectedNameFilter();
293 if (selectedFilter.contains(".svl")) { 293 if (selectedFilter.contains(".svl")) {
294 expectedExtension = "svl"; 294 expectedExtension = "svl";
295 } else if (selectedFilter.contains(".txt")) { 295 } else if (selectedFilter.contains(".txt")) {
296 expectedExtension = "txt"; 296 expectedExtension = "txt";
297 } else if (selectedFilter.contains(".csv")) { 297 } else if (selectedFilter.contains(".csv")) {