X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshersGUI%2FStdMeshersGUI_RadioButtonsGrpWdg.cxx;h=10abd45b028ba8aca908787b481322a7602aa273;hb=ac78dadbe5c45faeb606eab55bd9e9024aa6460a;hp=1d939f28bcde2ded62e7e5990fa89a6087c81a93;hpb=b0a908c0d20341651771d0249fb10882f54b2aad;p=modules%2Fsmesh.git diff --git a/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx index 1d939f28b..10abd45b0 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_RadioButtonsGrpWdg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -18,7 +18,12 @@ // #include "StdMeshersGUI_RadioButtonsGrpWdg.h" -#include +#include "SMESHGUI.h" + +#include + +#include +#include #include #include #include @@ -40,21 +45,32 @@ StdMeshersGUI_RadioButtonsGrpWdg::StdMeshersGUI_RadioButtonsGrpWdg( const QStrin //================================================================================ /*! - * \brief Creates a given nubmer of button labels with given labels (QString's) + * \brief Creates a given number of button labels with given labels (QString's) */ //================================================================================ -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 ); + } + } } }