Skip to content

Commit ff4a1e2

Browse files
author
wonder
committed
Removed keyPressed() slot from QgsMapLayer and removed connections made in QgisApp.
(it doesn't make much sense to have it there) git-svn-id: http://svn.osgeo.org/qgis/trunk@6665 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f6eca1e commit ff4a1e2

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

src/app/qgisapp.cpp

-51
Original file line numberDiff line numberDiff line change
@@ -1872,15 +1872,6 @@ bool QgisApp::addLayer(QFileInfo const & vectorFile)
18721872
// Register this layer with the layers registry
18731873
QgsMapLayerRegistry::instance()->addMapLayer(layer);
18741874

1875-
// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
1876-
#ifdef QGISDEBUG
1877-
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
1878-
#endif
1879-
QObject::connect(this,
1880-
SIGNAL(keyPressed(QKeyEvent *)),
1881-
layer,
1882-
SLOT(keyPressed(QKeyEvent* )));
1883-
18841875
}
18851876
else
18861877
{
@@ -1963,14 +1954,6 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
19631954
// Register this layer with the layers registry
19641955
QgsMapLayerRegistry::instance()->addMapLayer(layer);
19651956

1966-
// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
1967-
#ifdef QGISDEBUG
1968-
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
1969-
#endif
1970-
QObject::connect(this,
1971-
SIGNAL(keyPressed(QKeyEvent *)),
1972-
layer,
1973-
SLOT(keyPressed(QKeyEvent* )));
19741957
}
19751958
else
19761959
{
@@ -2062,14 +2045,6 @@ void QgisApp::addDatabaseLayer()
20622045
// register this layer with the central layers registry
20632046
QgsMapLayerRegistry::instance()->addMapLayer(layer);
20642047

2065-
// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
2066-
#ifdef QGISDEBUG
2067-
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
2068-
#endif
2069-
QObject::connect(this,
2070-
SIGNAL(keyPressed(QKeyEvent *)),
2071-
layer,
2072-
SLOT(keyPressed(QKeyEvent* )));
20732048
}
20742049
else
20752050
{
@@ -4275,15 +4250,6 @@ void QgisApp::addVectorLayer(QString vectorLayerPath, QString baseName, QString
42754250
// Register this layer with the layers registry
42764251
QgsMapLayerRegistry::instance()->addMapLayer(layer);
42774252

4278-
// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
4279-
#ifdef QGISDEBUG
4280-
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
4281-
#endif
4282-
QObject::connect(this,
4283-
SIGNAL(keyPressed(QKeyEvent * )),
4284-
layer,
4285-
SLOT(keyPressed(QKeyEvent* )));
4286-
42874253
QgsProject::instance()->dirty(false); // XXX this might be redundant
42884254

42894255
statusBar()->message(mMapCanvas->extent().stringRep(2));
@@ -4947,14 +4913,6 @@ bool QgisApp::addRasterLayer(QgsRasterLayer * theRasterLayer, bool theForceRedra
49474913
SIGNAL(setStatus(QString)),
49484914
this,
49494915
SLOT(showStatusMessage(QString)));
4950-
// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
4951-
#ifdef QGISDEBUG
4952-
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
4953-
#endif
4954-
QObject::connect(this ,
4955-
SIGNAL(keyPressed(QKeyEvent * )),
4956-
theRasterLayer,
4957-
SLOT(keyPressed(QKeyEvent* )));
49584916

49594917
// add it to the mapcanvas collection
49604918
// no longer necessary since adding to registry automatically adds to canvas
@@ -5099,15 +5057,6 @@ void QgisApp::addRasterLayer(QString const & rasterLayerPath,
50995057
this,
51005058
SLOT(showStatusMessage(QString)));
51015059

5102-
// connect up any keypresses to be passed tot he layer (e.g. so esc can stop rendering)
5103-
#ifdef QGISDEBUG
5104-
std::cout << " Connecting up maplayers keyPressed event to the QgisApp keyPress signal" << std::endl;
5105-
#endif
5106-
QObject::connect(this,
5107-
SIGNAL(keyPressed(QKeyEvent * )),
5108-
layer,
5109-
SLOT(keyPressed(QKeyEvent* )));
5110-
51115060
QgsProject::instance()->dirty(false); // XXX this might be redundant
51125061

51135062
statusBar()->message(mMapCanvas->extent().stringRep(2));

src/core/qgsmaplayer.h

-3
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@ public slots:
222222
void setScaleBasedVisibility( bool theVisibilityFlag);
223223
bool scaleBasedVisibility();
224224

225-
/** Layer can be informed when a key is pressed. */
226-
virtual void keyPressed (QKeyEvent *e) {};
227-
228225
signals:
229226

230227
/** Emit a signal to notify of a progress event */

0 commit comments

Comments
 (0)