X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_GeoreferencementDlg.cxx;h=35be05cd0187f33c40e768357d133f30320d7001;hb=a1431f03eac1d1aed4203d0568d987c41ce939b3;hp=7ef449c44beb4d223d1d6887e31fd6257e12deab;hpb=9488952cdf264de49e24970f8aae488ca06bbe9e;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_GeoreferencementDlg.cxx b/src/HYDROGUI/HYDROGUI_GeoreferencementDlg.cxx index 7ef449c4..35be05cd 100644 --- a/src/HYDROGUI/HYDROGUI_GeoreferencementDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_GeoreferencementDlg.cxx @@ -45,9 +45,11 @@ //! Profile data structre constructor HYDROGUI_GeoreferencementDlg::ProfileGeoData::ProfileGeoData( + const QString& theName, const QString& theXg, const QString& theYg, const QString& theXd, const QString& theYd) { + this->Name = theName; this->isEmpty = theXg.isEmpty() && theYg.isEmpty() && theXd.isEmpty() && theYd.isEmpty(); this->isIncomplete = !isEmpty; @@ -210,21 +212,20 @@ void HYDROGUI_GeoreferencementDlg::setMode( const int theMode ) myModeButtons->blockSignals( isBlocked ); } -void HYDROGUI_GeoreferencementDlg::setData( const ProfilesGeoDataMap& theMap ) +void HYDROGUI_GeoreferencementDlg::setData( const ProfilesGeoDataList& theData ) { disconnect( myTable->model(), SIGNAL( dataChanged ( const QModelIndex&, const QModelIndex& ) ), this, SLOT( onDataChanged() ) ); myTable->setRowCount( 0 ); - foreach ( const QString& aProfileName, theMap.keys() ) { + foreach ( const ProfileGeoData& aGeoData, theData ) { // Check the current profile name - if ( aProfileName.isEmpty() ) { + if ( aGeoData.Name.isEmpty() ) { continue; } // Get georeferencement data for the current profile - ProfileGeoData aGeoData = theMap.value( aProfileName ); QString aXg, anYg, aXd, anYd; if ( !aGeoData.isEmpty ) { aXg = HYDROGUI_Tool::GetCoordinateString( aGeoData.Xg ); @@ -238,11 +239,13 @@ void HYDROGUI_GeoreferencementDlg::setData( const ProfilesGeoDataMap& theMap ) myTable->insertRow( aRow ); // "Profile" column - QTableWidgetItem* aNameItem = new QTableWidgetItem( aProfileName ); - aNameItem->setFlags( Qt::ItemIsEnabled ); + QTableWidgetItem* aNameItem = new QTableWidgetItem( aGeoData.Name ); + aNameItem->setFlags( aNameItem->flags() & ~Qt::ItemIsEnabled ); + /* Bold font is not used in other tables. Keep the common style. QFont aFont = aNameItem->font(); aFont.setBold( true ); - aNameItem->setFont( aFont ); + aNameItem->setFont( aFont ); + */ myTable->setItem( aRow, 0, aNameItem ); // "Xg" column @@ -267,10 +270,10 @@ void HYDROGUI_GeoreferencementDlg::setData( const ProfilesGeoDataMap& theMap ) this, SLOT( onDataChanged() ) ); } -void HYDROGUI_GeoreferencementDlg::getData( ProfilesGeoDataMap& theMap ) +void HYDROGUI_GeoreferencementDlg::getData( ProfilesGeoDataList& theData ) const { - // Clear the map - theMap.clear(); + // Clear the list + theData.clear(); // Fill the map bool isOk = false; @@ -283,7 +286,7 @@ void HYDROGUI_GeoreferencementDlg::getData( ProfilesGeoDataMap& theMap ) aXd = myTable->item( aRow, 3 )->text(); anYd = myTable->item( aRow, 4 )->text(); - theMap.insert( aProfileName, ProfileGeoData( aXg, anYg, aXd, anYd ) ); + theData.append( ProfileGeoData( aProfileName, aXg, anYg, aXd, anYd ) ); } }