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