From 914b0c1c0d2440bee0675ef9b77bad9d40630903 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Sun, 9 Jan 2011 03:14:04 +0530 Subject: =?UTF-8?q?Tab=20bar=20preview=20optimization,=20use=20event->pos(?= =?UTF-8?q?)=20to=20get=20the=20position=20of=20tab=20instead=20of=20cycli?= =?UTF-8?q?ng=20=20with=20a=20while=20loop=20Thanks=20to=20Furkan=20=C3=9C?= =?UTF-8?q?z=C3=BCmc=C3=BC=20Review=20Board=20request=20:=20http://git.rev?= =?UTF-8?q?iewboard.kde.org/r/100324/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tabbar.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 57124979..fcc7b789 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -222,18 +222,7 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) if (ReKonfig::hoveringTabOption() == 0) { //Find the tab under the mouse - int i = 0; - int tabIndex = -1; - while (i < count() - && tabIndex == -1 - ) - { - if (tabRect(i).contains(event->pos())) - { - tabIndex = i; - } - i++; - } + const int tabIndex = tabAt(event->pos()); // if found and not the current tab then show tab preview if (tabIndex != -1 -- cgit v1.2.1