From: <mrj...@us...> - 2007-10-04 17:07:05
|
Revision: 2194 http://tora.svn.sourceforge.net/tora/?rev=2194&view=rev Author: mrjohnson0 Date: 2007-10-04 10:07:09 -0700 (Thu, 04 Oct 2007) Log Message: ----------- qt4 updates. remove toListTip. QToolTip is private now and this looks like old code that doesn't do anything. Modified Paths: -------------- branches/tora-1.4/tora/src/toresultview.cpp Modified: branches/tora-1.4/tora/src/toresultview.cpp =================================================================== --- branches/tora-1.4/tora/src/toresultview.cpp 2007-10-04 16:33:00 UTC (rev 2193) +++ branches/tora-1.4/tora/src/toresultview.cpp 2007-10-04 17:07:09 UTC (rev 2194) @@ -65,7 +65,6 @@ #include <qprinter.h> #include <qregexp.h> #include <qstyle.h> -#include <qtooltip.h> #include <qworkspace.h> //Added by qt3to4: #include <QKeyEvent> @@ -74,7 +73,6 @@ #include <QFocusEvent> #include <QMouseEvent> - // #include "toresultlistformatui.moc" // #include "toresultview.moc" @@ -408,7 +406,7 @@ t = txt; int wx = top->itemMargin() * 2 - fm.minLeftBearing() - fm.minRightBearing() + 1; if (column == 0) - wx += top->style().pixelMetric(QStyle::PM_CheckListButtonSize) + 4 + top->itemMargin(); + wx += top->style()->pixelMetric(QStyle::PM_CheckListButtonSize) + 4 + top->itemMargin(); return std::min(TextWidth(fm, t), MaxColDisp) + wx; } @@ -426,7 +424,7 @@ QRect bounds = fm.boundingRect(t); int wx = top->itemMargin() * 2 - fm.minLeftBearing() - fm.minRightBearing() + 1; if (column == 0) - wx += top->style().pixelMetric(QStyle::PM_CheckListButtonSize) + 4 + top->itemMargin(); + wx += top->style()->pixelMetric(QStyle::PM_CheckListButtonSize) + 4 + top->itemMargin(); return std::min(bounds.width(), MaxColDisp) + wx; } @@ -460,51 +458,6 @@ return txt; } -class toListTip : public QToolTip -{ -private: - toListView *List; -public: - toListTip(toListView *parent) - : QToolTip(parent->viewport()) - { - List = parent; - } - - virtual void maybeTip(const QPoint &p) - { - Q3ListViewItem *item = List->itemAt(p); - toResultViewItem *resItem = dynamic_cast<toResultViewItem *>(item); - toResultViewCheck *chkItem = dynamic_cast<toResultViewCheck *>(item); - if (item) - { - int col = List->header()->sectionAt(List->viewportToContents(p).x()); - QPoint t(List->header()->sectionPos(col), 0); - int pos = List->contentsToViewport(t).x(); - int width = List->header()->sectionSize(col); - QString key; - - QString text = item->text(col); - if (resItem) - key = resItem->tooltip(col); - else if (chkItem) - key = chkItem->tooltip(col); - else - key = text; - int textWidth = TextWidth(List->fontMetrics(), text) + List->itemMargin() * 2 - - List->fontMetrics().minLeftBearing() - List->fontMetrics().minRightBearing() + 1; - if (key != text || - width < textWidth) - { - QRect itemRect = List->itemRect(item); - itemRect.setLeft(pos); - itemRect.setRight(pos + width); - tip(itemRect, key); - } - } - } -}; - toListView::toListView(QWidget *parent, const char *name, Qt::WFlags f) : Q3ListView(parent, name, f), toEditWidget(false, true, true, @@ -516,7 +469,6 @@ setTreeStepSize(15); setSelectionMode(Extended); setAllColumnsShowFocus(true); - AllTip = new toListTip(this); setSorting( -1); Menu = NULL; @@ -533,8 +485,6 @@ toListView::~toListView() { - delete AllTip; - AllTip = 0; } void toListView::contentsMouseDoubleClickEvent (QMouseEvent *e) @@ -1005,7 +955,8 @@ toListView *toListView::copyTransposed(void) { toListView *lst = new toListView(toMainWidget()->workspace()); - lst->setWFlags(lst->getWFlags() | Qt::WDestructiveClose); + // qt4 +// lst->setWFlags(lst->getWFlags() | Qt::WDestructiveClose); lst->Name = Name; Q3ListViewItem *next = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |