mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-11-04 02:30:06 +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();
 | 
						|
      }
 | 
						|
   }
 | 
						|
};
 |