mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:30:05 +00:00 
			
		
		
		
	Initial alert model
This commit is contained in:
		
							parent
							
								
									5cf9746e97
								
							
						
					
					
						commit
						9afba385ea
					
				
					 3 changed files with 286 additions and 2 deletions
				
			
		
							
								
								
									
										45
									
								
								scwx-qt/source/scwx/qt/model/alert_model.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								scwx-qt/source/scwx/qt/model/alert_model.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,45 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/types/text_event_key.hpp> | ||||
| 
 | ||||
| #include <memory> | ||||
| 
 | ||||
| #include <QAbstractTableModel> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace model | ||||
| { | ||||
| 
 | ||||
| class AlertModelImpl; | ||||
| 
 | ||||
| class AlertModel : public QAbstractTableModel | ||||
| { | ||||
| public: | ||||
|    explicit AlertModel(QObject* parent = nullptr); | ||||
|    ~AlertModel(); | ||||
| 
 | ||||
|    int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||||
|    int columnCount(const QModelIndex& parent = QModelIndex()) const override; | ||||
| 
 | ||||
|    QVariant data(const QModelIndex& index, | ||||
|                  int                role = Qt::DisplayRole) const override; | ||||
|    QVariant headerData(int             section, | ||||
|                        Qt::Orientation orientation, | ||||
|                        int             role = Qt::DisplayRole) const override; | ||||
| 
 | ||||
| public slots: | ||||
|    void HandleAlert(const types::TextEventKey& alertKey); | ||||
|    void HandleMapUpdate(double latitude, double longitude); | ||||
| 
 | ||||
| private: | ||||
|    std::unique_ptr<AlertModelImpl> p; | ||||
| 
 | ||||
|    friend class AlertModelImpl; | ||||
| }; | ||||
| 
 | ||||
| } // namespace model
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat