diff options
Diffstat (limited to 'kchart/kchart_view.cc')
-rw-r--r-- | kchart/kchart_view.cc | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/kchart/kchart_view.cc b/kchart/kchart_view.cc index 8552d714..358aecd8 100644 --- a/kchart/kchart_view.cc +++ b/kchart/kchart_view.cc @@ -4,12 +4,12 @@ */ -#include <qfile.h> -#include <qpainter.h> -#include <qcursor.h> -#include <qpopupmenu.h> -#include <qpaintdevicemetrics.h> -#include <qcstring.h> // For QByteArray +#include <tqfile.h> +#include <tqpainter.h> +#include <tqcursor.h> +#include <tqpopupmenu.h> +#include <tqpaintdevicemetrics.h> +#include <tqcstring.h> // For TQByteArray #include <kaction.h> #include <kglobal.h> @@ -49,12 +49,12 @@ namespace KChart { -KChartView::KChartView( KChartPart* part, QWidget* parent, const char* name ) - : KoView( part, parent, name ) +KChartView::KChartView( KChartPart* part, TQWidget* tqparent, const char* name ) + : KoView( part, tqparent, name ) { // No flicker - setBackgroundMode( Qt::NoBackground ); + setBackgroundMode( TQt::NoBackground ); setInstance( KChartFactory::global() ); if ( koDocument()->isReadWrite() ) @@ -65,100 +65,100 @@ KChartView::KChartView( KChartPart* part, QWidget* parent, const char* name ) dcopObject(); // build it m_importData = new KAction( i18n( "Import Data..." ), 0, - this, SLOT( importData() ), + TQT_TQOBJECT(this), TQT_SLOT( importData() ), actionCollection(), "import_data" ); #if 0 KAction * actionExtraCreateTemplate = #endif new KAction( i18n( "&Create Template From Document..." ), 0, - this, SLOT( extraCreateTemplate() ), + TQT_TQOBJECT(this), TQT_SLOT( extraCreateTemplate() ), actionCollection(), "extra_template" ); m_wizard = new KAction( i18n("Customize with &Wizard..."), "wizard", 0, - this, SLOT( wizard() ), + TQT_TQOBJECT(this), TQT_SLOT( wizard() ), actionCollection(), "wizard"); m_edit = new KAction( i18n("Edit &Data..."), "edit", 0, - this, SLOT( editData() ), + TQT_TQOBJECT(this), TQT_SLOT( editData() ), actionCollection(), "editdata"); m_config = new KAction( i18n( "&Chart..." ), "configure", 0, - this, SLOT( slotConfig() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfig() ), actionCollection(), "config" ); // One KToggleAction per chart type - m_chartbars = new KToggleAction( i18n("&Bar"), "chart_bar_3d", 0, this, - SLOT( barsChart() ), actionCollection(), + m_chartbars = new KToggleAction( i18n("&Bar"), "chart_bar_3d", 0, TQT_TQOBJECT(this), + TQT_SLOT( barsChart() ), actionCollection(), "barschart"); m_chartbars->setExclusiveGroup( "charttypes" ); m_chartbars->setChecked( true ); - m_chartline = new KToggleAction( i18n("&Line"), "chart_line", 0, this, - SLOT( lineChart() ), actionCollection(), + m_chartline = new KToggleAction( i18n("&Line"), "chart_line", 0, TQT_TQOBJECT(this), + TQT_SLOT( lineChart() ), actionCollection(), "linechart"); m_chartline->setExclusiveGroup( "charttypes" ); - m_chartareas = new KToggleAction( i18n("&Area"), "chart_area", 0, this, - SLOT( areasChart() ), actionCollection(), + m_chartareas = new KToggleAction( i18n("&Area"), "chart_area", 0, TQT_TQOBJECT(this), + TQT_SLOT( areasChart() ), actionCollection(), "areaschart"); m_chartareas->setExclusiveGroup( "charttypes" ); - m_charthilo = new KToggleAction( i18n("&HiLo"), "chart_hilo", 0, this, - SLOT( hiLoChart() ), actionCollection(), + m_charthilo = new KToggleAction( i18n("&HiLo"), "chart_hilo", 0, TQT_TQOBJECT(this), + TQT_SLOT( hiLoChart() ), actionCollection(), "hilochart"); m_charthilo->setExclusiveGroup( "charttypes" ); - m_chartbw = new KToggleAction( i18n("Bo&x && Whiskers"), "chart_boxwhisker", 0, this, - SLOT( bwChart() ), actionCollection(), + m_chartbw = new KToggleAction( i18n("Bo&x && Whiskers"), "chart_boxwhisker", 0, TQT_TQOBJECT(this), + TQT_SLOT( bwChart() ), actionCollection(), "bwchart"); m_chartbw->setExclusiveGroup( "charttypes" ); - m_chartpie = new KToggleAction( i18n("&Pie"), "chart_pie", 0, this, - SLOT( pieChart() ), actionCollection(), + m_chartpie = new KToggleAction( i18n("&Pie"), "chart_pie", 0, TQT_TQOBJECT(this), + TQT_SLOT( pieChart() ), actionCollection(), "piechart"); m_chartpie->setExclusiveGroup( "charttypes" ); - m_chartring = new KToggleAction( i18n("&Ring"), "chart_ring", 0, this, - SLOT( ringChart() ), actionCollection(), + m_chartring = new KToggleAction( i18n("&Ring"), "chart_ring", 0, TQT_TQOBJECT(this), + TQT_SLOT( ringChart() ), actionCollection(), "ringchart"); m_chartring->setExclusiveGroup( "charttypes" ); - m_chartpolar = new KToggleAction( i18n("&Polar"), "chart_polar", 0, this, - SLOT( polarChart() ), actionCollection(), + m_chartpolar = new KToggleAction( i18n("&Polar"), "chart_polar", 0, TQT_TQOBJECT(this), + TQT_SLOT( polarChart() ), actionCollection(), "polarchart"); m_chartpolar->setExclusiveGroup( "charttypes" ); // Configuration KActions m_colorConfig = new KAction( i18n( "&Colors..." ), 0, - this, SLOT( slotConfigColor() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigColor() ), actionCollection(), "color_config" ); m_fontConfig = new KAction( i18n( "&Font..." ), 0, - this, SLOT( slotConfigFont() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigFont() ), actionCollection(), "font_config" ); m_backConfig = new KAction( i18n( "&Background..." ), 0, - this, SLOT( slotConfigBack() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigBack() ), actionCollection(), "back_config" ); m_legendConfig = new KAction( i18n( "&Legend..." ), 0, - this, SLOT( slotConfigLegend() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigLegend() ), actionCollection(), "legend_config" ); m_subTypeChartConfig = new KAction( i18n( "Chart &Sub-type..." ), 0, - this, SLOT( slotConfigSubTypeChart() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigSubTypeChart() ), actionCollection(), "legend_subtype" ); m_dataFormatConfig = new KAction( i18n( "&Data Format..." ), 0, - this, SLOT( slotConfigDataFormat() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigDataFormat() ), actionCollection(), "data_format" ); m_headerFooterConfig = new KAction( i18n( "&Header && Footer..." ), 0, - this, SLOT( slotConfigHeaderFooterChart() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigHeaderFooterChart() ), actionCollection(), "headerfooter_subtype" ); m_pageLayoutConfig = new KAction( i18n( "Page Layout..." ), 0, - this, SLOT( slotConfigPageLayout() ), + TQT_TQOBJECT(this), TQT_SLOT( slotConfigPageLayout() ), actionCollection(), "page_layout" ); // initialize the configuration @@ -190,9 +190,9 @@ DCOPObject* KChartView::dcopObject() } -void KChartView::paintEvent( QPaintEvent* /*ev*/ ) +void KChartView::paintEvent( TQPaintEvent* /*ev*/ ) { - QPainter painter( this ); + TQPainter painter( this ); // ### TODO: Scaling @@ -230,11 +230,11 @@ void KChartView::editData() ed.setColLabels(((KChartPart*)koDocument())->colLabelTexts()); // Activate the Apply button in the editor. - connect(&ed, SIGNAL(applyClicked(kchartDataEditor *)), - this, SLOT(applyEdit(kchartDataEditor *))); + connect(&ed, TQT_SIGNAL(applyClicked(kchartDataEditor *)), + TQT_TQOBJECT(this), TQT_SLOT(applyEdit(kchartDataEditor *))); // Execute the data editor. - if ( ed.exec() != QDialog::Accepted ) { + if ( ed.exec() != TQDialog::Accepted ) { return; } if (!ed.modified()) @@ -339,8 +339,8 @@ void KChartView::config(int flags) KChartConfigDialog *d = new KChartConfigDialog( params, this, flags, dat ); - connect( d, SIGNAL( dataChanged() ), - this, SLOT( slotRepaint() ) ); + connect( d, TQT_SIGNAL( dataChanged() ), + TQT_TQOBJECT(this), TQT_SLOT( slotRepaint() ) ); d->exec(); delete d; } @@ -541,12 +541,12 @@ void KChartView::bwChart() } -void KChartView::mousePressEvent ( QMouseEvent *e ) +void KChartView::mousePressEvent ( TQMouseEvent *e ) { if (!koDocument()->isReadWrite() || !factory()) return; - if ( e->button() == RightButton ) - ((QPopupMenu*)factory()->container("action_popup",this))->popup(QCursor::pos()); + if ( e->button() == Qt::RightButton ) + ((TQPopupMenu*)factory()->container("action_popup",this))->popup(TQCursor::pos()); } @@ -611,8 +611,8 @@ void KChartView::slotConfigPageLayout() KChartPageLayout *dialog = new KChartPageLayout(params, this, "Page Layout"); - connect( dialog, SIGNAL( dataChanged() ), - this, SLOT( slotRepaint() ) ); + connect( dialog, TQT_SIGNAL( dataChanged() ), + this, TQT_SLOT( slotRepaint() ) ); dialog->exec(); delete dialog; @@ -630,9 +630,9 @@ void KChartView::print(KPrinter &printer) { printer.setFullPage( false ); - QPainter painter; + TQPainter painter; painter.begin(&printer); - QPaintDeviceMetrics pdm( &printer ); + TQPaintDeviceMetrics pdm( &printer ); int height; int width; @@ -649,7 +649,7 @@ void KChartView::print(KPrinter &printer) height = pdm.height(); } - QRect rect(0, 0, width, height); + TQRect rect(0, 0, width, height); KDChart::print(&painter, ((KChartPart*)koDocument())->params(), ((KChartPart*)koDocument())->data(), @@ -666,8 +666,8 @@ void KChartView::print(KPrinter &printer) void KChartView::importData() { // Get the name of the file to open. - QString filename = KFileDialog::getOpenFileName(QString::null,// startDir - QString::null,// filter + TQString filename = KFileDialog::getOpenFileName(TQString(),// startDir + TQString(),// filter 0, i18n("Import Data")); kdDebug(35001) << "Filename = <" << filename << ">" << endl; @@ -675,16 +675,16 @@ void KChartView::importData() return; // Check to see if we can read the file. - QFile inFile(filename); + TQFile inFile(filename); if (!inFile.open(IO_ReadOnly)) { KMessageBox::sorry( 0, i18n("The file %1 could not be read.") - .arg(filename) ); + .tqarg(filename) ); inFile.close(); return; } // Let the CSV dialog structure the data in the file. - QByteArray inData( inFile.readAll() ); + TQByteArray inData( inFile.readAll() ); inFile.close(); CSVImportDialog *dialog = new CSVImportDialog(0L, inData); @@ -709,7 +709,7 @@ void KChartView::importData() for (uint row = 0; row < rows; row++) { for (uint col = 0; col < cols; col++) { bool ok; - QString tmp; + TQString tmp; double val; // Get the text and convert to double unless in the headers. @@ -743,9 +743,9 @@ void KChartView::extraCreateTemplate() { int width = 60; int height = 60; - QPixmap pix = koDocument()->generatePreview(QSize(width, height)); + TQPixmap pix = koDocument()->generatePreview(TQSize(width, height)); - KTempFile tempFile( QString::null, ".chrt" ); + KTempFile tempFile( TQString(), ".chrt" ); tempFile.setAutoDelete(true); koDocument()->saveNativeFormat( tempFile.name() ); |