OSDN Git Service

add timer
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Tue, 1 Jul 2003 15:13:32 +0000 (15:13 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Tue, 1 Jul 2003 15:13:32 +0000 (15:13 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@386 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/part/kitathreadview.cpp
kita/src/part/kitathreadview.h

index 3ba5861..4925018 100644 (file)
@@ -67,6 +67,7 @@ KitaThreadView::KitaThreadView(QWidget *parent, const char *name)
 //    , m_currentJob( 0 )
     , m_labelMaxLength( 60 )
     , m_popup( 0 )
+    , m_popupTimer( 0 )
 {
   m_threadPart = new KitaHTMLPart(threadFrame);
   QHBoxLayout* aLayout = new QHBoxLayout(threadFrame);
@@ -385,24 +386,42 @@ void KitaThreadView::slotOnURL(const QString& url)
 
 #if 0
   // BUG: view¤«¤é¥Þ¥¦¥¹¥«¡¼¥½¥ë¤¬³°¤ì¤¿»þ¤ÎÂнè¤ò¤·¤Æ¤¤¤Ê¤¤
+  // ¤È¤ê¤¢¤¨¤ºTimer¤Ç¤´¤Þ¤«¤·¤¿¤±¤É¡¢ËÜÅö¤ÏKHTMLView¤Î¥µ¥Ö¥¯¥é¥¹¤ò¤Ä¤¯¤Ã¤Æ¡¢
+  // leaveEvent()¤ò¼ÂÁõ¤¹¤ëɬÍפ¬¤¢¤ë(¤¿¤Ö¤ó)
   if ( ! url.isEmpty() ) {
     KHTMLView* view = m_threadPart->view();
 
     if( ! m_popup ) {
       m_popup = new QLabel( view, "res_popup", WStyle_Customize | WStyle_NoBorder | WStyle_Tool );
     }
+    if( ! m_popupTimer ) {
+      m_popupTimer = new QTimer( m_popup );
+      connect( m_popupTimer, SIGNAL( timeout() ), this, SLOT( popupTimeout() ) );
+    }
+
     m_popup->setText( url );
 
     m_popup->move( view->mapFromGlobal( QCursor::pos() ) );
     m_popup->adjustSize();
 
     m_popup->show();
+
+    m_popupTimer->start( 10000, TRUE );
   } else {
     m_popup->hide();
   }
 #endif
 }
 
+void KitaThreadView::popupTimeout()
+{
+  qDebug("foo");
+  if( m_popup ) {
+    m_popup->hide();
+  }
+  qDebug("bar");
+}
+
 void KitaThreadView::slotPopupMenu( KXMLGUIClient *client, const QPoint &global, const KURL &url, const QString &mimeType, mode_t mode)
 {
   KActionCollection * collection = client->actionCollection();
index 0954db6..e88de75 100644 (file)
@@ -72,6 +72,7 @@ private: // Private attributes
   int m_labelMaxLength;
   Kita::PostInfo m_postInfo;
   QLabel* m_popup;
+  QTimer* m_popupTimer;
 
   void insertSearchCombo();
   KURL filterReadCGI( const KURL& );
@@ -91,6 +92,7 @@ private slots:
   void slotBookmarkButtonClicked( bool on );
   void slotWriteButtonClicked();
   void slotShowErrorDialog( const QString& input, const KURL& urlOfInput = 0 );
+  void popupTimeout();
 
 signals:
   void showThreadCompleted( const KURL& threadUrl );