Skip to content
Permalink
Browse files

[GRASS] show module name in tab if icon is missing

  • Loading branch information
blazek committed Feb 7, 2016
1 parent 8e48e97 commit 92e5f679788ffeca9d8e7425487402c72135544f
Showing with 15 additions and 8 deletions.
  1. +15 −8 src/plugins/grass/qgsgrasstools.cpp
@@ -318,17 +318,24 @@ void QgsGrassTools::runModule( QString name, bool direct )
QString path = QgsGrass::modulesConfigDirPath() + "/" + name;
QPixmap pixmap = QgsGrassModule::pixmap( path, height );

// Icon size in QT4 does not seem to be variable
// -> reset the width to max icon width
if ( mTabWidget->iconSize().width() < pixmap.width() )
if ( !pixmap.isNull() )
{
mTabWidget->setIconSize( QSize( pixmap.width(), mTabWidget->iconSize().height() ) );
}
// Icon size in QT4 does not seem to be variable
// -> reset the width to max icon width
if ( mTabWidget->iconSize().width() < pixmap.width() )
{
mTabWidget->setIconSize( QSize( pixmap.width(), mTabWidget->iconSize().height() ) );
}


QIcon is;
is.addPixmap( pixmap );
mTabWidget->addTab( m, is, "" );
QIcon is;
is.addPixmap( pixmap );
mTabWidget->addTab( m, is, "" );
}
else
{
mTabWidget->addTab( m, name );
}


mTabWidget->setCurrentIndex( mTabWidget->count() - 1 );

0 comments on commit 92e5f67

Please sign in to comment.
You can’t perform that action at this time.