Force sRGB color space for windows on macOS.
This commit is contained in:
		
							parent
							
								
									aaa88be9d7
								
							
						
					
					
						commit
						3542f5e913
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -12,6 +12,7 @@
 | 
			
		|||
 | 
			
		||||
#include <QtGui/QWindow>
 | 
			
		||||
#include <QtGui/QtEvents>
 | 
			
		||||
#include <QtGui/QColorSpace>
 | 
			
		||||
#include <private/qwidget_p.h>
 | 
			
		||||
 | 
			
		||||
class TWidgetPrivate : public QWidgetPrivate {
 | 
			
		||||
| 
						 | 
				
			
			@ -47,6 +48,9 @@ TWidget::TWidget(QWidget *parent)
 | 
			
		|||
	[[maybe_unused]] static const auto Once = [] {
 | 
			
		||||
		auto format = QSurfaceFormat::defaultFormat();
 | 
			
		||||
		format.setSwapInterval(0);
 | 
			
		||||
		if (Platform::IsMac()) {
 | 
			
		||||
			format.setColorSpace(QColorSpace::SRgb);
 | 
			
		||||
		}
 | 
			
		||||
		QSurfaceFormat::setDefaultFormat(format);
 | 
			
		||||
		return true;
 | 
			
		||||
	}();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue