125 view->setRowCount( 3 ); |
125 view->setRowCount( 3 ); |
126 }else { |
126 }else { |
127 view->setColumnCount( 3 ); |
127 view->setColumnCount( 3 ); |
128 view->setRowCount( 5 ); |
128 view->setRowCount( 5 ); |
129 } |
129 } |
130 view->setTextVisible(false); |
130 // view->setTextVisible(false); |
131 view->setUniformItemSizes( true ); |
131 view->setUniformItemSizes( true ); |
132 view->setItemRecycling( true ); |
132 view->setItemRecycling( true ); |
133 //this could be done to change mode, for images it doesn't make sence, becouse images thumbnails are created by default only for medium and fullsize |
133 //this could be done to change mode, for images it doesn't make sence, becouse images thumbnails are created by default only for medium and fullsize |
134 // AbstractDataProvider *data = mModel->DataProvider(); |
134 // AbstractDataProvider *data = mModel->DataProvider(); |
135 // MyDataProvider *prov = static_cast<MyDataProvider*>(data); //of course we have already poiter to that - mMyDataProvider, but it is example how to get it from model |
135 // MyDataProvider *prov = static_cast<MyDataProvider*>(data); //of course we have already poiter to that - mMyDataProvider, but it is example how to get it from model |
165 mModel->setSortRole(Qt::DisplayRole); |
165 mModel->setSortRole(Qt::DisplayRole); |
166 mModel->setSortCaseSensitivity(Qt::CaseInsensitive); |
166 mModel->setSortCaseSensitivity(Qt::CaseInsensitive); |
167 mModel->sort(0); |
167 mModel->sort(0); |
168 } else if (command == 201) { //disable filter |
168 } else if (command == 201) { //disable filter |
169 QRegExp reg = QRegExp(); |
169 QRegExp reg = QRegExp(); |
170 // mModel->setFilterRegExp(reg); |
170 mModel->setFilterRegExp(reg); |
171 } else if (command == 202) { //Filter ITEM* (Case Sensitive) |
171 } else if (command == 202) { //Filter ITEM* (Case Sensitive) |
172 QRegExp reg = QRegExp("ITEM*", Qt::CaseSensitive, QRegExp::Wildcard); |
172 QRegExp reg = QRegExp("ITEM*", Qt::CaseSensitive, QRegExp::Wildcard); |
173 // mModel->setFilterCaseSensitivity(Qt::CaseSensitive); |
173 mModel->setFilterCaseSensitivity(Qt::CaseSensitive); |
174 // mModel->setFilterRegExp(reg); |
174 mModel->setFilterRegExp(reg); |
175 } else if (command == 203) { //Filter ITEM1*(Case Insensitive) |
175 } else if (command == 203) { //Filter ITEM1*(Case Insensitive) |
176 QRegExp reg = QRegExp("ITEM1*", Qt::CaseInsensitive, QRegExp::Wildcard); |
176 QRegExp reg = QRegExp("ITEM1*", Qt::CaseInsensitive, QRegExp::Wildcard); |
177 // mModel->setFilterCaseSensitivity(Qt::CaseInsensitive); |
177 mModel->setFilterCaseSensitivity(Qt::CaseInsensitive); |
178 // mModel->setFilterRegExp(reg); |
178 mModel->setFilterRegExp(reg); |
179 } else if (command == 1000) { //reset |
179 } else if (command == 1000) { //reset |
180 mMyDataProvider->resetModel(); |
180 mMyDataProvider->resetModel(); |
181 } else if (command == 1001) { //reset |
181 } else if (command == 1001) { //reset |
182 bool current = !mModel->dynamicSortFilter(); |
182 bool current = !mModel->dynamicSortFilter(); |
183 mModel->setDynamicSortFilter(current); |
183 mModel->setDynamicSortFilter(current); |