https://issues.qgis.org/https://issues.qgis.org/favicon.ico2013-08-15T17:20:36ZQGIS Issue TrackingQGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=440902013-08-15T17:20:36ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/download/6163/12.png">12.png</a> added</li><li><strong>File</strong> <a href="/attachments/download/6164/22.png">22.png</a> added</li><li><strong>File</strong> <a href="/attachments/download/6165/11.png">11.png</a> added</li></ul><p>I see another issue, this time only on Linux. See Attached screenshots.</p>
<p>On Windows if in the composer legend there is vector with "single symbol" symbology, then the (one) symbology class has no text associated, but this can be edited.</p>
<p>On Linux in the same situation, the (one) symbology class is given the layer name by default, and this cannot be edited.</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441012013-08-16T00:48:31ZSalvatore Larosalrssvtml@gmail.com
<ul></ul><p>I am not fairly sure but this patch has worked for me (please anyone who knows better the composer code might reviews it ?):</p>
<pre>
diff --git a/src/app/composer/qgscomposerlegendwidget.cpp b/src/app/composer/qgscomposerlegendwidget.cpp
index 613d394..5032ab7 100644
--- a/src/app/composer/qgscomposerlegendwidget.cpp
+++ b/src/app/composer/qgscomposerlegendwidget.cpp
@@ -740,8 +740,8 @@ void QgsComposerLegendWidget::on_mEditPushButton_clicked()
QgsComposerLegendItemDialog itemDialog( currentItem );
if ( itemDialog.exec() == QDialog::Accepted )
{
- currentItem->setUserText( itemDialog.itemText() );
- mLegend->model()->updateItemText( currentItem );
+ currentItem->setText( itemDialog.itemText() );
+ //mLegend->model()->updateItemText( currentItem );
}
mLegend->beginCommand( tr( "Legend item edited" ) );
</pre> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441032013-08-16T00:49:28ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Pull Request or Patch supplied</strong> changed from <i>No</i> to <i>Yes</i></li></ul> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441422013-08-18T12:32:05ZAnita Graseranitagraser@gmx.at
<ul><li><strong>Subject</strong> changed from <i>Cannot rename raster layers in composer legend</i> to <i>Cannot rename (raster) layers in composer legend</i></li></ul><p>For me, this issue is not limited to raster layers. (Using today's OSGeo4W nightly - code rev 4408a8b.)</p>
<p>In a project with only one polygon layer, I can only rename the upper level item in the print composer legend - but not the sub-level item.</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441492013-08-19T01:39:11ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Subject</strong> changed from <i>Cannot rename (raster) layers in composer legend</i> to <i>Cannot rename layers in composer legend</i></li></ul> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441532013-08-19T04:23:36ZRené-Luc ReLucrldhont@3liz.com
<ul><li><strong>Assignee</strong> set to <i>René-Luc ReLuc</i></li></ul><p>Thanks Salvatore for your patch, but it changes the way to manage text for all the layers and not only for raster layers.</p>
<p>I proposed this patch :<br /><pre>
index 29b86f5..d958676 100644
--- a/src/core/composer/qgslegendmodel.cpp
+++ b/src/core/composer/qgslegendmodel.cpp
@@ -380,10 +380,9 @@ void QgsLegendModel::updateLayer( QStandardItem* layerItem )
QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( lItem->layerID() );
if ( mapLayer )
{
- QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( mapLayer );
-
updateLayerItemText( lItem );
+ QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( mapLayer );
if ( vLayer )
{
addVectorLayerItemsV2( lItem, vLayer );
@@ -406,11 +405,9 @@ void QgsLegendModel::updateLayerItemText( QStandardItem* layerItem )
QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( lItem->layerID() );
if ( !mapLayer ) return;
- QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( mapLayer );
- if ( !vLayer ) return;
-
QString label = lItem->userText().isEmpty() ? mapLayer->name() : lItem->userText();
+ QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( mapLayer );
if ( vLayer && lItem->showFeatureCount() )
{
label += QString( " [%1]" ).arg( vLayer->featureCount() );
</pre></p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441562013-08-19T08:44:22ZSalvatore Larosalrssvtml@gmail.com
<ul></ul><p>Hi René, sadly I am not a C++ expert :-( so my patch might not be correct.</p>
<p>Anyway, I did try your patch but renaming sub-level has not worked for me, I see the same issue as Anita.<br />For raster layers works fine!</p>
<p>Thanks.</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441652013-08-20T03:22:30ZRené-Luc ReLucrldhont@3liz.com
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>90</i></li></ul><p>I have completed my patch and I proposed it through this pull request<br /><a class="external" href="https://github.com/qgis/Quantum-GIS/pull/824">https://github.com/qgis/Quantum-GIS/pull/824</a></p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=441922013-08-22T00:29:12ZRené-Luc ReLucrldhont@3liz.com
<ul><li><strong>Assignee</strong> changed from <i>René-Luc ReLuc</i> to <i>Radim Blazek</i></li></ul><p>Hi Radim,</p>
<p>I assigne this issue to you for reviewing my patch.<br />Marco wrote that you did a lot of work on composer legend.</p>
<p>Regards,</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=442002013-08-22T04:15:46ZRadim Blazekradim.blazek@gmail.com
<ul></ul><p>I am offline until September 3, please ask someone else to apply the patch.</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=442012013-08-22T04:18:45ZMarco Hugentoblermarco.hugentobler@sourcepole.ch
<ul><li><strong>Assignee</strong> changed from <i>Radim Blazek</i> to <i>Marco Hugentobler</i></li></ul><p>Ok, in that case the ticket is assigned to me.</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=442022013-08-22T07:01:58ZMarco Hugentoblermarco.hugentobler@sourcepole.ch
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>The changes are fine and the patch is applied in master branch. Thanks rldhont for fixing this issue!</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=444432013-09-03T02:05:36ZLene Fischerlfi@ign.ku.dk
<ul></ul><p>I have just downloaded weekly (03-09-13) Still the same problem. Is the correction not in the weekly yet?<br />Regards<br />Lene Fischer</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=444452013-09-03T02:27:31ZGiovanni Manghigiovanni.manghi@gmail.com
<ul></ul><p>Lene Fischer wrote:</p>
<blockquote>
<p>I have just downloaded weekly (03-09-13) Still the same problem. Is the correction not in the weekly yet?<br />Regards<br />Lene Fischer</p>
</blockquote>
<p>it works fine here on Linux.</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=444482013-09-03T02:40:45ZSalvatore Larosalrssvtml@gmail.com
<ul></ul><p>Hi Lene,</p>
<p>Which is the revision code ?<br />The fix has been introduced in <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/7f8b259209811645c791d2281fa34c440af2d747" title="Merge pull request #824 from rldhont/8473 FIX BUG #8473 Cannot rename layers in composer legend">7f8b259</a>, so I think the last weekly should include that fix.</p> QGIS Application - Bug report #8473: Cannot rename layers in composer legendhttps://issues.qgis.org/issues/8473?journal_id=444542013-09-03T03:07:37ZRené-Luc ReLucrldhont@3liz.com
<ul></ul><p>I've tested a today compliation on Ubuntu, qgis is named fef175b, and it works.</p>