summaryrefslogtreecommitdiffstats
path: root/kdgantt/KDGanttViewSubwidgets.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kdgantt/KDGanttViewSubwidgets.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdgantt/KDGanttViewSubwidgets.cpp')
-rw-r--r--kdgantt/KDGanttViewSubwidgets.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/kdgantt/KDGanttViewSubwidgets.cpp b/kdgantt/KDGanttViewSubwidgets.cpp
index b6dabe2b..197ba18b 100644
--- a/kdgantt/KDGanttViewSubwidgets.cpp
+++ b/kdgantt/KDGanttViewSubwidgets.cpp
@@ -27,8 +27,8 @@
** licensing are not clear to you.
**
** As a special exception, permission is given to link this program
- ** with any edition of Qt, and distribute the resulting executable,
- ** without including the source code for Qt in the source distribution.
+ ** with any edition of TQt, and distribute the resulting executable,
+ ** without including the source code for TQt in the source distribution.
**
**********************************************************************/
@@ -58,19 +58,19 @@
#include <kcalendarsystem.h>
#include <kdebug.h>
-KDTimeTableWidget:: KDTimeTableWidget( TQWidget* parent,KDGanttView* myGantt)
- : TQCanvas (parent)
+KDTimeTableWidget:: KDTimeTableWidget( TQWidget* tqparent,KDGanttView* myGantt)
+ : TQCanvas (tqparent)
{
myGanttView = myGantt;
taskLinksVisible = true;
flag_blockUpdating = false;
int_blockUpdating = 0;
- gridPen.setStyle(Qt::DotLine);
+ gridPen.setStyle(TQt::DotLine);
gridPen.setColor(TQColor(100,100,100));
maximumComputedGridHeight = 0;
denseLineCount = 0;
denseLineBrush = TQBrush( TQColor ( 240,240,240 ));
- noInfoLineBrush = TQBrush( TQColor ( 100,100,100 ), Qt::FDiagPattern );
+ noInfoLineBrush = TQBrush( TQColor ( 100,100,100 ), TQt::FDiagPattern );
pendingHeight = 0;
pendingWidth = 0;
retune(256);
@@ -514,7 +514,7 @@ void KDTimeTableWidget::computeDenseLines()
denseLine->setSize( wid, temp->height());
}
if (denseLine->brush() != denseLineBrush ) {
- denseLine->setPen( TQPen( Qt::NoPen ) );
+ denseLine->setPen( TQPen( TQt::NoPen ) );
denseLine->setBrush( denseLineBrush);
}
if (!denseLine->isVisible() )
@@ -555,7 +555,7 @@ void KDTimeTableWidget::computeShowNoInformation()
}
noInfoLine->move( 0, temp->itemPos() );
noInfoLine->setSize( wid, temp->height());
- noInfoLine->setPen( TQPen( Qt::NoPen ) );
+ noInfoLine->setPen( TQPen( TQt::NoPen ) );
noInfoLine->setBrush( noInfoLineBrush);
noInfoLine->show();
}
@@ -695,8 +695,8 @@ int KDTimeTableWidget::getCoordX( TQDateTime dt ) {
/* ***************************************************************
KDTimeHeaderWidget:: KDTimeHeaderWidget
***************************************************************** */
-KDTimeHeaderWidget:: KDTimeHeaderWidget( TQWidget* parent,KDGanttView* gant )
- : TQWidget (parent)
+KDTimeHeaderWidget:: KDTimeHeaderWidget( TQWidget* tqparent,KDGanttView* gant )
+ : TQWidget (tqparent)
{
myToolTip = new KDTimeHeaderToolTip(this,this);
mySizeHint = 0;
@@ -770,7 +770,7 @@ KDTimeHeaderWidget:: KDTimeHeaderWidget( TQWidget* parent,KDGanttView* gant )
flagDoNotRepaintAfterChange = false;
setShowPopupMenu(false,false,false,false,false,false,false);
for (int j =1;j<8;++j)
- weekdayColor[j] = Qt::white;
+ weekdayColor[j] = TQt::white;
myMinimumWidth = 0;
mouseDown = false;
beginMouseDown = 0;
@@ -1636,7 +1636,7 @@ bool KDTimeHeaderWidget::getColumnColor(TQColor& col,int coordLow, int coordHigh
start = getDateTimeForIndex((coordLow+coordHigh)/2);
int day = start.date().dayOfWeek ();
//checkweekdaycolor
- if (weekdayColor[day] != Qt::white) {
+ if (weekdayColor[day] != TQt::white) {
col = weekdayColor[day];
return true;
}
@@ -1915,7 +1915,7 @@ void KDTimeHeaderWidget::tqrepaintMe(int left,int paintwid, TQPainter* painter)
for ( it = minorText.begin(); it != minorText.end(); ++it ) {
if (i*wid1 >= left-wid1 && i*wid1 <= left+paintwid) {
qDrawShadeLine ( p,i*wid1-offsetLeft ,hei1-1, i*wid1-offsetLeft, hei2, qcg, true, lwid, 1 );
- p->drawText(i*wid1+1-offsetLeft,hei1+1,wid1-1,hei2-hei1,Qt::AlignCenter,(*it));
+ p->drawText(i*wid1+1-offsetLeft,hei1+1,wid1-1,hei2-hei1,TQt::AlignCenter,(*it));
}
++i;
}
@@ -2135,8 +2135,8 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
qDebug(" RealScale == Auto : This may not be! ");
break;
}
- tqitemRectMinor = p.boundingRect ( 10, 10, 2, 2, Qt::AlignLeft,testTextMinor);
- tqitemRectMajor = p.boundingRect ( 10, 10, 2, 2, Qt::AlignLeft,testTextMajor);
+ tqitemRectMinor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMinor);
+ tqitemRectMajor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMajor);
p.end();
//qDebug(" tempMinorScaleCount %d ", tempMinorScaleCount);
Height = tqitemRectMinor.height()+tqitemRectMajor.height()+11;
@@ -2537,10 +2537,10 @@ void KDTimeHeaderWidget::mouseMoveEvent ( TQMouseEvent * e )
/* ***************************************************************
KDLegendWidget:: KDLegendWidget
***************************************************************** */
-KDLegendWidget:: KDLegendWidget( TQWidget* parent,
+KDLegendWidget:: KDLegendWidget( TQWidget* tqparent,
KDGanttMinimizeSplitter* legendParent ) :
KDGanttSemiSizingControl ( KDGanttSemiSizingControl::Before, Vertical,
- parent)
+ tqparent)
{
myLegendParent = legendParent;
dock = 0;
@@ -2645,10 +2645,10 @@ void KDLegendWidget::clearLegend ( )
{
if ( myLegend ) delete myLegend;
if ( dock )
- myLegend = new TQGroupBox( 1, Qt::Horizontal, scroll->viewport() );
+ myLegend = new TQGroupBox( 1, TQt::Horizontal, scroll->viewport() );
else
- myLegend = new TQGroupBox( 1, Qt::Horizontal, i18n( "Legend" ), scroll->viewport() );
- myLegend->setBackgroundColor( Qt::white );
+ myLegend = new TQGroupBox( 1, TQt::Horizontal, i18n( "Legend" ), scroll->viewport() );
+ myLegend->setBackgroundColor( TQt::white );
myLegend->setFont( font() );
scroll->addChild( myLegend );
scroll->setResizePolicy( TQScrollView::AutoOneFit );
@@ -2664,16 +2664,16 @@ void KDLegendWidget::clearLegend ( )
void KDLegendWidget::addLegendItem( KDGanttViewItem::Shape tqshape, const TQColor& tqshapeColor, const TQString& text )
{
TQLabel * temp;
- TQPixmap p = KDGanttView::getPixmap( tqshape, tqshapeColor, Qt::white, 10);
+ TQPixmap p = KDGanttView::getPixmap( tqshape, tqshapeColor, TQt::white, 10);
TQWidget *w = new TQWidget( myLegend );
- w->setBackgroundColor( Qt::white );
+ w->setBackgroundColor( TQt::white );
TQHBoxLayout *lay = new TQHBoxLayout( w ,0, 6);
temp = new TQLabel ( w );
- lay->addWidget( temp, 0, Qt:: AlignRight);
+ lay->addWidget( temp, 0, TQt:: AlignRight);
temp->setPixmap(p);
temp = new TQLabel ( text, w );
- temp->setBackgroundColor( Qt::white );
- lay->addWidget( temp, 0, Qt:: AlignLeft);
+ temp->setBackgroundColor( TQt::white );
+ lay->addWidget( temp, 0, TQt:: AlignLeft);
lay->addStretch();
if ( dock )
scroll->setMaximumHeight( 32000 );
@@ -2688,7 +2688,7 @@ bool KDLegendWidget::isShown ( )
}
-KDListView::KDListView(TQWidget* parent, KDGanttView* gantView):TQListView (parent)
+KDListView::KDListView(TQWidget* tqparent, KDGanttView* gantView):TQListView (tqparent)
{
myGanttView = gantView;
setAcceptDrops(true);
@@ -2781,7 +2781,7 @@ void KDListView::drawToPainter ( TQPainter * p, bool drawHeader )
return;
}
// Draw headers
- TQPen pen = TQPen(Qt::lightGray, 1);
+ TQPen pen = TQPen(TQt::lightGray, 1);
p->save();
TQHeader *h = header();
for (int s = 0; s < h->count(); ++s) {
@@ -2790,7 +2790,7 @@ void KDListView::drawToPainter ( TQPainter * p, bool drawHeader )
p->translate(0, -r.height());
}
//kdDebug()<<s<<": "<<h->label(s)<<" "<<r<<endl;
- p->drawText(r.x()+2, r.y(), r.width()-2, r.height(), columnAlignment(s)|Qt::AlignVCenter, h->label(s), -1);
+ p->drawText(r.x()+2, r.y(), r.width()-2, r.height(), columnAlignment(s)|TQt::AlignVCenter, h->label(s), -1);
p->save();
p->setPen(pen);
p->drawRect(r.x(), r.y()+1, r.width(), r.height()-2);
@@ -2921,7 +2921,7 @@ void KDListView::drawAllContents(TQPainter * p, int cx, int cy, int cw, int ch)
if ( tx < 0 )
tx = header()->cellPos( cell );
- // do any children of current need to be painted?
+ // do any tqchildren of current need to be painted?
/* FIXME: painting branches doesn't work for some reason...
if ( ih != ith &&
rootIsDecorated() &&
@@ -2936,10 +2936,10 @@ void KDListView::drawAllContents(TQPainter * p, int cx, int cy, int cw, int ch)
int rleft = tx + current->l*treeStepSize();
int rright = rleft + treeStepSize();
- int crtop = QMAX( rtop, cy );
- int crbottom = QMIN( rbottom, cy+ch );
- int crleft = QMAX( rleft, cx );
- int crright = QMIN( rright, cx+cw );
+ int crtop = TQMAX( rtop, cy );
+ int crbottom = TQMIN( rbottom, cy+ch );
+ int crleft = TQMAX( rleft, cx );
+ int crright = TQMIN( rright, cx+cw );
r.setRect( crleft, crtop,
crright-crleft, crbottom-crtop );
@@ -2991,13 +2991,13 @@ void KDListView::dragMoveEvent ( TQDragMoveEvent * e)
}
if ( e->source() == myGanttView && gItem ){
// internal drag - do not allow to drag the item to a subitem of itself
- KDGanttViewItem* pItem = gItem->parent();
+ KDGanttViewItem* pItem = gItem->tqparent();
while ( pItem ) {
if ( pItem == myGanttView->myCanvasView->lastClickedItem ) {
e->accept( false );
return;
}
- pItem = pItem->parent();
+ pItem = pItem->tqparent();
}
if ( gItem == myGanttView->myCanvasView->lastClickedItem ) {
e->accept( false );
@@ -3091,69 +3091,69 @@ void KDListView::startDrag ()
}
KDCanvasText::KDCanvasText( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
TQCanvasText(canvas)
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasLine::KDCanvasLine( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
TQCanvasLine(canvas)
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasPolygonItem::KDCanvasPolygonItem( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
TQCanvasPolygonalItem( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasPolygon::KDCanvasPolygon( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
TQCanvasPolygon( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasEllipse::KDCanvasEllipse( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
TQCanvasEllipse( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasRectangle::KDCanvasRectangle( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
TQCanvasRectangle( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
-KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,TQCanvas* canvas, TQWidget* parent, const
- char* name ) : TQCanvasView ( canvas, parent, name ),
+KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,TQCanvas* canvas, TQWidget* tqparent, const
+ char* name ) : TQCanvasView ( canvas, tqparent, name ),
movingGVItem( 0 ),
scrollBarTimer( 0, "scrollBarTimer" )
{
@@ -3311,20 +3311,20 @@ void KDGanttCanvasView::insertItemAsRoot( KDGanttViewItem* item )
if ( item == cuttedItem )
cuttedItem = 0;
}
-void KDGanttCanvasView::insertItemAsChild( KDGanttViewItem* parent, KDGanttViewItem* item )
+void KDGanttCanvasView::insertItemAsChild( KDGanttViewItem* tqparent, KDGanttViewItem* item )
{
- parent->insertItem( cuttedItem );
+ tqparent->insertItem( cuttedItem );
if ( item == cuttedItem )
cuttedItem = 0;
}
-void KDGanttCanvasView::insertItemAfter( KDGanttViewItem* parent , KDGanttViewItem* item )
+void KDGanttCanvasView::insertItemAfter( KDGanttViewItem* tqparent , KDGanttViewItem* item )
{
- if ( parent->parent() ) {
- parent->parent()->insertItem( item );
+ if ( tqparent->tqparent() ) {
+ tqparent->tqparent()->insertItem( item );
}
else
mySignalSender->myListView->insertItem( item );
- item->moveItem( parent );
+ item->moveItem( tqparent );
if ( item == cuttedItem )
cuttedItem = 0;
}
@@ -3332,9 +3332,9 @@ void KDGanttCanvasView::insertItemAfter( KDGanttViewItem* parent , KDGanttViewI
void KDGanttCanvasView::cutItem()
{
lastClickedItem->hideSubtree();
- //qDebug("last clicked %d parent %d ", lastClickedItem , lastClickedItem->parent());
- if ( lastClickedItem->parent() )
- lastClickedItem->parent()->takeItem(lastClickedItem);
+ //qDebug("last clicked %d tqparent %d ", lastClickedItem , lastClickedItem->tqparent());
+ if ( lastClickedItem->tqparent() )
+ lastClickedItem->tqparent()->takeItem(lastClickedItem);
else
mySignalSender->myListView->takeItem( lastClickedItem );
mySignalSender->myTimeTable->updateMyContent();
@@ -3370,8 +3370,8 @@ void KDGanttCanvasView::pasteItem( int type )
lastClickedItem->insertItem( cuttedItem );
break;
case 2://after
- if ( lastClickedItem->parent() ) {
- lastClickedItem->parent()->insertItem( cuttedItem );
+ if ( lastClickedItem->tqparent() ) {
+ lastClickedItem->tqparent()->insertItem( cuttedItem );
}
else
mySignalSender->myListView->insertItem( cuttedItem );
@@ -3418,20 +3418,20 @@ void KDGanttCanvasView::newChildItem( int type )
temp = new KDGanttViewTaskItem( lastClickedItem, i18n( "New Task" ) );
break;
case 5:
- if ( lastClickedItem->parent() )
- temp = new KDGanttViewEventItem( lastClickedItem->parent(), lastClickedItem, i18n( "New Event" ) );
+ if ( lastClickedItem->tqparent() )
+ temp = new KDGanttViewEventItem( lastClickedItem->tqparent(), lastClickedItem, i18n( "New Event" ) );
else
temp = new KDGanttViewEventItem( mySignalSender, lastClickedItem, i18n( "New Event" ) );
break;
case 4:
- if ( lastClickedItem->parent() )
- temp = new KDGanttViewSummaryItem( lastClickedItem->parent(), lastClickedItem, i18n( "New Summary" ) );
+ if ( lastClickedItem->tqparent() )
+ temp = new KDGanttViewSummaryItem( lastClickedItem->tqparent(), lastClickedItem, i18n( "New Summary" ) );
else
temp = new KDGanttViewSummaryItem( mySignalSender, lastClickedItem, i18n( "New Summary" ) );
break;
case 6:
- if ( lastClickedItem->parent() )
- temp = new KDGanttViewTaskItem( lastClickedItem->parent(), lastClickedItem, i18n( "New Task" ) );
+ if ( lastClickedItem->tqparent() )
+ temp = new KDGanttViewTaskItem( lastClickedItem->tqparent(), lastClickedItem, i18n( "New Task" ) );
else
temp = new KDGanttViewTaskItem( mySignalSender, lastClickedItem, i18n( "New Task" ) );
break;
@@ -3935,7 +3935,7 @@ void KDGanttCanvasView::slotScrollTimer() {
if (my < 0)
dy = -5;
else if (my > visibleHeight())
- dy = QMIN(5, verticalScrollBar()->maxValue()-verticalScrollBar()->value());
+ dy = TQMIN(5, verticalScrollBar()->maxValue()-verticalScrollBar()->value());
if (dx != 0 || dy != 0)
scrollBy(dx, dy);
@@ -3984,7 +3984,7 @@ int KDGanttCanvasView::getLinkType(int from, int to) {
/*!
Represents the background color for a given interval of time (across all tasks).
\sa KDGanttView::addIntervalBackgroundColor
- \param view parent view
+ \param view tqparent view
*/
KDIntervalColorRectangle::KDIntervalColorRectangle( KDGanttView* view )
: KDCanvasRectangle( view->timeTableWidget(), 0, Type_is_KDGanttGridItem ),