Skip to content

Commit

Permalink
Hide color picker tab in color dialog for OSX builds.
Browse files Browse the repository at this point in the history
Qt on OSX does not support the required QWidget::grabMouse method.
Instead of showing a broken tab, just hide it under this platform.
Revisit when we switch to Qt5 builds to see if there's a solution to
this.
  • Loading branch information
nyalldawson committed Oct 20, 2014
1 parent efa4f97 commit c496fc7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/qgscolordialog.cpp
Expand Up @@ -235,6 +235,13 @@ QgsColorDialogV2::QgsColorDialogV2( QWidget *parent, Qt::WindowFlags fl, const Q
int currentTab = settings.value( "/Windows/ColorDialog/activeTab", 0 ).toInt(); int currentTab = settings.value( "/Windows/ColorDialog/activeTab", 0 ).toInt();
mTabWidget->setCurrentIndex( currentTab ); mTabWidget->setCurrentIndex( currentTab );


#ifdef Q_WS_MAC
//disable color picker tab for OSX, as it is impossible to grab the mouse under OSX
//see note for QWidget::grabMouse() re OSX Cocoa
//http://qt-project.org/doc/qt-4.8/qwidget.html#grabMouse
mTabWidget->removeTab( 3 );
#endif

//setup connections //setup connections
connect( mColorBox, SIGNAL( colorChanged( QColor ) ), this, SLOT( setColor( QColor ) ) ); connect( mColorBox, SIGNAL( colorChanged( QColor ) ), this, SLOT( setColor( QColor ) ) );
connect( mColorWheel, SIGNAL( colorChanged( QColor ) ), this, SLOT( setColor( QColor ) ) ); connect( mColorWheel, SIGNAL( colorChanged( QColor ) ), this, SLOT( setColor( QColor ) ) );
Expand Down

0 comments on commit c496fc7

Please sign in to comment.