diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
commit | a374efce3a207b39514be3c52264091400ce297e (patch) | |
tree | 77bdf654b55826d4f59b53a5621310206bcaead1 /kstars/kstars/fitsviewer.cpp | |
parent | f81a494f3957d5cf38c787973415597941934727 (diff) | |
download | tdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip |
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kstars/kstars/fitsviewer.cpp')
-rw-r--r-- | kstars/kstars/fitsviewer.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/kstars/kstars/fitsviewer.cpp b/kstars/kstars/fitsviewer.cpp index 2d0ca2ed..ccf0f75d 100644 --- a/kstars/kstars/fitsviewer.cpp +++ b/kstars/kstars/fitsviewer.cpp @@ -91,8 +91,8 @@ extern int fits_ieee64_motorola; uc[4] = p[3]; uc[5] = p[2]; uc[6] = p[1]; uc[7] = p[0]; \ val = *(FITS_BITPIXM64 *)uc; } else val = *(FITS_BITPIXM64 *)p; } -FITSViewer::FITSViewer (const KURL *url, TQWidget *parent, const char *name) - : KMainWindow (parent, name) +FITSViewer::FITSViewer (const KURL *url, TQWidget *tqparent, const char *name) + : KMainWindow (tqparent, name) { image = NULL; currentURL = *url; @@ -118,7 +118,7 @@ FITSViewer::FITSViewer (const KURL *url, TQWidget *parent, const char *name) statusBar()->insertItem("", 2); statusBar()->setItemFixed(2, 100); statusBar()->insertItem(i18n("Welcome to KStars FITS Viewer"), 3, 1, true); - statusBar()->setItemAlignment(3 , Qt::AlignLeft); + statusBar()->setItemAlignment(3 , TQt::AlignLeft); /* FITS initializations */ if (!initFITS()) @@ -131,41 +131,41 @@ FITSViewer::FITSViewer (const KURL *url, TQWidget *parent, const char *name) if (KSUtils::openDataFile( tempFile, "imgreduction.png" ) ) { - new KAction( i18n("Image Reduction"), tempFile.name(), KShortcut( "Ctrl+R" ), this, TQT_SLOT( imageReduction()), actionCollection(), "image_reduce"); + new KAction( i18n("Image Reduction"), tempFile.name(), KShortcut( "Ctrl+R" ), TQT_TQOBJECT(this), TQT_SLOT( imageReduction()), actionCollection(), "image_reduce"); tempFile.close(); } else - new KAction( i18n("Image Reduction"), "blend", KShortcut( "Ctrl+R" ), this, TQT_SLOT( imageReduction()), actionCollection(), "image_reduce"); + new KAction( i18n("Image Reduction"), "blend", KShortcut( "Ctrl+R" ), TQT_TQOBJECT(this), TQT_SLOT( imageReduction()), actionCollection(), "image_reduce"); /*if (KSUtils::openDataFile( tempFile, "bricon.png" ) ) { - new KAction( i18n("Brightness/Contrast"), tempFile.name(), KShortcut( "Ctrl+T" ), this, TQT_SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); + new KAction( i18n("Brightness/Contrast"), tempFile.name(), KShortcut( "Ctrl+T" ), TQT_TQOBJECT(this), TQT_SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); tempFile.close(); } else*/ - new KAction( i18n("Brightness/Contrast"), "contrast+", KShortcut( "Ctrl+T" ), this, TQT_SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); + new KAction( i18n("Brightness/Contrast"), "contrast+", KShortcut( "Ctrl+T" ), TQT_TQOBJECT(this), TQT_SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); if (KSUtils::openDataFile( tempFile, "histogram.png" ) ) { - new KAction ( i18n("Histogram"), tempFile.name(), KShortcut("Ctrl+H"), this, TQT_SLOT (imageHistogram()), actionCollection(), "image_histogram"); + new KAction ( i18n("Histogram"), tempFile.name(), KShortcut("Ctrl+H"), TQT_TQOBJECT(this), TQT_SLOT (imageHistogram()), actionCollection(), "image_histogram"); tempFile.close(); } else - new KAction ( i18n("Histogram"), "wizard", KShortcut("Ctrl+H"), this, TQT_SLOT (imageHistogram()), actionCollection(), "image_histogram"); + new KAction ( i18n("Histogram"), "wizard", KShortcut("Ctrl+H"), TQT_TQOBJECT(this), TQT_SLOT (imageHistogram()), actionCollection(), "image_histogram"); - KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection()); - KStdAction::save(this, TQT_SLOT(fileSave()), actionCollection()); - KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection()); - KStdAction::close(this, TQT_SLOT(slotClose()), actionCollection()); - KStdAction::copy(this, TQT_SLOT(fitsCOPY()), actionCollection()); - KStdAction::zoomIn(image, TQT_SLOT(fitsZoomIn()), actionCollection()); - KStdAction::zoomOut(image, TQT_SLOT(fitsZoomOut()), actionCollection()); + KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(fileOpen()), actionCollection()); + KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(fileSave()), actionCollection()); + KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(fileSaveAs()), actionCollection()); + KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(slotClose()), actionCollection()); + KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(fitsCOPY()), actionCollection()); + KStdAction::zoomIn(TQT_TQOBJECT(image), TQT_SLOT(fitsZoomIn()), actionCollection()); + KStdAction::zoomOut(TQT_TQOBJECT(image), TQT_SLOT(fitsZoomOut()), actionCollection()); new KAction( i18n( "&Default Zoom" ), "viewmagfit.png", KShortcut( "Ctrl+D" ), - image, TQT_SLOT(fitsZoomDefault()), actionCollection(), "zoom_default" ); - new KAction( i18n( "Statistics"), "sum", 0, this, TQT_SLOT(fitsStatistics()), actionCollection(), "image_stats"); - new KAction( i18n( "FITS Header"), "frame_spreadsheet.png", 0, this, TQT_SLOT(fitsHeader()), actionCollection(), "fits_editor"); + TQT_TQOBJECT(image), TQT_SLOT(fitsZoomDefault()), actionCollection(), "zoom_default" ); + new KAction( i18n( "Statistics"), "sum", 0, TQT_TQOBJECT(this), TQT_SLOT(fitsStatistics()), actionCollection(), "image_stats"); + new KAction( i18n( "FITS Header"), "frame_spreadsheet.png", 0, TQT_TQOBJECT(this), TQT_SLOT(fitsHeader()), actionCollection(), "fits_editor"); - /* Create GUI */ + /* Create GUI */ createGUI("fitsviewer.rc"); /* initially resize in accord with KDE rules */ @@ -311,7 +311,7 @@ float * FITSViewer::loadData(const char *filename, float *buffer) if (fread(tempData, 1, width * height * bpp, ifp->fp) != (unsigned int) (width * height * bpp)) { - KMessageBox::error(0, i18n("Unable to read FITS data from file. %1.\n").arg(strerror(errno))); + KMessageBox::error(0, i18n("Unable to read FITS data from file. %1.\n").tqarg(strerror(errno))); return (NULL); } @@ -388,7 +388,7 @@ void FITSViewer::calculateStats() kdDebug() << "Average: " << stats.average << " - stddev: " << stats.stddev << endl; kdDebug() << "Width: " << stats.width << " - Height " << stats.height << " - bitpix " << stats.bitpix << endl;*/ - statusBar()->changeItem( TQString("%1 x %2").arg( (int) stats.width).arg( (int) stats.height), 2); + statusBar()->changeItem( TQString("%1 x %2").tqarg( (int) stats.width).tqarg( (int) stats.height), 2); } @@ -549,13 +549,13 @@ void FITSViewer::fileSave() currentURL = backupCurrent; return; } - if (currentURL.path().contains('.') == 0) currentURL.setPath(currentURL.path() + ".fits"); + if (currentURL.path().tqcontains('.') == 0) currentURL.setPath(currentURL.path() + ".fits"); if (TQFile::exists(currentURL.path())) { - int r=KMessageBox::warningContinueCancel(static_cast<TQWidget *>(parent()), + int r=KMessageBox::warningContinueCancel(TQT_TQWIDGET(tqparent()), i18n( "A file named \"%1\" already exists. " - "Overwrite it?" ).arg(currentURL.fileName()), + "Overwrite it?" ).tqarg(currentURL.fileName()), i18n( "Overwrite File?" ), i18n( "&Overwrite" ) ); @@ -588,8 +588,8 @@ void FITSViewer::fileSave() { recordList = record[j]; - if ( (index = recordList.find("BITPIX")) != -1) - recordList.replace(index, FITS_CARD_SIZE, bitpixRec); + if ( (index = recordList.tqfind("BITPIX")) != -1) + recordList.tqreplace(index, FITS_CARD_SIZE, bitpixRec); fwrite(recordList.ascii(), 1, FITS_RECORD_SIZE, ifp->fp); } @@ -692,7 +692,7 @@ void FITSViewer::fileSave() } else { - TQString message = i18n( "Invalid URL: %1" ).arg( currentURL.url() ); + TQString message = i18n( "Invalid URL: %1" ).tqarg( currentURL.url() ); KMessageBox::sorry( 0, message, i18n( "Invalid URL" ) ); } @@ -880,15 +880,15 @@ void FITSViewer::fitsStatistics() calculateStats(); - stat.widthOUT->setText(TQString("%1").arg(stats.width)); - stat.heightOUT->setText(TQString("%1").arg(stats.height)); - stat.bitpixOUT->setText(TQString("%1").arg(stats.bitpix)); - stat.maxOUT->setText(TQString("%1").arg(stats.max)); - stat.minOUT->setText(TQString("%1").arg(stats.min)); - stat.atMaxOUT->setText(TQString("%1").arg(stats.maxAt)); - stat.atMinOUT->setText(TQString("%1").arg(stats.minAt)); - stat.meanOUT->setText(TQString("%1").arg(stats.average)); - stat.stddevOUT->setText(TQString("%1").arg(stats.stddev)); + stat.widthOUT->setText(TQString("%1").tqarg(stats.width)); + stat.heightOUT->setText(TQString("%1").tqarg(stats.height)); + stat.bitpixOUT->setText(TQString("%1").tqarg(stats.bitpix)); + stat.maxOUT->setText(TQString("%1").tqarg(stats.max)); + stat.minOUT->setText(TQString("%1").tqarg(stats.min)); + stat.atMaxOUT->setText(TQString("%1").tqarg(stats.maxAt)); + stat.atMinOUT->setText(TQString("%1").tqarg(stats.minAt)); + stat.meanOUT->setText(TQString("%1").tqarg(stats.average)); + stat.stddevOUT->setText(TQString("%1").tqarg(stats.stddev)); stat.exec(); @@ -903,7 +903,7 @@ void FITSViewer::fitsHeader() fitsHeaderDialog header(this); header.headerView->setSorting(-1); - header.headerView->setColumnAlignment(1, Qt::AlignHCenter); + header.headerView->setColumnAlignment(1, TQt::AlignHCenter); for (unsigned int i=0; i < record.count(); i++) { @@ -914,14 +914,14 @@ void FITSViewer::fitsHeader() { property = recordList.left(FITS_CARD_SIZE); - equal = property.find('='); + equal = property.tqfind('='); if (equal == -1) { - if (property.contains(" ") != FITS_CARD_SIZE) + if (property.tqcontains(" ") != FITS_CARD_SIZE) cards << property << "" << ""; recordList.remove(0, FITS_CARD_SIZE); - if (property.find("END") != -1) + if (property.tqfind("END") != -1) break; else continue; @@ -929,11 +929,11 @@ void FITSViewer::fitsHeader() cards << property.left(equal); - slash = property.find("'"); + slash = property.tqfind("'"); if (slash != -1) - slash = property.find("'", slash + 1) + 1; + slash = property.tqfind("'", slash + 1) + 1; else - slash = property.find('/') - 1; + slash = property.tqfind('/') - 1; cards << property.mid(equal + 2, slash - (equal + 2)).simplifyWhiteSpace().remove("'"); cards << property.mid(slash + 1, FITS_CARD_SIZE - (slash + 1)).simplifyWhiteSpace(); @@ -952,9 +952,9 @@ void FITSViewer::fitsHeader() } -FITSChangeCommand::FITSChangeCommand(TQWidget * parent, int inType, TQImage* newIMG, TQImage *oldIMG) +FITSChangeCommand::FITSChangeCommand(TQWidget * tqparent, int inType, TQImage* newIMG, TQImage *oldIMG) { - viewer = (FITSViewer *) parent; + viewer = (FITSViewer *) tqparent; newImage = new TQImage(); oldImage = new TQImage(); *newImage = newIMG->copy(); |