File tree 5 files changed +5
-20
lines changed
5 files changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ void QgsBookmarks::initialise()
87
87
{
88
88
QString name = QString::fromUtf8 ((const char *)sqlite3_column_text (ppStmt, 1 ));
89
89
// sqlite3_bind_parameter_index(ppStmt, "name"));
90
- QgsDebugMsg (" Bookmark name: " + name.toLocal8Bit ().data ());
90
+ // QgsDebugMsg("Bookmark name: " + name.toLocal8Bit().data());
91
91
Q3ListViewItem *lvi = new Q3ListViewItem (lstBookmarks, name);
92
92
// set the project name
93
93
lvi->setText (1 , QString::fromUtf8 ((const char *)sqlite3_column_text (ppStmt, 2 )));
Original file line number Diff line number Diff line change @@ -1265,9 +1265,6 @@ QDomNode QgsLegend::nextDomNode(const QDomNode& theNode)
1265
1265
1266
1266
void QgsLegend::insertItem (QTreeWidgetItem* move, QTreeWidgetItem* into)
1267
1267
{
1268
- #ifdef QGISDEBUG
1269
- qWarning (" entering QgsLegend::insertItem" );
1270
- #endif
1271
1268
QgsLegendItem* movedItem = dynamic_cast <QgsLegendItem*>(move);
1272
1269
QgsLegendItem* intoItem = dynamic_cast <QgsLegendItem*>(into);
1273
1270
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ class QgsLegend : public QTreeWidget
162
162
the given QgsLegendLayerFile */
163
163
void setName (QgsLegendLayerFile* w, QString layerName);
164
164
165
+ void updateCheckStates (QTreeWidgetItem* item, Qt::CheckState state) {mStateOfCheckBoxes [item] = state;}
165
166
166
167
public slots:
167
168
Original file line number Diff line number Diff line change 19
19
***************************************************************************/
20
20
21
21
#include " qgsapplication.h"
22
+ #include " qgslegend.h"
22
23
#include " qgslegendlayer.h"
23
24
#include " qgslegendlayerfile.h"
24
25
#include " qgslegendlayerfilegroup.h"
@@ -230,6 +231,8 @@ void QgsLegendLayer::updateCheckState()
230
231
{
231
232
treeWidget ()->blockSignals (true );
232
233
setCheckState (0 , theState);
234
+ // notify the legend that the check state has changed
235
+ legend ()->updateCheckStates (this , theState);
233
236
treeWidget ()->blockSignals (false );
234
237
}
235
238
}
Original file line number Diff line number Diff line change @@ -73,23 +73,13 @@ QgsLegendItem::DRAG_ACTION QgsLegendLayerFileGroup::accept(const QgsLegendItem*
73
73
74
74
bool QgsLegendLayerFileGroup::insert (QgsLegendItem* newItem)
75
75
{
76
- #ifdef QGISDEBUG
77
- qWarning (" In QgsLegendLayerFileGroup::insert" );
78
- #endif
79
76
if ( newItem->type () == LEGEND_LAYER_FILE )
80
77
{
81
78
QgsLegendItem* oldItem = firstChild ();
82
- // QgsLegendLayer* parentLegendLayer = dynamic_cast<QgsLegendLayer*>(parent());
83
79
84
80
if (!oldItem)// this item is the first child
85
81
{
86
82
insertChild (0 , newItem);
87
- // update the icon and the check state of the new and the former legend layer
88
- // if(parentLegendLayer)
89
- // {
90
- // parentLegendLayer->updateIcon();
91
- // parentLegendLayer->updateCheckState();
92
- // }
93
83
return true ;
94
84
}
95
85
// there are already legend layer files
@@ -114,12 +104,6 @@ bool QgsLegendLayerFileGroup::insert(QgsLegendItem* newItem)
114
104
if (newLayer->isSymbologyCompatible (*thelayer))
115
105
{
116
106
insertChild (childCount (), newItem);
117
- // update the icon and the check state of the new and the former legend layer
118
- // if(parentLegendLayer)
119
- // {
120
- // parentLegendLayer->updateIcon();
121
- // parentLegendLayer->updateCheckState();
122
- // }
123
107
return true ;
124
108
}
125
109
else
You can’t perform that action at this time.
0 commit comments