From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kalarm/eventlistviewbase.cpp | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'kalarm/eventlistviewbase.cpp') diff --git a/kalarm/eventlistviewbase.cpp b/kalarm/eventlistviewbase.cpp index 1a25e2ac0..a0f5d4952 100644 --- a/kalarm/eventlistviewbase.cpp +++ b/kalarm/eventlistviewbase.cpp @@ -20,8 +20,8 @@ #include "kalarm.h" -#include -#include +#include +#include #include #include @@ -33,8 +33,8 @@ class EventListWhatsThisBase : public QWhatsThis { public: - EventListWhatsThisBase(EventListViewBase* lv) : QWhatsThis(lv), mListView(lv) { } - virtual QString text(const QPoint&); + EventListWhatsThisBase(EventListViewBase* lv) : TQWhatsThis(lv), mListView(lv) { } + virtual TQString text(const TQPoint&); private: EventListViewBase* mListView; }; @@ -45,7 +45,7 @@ class EventListWhatsThisBase : public QWhatsThis = Base class for displaying a list of events. =============================================================================*/ -EventListViewBase::EventListViewBase(QWidget* parent, const char* name) +EventListViewBase::EventListViewBase(TQWidget* parent, const char* name) : KListView(parent, name), mFind(0), mLastColumn(-1), @@ -57,12 +57,12 @@ EventListViewBase::EventListViewBase(QWidget* parent, const char* name) new EventListWhatsThisBase(this); } -void EventListViewBase::addLastColumn(const QString& title) +void EventListViewBase::addLastColumn(const TQString& title) { addColumn(title); mLastColumn = columns() - 1; mLastColumnHeaderWidth = columnWidth(mLastColumn); - setColumnWidthMode(mLastColumn, QListView::Maximum); + setColumnWidthMode(mLastColumn, TQListView::Maximum); } /****************************************************************************** @@ -70,7 +70,7 @@ void EventListViewBase::addLastColumn(const QString& title) */ void EventListViewBase::refresh() { - QString currentID; + TQString currentID; if (currentItem()) currentID = currentItem()->event().id(); // save current item for restoration afterwards clear(); @@ -87,7 +87,7 @@ void EventListViewBase::refresh() /****************************************************************************** * Get the item for a given event ID. */ -EventListViewItemBase* EventListViewBase::getEntry(const QString& eventID) const +EventListViewItemBase* EventListViewBase::getEntry(const TQString& eventID) const { if (!eventID.isEmpty()) { @@ -114,7 +114,7 @@ void EventListViewBase::addEvent(const KAEvent& event, const InstanceList& insta * If 'selectionView' is non-null, the selection highlight is moved to the * modified event in that listView instance. */ -void EventListViewBase::modifyEvent(const QString& oldEventID, const KAEvent& newEvent, +void EventListViewBase::modifyEvent(const TQString& oldEventID, const KAEvent& newEvent, const InstanceList& instanceList, EventListViewBase* selectionView) { for (InstanceListConstIterator it = instanceList.begin(); it != instanceList.end(); ++it) @@ -130,7 +130,7 @@ void EventListViewBase::modifyEvent(const QString& oldEventID, const KAEvent& ne /****************************************************************************** * Delete an event from every displayed list. */ -void EventListViewBase::deleteEvent(const QString& eventID, const InstanceList& instanceList) +void EventListViewBase::deleteEvent(const TQString& eventID, const InstanceList& instanceList) { for (InstanceListConstIterator it = instanceList.begin(); it != instanceList.end(); ++it) { @@ -199,7 +199,7 @@ void EventListViewBase::slotFind() if (!mFind) { mFind = new Find(this); - connect(mFind, SIGNAL(active(bool)), SIGNAL(findActive(bool))); + connect(mFind, TQT_SIGNAL(active(bool)), TQT_SIGNAL(findActive(bool))); } mFind->display(); } @@ -219,7 +219,7 @@ void EventListViewBase::findNext(bool forward) */ void EventListViewBase::slotSelectAll() { - if (selectionMode() == QListView::Multi || selectionMode() == QListView::Extended) + if (selectionMode() == TQListView::Multi || selectionMode() == TQListView::Extended) selectAll(true); } @@ -237,7 +237,7 @@ void EventListViewBase::slotDeselect() */ bool EventListViewBase::anySelected() const { - for (QListViewItem* item = KListView::firstChild(); item; item = item->nextSibling()) + for (TQListViewItem* item = KListView::firstChild(); item; item = item->nextSibling()) if (isSelected(item)) return true; return false; @@ -257,16 +257,16 @@ const KAEvent* EventListViewBase::selectedEvent() const /****************************************************************************** * Fetch the single selected item. * This method works in both Single and Multi selection mode, unlike -* QListView::selectedItem(). +* TQListView::selectedItem(). * Reply = null if no items are selected, or if multiple items are selected. */ EventListViewItemBase* EventListViewBase::selectedItem() const { - if (selectionMode() == QListView::Single) + if (selectionMode() == TQListView::Single) return (EventListViewItemBase*)KListView::selectedItem(); - QListViewItem* item = 0; - for (QListViewItem* it = firstChild(); it; it = it->nextSibling()) + TQListViewItem* item = 0; + for (TQListViewItem* it = firstChild(); it; it = it->nextSibling()) { if (isSelected(it)) { @@ -281,10 +281,10 @@ EventListViewItemBase* EventListViewBase::selectedItem() const /****************************************************************************** * Fetch all selected items. */ -QValueList EventListViewBase::selectedItems() const +TQValueList EventListViewBase::selectedItems() const { - QValueList items; - for (QListViewItem* item = firstChild(); item; item = item->nextSibling()) + TQValueList items; + for (TQListViewItem* item = firstChild(); item; item = item->nextSibling()) { if (isSelected(item)) items.append((EventListViewItemBase*)item); @@ -298,7 +298,7 @@ QValueList EventListViewBase::selectedItems() const int EventListViewBase::selectedCount() const { int count = 0; - for (QListViewItem* item = firstChild(); item; item = item->nextSibling()) + for (TQListViewItem* item = firstChild(); item; item = item->nextSibling()) { if (isSelected(item)) ++count; @@ -319,7 +319,7 @@ void EventListViewBase::resizeLastColumn() if (mw > lastColumnWidth) lastColumnWidth = mw; } - QHeader* head = header(); + TQHeader* head = header(); int x = head->sectionPos(mLastColumn); int availableWidth = visibleWidth() - x; int rightColWidth = 0; @@ -344,7 +344,7 @@ void EventListViewBase::resizeLastColumn() * Sets the last column in the list view to extend at least to the right hand * edge of the list view. */ -void EventListViewBase::resizeEvent(QResizeEvent* re) +void EventListViewBase::resizeEvent(TQResizeEvent* re) { KListView::resizeEvent(re); resizeLastColumn(); @@ -355,7 +355,7 @@ void EventListViewBase::resizeEvent(QResizeEvent* re) * Sets the last column in the list view to extend at least to the right hand * edge of the list view. */ -void EventListViewBase::showEvent(QShowEvent* se) +void EventListViewBase::showEvent(TQShowEvent* se) { KListView::showEvent(se); resizeLastColumn(); @@ -370,7 +370,7 @@ int EventListViewBase::itemHeight() if (!item) { // The list is empty, so create a temporary item to find its height - QListViewItem* item = new QListViewItem(this, QString::null); + TQListViewItem* item = new TQListViewItem(this, TQString::null); int height = item->height(); delete item; return height; @@ -385,15 +385,15 @@ int EventListViewBase::itemHeight() = Base class containing the details of one event for display in an * EventListViewBase. =============================================================================*/ -QPixmap* EventListViewItemBase::mTextIcon; -QPixmap* EventListViewItemBase::mFileIcon; -QPixmap* EventListViewItemBase::mCommandIcon; -QPixmap* EventListViewItemBase::mEmailIcon; +TQPixmap* EventListViewItemBase::mTextIcon; +TQPixmap* EventListViewItemBase::mFileIcon; +TQPixmap* EventListViewItemBase::mCommandIcon; +TQPixmap* EventListViewItemBase::mEmailIcon; int EventListViewItemBase::mIconWidth = 0; EventListViewItemBase::EventListViewItemBase(EventListViewBase* parent, const KAEvent& event) - : QListViewItem(parent), + : TQListViewItem(parent), mEvent(event) { iconWidth(); // load the icons @@ -416,10 +416,10 @@ int EventListViewItemBase::iconWidth() { if (!mIconWidth) { - mTextIcon = new QPixmap(SmallIcon("message")); - mFileIcon = new QPixmap(SmallIcon("file")); - mCommandIcon = new QPixmap(SmallIcon("exec")); - mEmailIcon = new QPixmap(SmallIcon("mail_generic")); + mTextIcon = new TQPixmap(SmallIcon("message")); + mFileIcon = new TQPixmap(SmallIcon("file")); + mCommandIcon = new TQPixmap(SmallIcon("exec")); + mEmailIcon = new TQPixmap(SmallIcon("mail_generic")); if (mTextIcon) mIconWidth = mTextIcon->width(); if (mFileIcon && mFileIcon->width() > mIconWidth) @@ -435,7 +435,7 @@ int EventListViewItemBase::iconWidth() /****************************************************************************** * Return the icon associated with the event's action. */ -QPixmap* EventListViewItemBase::eventIcon() const +TQPixmap* EventListViewItemBase::eventIcon() const { switch (mEvent.action()) { @@ -453,13 +453,13 @@ QPixmap* EventListViewItemBase::eventIcon() const = Sets What's This? text depending on where in the list view is clicked. =============================================================================*/ -QString EventListWhatsThisBase::text(const QPoint& pt) +TQString EventListWhatsThisBase::text(const TQPoint& pt) { int column = -1; - QPoint viewportPt = mListView->viewport()->mapFrom(mListView, pt); - QRect frame = mListView->header()->frameGeometry(); + TQPoint viewportPt = mListView->viewport()->mapFrom(mListView, pt); + TQRect frame = mListView->header()->frameGeometry(); if (frame.contains(pt) - || mListView->itemAt(QPoint(mListView->itemMargin(), viewportPt.y())) && frame.contains(QPoint(pt.x(), frame.y()))) + || mListView->itemAt(TQPoint(mListView->itemMargin(), viewportPt.y())) && frame.contains(TQPoint(pt.x(), frame.y()))) column = mListView->header()->sectionAt(pt.x()); return mListView->whatsThisText(column); } -- cgit v1.2.1