mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 14:20:04 +00:00 
			
		
		
		
	Add KeybindEdit widget
This commit is contained in:
		
							parent
							
								
									2bf15f8a69
								
							
						
					
					
						commit
						22e3101c22
					
				
					 3 changed files with 180 additions and 0 deletions
				
			
		
							
								
								
									
										41
									
								
								scwx-qt/source/scwx/qt/ui/keybind_edit.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								scwx-qt/source/scwx/qt/ui/keybind_edit.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,41 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <QLineEdit> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace ui | ||||
| { | ||||
| 
 | ||||
| class KeybindEdit : public QLineEdit | ||||
| { | ||||
|    Q_OBJECT | ||||
|    Q_DISABLE_COPY_MOVE(KeybindEdit) | ||||
| 
 | ||||
| public: | ||||
|    explicit KeybindEdit(QWidget* parent = nullptr); | ||||
|    ~KeybindEdit(); | ||||
| 
 | ||||
|    QKeySequence key_sequence() const; | ||||
| 
 | ||||
|    void set_key_sequence(const QKeySequence& sequence); | ||||
| 
 | ||||
| protected: | ||||
|    void focusInEvent(QFocusEvent* e) override; | ||||
|    void focusOutEvent(QFocusEvent* e) override; | ||||
|    void keyPressEvent(QKeyEvent* e) override; | ||||
|    void keyReleaseEvent(QKeyEvent* e) override; | ||||
| 
 | ||||
| signals: | ||||
|    void KeySequenceChanged(const QKeySequence& sequence); | ||||
| 
 | ||||
| private: | ||||
|    class Impl; | ||||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace ui
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat