Commit 96f7628c868876f837df7501c67fca27a247469d

  • avatar
  • Jakub Wieczorek <faw217 @gm…l.com>
  • Thu Jun 18 17:20:50 CEST 2009
  • Tree SHA1: 539908a
  • Parent SHA1: 40521d9 (fix the 'Add Rule' functionality. QDialog.show() returns immediately, so when the dialog is allocated on the stack, it wont)
  • raw diff | raw patch
Add the ability to drop an url on the tab bar which will open it in a
new tab.
  
308308 }
309309 QTabBar::dropEvent(event);
310310}
311#else
312void TabBar::dragEnterEvent(QDragEnterEvent *event)
313{
314 const QMimeData *mimeData = event->mimeData();
315 if (mimeData->hasUrls())
316 event->acceptProposedAction();
317
318 QTabBar::dragEnterEvent(event);
319}
320
321void TabBar::dropEvent(QDropEvent *event)
322{
323 const QMimeData *mimeData = event->mimeData();
324 QUrl url = mimeData->urls().at(0);
325 if (url.isValid()) {
326 event->acceptProposedAction();
327 loadUrl(url, TabWidget::NewSelectedTab);
328 }
329
330 QTabBar::dropEvent(event);
331}
311332#endif
312333
313334QSize TabBar::tabSizeHint(int index) const
  
101101 void mouseReleaseEvent(QMouseEvent *event);
102102 void mousePressEvent(QMouseEvent *event);
103103 void mouseMoveEvent(QMouseEvent *event);
104#if QT_VERSION < 0x040500
105104 void dragEnterEvent(QDragEnterEvent *event);
106105 void dropEvent(QDropEvent *event);
107#endif
108106 QSize tabSizeHint(int index) const;
109107 void tabInserted(int position);
110108 void tabRemoved(int position);