diff options
Diffstat (limited to 'kdeui/kjanuswidget.cpp')
-rw-r--r-- | kdeui/kjanuswidget.cpp | 396 |
1 files changed, 198 insertions, 198 deletions
diff --git a/kdeui/kjanuswidget.cpp b/kdeui/kjanuswidget.cpp index 4a38a7b28..f8647fb26 100644 --- a/kdeui/kjanuswidget.cpp +++ b/kdeui/kjanuswidget.cpp @@ -18,20 +18,20 @@ * Boston, MA 02110-1301, USA. */ -#include <qbitmap.h> -#include <qgrid.h> -#include <qhbox.h> -#include <qheader.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qpixmap.h> -#include <qsplitter.h> -#include <qtabwidget.h> -#include <qvbox.h> -#include <qwidgetstack.h> -#include <qpainter.h> -#include <qstyle.h> +#include <tqbitmap.h> +#include <tqgrid.h> +#include <tqhbox.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqpixmap.h> +#include <tqsplitter.h> +#include <tqtabwidget.h> +#include <tqvbox.h> +#include <tqwidgetstack.h> +#include <tqpainter.h> +#include <tqstyle.h> #include <kapplication.h> #include <kdialog.h> // Access to some static members @@ -48,18 +48,18 @@ class KJanusWidget::IconListItem : public QListBoxItem { public: - IconListItem( QListBox *listbox, const QPixmap &pixmap, - const QString &text ); - virtual int height( const QListBox *lb ) const; - virtual int width( const QListBox *lb ) const; + IconListItem( TQListBox *listbox, const TQPixmap &pixmap, + const TQString &text ); + virtual int height( const TQListBox *lb ) const; + virtual int width( const TQListBox *lb ) const; int expandMinimumWidth( int width ); protected: - const QPixmap &defaultPixmap(); - void paint( QPainter *painter ); + const TQPixmap &defaultPixmap(); + void paint( TQPainter *painter ); private: - QPixmap mPixmap; + TQPixmap mPixmap; int mMinimumWidth; }; @@ -71,78 +71,78 @@ public: int mNextPageIndex; // The next page index. // Dictionary for multipage modes. - QMap<int,QWidget*> mIntToPage; + TQMap<int,TQWidget*> mIntToPage; // Reverse dictionary. Used because showPage() may be performance critical. - QMap<QWidget*,int> mPageToInt; + TQMap<TQWidget*,int> mPageToInt; // Dictionary of title string associated with page. - QMap<int, QString> mIntToTitle; + TQMap<int, TQString> mIntToTitle; - QWidget * mListFrame; - QSplitter * mSplitter; + TQWidget * mListFrame; + TQSplitter * mSplitter; }; -template class QPtrList<QListViewItem>; +template class TQPtrList<TQListViewItem>; -KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) - : QWidget( parent, name, 0 ), +KJanusWidget::KJanusWidget( TQWidget *parent, const char *name, int face ) + : TQWidget( parent, name, 0 ), mValid(false), mPageList(0), mTitleList(0), mFace(face), mTitleLabel(0), mActivePageWidget(0), mShowIconsInTreeList(false), d(0) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); + TQVBoxLayout *topLayout = new TQVBoxLayout( this ); if( mFace == TreeList || mFace == IconList ) { d = new KJanusWidgetPrivate; d->mSplitter = 0; - QFrame *page; + TQFrame *page; if( mFace == TreeList ) { - d->mSplitter = new QSplitter( this ); + d->mSplitter = new TQSplitter( this ); topLayout->addWidget( d->mSplitter, 10 ); - mTreeListResizeMode = QSplitter::KeepSize; + mTreeListResizeMode = TQSplitter::KeepSize; - d->mListFrame = new QWidget( d->mSplitter ); - QVBoxLayout *dummy = new QVBoxLayout( d->mListFrame, 0, KDialog::spacingHint() ); + d->mListFrame = new TQWidget( d->mSplitter ); + TQVBoxLayout *dummy = new TQVBoxLayout( d->mListFrame, 0, KDialog::spacingHint() ); dummy->setAutoAdd( true ); mTreeList = new KListView( d->mListFrame ); - mTreeList->addColumn( QString::null ); + mTreeList->addColumn( TQString::null ); mTreeList->header()->hide(); mTreeList->setRootIsDecorated(true); mTreeList->setSorting( -1 ); - connect( mTreeList, SIGNAL(selectionChanged()), SLOT(slotShowPage()) ); - connect( mTreeList, SIGNAL(clicked(QListViewItem *)), SLOT(slotItemClicked(QListViewItem *))); + connect( mTreeList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotShowPage()) ); + connect( mTreeList, TQT_SIGNAL(clicked(TQListViewItem *)), TQT_SLOT(slotItemClicked(TQListViewItem *))); // // Page area. Title at top with a separator below and a pagestack using // all available space at bottom. // - QFrame *p = new QFrame( d->mSplitter ); + TQFrame *p = new TQFrame( d->mSplitter ); - QHBoxLayout *hbox = new QHBoxLayout( p, 0, 0 ); + TQHBoxLayout *hbox = new TQHBoxLayout( p, 0, 0 ); - page = new QFrame( p ); + page = new TQFrame( p ); hbox->addWidget( page, 10 ); } else { - QHBoxLayout *hbox = new QHBoxLayout( topLayout ); - d->mListFrame = new QWidget( this ); + TQHBoxLayout *hbox = new TQHBoxLayout( topLayout ); + d->mListFrame = new TQWidget( this ); hbox->addWidget( d->mListFrame ); - ( new QVBoxLayout( d->mListFrame, 0, 0 ) )->setAutoAdd( true ); + ( new TQVBoxLayout( d->mListFrame, 0, 0 ) )->setAutoAdd( true ); mIconList = new IconListBox( d->mListFrame ); - QFont listFont( mIconList->font() ); + TQFont listFont( mIconList->font() ); listFont.setBold( true ); mIconList->setFont( listFont ); mIconList->verticalScrollBar()->installEventFilter( this ); - connect( mIconList, SIGNAL(selectionChanged()), SLOT(slotShowPage())); + connect( mIconList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotShowPage())); hbox->addSpacing( KDialog::marginHint() ); - page = new QFrame( this ); + page = new TQFrame( this ); hbox->addWidget( page, 10 ); } @@ -151,48 +151,48 @@ KJanusWidget::KJanusWidget( QWidget *parent, const char *name, int face ) // pagestack using all available space at bottom. // - QVBoxLayout *vbox = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); - mTitleLabel = new QLabel( i18n("Empty Page"), page, "KJanusWidgetTitleLabel" ); - vbox->addWidget( mTitleLabel, 0, QApplication::reverseLayout() ? AlignRight : AlignLeft ); + mTitleLabel = new TQLabel( i18n("Empty Page"), page, "KJanusWidgetTitleLabel" ); + vbox->addWidget( mTitleLabel, 0, TQApplication::reverseLayout() ? AlignRight : AlignLeft ); - QFont titleFont( mTitleLabel->font() ); + TQFont titleFont( mTitleLabel->font() ); titleFont.setBold( true ); mTitleLabel->setFont( titleFont ); mTitleSep = new KSeparator( page ); - mTitleSep->setFrameStyle( QFrame::HLine|QFrame::Plain ); + mTitleSep->setFrameStyle( TQFrame::HLine|TQFrame::Plain ); vbox->addWidget( mTitleSep ); - mPageStack = new QWidgetStack( page ); - connect(mPageStack, SIGNAL(aboutToShow(QWidget *)), - SIGNAL(aboutToShowPage(QWidget *))); + mPageStack = new TQWidgetStack( page ); + connect(mPageStack, TQT_SIGNAL(aboutToShow(TQWidget *)), + TQT_SIGNAL(aboutToShowPage(TQWidget *))); vbox->addWidget( mPageStack, 10 ); } else if( mFace == Tabbed ) { d = new KJanusWidgetPrivate; - mTabControl = new QTabWidget( this ); + mTabControl = new TQTabWidget( this ); mTabControl->setMargin (KDialog::marginHint()); - connect(mTabControl, SIGNAL(currentChanged(QWidget *)), - SIGNAL(aboutToShowPage(QWidget *))); + connect(mTabControl, TQT_SIGNAL(currentChanged(TQWidget *)), + TQT_SIGNAL(aboutToShowPage(TQWidget *))); topLayout->addWidget( mTabControl, 10 ); } else if( mFace == Swallow ) { - mSwallowPage = new QWidget( this ); + mSwallowPage = new TQWidget( this ); topLayout->addWidget( mSwallowPage, 10 ); } else { mFace = Plain; - mPlainPage = new QFrame( this ); + mPlainPage = new TQFrame( this ); topLayout->addWidget( mPlainPage, 10 ); } if ( kapp ) - connect(kapp,SIGNAL(kdisplayFontChanged()),SLOT(slotFontChanged())); + connect(kapp,TQT_SIGNAL(kdisplayFontChanged()),TQT_SLOT(slotFontChanged())); mValid = true; setSwallowedWidget(0); // Set default size if 'mFace' is Swallow. @@ -211,7 +211,7 @@ bool KJanusWidget::isValid() const } -QFrame *KJanusWidget::plainPage() +TQFrame *KJanusWidget::plainPage() { return mPlainPage; } @@ -222,7 +222,7 @@ int KJanusWidget::face() const return mFace; } -QWidget *KJanusWidget::FindParent() +TQWidget *KJanusWidget::FindParent() { if( mFace == Tabbed ) { return mTabControl; @@ -232,8 +232,8 @@ QWidget *KJanusWidget::FindParent() } } -QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, - const QPixmap &pixmap ) +TQFrame *KJanusWidget::addPage( const TQStringList &items, const TQString &header, + const TQPixmap &pixmap ) { if( !mValid ) { @@ -241,36 +241,36 @@ QFrame *KJanusWidget::addPage( const QStringList &items, const QString &header, return 0; } - QFrame *page = new QFrame( FindParent(), "page" ); + TQFrame *page = new TQFrame( FindParent(), "page" ); addPageWidget( page, items, header, pixmap ); return page; } -void KJanusWidget::pageGone( QObject *obj ) +void KJanusWidget::pageGone( TQObject *obj ) { - removePage( static_cast<QWidget*>( obj ) ); + removePage( static_cast<TQWidget*>( obj ) ); } -void KJanusWidget::slotReopen( QListViewItem * item ) +void KJanusWidget::slotReopen( TQListViewItem * item ) { if( item ) item->setOpen( true ); } -QFrame *KJanusWidget::addPage( const QString &itemName, const QString &header, - const QPixmap &pixmap ) +TQFrame *KJanusWidget::addPage( const TQString &itemName, const TQString &header, + const TQPixmap &pixmap ) { - QStringList items; + TQStringList items; items << itemName; return addPage(items, header, pixmap); } -QVBox *KJanusWidget::addVBoxPage( const QStringList &items, - const QString &header, - const QPixmap &pixmap ) +TQVBox *KJanusWidget::addVBoxPage( const TQStringList &items, + const TQString &header, + const TQPixmap &pixmap ) { if( !mValid ) { @@ -278,51 +278,51 @@ QVBox *KJanusWidget::addVBoxPage( const QStringList &items, return 0; } - QVBox *page = new QVBox(FindParent() , "page" ); + TQVBox *page = new TQVBox(FindParent() , "page" ); page->setSpacing( KDialog::spacingHint() ); addPageWidget( page, items, header, pixmap ); return page; } -QVBox *KJanusWidget::addVBoxPage( const QString &itemName, - const QString &header, - const QPixmap &pixmap ) +TQVBox *KJanusWidget::addVBoxPage( const TQString &itemName, + const TQString &header, + const TQPixmap &pixmap ) { - QStringList items; + TQStringList items; items << itemName; return addVBoxPage(items, header, pixmap); } -QHBox *KJanusWidget::addHBoxPage( const QStringList &items, - const QString &header, - const QPixmap &pixmap ) +TQHBox *KJanusWidget::addHBoxPage( const TQStringList &items, + const TQString &header, + const TQPixmap &pixmap ) { if( !mValid ) { kdDebug() << "addPage: Invalid object" << endl; return 0; } - QHBox *page = new QHBox(FindParent(), "page"); + TQHBox *page = new TQHBox(FindParent(), "page"); page->setSpacing( KDialog::spacingHint() ); addPageWidget( page, items, header, pixmap ); return page; } -QHBox *KJanusWidget::addHBoxPage( const QString &itemName, - const QString &header, - const QPixmap &pixmap ) +TQHBox *KJanusWidget::addHBoxPage( const TQString &itemName, + const TQString &header, + const TQPixmap &pixmap ) { - QStringList items; + TQStringList items; items << itemName; return addHBoxPage(items, header, pixmap); } -QGrid *KJanusWidget::addGridPage( int n, Orientation dir, - const QStringList &items, - const QString &header, - const QPixmap &pixmap ) +TQGrid *KJanusWidget::addGridPage( int n, Orientation dir, + const TQStringList &items, + const TQString &header, + const TQPixmap &pixmap ) { if( !mValid ) { @@ -330,7 +330,7 @@ QGrid *KJanusWidget::addGridPage( int n, Orientation dir, return 0; } - QGrid *page = new QGrid( n, dir, FindParent(), "page" ); + TQGrid *page = new TQGrid( n, dir, FindParent(), "page" ); page->setSpacing( KDialog::spacingHint() ); addPageWidget( page, items, header, pixmap ); @@ -338,25 +338,25 @@ QGrid *KJanusWidget::addGridPage( int n, Orientation dir, } -QGrid *KJanusWidget::addGridPage( int n, Orientation dir, - const QString &itemName, - const QString &header, - const QPixmap &pixmap ) +TQGrid *KJanusWidget::addGridPage( int n, Orientation dir, + const TQString &itemName, + const TQString &header, + const TQPixmap &pixmap ) { - QStringList items; + TQStringList items; items << itemName; return addGridPage(n, dir, items, header, pixmap); } -void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &pixmap, QFrame *page) +void KJanusWidget::InsertTreeListItem(const TQStringList &items, const TQPixmap &pixmap, TQFrame *page) { bool isTop = true; - QListViewItem *curTop = 0, *child, *last, *newChild; + TQListViewItem *curTop = 0, *child, *last, *newChild; unsigned int index = 1; - QStringList curPath; + TQStringList curPath; - for ( QStringList::ConstIterator it = items.begin(); it != items.end(); ++it, index++ ) { - QString name = (*it); + for ( TQStringList::ConstIterator it = items.begin(); it != items.end(); ++it, index++ ) { + TQString name = (*it); bool isPath = ( index != items.count() ); // Find the first child. @@ -375,9 +375,9 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p // This node didn't have any children at all, lets just insert the // new child. if (isTop) - newChild = new QListViewItem(mTreeList, name); + newChild = new TQListViewItem(mTreeList, name); else - newChild = new QListViewItem(curTop, name); + newChild = new TQListViewItem(curTop, name); } else if (child) { @@ -394,9 +394,9 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p else { // the node had some children, but we didn't find the given name if (isTop) - newChild = new QListViewItem(mTreeList, last, name); + newChild = new TQListViewItem(mTreeList, last, name); else - newChild = new QListViewItem(curTop, last, name); + newChild = new TQListViewItem(curTop, last, name); } // Now make the element expandable if it is a path component, and make @@ -407,9 +407,9 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p isTop = false; curPath << name; - QString key = curPath.join("_/_"); + TQString key = curPath.join("_/_"); if (mFolderIconMap.contains(key)) { - QPixmap p = mFolderIconMap[key]; + TQPixmap p = mFolderIconMap[key]; newChild->setPixmap(0,p); } } @@ -422,26 +422,26 @@ void KJanusWidget::InsertTreeListItem(const QStringList &items, const QPixmap &p } } -void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, - const QString &header,const QPixmap &pixmap ) +void KJanusWidget::addPageWidget( TQFrame *page, const TQStringList &items, + const TQString &header,const TQPixmap &pixmap ) { - connect(page, SIGNAL(destroyed(QObject*)), SLOT(pageGone(QObject*))); + connect(page, TQT_SIGNAL(destroyed(TQObject*)), TQT_SLOT(pageGone(TQObject*))); if( mFace == Tabbed ) { mTabControl->addTab (page, items.last()); - d->mIntToPage[d->mNextPageIndex] = static_cast<QWidget*>(page); - d->mPageToInt[static_cast<QWidget*>(page)] = d->mNextPageIndex; + d->mIntToPage[d->mNextPageIndex] = static_cast<TQWidget*>(page); + d->mPageToInt[static_cast<TQWidget*>(page)] = d->mNextPageIndex; d->mNextPageIndex++; } else if( mFace == TreeList || mFace == IconList ) { - d->mIntToPage[d->mNextPageIndex] = static_cast<QWidget*>(page); - d->mPageToInt[static_cast<QWidget*>(page)] = d->mNextPageIndex; + d->mIntToPage[d->mNextPageIndex] = static_cast<TQWidget*>(page); + d->mPageToInt[static_cast<TQWidget*>(page)] = d->mNextPageIndex; mPageStack->addWidget( page, 0 ); if (items.isEmpty()) { - kdDebug() << "Invalid QStringList, with zero items" << endl; + kdDebug() << "Invalid TQStringList, with zero items" << endl; return; } @@ -451,7 +451,7 @@ void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, } else // mFace == IconList { - QString itemName = items.last(); + TQString itemName = items.last(); IconListItem *item = new IconListItem( mIconList, pixmap, itemName ); mIconListToPageStack.insert(item, page); mIconList->invalidateHeight(); @@ -464,9 +464,9 @@ void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, // // Make sure the title label is sufficiently wide // - QString lastName = items.last(); - const QString &title = (!header.isNull() ? header : lastName); - QRect r = mTitleLabel->fontMetrics().boundingRect( title ); + TQString lastName = items.last(); + const TQString &title = (!header.isNull() ? header : lastName); + TQRect r = mTitleLabel->fontMetrics().boundingRect( title ); if( mTitleLabel->minimumWidth() < r.width() ) { mTitleLabel->setMinimumWidth( r.width() ); @@ -485,15 +485,15 @@ void KJanusWidget::addPageWidget( QFrame *page, const QStringList &items, } -void KJanusWidget::setFolderIcon(const QStringList &path, const QPixmap &pixmap) +void KJanusWidget::setFolderIcon(const TQStringList &path, const TQPixmap &pixmap) { - QString key = path.join("_/_"); + TQString key = path.join("_/_"); mFolderIconMap.insert(key,pixmap); } -bool KJanusWidget::setSwallowedWidget( QWidget *widget ) +bool KJanusWidget::setSwallowedWidget( TQWidget *widget ) { if( mFace != Swallow || !mValid ) { @@ -505,18 +505,18 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget ) // delete mSwallowPage->layout(); - QGridLayout *gbox = new QGridLayout( mSwallowPage, 1, 1, 0 ); + TQGridLayout *gbox = new TQGridLayout( mSwallowPage, 1, 1, 0 ); // // Hide old children // - QObjectList *l = (QObjectList*)mSwallowPage->children(); // silence please + TQObjectList *l = (TQObjectList*)mSwallowPage->children(); // silence please for( uint i=0; i < l->count(); i++ ) { - QObject *o = l->at(i); + TQObject *o = l->at(i); if( o->isWidgetType() ) { - ((QWidget*)o)->hide(); + ((TQWidget*)o)->hide(); } } @@ -533,7 +533,7 @@ bool KJanusWidget::setSwallowedWidget( QWidget *widget ) { if( widget->parent() != mSwallowPage ) { - widget->reparent( mSwallowPage, 0, QPoint(0,0) ); + widget->reparent( mSwallowPage, 0, TQPoint(0,0) ); } gbox->addWidget(widget, 0, 0 ); gbox->activate(); @@ -552,18 +552,18 @@ bool KJanusWidget::slotShowPage() if( mFace == TreeList ) { - QListViewItem *node = mTreeList->selectedItem(); + TQListViewItem *node = mTreeList->selectedItem(); if( !node ) { return false; } - QWidget *stackItem = mTreeListToPageStack[node]; + TQWidget *stackItem = mTreeListToPageStack[node]; // Make sure to call through the virtual function showPage(int) return showPage(d->mPageToInt[stackItem]); } else if( mFace == IconList ) { - QListBoxItem *node = mIconList->item( mIconList->currentItem() ); + TQListBoxItem *node = mIconList->item( mIconList->currentItem() ); if( !node ) { return false; } - QWidget *stackItem = mIconListToPageStack[node]; + TQWidget *stackItem = mIconListToPageStack[node]; // Make sure to call through the virtual function showPage(int) return showPage(d->mPageToInt[stackItem]); } @@ -585,7 +585,7 @@ bool KJanusWidget::showPage( int index ) } -bool KJanusWidget::showPage( QWidget *w ) +bool KJanusWidget::showPage( TQWidget *w ) { if( !w || !mValid ) { @@ -601,10 +601,10 @@ bool KJanusWidget::showPage( QWidget *w ) mTitleLabel->setText( d->mIntToTitle[index] ); if( mFace == TreeList ) { - QMap<QListViewItem *, QWidget *>::Iterator it; + TQMap<TQListViewItem *, TQWidget *>::Iterator it; for (it = mTreeListToPageStack.begin(); it != mTreeListToPageStack.end(); ++it){ - QListViewItem *key = it.key(); - QWidget *val = it.data(); + TQListViewItem *key = it.key(); + TQWidget *val = it.data(); if (val == w) { mTreeList->setSelected(key, true ); break; @@ -613,10 +613,10 @@ bool KJanusWidget::showPage( QWidget *w ) } else { - QMap<QListBoxItem *, QWidget *>::Iterator it; + TQMap<TQListBoxItem *, TQWidget *>::Iterator it; for (it = mIconListToPageStack.begin(); it != mIconListToPageStack.end(); ++it){ - QListBoxItem *key = it.key(); - QWidget *val = it.data(); + TQListBoxItem *key = it.key(); + TQWidget *val = it.data(); if (val == w) { mIconList->setSelected( key, true ); break; @@ -641,19 +641,19 @@ bool KJanusWidget::showPage( QWidget *w ) int KJanusWidget::activePageIndex() const { if( mFace == TreeList) { - QListViewItem *node = mTreeList->selectedItem(); + TQListViewItem *node = mTreeList->selectedItem(); if( !node ) { return -1; } - QWidget *stackItem = mTreeListToPageStack[node]; + TQWidget *stackItem = mTreeListToPageStack[node]; return d->mPageToInt[stackItem]; } else if (mFace == IconList) { - QListBoxItem *node = mIconList->item( mIconList->currentItem() ); + TQListBoxItem *node = mIconList->item( mIconList->currentItem() ); if( !node ) { return false; } - QWidget *stackItem = mIconListToPageStack[node]; + TQWidget *stackItem = mIconListToPageStack[node]; return d->mPageToInt[stackItem]; } else if( mFace == Tabbed ) { - QWidget *widget = mTabControl->currentPage(); + TQWidget *widget = mTabControl->currentPage(); return ( !widget ? -1 : d->mPageToInt[widget] ); } else { @@ -662,7 +662,7 @@ int KJanusWidget::activePageIndex() const } -int KJanusWidget::pageIndex( QWidget *widget ) const +int KJanusWidget::pageIndex( TQWidget *widget ) const { if( !widget ) { @@ -677,9 +677,9 @@ int KJanusWidget::pageIndex( QWidget *widget ) const // // The user gets the real page widget with addVBoxPage(), addHBoxPage() // and addGridPage() but not with addPage() which returns a child of - // the toplevel page. addPage() returns a QFrame so I check for that. + // the toplevel page. addPage() returns a TQFrame so I check for that. // - if( widget->isA("QFrame") ) + if( widget->isA("TQFrame") ) { return d->mPageToInt[widget->parentWidget()]; } @@ -699,14 +699,14 @@ void KJanusWidget::slotFontChanged() if( mTitleLabel ) { mTitleLabel->setFont( KGlobalSettings::generalFont() ); - QFont titleFont( mTitleLabel->font() ); + TQFont titleFont( mTitleLabel->font() ); titleFont.setBold( true ); mTitleLabel->setFont( titleFont ); } if( mFace == IconList ) { - QFont listFont( mIconList->font() ); + TQFont listFont( mIconList->font() ); listFont.setBold( true ); mIconList->setFont( listFont ); mIconList->invalidateHeight(); @@ -715,7 +715,7 @@ void KJanusWidget::slotFontChanged() } // makes the treelist behave like the list of kcontrol -void KJanusWidget::slotItemClicked(QListViewItem *it) +void KJanusWidget::slotItemClicked(TQListViewItem *it) { if(it && (it->childCount()>0)) it->setOpen(!it->isOpen()); @@ -747,18 +747,18 @@ void KJanusWidget::setFocus() } -QSize KJanusWidget::minimumSizeHint() const +TQSize KJanusWidget::minimumSizeHint() const { if( mFace == TreeList || mFace == IconList ) { - QSize s1( KDialog::spacingHint(), KDialog::spacingHint()*2 ); - QSize s2(0,0); - QSize s3(0,0); - QSize s4( mPageStack->sizeHint() ); + TQSize s1( KDialog::spacingHint(), KDialog::spacingHint()*2 ); + TQSize s2(0,0); + TQSize s3(0,0); + TQSize s4( mPageStack->sizeHint() ); if( mFace == TreeList ) { - s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); + s1.rwidth() += style().pixelMetric( TQStyle::PM_SplitterWidth ); s2 = mTreeList->minimumSize(); } else @@ -780,7 +780,7 @@ QSize KJanusWidget::minimumSizeHint() const int h1 = s1.rheight() + s3.rheight() + s4.height(); int h2 = QMAX( h1, s2.rheight() ); - return QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ); + return TQSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ); } else if( mFace == Tabbed ) { @@ -796,13 +796,13 @@ QSize KJanusWidget::minimumSizeHint() const } else { - return QSize( 100, 100 ); // Should never happen though. + return TQSize( 100, 100 ); // Should never happen though. } } -QSize KJanusWidget::sizeHint() const +TQSize KJanusWidget::sizeHint() const { return minimumSizeHint(); } @@ -813,7 +813,7 @@ void KJanusWidget::setTreeListAutoResize( bool state ) if( mFace == TreeList ) { mTreeListResizeMode = !state ? - QSplitter::KeepSize : QSplitter::Stretch; + TQSplitter::KeepSize : TQSplitter::Stretch; if( d->mSplitter ) d->mSplitter->setResizeMode( d->mListFrame, mTreeListResizeMode ); } @@ -845,42 +845,42 @@ void KJanusWidget::unfoldTreeList( bool persist ) if( mFace == TreeList ) { if( persist ) - connect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); + connect( mTreeList, TQT_SIGNAL( collapsed( TQListViewItem * ) ), this, TQT_SLOT( slotReopen( TQListViewItem * ) ) ); else - disconnect( mTreeList, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( slotReopen( QListViewItem * ) ) ); + disconnect( mTreeList, TQT_SIGNAL( collapsed( TQListViewItem * ) ), this, TQT_SLOT( slotReopen( TQListViewItem * ) ) ); - for( QListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) + for( TQListViewItem * item = mTreeList->firstChild(); item; item = item->itemBelow() ) item->setOpen( true ); } } -void KJanusWidget::addWidgetBelowList( QWidget * widget ) +void KJanusWidget::addWidgetBelowList( TQWidget * widget ) { if( ( mFace == TreeList || mFace == IconList ) && d->mListFrame ) { - widget->reparent( d->mListFrame, QPoint() ); + widget->reparent( d->mListFrame, TQPoint() ); } } -void KJanusWidget::addButtonBelowList( const QString & text, QObject * recv, const char * slot ) +void KJanusWidget::addButtonBelowList( const TQString & text, TQObject * recv, const char * slot ) { if( ( mFace == TreeList || mFace == IconList ) && d->mListFrame ) { - QPushButton * button = new QPushButton( text, d->mListFrame, "KJanusWidget::buttonBelowList" ); - connect( button, SIGNAL( clicked() ), recv, slot ); + TQPushButton * button = new TQPushButton( text, d->mListFrame, "KJanusWidget::buttonBelowList" ); + connect( button, TQT_SIGNAL( clicked() ), recv, slot ); } } -void KJanusWidget::addButtonBelowList( const KGuiItem & item, QObject * recv, const char * slot ) +void KJanusWidget::addButtonBelowList( const KGuiItem & item, TQObject * recv, const char * slot ) { if( ( mFace == TreeList || mFace == IconList ) && d->mListFrame ) { KPushButton * button = new KPushButton( item, d->mListFrame, "KJanusWidget::buttonBelowList" ); - connect( button, SIGNAL( clicked() ), recv, slot ); + connect( button, TQT_SIGNAL( clicked() ), recv, slot ); } } -void KJanusWidget::showEvent( QShowEvent * ) +void KJanusWidget::showEvent( TQShowEvent * ) { if( mFace == TreeList ) { @@ -895,9 +895,9 @@ void KJanusWidget::showEvent( QShowEvent * ) // It should be obvious that this eventfilter must only be // be installed on the vertical scrollbar of the mIconList. // -bool KJanusWidget::eventFilter( QObject *o, QEvent *e ) +bool KJanusWidget::eventFilter( TQObject *o, TQEvent *e ) { - if( e->type() == QEvent::Show ) + if( e->type() == TQEvent::Show ) { IconListItem *item = (IconListItem*)mIconList->item(0); if( item ) @@ -907,7 +907,7 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e ) mIconList->setFixedWidth( lw+sw+mIconList->frameWidth()*2 ); } } - else if( e->type() == QEvent::Hide ) + else if( e->type() == TQEvent::Hide ) { IconListItem *item = (IconListItem*)mIconList->item(0); if( item ) @@ -916,7 +916,7 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e ) mIconList->setFixedWidth( lw+mIconList->frameWidth()*2 ); } } - return QWidget::eventFilter( o, e ); + return TQWidget::eventFilter( o, e ); } @@ -926,7 +926,7 @@ bool KJanusWidget::eventFilter( QObject *o, QEvent *e ) // -KJanusWidget::IconListBox::IconListBox( QWidget *parent, const char *name, +KJanusWidget::IconListBox::IconListBox( TQWidget *parent, const char *name, WFlags f ) :KListBox( parent, name, f ), mShowAll(false), mHeightValid(false), mWidthValid(false) @@ -939,7 +939,7 @@ void KJanusWidget::IconListBox::updateMinimumHeight() if( mShowAll && !mHeightValid ) { int h = frameWidth()*2; - for( QListBoxItem *i = item(0); i; i = i->next() ) + for( TQListBoxItem *i = item(0); i; i = i->next() ) { h += i->height( this ); } @@ -954,13 +954,13 @@ void KJanusWidget::IconListBox::updateWidth() if( !mWidthValid ) { int maxWidth = 10; - for( QListBoxItem *i = item(0); i; i = i->next() ) + for( TQListBoxItem *i = item(0); i; i = i->next() ) { int w = ((IconListItem *)i)->width(this); maxWidth = QMAX( w, maxWidth ); } - for( QListBoxItem *i = item(0); i; i = i->next() ) + for( TQListBoxItem *i = item(0); i; i = i->next() ) { ((IconListItem *)i)->expandMinimumWidth( maxWidth ); } @@ -996,9 +996,9 @@ void KJanusWidget::IconListBox::setShowAll( bool showAll ) -KJanusWidget::IconListItem::IconListItem( QListBox *listbox, const QPixmap &pixmap, - const QString &text ) - : QListBoxItem( listbox ) +KJanusWidget::IconListItem::IconListItem( TQListBox *listbox, const TQPixmap &pixmap, + const TQString &text ) + : TQListBoxItem( listbox ) { mPixmap = pixmap; if( mPixmap.isNull() ) @@ -1017,19 +1017,19 @@ int KJanusWidget::IconListItem::expandMinimumWidth( int width ) } -const QPixmap &KJanusWidget::IconListItem::defaultPixmap() +const TQPixmap &KJanusWidget::IconListItem::defaultPixmap() { - static QPixmap *pix=0; + static TQPixmap *pix=0; if( !pix ) { - pix = new QPixmap( 32, 32 ); - QPainter p( pix ); + pix = new TQPixmap( 32, 32 ); + TQPainter p( pix ); p.eraseRect( 0, 0, pix->width(), pix->height() ); p.setPen( Qt::red ); p.drawRect ( 0, 0, pix->width(), pix->height() ); p.end(); - QBitmap mask( pix->width(), pix->height(), true ); + TQBitmap mask( pix->width(), pix->height(), true ); mask.fill( Qt::black ); p.begin( &mask ); p.setPen( Qt::white ); @@ -1042,9 +1042,9 @@ const QPixmap &KJanusWidget::IconListItem::defaultPixmap() } -void KJanusWidget::IconListItem::paint( QPainter *painter ) +void KJanusWidget::IconListItem::paint( TQPainter *painter ) { - QFontMetrics fm = painter->fontMetrics(); + TQFontMetrics fm = painter->fontMetrics(); int ht = fm.boundingRect( 0, 0, 0, 0, Qt::AlignCenter, text() ).height(); int wp = mPixmap.width(); int hp = mPixmap.height(); @@ -1056,7 +1056,7 @@ void KJanusWidget::IconListItem::paint( QPainter *painter ) } } -int KJanusWidget::IconListItem::height( const QListBox *lb ) const +int KJanusWidget::IconListItem::height( const TQListBox *lb ) const { if( text().isEmpty() ) { @@ -1070,7 +1070,7 @@ int KJanusWidget::IconListItem::height( const QListBox *lb ) const } -int KJanusWidget::IconListItem::width( const QListBox *lb ) const +int KJanusWidget::IconListItem::width( const TQListBox *lb ) const { int wt = lb->fontMetrics().boundingRect( 0, 0, 0, 0, Qt::AlignCenter, text() ).width() + 10; int wp = mPixmap.width() + 10; @@ -1084,7 +1084,7 @@ void KJanusWidget::virtual_hook( int, void* ) // TODO: In TreeList, if the last child of a node is removed, and there is no corrsponding widget for that node, allow the caller to // delete the node. -void KJanusWidget::removePage( QWidget *page ) +void KJanusWidget::removePage( TQWidget *page ) { if (!d || !d->mPageToInt.contains(page)) return; @@ -1093,7 +1093,7 @@ void KJanusWidget::removePage( QWidget *page ) if ( mFace == TreeList ) { - QMap<QListViewItem*, QWidget *>::Iterator i; + TQMap<TQListViewItem*, TQWidget *>::Iterator i; for( i = mTreeListToPageStack.begin(); i != mTreeListToPageStack.end(); ++i ) if (i.data()==page) { @@ -1108,7 +1108,7 @@ void KJanusWidget::removePage( QWidget *page ) } else if ( mFace == IconList ) { - QMap<QListBoxItem*, QWidget *>::Iterator i; + TQMap<TQListBoxItem*, TQWidget *>::Iterator i; for( i = mIconListToPageStack.begin(); i != mIconListToPageStack.end(); ++i ) if (i.data()==page) { @@ -1129,15 +1129,15 @@ void KJanusWidget::removePage( QWidget *page ) } } -QString KJanusWidget::pageTitle(int index) const +TQString KJanusWidget::pageTitle(int index) const { if (!d || !d->mIntToTitle.contains(index)) - return QString::null; + return TQString::null; else return d->mIntToTitle[index]; } -QWidget *KJanusWidget::pageWidget(int index) const +TQWidget *KJanusWidget::pageWidget(int index) const { if (!d || !d->mIntToPage.contains(index)) return 0; |