[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Akarsh Simha <akarshsimha () gmail ! com>
Date:       2011-01-01 4:27:39
Message-ID: 20110101042739.2E364AC8BC () svn ! kde ! org
[Download RAW message or body]

SVN commit 1210559 by asimha:

Not very clean work-around for the InfoBox problem.

Make the Infoboxes subordinate to the widget that does the actual
drawing, and not the QGraphicsView. This is what was, in principle
being done before -- the SkyMap widget had these widgets as
children. But this is not neat, IMO.

Probably, the right way to do this would be to make the InfoBoxes a
child of the QGraphicsView. But then, there are problems with
capturing mouse events.

 M  +17 -8     skymap.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #1210558:1210559
@@ -223,14 +223,6 @@
     connect(this,     SIGNAL( positionChanged( SkyPoint*) ),
             m_objBox, SLOT(   slotPointChanged(SkyPoint*) ) );
 
-
-    m_iboxes = new InfoBoxes(this);
-    m_iboxes->setVisible( Options::showInfoBoxes() );
-    m_iboxes->setMouseTracking( true ); // Required to generate mouse move events
-    m_iboxes->addInfoBox(m_timeBox);
-    m_iboxes->addInfoBox(m_geoBox);
-    m_iboxes->addInfoBox(m_objBox);
-
 #ifdef HAVE_OPENGL
 
     Q_ASSERT( TextureManager::getContext() ); // Should not fail, because TextureManager should be \
already created. @@ -254,6 +246,23 @@
     m_SkyMapDraw->setParent( this->viewport() );
     m_SkyMapDraw->show();
 
+    /*
+    m_Scene = new QGraphicsScene( rect() );
+    setScene( m_Scene );
+    */
+    m_iboxes = new InfoBoxes( m_SkyMapDraw );
+    m_iboxes->setVisible( Options::showInfoBoxes() );
+    m_iboxes->setMouseTracking( false ); // DEBUG: Changed this to false. Why should we generate mouse \
move events, actually? +    m_iboxes->setAutoFillBackground( false );
+    m_iboxes->setBackgroundRole( QPalette::NoRole );
+    m_iboxes->addInfoBox(m_timeBox);
+    m_iboxes->addInfoBox(m_geoBox);
+    m_iboxes->addInfoBox(m_objBox);
+    /*
+    ( m_Scene->addWidget( m_iboxes ) )->setAcceptedMouseButtons( Qt::NoButton );
+    */
+
+
     //The update timer will be destructed when SkyMap is..
     QTimer *update = new QTimer(this);
     update->setInterval(30);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic