mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 17:10:04 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			358 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			358 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <QComboBox>
 | |
| #include <QWheelEvent>
 | |
| 
 | |
| class QFocusedComboBox : public QComboBox
 | |
| {
 | |
|    Q_OBJECT
 | |
| 
 | |
| public:
 | |
|    using QComboBox::QComboBox;
 | |
| 
 | |
| protected:
 | |
|    void wheelEvent(QWheelEvent* event) override
 | |
|    {
 | |
|       if (hasFocus())
 | |
|       {
 | |
|          QComboBox::wheelEvent(event);
 | |
|       }
 | |
|       else
 | |
|       {
 | |
|          event->ignore();
 | |
|       }
 | |
|    }
 | |
| };
 | 
