mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 08:10:06 +00:00 
			
		
		
		
	Refactor Qt types to avoid namespace conflict
This commit is contained in:
		
							parent
							
								
									78f57698f6
								
							
						
					
					
						commit
						e98bca9d5d
					
				
					 6 changed files with 12 additions and 13 deletions
				
			
		|  | @ -9,6 +9,7 @@ | |||
| #include <scwx/qt/map/map_widget.hpp> | ||||
| #include <scwx/qt/model/alert_model.hpp> | ||||
| #include <scwx/qt/model/radar_product_model.hpp> | ||||
| #include <scwx/qt/types/qt_types.hpp> | ||||
| #include <scwx/qt/ui/flow_layout.hpp> | ||||
| #include <scwx/qt/ui/level2_products_widget.hpp> | ||||
| #include <scwx/qt/ui/level2_settings_widget.hpp> | ||||
|  | @ -80,7 +81,7 @@ public: | |||
|       settings_.setCacheDatabaseMaximumSize(20 * 1024 * 1024); | ||||
| 
 | ||||
|       alertProxyModel_->setSourceModel(alertModel_.get()); | ||||
|       alertProxyModel_->setSortRole(Qt::UserRole); // TODO
 | ||||
|       alertProxyModel_->setSortRole(types::SortRole); | ||||
|       alertProxyModel_->setFilterCaseSensitivity(Qt::CaseInsensitive); | ||||
|       alertProxyModel_->setFilterKeyColumn(-1); | ||||
|    } | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| #include <scwx/qt/model/alert_model.hpp> | ||||
| #include <scwx/qt/common/types.hpp> | ||||
| #include <scwx/qt/types/qt_types.hpp> | ||||
| #include <scwx/common/geographic.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
|  | @ -68,7 +68,7 @@ QVariant AlertModel::data(const QModelIndex& index, int role) const | |||
| { | ||||
|    if (index.isValid() && index.row() >= 0 && | ||||
|        index.row() < p->textEventKeys_.size() && | ||||
|        (role == Qt::DisplayRole || role == common::SortRole)) | ||||
|        (role == Qt::DisplayRole || role == types::SortRole)) | ||||
|    { | ||||
|       const auto& textEventKey = p->textEventKeys_.at(index.row()); | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #include <scwx/qt/model/radar_site_model.hpp> | ||||
| #include <scwx/qt/common/types.hpp> | ||||
| #include <scwx/qt/config/radar_site.hpp> | ||||
| #include <scwx/qt/types/qt_types.hpp> | ||||
| #include <scwx/common/geographic.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
|  | @ -63,7 +63,7 @@ QVariant RadarSiteModel::data(const QModelIndex& index, int role) const | |||
| { | ||||
|    if (index.isValid() && index.row() >= 0 && | ||||
|        index.row() < p->radarSites_.size() && | ||||
|        (role == Qt::DisplayRole || role == common::SortRole)) | ||||
|        (role == Qt::DisplayRole || role == types::SortRole)) | ||||
|    { | ||||
|       const auto& site = p->radarSites_.at(index.row()); | ||||
| 
 | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ namespace scwx | |||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace common | ||||
| namespace types | ||||
| { | ||||
| 
 | ||||
| enum ItemDataRole | ||||
|  | @ -14,6 +14,6 @@ enum ItemDataRole | |||
|    SortRole = Qt::UserRole | ||||
| }; | ||||
| 
 | ||||
| } // namespace common
 | ||||
| } // namespace types
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
|  | @ -1,8 +1,8 @@ | |||
| #include "radar_site_dialog.hpp" | ||||
| #include "./ui_radar_site_dialog.h" | ||||
| 
 | ||||
| #include <scwx/qt/common/types.hpp> | ||||
| #include <scwx/qt/model/radar_site_model.hpp> | ||||
| #include <scwx/qt/types/qt_types.hpp> | ||||
| #include <scwx/common/geographic.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
|  | @ -31,7 +31,7 @@ public: | |||
|        selectedRadarSite_ {"?"} | ||||
|    { | ||||
|       proxyModel_->setSourceModel(radarSiteModel_); | ||||
|       proxyModel_->setSortRole(common::SortRole); | ||||
|       proxyModel_->setSortRole(types::SortRole); | ||||
|       proxyModel_->setFilterCaseSensitivity(Qt::CaseInsensitive); | ||||
|       proxyModel_->setFilterKeyColumn(-1); | ||||
|    } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat