diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /kdevdesigner/designer/workspace.cpp | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdevdesigner/designer/workspace.cpp')
-rw-r--r-- | kdevdesigner/designer/workspace.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/kdevdesigner/designer/workspace.cpp b/kdevdesigner/designer/workspace.cpp index 9977c2ab..fe62a4ec 100644 --- a/kdevdesigner/designer/workspace.cpp +++ b/kdevdesigner/designer/workspace.cpp @@ -1,15 +1,15 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** -** This file is part of Qt Designer. +** This file is part of TQt Designer. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @@ -17,7 +17,7 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. +** information about TQt Commercial License Agreements. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. @@ -53,8 +53,8 @@ #include <klocale.h> -WorkspaceItem::WorkspaceItem( TQListView *parent, Project* p ) - : TQListViewItem( parent ) +WorkspaceItem::WorkspaceItem( TQListView *tqparent, Project* p ) + : TQListViewItem( tqparent ) { init(); project = p; @@ -63,8 +63,8 @@ WorkspaceItem::WorkspaceItem( TQListView *parent, Project* p ) setExpandable( FALSE ); } -WorkspaceItem::WorkspaceItem( TQListViewItem *parent, SourceFile* sf ) - : TQListViewItem( parent ) +WorkspaceItem::WorkspaceItem( TQListViewItem *tqparent, SourceFile* sf ) + : TQListViewItem( tqparent ) { init(); sourceFile = sf; @@ -72,8 +72,8 @@ WorkspaceItem::WorkspaceItem( TQListViewItem *parent, SourceFile* sf ) setPixmap( 0, SmallIcon( "designer_filenew.png" , KDevDesignerPartFactory::instance()) ); } -WorkspaceItem::WorkspaceItem( TQListViewItem *parent, TQObject *o, Project *p ) - : TQListViewItem( parent ) +WorkspaceItem::WorkspaceItem( TQListViewItem *tqparent, TQObject *o, Project *p ) + : TQListViewItem( tqparent ) { init(); object = o; @@ -84,8 +84,8 @@ WorkspaceItem::WorkspaceItem( TQListViewItem *parent, TQObject *o, Project *p ) listView(), TQT_SLOT( update() ) ); } -WorkspaceItem::WorkspaceItem( TQListViewItem *parent, FormFile* ff, Type type ) - : TQListViewItem( parent ) +WorkspaceItem::WorkspaceItem( TQListViewItem *tqparent, FormFile* ff, Type type ) + : TQListViewItem( tqparent ) { init(); formFile = ff; @@ -115,16 +115,16 @@ void WorkspaceItem::paintCell( TQPainter *p, const TQColorGroup &cg, int column, { TQColorGroup g( cg ); g.setColor( TQColorGroup::Base, backgroundColor() ); - g.setColor( TQColorGroup::Foreground, Qt::black ); + g.setColor( TQColorGroup::Foreground, TQt::black ); if ( type() == FormSourceType && ( !formFile->hasFormCode() || ( formFile->codeFileState() == FormFile::Deleted && formFile->formWindow() ) ) && - parent() && parent()->parent() && ( (WorkspaceItem*)parent()->parent() )->project && - ( (WorkspaceItem*)parent()->parent() )->project->isCpp() ) { - g.setColor( TQColorGroup::Text, listView()->palette().disabled().color( TQColorGroup::Text) ); - g.setColor( TQColorGroup::HighlightedText, listView()->palette().disabled().color( TQColorGroup::Text) ); + tqparent() && tqparent()->tqparent() && ( (WorkspaceItem*)tqparent()->tqparent() )->project && + ( (WorkspaceItem*)tqparent()->tqparent() )->project->isCpp() ) { + g.setColor( TQColorGroup::Text, listView()->tqpalette().disabled().color( TQColorGroup::Text) ); + g.setColor( TQColorGroup::HighlightedText, listView()->tqpalette().disabled().color( TQColorGroup::Text) ); } else { - g.setColor( TQColorGroup::Text, Qt::black ); + g.setColor( TQColorGroup::Text, TQt::black ); } p->save(); @@ -177,7 +177,7 @@ TQString WorkspaceItem::text( int column ) const return project->qualifiedName( object ); } - return TQString::null; // shut up compiler + return TQString(); // shut up compiler } void WorkspaceItem::fillCompletionList( TQStringList& completion ) @@ -252,8 +252,8 @@ TQString WorkspaceItem::key( int column, bool ) const TQColor WorkspaceItem::backgroundColor() { bool b = useOddColor; - if ( t == FormSourceType && parent() ) - b = ( ( WorkspaceItem*)parent() )->useOddColor; + if ( t == FormSourceType && tqparent() ) + b = ( ( WorkspaceItem*)tqparent() )->useOddColor; return b ? *backColor2 : *backColor1; } @@ -270,8 +270,8 @@ void WorkspaceItem::setAutoOpen( bool b ) autoOpen = b; } -Workspace::Workspace( TQWidget *parent, MainWindow *mw ) - : TQListView( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | +Workspace::Workspace( TQWidget *tqparent, MainWindow *mw ) + : TQListView( tqparent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_Tool | WStyle_MinMax | WStyle_SysMenu ), mainWindow( mw ), project( 0 ), completionDirty( FALSE ) { @@ -284,7 +284,7 @@ Workspace::Workspace( TQWidget *parent, MainWindow *mw ) header()->hide(); setSorting( 0 ); setResizePolicy( TQScrollView::Manual ); -#ifndef Q_WS_MAC +#ifndef TQ_WS_MAC TQPalette p( palette() ); p.setColor( TQColorGroup::Base, TQColor( *backColor2 ) ); (void)*selectedBack; // hack @@ -419,9 +419,9 @@ void Workspace::update( FormFile* ff ) { TQListViewItem* i = findItem( ff ); if ( i ) { - i->repaint(); + i->tqrepaint(); if ( (i = i->firstChild()) ) - i->repaint(); + i->tqrepaint(); } } @@ -499,7 +499,7 @@ void Workspace::closeAutoOpenItems() TQListViewItemIterator it( this ); for ( ; it.current(); ++it ) { WorkspaceItem* i = (WorkspaceItem*) it.current(); - WorkspaceItem* ip = (WorkspaceItem*) i->parent(); + WorkspaceItem* ip = (WorkspaceItem*) i->tqparent(); if ( i->type() == WorkspaceItem::FormSourceType ) { if ( !i->isSelected() && !ip->isSelected() && ip->isAutoOpen() ) { @@ -523,7 +523,7 @@ void Workspace::itemDoubleClicked( TQListViewItem *i ) void Workspace::itemClicked( int button, TQListViewItem *i, const TQPoint& ) { - if ( !i || button != LeftButton ) + if ( !i || button != Qt::LeftButton ) return; closeAutoOpenItems(); @@ -640,7 +640,7 @@ void Workspace::rmbClicked( TQListViewItem *i, const TQPoint& pos ) case OPEN_SOURCE: case OPEN_FORM: case OPEN_FORM_SOURCE: - itemClicked( LeftButton, i, pos ); + itemClicked( Qt::LeftButton, i, pos ); break; } } @@ -648,12 +648,12 @@ void Workspace::rmbClicked( TQListViewItem *i, const TQPoint& pos ) bool Workspace::eventFilter( TQObject *o, TQEvent * e ) { // Reggie, on what type of events do we have to execute updateBufferEdit() - if ( o ==bufferEdit && e->type() != TQEvent::ChildRemoved ) + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(bufferEdit) && e->type() != TQEvent::ChildRemoved ) updateBufferEdit(); return TQListView::eventFilter( o, e ); } -void Workspace::setBufferEdit( QCompletionEdit *edit ) +void Workspace::setBufferEdit( TQCompletionEdit *edit ) { bufferEdit = edit; connect( bufferEdit, TQT_SIGNAL( chosen( const TQString & ) ), @@ -681,7 +681,7 @@ void Workspace::bufferChosen( const TQString &buffer ) if ( bufferEdit ) bufferEdit->setText( "" ); - if ( MainWindow::self->projectFileNames().contains( buffer ) ) { + if ( MainWindow::self->projectFileNames().tqcontains( buffer ) ) { MainWindow::self->setCurrentProjectByFilename( buffer ); return; } @@ -689,7 +689,7 @@ void Workspace::bufferChosen( const TQString &buffer ) TQListViewItemIterator it( this ); while ( it.current() ) { if ( ( (WorkspaceItem*)it.current())->checkCompletion( buffer ) ) { - itemClicked( LeftButton, it.current(), TQPoint() ); + itemClicked( Qt::LeftButton, it.current(), TQPoint() ); break; } ++it; |