diff options
Diffstat (limited to 'kdeprint/management/kmiconview.cpp')
-rw-r--r-- | kdeprint/management/kmiconview.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/kdeprint/management/kmiconview.cpp b/kdeprint/management/kmiconview.cpp index cabd4496a..5d16e34d0 100644 --- a/kdeprint/management/kmiconview.cpp +++ b/kdeprint/management/kmiconview.cpp @@ -20,21 +20,21 @@ #include "kmiconview.h" #include "kmprinter.h" -#include <qpainter.h> +#include <tqpainter.h> #include <kiconloader.h> #include <kdebug.h> -KMIconViewItem::KMIconViewItem(QIconView *parent, KMPrinter *p) -: QIconViewItem(parent) +KMIconViewItem::KMIconViewItem(TQIconView *parent, KMPrinter *p) +: TQIconViewItem(parent) { m_state = 0; m_mode = parent->itemTextPos(); - m_pixmap = QString::null; + m_pixmap = TQString::null; m_isclass = false; updatePrinter(p, m_mode); } -void KMIconViewItem::paintItem(QPainter *p, const QColorGroup& cg) +void KMIconViewItem::paintItem(TQPainter *p, const TQColorGroup& cg) { if (m_state != 0) { @@ -43,10 +43,10 @@ void KMIconViewItem::paintItem(QPainter *p, const QColorGroup& cg) if (m_state & 0x2) f.setItalic(true); p->setFont(f); } - QIconViewItem::paintItem(p,cg); + TQIconViewItem::paintItem(p,cg); } -void KMIconViewItem::calcRect(const QString&) +void KMIconViewItem::calcRect(const TQString&) { QRect ir(rect()), pr, tr; @@ -59,25 +59,25 @@ void KMIconViewItem::calcRect(const QString&) if (m_state & 0x1) f.setBold(true); if (m_state & 0x2) f.setItalic(true); QFontMetrics fm(f); - if (m_mode == QIconView::Bottom) + if (m_mode == TQIconView::Bottom) tr = fm.boundingRect(0, 0, iconView()->maxItemWidth(), 0xFFFFFF, AlignHCenter|AlignTop|WordBreak|BreakAnywhere, text()+"X"); else tr = fm.boundingRect(0, 0, 0xFFFFFF, 0xFFFFFF, AlignLeft|AlignTop, text()+"X"); // item rect - if (m_mode == QIconView::Bottom) + if (m_mode == TQIconView::Bottom) { ir.setHeight(pr.height() + tr.height() + 15); ir.setWidth(QMAX(pr.width(), tr.width()) + 10); - pr = QRect((ir.width()-pr.width())/2, 5, pr.width(), pr.height()); - tr = QRect((ir.width()-tr.width())/2, 10+pr.height(), tr.width(), tr.height()); + pr = TQRect((ir.width()-pr.width())/2, 5, pr.width(), pr.height()); + tr = TQRect((ir.width()-tr.width())/2, 10+pr.height(), tr.width(), tr.height()); } else { ir.setHeight(QMAX(pr.height(), tr.height()) + 4); ir.setWidth(pr.width() + tr.width() + 6); - pr = QRect(2, (ir.height()-pr.height())/2, pr.width(), pr.height()); - tr = QRect(4+pr.width(), (ir.height()-tr.height())/2, tr.width(), tr.height()); + pr = TQRect(2, (ir.height()-pr.height())/2, pr.width(), pr.height()); + tr = TQRect(4+pr.width(), (ir.height()-tr.height())/2, tr.width(), tr.height()); } // set rects @@ -96,10 +96,10 @@ void KMIconViewItem::updatePrinter(KMPrinter *p, int mode) update = (oldstate != m_state); if (p->name() != text() || update) { - setText(QString::null); + setText(TQString::null); setText(p->name()); } - setKey(QString::fromLatin1("%1_%2").arg((p->isSpecial() ? "special" : (p->isClass(false) ? "class" : "printer"))).arg(p->name())); + setKey(TQString::fromLatin1("%1_%2").arg((p->isSpecial() ? "special" : (p->isClass(false) ? "class" : "printer"))).arg(p->name())); m_isclass = p->isClass(false); } if (mode != m_mode || ((oldstate&0x4) != (m_state&0x4)) || (p && p->pixmap() != m_pixmap)) @@ -108,7 +108,7 @@ void KMIconViewItem::updatePrinter(KMPrinter *p, int mode) if (p) m_pixmap = p->pixmap(); m_mode = mode; - if (m_mode == QIconView::Bottom) + if (m_mode == TQIconView::Bottom) setPixmap(DesktopIcon(m_pixmap, 0, iconstate)); else setPixmap(SmallIcon(m_pixmap, 0, iconstate)); @@ -118,19 +118,19 @@ void KMIconViewItem::updatePrinter(KMPrinter *p, int mode) setDiscarded(false); } -KMIconView::KMIconView(QWidget *parent, const char *name) +KMIconView::KMIconView(TQWidget *parent, const char *name) : KIconView(parent,name) { setMode(KIconView::Select); - setSelectionMode(QIconView::Single); + setSelectionMode(TQIconView::Single); setItemsMovable(false); - setResizeMode(QIconView::Adjust); + setResizeMode(TQIconView::Adjust); m_items.setAutoDelete(false); setViewMode(KMIconView::Big); - connect(this,SIGNAL(contextMenuRequested(QIconViewItem*,const QPoint&)),SLOT(slotRightButtonClicked(QIconViewItem*,const QPoint&))); - connect(this,SIGNAL(selectionChanged()),SLOT(slotSelectionChanged())); + connect(this,TQT_SIGNAL(contextMenuRequested(TQIconViewItem*,const TQPoint&)),TQT_SLOT(slotRightButtonClicked(TQIconViewItem*,const TQPoint&))); + connect(this,TQT_SIGNAL(selectionChanged()),TQT_SLOT(slotSelectionChanged())); } KMIconView::~KMIconView() @@ -141,7 +141,7 @@ KMIconViewItem* KMIconView::findItem(KMPrinter *p) { if (p) { - QPtrListIterator<KMIconViewItem> it(m_items); + TQPtrListIterator<KMIconViewItem> it(m_items); for (;it.current();++it) if (it.current()->text() == p->name() && it.current()->isClass() == p->isClass()) @@ -150,17 +150,17 @@ KMIconViewItem* KMIconView::findItem(KMPrinter *p) return 0; } -void KMIconView::setPrinterList(QPtrList<KMPrinter> *list) +void KMIconView::setPrinterList(TQPtrList<KMPrinter> *list) { bool changed(false); - QPtrListIterator<KMIconViewItem> it(m_items); + TQPtrListIterator<KMIconViewItem> it(m_items); for (;it.current();++it) it.current()->setDiscarded(true); if (list) { - QPtrListIterator<KMPrinter> it(*list); + TQPtrListIterator<KMPrinter> it(*list); KMIconViewItem *item(0); for (;it.current();++it) { @@ -195,32 +195,32 @@ void KMIconView::setViewMode(ViewMode m) { m_mode = m; bool big = (m == KMIconView::Big); - int mode = (big ? QIconView::Bottom : QIconView::Right); + int mode = (big ? TQIconView::Bottom : TQIconView::Right); - QPtrListIterator<KMIconViewItem> it(m_items); + TQPtrListIterator<KMIconViewItem> it(m_items); for (;it.current();++it) it.current()->updatePrinter(0, mode); - setArrangement((big ? QIconView::LeftToRight : QIconView::TopToBottom)); - setItemTextPos((QIconView::ItemTextPos)mode); + setArrangement((big ? TQIconView::LeftToRight : TQIconView::TopToBottom)); + setItemTextPos((TQIconView::ItemTextPos)mode); //setGridX((big ? 60 : -1)); setWordWrapIconText(true); } -void KMIconView::slotRightButtonClicked(QIconViewItem *item, const QPoint& p) +void KMIconView::slotRightButtonClicked(TQIconViewItem *item, const TQPoint& p) { - emit rightButtonClicked(item ? item->text() : QString::null, p); + emit rightButtonClicked(item ? item->text() : TQString::null, p); } void KMIconView::slotSelectionChanged() { KMIconViewItem *item = static_cast<KMIconViewItem*>(currentItem()); - emit printerSelected((item && !item->isDiscarded() && item->isSelected() ? item->text() : QString::null)); + emit printerSelected((item && !item->isDiscarded() && item->isSelected() ? item->text() : TQString::null)); } -void KMIconView::setPrinter(const QString& prname) +void KMIconView::setPrinter(const TQString& prname) { - QPtrListIterator<KMIconViewItem> it(m_items); + TQPtrListIterator<KMIconViewItem> it(m_items); for (; it.current(); ++it) if (it.current()->text() == prname) { @@ -231,7 +231,7 @@ void KMIconView::setPrinter(const QString& prname) void KMIconView::setPrinter(KMPrinter *p) { - setPrinter(p ? p->name() : QString::null); + setPrinter(p ? p->name() : TQString::null); } #include "kmiconview.moc" |