- HYDROData_SequenceOfObjects aRefObjects;
- QStringList aRefNames;
- GetObjectReferences( anImage, aRefObjects, aRefNames );
- if( aRefNames.contains( aName ) )
- {
- theBackRefObjects.Append( anImage );
- theBackRefNames.append( anImage->GetName() );
- }
- }
- }
-}
-
-
-QDockWidget* HYDROGUI_Tool::WindowDock( QWidget* wid )
-{
- if ( !wid )
- return 0;
-
- QDockWidget* dock = 0;
- QWidget* w = wid->parentWidget();
- while ( w && !dock )
- {
- dock = ::qobject_cast<QDockWidget*>( w );
- w = w->parentWidget();
- }
- return dock;
-}
-
-QColor HYDROGUI_Tool::GenerateFillingColor( HYDROGUI_Module* theModule,
- const QStringList& theZoneNames )
-{
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
- return GenerateFillingColor( aDocument, theZoneNames );
-}
+ Image_PixMap::ImgFormat aFormat;
+ if ( anImage.hasAlphaChannel() )
+ {
+ if ( anImage.format() != QImage::Format_ARGB32 )
+ anImage = anImage.convertToFormat( QImage::Format_ARGB32 );
+ aFormat = Image_PixMap::ImgRGBA;
+ }
+ else
+ {
+ if ( anImage.format() != QImage::Format_RGB888 )
+ anImage = anImage.convertToFormat( QImage::Format_RGB888 );
+ aFormat = Image_PixMap::ImgRGB;
+ }