X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshersGUI%2FStdMeshersGUI_RadioButtonsGrpWdg.cxx;h=4c694d8222e5e96270a09a70df78c6270e0bbf23;hb=eb75a450cceabb83064e079ca4f907bde33b38de;hp=cca80aa17dc8febde0f83562447571f5e849342c;hpb=62c442d05faf338dd2a7c14a6c175a588735bbe4;p=modules%2Fsmesh.git diff --git a/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx index cca80aa17..4c694d822 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,7 +18,12 @@ // #include "StdMeshersGUI_RadioButtonsGrpWdg.h" -#include +#include "SMESHGUI.h" + +#include + +#include +#include #include #include #include @@ -44,17 +49,28 @@ StdMeshersGUI_RadioButtonsGrpWdg::StdMeshersGUI_RadioButtonsGrpWdg( const QStrin */ //================================================================================ -void StdMeshersGUI_RadioButtonsGrpWdg::setButtonLabels( const QStringList& buttonLabels ) +void StdMeshersGUI_RadioButtonsGrpWdg::setButtonLabels( const QStringList& buttonLabels, + const QStringList& buttonIcons ) { - QVBoxLayout* layout = new QVBoxLayout( this ); + QGridLayout* layout = new QGridLayout( this ); layout->setSpacing(SPACING); layout->setMargin(MARGIN); for ( int id = 0; id < buttonLabels.size(); ++id ) { QRadioButton* button = new QRadioButton( buttonLabels.at(id), this ); - layout->addWidget( button ); + layout->addWidget( button, id, 0 ); myButtonGrp->addButton( button, id ); + + if ( id < buttonIcons.count() ) + { + QPixmap pmi (SMESHGUI::resourceMgr()->loadPixmap("SMESH", buttonIcons.at(id))); + if ( !pmi.isNull() ) { + QLabel* pixLabel = new QLabel( this ); + pixLabel->setPixmap( pmi ); + layout->addWidget( pixLabel, id, 1 ); + } + } } }