diff options
Diffstat (limited to 'kdgantt/KDGanttView.cpp')
-rw-r--r-- | kdgantt/KDGanttView.cpp | 206 |
1 files changed, 103 insertions, 103 deletions
diff --git a/kdgantt/KDGanttView.cpp b/kdgantt/KDGanttView.cpp index 1aaa1e468..5a1618a31 100644 --- a/kdgantt/KDGanttView.cpp +++ b/kdgantt/KDGanttView.cpp @@ -41,7 +41,7 @@ #include "itemAttributeDialog.h" #include <tqprinter.h> #include <tqpainter.h> -#include <layout.h> +#include <tqlayout.h> #include <tqpaintdevicemetrics.h> #include <tqfile.h> #include <tqheader.h> @@ -186,7 +186,7 @@ KDGanttView::KDGanttView( TQWidget* parent, const char* name ) fDropEnabled = false; closingBlocked = false; myTimeHeader->computeTicks(); - centerTimelineAfterShow( TQDateTime::currentDateTime () ); + centerTimelineAfterShow( TQDateTime::tqcurrentDateTime () ); setDisplayEmptyTasksAsLine( false ); TQValueList<int> list; list.append(240); @@ -313,12 +313,12 @@ bool KDGanttView::close ( bool alsoDelete ) /*! Returns a useful size for the view. Returned width: - sizeHint().width() of the list view + width of TimeTable + tqsizeHint().width() of the list view + width of TimeTable Returned height: height() of TimeHeader + height() of TimeTable + height() of Legend (if shown) */ -TQSize KDGanttView::sizeHint() const +TQSize KDGanttView::tqsizeHint() const { bool block = myTimeTable->blockUpdating(); myTimeTable->setBlockUpdating( false ); @@ -342,9 +342,9 @@ TQSize KDGanttView::sizeHint() const if ( myLegend->isShown() ) hintHeight += myLegend->legendSizeHint().height() +10; hintHeight += myTimeTable->minimumHeight+myListView->frameWidth()*2+2; - int hintWid = myListView->sizeHint().width(); + int hintWid = myListView->tqsizeHint().width(); //hintWid += myTimeHeader->mySizeHint+myCanvasView->verticalScrollBar()->width(); - hintWid += myCanvasView->sizeHint().width(); + hintWid += myCanvasView->tqsizeHint().width(); // add 10 for the splitter-bars // qDebug("sizehint %d %d ",hintWid+10, hintHeight ); myTimeTable->setBlockUpdating( block ); @@ -532,7 +532,7 @@ void KDGanttView::slotMouseButtonPressed ( int button, TQListViewItem * item, the fastest mode. If Medium, there is extra repainting after releasing the scrollbar. This provides fast scrolling with updated content - after scrolling. Recommended, when repaint problems occur. + after scrolling. Recommended, when tqrepaint problems occur. This is the default value after startup. If Always, there is an extra update after every move of the scrollbar. This entails slow scrolling with updated @@ -615,7 +615,7 @@ void KDGanttView::slotHeaderSizeChanged() // legend is cleared - reinit legend with list legendItem* li; for ( li = myLegendItems->first(); li; li = myLegendItems->next() ) { - myLegend->addLegendItem(li->shape, li->color, li->text ); + myLegend->addLegendItem(li->tqshape, li->color, li->text ); } } } @@ -766,25 +766,25 @@ bool KDGanttView::editable() const /*! - Saves the state of the Gantt view in an IO device in XML format. The saved + Saves the state of the Gantt view in an IO tqdevice in XML format. The saved data can be reloaded with \a loadProject(). - \param device a pointer to the IO device in which to store the Gantt + \param tqdevice a pointer to the IO tqdevice in which to store the Gantt view state. \return true if the data could be written, false if an error occurred \sa loadProject() */ -bool KDGanttView::saveProject( TQIODevice* device ) +bool KDGanttView::saveProject( TQIODevice* tqdevice ) { - Q_ASSERT( device ); + Q_ASSERT( tqdevice ); TQDomDocument doc = saveXML(); - if( device->isOpen() ) - device->close(); - if( device->open( IO_WriteOnly ) ) { - TQTextStream ts( device ); + if( tqdevice->isOpen() ) + tqdevice->close(); + if( tqdevice->open( IO_WriteOnly ) ) { + TQTextStream ts( tqdevice ); ts << doc.toString(); return true; } else @@ -796,30 +796,30 @@ bool KDGanttView::saveProject( TQIODevice* device ) Loads a previously saved state of the Gantt view. All current settings and items are discarded before loading the data. - \param device a pointer to the IO device from which to load the + \param tqdevice a pointer to the IO tqdevice from which to load the Gantt view state. \return true if the file could be read, false if an error occurred \sa saveProject() */ -bool KDGanttView::loadProject( TQIODevice* device ) +bool KDGanttView::loadProject( TQIODevice* tqdevice ) { - Q_ASSERT( device ); + Q_ASSERT( tqdevice ); - if( device->isOpen() ) - device->close(); - if( device->open( IO_ReadOnly ) ) { + if( tqdevice->isOpen() ) + tqdevice->close(); + if( tqdevice->open( IO_ReadOnly ) ) { TQDomDocument doc( "GanttView" ); TQString err; int errline, errcol; - if ( !doc.setContent( device, &err, &errline, &errcol ) ) { + if ( !doc.setContent( tqdevice, &err, &errline, &errcol ) ) { qDebug("KDGantt::Error parsing XML data at line %d. Message is:", errline ); qDebug("%s ", err.latin1()); - device->close(); + tqdevice->close(); return false; } - device->close(); + tqdevice->close(); return loadXML( doc ); } else return false; @@ -868,7 +868,7 @@ void KDGanttView::print( TQPrinter* printer , TQSize size = drawContents( 0, printListView, printTimeLine, printLegend ); // at the top, we want to print current time/date - TQString date = "Printing Time: " + TQDateTime::currentDateTime().toString(); + TQString date = "Printing Time: " + TQDateTime::tqcurrentDateTime().toString(); int hei = p.boundingRect(0,0, 5, 5, TQt::AlignLeft, date ).height(); p.drawText( 0, 0, date ); @@ -1209,7 +1209,7 @@ bool KDGanttView::showTaskLinks() const void KDGanttView::setFont(const TQFont& font) { myListView->setFont(font); - myListView->repaint(); + myListView->tqrepaint(); myTimeHeader->setFont(font); myLegend->setFont( font ); TQWidget::setFont( font ); @@ -1299,21 +1299,21 @@ bool KDGanttView::showTimeTablePopupMenu() const /*! - Sets the shapes for a certain type of Gantt item. Not all items use - all three shapes (e.g., only summary items use the middle shape). + Sets the tqshapes for a certain type of Gantt item. Not all items use + all three tqshapes (e.g., only summary items use the middle tqshape). - This setting overrides any shape settings made on individual items. + This setting overrides any tqshape settings made on individual items. These settings will be taken as initial values of any newly created item of this certain type. See also the documentation of the KDGanttViewItem class. - \param type the type of Gantt items for which to set the shapes - \param start the shape to use for the beginning of the item - \param middle the shape to use for the middle of the item - \param end the shape to use for the end of the item - \param overwriteExisting if true, overwrites existing shape settings + \param type the type of Gantt items for which to set the tqshapes + \param start the tqshape to use for the beginning of the item + \param middle the tqshape to use for the middle of the item + \param end the tqshape to use for the end of the item + \param overwriteExisting if true, overwrites existing tqshape settings in the individual items - \sa shapes() + \sa tqshapes() */ void KDGanttView::setShapes( KDGanttViewItem::Type type, KDGanttViewItem::Shape start, @@ -1337,18 +1337,18 @@ void KDGanttView::setShapes( KDGanttViewItem::Type type, /*! - Queries the shapes for a particular type of Gantt item. + Queries the tqshapes for a particular type of Gantt item. - \param type the type of Gantt items for which to query the shapes - \param start the start shape is returned in this parameter - \param middle the middle shape is returned in this parameter - \param end the end shape is returned in this parameter - \return true if there was a general shape set for the specified - type. If the return value is false, the values of the three shape + \param type the type of Gantt items for which to query the tqshapes + \param start the start tqshape is returned in this parameter + \param middle the middle tqshape is returned in this parameter + \param end the end tqshape is returned in this parameter + \return true if there was a general tqshape set for the specified + type. If the return value is false, the values of the three tqshape parameters are undefined. \sa setShapes() */ -bool KDGanttView::shapes( KDGanttViewItem::Type type, +bool KDGanttView::tqshapes( KDGanttViewItem::Type type, KDGanttViewItem::Shape& start, KDGanttViewItem::Shape& middle, KDGanttViewItem::Shape& end ) const @@ -1562,19 +1562,19 @@ void KDGanttView::clearLegend( ) /*! Adds an item to the legend. - \param shape the shape to display - \param shapeColor the color in which to display the shape + \param tqshape the tqshape to display + \param tqshapeColor the color in which to display the tqshape \param text the text to display \sa clearLegend() */ -void KDGanttView::addLegendItem( KDGanttViewItem::Shape shape, - const TQColor& shapeColor, +void KDGanttView::addLegendItem( KDGanttViewItem::Shape tqshape, + const TQColor& tqshapeColor, const TQString& text ) { - myLegend->addLegendItem( shape,shapeColor,text ); + myLegend->addLegendItem( tqshape,tqshapeColor,text ); legendItem* item = new legendItem; - item->shape = shape; - item->color = shapeColor; + item->tqshape = tqshape; + item->color = tqshapeColor; item->text = text; myLegendItems->append( item ); } @@ -3415,58 +3415,58 @@ TQDomDocument KDGanttView::saveXML( bool withPI ) const showTimeTablePopupMenu() ); // the Shapes element - TQDomElement shapesElement = doc.createElement( "Shapes" ); - docRoot.appendChild( shapesElement ); - TQDomElement shapesEventElement = doc.createElement( "Event" ); - shapesElement.appendChild( shapesEventElement ); + TQDomElement tqshapesElement = doc.createElement( "Shapes" ); + docRoot.appendChild( tqshapesElement ); + TQDomElement tqshapesEventElement = doc.createElement( "Event" ); + tqshapesElement.appendChild( tqshapesEventElement ); KDGanttViewItem::Shape start, middle, end; - if( shapes( KDGanttViewItem::Event, start, middle, end ) ) { - KDGanttXML::createStringNode( doc, shapesEventElement, "Start", - KDGanttViewItem::shapeToString( start ) ); - KDGanttXML::createStringNode( doc, shapesEventElement, "Middle", - KDGanttViewItem::shapeToString( middle ) ); - KDGanttXML::createStringNode( doc, shapesEventElement, "End", - KDGanttViewItem::shapeToString( end ) ); + if( tqshapes( KDGanttViewItem::Event, start, middle, end ) ) { + KDGanttXML::createStringNode( doc, tqshapesEventElement, "Start", + KDGanttViewItem::tqshapeToString( start ) ); + KDGanttXML::createStringNode( doc, tqshapesEventElement, "Middle", + KDGanttViewItem::tqshapeToString( middle ) ); + KDGanttXML::createStringNode( doc, tqshapesEventElement, "End", + KDGanttViewItem::tqshapeToString( end ) ); } else { - KDGanttXML::createStringNode( doc, shapesEventElement, "Start", + KDGanttXML::createStringNode( doc, tqshapesEventElement, "Start", "Undefined" ); - KDGanttXML::createStringNode( doc, shapesEventElement, "Middle", + KDGanttXML::createStringNode( doc, tqshapesEventElement, "Middle", "Undefined" ); - KDGanttXML::createStringNode( doc, shapesEventElement, "End", + KDGanttXML::createStringNode( doc, tqshapesEventElement, "End", "Undefined" ); } - TQDomElement shapesTaskElement = doc.createElement( "Task" ); - shapesElement.appendChild( shapesTaskElement ); - if( shapes( KDGanttViewItem::Task, start, middle, end ) ) { - KDGanttXML::createStringNode( doc, shapesTaskElement, "Start", - KDGanttViewItem::shapeToString( start ) ); - KDGanttXML::createStringNode( doc, shapesTaskElement, "Middle", - KDGanttViewItem::shapeToString( middle ) ); - KDGanttXML::createStringNode( doc, shapesTaskElement, "End", - KDGanttViewItem::shapeToString( end ) ); + TQDomElement tqshapesTaskElement = doc.createElement( "Task" ); + tqshapesElement.appendChild( tqshapesTaskElement ); + if( tqshapes( KDGanttViewItem::Task, start, middle, end ) ) { + KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Start", + KDGanttViewItem::tqshapeToString( start ) ); + KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Middle", + KDGanttViewItem::tqshapeToString( middle ) ); + KDGanttXML::createStringNode( doc, tqshapesTaskElement, "End", + KDGanttViewItem::tqshapeToString( end ) ); } else { - KDGanttXML::createStringNode( doc, shapesTaskElement, "Start", + KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Start", "Undefined" ); - KDGanttXML::createStringNode( doc, shapesTaskElement, "Middle", + KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Middle", "Undefined" ); - KDGanttXML::createStringNode( doc, shapesTaskElement, "End", + KDGanttXML::createStringNode( doc, tqshapesTaskElement, "End", "Undefined" ); } - TQDomElement shapesSummaryElement = doc.createElement( "Summary" ); - shapesElement.appendChild( shapesSummaryElement ); - if( shapes( KDGanttViewItem::Event, start, middle, end ) ) { - KDGanttXML::createStringNode( doc, shapesSummaryElement, "Start", - KDGanttViewItem::shapeToString( start ) ); - KDGanttXML::createStringNode( doc, shapesSummaryElement, "Middle", - KDGanttViewItem::shapeToString( middle ) ); - KDGanttXML::createStringNode( doc, shapesSummaryElement, "End", - KDGanttViewItem::shapeToString( end ) ); + TQDomElement tqshapesSummaryElement = doc.createElement( "Summary" ); + tqshapesElement.appendChild( tqshapesSummaryElement ); + if( tqshapes( KDGanttViewItem::Event, start, middle, end ) ) { + KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Start", + KDGanttViewItem::tqshapeToString( start ) ); + KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Middle", + KDGanttViewItem::tqshapeToString( middle ) ); + KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "End", + KDGanttViewItem::tqshapeToString( end ) ); } else { - KDGanttXML::createStringNode( doc, shapesSummaryElement, "Start", + KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Start", "Undefined" ); - KDGanttXML::createStringNode( doc, shapesSummaryElement, "Middle", + KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Middle", "Undefined" ); - KDGanttXML::createStringNode( doc, shapesSummaryElement, "End", + KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "End", "Undefined" ); } @@ -3604,7 +3604,7 @@ TQDomDocument KDGanttView::saveXML( bool withPI ) const TQDomElement legendItemElement = doc.createElement( "LegendItem" ); legendItemsElement.appendChild( legendItemElement ); KDGanttXML::createStringNode( doc, legendItemElement, "Shape", - KDGanttViewItem::shapeToString( current->shape ) ); + KDGanttViewItem::tqshapeToString( current->tqshape ) ); KDGanttXML::createColorNode( doc, legendItemElement, "Color", current->color ); KDGanttXML::createStringNode( doc, legendItemElement, "Text", @@ -3757,17 +3757,17 @@ void KDGanttView::editItem( KDGanttViewItem* item) /*! - This method returns the pixmap used for a certain shape, in the + This method returns the pixmap used for a certain tqshape, in the selected color and size. - \param shape the shape to generate - \param shapeColor the foreground color of the shape - \param backgroundColor the background color of the shape - \param itemSize the size of the shape - \return the generated shape pixmap + \param tqshape the tqshape to generate + \param tqshapeColor the foreground color of the tqshape + \param backgroundColor the background color of the tqshape + \param itemSize the size of the tqshape + \return the generated tqshape pixmap */ -TQPixmap KDGanttView::getPixmap( KDGanttViewItem::Shape shape, - const TQColor& shapeColor, +TQPixmap KDGanttView::getPixmap( KDGanttViewItem::Shape tqshape, + const TQColor& tqshapeColor, const TQColor& backgroundColor, int itemSize) { // 10 is a good value as size @@ -3777,11 +3777,11 @@ TQPixmap KDGanttView::getPixmap( KDGanttViewItem::Shape shape, p.fill( backgroundColor ); TQPainter paint (&p); TQBrush b = TQBrush ( TQt::SolidPattern ); - b.setColor( shapeColor ); + b.setColor( tqshapeColor ); paint.setBrush( b ); TQPen pen( TQt::black, 1 ) ; paint.setPen( pen ); - switch (shape) { + switch (tqshape) { case KDGanttViewItem::TriangleDown:{ TQPointArray arr = TQPointArray(3); arr.setPoint(0,-size/2,-hei); @@ -3864,8 +3864,8 @@ void KDGanttView::initDefaults() myDefaultColor [ getIndex( KDGanttViewItem::Summary ) ] = TQt::cyan;//summary myDefaultColorHL [ getIndex( KDGanttViewItem::Summary ) ] = TQt::red; - // setting the default shape types - // currently, we take for each item for all three shapes (start, middle, end) the same default shape + // setting the default tqshape types + // currently, we take for each item for all three tqshapes (start, middle, end) the same default tqshape for (i = 0;i<3;++i) { myDefaultShape [3*getIndex( KDGanttViewItem::Event )+ i] = KDGanttViewItem::Diamond; //event myDefaultShape [3*getIndex( KDGanttViewItem::Task ) +i] = KDGanttViewItem::Square; //task @@ -4239,7 +4239,7 @@ TQColor KDGanttView::legendHeaderBackgroundColor () const may add as many widgets as you want. They are ordered horizontally from left to right. To remove a widget from the spacer widget, call widget->reparent(newParent,...) or delete the widget. Since the spacer - is a TQHBox, the layout of the added widgets is managed by this + is a TQHBox, the tqlayout of the added widgets is managed by this TQHBox. \param w A pointer to the widget to be added. |