From 0a6e0958c03e41c87b15557b6f407874f20c2f8d Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:39:55 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- blinken/src/artsplayer.cpp | 8 +- blinken/src/artsplayer.h | 8 +- blinken/src/blinken.cpp | 190 +++--- blinken/src/blinken.h | 46 +- blinken/src/blinkengame.cpp | 12 +- blinken/src/blinkengame.h | 10 +- blinken/src/button.cpp | 14 +- blinken/src/button.h | 10 +- blinken/src/counter.cpp | 10 +- blinken/src/counter.h | 2 +- blinken/src/fontchecker.cpp | 8 +- blinken/src/fontchecker.h | 2 +- blinken/src/fontutils.cpp | 10 +- blinken/src/fontutils.h | 2 +- blinken/src/highscoredialog.cpp | 76 +-- blinken/src/highscoredialog.h | 10 +- blinken/src/main.cpp | 4 +- blinken/src/number.cpp | 10 +- blinken/src/number.h | 4 +- kalzium/src/detailedgraphicaloverview.cpp | 44 +- kalzium/src/detailedgraphicaloverview.h | 10 +- kalzium/src/detailinfodlg.cpp | 100 ++-- kalzium/src/detailinfodlg.h | 26 +- kalzium/src/element.cpp | 108 ++-- kalzium/src/element.h | 102 ++-- kalzium/src/elementdataviewer.cpp | 40 +- kalzium/src/elementdataviewer.h | 10 +- kalzium/src/eqchemview.cpp | 18 +- kalzium/src/eqchemview.h | 10 +- kalzium/src/eqresult.cpp | 54 +- kalzium/src/eqresult.h | 38 +- kalzium/src/exporter.cpp | 8 +- kalzium/src/exporter.h | 4 +- kalzium/src/isotope.cpp | 6 +- kalzium/src/isotope.h | 22 +- kalzium/src/kalzium.cpp | 118 ++-- kalzium/src/kalzium.h | 6 +- kalzium/src/kalziumdataobject.cpp | 62 +- kalzium/src/kalziumdataobject.h | 6 +- kalzium/src/kalziumtip.cpp | 64 +- kalzium/src/kalziumtip.h | 28 +- kalzium/src/kalziumutils.cpp | 26 +- kalzium/src/kalziumutils.h | 8 +- kalzium/src/molcalcwidget.cpp | 40 +- kalzium/src/molcalcwidget.h | 4 +- kalzium/src/moleculeparser.cpp | 16 +- kalzium/src/moleculeparser.h | 18 +- kalzium/src/orbitswidget.cpp | 22 +- kalzium/src/orbitswidget.h | 10 +- kalzium/src/parser.cpp | 8 +- kalzium/src/parser.h | 8 +- kalzium/src/periodictableview.cpp | 260 ++++----- kalzium/src/periodictableview.h | 116 ++-- kalzium/src/plotwidget.cpp | 14 +- kalzium/src/plotwidget.h | 4 +- kalzium/src/somwidget_impl.cpp | 88 +-- kalzium/src/somwidget_impl.h | 10 +- kalzium/src/spectrum.cpp | 34 +- kalzium/src/spectrum.h | 26 +- kalzium/src/spectrumviewimpl.cpp | 8 +- kalzium/src/spectrumviewimpl.h | 2 +- kalzium/src/spectrumwidget.cpp | 62 +- kalzium/src/spectrumwidget.h | 40 +- kalzium/src/tempunit.cpp | 16 +- kalzium/src/tempunit.h | 8 +- kalzium/src/timewidget_impl.cpp | 14 +- kalzium/src/timewidget_impl.h | 2 +- kanagram/src/fontutils.cpp | 10 +- kanagram/src/fontutils.h | 2 +- kanagram/src/grammarmanager.cpp | 118 ++-- kanagram/src/grammarmanager.h | 124 ++-- kanagram/src/kanagram.cpp | 216 +++---- kanagram/src/kanagram.h | 40 +- kanagram/src/kanagramgame.cpp | 28 +- kanagram/src/kanagramgame.h | 32 +- kanagram/src/keduvocdocument.cpp | 136 ++--- kanagram/src/keduvocdocument.h | 156 ++--- kanagram/src/keduvocexpression.cpp | 58 +- kanagram/src/keduvocexpression.h | 76 +-- kanagram/src/keduvockvtmlreader.cpp | 296 +++++----- kanagram/src/keduvockvtmlreader.h | 64 +- kanagram/src/keduvockvtmlwriter.cpp | 232 ++++---- kanagram/src/keduvockvtmlwriter.h | 34 +- kanagram/src/leitnerbox.cpp | 4 +- kanagram/src/leitnerbox.h | 8 +- kanagram/src/leitnersystem.cpp | 38 +- kanagram/src/leitnersystem.h | 40 +- kanagram/src/leitnersystemview.cpp | 24 +- kanagram/src/leitnersystemview.h | 16 +- kanagram/src/main.cpp | 14 +- kanagram/src/mainsettings.cpp | 40 +- kanagram/src/mainsettings.h | 4 +- kanagram/src/multiplechoice.cpp | 12 +- kanagram/src/multiplechoice.h | 36 +- kanagram/src/newstuff.cpp | 8 +- kanagram/src/newstuff.h | 2 +- kanagram/src/newstuffdialog.cpp | 8 +- kanagram/src/newstuffdialog.h | 6 +- kanagram/src/vocabedit.cpp | 48 +- kanagram/src/vocabedit.h | 16 +- kanagram/src/vocabsettings.cpp | 30 +- kanagram/src/vocabsettings.h | 8 +- kbruch/src/exercisebase.cpp | 4 +- kbruch/src/exercisebase.h | 6 +- kbruch/src/exercisecompare.cpp | 86 +-- kbruch/src/exercisecompare.h | 18 +- kbruch/src/exerciseconvert.cpp | 88 +-- kbruch/src/exerciseconvert.h | 20 +- kbruch/src/exercisefactorize.cpp | 160 ++--- kbruch/src/exercisefactorize.h | 62 +- kbruch/src/factorizedwidget.cpp | 14 +- kbruch/src/factorizedwidget.h | 8 +- kbruch/src/fractionbasewidget.cpp | 18 +- kbruch/src/fractionbasewidget.h | 20 +- kbruch/src/mainqtwidget.cpp | 110 ++-- kbruch/src/mainqtwidget.h | 14 +- kbruch/src/primenumber.h | 4 +- kbruch/src/ratio.cpp | 4 +- kbruch/src/ratio.h | 8 +- kbruch/src/rationalwidget.cpp | 18 +- kbruch/src/rationalwidget.h | 8 +- kbruch/src/ratiowidget.cpp | 12 +- kbruch/src/ratiowidget.h | 6 +- kbruch/src/resultwidget.cpp | 16 +- kbruch/src/resultwidget.h | 6 +- kbruch/src/statisticsview.cpp | 76 +-- kbruch/src/statisticsview.h | 24 +- kbruch/src/task.cpp | 4 +- kbruch/src/task.h | 10 +- kbruch/src/taskview.cpp | 88 +-- kbruch/src/taskview.h | 22 +- kbruch/src/taskwidget.cpp | 14 +- kbruch/src/taskwidget.h | 6 +- keduca/keduca/kcheckeduca.cpp | 24 +- keduca/keduca/kcheckeduca.h | 12 +- keduca/keduca/keduca.cpp | 18 +- keduca/keduca/keduca.h | 2 +- keduca/keduca/keduca_part.cpp | 10 +- keduca/keduca/keduca_part.h | 4 +- keduca/keduca/keducaprefs.cpp | 28 +- keduca/keduca/keducaprefs.h | 14 +- keduca/keduca/keducaview.cpp | 120 ++-- keduca/keduca/keducaview.h | 50 +- keduca/keduca/kgroupeduca.cpp | 20 +- keduca/keduca/kgroupeduca.h | 16 +- keduca/keduca/kquestion.cpp | 48 +- keduca/keduca/kquestion.h | 18 +- keduca/keduca/kradioeduca.cpp | 24 +- keduca/keduca/kradioeduca.h | 14 +- keduca/keduca/main.cpp | 4 +- keduca/keducabuilder/kcontroladdedit.cpp | 40 +- keduca/keducabuilder/kcontroladdedit.h | 12 +- keduca/keducabuilder/kcontrolheader.cpp | 146 ++--- keduca/keducabuilder/kcontrolheader.h | 12 +- keduca/keducabuilder/keducabuilder.cpp | 114 ++-- keduca/keducabuilder/keducabuilder.h | 16 +- keduca/keducabuilder/keducaeditorstartdialog.cpp | 18 +- keduca/keducabuilder/klangcombo.cpp | 14 +- keduca/keducabuilder/klangcombo.h | 6 +- keduca/keducabuilder/ktagcombobox.cpp | 86 +-- keduca/keducabuilder/ktagcombobox.h | 38 +- keduca/keducabuilder/main.cpp | 4 +- keduca/libkeduca/fileread.cpp | 146 ++--- keduca/libkeduca/fileread.h | 72 +-- keduca/libkeduca/kgallerydialog.cpp | 62 +- keduca/libkeduca/kgallerydialog.h | 6 +- kgeography/src/answer.cpp | 40 +- kgeography/src/answer.h | 12 +- kgeography/src/answersdialog.cpp | 34 +- kgeography/src/answersdialog.h | 12 +- kgeography/src/askwidget.cpp | 12 +- kgeography/src/askwidget.h | 20 +- kgeography/src/boxasker.cpp | 34 +- kgeography/src/boxasker.h | 16 +- kgeography/src/capitaldivisionasker.cpp | 16 +- kgeography/src/capitaldivisionasker.h | 8 +- kgeography/src/division.cpp | 18 +- kgeography/src/division.h | 18 +- kgeography/src/divisioncapitalasker.cpp | 18 +- kgeography/src/divisioncapitalasker.h | 8 +- kgeography/src/divisionflagasker.cpp | 20 +- kgeography/src/divisionflagasker.h | 6 +- kgeography/src/flagdivisionasker.cpp | 16 +- kgeography/src/flagdivisionasker.h | 8 +- kgeography/src/kgeography.cpp | 88 +-- kgeography/src/kgeography.h | 10 +- kgeography/src/map.cpp | 50 +- kgeography/src/map.h | 34 +- kgeography/src/mapasker.cpp | 68 +-- kgeography/src/mapasker.h | 20 +- kgeography/src/mapchooser.cpp | 40 +- kgeography/src/mapchooser.h | 12 +- kgeography/src/mapparser.cpp | 34 +- kgeography/src/mapparser.h | 24 +- kgeography/src/mapwidget.cpp | 40 +- kgeography/src/mapwidget.h | 32 +- kgeography/src/mypopup.cpp | 30 +- kgeography/src/mypopup.h | 6 +- kgeography/src/popupmanager.cpp | 12 +- kgeography/src/popupmanager.h | 14 +- kgeography/src/script.cpp | 28 +- khangman/khangman/fontchecker.cpp | 8 +- khangman/khangman/fontchecker.h | 2 +- khangman/khangman/khangman.cpp | 112 ++-- khangman/khangman/khangman.h | 18 +- khangman/khangman/khangmanview.cpp | 264 ++++----- khangman/khangman/khangmanview.h | 42 +- khangman/khangman/khnewstuff.cpp | 8 +- khangman/khangman/khnewstuff.h | 4 +- khangman/khangman/main.cpp | 4 +- khangman/khangman/timer.cpp | 16 +- khangman/khangman/timer.h | 2 +- kig/filters/cabri-filter.cc | 56 +- kig/filters/cabri-filter.h | 6 +- kig/filters/drgeo-filter-chooser.cc | 10 +- kig/filters/drgeo-filter-chooser.h | 4 +- kig/filters/drgeo-filter.cc | 90 +-- kig/filters/drgeo-filter.h | 6 +- kig/filters/exporter.cc | 80 +-- kig/filters/exporter.h | 18 +- kig/filters/filter.cc | 20 +- kig/filters/filter.h | 22 +- kig/filters/filters-common.cc | 8 +- kig/filters/filters-common.h | 2 +- kig/filters/imageexporteroptions.cc | 10 +- kig/filters/imageexporteroptions.h | 4 +- kig/filters/kgeo-filter.cc | 20 +- kig/filters/kgeo-filter.h | 6 +- kig/filters/kgeo-resource.h | 2 +- kig/filters/kseg-defs.h | 2 +- kig/filters/kseg-filter.cc | 46 +- kig/filters/kseg-filter.h | 6 +- kig/filters/latexexporter.cc | 62 +- kig/filters/latexexporter.h | 6 +- kig/filters/native-filter.cc | 156 ++--- kig/filters/native-filter.h | 16 +- kig/filters/svgexporter.cc | 26 +- kig/filters/svgexporter.h | 6 +- kig/kfile/kfile_drgeo.cpp | 36 +- kig/kfile/kfile_drgeo.h | 2 +- kig/kfile/kfile_kig.cpp | 52 +- kig/kfile/kfile_kig.h | 2 +- kig/kig/kig.cpp | 38 +- kig/kig/kig.h | 6 +- kig/kig/kig_commands.cpp | 8 +- kig/kig/kig_commands.h | 4 +- kig/kig/kig_iface.h | 2 +- kig/kig/kig_part.cpp | 156 ++--- kig/kig/kig_part.h | 24 +- kig/kig/kig_view.cpp | 90 +-- kig/kig/kig_view.h | 48 +- kig/kig/main.cpp | 8 +- kig/misc/common.cpp | 10 +- kig/misc/common.h | 6 +- kig/misc/coordinate.cpp | 8 +- kig/misc/coordinate.h | 4 +- kig/misc/coordinate_system.cpp | 110 ++-- kig/misc/coordinate_system.h | 36 +- kig/misc/goniometry.cc | 6 +- kig/misc/goniometry.h | 4 +- kig/misc/guiaction.cc | 56 +- kig/misc/guiaction.h | 52 +- kig/misc/kigfiledialog.cc | 22 +- kig/misc/kigfiledialog.h | 12 +- kig/misc/kiginputdialog.cc | 80 +-- kig/misc/kiginputdialog.h | 20 +- kig/misc/kigpainter.cpp | 166 +++--- kig/misc/kigpainter.h | 68 +-- kig/misc/kigtransform.cpp | 2 +- kig/misc/kigtransform.h | 2 +- kig/misc/lists.cc | 56 +- kig/misc/lists.h | 8 +- kig/misc/object_constructor.cc | 62 +- kig/misc/object_constructor.h | 62 +- kig/misc/object_hierarchy.cc | 54 +- kig/misc/object_hierarchy.h | 6 +- kig/misc/rect.cc | 6 +- kig/misc/rect.h | 10 +- kig/misc/screeninfo.cc | 22 +- kig/misc/screeninfo.h | 18 +- kig/misc/special_constructors.cc | 68 +-- kig/misc/special_constructors.h | 46 +- kig/modes/base_mode.cc | 24 +- kig/modes/base_mode.h | 32 +- kig/modes/construct_mode.cc | 62 +- kig/modes/construct_mode.h | 38 +- kig/modes/dragrectmode.cc | 44 +- kig/modes/dragrectmode.h | 40 +- kig/modes/edittype.cc | 14 +- kig/modes/edittype.h | 14 +- kig/modes/label.cc | 58 +- kig/modes/label.h | 14 +- kig/modes/linkslabel.cpp | 48 +- kig/modes/linkslabel.h | 10 +- kig/modes/macro.cc | 14 +- kig/modes/macro.h | 14 +- kig/modes/macrowizard.cc | 16 +- kig/modes/macrowizard.h | 4 +- kig/modes/mode.cc | 20 +- kig/modes/mode.h | 22 +- kig/modes/moving.cc | 10 +- kig/modes/moving.h | 6 +- kig/modes/normal.cc | 18 +- kig/modes/normal.h | 14 +- kig/modes/popup.cc | 168 +++--- kig/modes/popup.h | 20 +- kig/modes/textlabelwizard.cc | 22 +- kig/modes/textlabelwizard.h | 2 +- kig/modes/typesdialog.cpp | 76 +-- kig/modes/typesdialog.h | 12 +- kig/objects/angle_type.cc | 6 +- kig/objects/angle_type.h | 2 +- kig/objects/arc_type.cc | 2 +- kig/objects/bogus_imp.cc | 16 +- kig/objects/bogus_imp.h | 24 +- kig/objects/circle_imp.cc | 12 +- kig/objects/circle_imp.h | 6 +- kig/objects/common.h | 8 +- kig/objects/conic_imp.cc | 10 +- kig/objects/conic_imp.h | 6 +- kig/objects/conic_types.cc | 4 +- kig/objects/conic_types.h | 2 +- kig/objects/cubic_imp.cc | 4 +- kig/objects/cubic_imp.h | 2 +- kig/objects/line_imp.cc | 8 +- kig/objects/line_imp.h | 2 +- kig/objects/line_type.cc | 6 +- kig/objects/line_type.h | 2 +- kig/objects/object_drawer.cc | 22 +- kig/objects/object_drawer.h | 20 +- kig/objects/object_factory.cc | 8 +- kig/objects/object_factory.h | 8 +- kig/objects/object_holder.cc | 8 +- kig/objects/object_holder.h | 8 +- kig/objects/object_imp.cc | 22 +- kig/objects/object_imp.h | 18 +- kig/objects/object_imp_factory.cc | 132 ++--- kig/objects/object_imp_factory.h | 4 +- kig/objects/object_type.cc | 6 +- kig/objects/object_type.h | 2 +- kig/objects/object_type_factory.cc | 2 +- kig/objects/point_imp.cc | 2 +- kig/objects/point_imp.h | 2 +- kig/objects/point_type.cc | 10 +- kig/objects/point_type.h | 6 +- kig/objects/text_imp.cc | 4 +- kig/objects/text_imp.h | 6 +- kig/objects/text_type.cc | 10 +- kig/objects/text_type.h | 2 +- kig/scripting/newscriptwizard.cc | 26 +- kig/scripting/newscriptwizard.h | 6 +- kig/scripting/python_type.cc | 2 +- kig/scripting/python_type.h | 2 +- kig/scripting/script-common.cc | 16 +- kig/scripting/script-common.h | 6 +- kig/scripting/script_mode.cc | 26 +- kig/scripting/script_mode.h | 14 +- kiten/asyndeta.cpp | 18 +- kiten/asyndeta.h | 2 +- kiten/configdictionaries.cpp | 46 +- kiten/configdictionaries.h | 6 +- kiten/deinf.cpp | 40 +- kiten/deinf.h | 14 +- kiten/dict.cpp | 182 +++--- kiten/dict.h | 100 ++-- kiten/kiten.cpp | 242 ++++---- kiten/kiten.h | 28 +- kiten/kloader.cpp | 32 +- kiten/kloader.h | 14 +- kiten/kromajiedit.cpp | 54 +- kiten/kromajiedit.h | 16 +- kiten/ksaver.cpp | 28 +- kiten/ksaver.h | 14 +- kiten/learn.cpp | 194 +++---- kiten/learn.h | 38 +- kiten/main.cpp | 4 +- kiten/optiondialog.cpp | 18 +- kiten/optiondialog.h | 2 +- kiten/rad.cpp | 132 ++--- kiten/rad.h | 52 +- kiten/widgets.cpp | 156 ++--- kiten/widgets.h | 38 +- klatin/klatin/keduvocdata.h | 16 +- klatin/klatin/klatin.cpp | 34 +- klatin/klatin/klatin.h | 4 +- klatin/klatin/klatingrammar.cpp | 22 +- klatin/klatin/klatingrammar.h | 6 +- klatin/klatin/klatinverbs.cpp | 30 +- klatin/klatin/klatinverbs.h | 10 +- klatin/klatin/klatinvocab.cpp | 48 +- klatin/klatin/klatinvocab.h | 28 +- klettres/klettres/klettres.cpp | 148 ++--- klettres/klettres/klettres.h | 18 +- klettres/klettres/klettresview.cpp | 58 +- klettres/klettres/klettresview.h | 20 +- klettres/klettres/klnewstuff.cpp | 8 +- klettres/klettres/klnewstuff.h | 4 +- klettres/klettres/prefs_addons.h | 6 +- klettres/klettres/soundfactory.cpp | 24 +- klettres/klettres/soundfactory.h | 12 +- klettres/klettres/timer.cpp | 16 +- klettres/klettres/timer.h | 2 +- kmplot/kmplot/FktDlg.cpp | 94 +-- kmplot/kmplot/FktDlg.h | 14 +- kmplot/kmplot/MainDlg.cpp | 172 +++--- kmplot/kmplot/MainDlg.h | 16 +- kmplot/kmplot/View.cpp | 240 ++++---- kmplot/kmplot/View.h | 72 +-- kmplot/kmplot/coordsconfigdialog.cpp | 4 +- kmplot/kmplot/coordsconfigdialog.h | 2 +- kmplot/kmplot/diagr.cpp | 78 +-- kmplot/kmplot/diagr.h | 20 +- kmplot/kmplot/editfunction.cpp | 40 +- kmplot/kmplot/editfunction.h | 6 +- kmplot/kmplot/kconstanteditor.cpp | 48 +- kmplot/kmplot/kconstanteditor.h | 8 +- kmplot/kmplot/keditconstant.cpp | 14 +- kmplot/kmplot/keditconstant.h | 4 +- kmplot/kmplot/keditparametric.cpp | 22 +- kmplot/kmplot/keditparametric.h | 8 +- kmplot/kmplot/keditpolar.cpp | 14 +- kmplot/kmplot/keditpolar.h | 2 +- kmplot/kmplot/kminmax.cpp | 120 ++-- kmplot/kmplot/kminmax.h | 8 +- kmplot/kmplot/kmplot.cpp | 40 +- kmplot/kmplot/kmplot.h | 2 +- kmplot/kmplot/kmplotIface.h | 2 +- kmplot/kmplot/kmplotio.cpp | 124 ++-- kmplot/kmplot/kmplotio.h | 20 +- kmplot/kmplot/kmplotprogress.cpp | 6 +- kmplot/kmplot/kmplotprogress.h | 4 +- kmplot/kmplot/kparametereditor.cpp | 64 +- kmplot/kmplot/kparametereditor.h | 10 +- kmplot/kmplot/kprinterdlg.cpp | 16 +- kmplot/kmplot/kprinterdlg.h | 14 +- kmplot/kmplot/ksliderwindow.cpp | 32 +- kmplot/kmplot/ksliderwindow.h | 6 +- kmplot/kmplot/parser.cpp | 82 +-- kmplot/kmplot/parser.h | 42 +- kmplot/kmplot/parseriface.h | 54 +- kmplot/kmplot/qconstanteditor.ui.h | 4 +- kmplot/kmplot/xparser.cpp | 144 ++--- kmplot/kmplot/xparser.h | 58 +- kpercentage/kpercentage/kanimation.cpp | 32 +- kpercentage/kpercentage/kanimation.h | 18 +- kpercentage/kpercentage/kanswer.cpp | 68 +-- kpercentage/kpercentage/kanswer.h | 22 +- kpercentage/kpercentage/kpercentage.cpp | 96 +-- kpercentage/kpercentage/kpercentage.h | 6 +- kpercentage/kpercentage/kpercentmain.cpp | 120 ++-- kpercentage/kpercentage/kpercentmain.h | 34 +- kpercentage/kpercentage/ksplashscreen.cpp | 22 +- kstars/kstars/addcatdialog.cpp | 68 +-- kstars/kstars/addcatdialog.h | 16 +- kstars/kstars/addlinkdialog.cpp | 18 +- kstars/kstars/addlinkdialog.h | 20 +- kstars/kstars/ccdpreviewwg.cpp | 68 +-- kstars/kstars/ccdpreviewwg.h | 18 +- kstars/kstars/colorscheme.cpp | 78 +-- kstars/kstars/colorscheme.h | 36 +- kstars/kstars/conbridlg.cpp | 22 +- kstars/kstars/conbridlg.h | 8 +- kstars/kstars/csegment.cpp | 4 +- kstars/kstars/csegment.h | 18 +- kstars/kstars/customcatalog.cpp | 6 +- kstars/kstars/customcatalog.h | 24 +- kstars/kstars/deepskyobject.cpp | 44 +- kstars/kstars/deepskyobject.h | 28 +- kstars/kstars/detaildialog.cpp | 250 ++++---- kstars/kstars/detaildialog.h | 52 +- kstars/kstars/devicemanager.cpp | 38 +- kstars/kstars/devicemanager.h | 14 +- kstars/kstars/dms.cpp | 48 +- kstars/kstars/dms.h | 14 +- kstars/kstars/dmsbox.cpp | 40 +- kstars/kstars/dmsbox.h | 10 +- kstars/kstars/draglistbox.cpp | 28 +- kstars/kstars/draglistbox.h | 12 +- kstars/kstars/filesource.cpp | 6 +- kstars/kstars/filesource.h | 20 +- kstars/kstars/finddialog.cpp | 66 +-- kstars/kstars/finddialog.h | 26 +- kstars/kstars/fitshistogram.cpp | 58 +- kstars/kstars/fitshistogram.h | 14 +- kstars/kstars/fitsimage.cpp | 40 +- kstars/kstars/fitsimage.h | 42 +- kstars/kstars/fitsprocess.cpp | 10 +- kstars/kstars/fitsprocess.h | 22 +- kstars/kstars/fitsviewer.cpp | 134 ++--- kstars/kstars/fitsviewer.h | 34 +- kstars/kstars/focusdialog.cpp | 36 +- kstars/kstars/focusdialog.h | 10 +- kstars/kstars/fov.cpp | 20 +- kstars/kstars/fov.h | 20 +- kstars/kstars/fovdialog.cpp | 90 +-- kstars/kstars/fovdialog.h | 14 +- kstars/kstars/geolocation.cpp | 12 +- kstars/kstars/geolocation.h | 28 +- kstars/kstars/imagereductiondlg.cpp | 36 +- kstars/kstars/imagereductiondlg.h | 2 +- kstars/kstars/imagesequence.cpp | 70 +-- kstars/kstars/imagesequence.h | 10 +- kstars/kstars/imageviewer.cpp | 40 +- kstars/kstars/imageviewer.h | 30 +- kstars/kstars/indi/webcam/v4l1_pwc.h | 2 +- kstars/kstars/indidevice.cpp | 74 +-- kstars/kstars/indidevice.h | 32 +- kstars/kstars/indidriver.cpp | 132 ++--- kstars/kstars/indidriver.h | 50 +- kstars/kstars/indielement.cpp | 48 +- kstars/kstars/indielement.h | 22 +- kstars/kstars/indifitsconf.cpp | 18 +- kstars/kstars/indifitsconf.h | 4 +- kstars/kstars/indigroup.cpp | 20 +- kstars/kstars/indigroup.h | 16 +- kstars/kstars/indimenu.cpp | 48 +- kstars/kstars/indimenu.h | 18 +- kstars/kstars/indiproperty.cpp | 106 ++-- kstars/kstars/indiproperty.h | 26 +- kstars/kstars/indistd.cpp | 62 +- kstars/kstars/indistd.h | 10 +- kstars/kstars/infobox.cpp | 34 +- kstars/kstars/infobox.h | 54 +- kstars/kstars/infoboxes.cpp | 98 ++-- kstars/kstars/infoboxes.h | 48 +- kstars/kstars/jupitermoons.cpp | 2 +- kstars/kstars/jupitermoons.h | 6 +- kstars/kstars/ksasteroid.cpp | 2 +- kstars/kstars/ksasteroid.h | 2 +- kstars/kstars/kscomet.cpp | 4 +- kstars/kstars/kscomet.h | 2 +- kstars/kstars/ksfilereader.cpp | 14 +- kstars/kstars/ksfilereader.h | 18 +- kstars/kstars/ksmoon.cpp | 30 +- kstars/kstars/ksmoon.h | 6 +- kstars/kstars/ksnewstuff.cpp | 34 +- kstars/kstars/ksnewstuff.h | 12 +- kstars/kstars/ksplanet.cpp | 26 +- kstars/kstars/ksplanet.h | 18 +- kstars/kstars/ksplanetbase.cpp | 14 +- kstars/kstars/ksplanetbase.h | 22 +- kstars/kstars/kspluto.cpp | 4 +- kstars/kstars/kspluto.h | 2 +- kstars/kstars/kspopupmenu.cpp | 108 ++-- kstars/kstars/kspopupmenu.h | 8 +- kstars/kstars/kssun.cpp | 6 +- kstars/kstars/kssun.h | 4 +- kstars/kstars/kstars.cpp | 34 +- kstars/kstars/kstars.h | 70 +-- kstars/kstars/kstarsactions.cpp | 128 ++-- kstars/kstars/kstarsdata.cpp | 340 +++++------ kstars/kstars/kstarsdata.h | 118 ++-- kstars/kstars/kstarsdatetime.cpp | 18 +- kstars/kstars/kstarsdatetime.h | 12 +- kstars/kstars/kstarsdcop.cpp | 126 ++-- kstars/kstars/kstarsinit.cpp | 202 +++---- kstars/kstars/kstarsinterface.h | 56 +- kstars/kstars/kstarssplash.cpp | 46 +- kstars/kstars/kstarssplash.h | 16 +- kstars/kstars/ksutils.cpp | 6 +- kstars/kstars/ksutils.h | 6 +- kstars/kstars/kswizard.cpp | 30 +- kstars/kstars/kswizard.h | 8 +- kstars/kstars/locationdialog.cpp | 150 ++--- kstars/kstars/locationdialog.h | 42 +- kstars/kstars/magnitudespinbox.cpp | 4 +- kstars/kstars/magnitudespinbox.h | 4 +- kstars/kstars/main.cpp | 18 +- kstars/kstars/mapcanvas.cpp | 34 +- kstars/kstars/mapcanvas.h | 30 +- kstars/kstars/objectnamelist.cpp | 18 +- kstars/kstars/objectnamelist.h | 24 +- kstars/kstars/opsadvanced.cpp | 12 +- kstars/kstars/opsadvanced.h | 2 +- kstars/kstars/opscatalog.cpp | 62 +- kstars/kstars/opscatalog.h | 6 +- kstars/kstars/opscolors.cpp | 86 +-- kstars/kstars/opscolors.h | 10 +- kstars/kstars/opsguides.cpp | 14 +- kstars/kstars/opsguides.h | 2 +- kstars/kstars/opssolarsystem.cpp | 18 +- kstars/kstars/opssolarsystem.h | 2 +- kstars/kstars/planetcatalog.cpp | 12 +- kstars/kstars/planetcatalog.h | 18 +- kstars/kstars/simclock.cpp | 14 +- kstars/kstars/simclock.h | 12 +- kstars/kstars/skymap.cpp | 158 ++--- kstars/kstars/skymap.h | 150 ++--- kstars/kstars/skymapdraw.cpp | 312 +++++----- kstars/kstars/skymapevents.cpp | 82 +-- kstars/kstars/skyobject.cpp | 74 +-- kstars/kstars/skyobject.h | 60 +- kstars/kstars/skyobjectname.cpp | 6 +- kstars/kstars/skyobjectname.h | 20 +- kstars/kstars/skypoint.cpp | 10 +- kstars/kstars/skypoint.h | 6 +- kstars/kstars/stardatasink.cpp | 6 +- kstars/kstars/stardatasink.h | 8 +- kstars/kstars/starobject.cpp | 264 ++++----- kstars/kstars/starobject.h | 32 +- kstars/kstars/starpixmap.cpp | 42 +- kstars/kstars/starpixmap.h | 8 +- kstars/kstars/streamwg.cpp | 58 +- kstars/kstars/streamwg.h | 18 +- kstars/kstars/telescopeprop.cpp | 16 +- kstars/kstars/telescopeprop.h | 2 +- kstars/kstars/telescopewizardprocess.cpp | 70 +-- kstars/kstars/telescopewizardprocess.h | 10 +- kstars/kstars/thumbnaileditor.cpp | 74 +-- kstars/kstars/thumbnaileditor.h | 32 +- kstars/kstars/thumbnailpicker.cpp | 110 ++-- kstars/kstars/thumbnailpicker.h | 20 +- kstars/kstars/timebox.cpp | 44 +- kstars/kstars/timebox.h | 28 +- kstars/kstars/timedialog.cpp | 58 +- kstars/kstars/timedialog.h | 34 +- kstars/kstars/timespinbox.cpp | 18 +- kstars/kstars/timespinbox.h | 12 +- kstars/kstars/timestepbox.cpp | 26 +- kstars/kstars/timestepbox.h | 12 +- kstars/kstars/timeunitbox.cpp | 14 +- kstars/kstars/timeunitbox.h | 10 +- kstars/kstars/timezonerule.cpp | 26 +- kstars/kstars/timezonerule.h | 14 +- kstars/kstars/toggleaction.cpp | 14 +- kstars/kstars/toggleaction.h | 22 +- kstars/kstars/tools/altvstime.cpp | 104 ++-- kstars/kstars/tools/altvstime.h | 20 +- kstars/kstars/tools/astrocalc.cpp | 76 +-- kstars/kstars/tools/astrocalc.h | 22 +- kstars/kstars/tools/jmoontool.cpp | 30 +- kstars/kstars/tools/jmoontool.h | 6 +- kstars/kstars/tools/kstarsplotwidget.cpp | 70 +-- kstars/kstars/tools/kstarsplotwidget.h | 12 +- kstars/kstars/tools/lcgenerator.cpp | 132 ++--- kstars/kstars/tools/lcgenerator.h | 70 +-- kstars/kstars/tools/modcalcangdist.cpp | 42 +- kstars/kstars/tools/modcalcangdist.h | 4 +- kstars/kstars/tools/modcalcapcoord.cpp | 52 +- kstars/kstars/tools/modcalcapcoord.h | 8 +- kstars/kstars/tools/modcalcazel.cpp | 52 +- kstars/kstars/tools/modcalcazel.h | 8 +- kstars/kstars/tools/modcalcdaylength.cpp | 20 +- kstars/kstars/tools/modcalcdaylength.h | 4 +- kstars/kstars/tools/modcalceclipticcoords.cpp | 46 +- kstars/kstars/tools/modcalceclipticcoords.h | 6 +- kstars/kstars/tools/modcalcequinox.cpp | 50 +- kstars/kstars/tools/modcalcequinox.h | 8 +- kstars/kstars/tools/modcalcgalcoord.cpp | 46 +- kstars/kstars/tools/modcalcgalcoord.h | 6 +- kstars/kstars/tools/modcalcgeodcoord.cpp | 44 +- kstars/kstars/tools/modcalcgeodcoord.h | 10 +- kstars/kstars/tools/modcalcjd.cpp | 8 +- kstars/kstars/tools/modcalcjd.h | 4 +- kstars/kstars/tools/modcalcplanets.cpp | 60 +- kstars/kstars/tools/modcalcplanets.h | 8 +- kstars/kstars/tools/modcalcprec.cpp | 46 +- kstars/kstars/tools/modcalcprec.h | 8 +- kstars/kstars/tools/modcalcsidtime.cpp | 70 +-- kstars/kstars/tools/modcalcsidtime.h | 16 +- kstars/kstars/tools/modcalcvlsr.cpp | 52 +- kstars/kstars/tools/modcalcvlsr.h | 8 +- kstars/kstars/tools/observinglist.cpp | 136 ++--- kstars/kstars/tools/observinglist.h | 10 +- kstars/kstars/tools/obslistwizard.cpp | 76 +-- kstars/kstars/tools/obslistwizard.h | 10 +- kstars/kstars/tools/planetviewer.cpp | 52 +- kstars/kstars/tools/planetviewer.h | 36 +- kstars/kstars/tools/scriptbuilder.cpp | 646 ++++++++++----------- kstars/kstars/tools/scriptbuilder.h | 28 +- kstars/kstars/tools/scriptfunction.cpp | 20 +- kstars/kstars/tools/scriptfunction.h | 46 +- kstars/kstars/tools/wutdialog.cpp | 72 +-- kstars/kstars/tools/wutdialog.h | 10 +- ktouch/src/ktouch.cpp | 158 ++--- ktouch/src/ktouch.h | 28 +- ktouch/src/ktouchchartwidget.cpp | 8 +- ktouch/src/ktouchchartwidget.h | 2 +- ktouch/src/ktouchcoloreditor.cpp | 20 +- ktouch/src/ktouchcoloreditor.h | 12 +- ktouch/src/ktouchcolorscheme.cpp | 132 ++--- ktouch/src/ktouchcolorscheme.h | 46 +- ktouch/src/ktouchkey.cpp | 28 +- ktouch/src/ktouchkey.h | 16 +- ktouch/src/ktouchkeyboard.cpp | 152 ++--- ktouch/src/ktouchkeyboard.h | 18 +- ktouch/src/ktouchkeyboardeditor.cpp | 36 +- ktouch/src/ktouchkeyboardeditor.h | 6 +- ktouch/src/ktouchkeyboardwidget.cpp | 100 ++-- ktouch/src/ktouchkeyboardwidget.h | 42 +- ktouch/src/ktouchkeyconnector.cpp | 20 +- ktouch/src/ktouchkeyconnector.h | 12 +- ktouch/src/ktouchkeys.cpp | 32 +- ktouch/src/ktouchkeys.h | 38 +- ktouch/src/ktouchlecture.cpp | 86 +-- ktouch/src/ktouchlecture.h | 30 +- ktouch/src/ktouchlectureeditor.cpp | 84 +-- ktouch/src/ktouchlectureeditor.h | 12 +- ktouch/src/ktouchleveldata.cpp | 52 +- ktouch/src/ktouchleveldata.h | 30 +- ktouch/src/ktouchopenrequest.cpp | 22 +- ktouch/src/ktouchopenrequest.h | 16 +- ktouch/src/ktouchslideline.cpp | 74 +-- ktouch/src/ktouchslideline.h | 42 +- ktouch/src/ktouchstatistics.cpp | 58 +- ktouch/src/ktouchstatistics.h | 2 +- ktouch/src/ktouchstatisticsdata.cpp | 148 ++--- ktouch/src/ktouchstatisticsdata.h | 54 +- ktouch/src/ktouchstatus.cpp | 10 +- ktouch/src/ktouchstatus.h | 4 +- ktouch/src/ktouchtrainer.cpp | 54 +- ktouch/src/ktouchtrainer.h | 20 +- ktouch/src/ktouchutils.cpp | 18 +- ktouch/src/ktouchutils.h | 6 +- ktouch/src/main.cpp | 4 +- kturtle/src/canvas.cpp | 130 ++--- kturtle/src/canvas.h | 30 +- kturtle/src/dialogs.cpp | 70 +-- kturtle/src/dialogs.h | 54 +- kturtle/src/executer.cpp | 32 +- kturtle/src/executer.h | 16 +- kturtle/src/kturtle.cpp | 306 +++++----- kturtle/src/kturtle.h | 34 +- kturtle/src/lexer.cpp | 38 +- kturtle/src/lexer.h | 20 +- kturtle/src/parser.cpp | 12 +- kturtle/src/parser.h | 10 +- kturtle/src/token.h | 8 +- kturtle/src/translate.cpp | 26 +- kturtle/src/translate.h | 12 +- kturtle/src/treenode.cpp | 6 +- kturtle/src/treenode.h | 10 +- kturtle/src/value.cpp | 14 +- kturtle/src/value.h | 14 +- kverbos/kverbos/kerfassen.cpp | 26 +- kverbos/kverbos/kerfassen.h | 4 +- kverbos/kverbos/kfeedercontrol.cpp | 12 +- kverbos/kverbos/kfeedercontrol.h | 4 +- kverbos/kverbos/kresult.cpp | 34 +- kverbos/kverbos/kresult.h | 2 +- kverbos/kverbos/kstartuplogo.cpp | 12 +- kverbos/kverbos/kstartuplogo.h | 8 +- kverbos/kverbos/kverbedit.cpp | 20 +- kverbos/kverbos/kverbedit.h | 2 +- kverbos/kverbos/kverbos.cpp | 100 ++-- kverbos/kverbos/kverbos.h | 4 +- kverbos/kverbos/kverbosdoc.cpp | 54 +- kverbos/kverbos/kverbosdoc.h | 20 +- kverbos/kverbos/kverbosoptions.cpp | 6 +- kverbos/kverbos/kverbosoptions.h | 2 +- kverbos/kverbos/kverbosuser.cpp | 22 +- kverbos/kverbos/kverbosuser.h | 18 +- kverbos/kverbos/kverbosview.cpp | 64 +- kverbos/kverbos/kverbosview.h | 18 +- kverbos/kverbos/verbspanish.cpp | 70 +-- kverbos/kverbos/verbspanish.h | 74 +-- kvoctrain/kvoctrain/common-dialogs/ProgressDlg.cpp | 6 +- kvoctrain/kvoctrain/common-dialogs/ProgressDlg.h | 8 +- .../kvoctrain/common-dialogs/blockoptions.cpp | 52 +- kvoctrain/kvoctrain/common-dialogs/blockoptions.h | 12 +- .../kvoctrain/common-dialogs/generaloptions.cpp | 4 +- .../kvoctrain/common-dialogs/generaloptions.h | 2 +- .../kvoctrain/common-dialogs/groupoptions.cpp | 6 +- kvoctrain/kvoctrain/common-dialogs/groupoptions.h | 2 +- .../kvoctrain/common-dialogs/kvoctrainprefs.cpp | 26 +- .../kvoctrain/common-dialogs/kvoctrainprefs.h | 2 +- .../kvoctrain/common-dialogs/languageoptions.cpp | 170 +++--- .../kvoctrain/common-dialogs/languageoptions.h | 38 +- .../kvoctrain/common-dialogs/pasteoptions.cpp | 40 +- kvoctrain/kvoctrain/common-dialogs/pasteoptions.h | 4 +- .../kvoctrain/common-dialogs/profilesdialog.cpp | 34 +- .../kvoctrain/common-dialogs/profilesdialog.h | 16 +- .../kvoctrain/common-dialogs/queryoptions.cpp | 12 +- kvoctrain/kvoctrain/common-dialogs/queryoptions.h | 2 +- .../kvoctrain/common-dialogs/thresholdoptions.cpp | 44 +- .../kvoctrain/common-dialogs/thresholdoptions.h | 2 +- kvoctrain/kvoctrain/common-dialogs/viewoptions.cpp | 4 +- kvoctrain/kvoctrain/common-dialogs/viewoptions.h | 2 +- .../kvoctrain/docprop-dialogs/DocOptionsPage.cpp | 6 +- .../kvoctrain/docprop-dialogs/DocOptionsPage.h | 2 +- kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.cpp | 34 +- kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.h | 34 +- .../kvoctrain/docprop-dialogs/DocPropLangDlg.cpp | 22 +- .../kvoctrain/docprop-dialogs/DocPropLangDlg.h | 6 +- .../kvoctrain/docprop-dialogs/LangPropPage.cpp | 94 +-- kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.h | 36 +- .../kvoctrain/docprop-dialogs/LessOptPage.cpp | 42 +- kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.h | 8 +- .../kvoctrain/docprop-dialogs/TenseOptPage.cpp | 46 +- kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.h | 6 +- kvoctrain/kvoctrain/docprop-dialogs/TitlePage.cpp | 28 +- kvoctrain/kvoctrain/docprop-dialogs/TitlePage.h | 30 +- .../kvoctrain/docprop-dialogs/TypeOptPage.cpp | 46 +- kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.h | 6 +- .../kvoctrain/docprop-dialogs/UsageOptPage.cpp | 56 +- kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.h | 6 +- kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.cpp | 16 +- kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.h | 8 +- .../kvoctrain/entry-dialogs/AuxInfoEntryPage.cpp | 40 +- .../kvoctrain/entry-dialogs/AuxInfoEntryPage.h | 36 +- .../kvoctrain/entry-dialogs/CommonEntryPage.cpp | 106 ++-- .../kvoctrain/entry-dialogs/CommonEntryPage.h | 64 +- kvoctrain/kvoctrain/entry-dialogs/EntryDlg.cpp | 142 ++--- kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h | 100 ++-- .../kvoctrain/entry-dialogs/FromToEntryPage.cpp | 82 +-- .../kvoctrain/entry-dialogs/FromToEntryPage.h | 22 +- kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.cpp | 24 +- kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.h | 12 +- kvoctrain/kvoctrain/entry-dialogs/MySpinBox.cpp | 10 +- kvoctrain/kvoctrain/entry-dialogs/MySpinBox.h | 14 +- .../kvoctrain/entry-dialogs/PhoneticEntryPage.cpp | 34 +- .../kvoctrain/entry-dialogs/PhoneticEntryPage.h | 10 +- .../kvoctrain/entry-dialogs/TenseEntryPage.cpp | 60 +- kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.h | 24 +- kvoctrain/kvoctrain/entry-dialogs/blockall.cpp | 4 +- kvoctrain/kvoctrain/entry-dialogs/blockall.h | 4 +- kvoctrain/kvoctrain/kva_clip.cpp | 34 +- kvoctrain/kvoctrain/kva_config.cpp | 30 +- kvoctrain/kvoctrain/kva_header.cpp | 96 +-- kvoctrain/kvoctrain/kva_init.cpp | 118 ++-- kvoctrain/kvoctrain/kva_io.cpp | 120 ++-- kvoctrain/kvoctrain/kva_query.cpp | 70 +-- kvoctrain/kvoctrain/kvoctrain.cpp | 180 +++--- kvoctrain/kvoctrain/kvoctrain.h | 42 +- kvoctrain/kvoctrain/kvoctraintable.cpp | 122 ++-- kvoctrain/kvoctrain/kvoctraintable.h | 40 +- kvoctrain/kvoctrain/kvoctraintableitem.cpp | 28 +- kvoctrain/kvoctrain/kvoctraintableitem.h | 8 +- kvoctrain/kvoctrain/kvoctrainview.cpp | 92 +-- kvoctrain/kvoctrain/kvoctrainview.h | 12 +- kvoctrain/kvoctrain/kvt-core/LineList.cpp | 12 +- kvoctrain/kvoctrain/kvt-core/LineList.h | 12 +- kvoctrain/kvoctrain/kvt-core/MultipleChoice.cpp | 12 +- kvoctrain/kvoctrain/kvt-core/MultipleChoice.h | 36 +- kvoctrain/kvoctrain/kvt-core/QueryManager.cpp | 48 +- kvoctrain/kvoctrain/kvt-core/QueryManager.h | 38 +- kvoctrain/kvoctrain/kvt-core/UsageManager.cpp | 12 +- kvoctrain/kvoctrain/kvt-core/UsageManager.h | 16 +- kvoctrain/kvoctrain/kvt-core/grammarmanager.cpp | 118 ++-- kvoctrain/kvoctrain/kvt-core/grammarmanager.h | 124 ++-- kvoctrain/kvoctrain/kvt-core/kvd_csv.cpp | 50 +- kvoctrain/kvoctrain/kvt-core/kvd_lex.cpp | 48 +- kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml1.cpp | 106 ++-- kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml2.cpp | 36 +- kvoctrain/kvoctrain/kvt-core/kvd_rh_kvtml.cpp | 64 +- kvoctrain/kvoctrain/kvt-core/kvd_vcb.cpp | 38 +- kvoctrain/kvoctrain/kvt-core/kvd_voc.cpp | 12 +- kvoctrain/kvoctrain/kvt-core/kvd_wkvtml.cpp | 62 +- kvoctrain/kvoctrain/kvt-core/kvoctraindoc.cpp | 152 ++--- kvoctrain/kvoctrain/kvt-core/kvoctraindoc.h | 208 +++---- kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.cpp | 58 +- kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.h | 76 +-- .../kvoctrain/kvt-core/kvt-xml/XmlTokenizer.h | 2 +- kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlWriter.h | 2 +- .../kvoctrain/kvt-core/kvt-xml/koxml_config.h | 4 +- kvoctrain/kvoctrain/kvt-core/langset.cpp | 52 +- kvoctrain/kvoctrain/kvt-core/langset.h | 46 +- kvoctrain/kvoctrain/kvtnewstuff.cpp | 30 +- kvoctrain/kvoctrain/kvtnewstuff.h | 12 +- kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.cpp | 46 +- kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.h | 12 +- kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.cpp | 44 +- kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.h | 6 +- kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.cpp | 48 +- kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.h | 10 +- kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.cpp | 128 ++-- kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.h | 34 +- .../kvoctrain/query-dialogs/RandomQueryDlg.cpp | 126 ++-- kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.h | 26 +- .../kvoctrain/query-dialogs/SimpleQueryDlg.cpp | 30 +- kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.h | 4 +- kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.cpp | 102 ++-- kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.h | 26 +- kvoctrain/kvoctrain/spotlight2kvtml.cpp | 32 +- .../kvoctrain/statistik-dialogs/GenStatPage.cpp | 10 +- .../kvoctrain/statistik-dialogs/GenStatPage.h | 2 +- .../kvoctrain/statistik-dialogs/StatistikDlg.cpp | 14 +- .../kvoctrain/statistik-dialogs/StatistikDlg.h | 2 +- .../kvoctrain/statistik-dialogs/StatistikPage.cpp | 46 +- .../kvoctrain/statistik-dialogs/StatistikPage.h | 8 +- kvoctrain/kvoctrain/tools/extractlang.cpp | 30 +- kwordquiz/src/dlglanguage.cpp | 8 +- kwordquiz/src/dlglanguage.h | 6 +- kwordquiz/src/dlgrc.cpp | 8 +- kwordquiz/src/dlgrc.h | 2 +- kwordquiz/src/dlgsort.cpp | 6 +- kwordquiz/src/dlgsort.h | 4 +- kwordquiz/src/dlgspecchar.cpp | 14 +- kwordquiz/src/dlgspecchar.h | 14 +- kwordquiz/src/flashview.cpp | 14 +- kwordquiz/src/flashview.h | 4 +- kwordquiz/src/keduvocdata.cpp | 36 +- kwordquiz/src/keduvocdata.h | 22 +- kwordquiz/src/kvtmlwriter.cpp | 32 +- kwordquiz/src/kvtmlwriter.h | 18 +- kwordquiz/src/kwordquiz.cpp | 236 ++++---- kwordquiz/src/kwordquiz.h | 14 +- kwordquiz/src/kwordquizdoc.cpp | 82 +-- kwordquiz/src/kwordquizdoc.h | 4 +- kwordquiz/src/kwordquizprefs.cpp | 70 +-- kwordquiz/src/kwordquizprefs.h | 4 +- kwordquiz/src/kwordquizview.cpp | 188 +++--- kwordquiz/src/kwordquizview.h | 38 +- kwordquiz/src/kwqnewstuff.cpp | 30 +- kwordquiz/src/kwqnewstuff.h | 12 +- kwordquiz/src/main.cpp | 4 +- kwordquiz/src/multipleview.cpp | 16 +- kwordquiz/src/multipleview.h | 2 +- kwordquiz/src/paukerreader.cpp | 32 +- kwordquiz/src/paukerreader.h | 22 +- kwordquiz/src/prefcardappearance.cpp | 16 +- kwordquiz/src/prefcardappearance.h | 12 +- kwordquiz/src/prefcharacter.cpp | 2 +- kwordquiz/src/prefcharacter.h | 2 +- kwordquiz/src/prefeditor.cpp | 2 +- kwordquiz/src/prefeditor.h | 2 +- kwordquiz/src/prefquiz.cpp | 6 +- kwordquiz/src/prefquiz.h | 2 +- kwordquiz/src/qaview.cpp | 32 +- kwordquiz/src/qaview.h | 4 +- kwordquiz/src/wqlreader.cpp | 28 +- kwordquiz/src/wqlreader.h | 34 +- kwordquiz/src/wqlwriter.cpp | 42 +- kwordquiz/src/wqlwriter.h | 20 +- kwordquiz/src/wqprintdialogpage.cpp | 40 +- kwordquiz/src/wqprintdialogpage.h | 16 +- kwordquiz/src/wqquiz.cpp | 76 +-- kwordquiz/src/wqquiz.h | 28 +- kwordquiz/src/wqscore.cpp | 16 +- kwordquiz/src/wqscore.h | 10 +- kwordquiz/src/wqundo.h | 20 +- libkdeedu/extdate/extcalendarsystem.cpp | 26 +- libkdeedu/extdate/extcalendarsystem.h | 42 +- libkdeedu/extdate/extcalendarsystemgregorian.cpp | 24 +- libkdeedu/extdate/extcalendarsystemgregorian.h | 18 +- libkdeedu/extdate/extdatepicker.cpp | 162 +++--- libkdeedu/extdate/extdatepicker.h | 30 +- libkdeedu/extdate/extdatetbl.cpp | 168 +++--- libkdeedu/extdate/extdatetbl.h | 78 +-- libkdeedu/extdate/extdatetime.cpp | 134 ++--- libkdeedu/extdate/extdatetime.h | 70 +-- libkdeedu/extdate/extdatetimeedit.cpp | 400 ++++++------- libkdeedu/extdate/extdatetimeedit.h | 104 ++-- libkdeedu/extdate/extdatewidget.cpp | 46 +- libkdeedu/extdate/extdatewidget.h | 6 +- libkdeedu/extdate/main.cpp | 2 +- libkdeedu/extdate/test_extdate.cc | 38 +- libkdeedu/extdate/testwidget.cpp | 22 +- libkdeedu/extdate/testwidget.h | 6 +- libkdeedu/kdeeducore/keduvocdata.cpp | 30 +- libkdeedu/kdeeducore/keduvocdata.h | 18 +- libkdeedu/kdeeduplot/kplotaxis.cpp | 4 +- libkdeedu/kdeeduplot/kplotaxis.h | 16 +- libkdeedu/kdeeduplot/kplotobject.cpp | 4 +- libkdeedu/kdeeduplot/kplotobject.h | 30 +- libkdeedu/kdeeduplot/kplotwidget.cpp | 60 +- libkdeedu/kdeeduplot/kplotwidget.h | 38 +- libkdeedu/kdeeduui/kdeeduglossary.cpp | 140 ++--- libkdeedu/kdeeduui/kdeeduglossary.h | 74 +-- 959 files changed, 18039 insertions(+), 18039 deletions(-) diff --git a/blinken/src/artsplayer.cpp b/blinken/src/artsplayer.cpp index b9632737..ef072e27 100644 --- a/blinken/src/artsplayer.cpp +++ b/blinken/src/artsplayer.cpp @@ -7,7 +7,7 @@ * (at your option) any later version. * ***************************************************************************/ -#include +#include #include @@ -22,8 +22,8 @@ artsPlayer::artsPlayer() : m_playobj(0) { - m_endChecker = new QTimer(this); - connect(m_endChecker, SIGNAL(timeout()), this, SLOT(checkEnded())); + m_endChecker = new TQTimer(this); + connect(m_endChecker, TQT_SIGNAL(timeout()), this, TQT_SLOT(checkEnded())); #ifndef WITHOUT_ARTS m_dispatcher = new KArtsDispatcher; @@ -87,7 +87,7 @@ void artsPlayer::play(blinkenGame::color c, bool stopCurrent) void artsPlayer::play() { #ifndef WITHOUT_ARTS - QString path; + TQString path; blinkenGame::color c = m_nextSounds.first(); m_nextSounds.pop_front(); switch (c) diff --git a/blinken/src/artsplayer.h b/blinken/src/artsplayer.h index d502ddbd..5668fc6c 100644 --- a/blinken/src/artsplayer.h +++ b/blinken/src/artsplayer.h @@ -28,7 +28,7 @@ namespace KDE #include #endif -#include +#include #include "blinkengame.h" @@ -51,11 +51,11 @@ Q_OBJECT void checkEnded(); private: - QValueList m_nextSounds; + TQValueList m_nextSounds; - QString m_greenPath, m_redPath, m_bluePath, m_yellowPath, m_allPath; + TQString m_greenPath, m_redPath, m_bluePath, m_yellowPath, m_allPath; - QTimer *m_endChecker; + TQTimer *m_endChecker; KArtsDispatcher *m_dispatcher; KArtsServer *m_server; diff --git a/blinken/src/blinken.cpp b/blinken/src/blinken.cpp index 997895fa..202a9a99 100644 --- a/blinken/src/blinken.cpp +++ b/blinken/src/blinken.cpp @@ -7,10 +7,10 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -30,52 +30,52 @@ #include "highscoredialog.h" #include "settings.h" -blinken::blinken() : QWidget(0, 0, WStaticContents | WNoAutoErase), m_overHighscore(false), m_overQuit(false), m_overCentralText(false), m_overMenu(false), m_overAboutKDE(false), m_overAboutBlinken(false), m_overManual(false), m_overCentralLetters(false), m_overCounter(false), m_overFont(false), m_overSound(false), m_showPreferences(false), m_updateButtonHighlighting(false), m_highlighted(blinkenGame::none) +blinken::blinken() : TQWidget(0, 0, WStaticContents | WNoAutoErase), m_overHighscore(false), m_overQuit(false), m_overCentralText(false), m_overMenu(false), m_overAboutKDE(false), m_overAboutBlinken(false), m_overManual(false), m_overCentralLetters(false), m_overCounter(false), m_overFont(false), m_overSound(false), m_showPreferences(false), m_updateButtonHighlighting(false), m_highlighted(blinkenGame::none) { - m_back = new QPixmap(locate("appdata", "images/blinken.png")); + m_back = new TQPixmap(locate("appdata", "images/blinken.png")); m_buttons[0] = new button(blinkenGame::blue); m_buttons[1] = new button(blinkenGame::yellow); m_buttons[2] = new button(blinkenGame::red); m_buttons[3] = new button(blinkenGame::green); - m_highscore = new QPixmap(locate("appdata", "images/highscore.png")); - m_highscoreHover = new QPixmap(locate("appdata", "images/highscore_hover.png")); - m_quit = new QPixmap(locate("appdata", "images/quit.png")); - m_quitHover = new QPixmap(locate("appdata", "images/quit_hover.png")); - m_menu = new QPixmap(locate("appdata", "images/menu.png")); - m_menuHover = new QPixmap(locate("appdata", "images/menu_hover.png")); - m_mark = new QPixmap(locate("appdata", "images/mark.png")); - m_highscoreRect = QRect(10, 10, 72, 72); - m_quitRect = QRect(562, 10, 72, 73); - m_menuRect = QRect(562, 443, 72, 72); - m_aboutKDERect = QRect(452, 461, 54, 54); - m_aboutBlinkenRect = QRect(506, 461, 56, 54); - m_manualRect = QRect(578, 389, 54, 54); - m_centralLettersRect = QRect(192, 194, 254, 54); - m_counterRect = QRect(268, 110, 102, 52); - - m_fillColor = QColor(40, 40, 40); - m_fontColor = QColor(126, 126, 126); - m_fontHighlightColor = QColor(230, 230, 230); - m_countDownColor = QColor(55, 55, 55); + m_highscore = new TQPixmap(locate("appdata", "images/highscore.png")); + m_highscoreHover = new TQPixmap(locate("appdata", "images/highscore_hover.png")); + m_quit = new TQPixmap(locate("appdata", "images/quit.png")); + m_quitHover = new TQPixmap(locate("appdata", "images/quit_hover.png")); + m_menu = new TQPixmap(locate("appdata", "images/menu.png")); + m_menuHover = new TQPixmap(locate("appdata", "images/menu_hover.png")); + m_mark = new TQPixmap(locate("appdata", "images/mark.png")); + m_highscoreRect = TQRect(10, 10, 72, 72); + m_quitRect = TQRect(562, 10, 72, 73); + m_menuRect = TQRect(562, 443, 72, 72); + m_aboutKDERect = TQRect(452, 461, 54, 54); + m_aboutBlinkenRect = TQRect(506, 461, 56, 54); + m_manualRect = TQRect(578, 389, 54, 54); + m_centralLettersRect = TQRect(192, 194, 254, 54); + m_counterRect = TQRect(268, 110, 102, 52); + + m_fillColor = TQColor(40, 40, 40); + m_fontColor = TQColor(126, 126, 126); + m_fontHighlightColor = TQColor(230, 230, 230); + m_countDownColor = TQColor(55, 55, 55); setMouseTracking(true); setFixedSize(644, 525); show(); - m_unhighlighter = new QTimer(this); - connect(m_unhighlighter, SIGNAL(timeout()), this, SLOT(unhighlight())); + m_unhighlighter = new TQTimer(this); + connect(m_unhighlighter, TQT_SIGNAL(timeout()), this, TQT_SLOT(unhighlight())); - connect(&m_game, SIGNAL(gameEnded()), this, SLOT(checkHS())); - connect(&m_game, SIGNAL(phaseChanged()), this, SLOT(update())); - connect(&m_game, SIGNAL(highlight(blinkenGame::color, bool)), this, SLOT(highlight(blinkenGame::color, bool))); + connect(&m_game, TQT_SIGNAL(gameEnded()), this, TQT_SLOT(checkHS())); + connect(&m_game, TQT_SIGNAL(phaseChanged()), this, TQT_SLOT(update())); + connect(&m_game, TQT_SIGNAL(highlight(blinkenGame::color, bool)), this, TQT_SLOT(highlight(blinkenGame::color, bool))); m_helpMenu = new KHelpMenu(this, kapp->aboutData()); for (int i = 0; i < 3; i++) m_overLevels[i] = false; - QString aux = i18n("If the Steve font that is used by bliken by default to show status messages does not support any of the characters of your language, please translate that message to 1 and KDE standard font will be used to show the texts, if not translate it to 0", "0"); + TQString aux = i18n("If the Steve font that is used by bliken by default to show status messages does not support any of the characters of your language, please translate that message to 1 and KDE standard font will be used to show the texts, if not translate it to 0", "0"); m_alwaysUseNonCoolFont = aux == "1"; } @@ -94,22 +94,22 @@ blinken::~blinken() delete m_helpMenu; } -void blinken::paintEvent(QPaintEvent *) +void blinken::paintEvent(TQPaintEvent *) { - QPixmap buf(width(), height()); - QPainter p(&buf); + TQPixmap buf(width(), height()); + TQPainter p(&buf); p.drawPixmap(0, 0, *m_back); drawMenuQuit(p); - QFont f1, f = p.font(); + TQFont f1, f = p.font(); f1 = f; f.setBold(true); p.setFont(f); switch (m_game.phase()) { case blinkenGame::starting: - drawText(p, i18n("Start"), QPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false); + drawText(p, i18n("Start"), TQPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false); break; case blinkenGame::choosingLevel: @@ -121,7 +121,7 @@ void blinken::paintEvent(QPaintEvent *) case blinkenGame::waiting1: case blinkenGame::learningTheSequence: case blinkenGame::typingTheSequence: - drawText(p, i18n("Restart"), QPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false); + drawText(p, i18n("Restart"), TQPoint(318, 316), true, 10, 5, &m_centralTextRect, m_overCentralText, false); break; } p.setFont(f1); @@ -129,14 +129,14 @@ void blinken::paintEvent(QPaintEvent *) if (m_showPreferences) { // draw the current keys - drawText(p, m_buttons[0]->shortcut(), QPoint(115, 285), true, 20, 5, 0, m_buttons[0]->selected(), false); - drawText(p, m_buttons[1]->shortcut(), QPoint(115, 155), true, 20, 5, 0, m_buttons[1]->selected(), false); - drawText(p, m_buttons[2]->shortcut(), QPoint(520, 155), true, 20, 5, 0, m_buttons[2]->selected(), false); - drawText(p, m_buttons[3]->shortcut(), QPoint(520, 285), true, 20, 5, 0, m_buttons[3]->selected(), false); - - const QPen &oPen = p.pen(); - const QBrush &oBrush = p.brush(); - const QFont &oFont = p.font(); + drawText(p, m_buttons[0]->shortcut(), TQPoint(115, 285), true, 20, 5, 0, m_buttons[0]->selected(), false); + drawText(p, m_buttons[1]->shortcut(), TQPoint(115, 155), true, 20, 5, 0, m_buttons[1]->selected(), false); + drawText(p, m_buttons[2]->shortcut(), TQPoint(520, 155), true, 20, 5, 0, m_buttons[2]->selected(), false); + drawText(p, m_buttons[3]->shortcut(), TQPoint(520, 285), true, 20, 5, 0, m_buttons[3]->selected(), false); + + const TQPen &oPen = p.pen(); + const TQBrush &oBrush = p.brush(); + const TQFont &oFont = p.font(); // draw the internal square plus a bit of ellipse on the sides and the // two delimiter lines @@ -144,16 +144,16 @@ void blinken::paintEvent(QPaintEvent *) p.setBrush(m_fillColor); p.drawPie(169, 192, 4, 58, 1440, 2880); p.drawPie(465, 192, 4, 58, -1440, 2880); - p.setPen(QPen(Qt::black, 3)); + p.setPen(TQPen(Qt::black, 3)); p.fillRect(171, 192, 296, 58, m_fillColor); p.drawLine(169, 192, 469, 192); p.drawLine(169, 250, 469, 250); // draw the two squares of the options - p.setPen(QPen(m_fontColor, 2, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin)); + p.setPen(TQPen(m_fontColor, 2, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin)); - m_soundRect = QRect(181, 209, 25, 25); - m_fontRect = QRect(432, 209, 25, 25); + m_soundRect = TQRect(181, 209, 25, 25); + m_fontRect = TQRect(432, 209, 25, 25); #ifndef WITHOUT_ARTS p.drawRect(m_soundRect); if (blinkenSettings::playSounds()) @@ -173,25 +173,25 @@ void blinken::paintEvent(QPaintEvent *) } // draw the options' text - QFont f1 = QFont(); + TQFont f1 = TQFont(); p.setFont(f1); int size, sizeAux; - QRect area; - QString sounds = i18n("Sounds"); - QString font = i18n("Font"); + TQRect area; + TQString sounds = i18n("Sounds"); + TQString font = i18n("Font"); size = fontUtils::fontSize(p, sounds, 95, 20); sizeAux = fontUtils::fontSize(p, font, 95, 20); if (sizeAux > size) size = sizeAux; f1.setPointSize(size); #ifndef WITHOUT_ARTS - area = p.boundingRect(QRect(), Qt::AlignAuto, sounds); + area = p.boundingRect(TQRect(), Qt::AlignAuto, sounds); area.moveBy(212, 221 - (area.height() / 2)); p.drawText(area, Qt::AlignCenter, sounds); m_soundRect = m_soundRect.unite(area); #endif if (!m_alwaysUseNonCoolFont) { - area = p.boundingRect(QRect(), Qt::AlignAuto, font); + area = p.boundingRect(TQRect(), Qt::AlignAuto, font); area.moveBy(426 - area.width(), 221 - (area.height() / 2)); p.drawText(area, Qt::AlignCenter, font); m_fontRect = m_fontRect.unite(area); @@ -213,10 +213,10 @@ void blinken::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, &buf); - if (m_updateButtonHighlighting) updateButtonHighlighting(mapFromGlobal(QCursor::pos())); + if (m_updateButtonHighlighting) updateButtonHighlighting(mapFromGlobal(TQCursor::pos())); } -void blinken::keyPressEvent(QKeyEvent *e) +void blinken::keyPressEvent(TQKeyEvent *e) { if (e -> isAutoRepeat()) return; @@ -263,7 +263,7 @@ void blinken::keyPressEvent(QKeyEvent *e) } } -void blinken::keyReleaseEvent(QKeyEvent *e) +void blinken::keyReleaseEvent(TQKeyEvent *e) { if (e -> isAutoRepeat()) return; @@ -271,17 +271,17 @@ void blinken::keyReleaseEvent(QKeyEvent *e) { m_showPreferences = !m_showPreferences; for (int i = 0; i < 4; i++) m_buttons[i] -> setSelected(false); - updateButtonHighlighting(mapFromGlobal(QCursor::pos())); + updateButtonHighlighting(mapFromGlobal(TQCursor::pos())); update(); } } -void blinken::mouseMoveEvent(QMouseEvent *e) +void blinken::mouseMoveEvent(TQMouseEvent *e) { updateButtonHighlighting(e->pos()); } -void blinken::mousePressEvent(QMouseEvent *e) +void blinken::mousePressEvent(TQMouseEvent *e) { if (m_overHighscore || m_overCounter) { @@ -328,8 +328,8 @@ void blinken::mousePressEvent(QMouseEvent *e) } } - QPoint p = e->pos(); - p -= QPoint(319, 221); + TQPoint p = e->pos(); + p -= TQPoint(319, 221); if (insideGreen(p)) { if (m_showPreferences) selectButton(3); @@ -358,7 +358,7 @@ void blinken::checkHS() if (hsd->scoreGoodEnough(m_game.level(), m_game.score())) { bool ok; - QString name = KInputDialog::getText(i18n("Enter Your Name"), i18n("Name:"), m_lastName, &ok); + TQString name = KInputDialog::getText(i18n("Enter Your Name"), i18n("Name:"), m_lastName, &ok); if (!name.isNull() && ok) { m_lastName = name; @@ -376,7 +376,7 @@ void blinken::highlight(blinkenGame::color c, bool unhighlight) else if (c == blinkenGame::none) { m_unhighlighter -> stop(); - updateCursor(mapFromGlobal(QCursor::pos())); + updateCursor(mapFromGlobal(TQCursor::pos())); } } @@ -446,27 +446,27 @@ void blinken::selectButton(int button) } } -bool blinken::insideGreen(const QPoint &p) const +bool blinken::insideGreen(const TQPoint &p) const { return insideButtonsArea(p) && p.x() > 6 && p.y() > 6; } -bool blinken::insideBlue(const QPoint &p) const +bool blinken::insideBlue(const TQPoint &p) const { return insideButtonsArea(p) && p.x() < -6 && p.y() > 6; } -bool blinken::insideYellow(const QPoint &p) const +bool blinken::insideYellow(const TQPoint &p) const { return insideButtonsArea(p) && p.x() < -6 && p.y() < -6; } -bool blinken::insideRed(const QPoint &p) const +bool blinken::insideRed(const TQPoint &p) const { return insideButtonsArea(p) && p.x() > 6 && p.y() < -6; } -bool blinken::insideButtonsArea(const QPoint &p) const +bool blinken::insideButtonsArea(const TQPoint &p) const { double x, y, x2, y2; x = (double)p.x(); @@ -484,7 +484,7 @@ bool blinken::insideButtonsArea(const QPoint &p) const return false; } -void blinken::drawMenuQuit(QPainter &p) +void blinken::drawMenuQuit(TQPainter &p) { if (!m_overHighscore) p.drawPixmap(10, 10, *m_highscore); else p.drawPixmap(10, 10, *m_highscoreHover); @@ -507,9 +507,9 @@ void blinken::drawMenuQuit(QPainter &p) } } -void blinken::drawScoreAndCounter(QPainter &p) +void blinken::drawScoreAndCounter(TQPainter &p) { - QColor c1, c2, c3; + TQColor c1, c2, c3; p.translate(268, 110); switch (m_game.phase()) @@ -544,14 +544,14 @@ void blinken::drawScoreAndCounter(QPainter &p) p.translate(-268, -110); } -void blinken::drawStatusText(QPainter &p) +void blinken::drawStatusText(TQPainter &p) { p.translate(25, 505); p.rotate(-3.29); p.setPen(blue); - QString restartText = i18n("Restart the game"); - QString text; + TQString restartText = i18n("Restart the game"); + TQString text; if (m_overQuit) text = i18n("Quit blinKen"); else if (m_overHighscore || m_overCounter) text = i18n("View Highscore Table"); else if (m_overAboutBlinken || m_overCentralLetters) text = m_helpMenu -> menu() -> text(KHelpMenu::menuAboutApp).remove("&"); @@ -603,50 +603,50 @@ void blinken::drawStatusText(QPainter &p) } } - QFont f; - if (blinkenSettings::customFont() && !m_alwaysUseNonCoolFont) f = QFont("Steve"); + TQFont f; + if (blinkenSettings::customFont() && !m_alwaysUseNonCoolFont) f = TQFont("Steve"); p.setFont(f); f.setPointSize(fontUtils::fontSize(p, text, 380, 30)); p.setFont(f); p.drawText(0, 0, text); } -void blinken::drawLevel(QPainter &p) +void blinken::drawLevel(TQPainter &p) { - QString n[3]; + TQString n[3]; n[0] = i18n("2"); n[1] = i18n("1"); n[2] = i18n("?"); - drawText(p, i18n("Level"), QPoint(322, 281), false, 0, 0, 0, false, true); + drawText(p, i18n("Level"), TQPoint(322, 281), false, 0, 0, 0, false, true); - QPoint cp; + TQPoint cp; for (int i = 0; i < 3; i++) { - if (i == 0) cp = QPoint(319, 315); - else if (i == 1) cp = QPoint(m_levelsRect[0].left() - m_levelsRect[0].width(), 315); - else if (i == 2) cp = QPoint(m_levelsRect[0].right() + m_levelsRect[0].width(), 315); + if (i == 0) cp = TQPoint(319, 315); + else if (i == 1) cp = TQPoint(m_levelsRect[0].left() - m_levelsRect[0].width(), 315); + else if (i == 2) cp = TQPoint(m_levelsRect[0].right() + m_levelsRect[0].width(), 315); drawText(p, n[i], cp, true, 20, 5, &(m_levelsRect[i]), m_overLevels[i], true); } } -void blinken::drawText(QPainter &p, const QString &text, const QPoint ¢er, bool withMargin, int xMargin, int yMargin, QRect *rect, bool highlight, bool bold) +void blinken::drawText(TQPainter &p, const TQString &text, const TQPoint ¢er, bool withMargin, int xMargin, int yMargin, TQRect *rect, bool highlight, bool bold) { - QRect r; - QFont oldFont, f = p.font(); + TQRect r; + TQFont oldFont, f = p.font(); oldFont = f; f.setPointSize(fontUtils::fontSize(p, text, 190, 30)); if (bold) f.setBold(true); p.setFont(f); - r = p.boundingRect(QRect(), Qt::AlignAuto, text); - r = QRect(0, 0, r.width() + xMargin, r.height() + yMargin); + r = p.boundingRect(TQRect(), Qt::AlignAuto, text); + r = TQRect(0, 0, r.width() + xMargin, r.height() + yMargin); r.moveBy(center.x() - r.width() / 2, center.y() - r.height() / 2); if (withMargin) { p.fillRect(r, m_fillColor); - p.setPen(QPen(black, 3)); + p.setPen(TQPen(black, 3)); p.drawRoundRect(r.left(), r.top(), r.width(), r.height(), 15, 15); } @@ -659,7 +659,7 @@ void blinken::drawText(QPainter &p, const QString &text, const QPoint ¢er, b } -void blinken::updateButtonHighlighting(const QPoint &p) +void blinken::updateButtonHighlighting(const TQPoint &p) { bool haveToUpdate; m_updateButtonHighlighting = false; @@ -844,9 +844,9 @@ void blinken::updateButtonHighlighting(const QPoint &p) if (haveToUpdate) update(); } -void blinken::updateCursor(const QPoint &p) +void blinken::updateCursor(const TQPoint &p) { - QPoint p2 = p - QPoint(319, 221); + TQPoint p2 = p - TQPoint(319, 221); if (m_overHighscore || m_overQuit || m_overCentralText || m_overMenu || m_overAboutKDE || m_overAboutBlinken || m_overManual || m_overLevels[0] || m_overLevels[1] || m_overLevels[2] || m_overCentralLetters || m_overCounter || (m_game.canType() && (insideGreen(p2) || insideRed(p2) || insideBlue(p2) || insideYellow(p2))) || m_overFont || m_overSound) setCursor(PointingHandCursor); else setCursor(ArrowCursor); diff --git a/blinken/src/blinken.h b/blinken/src/blinken.h index a6ea2199..5a076d8f 100644 --- a/blinken/src/blinken.h +++ b/blinken/src/blinken.h @@ -10,7 +10,7 @@ #ifndef BLINKEN_H #define BLINKEN_H -#include +#include #include "blinkengame.h" @@ -30,11 +30,11 @@ Q_OBJECT ~blinken(); protected: - void paintEvent(QPaintEvent *); - void mouseMoveEvent(QMouseEvent *e); - void mousePressEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *e); - void keyReleaseEvent(QKeyEvent *e); + void paintEvent(TQPaintEvent *); + void mouseMoveEvent(TQMouseEvent *e); + void mousePressEvent(TQMouseEvent *e); + void keyPressEvent(TQKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); private slots: void checkHS(); @@ -48,27 +48,27 @@ Q_OBJECT private: void selectButton(int button); - bool insideGreen(const QPoint &p) const; - bool insideYellow(const QPoint &p) const; - bool insideRed(const QPoint &p) const; - bool insideBlue(const QPoint &p) const; - bool insideButtonsArea(const QPoint &p) const; - void updateCursor(const QPoint &p); + bool insideGreen(const TQPoint &p) const; + bool insideYellow(const TQPoint &p) const; + bool insideRed(const TQPoint &p) const; + bool insideBlue(const TQPoint &p) const; + bool insideButtonsArea(const TQPoint &p) const; + void updateCursor(const TQPoint &p); - void drawMenuQuit(QPainter &p); - void drawScoreAndCounter(QPainter &p); - void drawStatusText(QPainter &p); - void drawLevel(QPainter &p); - void drawText(QPainter &p, const QString &text, const QPoint ¢er, bool withMargin, int xMargin, int yMargin, QRect *rect, bool highlight, bool bold); - void updateButtonHighlighting(const QPoint &p); + void drawMenuQuit(TQPainter &p); + void drawScoreAndCounter(TQPainter &p); + void drawStatusText(TQPainter &p); + void drawLevel(TQPainter &p); + void drawText(TQPainter &p, const TQString &text, const TQPoint ¢er, bool withMargin, int xMargin, int yMargin, TQRect *rect, bool highlight, bool bold); + void updateButtonHighlighting(const TQPoint &p); button *m_buttons[4]; - QPixmap *m_back, *m_highscore, *m_highscoreHover, *m_quit, *m_quitHover, *m_menu, *m_menuHover, *m_mark; + TQPixmap *m_back, *m_highscore, *m_highscoreHover, *m_quit, *m_quitHover, *m_menu, *m_menuHover, *m_mark; bool m_overHighscore, m_overQuit, m_overCentralText, m_overMenu, m_overAboutKDE, m_overAboutBlinken, m_overManual, m_overLevels[3], m_overCentralLetters, m_overCounter, m_overFont, m_overSound; // i obviously suck but m_levelsRect[0] is 2, m_levelsRect[1] is 1 and m_levelsRect[3] is ? - QRect m_highscoreRect, m_quitRect, m_centralTextRect, m_menuRect, m_aboutKDERect, m_aboutBlinkenRect, m_manualRect, m_levelsRect[3], m_centralLettersRect, m_counterRect, m_soundRect, m_fontRect; - QColor m_fillColor, m_fontColor, m_fontHighlightColor, m_countDownColor; + TQRect m_highscoreRect, m_quitRect, m_centralTextRect, m_menuRect, m_aboutKDERect, m_aboutBlinkenRect, m_manualRect, m_levelsRect[3], m_centralLettersRect, m_counterRect, m_soundRect, m_fontRect; + TQColor m_fillColor, m_fontColor, m_fontHighlightColor, m_countDownColor; // Preferences setting handling bool m_showPreferences; @@ -80,9 +80,9 @@ Q_OBJECT bool m_alwaysUseNonCoolFont; blinkenGame::color m_highlighted; - QTimer *m_unhighlighter; + TQTimer *m_unhighlighter; - QString m_lastName; + TQString m_lastName; blinkenGame m_game; diff --git a/blinken/src/blinkengame.cpp b/blinken/src/blinkengame.cpp index d1ec463b..280efcd8 100644 --- a/blinken/src/blinkengame.cpp +++ b/blinken/src/blinkengame.cpp @@ -9,7 +9,7 @@ #include // for RAND_MAX -#include +#include #include @@ -19,8 +19,8 @@ blinkenGame::blinkenGame() : m_phase(starting) { m_artsPlayer = new artsPlayer; - m_waitTimer = new QTimer(this); - connect(m_waitTimer, SIGNAL(timeout()), this, SLOT(waiting())); + m_waitTimer = new TQTimer(this); + connect(m_waitTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(waiting())); } blinkenGame::~blinkenGame() @@ -114,8 +114,8 @@ void blinkenGame::nextSound() void blinkenGame::soundEnded() { - QTimer::singleShot(100, this, SLOT(nextSound())); - QTimer::singleShot(50, this, SLOT(unhighlight())); + TQTimer::singleShot(100, this, TQT_SLOT(nextSound())); + TQTimer::singleShot(50, this, TQT_SLOT(unhighlight())); } void blinkenGame::unhighlight() @@ -135,7 +135,7 @@ void blinkenGame::waiting() } else m_sequence.append(generateColor()); - connect(m_artsPlayer, SIGNAL(ended()), this, SLOT(soundEnded())); + connect(m_artsPlayer, TQT_SIGNAL(ended()), this, TQT_SLOT(soundEnded())); m_nextColor = m_sequence.begin(); soundEnded(); } diff --git a/blinken/src/blinkengame.h b/blinken/src/blinkengame.h index 7a0f2941..23feffae 100644 --- a/blinken/src/blinkengame.h +++ b/blinken/src/blinkengame.h @@ -10,8 +10,8 @@ #ifndef BLINKENGAME_H #define BLINKENGAME_H -#include -#include +#include +#include class QTimer; @@ -62,11 +62,11 @@ Q_OBJECT int m_level; int m_sequenceLength; - QTimer *m_waitTimer; + TQTimer *m_waitTimer; artsPlayer *m_artsPlayer; - QValueList m_sequence; - QValueList::const_iterator m_nextColor; + TQValueList m_sequence; + TQValueList::const_iterator m_nextColor; }; #endif diff --git a/blinken/src/button.cpp b/blinken/src/button.cpp index b359e953..406112eb 100644 --- a/blinken/src/button.cpp +++ b/blinken/src/button.cpp @@ -19,8 +19,8 @@ button::button(blinkenGame::color c) : m_selected(false), m_color(c) { KConfig *kc = kapp->config(); kc->setGroup("General"); - QString cs = getColorString(); - QString pixmap = QString("images/%1h.png").arg(cs); + TQString cs = getColorString(); + TQString pixmap = TQString("images/%1h.png").arg(cs); switch (c) { @@ -45,7 +45,7 @@ button::button(blinkenGame::color c) : m_selected(false), m_color(c) break; } - m_highlighted = new QPixmap(locate("appdata", pixmap)); + m_highlighted = new TQPixmap(locate("appdata", pixmap)); } button::~button() @@ -64,7 +64,7 @@ void button::setShortcut(int key) kc->sync(); } -QString button::shortcut() const +TQString button::shortcut() const { return KShortcut(m_key).toString(); } @@ -84,12 +84,12 @@ bool button::selected() const return m_selected; } -QPixmap *button::pixmap() const +TQPixmap *button::pixmap() const { return m_highlighted; } -QString button::getColorString() const +TQString button::getColorString() const { switch (m_color) { @@ -115,5 +115,5 @@ QString button::getColorString() const } // never happens - return QString::null; + return TQString::null; } diff --git a/blinken/src/button.h b/blinken/src/button.h index 80300c06..d267b5b1 100644 --- a/blinken/src/button.h +++ b/blinken/src/button.h @@ -10,7 +10,7 @@ #ifndef BUTTON_H #define BUTTON_H -#include +#include #include "blinkengame.h" @@ -25,16 +25,16 @@ class button ~button(); void setShortcut(int key); - QString shortcut() const; + TQString shortcut() const; int key() const; void setSelected(bool b); bool selected() const; - QPixmap *pixmap() const; + TQPixmap *pixmap() const; private: - QString getColorString() const; + TQString getColorString() const; - QPixmap *m_highlighted; + TQPixmap *m_highlighted; bool m_selected; int m_key; blinkenGame::color m_color; diff --git a/blinken/src/counter.cpp b/blinken/src/counter.cpp index 6d5ec217..93c55109 100644 --- a/blinken/src/counter.cpp +++ b/blinken/src/counter.cpp @@ -7,18 +7,18 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include +#include +#include #include "counter.h" #include "number.h" -void counter::paint(QPainter &p, bool drawScore, int score, bool drawTimer, const QColor &c1, const QColor &c2, const QColor &c3) +void counter::paint(TQPainter &p, bool drawScore, int score, bool drawTimer, const TQColor &c1, const TQColor &c2, const TQColor &c3) { p.save(); p.translate(45, 15); - p.setPen(QPen(Qt::black, 3)); - p.setBrush(QColor(40, 40, 40)); + p.setPen(TQPen(Qt::black, 3)); + p.setBrush(TQColor(40, 40, 40)); if (drawTimer) { p.fillRect(-44, -13, 98, 48, p.brush()); diff --git a/blinken/src/counter.h b/blinken/src/counter.h index 81e20ed3..49957aeb 100644 --- a/blinken/src/counter.h +++ b/blinken/src/counter.h @@ -15,7 +15,7 @@ class QPainter; class counter { public: - static void paint(QPainter &p, bool drawScore, int score, bool drawTimer, const QColor &c1, const QColor &c2, const QColor &c3); + static void paint(TQPainter &p, bool drawScore, int score, bool drawTimer, const TQColor &c1, const TQColor &c2, const TQColor &c3); static int width(bool drawTimer); static int height(); }; diff --git a/blinken/src/fontchecker.cpp b/blinken/src/fontchecker.cpp index 684afaaa..55e18601 100644 --- a/blinken/src/fontchecker.cpp +++ b/blinken/src/fontchecker.cpp @@ -7,16 +7,16 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include +#include +#include #include #include "fontchecker.h" -bool fontChecker::checkInstalled(const QFont &font, const QString &fontPath) +bool fontChecker::checkInstalled(const TQFont &font, const TQString &fontPath) { - QFontInfo fi(font); + TQFontInfo fi(font); // Works with Steve may need some tweaking to work with other fonts if (!fi.exactMatch()) { diff --git a/blinken/src/fontchecker.h b/blinken/src/fontchecker.h index b8b60b6f..a65c95e9 100644 --- a/blinken/src/fontchecker.h +++ b/blinken/src/fontchecker.h @@ -15,7 +15,7 @@ class QFont; class fontChecker { public: - static bool checkInstalled(const QFont &font, const QString &fontPath); + static bool checkInstalled(const TQFont &font, const TQString &fontPath); }; #endif diff --git a/blinken/src/fontutils.cpp b/blinken/src/fontutils.cpp index eacbbd46..10d3bc0d 100644 --- a/blinken/src/fontutils.cpp +++ b/blinken/src/fontutils.cpp @@ -7,24 +7,24 @@ * (at your option) any later version. * ***************************************************************************/ -#include +#include #include "fontutils.h" -int fontUtils::fontSize(QPainter &p, const QString &s1, int w, int h) +int fontUtils::fontSize(TQPainter &p, const TQString &s1, int w, int h) { int size; - QRect aux1; + TQRect aux1; bool done = false; size = 28; while (!done) { - QFont f = p.font(); + TQFont f = p.font(); f.setPointSize(size); p.setFont(f); - aux1 = p.boundingRect(QRect(), Qt::AlignAuto, s1); + aux1 = p.boundingRect(TQRect(), Qt::AlignAuto, s1); if (aux1.width() > w || aux1.height() > h) size = QMIN(w * size / aux1.width(), h * size / aux1.height()); else done = true; } diff --git a/blinken/src/fontutils.h b/blinken/src/fontutils.h index b6bc9c97..b458f394 100644 --- a/blinken/src/fontutils.h +++ b/blinken/src/fontutils.h @@ -12,7 +12,7 @@ namespace fontUtils { - int fontSize(QPainter &p, const QString &s1, int w, int h); + int fontSize(TQPainter &p, const TQString &s1, int w, int h); } #endif diff --git a/blinken/src/highscoredialog.cpp b/blinken/src/highscoredialog.cpp index a162ab33..9c5a5287 100644 --- a/blinken/src/highscoredialog.cpp +++ b/blinken/src/highscoredialog.cpp @@ -7,10 +7,10 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -30,46 +30,46 @@ static const int namesFontSize = 25; class scoresWidget : public QWidget { public: - scoresWidget(QWidget *parent, const QValueList< QPair > &scores); - QSize calcSize(); + scoresWidget(TQWidget *parent, const TQValueList< QPair > &scores); + TQSize calcSize(); protected: - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); private: - const QValueList< QPair > &m_scores; + const TQValueList< QPair > &m_scores; }; -scoresWidget::scoresWidget(QWidget *parent, const QValueList< QPair > &scores) : QWidget(parent, 0, WStaticContents | WNoAutoErase), m_scores(scores) +scoresWidget::scoresWidget(TQWidget *parent, const TQValueList< QPair > &scores) : TQWidget(parent, 0, WStaticContents | WNoAutoErase), m_scores(scores) { } -void scoresWidget::paintEvent(QPaintEvent *) +void scoresWidget::paintEvent(TQPaintEvent *) { int w = width(); int h = height(); - QFont f; - QPixmap buf(w, h); - QPainter p(&buf); - QRect r; - QColor bg = paletteBackgroundColor(); + TQFont f; + TQPixmap buf(w, h); + TQPainter p(&buf); + TQRect r; + TQColor bg = paletteBackgroundColor(); // bg color p.fillRect(0, 0, w, h, bg); p.setPen(black); - if (blinkenSettings::customFont()) f = QFont("Steve"); + if (blinkenSettings::customFont()) f = TQFont("Steve"); p.setFont(f); f.setPointSize(fontUtils::fontSize(p, "A", 1000, namesFontSize)); p.setFont(f); p.translate(margin, margin); - QValueList< QPair >::const_iterator it; + TQValueList< QPair >::const_iterator it; for (it = m_scores.begin(); it != m_scores.end(); ++it) { - counter::paint(p, !(*it).second.isEmpty(), (*it).first, false, QColor(), QColor(), QColor()); + counter::paint(p, !(*it).second.isEmpty(), (*it).first, false, TQColor(), TQColor(), TQColor()); p.setPen(black); p.drawText(counter::width(false) + 2 * smallMargin, 30, (*it).second); p.translate(0, counter::height() + smallMargin); @@ -78,24 +78,24 @@ void scoresWidget::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, &buf); } -QSize scoresWidget::calcSize() +TQSize scoresWidget::calcSize() { int mw, mh, lt; - QRect r; - QPainter p(this); - QFont f; + TQRect r; + TQPainter p(this); + TQFont f; - if (blinkenSettings::customFont()) f = QFont("Steve"); + if (blinkenSettings::customFont()) f = TQFont("Steve"); p.setFont(f); f.setPointSize(fontUtils::fontSize(p, "A", 1000, namesFontSize)); p.setFont(f); for (int i = 0; i < 3; i++) { lt = 0; - QValueList< QPair >::const_iterator it; + TQValueList< QPair >::const_iterator it; for (it = m_scores.begin(); it != m_scores.end(); ++it) { - r = p.boundingRect(QRect(), Qt::AlignAuto, (*it).second); + r = p.boundingRect(TQRect(), Qt::AlignAuto, (*it).second); lt = QMAX(lt, r.width()); } } @@ -103,7 +103,7 @@ QSize scoresWidget::calcSize() mw = margin + counter::width(false) + 2 * smallMargin + lt + margin; mh = margin * 2 + counter::height() * 5 + smallMargin * 4; - QSize size(mw, mh); + TQSize size(mw, mh); setMinimumSize(size); resize(size); @@ -115,9 +115,9 @@ QSize scoresWidget::calcSize() class myTabWidget : public QTabWidget { public: - myTabWidget(QWidget *parent) : QTabWidget(parent) {} + myTabWidget(TQWidget *parent) : TQTabWidget(parent) {} - QSize tabBarSizeHint() const + TQSize tabBarSizeHint() const { return tabBar() -> sizeHint(); } @@ -125,7 +125,7 @@ class myTabWidget : public QTabWidget /* highScoreDialog */ -highScoreDialog::highScoreDialog(QWidget *parent) : KDialogBase(parent, 0, true, i18n("Highscores"), KDialogBase::Close) +highScoreDialog::highScoreDialog(TQWidget *parent) : KDialogBase(parent, 0, true, i18n("Highscores"), KDialogBase::Close) { m_tw = new myTabWidget(this); setMainWidget(m_tw); @@ -133,10 +133,10 @@ highScoreDialog::highScoreDialog(QWidget *parent) : KDialogBase(parent, 0, true, KConfig *cfg = kapp -> config(); for (int i = 1; i <= 3; i++) { - cfg -> setGroup(QString("Level%1").arg(i)); + cfg -> setGroup(TQString("Level%1").arg(i)); for (int j = 1; j <= 5; j++) { - m_scores[i-1].append(qMakePair(cfg->readNumEntry(QString("Score%1").arg(j)), cfg->readEntry(QString("Name%1").arg(j)))); + m_scores[i-1].append(qMakePair(cfg->readNumEntry(TQString("Score%1").arg(j)), cfg->readEntry(TQString("Name%1").arg(j)))); } } @@ -148,7 +148,7 @@ highScoreDialog::highScoreDialog(QWidget *parent) : KDialogBase(parent, 0, true, bool highScoreDialog::scoreGoodEnough(int level, int score) { level--; - QValueList< QPair >::iterator it, itEnd; + TQValueList< QPair >::iterator it, itEnd; it = m_scores[level].begin(); itEnd = m_scores[level].end(); while (it != itEnd && (*it).first >= score) it++; @@ -156,10 +156,10 @@ bool highScoreDialog::scoreGoodEnough(int level, int score) return (it != itEnd); } -void highScoreDialog::addScore(int level, int score, const QString &name) +void highScoreDialog::addScore(int level, int score, const TQString &name) { level--; - QValueList< QPair >::iterator it, itEnd; + TQValueList< QPair >::iterator it, itEnd; it = m_scores[level].begin(); itEnd = m_scores[level].end(); while (it != itEnd && (*it).first >= score) it++; @@ -170,12 +170,12 @@ void highScoreDialog::addScore(int level, int score, const QString &name) m_scores[level].remove(--m_scores[level].end()); KConfig *cfg = kapp -> config(); - cfg -> setGroup(QString("Level%1").arg(level + 1)); + cfg -> setGroup(TQString("Level%1").arg(level + 1)); int j; for (it = m_scores[level].begin(), j = 1; it != m_scores[level].end(); ++it, j++) { - cfg->writeEntry(QString("Score%1").arg(j), (*it).first); - cfg->writeEntry(QString("Name%1").arg(j), (*it).second); + cfg->writeEntry(TQString("Score%1").arg(j), (*it).first); + cfg->writeEntry(TQString("Name%1").arg(j), (*it).second); } cfg -> sync(); } @@ -183,7 +183,7 @@ void highScoreDialog::addScore(int level, int score, const QString &name) void highScoreDialog::showLevel(int level) { - QSize max, aux; + TQSize max, aux; m_tw -> setCurrentPage(level -1); for (int i = 0; i < 3; i++) diff --git a/blinken/src/highscoredialog.h b/blinken/src/highscoredialog.h index d61edf48..484f392b 100644 --- a/blinken/src/highscoredialog.h +++ b/blinken/src/highscoredialog.h @@ -10,8 +10,8 @@ #ifndef HIGHSCOREDIALOG_H #define HIGHSCOREDIALOG_H -#include -#include +#include +#include #include @@ -20,13 +20,13 @@ class myTabWidget; class highScoreDialog : private KDialogBase { public: - highScoreDialog(QWidget *parent); + highScoreDialog(TQWidget *parent); bool scoreGoodEnough(int level, int score); - void addScore(int level, int score, const QString &name); + void addScore(int level, int score, const TQString &name); void showLevel(int level); - QValueList< QPair > m_scores[3]; + TQValueList< QPair > m_scores[3]; myTabWidget *m_tw; }; diff --git a/blinken/src/main.cpp b/blinken/src/main.cpp index 4ad79157..e6373429 100644 --- a/blinken/src/main.cpp +++ b/blinken/src/main.cpp @@ -24,9 +24,9 @@ int main(int argc, char *argv[]) about.addCredit("Steve Jordi", I18N_NOOP("GPL'ed his 'Steve' font so that we could use it"), "steve@sjordi.com"); KCmdLineArgs::init(argc, argv, &about); KApplication app; - app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); + app.connect(&app, TQT_SIGNAL(lastWindowClosed()), &app, TQT_SLOT(quit())); - QFont f("Steve", 12, QFont::Normal, true); + TQFont f("Steve", 12, TQFont::Normal, true); if (!fontChecker::checkInstalled(f, locate("appdata", "fonts/steve.ttf"))) { KProcess *proc = new KProcess; diff --git a/blinken/src/number.cpp b/blinken/src/number.cpp index 230d23ce..2403f866 100644 --- a/blinken/src/number.cpp +++ b/blinken/src/number.cpp @@ -7,9 +7,9 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include "number.h" @@ -79,7 +79,7 @@ number::number(int n) m_number = n; } -void number::paint(QPainter &p, int digits) const +void number::paint(TQPainter &p, int digits) const { int nDigits, digit, number; nDigits = 0; @@ -96,7 +96,7 @@ void number::paint(QPainter &p, int digits) const p.translate(30 * nDigits, 0); } -void number::paintDigit(QPainter &p, int number) const +void number::paintDigit(TQPainter &p, int number) const { // make gcc happy const int *n = m_number0; diff --git a/blinken/src/number.h b/blinken/src/number.h index c4014024..08d9a892 100644 --- a/blinken/src/number.h +++ b/blinken/src/number.h @@ -17,10 +17,10 @@ class number public: number(int n); - void paint(QPainter &p, int digits) const; + void paint(TQPainter &p, int digits) const; private: - void paintDigit(QPainter &p, int n) const; + void paintDigit(TQPainter &p, int n) const; int m_number; diff --git a/kalzium/src/detailedgraphicaloverview.cpp b/kalzium/src/detailedgraphicaloverview.cpp index 56c086ff..d31e2579 100644 --- a/kalzium/src/detailedgraphicaloverview.cpp +++ b/kalzium/src/detailedgraphicaloverview.cpp @@ -23,19 +23,19 @@ email : cniehaus@kde.org #include //QT-Includes -#include -#include -#include -#include +#include +#include +#include +#include -DetailedGraphicalOverview::DetailedGraphicalOverview( Element *el, QWidget *parent, const char *name ) -: QWidget( parent, name ) +DetailedGraphicalOverview::DetailedGraphicalOverview( Element *el, TQWidget *parent, const char *name ) +: TQWidget( parent, name ) { init( el ); } -DetailedGraphicalOverview::DetailedGraphicalOverview( QWidget *parent, const char *name ) -: QWidget( parent, name ) +DetailedGraphicalOverview::DetailedGraphicalOverview( TQWidget *parent, const char *name ) +: TQWidget( parent, name ) { init( 0L ); } @@ -49,14 +49,14 @@ void DetailedGraphicalOverview::init( Element *el ) update(); } -void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) +void DetailedGraphicalOverview::paintEvent( TQPaintEvent* ) { int h = height(); int w = width(); - QPixmap pm( w, h ); + TQPixmap pm( w, h ); - QPainter p; + TQPainter p; p.begin( &pm ); p.setBrush(Qt::SolidPattern); @@ -83,26 +83,26 @@ void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) p.setBrush( Qt::black ); p.setBrush(Qt::NoBrush); - QFont fA = KGlobalSettings::generalFont(); - QFont fB = KGlobalSettings::generalFont(); - QFont fC = KGlobalSettings::generalFont(); + TQFont fA = KGlobalSettings::generalFont(); + TQFont fB = KGlobalSettings::generalFont(); + TQFont fC = KGlobalSettings::generalFont(); - QString strLocalizedMass = KalziumUtils::localizedValue( m_element->mass(), 6 ); + TQString strLocalizedMass = KalziumUtils::localizedValue( m_element->mass(), 6 ); fA.setPointSize( fA.pointSize() + 20 ); //Huge font fA.setBold( true ); fB.setPointSize( fB.pointSize() + 6 ); //Big font fC.setPointSize( fC.pointSize() + 4 ); //Big font fC.setBold( true ); - QFontMetrics fmA = QFontMetrics( fA ); - QFontMetrics fmB = QFontMetrics( fB ); + TQFontMetrics fmA = TQFontMetrics( fA ); + TQFontMetrics fmB = TQFontMetrics( fB ); //coordinates for element symbol: near the center int xA = 4 * w / 10; int yA = h / 2; //coordinates for the atomic number: offset from element symbol to the upper left - int xB = xA - fmB.width( QString::number( m_element->number() ) ); + int xB = xA - fmB.width( TQString::number( m_element->number() ) ); int yB = yA - fmA.height() + fmB.height(); //Element Symbol @@ -111,9 +111,9 @@ void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) //Atomic number p.setFont( fB ); - p.drawText( xB, yB, QString::number( m_element->number() )); + p.drawText( xB, yB, TQString::number( m_element->number() )); - QRect rect( 0, 20, w/2, h ); + TQRect rect( 0, 20, w/2, h ); p.setFont( fC ); @@ -150,7 +150,7 @@ void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) bitBlt( this, 0, 0, &pm ); } -void DetailedGraphicalOverview::drawBiologicalSymbol( QPainter *p ) +void DetailedGraphicalOverview::drawBiologicalSymbol( TQPainter *p ) { if ( !m_element ) return; const int db = h_t; //diameter of the big circle @@ -167,7 +167,7 @@ void DetailedGraphicalOverview::drawBiologicalSymbol( QPainter *p ) p->setBrush( Qt::SolidPattern ); p->setBrush( Qt::white ); p->setPen( Qt::black ); - p->drawRoundRect( QRect( width() - radius, + p->drawRoundRect( TQRect( width() - radius, -radius, 2 * radius, 2 * radius ), 70, 70 ); diff --git a/kalzium/src/detailedgraphicaloverview.h b/kalzium/src/detailedgraphicaloverview.h index 2f095be7..6fb649dc 100644 --- a/kalzium/src/detailedgraphicaloverview.h +++ b/kalzium/src/detailedgraphicaloverview.h @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include class Element; @@ -30,8 +30,8 @@ class DetailedGraphicalOverview : public QWidget Q_OBJECT public: - DetailedGraphicalOverview( Element *el, QWidget *parent, const char *name=0 ); - DetailedGraphicalOverview( QWidget *parent, const char *name=0 ); + DetailedGraphicalOverview( Element *el, TQWidget *parent, const char *name=0 ); + DetailedGraphicalOverview( TQWidget *parent, const char *name=0 ); /** * sets the elements whose data will be used to @p el @@ -45,7 +45,7 @@ class DetailedGraphicalOverview : public QWidget * draw the small symbol which symbolises the * relevence for humans */ - void drawBiologicalSymbol( QPainter *p ); + void drawBiologicalSymbol( TQPainter *p ); //calculation of the corners int x1,x2,y1,y2,h_t; @@ -57,7 +57,7 @@ class DetailedGraphicalOverview : public QWidget Element *m_element; protected: - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); /** * initialization method diff --git a/kalzium/src/detailinfodlg.cpp b/kalzium/src/detailinfodlg.cpp index c099ccd8..c4fc8899 100644 --- a/kalzium/src/detailinfodlg.cpp +++ b/kalzium/src/detailinfodlg.cpp @@ -28,13 +28,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "element.h" #include "orbitswidget.h" @@ -44,7 +44,7 @@ //TODO add bondxx-radius (H-H-distance for example) -DetailedInfoDlg::DetailedInfoDlg( Element *el , QWidget *parent, const char *name) +DetailedInfoDlg::DetailedInfoDlg( Element *el , TQWidget *parent, const char *name) : KDialogBase( IconList, name, Help|User1|User2|Close, Close, parent, name, false, //non modal false, @@ -66,7 +66,7 @@ DetailedInfoDlg::DetailedInfoDlg( Element *el , QWidget *parent, const char *nam createContent(); m_actionCollection = new KActionCollection(this); - KStdAction::quit(this, SLOT(slotClose()), m_actionCollection); + KStdAction::quit(this, TQT_SLOT(slotClose()), m_actionCollection); setButtonTip( User2, i18n( "Goes to the previous element" ) ); setButtonTip( User1, i18n( "Goes to the next element" ) ); @@ -91,10 +91,10 @@ void DetailedInfoDlg::setElement(Element *element) enableButton( User1, false ); } -KHTMLPart* DetailedInfoDlg::addHTMLTab( const QString& title, const QString& icontext, const QString& iconname ) +KHTMLPart* DetailedInfoDlg::addHTMLTab( const TQString& title, const TQString& icontext, const TQString& iconname ) { - QFrame *frame = addPage(title, icontext, BarIcon(iconname)); - QVBoxLayout *layout = new QVBoxLayout( frame ); + TQFrame *frame = addPage(title, icontext, BarIcon(iconname)); + TQVBoxLayout *layout = new TQVBoxLayout( frame ); layout->setMargin( 0 ); KHTMLPart *w = new KHTMLPart( frame, "html-part", frame ); layout->addWidget( w->view() ); @@ -102,7 +102,7 @@ KHTMLPart* DetailedInfoDlg::addHTMLTab( const QString& title, const QString& ico return w; } -void DetailedInfoDlg::fillHTMLTab( KHTMLPart* htmlpart, const QString& htmlcode ) +void DetailedInfoDlg::fillHTMLTab( KHTMLPart* htmlpart, const TQString& htmlcode ) { if ( !htmlpart ) return; @@ -111,13 +111,13 @@ void DetailedInfoDlg::fillHTMLTab( KHTMLPart* htmlpart, const QString& htmlcode htmlpart->end(); } -QString DetailedInfoDlg::getHtml(DATATYPE type) +TQString DetailedInfoDlg::getHtml(DATATYPE type) { - QString html = "Chemical dataChemical data
"; //get the list of ionisation-energies - QValueList ionlist = m_element->ionisationList(); + TQValueList ionlist = m_element->ionisationList(); html.append( "
" ); } break; @@ -233,11 +233,11 @@ QString DetailedInfoDlg::getHtml(DATATYPE type) return html; } -QString DetailedInfoDlg::isotopeTable() +TQString DetailedInfoDlg::isotopeTable() { - QValueList list = m_element->isotopes(); + TQValueList list = m_element->isotopes(); - QString html; + TQString html; html = "
" ); html.append( m_element->symbol() ); @@ -221,7 +221,7 @@ QString DetailedInfoDlg::getHtml(DATATYPE type) { html.append( "
\"icon\"/" ); html.append( i18n("the first variable is a number. The result is for example '1.' or '5.', the second is the value of the ionisation energy", - "%1. Ionization energy: %2" ).arg( QString::number( i+1 ), m_element->adjustUnits( Element::IE, ionlist[i] ) ) ); + "%1. Ionization energy: %2" ).arg( TQString::number( i+1 ), m_element->adjustUnits( Element::IE, ionlist[i] ) ) ); html.append( "
"; - QValueList::const_iterator it = list.begin(); - const QValueList::const_iterator itEnd = list.end(); + TQValueList::const_iterator it = list.begin(); + const TQValueList::const_iterator itEnd = list.end(); for ( ; it != itEnd; ++it ) { html.append( "" ); @@ -334,23 +334,23 @@ QString DetailedInfoDlg::isotopeTable() void DetailedInfoDlg::createContent( ) { // overview tab - QFrame *m_pOverviewTab = addPage( i18n( "Overview" ), i18n( "Overview" ), BarIcon( "overview" ) ); - QVBoxLayout *overviewLayout = new QVBoxLayout( m_pOverviewTab ); + TQFrame *m_pOverviewTab = addPage( i18n( "Overview" ), i18n( "Overview" ), BarIcon( "overview" ) ); + TQVBoxLayout *overviewLayout = new TQVBoxLayout( m_pOverviewTab ); overviewLayout->setMargin( 0 ); dTab = new DetailedGraphicalOverview( m_pOverviewTab, "DetailedGraphicalOverview" ); overviewLayout->addWidget( dTab ); // picture tab - QFrame *m_pPictureTab = addPage( i18n( "Picture" ), i18n( "What does this element look like?" ), BarIcon( "elempic" ) ); - QVBoxLayout *mainLayout = new QVBoxLayout( m_pPictureTab ); + TQFrame *m_pPictureTab = addPage( i18n( "Picture" ), i18n( "What does this element look like?" ), BarIcon( "elempic" ) ); + TQVBoxLayout *mainLayout = new TQVBoxLayout( m_pPictureTab ); mainLayout->setMargin( 0 ); - piclabel = new QLabel( m_pPictureTab ); + piclabel = new TQLabel( m_pPictureTab ); piclabel->setMinimumSize( 400, 350 ); mainLayout->addWidget( piclabel ); // atomic model tab - QFrame *m_pModelTab = addPage( i18n( "Atom Model" ), i18n( "Atom Model" ), BarIcon( "orbits" ) ); - QVBoxLayout *modelLayout = new QVBoxLayout( m_pModelTab ); + TQFrame *m_pModelTab = addPage( i18n( "Atom Model" ), i18n( "Atom Model" ), BarIcon( "orbits" ) ); + TQVBoxLayout *modelLayout = new TQVBoxLayout( m_pModelTab ); modelLayout->setMargin( 0 ); wOrbits = new OrbitsWidget( m_pModelTab ); modelLayout->addWidget( wOrbits ); @@ -361,22 +361,22 @@ void DetailedInfoDlg::createContent( ) m_htmlpages["misc"] = addHTMLTab( i18n( "Miscellaneous" ), i18n( "Miscellaneous" ), "misc" ); // spectrum widget tab - QFrame *m_pSpectrumTab = addPage( i18n("Spectrum"), i18n( "Spectrum" ), BarIcon( "spectrum" )); - QVBoxLayout *spectrumLayout = new QVBoxLayout( m_pSpectrumTab , 0, KDialog::spacingHint() ); + TQFrame *m_pSpectrumTab = addPage( i18n("Spectrum"), i18n( "Spectrum" ), BarIcon( "spectrum" )); + TQVBoxLayout *spectrumLayout = new TQVBoxLayout( m_pSpectrumTab , 0, KDialog::spacingHint() ); spectrumLayout->setMargin( 0 ); - m_spectrumStack = new QWidgetStack( m_pSpectrumTab ); + m_spectrumStack = new TQWidgetStack( m_pSpectrumTab ); spectrumLayout->addWidget( m_spectrumStack ); m_spectrumview = new SpectrumViewImpl( m_spectrumStack, "spectrumwidget" ); m_spectrumStack->addWidget( m_spectrumview ); - m_spectrumLabel = new QLabel( m_spectrumStack ); + m_spectrumLabel = new TQLabel( m_spectrumStack ); m_spectrumStack->addWidget( m_spectrumLabel ); } void DetailedInfoDlg::reloadContent() { // reading the most common data - const QString element_name = m_element->elname(); - const QString element_symbol = m_element->symbol(); + const TQString element_name = m_element->elname(); + const TQString element_symbol = m_element->symbol(); // updating caption setCaption( i18n( "For example Carbon (6)" , "%1 (%2)" ).arg( element_name ).arg( m_elementNumber ) ); @@ -385,12 +385,12 @@ void DetailedInfoDlg::reloadContent() dTab->setElement( m_element ); // updating picture tab - QString picpath = m_picsdir + element_symbol + ".jpg"; - if ( QFile::exists( picpath ) ) + TQString picpath = m_picsdir + element_symbol + ".jpg"; + if ( TQFile::exists( picpath ) ) { - QImage img( picpath, "JPEG" ); - img = img.smoothScale ( 400, 400, QImage::ScaleMin ); - QPixmap pic; + TQImage img( picpath, "JPEG" ); + img = img.smoothScale ( 400, 400, TQImage::ScaleMin ); + TQPixmap pic; pic.convertFromImage( img ); piclabel->setPixmap( pic ); } @@ -399,7 +399,7 @@ void DetailedInfoDlg::reloadContent() // updating atomic model tab wOrbits->setElementNumber( m_elementNumber ); - QWhatsThis::add( wOrbits, + TQWhatsThis::add( wOrbits, i18n( "Here you can see the atomic hull of %1. %2 has the configuration %3." ) .arg( m_element->elname() ) .arg( m_element->elname() ) @@ -431,7 +431,7 @@ void DetailedInfoDlg::slotHelp() { emit helpClicked(); - QString chapter = "infodialog_overview"; + TQString chapter = "infodialog_overview"; switch ( activePageIndex() ){ case 0: chapter = "infodialog_overview"; @@ -460,7 +460,7 @@ void DetailedInfoDlg::slotHelp() kapp->invokeHelp ( chapter, "kalzium" ); } -void DetailedInfoDlg::wheelEvent( QWheelEvent *ev ) +void DetailedInfoDlg::wheelEvent( TQWheelEvent *ev ) { if ( ev->delta() < 0 ) // setting the previous element diff --git a/kalzium/src/detailinfodlg.h b/kalzium/src/detailinfodlg.h index d5dacc29..f633459d 100644 --- a/kalzium/src/detailinfodlg.h +++ b/kalzium/src/detailinfodlg.h @@ -18,7 +18,7 @@ #include -#include +#include class DetailedGraphicalOverview; class Element; @@ -41,7 +41,7 @@ class DetailedInfoDlg : public KDialogBase Q_OBJECT public: - DetailedInfoDlg( Element *el , QWidget *parent=0, const char *name=0); + DetailedInfoDlg( Element *el , TQWidget *parent=0, const char *name=0); void setElement(Element *el); @@ -60,14 +60,14 @@ class DetailedInfoDlg : public KDialogBase SpectrumViewImpl *m_spectrumview; - QString isotopeTable(); + TQString isotopeTable(); - QMap m_htmlpages; + TQMap m_htmlpages; - QLabel *piclabel; + TQLabel *piclabel; - QWidgetStack* m_spectrumStack; - QLabel* m_spectrumLabel; + TQWidgetStack* m_spectrumStack; + TQLabel* m_spectrumLabel; DetailedGraphicalOverview *dTab; @@ -80,10 +80,10 @@ class DetailedInfoDlg : public KDialogBase void createContent(); void reloadContent(); - QString getHtml(DATATYPE); + TQString getHtml(DATATYPE); - QString m_baseHtml; - QString m_picsdir; + TQString m_baseHtml; + TQString m_picsdir; /** * Add a new HTML page to the dialog. @@ -95,14 +95,14 @@ class DetailedInfoDlg : public KDialogBase * @returns the pointer to the resulting KHTMLPart, needed for * writing HTML code on it */ - KHTMLPart* addHTMLTab( const QString& title, const QString& icontext, const QString& iconname ); + KHTMLPart* addHTMLTab( const TQString& title, const TQString& icontext, const TQString& iconname ); /** * Change the HTML code in an HTML page. * * @param htmlpart the KHTMLPart to edit * @param htmlcode the HTML code to display */ - void fillHTMLTab( KHTMLPart* htmlpart, const QString& htmlcode ); + void fillHTMLTab( KHTMLPart* htmlpart, const TQString& htmlcode ); protected slots: virtual void slotUser1(); @@ -113,7 +113,7 @@ class DetailedInfoDlg : public KDialogBase virtual void slotHelp(); protected: - virtual void wheelEvent ( QWheelEvent * ev ); + virtual void wheelEvent ( TQWheelEvent * ev ); signals: void elementChanged( int ); diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index a909a5ac..3fc7e493 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -26,11 +26,11 @@ #include "kalziumutils.h" #include "tempunit.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -46,8 +46,8 @@ Element::Element() Isotope* Element::isotopeByNucleons( int numberOfNucleons ) { - QValueList::ConstIterator it = m_isotopeList.begin(); - const QValueList::ConstIterator itEnd = m_isotopeList.end(); + TQValueList::ConstIterator it = m_isotopeList.begin(); + const TQValueList::ConstIterator itEnd = m_isotopeList.end(); for ( ; it != itEnd; ++it ) { @@ -57,7 +57,7 @@ Isotope* Element::isotopeByNucleons( int numberOfNucleons ) return 0; } -QString Element::parsedOrbits( bool canBeEmpty ) +TQString Element::parsedOrbits( bool canBeEmpty ) { if ( m_orbits.isEmpty() ) if ( !canBeEmpty ) @@ -65,9 +65,9 @@ QString Element::parsedOrbits( bool canBeEmpty ) else return ""; - QString orbits = m_orbits; - QRegExp rxs("([a-z])([0-9]+)"); - QRegExp rxb("([a-z]{2}) ",false); + TQString orbits = m_orbits; + TQRegExp rxs("([a-z])([0-9]+)"); + TQRegExp rxb("([a-z]{2}) ",false); orbits.replace(rxs,"\\1\\2"); //superscript around electron number orbits.replace(rxb,"\\1 "); //bold around element symbols return orbits; @@ -82,10 +82,10 @@ double Element::meanmass() return m_mass/m_number; } -const QString Element::adjustRadius( RADIUSTYPE rtype ) +const TQString Element::adjustRadius( RADIUSTYPE rtype ) { double val = 0.0; - QString v; + TQString v; switch ( rtype ) { @@ -110,9 +110,9 @@ const QString Element::adjustRadius( RADIUSTYPE rtype ) return v; } -const QString Element::adjustUnits( const int type, double value ) +const TQString Element::adjustUnits( const int type, double value ) { - QString v; + TQString v; if ( type == IE ) //an ionization energy { if ( Prefs::energies() == 0 ) @@ -130,9 +130,9 @@ const QString Element::adjustUnits( const int type, double value ) return v; } -const QString Element::adjustUnits( const int type ) +const TQString Element::adjustUnits( const int type ) { - QString v = QString::null; + TQString v = TQString::null; double val = 0.0; //the value to convert @@ -148,22 +148,22 @@ const QString Element::adjustUnits( const int type ) else { double newvalue = TempUnit::convert( val, (int)TempUnit::Kelvin, Prefs::temperature() ); - QString strVal = KalziumUtils::localizedValue( newvalue, 6 ); + TQString strVal = KalziumUtils::localizedValue( newvalue, 6 ); switch (Prefs::temperature()) { case 0: //Kelvin v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( strVal ); break; case 1://Kelvin to Celsius - v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( strVal ).arg( TQChar(0xB0) ); break; case 2: // Kelvin to Fahrenheit - v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( strVal ).arg( TQChar(0xB0) ); break; case 3: // Kelvin to Rankine - v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( strVal ).arg( TQChar(0xB0) ); break; case 4: // Kelvin to Reaumur - v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).arg( strVal ).arg( TQChar(0xB0) ); break; } } @@ -230,14 +230,14 @@ const QString Element::adjustUnits( const int type ) } else { - v = i18n( "This element was discovered in the year %1" ).arg( QString::number( val ) ); + v = i18n( "This element was discovered in the year %1" ).arg( TQString::number( val ) ); } } return v; } -void Element::drawStateOfMatter( QPainter* p, double temp ) +void Element::drawStateOfMatter( TQPainter* p, double temp ) { //the height of a "line" inside an element int h_small = 15; //the size for the small units like elementnumber @@ -248,16 +248,16 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) //The Y-coordinate int Y = yPos(); - QColor color = currentColor( temp ); + TQColor color = currentColor( temp ); p->setPen( color ); p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, color ); - QString text; - QFont symbol_font = p->font(); + TQString text; + TQFont symbol_font = p->font(); symbol_font.setPointSize( 10 ); - QFont f = p->font(); + TQFont f = p->font(); f.setPointSize( 9 ); p->setFont( f ); @@ -267,7 +267,7 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) text = KalziumUtils::localizedValue( KalziumUtils::strippedValue( mass( ) ), 6 ); p->drawText( X,Y ,ELEMENTSIZE,h_small,Qt::AlignCenter, text ); - text = QString::number( number() ); + text = TQString::number( number() ); p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, text ); p->setFont( symbol_font ); @@ -278,9 +278,9 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } -QColor Element::currentColor( const double temp ) +TQColor Element::currentColor( const double temp ) { - QColor color; + TQColor color; //take the colours for the given temperature const double iButton_melting = melting(); @@ -311,7 +311,7 @@ QColor Element::currentColor( const double temp ) } -void Element::drawGradient( QPainter* p, const QString& value, const QColor& c) +void Element::drawGradient( TQPainter* p, const TQString& value, const TQColor& c) { //Set the elementColor to c to make the overviewwidget show //the correct color @@ -330,15 +330,15 @@ void Element::drawGradient( QPainter* p, const QString& value, const QColor& c) p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, c ); p->setPen( Qt::black ); - QFont symbol_font = p->font(); - QFont f = p->font(); + TQFont symbol_font = p->font(); + TQFont f = p->font(); - f.setPointSize( KalziumUtils::maxSize(value, QRect( X,Y+ELEMENTSIZE-h_small, ELEMENTSIZE, h_small ),f, p ) ); + f.setPointSize( KalziumUtils::maxSize(value, TQRect( X,Y+ELEMENTSIZE-h_small, ELEMENTSIZE, h_small ),f, p ) ); p->setFont( f ); p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, value ); - const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); + const TQRect rect = TQRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p ); symbol_font.setPointSize( goodsize ); p->setFont( symbol_font ); @@ -349,7 +349,7 @@ void Element::drawGradient( QPainter* p, const QString& value, const QColor& c) p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } -void Element::drawGrayedOut( QPainter *p ) +void Element::drawGrayedOut( TQPainter *p ) { //The X-coordiante int X = xPos(); @@ -361,8 +361,8 @@ void Element::drawGrayedOut( QPainter *p ) p->setPen( Qt::darkGray ); - QFont symbol_font = p->font(); - const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); + TQFont symbol_font = p->font(); + const TQRect rect = TQRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p ); symbol_font.setPointSize( goodsize ); p->setFont( symbol_font ); @@ -372,7 +372,7 @@ void Element::drawGrayedOut( QPainter *p ) p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } -void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) +void Element::drawSelf( TQPainter* p, bool simple, bool isCrystal ) { //the height of a "line" inside an element int h_small = 12; //the size for the small units like elementnumber @@ -387,12 +387,12 @@ void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, elementColor() ); p->setPen( Qt::black ); - QString text; - QFont symbol_font = p->font(); + TQString text; + TQFont symbol_font = p->font(); const int max = ELEMENTSIZE-10; - const QRect rect = QRect( X,Y,ELEMENTSIZE-2,max ); + const TQRect rect = TQRect( X,Y,ELEMENTSIZE-2,max ); int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p ); symbol_font.setPointSize( goodsize ); @@ -403,19 +403,19 @@ void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) else p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,Qt::AlignHCenter, symbol() ); - QFont f = p->font(); + TQFont f = p->font(); - QRect smallRect( X,Y ,ELEMENTSIZE-4,h_small ); - f.setPointSize( KalziumUtils::maxSize( QString::number( number() ), smallRect, f, p ) ); + TQRect smallRect( X,Y ,ELEMENTSIZE-4,h_small ); + f.setPointSize( KalziumUtils::maxSize( TQString::number( number() ), smallRect, f, p ) ); p->setFont( f ); if ( !simple ) {//the user only wants a simple periodic table, don't weight the cell - QString text; + TQString text; if ( isCrystal ) { - QString structure = crystalstructure(); + TQString structure = crystalstructure(); /** * hcp: hexagonal close packed * fcc: face centered cubic @@ -444,7 +444,7 @@ void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) p->drawText( X+2,Y ,ELEMENTSIZE-4 ,h_small,Qt::AlignCenter, text ); } - text = QString::number( number() ); + text = TQString::number( number() ); p->drawText( X+2,Y+ELEMENTSIZE-h_small , ELEMENTSIZE-4, h_small,Qt::AlignCenter, text ); p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); @@ -479,7 +479,7 @@ void Element::setupXY() y = posYRegular[m_number-1]; } -void Element::setRadius( RADIUSTYPE type, double value, const QString& name ) +void Element::setRadius( RADIUSTYPE type, double value, const TQString& name ) { switch ( type ) { @@ -537,12 +537,12 @@ int Element::yPos() const return tmp_y; } -QPoint Element::pos() const +TQPoint Element::pos() const { - return QPoint( xPos(), yPos() ); + return TQPoint( xPos(), yPos() ); } -QPoint Element::coords() const +TQPoint Element::coords() const { - return QPoint( x, y ); + return TQPoint( x, y ); } diff --git a/kalzium/src/element.h b/kalzium/src/element.h index c3d2b091..b68bcb09 100644 --- a/kalzium/src/element.h +++ b/kalzium/src/element.h @@ -22,8 +22,8 @@ #define ELEMENTSIZE 40 -#include -#include +#include +#include class Element; class QDomDocument; @@ -36,9 +36,9 @@ class Isotope; struct coordinate; -typedef QValueList EList; -typedef QValueList CList; -typedef QValueList doubleList; +typedef TQValueList EList; +typedef TQValueList CList; +typedef TQValueList doubleList; struct coordinate{ int x; @@ -96,11 +96,11 @@ class Element{ /** * @return the information where the name of the Element comes from */ - QString nameOrigin() const{ + TQString nameOrigin() const{ return m_origin; } - QString orbits() const{ + TQString orbits() const{ return m_orbits; } @@ -121,7 +121,7 @@ class Element{ * The ionicradius also has a name @p name. This will store the charge of * the ion (for example, +2 or -3 ) */ - void setRadius( RADIUSTYPE type, double value, const QString& name = 0 ); + void setRadius( RADIUSTYPE type, double value, const TQString& name = 0 ); void setDate( int date ) { m_date = date; } void setPeriod( int period ){ m_period = period; } @@ -134,33 +134,33 @@ class Element{ */ void setAbundance( int abundance ){ m_abundance = abundance; } - void setScientist( const QString& value ) { m_scientist = value; } - void setCrysatalstructure( const QString& value ) { m_crystalstructure = value; } - void setName( const QString& value ) { m_name = value; } - void setOrigin( const QString& value ) { m_origin = value; } - void setBlock( const QString& value ) { m_block = value; } - void setGroup( const QString& value ) { m_group = value; } - void setFamily( const QString& value ) { m_family = value; } - void setOrbits( const QString& value ) { m_orbits = value; } - void setSymbol( const QString& value ) { m_symbol = value; } - void setOxydation( const QString& value ) { m_oxstage = value; } - void setAcidicbehaviour( const QString& value ) { m_acidbeh = value; } - void setIsotopes( const QString& value ) { m_isotopes = value; } + void setScientist( const TQString& value ) { m_scientist = value; } + void setCrysatalstructure( const TQString& value ) { m_crystalstructure = value; } + void setName( const TQString& value ) { m_name = value; } + void setOrigin( const TQString& value ) { m_origin = value; } + void setBlock( const TQString& value ) { m_block = value; } + void setGroup( const TQString& value ) { m_group = value; } + void setFamily( const TQString& value ) { m_family = value; } + void setOrbits( const TQString& value ) { m_orbits = value; } + void setSymbol( const TQString& value ) { m_symbol = value; } + void setOxydation( const TQString& value ) { m_oxstage = value; } + void setAcidicbehaviour( const TQString& value ) { m_acidbeh = value; } + void setIsotopes( const TQString& value ) { m_isotopes = value; } void setArtificial(){ m_artificial = true; } void setRadioactive(){ m_radioactive = true; } void setIonisationList( doubleList l ){ m_ionenergies = l; } - QValueList isotopes() const{ + TQValueList isotopes() const{ return m_isotopeList; } - QValueList spectrumList() const{ + TQValueList spectrumList() const{ return m_spectrumList; } - void setIsotopeList( QValueList list ){ + void setIsotopeList( TQValueList list ){ m_isotopeList = list; } @@ -209,12 +209,12 @@ class Element{ * return the correct color of the element at the * temperature @p temp */ - QColor currentColor( const double temp ); + TQColor currentColor( const double temp ); /** * mutator for the element's color */ - void setElementColor( const QColor &c ) { m_Color = c; } + void setElementColor( const TQColor &c ) { m_Color = c; } /** * @return the importance of the element for biological @@ -241,47 +241,47 @@ class Element{ /** * @return the symbol of the element */ - QString symbol() const { + TQString symbol() const { return m_symbol; } /** * @return the scientist who discovered the element */ - QString scientist() const{ + TQString scientist() const{ return m_scientist; } /** * @return the crystal structure of the element */ - QString crystalstructure() const{ + TQString crystalstructure() const{ return m_crystalstructure; } /** * @return the name of the element */ - QString elname() const { + TQString elname() const { return m_name; } //FIXME I need to add a way to have more than one ionic radius - QString ioncharge() const{ + TQString ioncharge() const{ return m_ionvalue; } /** * @return the chemical block (s, p, d, f) of the element */ - QString block() const { + TQString block() const { return m_block; } /** * @return the group of the element */ - QString group() const { + TQString group() const { return m_group; } @@ -289,32 +289,32 @@ class Element{ return m_period; } - QString family() const { + TQString family() const { return m_family; } /** * @return the acidic behavior of the element */ - QString acidicbeh() const { + TQString acidicbeh() const { return m_acidbeh; } /** * @return the oxydationstages of the element */ - QString oxstage() const { + TQString oxstage() const { return m_oxstage; } /** - * @return the orbits of the element. The QString is already + * @return the orbits of the element. The TQString is already * parsed so that the numbers are superscripts and the first * block is bold. * @param canBeEmpty specifies if the string returned can be * empty instead of a "Unknown structure" one. */ - QString parsedOrbits( bool canBeEmpty = false ); + TQString parsedOrbits( bool canBeEmpty = false ); /** * @return the boiling point of the element in Kelvin @@ -380,9 +380,9 @@ class Element{ * @param type the TYPE of the data * @return the adjusted datastring */ - const QString adjustUnits( const int type ); + const TQString adjustUnits( const int type ); - const QString adjustRadius( RADIUSTYPE rtype ); + const TQString adjustRadius( RADIUSTYPE rtype ); /** * adjusts the units for the data. The user can @@ -395,7 +395,7 @@ class Element{ * @param value the value of the data. * @return the adjusted datastring */ - const QString adjustUnits( const int type, double value ); + const TQString adjustUnits( const int type, double value ); /** * types of datas @@ -417,13 +417,13 @@ class Element{ IONICRADIUS }; - QPoint pos() const; - QPoint coords() const; + TQPoint pos() const; + TQPoint coords() const; /** * accessor for the element's color */ - QColor elementColor() const { + TQColor elementColor() const { return m_Color; } @@ -439,11 +439,11 @@ class Element{ bool m_hasSpectrum; - QValueList m_isotopeList; + TQValueList m_isotopeList; - QValueList m_spectrumList; + TQValueList m_spectrumList; - QColor m_Color; + TQColor m_Color; int xPos() const; int yPos() const; @@ -466,7 +466,7 @@ class Element{ m_period, m_abundance; - QString m_symbol, + TQString m_symbol, m_name, m_origin, m_oxstage, @@ -492,13 +492,13 @@ class Element{ * @param value the value to display as text * @param c the color used to paint the element */ - virtual void drawGradient( QPainter* p, const QString& value, const QColor& c); + virtual void drawGradient( TQPainter* p, const TQString& value, const TQColor& c); /** * Draw the Element grayed out. Used in the timeline * @param p the painter used for the painting */ - virtual void drawGrayedOut( QPainter* p ); + virtual void drawGrayedOut( TQPainter* p ); /** * draw the rectangle with the information @@ -506,9 +506,9 @@ class Element{ * @param simple if True more information will be shown * @param isCrystal whether the elements should draw its crystal structure */ - virtual void drawSelf( QPainter* p, bool simple = false, bool isCrystal = false ); + virtual void drawSelf( TQPainter* p, bool simple = false, bool isCrystal = false ); - virtual void drawStateOfMatter( QPainter* p, double temperature ); + virtual void drawStateOfMatter( TQPainter* p, double temperature ); }; diff --git a/kalzium/src/elementdataviewer.cpp b/kalzium/src/elementdataviewer.cpp index 6fe8a3e3..108889cc 100644 --- a/kalzium/src/elementdataviewer.cpp +++ b/kalzium/src/elementdataviewer.cpp @@ -26,11 +26,11 @@ #include //QT-Includes -#include -#include -#include +#include +#include +#include -ElementDataViewer::ElementDataViewer( QWidget *parent, const char* name ) +ElementDataViewer::ElementDataViewer( TQWidget *parent, const char* name ) : KDialogBase( KDialogBase::Plain, i18n( "Plot Data") , Help | User1 | Close, @@ -41,7 +41,7 @@ ElementDataViewer::ElementDataViewer( QWidget *parent, const char* name ) yData = new AxisData(); - QHBoxLayout *layout = new QHBoxLayout(plainPage(), 0, KDialog::spacingHint() ); + TQHBoxLayout *layout = new TQHBoxLayout(plainPage(), 0, KDialog::spacingHint() ); m_pPlotSetupWidget = new PlotSetupWidget( plainPage(), "plotsetup" ); m_pPlotSetupWidget->from->setMaxValue( d->numberOfElements() - 1 ); @@ -69,15 +69,15 @@ ElementDataViewer::ElementDataViewer( QWidget *parent, const char* name ) setButtonText( User1, i18n("&Plot") ); m_actionCollection = new KActionCollection(this); - KStdAction::quit(this, SLOT(slotClose()), m_actionCollection); + KStdAction::quit(this, TQT_SLOT(slotClose()), m_actionCollection); - connect ( m_pPlotSetupWidget->KCB_y, SIGNAL( activated(int) ), - this, SLOT( drawPlot()) ); + connect ( m_pPlotSetupWidget->KCB_y, TQT_SIGNAL( activated(int) ), + this, TQT_SLOT( drawPlot()) ); - connect ( m_pPlotSetupWidget->connectPoints, SIGNAL( toggled(bool) ), - this, SLOT( drawPlot()) ); - connect ( m_pPlotSetupWidget->showNames, SIGNAL( toggled(bool) ), - this, SLOT( drawPlot()) ); + connect ( m_pPlotSetupWidget->connectPoints, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( drawPlot()) ); + connect ( m_pPlotSetupWidget->showNames, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( drawPlot()) ); // Draw the plot so that the user doesn't have to press the "Plot" // button to seee anything. @@ -128,12 +128,12 @@ void ElementDataViewer::setLimits(int f, int t) m_pPlotWidget->setLimits( f - dx, t + dx, minY - dy, maxY + dy ); } -void ElementDataViewer::paintEvent(QPaintEvent*) +void ElementDataViewer::paintEvent(TQPaintEvent*) { m_pPlotWidget->update(); } -void ElementDataViewer::keyPressEvent(QKeyEvent *e) +void ElementDataViewer::keyPressEvent(TQKeyEvent *e) { switch ( e->key() ) { @@ -294,9 +294,9 @@ void ElementDataViewer::drawPlot() /* * reserve the memory for the KPlotObjects */ - //TODO QT4 replace QMemArray with QVector - QMemArray dataPoint(num); - QMemArray dataPointLabel(num); + //TODO QT4 replace TQMemArray with QVector + TQMemArray dataPoint(num); + TQMemArray dataPointLabel(num); int number = 0; @@ -334,9 +334,9 @@ void ElementDataViewer::drawPlot() } //now set the values for the min, max and avarage value - m_pPlotSetupWidget->aValue->setText( QString::number( av/number ) ); - m_pPlotSetupWidget->minValue->setText( QString::number( min ) ); - m_pPlotSetupWidget->maxValue->setText( QString::number( max ) ); + m_pPlotSetupWidget->aValue->setText( TQString::number( av/number ) ); + m_pPlotSetupWidget->minValue->setText( TQString::number( min ) ); + m_pPlotSetupWidget->maxValue->setText( TQString::number( max ) ); } void ElementDataViewer::initData() diff --git a/kalzium/src/elementdataviewer.h b/kalzium/src/elementdataviewer.h index 4414377c..76fea4b1 100644 --- a/kalzium/src/elementdataviewer.h +++ b/kalzium/src/elementdataviewer.h @@ -16,7 +16,7 @@ #include -typedef QValueList DoubleList; +typedef TQValueList DoubleList; class Element; class KalziumDataObject; @@ -98,7 +98,7 @@ class ElementDataViewer : public KDialogBase Q_OBJECT public: - ElementDataViewer( QWidget *parent=0 , const char *name =0 ); + ElementDataViewer( TQWidget *parent=0 , const char *name =0 ); /** * the AxixData for the y-Axis @@ -117,8 +117,8 @@ class ElementDataViewer : public KDialogBase void slotUser1(); protected: - virtual void paintEvent(QPaintEvent*); - virtual void keyPressEvent(QKeyEvent *e); + virtual void paintEvent(TQPaintEvent*); + virtual void keyPressEvent(TQKeyEvent *e); protected slots: /** @@ -132,7 +132,7 @@ class ElementDataViewer : public KDialogBase KalziumDataObject *d; - QStringList names; + TQStringList names; KActionCollection* m_actionCollection; diff --git a/kalzium/src/eqchemview.cpp b/kalzium/src/eqchemview.cpp index 6b5a9476..fee6e9c7 100644 --- a/kalzium/src/eqchemview.cpp +++ b/kalzium/src/eqchemview.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -46,11 +46,11 @@ extern "C" { char* solve_equation(const char *) { return NULL; } #endif -eqchemView::eqchemView(QWidget *parent) : QWidget(parent) +eqchemView::eqchemView(TQWidget *parent) : TQWidget(parent) { settingsChanged(); - QGridLayout *l = new QGridLayout(this, 2, 2, 11, 6, "eqchemView::eqchemView layout"); + TQGridLayout *l = new TQGridLayout(this, 2, 2, 11, 6, "eqchemView::eqchemView layout"); m_eqResult = new EqResult(this); m_eqedit = new KLineEdit(this); @@ -63,7 +63,7 @@ eqchemView::eqchemView(QWidget *parent) : QWidget(parent) m_eqclear->setIconSet( KGlobal::instance()->iconLoader()->loadIconSet("locationbar_erase", KIcon::NoGroup, 22 /*KIcon::SizeSmallMedium*/) ); - connect(m_eqclear, SIGNAL(clicked()), m_eqedit, SLOT(clear()) ); + connect(m_eqclear, TQT_SIGNAL(clicked()), m_eqedit, TQT_SLOT(clear()) ); } eqchemView::~eqchemView() @@ -88,14 +88,14 @@ void eqchemView::clear() void eqchemView::compute() { - QString equation( m_eqedit->text() ); + TQString equation( m_eqedit->text() ); equation.replace("+", "+"); equation.replace("->", " -> "); equation.append(" "); equation.prepend(" "); char * result = solve_equation( equation.latin1() ); - QString disp = QString(result); + TQString disp = TQString(result); // mem leak ? free(result); @@ -104,7 +104,7 @@ void eqchemView::compute() m_eqResult->add( equation, disp ); } -EQChemDialog::EQChemDialog( QWidget *parent ) +EQChemDialog::EQChemDialog( TQWidget *parent ) : KDialogBase(parent, "EQChemDialog", true, i18n( "Solve Chemical Equations" ), KDialogBase::Apply|KDialogBase::Close|KDialogBase::Help, KDialogBase::Apply, true ) { diff --git a/kalzium/src/eqchemview.h b/kalzium/src/eqchemview.h index 4e381fc2..418858a4 100644 --- a/kalzium/src/eqchemview.h +++ b/kalzium/src/eqchemview.h @@ -21,7 +21,7 @@ #ifndef _EQCHEMVIEW_H_ #define _EQCHEMVIEW_H_ -#include +#include #include class QPainter; @@ -47,7 +47,7 @@ public: /** * Default constructor */ - eqchemView(QWidget *parent); + eqchemView(TQWidget *parent); /** * Destructor @@ -58,12 +58,12 @@ signals: /** * Use this signal to change the content of the statusbar */ - void signalChangeStatusbar(const QString& text); + void signalChangeStatusbar(const TQString& text); /** * Use this signal to change the content of the caption */ - void signalChangeCaption(const QString& text); + void signalChangeCaption(const TQString& text); public slots: void clear(); @@ -92,7 +92,7 @@ class EQChemDialog : public KDialogBase * * @param parent the parent widget */ - EQChemDialog( QWidget *parent ); + EQChemDialog( TQWidget *parent ); private slots: /** diff --git a/kalzium/src/eqresult.cpp b/kalzium/src/eqresult.cpp index a1ebf555..c128c93e 100644 --- a/kalzium/src/eqresult.cpp +++ b/kalzium/src/eqresult.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include @@ -28,68 +28,68 @@ // inspired by speedcrunch -QuestionItem::QuestionItem( QListBox* listBox, const QString& e, QColor bg ): -QListBoxItem ( listBox ) +QuestionItem::QuestionItem( TQListBox* listBox, const TQString& e, TQColor bg ): +TQListBoxItem ( listBox ) { m_msg = e; m_bgcolor = bg; } -AnswerItem::AnswerItem( QListBox* listBox, const QString& e, const QString &r, QColor bg ): -QListBoxItem ( listBox ) +AnswerItem::AnswerItem( TQListBox* listBox, const TQString& e, const TQString &r, TQColor bg ): +TQListBoxItem ( listBox ) { m_msg = "

"+r+"

"; m_origmsg = e; m_bgcolor = bg; - m_richtext = new QSimpleRichText(m_msg, listBox->font()); + m_richtext = new TQSimpleRichText(m_msg, listBox->font()); m_richtext->setWidth( listBox->width() ); } -void QuestionItem::paint( QPainter* painter ) +void QuestionItem::paint( TQPainter* painter ) { int tf = Qt::NoAccel | Qt::SingleLine | Qt::AlignVCenter; - QRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); + TQRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); painter->fillRect( r, m_bgcolor ); painter->drawText( r, tf, m_msg ); } -void AnswerItem::paint( QPainter* painter ) +void AnswerItem::paint( TQPainter* painter ) { checkSize(); - QRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); + TQRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); painter->fillRect( r, m_bgcolor ); - QColorGroup cg = listBox()->colorGroup(); - cg.setColor( QColorGroup::Background, m_bgcolor ); + TQColorGroup cg = listBox()->colorGroup(); + cg.setColor( TQColorGroup::Background, m_bgcolor ); m_richtext->draw(painter, 0, 0, r, cg ); } -int QuestionItem::width( const QListBox*lb ) const +int QuestionItem::width( const TQListBox*lb ) const { - QFont font = lb->font(); - return QFontMetrics( font ).width( m_msg ); + TQFont font = lb->font(); + return TQFontMetrics( font ).width( m_msg ); } -int QuestionItem::height( const QListBox*lb ) const +int QuestionItem::height( const TQListBox*lb ) const { - QFont font = lb->font(); - return QFontMetrics( font ).height() + 4; + TQFont font = lb->font(); + return TQFontMetrics( font ).height() + 4; } void AnswerItem::checkSize() { - QFont font = listBox()->font(); - int t1 = QFontMetrics( font ).width( m_origmsg+"padding" ); + TQFont font = listBox()->font(); + int t1 = TQFontMetrics( font ).width( m_origmsg+"padding" ); int t2 = listBox()->width() - 20; // take the maximum m_richtext->setWidth( (t1>t2)?t1:t2 ); } -EqResult::EqResult(QWidget *parent) : QListBox(parent) +EqResult::EqResult(TQWidget *parent) : TQListBox(parent) { m_alternate_color = false; setMinimumWidth(140); @@ -99,9 +99,9 @@ EqResult::~EqResult() { } -void EqResult::add(const QString & question, const QString & answer) +void EqResult::add(const TQString & question, const TQString & answer) { - QColor bgcolor = colorGroup().base(); + TQColor bgcolor = colorGroup().base(); if ( m_alternate_color ) bgcolor = bgcolor.dark( 120 ); @@ -111,7 +111,7 @@ void EqResult::add(const QString & question, const QString & answer) new QuestionItem( this, question, bgcolor ); new AnswerItem( this, question, answer, bgcolor ); - QTimer::singleShot( 100, this, SLOT( scrollToEnd() ) ); + TQTimer::singleShot( 100, this, TQT_SLOT( scrollToEnd() ) ); } void EqResult::scrollToEnd() @@ -119,7 +119,7 @@ void EqResult::scrollToEnd() ensureVisible( 0, contentsHeight()-1 ); } -void EqResult::resizeEvent( QResizeEvent* ) +void EqResult::resizeEvent( TQResizeEvent* ) { triggerUpdate( true ); } diff --git a/kalzium/src/eqresult.h b/kalzium/src/eqresult.h index 7b229cde..39e7d85a 100644 --- a/kalzium/src/eqresult.h +++ b/kalzium/src/eqresult.h @@ -21,8 +21,8 @@ #ifndef _EQRESULT_H_ #define _EQRESULT_H_ -#include -#include +#include +#include /** * @author Thomas Nagy @@ -30,14 +30,14 @@ class QuestionItem : public QListBoxItem { public: - QuestionItem( QListBox*, const QString&, QColor bg ); + QuestionItem( TQListBox*, const TQString&, TQColor bg ); protected: - void paint( QPainter* p ); - int width( const QListBox* ) const; - int height( const QListBox* ) const; + void paint( TQPainter* p ); + int width( const TQListBox* ) const; + int height( const TQListBox* ) const; private: - QString m_msg; - QColor m_bgcolor; + TQString m_msg; + TQColor m_bgcolor; }; /** @@ -46,24 +46,24 @@ class QuestionItem : public QListBoxItem class AnswerItem : public QListBoxItem { public: - AnswerItem( QListBox*, const QString&, const QString&, QColor bg ); + AnswerItem( TQListBox*, const TQString&, const TQString&, TQColor bg ); ~AnswerItem() { delete m_richtext; } void checkSize(); protected: - void paint( QPainter* p ); - int width( const QListBox* ) const{ + void paint( TQPainter* p ); + int width( const TQListBox* ) const{ return m_richtext->height(); } - int height( const QListBox* ) const{ + int height( const TQListBox* ) const{ return m_richtext->height(); } private: - QString m_msg; - QString m_origmsg; - QColor m_bgcolor; - QSimpleRichText * m_richtext; + TQString m_msg; + TQString m_origmsg; + TQColor m_bgcolor; + TQSimpleRichText * m_richtext; }; /** @@ -74,13 +74,13 @@ class EqResult : public QListBox Q_OBJECT public: - EqResult(QWidget *parent); + EqResult(TQWidget *parent); ~EqResult(); public slots: - void add(const QString &, const QString &); + void add(const TQString &, const TQString &); void scrollToEnd(); - void resizeEvent( QResizeEvent* ); + void resizeEvent( TQResizeEvent* ); private: bool m_alternate_color; diff --git a/kalzium/src/exporter.cpp b/kalzium/src/exporter.cpp index 48f50170..0c667eac 100644 --- a/kalzium/src/exporter.cpp +++ b/kalzium/src/exporter.cpp @@ -19,7 +19,7 @@ #include "exporter.h" -#include +#include #include #include @@ -39,11 +39,11 @@ Exporter::~Exporter() { } -bool Exporter::saveAsImage( const QPixmap* pixmap, const QString& fileName, int x, int y, int width, int height ) +bool Exporter::saveAsImage( const TQPixmap* pixmap, const TQString& fileName, int x, int y, int width, int height ) { if ( x != 0 || y != 0 || width != 0 || height != 0 ) { - QPixmap* tmpPixmap = new QPixmap(); + TQPixmap* tmpPixmap = new TQPixmap(); copyBlt( tmpPixmap, 0, 0, pixmap, x, y, width, height ); @@ -55,7 +55,7 @@ bool Exporter::saveAsImage( const QPixmap* pixmap, const QString& fileName, int return pixmap->save( fileName, "PNG" ); } -QString Exporter::supportedImageFormats() +TQString Exporter::supportedImageFormats() { return KImageIO::pattern( KImageIO::Writing ); } diff --git a/kalzium/src/exporter.h b/kalzium/src/exporter.h index c780a394..b093b285 100644 --- a/kalzium/src/exporter.h +++ b/kalzium/src/exporter.h @@ -40,14 +40,14 @@ public: * exported. * @return whether the image was saved successfully */ - bool saveAsImage( const QPixmap* pixmap, const QString& fileName, int x = 0, int y = 0, int width = 0, int height = 0 ); + bool saveAsImage( const TQPixmap* pixmap, const TQString& fileName, int x = 0, int y = 0, int width = 0, int height = 0 ); /** * Which image type can we export to? * @return a string representing a filter string for file dialogs with * the image type we can export to */ - QString supportedImageFormats(); + TQString supportedImageFormats(); }; #endif diff --git a/kalzium/src/isotope.cpp b/kalzium/src/isotope.cpp index b15e38cc..268e99d4 100644 --- a/kalzium/src/isotope.cpp +++ b/kalzium/src/isotope.cpp @@ -23,7 +23,7 @@ #include #include -Isotope::Isotope( int neutrons, int protones, double percentage, double weight, double halflife, QString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay, double alphapercentage, double betapluspercentage, double betaminuspercentage, double ecpercentage, QString spin, QString magmoment) +Isotope::Isotope( int neutrons, int protones, double percentage, double weight, double halflife, TQString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay, double alphapercentage, double betapluspercentage, double betaminuspercentage, double ecpercentage, TQString spin, TQString magmoment) { m_neutrons = neutrons; m_protones = protones; @@ -45,9 +45,9 @@ Isotope::Isotope( int neutrons, int protones, double percentage, double weight, m_ecpercentage = ecpercentage; } -QString Isotope::halflifeAsString() +TQString Isotope::halflifeAsString() { - QString halflife; + TQString halflife; if ( !seconds() )//years { diff --git a/kalzium/src/isotope.h b/kalzium/src/isotope.h index feed345f..d32e8a5c 100644 --- a/kalzium/src/isotope.h +++ b/kalzium/src/isotope.h @@ -20,7 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include +#include /** * @author Carsten Niehaus @@ -36,7 +36,7 @@ class Isotope double percentage, double weight, double halflife, - QString format, + TQString format, double alphadecay, double betaplusdecay, double betaminusdecay, @@ -45,8 +45,8 @@ class Isotope double betapluspercentage, double betaminuspercentage, double ecpercentage, - QString spin, - QString magmoment); + TQString spin, + TQString magmoment); bool seconds() const{ if ( m_format == "seconds" ) @@ -123,20 +123,20 @@ class Isotope return m_ecdecay; } - QString spin() const{ + TQString spin() const{ return m_spin; } - QString magmoment() const{ + TQString magmoment() const{ return m_magmoment; } /** - * @return the halflife as a QString. The format will be + * @return the halflife as a TQString. The format will be * appended, for example "seconds" or "years" depending * on the timeframe */ - QString halflifeAsString(); + TQString halflifeAsString(); /** * @return the percentage of the betaminus decay @@ -172,7 +172,7 @@ class Isotope * isotopes have half-lifes of billion of years. This simply * doesn't fit into a unsigned int or double */ - QString m_format; + TQString m_format; /** * the weight of the isotope @@ -214,12 +214,12 @@ class Isotope /** *spin and parity */ - QString m_spin; + TQString m_spin; /** * magnetic moment */ - QString m_magmoment; + TQString m_magmoment; /** * the percentage with which the istope decays as alpha-rays diff --git a/kalzium/src/kalzium.cpp b/kalzium/src/kalzium.cpp index 613377cd..84c2c984 100644 --- a/kalzium/src/kalzium.cpp +++ b/kalzium/src/kalzium.cpp @@ -32,12 +32,12 @@ #include "kalziumutils.h" #include "config.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -61,21 +61,21 @@ Kalzium::Kalzium() // reading the elements from file KalziumDataObject::instance(); - QWidget *centralWidget = new QWidget( this, "centralWidget" ); - m_pCentralLayout = new QVBoxLayout( centralWidget, PerodicTableView_MARGIN, -1, "CentralLayout" ); + TQWidget *centralWidget = new TQWidget( this, "centralWidget" ); + m_pCentralLayout = new TQVBoxLayout( centralWidget, PerodicTableView_MARGIN, -1, "CentralLayout" ); - QScrollView *helperSV = new QScrollView(centralWidget); + TQScrollView *helperSV = new TQScrollView(centralWidget); m_pCentralLayout->addWidget(helperSV); helperSV->viewport()->setPaletteBackgroundColor(paletteBackgroundColor()); - helperSV->setFrameShape(QFrame::NoFrame); + helperSV->setFrameShape(TQFrame::NoFrame); m_PerodicTableView = new PerodicTableView( helperSV->viewport(), "PerodicTableView"); helperSV->addChild( m_PerodicTableView ); m_infoDialog = 0; m_toolboxCurrent = 0; - connect( m_PerodicTableView, SIGNAL( ElementClicked( int ) ), this, SLOT( openInformationDialog( int ) )); - connect( m_PerodicTableView, SIGNAL( MouseOver( int ) ), this, SLOT( slotStatusbar( int ) )); + connect( m_PerodicTableView, TQT_SIGNAL( ElementClicked( int ) ), this, TQT_SLOT( openInformationDialog( int ) )); + connect( m_PerodicTableView, TQT_SIGNAL( MouseOver( int ) ), this, TQT_SLOT( slotStatusbar( int ) )); // layouting setCentralWidget( centralWidget ); @@ -89,8 +89,8 @@ Kalzium::Kalzium() // creating the glossary dialog and loading the glossaries we have m_glossarydlg = new GlossaryDialog( true, this, "glossary" ); - QString dir = KGlobal::dirs()->findResourceDir( "data", "kalzium/data/" ); - QString picturepath = dir + "kalzium/data/bg.jpg"; + TQString dir = KGlobal::dirs()->findResourceDir( "data", "kalzium/data/" ); + TQString picturepath = dir + "kalzium/data/bg.jpg"; KURL u = dir + "kalzium/data/knowledge.xml"; Glossary *g = Glossary::readFromXML( u ); g->setName( i18n( "Knowledge" ) ); @@ -107,17 +107,17 @@ Kalzium::Kalzium() void Kalzium::setupActions() { - m_actionNoScheme = new KToggleAction(i18n("&No Color Scheme"), 0, this, SLOT(slotNoLook()), actionCollection(), "view_look_noscheme"); + m_actionNoScheme = new KToggleAction(i18n("&No Color Scheme"), 0, this, TQT_SLOT(slotNoLook()), actionCollection(), "view_look_noscheme"); // the actions for the color schemes - m_actionGroups = new KToggleAction(i18n("Show &Groups"), 0, this, SLOT(slotLookGroups()), actionCollection(), "view_look_groups"); - m_actionBlocks = new KToggleAction(i18n("Show &Blocks"), 0, this, SLOT(slotLookBlocks()), actionCollection(), "view_look_blocks"); - m_actionAcid = new KToggleAction(i18n("Show &Acid Behavior"), 0, this, SLOT(slotLookAcidBehavior()), actionCollection(), "view_look_acid"); - m_actionFamily = new KToggleAction(i18n("Show &Family"), 0, this, SLOT(slotLookFamily()), actionCollection(), "view_look_family"); - m_actionCrystal = new KToggleAction(i18n("Show &Crystal Structures"), 0, this, SLOT(slotLookCrystal()), actionCollection(), "view_look_crystal"); + m_actionGroups = new KToggleAction(i18n("Show &Groups"), 0, this, TQT_SLOT(slotLookGroups()), actionCollection(), "view_look_groups"); + m_actionBlocks = new KToggleAction(i18n("Show &Blocks"), 0, this, TQT_SLOT(slotLookBlocks()), actionCollection(), "view_look_blocks"); + m_actionAcid = new KToggleAction(i18n("Show &Acid Behavior"), 0, this, TQT_SLOT(slotLookAcidBehavior()), actionCollection(), "view_look_acid"); + m_actionFamily = new KToggleAction(i18n("Show &Family"), 0, this, TQT_SLOT(slotLookFamily()), actionCollection(), "view_look_family"); + m_actionCrystal = new KToggleAction(i18n("Show &Crystal Structures"), 0, this, TQT_SLOT(slotLookCrystal()), actionCollection(), "view_look_crystal"); //the actions for switching PerodicTableView - QStringList gradientlist; + TQStringList gradientlist; gradientlist.append(i18n("Atomic Radius")); gradientlist.append(i18n("Covalent Radius")); gradientlist.append(i18n("van der Waals Radius")); @@ -129,10 +129,10 @@ void Kalzium::setupActions() gradientlist.append(i18n("Electron Affinity")); gradient_action = new KSelectAction(i18n("&Gradient"), 0, this, 0, actionCollection(), "view_look_gradmenu"); gradient_action->setItems(gradientlist); - connect (gradient_action, SIGNAL(activated(int)), this, SLOT(slotSwitchtoGradient(int))); + connect (gradient_action, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSwitchtoGradient(int))); // the actions for switching PerodicTableView - QStringList numlist; + TQStringList numlist; numlist.append(i18n("No N&umeration")); numlist.append(i18n("Show &IUPAC")); numlist.append(i18n("Show &CAS")); @@ -140,25 +140,25 @@ void Kalzium::setupActions() numeration_action = new KSelectAction (i18n("&Numeration"), 0, this, 0, actionCollection(), "view_numerationtype"); numeration_action->setItems(numlist); numeration_action->setCurrentItem(Prefs::numeration()); - connect (numeration_action, SIGNAL(activated(int)), this, SLOT(slotSwitchtoNumeration(int))); + connect (numeration_action, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSwitchtoNumeration(int))); - m_SidebarAction = new KAction(i18n("Show &Sidebar"), "sidebar", 0, this, SLOT(slotShowHideSidebar()), actionCollection(), "view_sidebar"); + m_SidebarAction = new KAction(i18n("Show &Sidebar"), "sidebar", 0, this, TQT_SLOT(slotShowHideSidebar()), actionCollection(), "view_sidebar"); #ifdef HAVE_FACILE - m_EQSolverAction = new KAction(i18n("&Equation Solver..."), "eqchem", 0, this, SLOT(slotShowEQSolver()), actionCollection(), "tools_eqsolver"); + m_EQSolverAction = new KAction(i18n("&Equation Solver..."), "eqchem", 0, this, TQT_SLOT(slotShowEQSolver()), actionCollection(), "tools_eqsolver"); #endif // tools actions - m_pPlotAction = new KAction(i18n("&Plot Data..."), "plot", 0, this, SLOT(slotPlotData()), actionCollection(), "tools_plotdata"); - m_pGlossaryAction = new KAction(i18n("&Glossary..."), "glossary", 0, this, SLOT(slotGlossary()), actionCollection(), "tools_glossary"); + m_pPlotAction = new KAction(i18n("&Plot Data..."), "plot", 0, this, TQT_SLOT(slotPlotData()), actionCollection(), "tools_plotdata"); + m_pGlossaryAction = new KAction(i18n("&Glossary..."), "glossary", 0, this, TQT_SLOT(slotGlossary()), actionCollection(), "tools_glossary"); // other period view options - m_pLegendAction = new KAction(i18n("Show &Legend"), "legend", 0, this, SLOT(slotShowLegend()), actionCollection(), "view_legend"); - m_pTooltipAction = new KAction(i18n("Show &Tooltip"), "tooltip", 0, this, SLOT(slotEnableTooltips()), actionCollection(), "view_tooltip"); + m_pLegendAction = new KAction(i18n("Show &Legend"), "legend", 0, this, TQT_SLOT(slotShowLegend()), actionCollection(), "view_legend"); + m_pTooltipAction = new KAction(i18n("Show &Tooltip"), "tooltip", 0, this, TQT_SLOT(slotEnableTooltips()), actionCollection(), "view_tooltip"); // the standard actions - KStdAction::preferences(this, SLOT(showSettingsDialog()), actionCollection()); - KStdAction::quit( kapp, SLOT (closeAllWindows()),actionCollection() ); + KStdAction::preferences(this, TQT_SLOT(showSettingsDialog()), actionCollection()); + KStdAction::quit( kapp, TQT_SLOT (closeAllWindows()),actionCollection() ); slotShowScheme( Prefs::colorschemebox() ); slotSwitchtoNumeration( Prefs::numeration() ); @@ -197,51 +197,51 @@ void Kalzium::setupActions() void Kalzium::setupSidebars() { - m_dockWin = new QDockWindow( this ); + m_dockWin = new TQDockWindow( this ); m_dockWin->setNewLine( true ); m_dockWin->setFixedExtentWidth( 220 ); m_dockWin->setResizeEnabled( true ); - m_dockWin->setFrameShape( QFrame::ToolBarPanel ); + m_dockWin->setFrameShape( TQFrame::ToolBarPanel ); m_dockWin->setCaption( i18n( "Sidebar" ) ); - m_dockWin->setCloseMode( QDockWindow::Always ); + m_dockWin->setCloseMode( TQDockWindow::Always ); - QToolBox *m_toolbox = new QToolBox( m_dockWin ); + TQToolBox *m_toolbox = new TQToolBox( m_dockWin ); m_dockWin->setWidget( m_toolbox ); - QWidget *fake = new QWidget( m_dockWin ); - QVBoxLayout *lay = new QVBoxLayout( fake, 5 ); + TQWidget *fake = new TQWidget( m_dockWin ); + TQVBoxLayout *lay = new TQVBoxLayout( fake, 5 ); lay->activate(); m_detailWidget = new DetailedGraphicalOverview( fake, "DetailedGraphicalOverview" ); m_detailWidget->setMinimumSize( 200, m_detailWidget->minimumSize().height() ); - connect( m_PerodicTableView, SIGNAL( MouseOver( int ) ), this, SLOT( slotSelectedNumber( int ) )); + connect( m_PerodicTableView, TQT_SIGNAL( MouseOver( int ) ), this, TQT_SLOT( slotSelectedNumber( int ) )); lay->addWidget( m_detailWidget ); - lay->addItem( new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ) ); + lay->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Fixed, TQSizePolicy::MinimumExpanding ) ); m_toolbox->addItem( fake, SmallIcon( "overview" ), i18n( "Overview" ) ); m_calcWidget = new MolcalcWidget( m_dockWin, "molcalcwidget" ); m_toolbox->addItem( m_calcWidget, SmallIcon( "calculate" ), i18n( "Calculate" ) ); m_timeWidget = new TimeWidgetIMPL( this, "TimeWidget" ); - connect( m_timeWidget->time_slider, SIGNAL( valueChanged( int ) ), - m_PerodicTableView, SLOT( setDate( int ) ) ); - connect( m_timeWidget->time_slider, SIGNAL( valueChanged( int ) ), - m_timeWidget, SLOT( slotChanged( int ) ) ); - connect( m_timeWidget->Number1, SIGNAL( valueChanged( int ) ), - m_timeWidget, SLOT( slotChanged( int ) ) ); + connect( m_timeWidget->time_slider, TQT_SIGNAL( valueChanged( int ) ), + m_PerodicTableView, TQT_SLOT( setDate( int ) ) ); + connect( m_timeWidget->time_slider, TQT_SIGNAL( valueChanged( int ) ), + m_timeWidget, TQT_SLOT( slotChanged( int ) ) ); + connect( m_timeWidget->Number1, TQT_SIGNAL( valueChanged( int ) ), + m_timeWidget, TQT_SLOT( slotChanged( int ) ) ); m_toolbox->addItem( m_timeWidget, SmallIcon( "timeline" ), i18n( "Timeline" ) ); m_somWidget = new SOMWidgetIMPL( this, "somWidget" ); - connect( m_somWidget->temp_slider, SIGNAL( valueChanged( int ) ), - m_PerodicTableView, SLOT( setTemperature( int ) ) ); + connect( m_somWidget->temp_slider, TQT_SIGNAL( valueChanged( int ) ), + m_PerodicTableView, TQT_SLOT( setTemperature( int ) ) ); m_toolbox->addItem( m_somWidget, SmallIcon( "statematter" ), i18n( "State of Matter" ) ); - connect( m_toolbox, SIGNAL( currentChanged( int ) ), this, SLOT( slotToolboxCurrentChanged( int ) ) ); + connect( m_toolbox, TQT_SIGNAL( currentChanged( int ) ), this, TQT_SLOT( slotToolboxCurrentChanged( int ) ) ); moveDockWindow( m_dockWin, DockLeft ); setDockEnabled( /*m_dockWin, */DockTop, false ); setDockEnabled( /*m_dockWin, */DockBottom, false ); m_dockWin->hide(); - connect( m_dockWin, SIGNAL(visibilityChanged(bool)), this, SLOT(slotSidebarVisibilityChanged(bool))); + connect( m_dockWin, TQT_SIGNAL(visibilityChanged(bool)), this, TQT_SLOT(slotSidebarVisibilityChanged(bool))); } @@ -255,15 +255,15 @@ void Kalzium::slotShowEQSolver() #ifdef HAVE_FACILE EQChemDialog *dlg = new EQChemDialog( this ); - QWidget *page = new QWidget( dlg ); + TQWidget *page = new TQWidget( dlg ); dlg->setMainWidget( page ); - QVBoxLayout *vbox = new QVBoxLayout( page , 0, KDialogBase:: spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( page , 0, KDialogBase:: spacingHint() ); eqchemView *eqsolver = new eqchemView( page ); eqsolver->setMinimumSize( 600,400 ); vbox->addWidget( eqsolver ); - connect(dlg, SIGNAL(applyClicked()), eqsolver, SLOT(compute())); + connect(dlg, TQT_SIGNAL(applyClicked()), eqsolver, TQT_SLOT(compute())); dlg->show(); #endif } @@ -398,8 +398,8 @@ void Kalzium::showSettingsDialog() //KConfigDialog didn't find an instance of this dialog, so lets create it : KConfigDialog *dialog = new KConfigDialog(this,"settings", Prefs::self()); - connect( dialog, SIGNAL( settingsChanged() ), this , SLOT( slotUpdateSettings() ) ); - connect( dialog, SIGNAL( settingsChanged() ), m_somWidget, SLOT( reloadUnits() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), this , TQT_SLOT( slotUpdateSettings() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), m_somWidget, TQT_SLOT( reloadUnits() ) ); dialog->addPage( new setColors( 0, "colors_page"), i18n("Colors"), "colorize"); dialog->addPage( new setupUnits( 0, "units_page"), i18n("Units"), "gear"); dialog->addPage( new setupMisc( 0, "miscpage" ), i18n( "Miscellaneous" ), "misc" ); @@ -440,10 +440,10 @@ void Kalzium::openInformationDialog( int number ) this, "detailedDlg" ); // Remove the selection when this dialog finishes or hides. - connect(m_infoDialog, SIGNAL(hidden()), - m_PerodicTableView, SLOT(unSelect())); - connect(m_infoDialog, SIGNAL(elementChanged(int)), - m_PerodicTableView, SLOT(selectElement(int))); + connect(m_infoDialog, TQT_SIGNAL(hidden()), + m_PerodicTableView, TQT_SLOT(unSelect())); + connect(m_infoDialog, TQT_SIGNAL(elementChanged(int)), + m_PerodicTableView, TQT_SLOT(selectElement(int))); } m_infoDialog->show(); } diff --git a/kalzium/src/kalzium.h b/kalzium/src/kalzium.h index 5837607b..aeafbcc1 100644 --- a/kalzium/src/kalzium.h +++ b/kalzium/src/kalzium.h @@ -107,7 +107,7 @@ class Kalzium : public KMainWindow /** * the layout of the central Widget ( CentralWidget ) */ - QVBoxLayout *m_pCentralLayout; + TQVBoxLayout *m_pCentralLayout; MolcalcWidget *m_calcWidget; @@ -117,8 +117,8 @@ class Kalzium : public KMainWindow DetailedGraphicalOverview *m_detailWidget; - QDockWindow *m_dockWin; - QToolBox *m_toolbox; + TQDockWindow *m_dockWin; + TQToolBox *m_toolbox; int m_toolboxCurrent; GlossaryDialog *m_glossarydlg; diff --git a/kalzium/src/kalziumdataobject.cpp b/kalzium/src/kalziumdataobject.cpp index 3d1a33bf..a759fee2 100644 --- a/kalzium/src/kalziumdataobject.cpp +++ b/kalzium/src/kalziumdataobject.cpp @@ -23,8 +23,8 @@ #include "isotope.h" #include "spectrum.h" -#include -#include +#include +#include #include #include @@ -41,12 +41,12 @@ KalziumDataObject* KalziumDataObject::instance() KalziumDataObject::KalziumDataObject() { - QDomDocument doc( "datadocument" ); + TQDomDocument doc( "datadocument" ); KURL url; url.setPath( locate("data", "kalzium/data/")); url.setFileName( "data.xml" ); - QFile layoutFile( url.path() ); + TQFile layoutFile( url.path() ); if (!layoutFile.exists()) { @@ -86,11 +86,11 @@ Element* KalziumDataObject::element( int number ) return *( ElementList.at( number-1 ) ); } -EList KalziumDataObject::readData( QDomDocument &dataDocument ) +EList KalziumDataObject::readData( TQDomDocument &dataDocument ) { EList list; - QDomNodeList elementNodes; //the list of all element - QDomElement domElement; //a single element + TQDomNodeList elementNodes; //the list of all element + TQDomElement domElement; //a single element //read in all elements elementNodes = dataDocument.elementsByTagName( "element" ); @@ -99,7 +99,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) for ( uint i = 0; i < count; ++i ) {//iterate through all elements - domElement = ( const QDomElement& ) elementNodes.item( i ).toElement(); + domElement = ( const TQDomElement& ) elementNodes.item( i ).toElement(); double mass = domElement.namedItem( "mass" ).toElement().text().toDouble(); double en = domElement.namedItem( "electronegativity" ).toElement().text().toDouble(); @@ -112,7 +112,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) double vdw_radius = domElement.namedItem( "radius" ).namedItem( "vdw" ).toElement().text().toDouble(); double atomic_radius = domElement.namedItem( "radius" ).namedItem( "atomic" ).toElement().text().toDouble(); double ionic_radius = domElement.namedItem( "radius" ).namedItem( "ionic" ).toElement().text().toDouble(); - QString ionic_charge = domElement.namedItem( "radius" ).namedItem( "ionic" ).toElement().attributeNode( "charge" ).value(); + TQString ionic_charge = domElement.namedItem( "radius" ).namedItem( "ionic" ).toElement().attributeNode( "charge" ).value(); int bio = domElement.namedItem( "biologicalmeaning" ).toElement().text().toInt(); int radioactive = domElement.namedItem( "radioactive" ).toElement().text().toInt(); @@ -122,37 +122,37 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) int number = domElement.namedItem( "number" ).toElement().text().toInt(); int abundance = domElement.namedItem( "abundance" ).toElement().text().toInt(); - QString scientist = domElement.namedItem( "date" ).toElement().attributeNode( "scientist" ).value(); - QString crystal = domElement.namedItem( "crystalstructure" ).toElement().text(); + TQString scientist = domElement.namedItem( "date" ).toElement().attributeNode( "scientist" ).value(); + TQString crystal = domElement.namedItem( "crystalstructure" ).toElement().text(); - QDomElement nameE = domElement.namedItem( "name" ).toElement(); - QString name = nameE.text(); - QString origin = i18n( nameE.attributeNode( "origin" ).value().utf8() ); + TQDomElement nameE = domElement.namedItem( "name" ).toElement(); + TQString name = nameE.text(); + TQString origin = i18n( nameE.attributeNode( "origin" ).value().utf8() ); - QString block = domElement.namedItem( "block" ).toElement().text(); - QString group = domElement.namedItem( "group" ).toElement().text(); - QString family = domElement.namedItem( "family" ).toElement().text(); - QString orbits = domElement.namedItem( "orbits" ).toElement().text(); - QString symbol = domElement.namedItem( "symbol" ).toElement().text(); - QString oxydation = domElement.namedItem( "oxydation" ).toElement().text(); - QString acidicbehaviour = domElement.namedItem( "acidicbehaviour" ).toElement().text(); + TQString block = domElement.namedItem( "block" ).toElement().text(); + TQString group = domElement.namedItem( "group" ).toElement().text(); + TQString family = domElement.namedItem( "family" ).toElement().text(); + TQString orbits = domElement.namedItem( "orbits" ).toElement().text(); + TQString symbol = domElement.namedItem( "symbol" ).toElement().text(); + TQString oxydation = domElement.namedItem( "oxydation" ).toElement().text(); + TQString acidicbehaviour = domElement.namedItem( "acidicbehaviour" ).toElement().text(); - QDomNodeList elist = domElement.elementsByTagName( "energy" ); - QValueList ionlist; + TQDomNodeList elist = domElement.elementsByTagName( "energy" ); + TQValueList ionlist; for( uint i = 0; i < elist.length(); i++ ) { ionlist.append( elist.item( i ).toElement().text().toDouble() ); } //now read in all the date for the isotopes - QDomNodeList isotopelist = domElement.elementsByTagName( "isotope" ); - QValueList isolist; + TQDomNodeList isotopelist = domElement.elementsByTagName( "isotope" ); + TQValueList isolist; for( uint i = 0; i < isotopelist.length(); i++ ) { - QDomElement iso = isotopelist.item( i ).toElement(); + TQDomElement iso = isotopelist.item( i ).toElement(); double halflife = iso.attributeNode( "halflife" ).value().toDouble(); double weight = iso.attributeNode( "weight" ).value().toDouble(); - QString format = iso.attributeNode( "halflifeformat" ).value(); + TQString format = iso.attributeNode( "halflifeformat" ).value(); int neutrons = iso.attributeNode( "neutron" ).value().toInt(); double percentage = iso.attributeNode( "percentage" ).value().toDouble(); double alphapercentage = iso.attributeNode( "alphapercentage" ).value().toDouble(); @@ -163,8 +163,8 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) double betaplusdecay = iso.attributeNode( "betaplusdecay" ).value().toDouble(); double betaminusdecay = iso.attributeNode( "betaminusdecay" ).value().toDouble(); double ecdecay = iso.attributeNode( "ecdecay" ).value().toDouble(); - QString spin = iso.attributeNode( "spin" ).value(); - QString magmoment = iso.attributeNode( "magmoment" ).value(); + TQString spin = iso.attributeNode( "spin" ).value(); + TQString magmoment = iso.attributeNode( "magmoment" ).value(); Isotope *isotope = new Isotope( neutrons, @@ -186,7 +186,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) isolist.append( isotope ); } - QDomNodeList spectrumList = domElement.namedItem( "spectra" ).toElement().elementsByTagName( "spectrum" ); + TQDomNodeList spectrumList = domElement.namedItem( "spectra" ).toElement().elementsByTagName( "spectrum" ); Element *e = new Element(); e->setDate(date); @@ -234,7 +234,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) for( uint i = 0; i < spectrumList.length(); i++ ) { Spectrum::band b; - QDomElement spec = spectrumList.item( i ).toElement(); + TQDomElement spec = spectrumList.item( i ).toElement(); b.intensity = spec.attributeNode( "intensity" ).value().toInt(); b.wavelength = spec.attributeNode( "wavelength" ).value().toDouble()/10.0; diff --git a/kalzium/src/kalziumdataobject.h b/kalzium/src/kalziumdataobject.h index 6d358510..e8508276 100644 --- a/kalzium/src/kalziumdataobject.h +++ b/kalzium/src/kalziumdataobject.h @@ -26,7 +26,7 @@ * @short This class contains all Element objects * * This singleton class collects all the information about the elements of the - * Periodic Table as list of Element (QValueList). + * Periodic Table as list of Element (TQValueList). * Use: * @code * KalziumDataObject::instance()->ElementList; @@ -48,7 +48,7 @@ class KalziumDataObject static KalziumDataObject* instance(); /** - * The list of elements in a QValueList + * The list of elements in a TQValueList */ EList ElementList; @@ -69,7 +69,7 @@ class KalziumDataObject KalziumDataObject(); ~KalziumDataObject(); - EList readData( QDomDocument &dataDocument ); + EList readData( TQDomDocument &dataDocument ); /** * Caching the number of elements diff --git a/kalzium/src/kalziumtip.cpp b/kalzium/src/kalziumtip.cpp index 0f053c77..ba2a8252 100644 --- a/kalzium/src/kalziumtip.cpp +++ b/kalzium/src/kalziumtip.cpp @@ -24,12 +24,12 @@ #include "kalziumutils.h" #include "element.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -38,7 +38,7 @@ #include #include -KalziumTip::KalziumTip( QWidget * parent, const char * name, WFlags f ) : QWidget( parent, name, f ) +KalziumTip::KalziumTip( TQWidget * parent, const char * name, WFlags f ) : TQWidget( parent, name, f ) { setFocusPolicy(NoFocus); //the widget don't get the keyboard focus setBackgroundMode(NoBackground); // widget has no background @@ -48,14 +48,14 @@ KalziumTip::KalziumTip( QWidget * parent, const char * name, WFlags f ) : QWidge m_noElemIcon = KGlobal::iconLoader()->loadIcon( "orbits", KIcon::NoGroup, 64 ); setMouseTracking(true); // receice mouse move events - connect(&m_frameTimer, SIGNAL(timeout()), SLOT(internalUpdate())); + connect(&m_frameTimer, TQT_SIGNAL(timeout()), TQT_SLOT(internalUpdate())); } -void KalziumTip::showTip( QPoint mouse, Element* element, int visibleWidth, int visibleHeight ) +void KalziumTip::showTip( TQPoint mouse, Element* element, int visibleWidth, int visibleHeight ) { - QWidget *p = 0; - if ( dynamic_cast( parent() ) ) - p = static_cast( parent() ); + TQWidget *p = 0; + if ( dynamic_cast( parent() ) ) + p = static_cast( parent() ); if ( p ) { @@ -99,7 +99,7 @@ void KalziumTip::showTip( QPoint mouse, Element* element, int visibleWidth, int } } -void KalziumTip::paintEvent(QPaintEvent* e) +void KalziumTip::paintEvent(TQPaintEvent* e) { if (m_dirty) { @@ -107,11 +107,11 @@ void KalziumTip::paintEvent(QPaintEvent* e) m_dirty = false; } - QPainter p(this); + TQPainter p(this); p.drawPixmap(e->rect().topLeft(), m_pixmap, e->rect()); } -void KalziumTip::mouseMoveEvent(QMouseEvent * e) +void KalziumTip::mouseMoveEvent(TQMouseEvent * e) { // delegate the mouse move event to the parent (actually the elements table) // so that this tooltip doesn't stop to be updated @@ -125,15 +125,15 @@ void KalziumTip::display() delete m_richText; - QString elementname = m_tippedElement->elname(); + TQString elementname = m_tippedElement->elname(); - QString number = i18n( "Number: %1" ) - .arg( QString::number(m_tippedElement->number()) ); + TQString number = i18n( "Number: %1" ) + .arg( TQString::number(m_tippedElement->number()) ); - QString mass = i18n( "Mass: %1" ) + TQString mass = i18n( "Mass: %1" ) .arg( KalziumUtils::localizedValue(m_tippedElement->mass(), 6) ); - m_richText = new QSimpleRichText("

" + elementname + "

" + m_richText = new TQSimpleRichText("

" + elementname + "

" + number + "

" + mass +"

", font()); @@ -157,7 +157,7 @@ void KalziumTip::displayInternal() // determine text rectangel sizes - QRect textRect(0,0,0,0); + TQRect textRect(0,0,0,0); textRect.setWidth(m_richText->widthUsed()); textRect.setHeight(m_richText->height()); @@ -190,7 +190,7 @@ void KalziumTip::displayInternal() } // draw background - QPainter bufferPainter(&m_pixmap); + TQPainter bufferPainter(&m_pixmap); bufferPainter.setPen(Qt::black); bufferPainter.setBrush(backgroundColor()); bufferPainter.drawRoundRect(0, 0, width, height, @@ -206,10 +206,10 @@ void KalziumTip::displayInternal() } // draw text shadow - QColorGroup cg = colorGroup(); - cg.setColor(QColorGroup::Text, cg.background().dark(115)); - int shadowOffset = QApplication::reverseLayout() ? -1 : 1; - m_richText->draw(&bufferPainter, 5 + textX + shadowOffset, textY + 1, QRect(), cg); + TQColorGroup cg = colorGroup(); + cg.setColor(TQColorGroup::Text, cg.background().dark(115)); + int shadowOffset = TQApplication::reverseLayout() ? -1 : 1; + m_richText->draw(&bufferPainter, 5 + textX + shadowOffset, textY + 1, TQRect(), cg); // draw text cg = colorGroup(); @@ -218,7 +218,7 @@ void KalziumTip::displayInternal() void KalziumTip::dissolveMask() { - QPainter maskPainter(&m_mask); + TQPainter maskPainter(&m_mask); m_mask.fill(Qt::black); @@ -264,12 +264,12 @@ void KalziumTip::hide() { m_frameTimer.stop(); m_tippedElement = 0; - QWidget::hide(); + TQWidget::hide(); } void KalziumTip::plainMask() { - QPainter maskPainter(&m_mask); + TQPainter maskPainter(&m_mask); m_mask.fill(Qt::black); @@ -289,11 +289,11 @@ void KalziumTip::internalUpdate() void KalziumTip::loadIcon() { - QString iconpath = locate( "data" , "kalzium/elempics/" + m_tippedElement->symbol() + ".jpg" ); + TQString iconpath = locate( "data" , "kalzium/elempics/" + m_tippedElement->symbol() + ".jpg" ); if ( !iconpath.isEmpty() ) { - QImage img ( iconpath, "JPEG" ); - img = img.smoothScale ( 128, 128, QImage::ScaleMin ); + TQImage img ( iconpath, "JPEG" ); + img = img.smoothScale ( 128, 128, TQImage::ScaleMin ); m_icon.convertFromImage( img ); } diff --git a/kalzium/src/kalziumtip.h b/kalzium/src/kalziumtip.h index 425e2a7e..217717b1 100644 --- a/kalzium/src/kalziumtip.h +++ b/kalzium/src/kalziumtip.h @@ -22,9 +22,9 @@ ***************************************************************************/ -#include -#include -#include +#include +#include +#include class QPaintEvent; class QSimpleRichText; @@ -44,19 +44,19 @@ class KalziumTip : public QWidget public: enum MaskEffect { Plain, Dissolve }; - KalziumTip( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + KalziumTip( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ); - void showTip( QPoint, Element* element, int visibleWidth, int visibleHeight ); //show the tip + void showTip( TQPoint, Element* element, int visibleWidth, int visibleHeight ); //show the tip void hide(); // hide it protected: - void paintEvent(QPaintEvent * e); + void paintEvent(TQPaintEvent * e); void plainMask(); void dissolveMask(); // if the mouse pointer hovers us, send the event to the parent // so we are some-what 'mouse transparent' - void mouseMoveEvent(QMouseEvent * e); + void mouseMoveEvent(TQMouseEvent * e); void displayInternal(); void display(); @@ -66,19 +66,19 @@ class KalziumTip : public QWidget void internalUpdate(); private: - QBitmap m_mask; - QPoint m_mousePointer; - QPixmap m_pixmap; - QPixmap m_icon; //icon shown on the tip - QPixmap m_noElemIcon; //icon for element wich have no image + TQBitmap m_mask; + TQPoint m_mousePointer; + TQPixmap m_pixmap; + TQPixmap m_icon; //icon shown on the tip + TQPixmap m_noElemIcon; //icon for element wich have no image MaskEffect m_maskEffect; //inidicates to show mask effect or plain - QSimpleRichText* m_richText; + TQSimpleRichText* m_richText; int m_dissolveSize; int m_dissolveDelta; - QTimer m_frameTimer; //timer for the dissolve effect + TQTimer m_frameTimer; //timer for the dissolve effect bool m_dirty; //indicates repainting the tooltip internal const Element* m_tippedElement; //the element the tip is about diff --git a/kalzium/src/kalziumutils.cpp b/kalzium/src/kalziumutils.cpp index 2e4dd127..1522e495 100644 --- a/kalzium/src/kalziumutils.cpp +++ b/kalzium/src/kalziumutils.cpp @@ -15,27 +15,27 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #if defined(Q_OS_SOLARIS) #include #endif -int KalziumUtils::maxSize( const QString& string, const QRect& rect, QFont font, QPainter* p, int minFontSize, int maxFontSize ) +int KalziumUtils::maxSize( const TQString& string, const TQRect& rect, TQFont font, TQPainter* p, int minFontSize, int maxFontSize ) { bool goodSizeFound = false; int size = maxFontSize; - QRect r; + TQRect r; do { font.setPointSize( size ); p->setFont( font ); - r = p->boundingRect( QRect(), Qt::AlignAuto, string ); + r = p->boundingRect( TQRect(), Qt::AlignAuto, string ); r.moveBy( rect.left(), rect.top() ); if ( rect.contains( r ) ) @@ -48,14 +48,14 @@ int KalziumUtils::maxSize( const QString& string, const QRect& rect, QFont font, return size; } -int KalziumUtils::StringHeight( const QString& string, const QFont& font, QPainter* p ) +int KalziumUtils::StringHeight( const TQString& string, const TQFont& font, TQPainter* p ) { - return p->boundingRect( QRect(), Qt::AlignAuto, string ).height(); + return p->boundingRect( TQRect(), Qt::AlignAuto, string ).height(); } -int KalziumUtils::StringWidth( const QString& string, const QFont& font, QPainter* p ) +int KalziumUtils::StringWidth( const TQString& string, const TQFont& font, TQPainter* p ) { - return p->boundingRect( QRect(), Qt::AlignAuto, string ).width(); + return p->boundingRect( TQRect(), Qt::AlignAuto, string ).width(); } double KalziumUtils::strippedValue( double num ) @@ -74,9 +74,9 @@ double KalziumUtils::strippedValue( double num ) return num * power / 10000; } -QString KalziumUtils::localizedValue( double val, int precision, unsigned long options ) +TQString KalziumUtils::localizedValue( double val, int precision, unsigned long options ) { - QString str = KGlobal::locale()->formatNumber( val, precision ); + TQString str = KGlobal::locale()->formatNumber( val, precision ); while( str.endsWith("0") ) str.truncate( str.length()-1); if ( str.endsWith( KGlobal::locale()->decimalSymbol() ) ) diff --git a/kalzium/src/kalziumutils.h b/kalzium/src/kalziumutils.h index 36f66080..f8feb10b 100644 --- a/kalzium/src/kalziumutils.h +++ b/kalzium/src/kalziumutils.h @@ -34,7 +34,7 @@ class KalziumUtils * @param maxFontSize the maximum fontsize * @param minFontSize the maximum fontsize */ - static int maxSize( const QString& string, const QRect& rect, QFont font, QPainter* painter, int minFontSize = 4, int maxFontSize = 20 ); + static int maxSize( const TQString& string, const TQRect& rect, TQFont font, TQPainter* painter, int minFontSize = 4, int maxFontSize = 20 ); /** * calculate the 4-digit value of the value @p w. For @@ -51,7 +51,7 @@ class KalziumUtils * @param options the options used for formatting of @p val * @return */ - static QString localizedValue( double val, int precision, unsigned long options = 0 ); + static TQString localizedValue( double val, int precision, unsigned long options = 0 ); /** * @param string the string which is measured @@ -59,14 +59,14 @@ class KalziumUtils * @param painter the used painter * @return the width of the string @p string */ - static int StringWidth( const QString& string, const QFont& font, QPainter* painter ); + static int StringWidth( const TQString& string, const TQFont& font, TQPainter* painter ); /** * @param string the string which is measured * @param font the used font * @param painter the used painter * @return the height of the string @p string */ - static int StringHeight( const QString& string, const QFont& font, QPainter* painter ); + static int StringHeight( const TQString& string, const TQFont& font, TQPainter* painter ); }; #endif // KALZIUMUTILS_H diff --git a/kalzium/src/molcalcwidget.cpp b/kalzium/src/molcalcwidget.cpp index c9947eda..60eb5108 100644 --- a/kalzium/src/molcalcwidget.cpp +++ b/kalzium/src/molcalcwidget.cpp @@ -36,12 +36,12 @@ #include #include -#include -#include -#include +#include +#include +#include -MolcalcWidget::MolcalcWidget( QWidget *parent, const char *name ) +MolcalcWidget::MolcalcWidget( TQWidget *parent, const char *name ) : MolcalcWidgetBase( parent, name ) { clear(); @@ -60,9 +60,9 @@ void MolcalcWidget::clear() resultComposition->setText( i18n("To start, enter\na formula in the\nwidget above and\nclick on 'Calc'.") ); - QToolTip::remove( resultMass ); - QToolTip::remove( resultComposition ); - QToolTip::remove( resultLabel ); + TQToolTip::remove( resultMass ); + TQToolTip::remove( resultComposition ); + TQToolTip::remove( resultLabel ); } @@ -70,11 +70,11 @@ void MolcalcWidget::updateUI() { if ( m_validInput ){ - QString str; + TQString str; // The complexString stores the whole molecule like this: // 1 Seaborgium. Cumulative Mass: 263.119 u (39.2564 %) - QString complexString; + TQString complexString; // Create the list of elements making up the molecule ElementCountMap::Iterator it = m_elementMap.begin(); @@ -102,25 +102,25 @@ void MolcalcWidget::updateUI() // The mass resultMass->setText( i18n( "Molecular mass: %1 u" ).arg( m_mass ) ); - QToolTip::add( resultMass, complexString ); - QToolTip::add( resultComposition, complexString ); - QToolTip::add( resultLabel, complexString ); + TQToolTip::add( resultMass, complexString ); + TQToolTip::add( resultComposition, complexString ); + TQToolTip::add( resultLabel, complexString ); } else{//the input was invalid, so tell this the user resultComposition->setText( i18n( "Invalid input" ) ); - resultLabel->setText( QString() ); - resultMass->setText( QString() ); + resultLabel->setText( TQString() ); + resultMass->setText( TQString() ); - QToolTip::add( resultMass, i18n( "Invalid input" ) ); - QToolTip::add( resultComposition, i18n( "Invalid input" ) ); - QToolTip::add( resultLabel, i18n( "Invalid input" ) ); + TQToolTip::add( resultMass, i18n( "Invalid input" ) ); + TQToolTip::add( resultComposition, i18n( "Invalid input" ) ); + TQToolTip::add( resultLabel, i18n( "Invalid input" ) ); } } -QString MolcalcWidget::compositionString( ElementCountMap &_map ) +TQString MolcalcWidget::compositionString( ElementCountMap &_map ) { - QString str; + TQString str; ElementCountMap::Iterator it = _map.begin(); ElementCountMap::Iterator itEnd = _map.end(); @@ -140,7 +140,7 @@ QString MolcalcWidget::compositionString( ElementCountMap &_map ) void MolcalcWidget::slotCalcButtonClicked() { - QString molecule = formulaEdit->text(); + TQString molecule = formulaEdit->text(); // Parse the molecule, and at the same time calculate the total // mass, and the composition of it. diff --git a/kalzium/src/molcalcwidget.h b/kalzium/src/molcalcwidget.h index f09157e6..c86d41d3 100644 --- a/kalzium/src/molcalcwidget.h +++ b/kalzium/src/molcalcwidget.h @@ -47,7 +47,7 @@ class MolcalcWidget : public MolcalcWidgetBase * @param parent parent widget * @param name name of this widget */ - MolcalcWidget( QWidget *parent = 0, const char *name = 0 ); + MolcalcWidget( TQWidget *parent = 0, const char *name = 0 ); protected slots: void slotCalcButtonClicked(); @@ -60,7 +60,7 @@ class MolcalcWidget : public MolcalcWidgetBase * @return the HTML code of an element symbol and its * subscripted amount. Eg: Mg2 */ - QString compositionString( ElementCountMap &_map ); + TQString compositionString( ElementCountMap &_map ); /** * This methods gathers all the data and updates the diff --git a/kalzium/src/moleculeparser.cpp b/kalzium/src/moleculeparser.cpp index 183f9769..6780e65e 100644 --- a/kalzium/src/moleculeparser.cpp +++ b/kalzium/src/moleculeparser.cpp @@ -39,8 +39,8 @@ ElementCountMap::~ElementCountMap() ElementCount * ElementCountMap::search(Element *_element) { - QValueList::ConstIterator it = m_map.constBegin(); - const QValueList::ConstIterator itEnd = m_map.constEnd(); + TQValueList::ConstIterator it = m_map.constBegin(); + const TQValueList::ConstIterator itEnd = m_map.constEnd(); for (; it != itEnd; ++it) { if ((*it)->element() == _element) @@ -54,8 +54,8 @@ ElementCountMap::search(Element *_element) void ElementCountMap::add(ElementCountMap &_map) { - QValueList::ConstIterator it = _map.m_map.constBegin(); - const QValueList::ConstIterator itEnd = _map.m_map.constEnd(); + TQValueList::ConstIterator it = _map.m_map.constBegin(); + const TQValueList::ConstIterator itEnd = _map.m_map.constEnd(); // Step throught _map and for each element, add it to the current one. for (; it != itEnd; ++it) { @@ -99,7 +99,7 @@ MoleculeParser::MoleculeParser() } -MoleculeParser::MoleculeParser(const QString& _str) +MoleculeParser::MoleculeParser(const TQString& _str) : Parser(_str) { } @@ -120,7 +120,7 @@ MoleculeParser::~MoleculeParser() // This method also acts as the main loop. bool -MoleculeParser::weight(QString _moleculeString, +MoleculeParser::weight(TQString _moleculeString, double *_resultMass, ElementCountMap *_resultMap) { @@ -242,7 +242,7 @@ MoleculeParser::parseTerm(double *_resultMass, int MoleculeParser::getNextToken() { - QString elementName; + TQString elementName; #if 0 kdDebug() << "getNextToken(): Next character = " @@ -280,7 +280,7 @@ MoleculeParser::getNextToken() Element * -MoleculeParser::lookupElement( const QString& _name ) +MoleculeParser::lookupElement( const TQString& _name ) { EList elementList = KalziumDataObject::instance()->ElementList; diff --git a/kalzium/src/moleculeparser.h b/kalzium/src/moleculeparser.h index c35c71be..45b27436 100644 --- a/kalzium/src/moleculeparser.h +++ b/kalzium/src/moleculeparser.h @@ -17,8 +17,8 @@ #include "element.h" #include "parser.h" -#include -#include +#include +#include /** @@ -64,12 +64,12 @@ class ElementCountMap { void add(Element *_element, int _count); void multiply(int _factor); - typedef QValueList::Iterator Iterator; + typedef TQValueList::Iterator Iterator; Iterator begin() { return m_map.begin(); } Iterator end() { return m_map.end(); } private: - QValueList m_map; + TQValueList m_map; }; @@ -80,7 +80,7 @@ class ElementCountMap { * Usage: * @code * MoleculeParser parser; - * QString chemical_formula = "C2H5OH"; + * TQString chemical_formula = "C2H5OH"; * double weight; * * if (parser.weight(chemical_formula, &weight)) @@ -97,7 +97,7 @@ public: static const int ELEMENT_TOKEN = 300; MoleculeParser(); - MoleculeParser( const QString& _str); + MoleculeParser( const TQString& _str); ~MoleculeParser(); /** @@ -106,7 +106,7 @@ public: * * @return whether the parsing was successful or not */ - bool weight(QString _moleculeString, + bool weight(TQString _moleculeString, double *_resultMass, ElementCountMap *_resultMap); @@ -117,9 +117,9 @@ public: bool parseTerm(double *_resultMass, ElementCountMap *_resultMap); - Element *lookupElement( const QString& _name ); + Element *lookupElement( const TQString& _name ); - QMap m_elementMap; + TQMap m_elementMap; //if this booloean is "true" the parser found an error bool m_error; diff --git a/kalzium/src/orbitswidget.cpp b/kalzium/src/orbitswidget.cpp index f79381f0..06824c0f 100644 --- a/kalzium/src/orbitswidget.cpp +++ b/kalzium/src/orbitswidget.cpp @@ -18,13 +18,13 @@ #include //QT-Includes -#include -#include -#include +#include +#include +#include -static QStringList hulllist; +static TQStringList hulllist; -OrbitsWidget::OrbitsWidget( QWidget *parent, const char *name) : QWidget( parent, name ) +OrbitsWidget::OrbitsWidget( TQWidget *parent, const char *name) : TQWidget( parent, name ) { if ( hulllist.count() == 0 ) { @@ -154,8 +154,8 @@ void OrbitsWidget::setElementNumber( const int num ) void OrbitsWidget::getNumberOfOrbits() { numOfElectrons.clear(); - QRegExp rxb( "\\s" ); //space - QString o = getNumber(); + TQRegExp rxb( "\\s" ); //space + TQString o = getNumber(); num = 1; int pos = 0; @@ -184,15 +184,15 @@ void OrbitsWidget::getNumberOfOrbits() } } -const QString& OrbitsWidget::getNumber() const +const TQString& OrbitsWidget::getNumber() const { return *hulllist.at( Elemno-1 ); } -void OrbitsWidget::paintEvent( QPaintEvent* ) +void OrbitsWidget::paintEvent( TQPaintEvent* ) { - QPainter DC; + TQPainter DC; DC.begin( this ); int h=height(); @@ -213,7 +213,7 @@ void OrbitsWidget::paintEvent( QPaintEvent* ) r_electron = r/20; //diameter of an electron-circle - QBrush brush( yellow ); + TQBrush brush( yellow ); int d = 2*r; //Diameter int ddx = d/(2*num);//difference to the previous circle diff --git a/kalzium/src/orbitswidget.h b/kalzium/src/orbitswidget.h index 831684d0..cd7279bf 100644 --- a/kalzium/src/orbitswidget.h +++ b/kalzium/src/orbitswidget.h @@ -19,7 +19,7 @@ ***************************************************************************/ -#include +#include #include /** @@ -31,7 +31,7 @@ class OrbitsWidget : public QWidget Q_OBJECT public: - OrbitsWidget( QWidget *parent=0 , const char *name =0 ); + OrbitsWidget( TQWidget *parent=0 , const char *name =0 ); void setElementNumber( const int num ); @@ -46,10 +46,10 @@ class OrbitsWidget : public QWidget */ int num; - typedef QValueList intList; + typedef TQValueList intList; intList numOfElectrons; - const QString& getNumber() const; + const TQString& getNumber() const; /** * @return the delta of the x-coordinate @@ -79,7 +79,7 @@ class OrbitsWidget : public QWidget void getNumberOfOrbits(); protected slots: - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); }; #endif // ORBITSWIDGET_H diff --git a/kalzium/src/parser.cpp b/kalzium/src/parser.cpp index 19364c73..d678885f 100644 --- a/kalzium/src/parser.cpp +++ b/kalzium/src/parser.cpp @@ -21,11 +21,11 @@ Parser::Parser() { - start(QString::null); + start(TQString::null); } -Parser::Parser(const QString& _str) +Parser::Parser(const TQString& _str) { start(_str); } @@ -37,7 +37,7 @@ Parser::~Parser() void -Parser::start(const QString& _str) +Parser::start(const TQString& _str) { m_str = _str; @@ -165,7 +165,7 @@ Parser::getNextChar() int Parser::skipWhitespace() { - while (QChar(m_nextChar).isSpace()) + while (TQChar(m_nextChar).isSpace()) getNextChar(); return m_nextChar; diff --git a/kalzium/src/parser.h b/kalzium/src/parser.h index f4ec68e7..84007a7c 100644 --- a/kalzium/src/parser.h +++ b/kalzium/src/parser.h @@ -14,7 +14,7 @@ #ifndef PARSER_H #define PARSER_H -#include +#include /** * This is a general purpose parser originally written by Inge Wallin. @@ -31,13 +31,13 @@ public: // Extend this list in your subclass to make a more advanced parser. Parser(); - Parser(const QString& _str); + Parser(const TQString& _str); ~Parser(); /** * Start a new parse. */ - void start(const QString& _str); + void start(const TQString& _str); /** * Peek at the next character; @@ -79,7 +79,7 @@ protected: virtual int getNextToken(); private: - QString m_str; + TQString m_str; int m_index; int m_nextChar; diff --git a/kalzium/src/periodictableview.cpp b/kalzium/src/periodictableview.cpp index b466cffa..a09dcf34 100644 --- a/kalzium/src/periodictableview.cpp +++ b/kalzium/src/periodictableview.cpp @@ -29,20 +29,20 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -PerodicTableView::PerodicTableView(QWidget *parent, const char *name) - : QWidget(parent, name), m_kalziumTip(0), table(0), table2(0) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +PerodicTableView::PerodicTableView(TQWidget *parent, const char *name) + : TQWidget(parent, name), m_kalziumTip(0), table(0), table2(0) { d = KalziumDataObject::instance(); @@ -51,22 +51,22 @@ PerodicTableView::PerodicTableView(QWidget *parent, const char *name) unSelect(); #if 0 - connect( this, SIGNAL( tableClicked( QPoint ) ), - this, SLOT( selectPoint( QPoint ) ) ); + connect( this, TQT_SIGNAL( tableClicked( TQPoint ) ), + this, TQT_SLOT( selectPoint( TQPoint ) ) ); #endif - connect( this, SIGNAL( ToolTip( int ) ), - this, SLOT( slotToolTip( int ) ) ); + connect( this, TQT_SIGNAL( ToolTip( int ) ), + this, TQT_SLOT( slotToolTip( int ) ) ); - connect( &HoverTimer, SIGNAL( timeout() ), - this, SLOT( slotTransientLabel() ) ); + connect( &HoverTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( slotTransientLabel() ) ); - connect( &MouseoverTimer, SIGNAL( timeout() ), - this, SLOT( slotMouseover() ) ); + connect( &MouseoverTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( slotMouseover() ) ); setMouseTracking( true ); //JH: eliminates flicker on redraw - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); m_molcalcIsActive = false; m_showTooltip = true; @@ -119,8 +119,8 @@ PerodicTableView::PerodicTableView(QWidget *parent, const char *name) m_IUPACOLDlist.append( "7B"); m_IUPACOLDlist.append( "0"); - table = new QPixmap(); - table2 = new QPixmap(); + table = new TQPixmap(); + table2 = new TQPixmap(); m_kalziumTip = new KalziumTip( this ); @@ -170,12 +170,12 @@ void PerodicTableView::slotToolTip( int number ) m_tooltipElementNumber = number; - QWidget *p = 0; - if ( dynamic_cast( parent() ) ) - p = static_cast( parent() ); + TQWidget *p = 0; + if ( dynamic_cast( parent() ) ) + p = static_cast( parent() ); if( p ) - m_kalziumTip->showTip( mapFromGlobal(QCursor::pos()), + m_kalziumTip->showTip( mapFromGlobal(TQCursor::pos()), d->element(number), p->width(), p->height() ); @@ -192,7 +192,7 @@ void PerodicTableView::activateColorScheme( const int nr ) if ( m_currentScheme == PerodicTableView::NOCOLOUR ) //normal view, no colors { - const QColor color = Prefs::noscheme(); + const TQColor color = Prefs::noscheme(); while ( it != itEnd ) { ( *it )->setElementColor( color ); @@ -202,34 +202,34 @@ void PerodicTableView::activateColorScheme( const int nr ) else if ( m_currentScheme == PerodicTableView::GROUPS ) //groups view { - static QString group; + static TQString group; while ( it != itEnd ) { group = ( *it )->group(); - if (group == QString("1")) { + if (group == TQString("1")) { ( *it )->setElementColor( color_1 ); } - if (group == QString("2")){ + if (group == TQString("2")){ ( *it )->setElementColor( color_2 ); } - if (group == QString("3")){ + if (group == TQString("3")){ ( *it )->setElementColor( color_3 ); } - if (group == QString("4")){ + if (group == TQString("4")){ ( *it )->setElementColor( color_4 ); } - if (group == QString("5")){ + if (group == TQString("5")){ ( *it )->setElementColor( color_5 ); } - if (group == QString("6")){ + if (group == TQString("6")){ ( *it )->setElementColor( color_6 ); } - if (group == QString("7")){ + if (group == TQString("7")){ ( *it )->setElementColor( color_7 ); } - if (group == QString("8")){ + if (group == TQString("8")){ ( *it )->setElementColor( color_8 ); } @@ -238,21 +238,21 @@ void PerodicTableView::activateColorScheme( const int nr ) } else if ( m_currentScheme == PerodicTableView::BLOCK ) //block view { - static QString block; + static TQString block; while ( it != itEnd ) { block = (*it)->block(); - if (block == QString("s")) { + if (block == TQString("s")) { (*it)->setElementColor( color_s ); } - if (block == QString("p")) { + if (block == TQString("p")) { (*it)->setElementColor( color_p ); } - if (block == QString("d")) { + if (block == TQString("d")) { (*it)->setElementColor( color_d ); } - if (block == QString("f")) { + if (block == TQString("f")) { (*it)->setElementColor( color_f ); } ++it; @@ -260,22 +260,22 @@ void PerodicTableView::activateColorScheme( const int nr ) } else if ( m_currentScheme == PerodicTableView::ACIDIC ) //acidic beh { - static QString acidicbeh; + static TQString acidicbeh; while ( it != itEnd ) { acidicbeh = ( *it )->acidicbeh(); - if (acidicbeh == QString("0")) { + if (acidicbeh == TQString("0")) { (*it)->setElementColor( color_ac ); } - if (acidicbeh == QString("1")){ + if (acidicbeh == TQString("1")){ (*it)->setElementColor( color_ba ); } - if (acidicbeh == QString("2")){ + if (acidicbeh == TQString("2")){ (*it)->setElementColor( color_neu ); } - if (acidicbeh == QString("3")){ + if (acidicbeh == TQString("3")){ (*it)->setElementColor( color_amp ); } ++it; @@ -283,7 +283,7 @@ void PerodicTableView::activateColorScheme( const int nr ) } else if ( m_currentScheme == PerodicTableView::FAMILY ) //familiy of the element { - static QString family; + static TQString family; while ( it != itEnd ) { @@ -323,7 +323,7 @@ void PerodicTableView::activateColorScheme( const int nr ) } -void PerodicTableView::resizeEvent( QResizeEvent * /*e*/ ) +void PerodicTableView::resizeEvent( TQResizeEvent * /*e*/ ) { table->resize( width(), height() ); table2->resize( width(), height() ); @@ -334,9 +334,9 @@ void PerodicTableView::resizeEvent( QResizeEvent * /*e*/ ) update(); } -void PerodicTableView::paintEvent( QPaintEvent * /*e*/ ) +void PerodicTableView::paintEvent( TQPaintEvent * /*e*/ ) { - QPainter p; + TQPainter p; //JH: I have split the drawing into two pixmaps: table and table2. //table contains the "static" PerodicTableView table, and does not change very often. @@ -413,10 +413,10 @@ void PerodicTableView::paintCurrentSelection() // make a small gap (ELEMENTSIZE/3) over the rare earths if (m_currentPoint.y() > 7) y += ELEMENTSIZE/3; - QPainter p; + TQPainter p; p.begin(table); - QPen pen; + TQPen pen; pen.setStyle( DotLine ); pen.setWidth( 4 ); pen.setColor( Qt::blue ); @@ -431,12 +431,12 @@ void PerodicTableView::paintCurrentSelection() p.end(); } -void PerodicTableView::drawLegendToolTip( QPainter* p ) +void PerodicTableView::drawLegendToolTip( TQPainter* p ) { kdDebug() << "PerodicTableView::drawLegendToolTip()" << endl; if(!m_showLegendTooltip || !m_showLegend) return; - QString text; + TQString text; switch ( m_currentScheme ) { //No Legend drawn as only one colour is used @@ -456,19 +456,19 @@ void PerodicTableView::drawLegendToolTip( QPainter* p ) break; } - const int x1 = mapFromGlobal( QCursor::pos() ).x(); - const int y1 = mapFromGlobal( QCursor::pos() ).y(); + const int x1 = mapFromGlobal( TQCursor::pos() ).x(); + const int y1 = mapFromGlobal( TQCursor::pos() ).y(); static const int padding = 3; - QFont fB = KGlobalSettings::generalFont(); + TQFont fB = KGlobalSettings::generalFont(); fB.setPointSize( fB.pointSize() + 4 ); p->setFont( fB ); - QRect bRect( 0, 0, 1000, 1000 ); + TQRect bRect( 0, 0, 1000, 1000 ); bRect = p->boundingRect( bRect, AlignLeft|AlignTop, text ); bRect.moveBy( x1, y1 ); - QRect bRectExt = bRect; + TQRect bRectExt = bRect; bRect.moveBy( padding, padding ); bRectExt.setWidth( bRectExt.width() + 2 * padding ); bRectExt.setHeight( bRectExt.height() + 2 * padding ); @@ -492,7 +492,7 @@ void PerodicTableView::drawLegendToolTip( QPainter* p ) } p->setBrush(Qt::SolidPattern); - p->setBrush( QColor( 255, 255, 220 ) ); + p->setBrush( TQColor( 255, 255, 220 ) ); p->drawRect( bRectExt ); p->setBrush( Qt::black ); @@ -501,7 +501,7 @@ void PerodicTableView::drawLegendToolTip( QPainter* p ) p->drawText( bRect, AlignLeft|AlignTop, text ); } -void PerodicTableView::drawTimeLine( QPainter* p ) +void PerodicTableView::drawTimeLine( TQPainter* p ) { if ( !p ) return; kdDebug() << "PerodicTableView::drawTimeLine: " << m_date << endl; @@ -528,7 +528,7 @@ void PerodicTableView::drawTimeLine( QPainter* p ) } } -void PerodicTableView::drawLegend( QPainter* p ) +void PerodicTableView::drawLegend( TQPainter* p ) { if ( !p ) return; @@ -545,7 +545,7 @@ void PerodicTableView::drawLegend( QPainter* p ) * does not collide with the elements */ - QFont legendFont = KGlobalSettings::generalFont(); + TQFont legendFont = KGlobalSettings::generalFont(); legendFont.setPointSize( legendFont.pointSize() + 1 ); p->setFont( legendFont ); @@ -574,7 +574,7 @@ void PerodicTableView::drawLegend( QPainter* p ) if ( !m_currentScheme == PerodicTableView::NOCOLOUR ) p->fillRect(legendLeft, legendTop, legendWidth, legendHeight, - QColor(200, 200, 200)); + TQColor(200, 200, 200)); if ( som() ) { @@ -669,7 +669,7 @@ void PerodicTableView::drawLegend( QPainter* p ) } } -void PerodicTableView::drawNumeration( QPainter* p ) +void PerodicTableView::drawNumeration( TQPainter* p ) { if ( !p ) return; @@ -679,7 +679,7 @@ void PerodicTableView::drawNumeration( QPainter* p ) case PerodicTableView::CAS: for(int i = 0; i < 18 ; ++i ) { - p->drawText( i*ELEMENTSIZE,0 ,ELEMENTSIZE,ELEMENTSIZE, Qt::AlignCenter, QString::number(i+1)); + p->drawText( i*ELEMENTSIZE,0 ,ELEMENTSIZE,ELEMENTSIZE, Qt::AlignCenter, TQString::number(i+1)); } break; case PerodicTableView::IUPAC: @@ -698,7 +698,7 @@ void PerodicTableView::drawNumeration( QPainter* p ) } -void PerodicTableView::drawSOMPerodicTableView( QPainter* p ) +void PerodicTableView::drawSOMPerodicTableView( TQPainter* p ) { EList::ConstIterator it = d->ElementList.begin(); const EList::ConstIterator itEnd = d->ElementList.end(); @@ -713,7 +713,7 @@ void PerodicTableView::drawSOMPerodicTableView( QPainter* p ) void PerodicTableView::slotTransientLabel() { - QPoint point = ElementUnderMouse(); + TQPoint point = ElementUnderMouse(); int X = point.x(); int Y = point.y(); @@ -730,13 +730,13 @@ void PerodicTableView::slotTransientLabel() m_showLegendTooltip = false; } -void PerodicTableView::mousePressEvent( QMouseEvent *) +void PerodicTableView::mousePressEvent( TQMouseEvent *) { if( m_kalziumTip->isVisible() ) m_kalziumTip->hide(); } -void PerodicTableView::mouseMoveEvent( QMouseEvent * /*mouse*/ ) +void PerodicTableView::mouseMoveEvent( TQMouseEvent * /*mouse*/ ) { //JH: only update() if we were showing a tooltip if ( m_tooltipElementNumber || m_showLegendTooltip ) @@ -751,7 +751,7 @@ void PerodicTableView::mouseMoveEvent( QMouseEvent * /*mouse*/ ) if( m_kalziumTip->isVisible() ) { // kdDebug()<< "visible" << endl; - QPoint point = ElementUnderMouse(); + TQPoint point = ElementUnderMouse(); int X = point.x(); int Y = point.y(); @@ -781,7 +781,7 @@ bool PerodicTableView::pointerOnLegend(int X, int Y) return false; } -void PerodicTableView::mouseReleaseEvent( QMouseEvent *mouse ) +void PerodicTableView::mouseReleaseEvent( TQMouseEvent *mouse ) { ///first: find out the position int X = mouse->x()/ELEMENTSIZE; @@ -800,7 +800,7 @@ void PerodicTableView::mouseReleaseEvent( QMouseEvent *mouse ) X += 1; Y += 1; - QPoint point( X,Y ); + TQPoint point( X,Y ); emit tableClicked( point ); const int num = ElementNumber( X, Y ); @@ -846,14 +846,14 @@ int PerodicTableView::ElementNumber( int X, int Y ) void PerodicTableView::unSelect() { - m_currentPoint = QPoint(-1, -1); + m_currentPoint = TQPoint(-1, -1); // Full draw needed to redraw the select mark. setFullDraw(); update(); } -void PerodicTableView::selectPoint( const QPoint& point ) +void PerodicTableView::selectPoint( const TQPoint& point ) { kdDebug() << "PerodicTableView::selectPoint " << point << endl; @@ -871,7 +871,7 @@ void PerodicTableView::selectElement( int num ) selectPoint( d->element( num )->coords() ); } -void PerodicTableView::drawPerodicTableView( QPainter* p, bool isCrystal ) +void PerodicTableView::drawPerodicTableView( TQPainter* p, bool isCrystal ) { EList::ConstIterator it = d->ElementList.begin(); const EList::ConstIterator itEnd = d->ElementList.end(); @@ -891,12 +891,12 @@ void PerodicTableView::drawPerodicTableView( QPainter* p, bool isCrystal ) //CN This is called for *every* drawing of the table. This means //a lot overload... I would be better to chache the values in //member variables an only check if they need an update. -void PerodicTableView::calculateGradient( QPainter *p ) +void PerodicTableView::calculateGradient( TQPainter *p ) { EList::ConstIterator it = d->ElementList.begin(); const EList::ConstIterator itEnd = d->ElementList.end(); - QValueList tmpList; + TQValueList tmpList; switch ( m_gradientType ) { case Element::ATOMICRADIUS: @@ -955,8 +955,8 @@ void PerodicTableView::calculateGradient( QPainter *p ) break; } - QValueList::iterator dit = tmpList.begin(); - const QValueList::iterator ditEnd = tmpList.end(); + TQValueList::iterator dit = tmpList.begin(); + const TQValueList::iterator ditEnd = tmpList.end(); double tmpMin = *dit; double tmpMax = *dit; @@ -975,9 +975,9 @@ void PerodicTableView::calculateGradient( QPainter *p ) -void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double min, const double max ) +void PerodicTableView::drawGradientPerodicTableView( TQPainter *p, const double min, const double max ) { - QString title = QString::null; + TQString title = TQString::null; const double var = max-min; EList::ConstIterator it = d->ElementList.begin(); @@ -1102,10 +1102,10 @@ void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double m //int h = ELEMENTSIZE*4-5; // Create the gradient image. - QSize s( ELEMENTSIZE*7+20, 20 ); - QImage img = KImageEffect::gradient ( s, Qt::white, Qt::red, + TQSize s( ELEMENTSIZE*7+20, 20 ); + TQImage img = KImageEffect::gradient ( s, Qt::white, Qt::red, KImageEffect::HorizontalGradient ); - QPixmap pm( img ); + TQPixmap pm( img ); /** * now find the optimum stringsize for the caption @@ -1114,9 +1114,9 @@ void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double m * is a name it should be the same in all languages and be * probably always the longest string */ - QString tmp = i18n( "Gradient: van der Waals Radius" ); - QRect rect(x+5, y+50, ELEMENTSIZE*10,20); - QFont font = p->font(); + TQString tmp = i18n( "Gradient: van der Waals Radius" ); + TQRect rect(x+5, y+50, ELEMENTSIZE*10,20); + TQFont font = p->font(); int maxSize = KalziumUtils::maxSize( tmp, rect, p->font(), p, 8, 24 ); kdDebug() << "maxSize: " << maxSize << endl; font.setPointSize(maxSize); @@ -1130,24 +1130,24 @@ void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double m // FIXME: In the lines below, "30" is the max allowed text // height. This should be calculated from the font // metrics, not hard coded. - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, QString::number( min ) ); - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, QString::number( max ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, TQString::number( min ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, TQString::number( max ) ); } else { - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, QString::number( max ) ); - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, QString::number( min ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, TQString::number( max ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, TQString::number( min ) ); } } -QPoint PerodicTableView::ElementUnderMouse() +TQPoint PerodicTableView::ElementUnderMouse() { - int X = mapFromGlobal( QCursor::pos() ).x()/ELEMENTSIZE; - int Y = mapFromGlobal( QCursor::pos() ).y( )-ELEMENTSIZE; + int X = mapFromGlobal( TQCursor::pos() ).x()/ELEMENTSIZE; + int Y = mapFromGlobal( TQCursor::pos() ).y( )-ELEMENTSIZE; // mind the gap over rare earth! - if (Y >= (ELEMENTSIZE*7) && Y < (ELEMENTSIZE*7+ELEMENTSIZE/3+1)) return QPoint( 0, 0 ); + if (Y >= (ELEMENTSIZE*7) && Y < (ELEMENTSIZE*7+ELEMENTSIZE/3+1)) return TQPoint( 0, 0 ); if (Y > (ELEMENTSIZE*7)) Y -= ELEMENTSIZE/3; @@ -1156,41 +1156,41 @@ QPoint PerodicTableView::ElementUnderMouse() X += 1; Y += 1; - return QPoint( X,Y ); + return TQPoint( X,Y ); } void PerodicTableView::slotMouseover() { - QPoint point = ElementUnderMouse(); + TQPoint point = ElementUnderMouse(); int num = ElementNumber( point.x(), point.y() ); if ( num ) emit MouseOver( num ); } -void PerodicTableView::drawGradientButton( QPainter *p, Element* e, double coeff, double value, double minValue ) +void PerodicTableView::drawGradientButton( TQPainter *p, Element* e, double coeff, double value, double minValue ) { if ( value >= minValue && coeff != -1.0) { - QColor c = calculateColor( coeff ); - QString v = KalziumUtils::localizedValue( KalziumUtils::strippedValue( value ), 6 ); + TQColor c = calculateColor( coeff ); + TQString v = KalziumUtils::localizedValue( KalziumUtils::strippedValue( value ), 6 ); e->drawGradient( p, v, c ); } else e->drawGradient( p, i18n("It means: Not Available. Translators: keep it as short as you can!", "N/A"), Qt::lightGray ); } -QColor PerodicTableView::calculateColor( const double coeff ) +TQColor PerodicTableView::calculateColor( const double coeff ) { - const QColor color2 = Qt::white; - const QColor color1 = Qt::red; + const TQColor color2 = Qt::white; + const TQColor color1 = Qt::red; int red = (int)( (color1.red() - color2.red()) * coeff + color2.red() ); int green = (int)( (color1.green() - color2.green()) * coeff + color2.green() ); int blue = (int)( (color1.blue() - color2.blue()) * coeff + color2.blue() ); - return QColor( red, green, blue ); + return TQColor( red, green, blue ); } void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) @@ -1204,7 +1204,7 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) { case NOCOLOUR: { - const QColor color = Prefs::noscheme(); + const TQColor color = Prefs::noscheme(); while ( it != itEnd ) { ( *it )->setElementColor( color ); @@ -1215,34 +1215,34 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::GROUPS: // group view { - QString group; + TQString group; while ( it != itEnd ) { group = ( *it )->group(); - if (group == QString("1")) { + if (group == TQString("1")) { ( *it )->setElementColor( color_1 ); } - if (group == QString("2")){ + if (group == TQString("2")){ ( *it )->setElementColor( color_2 ); } - if (group == QString("3")){ + if (group == TQString("3")){ ( *it )->setElementColor( color_3 ); } - if (group == QString("4")){ + if (group == TQString("4")){ ( *it )->setElementColor( color_4 ); } - if (group == QString("5")){ + if (group == TQString("5")){ ( *it )->setElementColor( color_5 ); } - if (group == QString("6")){ + if (group == TQString("6")){ ( *it )->setElementColor( color_6 ); } - if (group == QString("7")){ + if (group == TQString("7")){ ( *it )->setElementColor( color_7 ); } - if (group == QString("8")){ + if (group == TQString("8")){ ( *it )->setElementColor( color_8 ); } @@ -1253,21 +1253,21 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::BLOCK: //block view { - static QString block; + static TQString block; while ( it != itEnd ) { block = (*it)->block(); - if (block == QString("s")) { + if (block == TQString("s")) { (*it)->setElementColor( color_s ); } - if (block == QString("p")) { + if (block == TQString("p")) { (*it)->setElementColor( color_p ); } - if (block == QString("d")) { + if (block == TQString("d")) { (*it)->setElementColor( color_d ); } - if (block == QString("f")) { + if (block == TQString("f")) { (*it)->setElementColor( color_f ); } ++it; @@ -1277,21 +1277,21 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::ACIDIC: //acidic beh { - static QString acidicbeh; + static TQString acidicbeh; while ( it != itEnd ) { acidicbeh = ( *it )->acidicbeh(); - if (acidicbeh == QString("0")) { + if (acidicbeh == TQString("0")) { (*it)->setElementColor( color_ac ); } - if (acidicbeh == QString("1")){ + if (acidicbeh == TQString("1")){ (*it)->setElementColor( color_ba ); } - if (acidicbeh == QString("2")){ + if (acidicbeh == TQString("2")){ (*it)->setElementColor( color_neu ); } - if (acidicbeh == QString("3")){ + if (acidicbeh == TQString("3")){ (*it)->setElementColor( color_amp ); } ++it; @@ -1301,7 +1301,7 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::FAMILY: //familiy of the element { - static QString family; + static TQString family; while ( it != itEnd ) { @@ -1342,7 +1342,7 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case CRYSTAL: { - QString structure; + TQString structure; while ( it != itEnd ) { structure = ( *it )->crystalstructure(); diff --git a/kalzium/src/periodictableview.h b/kalzium/src/periodictableview.h index 632f5d57..2fe89d12 100644 --- a/kalzium/src/periodictableview.h +++ b/kalzium/src/periodictableview.h @@ -29,9 +29,9 @@ class Element; class KalziumDataObject; class KalziumTip; -#include -#include -#include +#include +#include +#include // A PerodicTableView is ... /** @@ -48,7 +48,7 @@ class PerodicTableView : public QWidget * @param parent parent widget * @param name name of this widget */ - PerodicTableView( QWidget *parent = 0, const char *name = 0); + PerodicTableView( TQWidget *parent = 0, const char *name = 0); ~PerodicTableView(); enum SCHEMETYPE @@ -123,7 +123,7 @@ class PerodicTableView : public QWidget /** * @return the short and descriptive name of this PerodicTableView */ - QString shortName() const{ + TQString shortName() const{ return m_ShortName; } @@ -249,7 +249,7 @@ class PerodicTableView : public QWidget /** * calculates the min and max values to prepare the painting */ - void calculateGradient( QPainter* ); + void calculateGradient( TQPainter* ); /** * @return true if the mouse is over the legend area @@ -263,14 +263,14 @@ class PerodicTableView : public QWidget * @param value the value * @param minValue the smallest of all the values */ - void drawGradientButton( QPainter* p, Element* e, double coeff, double value, double minValue ); + void drawGradientButton( TQPainter* p, Element* e, double coeff, double value, double minValue ); /** * calculates the color of an element which has a value which * is @p percentage of the maximum value. This will be the * color used in the gradient view for an element. */ - QColor calculateColor( const double percentage ); + TQColor calculateColor( const double percentage ); /** * the date used in the timeline @@ -303,7 +303,7 @@ class PerodicTableView : public QWidget /** * timer used for the tooltop */ - QTimer HoverTimer, + TQTimer HoverTimer, MouseoverTimer; KalziumDataObject *d; @@ -323,19 +323,19 @@ class PerodicTableView : public QWidget * @return the coordinates of the element under the mouseCursor. * For example, H will be 1/1 and Li will be 1/2 */ - QPoint ElementUnderMouse(); + TQPoint ElementUnderMouse(); /** * the currently selected element (the x/y-coordinates) */ - QPoint m_currentPoint; + TQPoint m_currentPoint; - void mouseReleaseEvent( QMouseEvent* ); - void mousePressEvent( QMouseEvent* ); - void mouseMoveEvent( QMouseEvent* ); + void mouseReleaseEvent( TQMouseEvent* ); + void mousePressEvent( TQMouseEvent* ); + void mouseMoveEvent( TQMouseEvent* ); - QStringList m_IUPAClist; - QStringList m_IUPACOLDlist; + TQStringList m_IUPAClist; + TQStringList m_IUPACOLDlist; /** * if the the legend will be displayed @@ -345,7 +345,7 @@ class PerodicTableView : public QWidget /** * this is a short, descriptive name of the PerodicTableView */ - QString m_ShortName; + TQString m_ShortName; /** * true if the molcalc-mode is active @@ -360,8 +360,8 @@ class PerodicTableView : public QWidget /** * implements double buffering of the widget. */ - QPixmap *table; // The basic PerodicTableView - QPixmap *table2; // Basic PerodicTableView + extra data such as tooltip, etc + TQPixmap *table; // The basic PerodicTableView + TQPixmap *table2; // Basic PerodicTableView + extra data such as tooltip, etc /** * used for bitBlit. If true the complete table will be drawn @@ -371,74 +371,74 @@ class PerodicTableView : public QWidget //I am holding all colours as member so that they don't need to //be reloaded on every reload - QColor color_s;//Blocks - QColor color_p; - QColor color_d; - QColor color_f; - QColor color_1;//Groups - QColor color_2; - QColor color_3; - QColor color_4; - QColor color_5; - QColor color_6; - QColor color_7; - QColor color_8; - QColor color_ba;//Acidic - QColor color_ac; - QColor color_neu; - QColor color_amp; - QColor c_alkalie;//Family - QColor c_rare; - QColor c_nonmetal; - QColor c_alkaline; - QColor c_other_metal; - QColor c_halogene; - QColor c_transition; - QColor c_noble_gas; - QColor c_metalloid; - QColor c_liquid; - QColor c_solid; - QColor c_vapor; + TQColor color_s;//Blocks + TQColor color_p; + TQColor color_d; + TQColor color_f; + TQColor color_1;//Groups + TQColor color_2; + TQColor color_3; + TQColor color_4; + TQColor color_5; + TQColor color_6; + TQColor color_7; + TQColor color_8; + TQColor color_ba;//Acidic + TQColor color_ac; + TQColor color_neu; + TQColor color_amp; + TQColor c_alkalie;//Family + TQColor c_rare; + TQColor c_nonmetal; + TQColor c_alkaline; + TQColor c_other_metal; + TQColor c_halogene; + TQColor c_transition; + TQColor c_noble_gas; + TQColor c_metalloid; + TQColor c_liquid; + TQColor c_solid; + TQColor c_vapor; protected: - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); /** * draw the tooltip for the legend */ - virtual void drawLegendToolTip( QPainter *p ); + virtual void drawLegendToolTip( TQPainter *p ); - virtual void drawTimeLine( QPainter *p ); + virtual void drawTimeLine( TQPainter *p ); /** * called if the user resized the table */ - virtual void resizeEvent( QResizeEvent *e ); + virtual void resizeEvent( TQResizeEvent *e ); /** * the central place for the drawing of the table */ - virtual void drawPerodicTableView( QPainter* p, bool isCrystal ); + virtual void drawPerodicTableView( TQPainter* p, bool isCrystal ); /** * draw a gradient of the type @p type */ - virtual void drawGradientPerodicTableView( QPainter* p, const double min, const double max ); + virtual void drawGradientPerodicTableView( TQPainter* p, const double min, const double max ); /** * draw the state of matter */ - virtual void drawSOMPerodicTableView( QPainter* p ); + virtual void drawSOMPerodicTableView( TQPainter* p ); /** * draw the legend */ - virtual void drawLegend( QPainter* p ); + virtual void drawLegend( TQPainter* p ); /** * draw the numeration */ - virtual void drawNumeration( QPainter* p ); + virtual void drawNumeration( TQPainter* p ); public slots: /** @@ -481,7 +481,7 @@ class PerodicTableView : public QWidget /** * this slot updates the currently selected point */ - void selectPoint( const QPoint& point ); + void selectPoint( const TQPoint& point ); /** * this slot updates the element given in the @p num @@ -499,7 +499,7 @@ class PerodicTableView : public QWidget /** * this signal is emitted when the table is clicked */ - void tableClicked(QPoint); + void tableClicked(TQPoint); /** * this signal is emitted when an element is clicked diff --git a/kalzium/src/plotwidget.cpp b/kalzium/src/plotwidget.cpp index 3a6f8530..2619b504 100644 --- a/kalzium/src/plotwidget.cpp +++ b/kalzium/src/plotwidget.cpp @@ -19,27 +19,27 @@ #include //QT-Includes -#include +#include PlotWidget::PlotWidget( double x1, double x2, double y1, double y2, - QWidget *parent, + TQWidget *parent, const char* name) : KPlotWidget( x1, x2, y1, y2, parent, name ) { m_connectPoints = false; } -void PlotWidget::drawObjects( QPainter *p ) +void PlotWidget::drawObjects( TQPainter *p ) { // let the KPlotWidget draw the default stuff first KPlotWidget::drawObjects(p); // then draw the connecting lines if (!m_connectPoints) return; // bail out if connect points is not enabled - QPoint old; // used to remember last coordinates + TQPoint old; // used to remember last coordinates bool first = true; for ( KPlotObject *po = ObjectList.first(); po; po = ObjectList.next() ) { @@ -49,11 +49,11 @@ void PlotWidget::drawObjects( QPainter *p ) if (po->type() != KPlotObject::POINTS) continue; // draw the connecting lines - p->setPen( QColor( po->color() ) ); - p->setBrush( QColor( po->color() ) ); + p->setPen( TQColor( po->color() ) ); + p->setBrush( TQColor( po->color() ) ); for ( DPoint *dp = po->points()->first(); dp; dp = po->points()->next() ) { - QPoint q = dp->qpoint( PixRect, DataRect ); + TQPoint q = dp->qpoint( PixRect, DataRect ); if ( first ) first = false; diff --git a/kalzium/src/plotwidget.h b/kalzium/src/plotwidget.h index 5a0ccd61..44591f39 100644 --- a/kalzium/src/plotwidget.h +++ b/kalzium/src/plotwidget.h @@ -26,7 +26,7 @@ class PlotWidget : public KPlotWidget Q_OBJECT public: - PlotWidget( double x1 = 0.0, double x2 = 0.0, double y1 = 0.0, double y2 = 0.0, QWidget *parent=0 , const char *name =0 ); + PlotWidget( double x1 = 0.0, double x2 = 0.0, double y1 = 0.0, double y2 = 0.0, TQWidget *parent=0 , const char *name =0 ); /** * toggles if the points will be connected with @@ -47,7 +47,7 @@ class PlotWidget : public KPlotWidget /** * draws the objects */ - virtual void drawObjects( QPainter *p); + virtual void drawObjects( TQPainter *p); }; diff --git a/kalzium/src/somwidget_impl.cpp b/kalzium/src/somwidget_impl.cpp index ae1c19d8..6e3f4b71 100644 --- a/kalzium/src/somwidget_impl.cpp +++ b/kalzium/src/somwidget_impl.cpp @@ -13,11 +13,11 @@ #include "somwidget_impl.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include "prefs.h" #include "tempunit.h" -SOMWidgetIMPL::SOMWidgetIMPL( QWidget *parent, const char* name ) +SOMWidgetIMPL::SOMWidgetIMPL( TQWidget *parent, const char* name ) : SOMWidget( parent,name ) { m_list = KalziumDataObject::instance()->ElementList; @@ -39,18 +39,18 @@ SOMWidgetIMPL::SOMWidgetIMPL( QWidget *parent, const char* name ) text->setTextFormat( Qt::RichText ); text->setReadOnly( true ); text->setPaletteBackgroundColor( paletteBackgroundColor() ); - text->setFrameStyle( QFrame::NoFrame ); + text->setFrameStyle( TQFrame::NoFrame ); m_htmlBegin = ""; m_htmlEnd = ""; m_prevUnit = Prefs::temperature(); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - connect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + connect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); reloadUnits(); } @@ -71,40 +71,40 @@ kdDebug() << "min: " << Number1->minValue() << " - max: " << Number1->maxValue() void SOMWidgetIMPL::sliderValueChanged( int temp ) { // TODO check if in Qt4 the RangeControl emits the signal again - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - disconnect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + disconnect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); double newvalue = TempUnit::convert( (double)temp, (int)TempUnit::Kelvin, Prefs::temperature() ); Number1->setValue( newvalue ); setNewTemp( newvalue ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - connect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + connect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); } void SOMWidgetIMPL::spinValueChanged( double temp ) { - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - disconnect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + disconnect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); int newvalue = (int)TempUnit::convert( temp, Prefs::temperature(), (int)TempUnit::Kelvin ); temp_slider->setValue( newvalue ); setNewTemp( temp ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - connect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + connect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); } void SOMWidgetIMPL::setNewTemp( double newtemp ) @@ -113,13 +113,13 @@ void SOMWidgetIMPL::setNewTemp( double newtemp ) double temp = TempUnit::convert( newtemp, Prefs::temperature(), (int)TempUnit::Kelvin ); - QValueList::ConstIterator it = m_list.begin(); - const QValueList::ConstIterator itEnd = m_list.end(); + TQValueList::ConstIterator it = m_list.begin(); + const TQValueList::ConstIterator itEnd = m_list.end(); - QStringList listMeltingPoint; - QStringList listBoilingPoint; - QStringList listBoilingPointValue; - QStringList listMeltingPointValue; + TQStringList listMeltingPoint; + TQStringList listBoilingPoint; + TQStringList listBoilingPointValue; + TQStringList listMeltingPointValue; for ( ; it != itEnd; ++it ) { if ( ( ( *it )->melting() > 0.0 ) && fabs( ( *it )->melting() - temp ) <= threshold ) @@ -133,7 +133,7 @@ void SOMWidgetIMPL::setNewTemp( double newtemp ) listBoilingPointValue << ( *it )->adjustUnits( Element::BOILINGPOINT ); } } - QString htmlcode; + TQString htmlcode; if ( listMeltingPoint.count() > 0 ) { htmlcode += i18n( "Elements with melting point around this temperature:" ) + "
"; diff --git a/kalzium/src/somwidget_impl.h b/kalzium/src/somwidget_impl.h index 0c61c355..ab616f54 100644 --- a/kalzium/src/somwidget_impl.h +++ b/kalzium/src/somwidget_impl.h @@ -22,7 +22,7 @@ class Element; * @author Carsten Niehaus * @author Pino Toscano * - * The SOMWidgetIMPL provides a QSlider. When this slider is moved, + * The SOMWidgetIMPL provides a TQSlider. When this slider is moved, * this widget will display which elements have a boiling or melting * point near the temperature the user entered using the slider. */ @@ -35,7 +35,7 @@ class SOMWidgetIMPL : public SOMWidget * @param parent The parent of this widget * @param name The name of this widget */ - SOMWidgetIMPL( QWidget *parent = 0, const char* name = 0 ); + SOMWidgetIMPL( TQWidget *parent = 0, const char* name = 0 ); public slots: /** @@ -44,9 +44,9 @@ class SOMWidgetIMPL : public SOMWidget void reloadUnits(); private: - QValueList m_list; - QString m_htmlBegin; - QString m_htmlEnd; + TQValueList m_list; + TQString m_htmlBegin; + TQString m_htmlEnd; int m_prevUnit; private slots: diff --git a/kalzium/src/spectrum.cpp b/kalzium/src/spectrum.cpp index 4b74eadb..dc8abb01 100644 --- a/kalzium/src/spectrum.cpp +++ b/kalzium/src/spectrum.cpp @@ -28,8 +28,8 @@ double Spectrum::minBand() { double value = ( *m_bandlist.begin() ).wavelength; - QValueList::const_iterator it = m_bandlist.begin(); - const QValueList::const_iterator itEnd = m_bandlist.end(); + TQValueList::const_iterator it = m_bandlist.begin(); + const TQValueList::const_iterator itEnd = m_bandlist.end(); for (;it!=itEnd;++it) { if ( value > ( *it ).wavelength ) @@ -41,8 +41,8 @@ double Spectrum::minBand() double Spectrum::maxBand() { double value = ( *m_bandlist.begin() ).wavelength; - QValueList::const_iterator it = m_bandlist.begin(); - const QValueList::const_iterator itEnd = m_bandlist.end(); + TQValueList::const_iterator it = m_bandlist.begin(); + const TQValueList::const_iterator itEnd = m_bandlist.end(); for (;it!=itEnd;++it) { if ( value < ( *it ).wavelength ) @@ -56,8 +56,8 @@ Spectrum* Spectrum::adjustToWavelength( double min, double max ) { Spectrum *spec = new Spectrum(); - QValueList::const_iterator it = m_bandlist.begin(); - const QValueList::const_iterator itEnd = m_bandlist.end(); + TQValueList::const_iterator it = m_bandlist.begin(); + const TQValueList::const_iterator itEnd = m_bandlist.end(); for ( ; it != itEnd; ++it ) { @@ -75,8 +75,8 @@ Spectrum* Spectrum::adjustToWavelength( double min, double max ) void Spectrum::adjustIntensities() { int maxInt = 0; - QValueList::Iterator it = m_bandlist.begin(); - const QValueList::Iterator itEnd = m_bandlist.end(); + TQValueList::Iterator it = m_bandlist.begin(); + const TQValueList::Iterator itEnd = m_bandlist.end(); //find the highest intensity for ( ; it != itEnd; ++it ) @@ -101,12 +101,12 @@ void Spectrum::adjustIntensities() } } -QValueList Spectrum::wavelengths( double min, double max ) +TQValueList Spectrum::wavelengths( double min, double max ) { - QValueList list; + TQValueList list; - QValueList::const_iterator it = m_bandlist.begin(); - const QValueList::const_iterator itEnd = m_bandlist.end(); + TQValueList::const_iterator it = m_bandlist.begin(); + const TQValueList::const_iterator itEnd = m_bandlist.end(); for ( ; it != itEnd; ++it ) { @@ -119,17 +119,17 @@ QValueList Spectrum::wavelengths( double min, double max ) return list; } -QString Spectrum::bandsAsHtml() +TQString Spectrum::bandsAsHtml() { - QString html = "Chemical datai"; + TQString html = "Chemical datai"; html += "
"; html += i18n( "Isotope-Table" ); @@ -257,17 +257,17 @@ QString DetailedInfoDlg::isotopeTable() html += i18n( "Magnetic Moment" ); html += "
" ); if ( ( *it )->weight() > 0.0 ) html.append( i18n( "%1 u" ).arg( KalziumUtils::localizedValue( ( *it )->weight(), 6 ) ) ); - // html.append( i18n( "%1 u" ).arg( QString::number( ( *it )->weight() ) )); + // html.append( i18n( "%1 u" ).arg( TQString::number( ( *it )->weight() ) )); html.append( "" ); - html.append( QString::number( ( *it )->neutrons() ) ); + html.append( TQString::number( ( *it )->neutrons() ) ); html.append( "" ); if ( ( *it )->percentage() > 0.0 ) html.append( i18n( "this can for example be '24%'", "%1%" ).arg( KalziumUtils::localizedValue( ( *it )->percentage(), 6 ) ) ); @@ -279,7 +279,7 @@ QString DetailedInfoDlg::isotopeTable() if ( ( *it )->alphapercentage() > 0.0 ){ if ( ( *it )->alphadecay() > 0.0 ) html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->alphadecay(), 6 ) ) ); - html.append( i18n( " %1" ).arg( QChar( 945 ) ) ); + html.append( i18n( " %1" ).arg( TQChar( 945 ) ) ); if ( ( *it )->alphapercentage() < 100.0) html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( (*it )->alphapercentage(), 6 ) ) ); if ( ( *it )->betaminuspercentage() > 0.0 || ( *it )->betapluspercentage() > 0.0 || ( *it )->ecpercentage() > 0.0) @@ -288,7 +288,7 @@ QString DetailedInfoDlg::isotopeTable() if ( ( *it )->betaminuspercentage() > 0.0 ){ if ( ( *it )->betaminusdecay() > 0.0 ) html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->betaminusdecay(), 6 ) ) ); - html.append( i18n( " %1-" ).arg( QChar( 946 ) ) ); + html.append( i18n( " %1-" ).arg( TQChar( 946 ) ) ); if ( ( *it )->betaminuspercentage() < 100.0) html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( ( *it )->betaminuspercentage(), 6 ) )); if ( ( *it )->betapluspercentage() > 0.0 || ( *it )->ecpercentage() > 0.0 ) @@ -297,7 +297,7 @@ QString DetailedInfoDlg::isotopeTable() if ( ( *it )->betapluspercentage() > 0.0 ){ if ( ( *it )->betaplusdecay() > 0.0 ) html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->betaplusdecay(), 6 ) ) ); - html.append( i18n( " %1+" ).arg(QChar( 946 ) ) ); + html.append( i18n( " %1+" ).arg(TQChar( 946 ) ) ); if ( ( *it )->betapluspercentage() == ( *it )->ecpercentage() ) { if ( ( *it )->ecdecay() > 0.0 ) { html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->ecdecay(), 6 ) ) ); @@ -319,8 +319,8 @@ QString DetailedInfoDlg::isotopeTable() html.append( ( *it )->spin() ); html.append( "" ); if ( !( *it )->magmoment().isEmpty() ) { - QString v = KGlobal::locale()->formatNumber( ( *it )->magmoment(), false, 6 ); - html.append( i18n( "%1 %2n" ).arg( v ).arg( QChar( 956 ) ) ); + TQString v = KGlobal::locale()->formatNumber( ( *it )->magmoment(), false, 6 ); + html.append( i18n( "%1 %2n" ).arg( v ).arg( TQChar( 956 ) ) ); } html.append( "
"; - QValueList::const_iterator it = m_bandlist.begin(); - const QValueList::const_iterator itEnd = m_bandlist.end(); + TQValueList::const_iterator it = m_bandlist.begin(); + const TQValueList::const_iterator itEnd = m_bandlist.end(); for (;it!=itEnd;++it) { - html += QString( "" ) + html += TQString( "" ) + "" + "" + "" diff --git a/kalzium/src/spectrum.h b/kalzium/src/spectrum.h index 7578973d..ca6bcdac 100644 --- a/kalzium/src/spectrum.h +++ b/kalzium/src/spectrum.h @@ -21,8 +21,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include +#include +#include class QPixmap; class Element; @@ -66,12 +66,12 @@ class Spectrum ///relative. The highest is per definition 1000 int intensity; - QString electronconfig1; - QString electronconfig2; - QString term1; - QString term2; - QString J1; - QString J2; + TQString electronconfig1; + TQString electronconfig2; + TQString term1; + TQString term2; + TQString J1; + TQString J2; }; /** @@ -103,9 +103,9 @@ class Spectrum * @param min the lowest allowed wavalength in nanometer * @param max the highest allowed wavalength in nanometer * - * @return the wavelength in a QValueList + * @return the wavelength in a TQValueList */ - QValueList wavelengths( double min, double max ); + TQValueList wavelengths( double min, double max ); /** * @return the smallest wavelength @@ -124,7 +124,7 @@ class Spectrum /** * @return the list of bands of the spectrum */ - QValueList* bandlist(){ + TQValueList* bandlist(){ return &m_bandlist; } @@ -140,7 +140,7 @@ class Spectrum /** * @return the data of a spectrum as HTML code */ - QString bandsAsHtml(); + TQString bandsAsHtml(); /** * @return the parent element of this spectrum @@ -162,7 +162,7 @@ class Spectrum /** * the internal dataset */ - QValueList m_bandlist; + TQValueList m_bandlist; /** * the cached values of the highest and lowest wavelength diff --git a/kalzium/src/spectrumviewimpl.cpp b/kalzium/src/spectrumviewimpl.cpp index b7a3b479..89bc36ac 100644 --- a/kalzium/src/spectrumviewimpl.cpp +++ b/kalzium/src/spectrumviewimpl.cpp @@ -12,7 +12,7 @@ ***************************************************************************/ #include "spectrumviewimpl.h" -#include +#include #include #include @@ -22,7 +22,7 @@ #include "exporter.h" -SpectrumViewImpl::SpectrumViewImpl( QWidget *parent, const char* name ) +SpectrumViewImpl::SpectrumViewImpl( TQWidget *parent, const char* name ) : SpectrumView( parent, name ) { resize( minimumSizeHint() ); @@ -34,8 +34,8 @@ SpectrumViewImpl::SpectrumViewImpl( QWidget *parent, const char* name ) void SpectrumViewImpl::slotExportAsImage() { Exporter* exporter = new Exporter(); - QString fileName = KFileDialog::getSaveFileName( - QString::null, exporter->supportedImageFormats(), + TQString fileName = KFileDialog::getSaveFileName( + TQString::null, exporter->supportedImageFormats(), this, i18n( "Save Spectrum" ) ); if( !fileName.isEmpty() ) { diff --git a/kalzium/src/spectrumviewimpl.h b/kalzium/src/spectrumviewimpl.h index 131a602c..ed02db85 100644 --- a/kalzium/src/spectrumviewimpl.h +++ b/kalzium/src/spectrumviewimpl.h @@ -29,7 +29,7 @@ class SpectrumViewImpl : public SpectrumView * @param parent the parent widget * @param name the name used internally */ - SpectrumViewImpl( QWidget* parent, const char* name ); + SpectrumViewImpl( TQWidget* parent, const char* name ); /** * sets the spectrum to @p spec diff --git a/kalzium/src/spectrumwidget.cpp b/kalzium/src/spectrumwidget.cpp index 5531163c..54f70972 100644 --- a/kalzium/src/spectrumwidget.cpp +++ b/kalzium/src/spectrumwidget.cpp @@ -28,18 +28,18 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include #if defined(Q_OS_SOLARIS) #include #endif -SpectrumWidget::SpectrumWidget( QWidget *parent, const char* name ) : QWidget( parent, name ) +SpectrumWidget::SpectrumWidget( TQWidget *parent, const char* name ) : TQWidget( parent, name ) { startValue = 0; endValue = 0; @@ -57,11 +57,11 @@ SpectrumWidget::SpectrumWidget( QWidget *parent, const char* name ) : QWidget( p setType( EmissionSpectrum ); setMinimumSize( 400, 230 ); - setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); setBackgroundMode( NoBackground ); } -void SpectrumWidget::paintEvent( QPaintEvent * /*e*/ ) +void SpectrumWidget::paintEvent( TQPaintEvent * /*e*/ ) { if ( !m_spectrum ) return; @@ -69,7 +69,7 @@ void SpectrumWidget::paintEvent( QPaintEvent * /*e*/ ) m_pixmap.resize( width(), height() ); m_pixmap.fill( this, width(), height() ); - QPainter p; + TQPainter p; p.begin( &m_pixmap, this ); p.fillRect( 0, 0, width(), m_realHeight, Qt::black ); @@ -87,7 +87,7 @@ void SpectrumWidget::paintEvent( QPaintEvent * /*e*/ ) bitBlt( this, 0, 0, &m_pixmap ); } -void SpectrumWidget::drawZoomLine( QPainter* p ) +void SpectrumWidget::drawZoomLine( TQPainter* p ) { p->setPen( Qt::white ); p->drawLine( m_LMBPointPress.x(), m_LMBPointPress.y(), m_LMBPointCurrent.x(), m_LMBPointPress.y() ); @@ -96,7 +96,7 @@ void SpectrumWidget::drawZoomLine( QPainter* p ) } -void SpectrumWidget::paintBands( QPainter* p ) +void SpectrumWidget::paintBands( TQPainter* p ) { if ( m_type == AbsorptionSpectrum ) { @@ -114,7 +114,7 @@ void SpectrumWidget::paintBands( QPainter* p ) int x = 0; int temp = 0; - for ( QValueList::Iterator it = m_spectrum->bandlist()->begin(); + for ( TQValueList::Iterator it = m_spectrum->bandlist()->begin(); it != m_spectrum->bandlist()->end(); ++it ) { @@ -145,12 +145,12 @@ void SpectrumWidget::paintBands( QPainter* p ) } } -QColor SpectrumWidget::linecolor( double spectrum ) +TQColor SpectrumWidget::linecolor( double spectrum ) { int r,g,b; wavelengthToRGB( spectrum, r,g,b ); - QColor c( r,g,b ); + TQColor c( r,g,b ); return c; } @@ -226,7 +226,7 @@ int SpectrumWidget::Adjust( double color, double factor ) return qRound( IntensityMax * pow( color*factor, Gamma ) ); } -void SpectrumWidget::drawTickmarks( QPainter* p ) +void SpectrumWidget::drawTickmarks( TQPainter* p ) { //the size of the text on the tickmarks const int space = 20; @@ -259,7 +259,7 @@ void SpectrumWidget::drawTickmarks( QPainter* p ) } } -void SpectrumWidget::keyPressEvent( QKeyEvent *e ) +void SpectrumWidget::keyPressEvent( TQKeyEvent *e ) { kdDebug() << "SpectrumWidget::keyPressEvent()" << endl; switch ( e->key() ) @@ -312,17 +312,17 @@ void SpectrumWidget::slotZoomIn() kdDebug() << "SpectrumWidget::slotZoomIn() "<< startValue << ":: "<< endValue << endl; } -void SpectrumWidget::mouseMoveEvent( QMouseEvent *e ) +void SpectrumWidget::mouseMoveEvent( TQMouseEvent *e ) { m_LMBPointCurrent = e->pos(); update(); } -void SpectrumWidget::mousePressEvent( QMouseEvent *e ) +void SpectrumWidget::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() == QMouseEvent::LeftButton ) + if ( e->button() == TQMouseEvent::LeftButton ) m_LMBPointPress = e->pos(); - if ( e->button() == QMouseEvent::RightButton ) + if ( e->button() == TQMouseEvent::RightButton ) slotZoomOut(); //FIXME //the tooltip is not really working. Better to not have it @@ -334,8 +334,8 @@ void SpectrumWidget::PrepareTooltip( double wavelength ) { Spectrum::band band; - QValueList::const_iterator it = m_spectrum->bandlist()->begin(); - const QValueList::const_iterator itEnd = m_spectrum->bandlist()->end(); + TQValueList::const_iterator it = m_spectrum->bandlist()->begin(); + const TQValueList::const_iterator itEnd = m_spectrum->bandlist()->end(); //find the difference in percent (1.0 is 100%, 0.1 is 10%) double dif = 0.0; @@ -374,10 +374,10 @@ void SpectrumWidget::PrepareTooltip( double wavelength ) update(); } -void SpectrumWidget::drawTooltip( QPainter *p ) +void SpectrumWidget::drawTooltip( TQPainter *p ) { p->setPen( Qt::white ); - QPoint pt = mapFromGlobal( QCursor::pos() ); + TQPoint pt = mapFromGlobal( TQCursor::pos() ); p->drawText( pt, i18n("Wavelength: %1").arg(m_band.wavelength) ); pt.setY( pt.y() + 15 ); p->drawText( pt, i18n("Intensity: %1").arg(m_band.intensity) ); @@ -389,9 +389,9 @@ void SpectrumWidget::drawTooltip( QPainter *p ) p->drawText( pt, i18n("J 1, J 2: %1, %2").arg(m_band.J1).arg( m_band.J2 )); } -void SpectrumWidget::mouseReleaseEvent( QMouseEvent *e ) +void SpectrumWidget::mouseReleaseEvent( TQMouseEvent *e ) { - if ( e->button() == QMouseEvent::LeftButton ) + if ( e->button() == TQMouseEvent::LeftButton ) { int left = (int)Wavelength( ( double )m_LMBPointPress.x()/width() ); int right = (int)Wavelength( ( double )e->pos().x()/width() ); @@ -409,17 +409,17 @@ void SpectrumWidget::mouseReleaseEvent( QMouseEvent *e ) m_LMBPointCurrent.setX( -1 ); } -QPixmap SpectrumWidget::pixmap() +TQPixmap SpectrumWidget::pixmap() { - QPixmap tmp( m_pixmap ); - QString text; + TQPixmap tmp( m_pixmap ); + TQString text; if( m_type == EmissionSpectrum ) text = i18n( "Emission spectrum of %1" ).arg( m_spectrum->parentElement()->elname() ); else text = i18n( "Absorption spectrum of %1" ).arg( m_spectrum->parentElement()->elname() ); - QPainter p( &tmp ); + TQPainter p( &tmp ); p.setPen( Qt::black ); p.drawText( 30, m_realHeight + 70, text ); diff --git a/kalzium/src/spectrumwidget.h b/kalzium/src/spectrumwidget.h index 84a6fd80..c29e433c 100644 --- a/kalzium/src/spectrumwidget.h +++ b/kalzium/src/spectrumwidget.h @@ -21,9 +21,9 @@ #ifndef SPECTRUMWIDGET_H #define SPECTRUMWIDGET_H -#include +#include -#include +#include #include "spectrum.h" @@ -36,7 +36,7 @@ class SpectrumWidget : public QWidget Q_OBJECT public: - SpectrumWidget( QWidget *parent, const char* name = 0 ); + SpectrumWidget( TQWidget *parent, const char* name = 0 ); ~SpectrumWidget(){} @@ -76,7 +76,7 @@ class SpectrumWidget : public QWidget * find the nearest band. The returned value is the number * of pixel the next band is away */ - int findNearestBand( QValueList::iterator it ); + int findNearestBand( TQValueList::iterator it ); /** * there are several possible types. @@ -107,7 +107,7 @@ class SpectrumWidget : public QWidget * @returns the color of a line * @param spectrum the value of the spectrum */ - QColor linecolor( double spectrum ); + TQColor linecolor( double spectrum ); double Gamma; int IntensityMax; @@ -152,29 +152,29 @@ class SpectrumWidget : public QWidget */ void wavelengthToRGB( double wavelength, int& r, int& g, int& b ); - QPixmap pixmap(); + TQPixmap pixmap(); private: - QValueList m_spectra; + TQValueList m_spectra; SpectrumType m_type; Spectrum *m_spectrum; - QPixmap m_pixmap; + TQPixmap m_pixmap; bool m_showtooltip; Spectrum::band m_band; - void paintBands( QPainter* p ); - void drawZoomLine( QPainter* p ); - void drawTooltip( QPainter *p ); + void paintBands( TQPainter* p ); + void drawZoomLine( TQPainter* p ); + void drawTooltip( TQPainter *p ); /** * Draw the scale */ - void drawTickmarks( QPainter *p ); + void drawTickmarks( TQPainter *p ); double startValue; double endValue; @@ -182,13 +182,13 @@ class SpectrumWidget : public QWidget int m_realHeight; /** - * this QPoint stores the information where + * this TQPoint stores the information where * the left mouse button has been pressed. This * is used for the mouse zooming */ - QPoint m_LMBPointPress; + TQPoint m_LMBPointPress; - QPoint m_LMBPointCurrent; + TQPoint m_LMBPointCurrent; public slots: /** @@ -224,11 +224,11 @@ class SpectrumWidget : public QWidget void slotZoomOut(); protected: - virtual void paintEvent( QPaintEvent *e ); - virtual void keyPressEvent(QKeyEvent *e); - virtual void mouseMoveEvent( QMouseEvent *e ); - virtual void mousePressEvent( QMouseEvent *e ); - virtual void mouseReleaseEvent( QMouseEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); + virtual void keyPressEvent(TQKeyEvent *e); + virtual void mouseMoveEvent( TQMouseEvent *e ); + virtual void mousePressEvent( TQMouseEvent *e ); + virtual void mouseReleaseEvent( TQMouseEvent *e ); }; #endif // SPECTRUMWIDGET_H diff --git a/kalzium/src/tempunit.cpp b/kalzium/src/tempunit.cpp index 55d3630f..a4e18ef7 100644 --- a/kalzium/src/tempunit.cpp +++ b/kalzium/src/tempunit.cpp @@ -75,20 +75,20 @@ double TempUnit::convert( const double value, int from, int to ) return convert( value, (TempUnit::Unit)from, (TempUnit::Unit)to ); } -QStringList TempUnit::unitListSymbols() +TQStringList TempUnit::unitListSymbols() { - QStringList list; + TQStringList list; list << "K"; - list << QString::fromUtf8("°C"); - list << QString::fromUtf8("°F"); - list << QString::fromUtf8("°Ra"); - list << QString::fromUtf8("°R"); + list << TQString::fromUtf8("°C"); + list << TQString::fromUtf8("°F"); + list << TQString::fromUtf8("°Ra"); + list << TQString::fromUtf8("°R"); return list; } -QString TempUnit::unitListSymbol( int i ) +TQString TempUnit::unitListSymbol( int i ) { - QStringList l = unitListSymbols(); + TQStringList l = unitListSymbols(); if ( ( i < 0 ) || ( i >= (int)l.count() ) ) return l[0]; return l[i]; diff --git a/kalzium/src/tempunit.h b/kalzium/src/tempunit.h index db4c366e..23629bb2 100644 --- a/kalzium/src/tempunit.h +++ b/kalzium/src/tempunit.h @@ -20,8 +20,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include +#include +#include /** * This class obtains all the info needed to work with the units of measure @@ -74,12 +74,12 @@ class TempUnit * @return a list with the symbols of the temperature units * we support */ - static QStringList unitListSymbols(); + static TQStringList unitListSymbols(); /** * @return the symbol of the @p i -th unit */ - static QString unitListSymbol( int i ); + static TQString unitListSymbol( int i ); static QPair rangeForUnit( TempUnit::Unit u ); diff --git a/kalzium/src/timewidget_impl.cpp b/kalzium/src/timewidget_impl.cpp index 5f460f4a..a5f186bc 100644 --- a/kalzium/src/timewidget_impl.cpp +++ b/kalzium/src/timewidget_impl.cpp @@ -13,28 +13,28 @@ ***************************************************************************/ #include "timewidget_impl.h" -#include -#include -#include -#include +#include +#include +#include +#include #include -TimeWidgetIMPL::TimeWidgetIMPL( QWidget *parent, const char* name ) +TimeWidgetIMPL::TimeWidgetIMPL( TQWidget *parent, const char* name ) : TimeWidget( parent, name ) { text->setAlignment( text->alignment() | Qt::WordBreak ); text->setTextFormat( Qt::RichText ); text->setReadOnly( true ); text->setPaletteBackgroundColor( paletteBackgroundColor() ); - text->setFrameStyle( QFrame::NoFrame ); + text->setFrameStyle( TQFrame::NoFrame ); } void TimeWidgetIMPL::slotChanged( int value ) { ( void )value; text->hide(); - verticalSpacer->changeSize( 21, 5, QSizePolicy::Fixed, QSizePolicy::Expanding ); + verticalSpacer->changeSize( 21, 5, TQSizePolicy::Fixed, TQSizePolicy::Expanding ); } #include "timewidget_impl.moc" diff --git a/kalzium/src/timewidget_impl.h b/kalzium/src/timewidget_impl.h index 6664ca15..65030da1 100644 --- a/kalzium/src/timewidget_impl.h +++ b/kalzium/src/timewidget_impl.h @@ -28,7 +28,7 @@ class TimeWidgetIMPL : public TimeWidget * @param parent The parent of this widget * @param name The name of this widget */ - TimeWidgetIMPL( QWidget *parent = 0, const char* name = 0 ); + TimeWidgetIMPL( TQWidget *parent = 0, const char* name = 0 ); public slots: /** diff --git a/kanagram/src/fontutils.cpp b/kanagram/src/fontutils.cpp index 320f501f..14fff456 100644 --- a/kanagram/src/fontutils.cpp +++ b/kanagram/src/fontutils.cpp @@ -7,18 +7,18 @@ * (at your option) any later version. * ***************************************************************************/ -#include +#include #include "fontutils.h" -int fontUtils::fontSize(QPainter &p, const QString &s1, int w, int h) +int fontUtils::fontSize(TQPainter &p, const TQString &s1, int w, int h) { - QRect aux1; - QFont f = p.font(); + TQRect aux1; + TQFont f = p.font(); f.setPointSize(28); p.setFont(f); - aux1 = p.boundingRect(QRect(), Qt::AlignAuto, s1); + aux1 = p.boundingRect(TQRect(), Qt::AlignAuto, s1); return QMIN(w * 28 / aux1.width(), h * 28 / aux1.height()); } diff --git a/kanagram/src/fontutils.h b/kanagram/src/fontutils.h index b6bc9c97..b458f394 100644 --- a/kanagram/src/fontutils.h +++ b/kanagram/src/fontutils.h @@ -12,7 +12,7 @@ namespace fontUtils { - int fontSize(QPainter &p, const QString &s1, int w, int h); + int fontSize(TQPainter &p, const TQString &s1, int w, int h); } #endif diff --git a/kanagram/src/grammarmanager.cpp b/kanagram/src/grammarmanager.cpp index dd526fd5..71387b91 100644 --- a/kanagram/src/grammarmanager.cpp +++ b/kanagram/src/grammarmanager.cpp @@ -42,15 +42,15 @@ Conjugation::names [] = }; -vector Conjugation::userTenses; +vector Conjugation::userTenses; //================================================================ Comparison::Comparison ( - const QString &l1, - const QString &l2, - const QString &l3 + const TQString &l1, + const TQString &l2, + const TQString &l3 ) { setL1 (l1); @@ -79,9 +79,9 @@ void Comparison::clear() Article::Article - (const QString &fem_def, const QString &fem_indef, - const QString &mal_def, const QString &mal_indef, - const QString &nat_def, const QString &nat_indef + (const TQString &fem_def, const TQString &fem_indef, + const TQString &mal_def, const TQString &mal_indef, + const TQString &nat_def, const TQString &nat_indef ) { setFemale (fem_def, fem_indef); @@ -91,7 +91,7 @@ Article::Article void Article::setFemale - (const QString &def, const QString &indef) + (const TQString &def, const TQString &indef) { fem_def = def; fem_indef = indef; @@ -99,7 +99,7 @@ void Article::setFemale void Article::setMale - (const QString &def, const QString &indef) + (const TQString &def, const TQString &indef) { mal_def = def; mal_indef = indef; @@ -107,7 +107,7 @@ void Article::setMale void Article::setNatural - (const QString &def, const QString &indef) + (const TQString &def, const TQString &indef) { nat_def = def; nat_indef = indef; @@ -115,7 +115,7 @@ void Article::setNatural void Article::female - (QString &def, QString &indef) const + (TQString &def, TQString &indef) const { def = fem_def; indef = fem_indef; @@ -123,7 +123,7 @@ void Article::female void Article::male - (QString &def, QString &indef) const + (TQString &def, TQString &indef) const { def = mal_def; indef = mal_indef; @@ -131,7 +131,7 @@ void Article::male void Article::natural - (QString &def, QString &indef) const + (TQString &def, TQString &indef) const { def = nat_def; indef = nat_indef; @@ -158,7 +158,7 @@ vector Conjugation::getRelation () } for (int i = 0; i < (int) userTenses.size(); i++) { - QString s; + TQString s; s.setNum(i+1); s.insert(0, UL_USER_TENSE); vec.push_back(TenseRelation(s, userTenses[i])); @@ -168,16 +168,16 @@ vector Conjugation::getRelation () } -void Conjugation::setTenseNames (vector names) +void Conjugation::setTenseNames (vector names) { userTenses = names; } -QString Conjugation::getName (const QString &abbrev) +TQString Conjugation::getName (const TQString &abbrev) { - if (abbrev.length() >= 2 && abbrev[0] == QString(UL_USER_TENSE)) { - QString s = abbrev; + if (abbrev.length() >= 2 && abbrev[0] == TQString(UL_USER_TENSE)) { + TQString s = abbrev; s.remove(0, 1); int i = s.toInt() - 1; @@ -197,7 +197,7 @@ QString Conjugation::getName (const QString &abbrev) } -QString Conjugation::getName (int idx) +TQString Conjugation::getName (int idx) { if (idx < numInternalNames() ) return i18n(names[idx].name); @@ -210,11 +210,11 @@ QString Conjugation::getName (int idx) } -QString Conjugation::getAbbrev (const QString &name) +TQString Conjugation::getAbbrev (const TQString &name) { for (int i = 0; i < (int) userTenses.size(); i++) if (userTenses[i] == name) { - QString s; + TQString s; s.setNum(i+1); s.insert(0, UL_USER_TENSE); return s; @@ -228,13 +228,13 @@ QString Conjugation::getAbbrev (const QString &name) } -QString Conjugation::getAbbrev (int idx) +TQString Conjugation::getAbbrev (int idx) { if (idx < numInternalNames() ) return names[idx].abbrev; else if (idx < numTenses() ) { - QString s; + TQString s; s.setNum(idx-numInternalNames()+1); s.insert(0, UL_USER_TENSE); return s; @@ -257,7 +257,7 @@ int Conjugation::numTenses() } -QString Conjugation::getType (int idx) +TQString Conjugation::getType (int idx) { if (idx >= (int) conjugations.size() ) return ""; @@ -266,7 +266,7 @@ QString Conjugation::getType (int idx) } -void Conjugation::setType (int idx, const QString & type) +void Conjugation::setType (int idx, const TQString & type) { if (idx >= (int) conjugations.size() ) return; @@ -321,83 +321,83 @@ bool Conjugation::isEmpty (int idx) return default; -bool Conjugation::pers3SingularCommon(const QString &type) const +bool Conjugation::pers3SingularCommon(const TQString &type) const { _GET_CON_(s3common, type, false); } -bool Conjugation::pers3PluralCommon(const QString &type) const +bool Conjugation::pers3PluralCommon(const TQString &type) const { _GET_CON_(p3common, type, false); } -QString Conjugation::pers1Singular - (const QString &type) const +TQString Conjugation::pers1Singular + (const TQString &type) const { _GET_CON_(pers1_sing, type, ""); } -QString Conjugation::pers2Singular - (const QString &type) const +TQString Conjugation::pers2Singular + (const TQString &type) const { _GET_CON_(pers2_sing, type, ""); } -QString Conjugation::pers3FemaleSingular - (const QString &type) const +TQString Conjugation::pers3FemaleSingular + (const TQString &type) const { _GET_CON_(pers3_f_sing, type, ""); } -QString Conjugation::pers3MaleSingular - (const QString &type) const +TQString Conjugation::pers3MaleSingular + (const TQString &type) const { _GET_CON_(pers3_m_sing, type, ""); } -QString Conjugation::pers3NaturalSingular - (const QString &type) const +TQString Conjugation::pers3NaturalSingular + (const TQString &type) const { _GET_CON_(pers3_n_sing, type, ""); } -QString Conjugation::pers1Plural - (const QString &type) const +TQString Conjugation::pers1Plural + (const TQString &type) const { _GET_CON_(pers1_plur, type, ""); } -QString Conjugation::pers2Plural - (const QString &type) const +TQString Conjugation::pers2Plural + (const TQString &type) const { _GET_CON_(pers2_plur, type, ""); } -QString Conjugation::pers3FemalePlural - (const QString &type) const +TQString Conjugation::pers3FemalePlural + (const TQString &type) const { _GET_CON_(pers3_f_plur, type, ""); } -QString Conjugation::pers3MalePlural - (const QString &type) const +TQString Conjugation::pers3MalePlural + (const TQString &type) const { _GET_CON_(pers3_m_plur, type, ""); } -QString Conjugation::pers3NaturalPlural - (const QString &type) const +TQString Conjugation::pers3NaturalPlural + (const TQString &type) const { _GET_CON_(pers3_n_plur, type, ""); } @@ -418,83 +418,83 @@ QString Conjugation::pers3NaturalPlural conjugations.push_back(ct); -void Conjugation::setPers3PluralCommon(const QString &type, bool f) +void Conjugation::setPers3PluralCommon(const TQString &type, bool f) { _SET_CON_(p3common, type, f); } -void Conjugation::setPers3SingularCommon(const QString &type, bool f) +void Conjugation::setPers3SingularCommon(const TQString &type, bool f) { _SET_CON_(s3common, type, f); } void Conjugation::setPers1Singular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers1_sing, type, str); } void Conjugation::setPers2Singular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers2_sing, type, str); } void Conjugation::setPers3FemaleSingular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_f_sing, type, str); } void Conjugation::setPers3MaleSingular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_m_sing, type, str); } void Conjugation::setPers3NaturalSingular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_n_sing, type, str); } void Conjugation::setPers1Plural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers1_plur, type, str); } void Conjugation::setPers2Plural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers2_plur, type, str); } void Conjugation::setPers3FemalePlural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_f_plur, type, str); } void Conjugation::setPers3MalePlural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_m_plur, type, str); } void Conjugation::setPers3NaturalPlural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_n_plur, type, str); } diff --git a/kanagram/src/grammarmanager.h b/kanagram/src/grammarmanager.h index 1b9cfe76..01f020b9 100644 --- a/kanagram/src/grammarmanager.h +++ b/kanagram/src/grammarmanager.h @@ -27,7 +27,7 @@ #ifndef grammarmanager_included #define grammarmanager_included -#include +#include #include using namespace std; @@ -54,22 +54,22 @@ public: Article() {} Article ( - const QString &fem_def, const QString &fem_indef, - const QString &mal_def, const QString &mal_indef, - const QString &nat_def, const QString &nat_indef + const TQString &fem_def, const TQString &fem_indef, + const TQString &mal_def, const TQString &mal_indef, + const TQString &nat_def, const TQString &nat_indef ); - void setFemale (const QString &def, const QString &indef); - void setMale (const QString &def, const QString &indef); - void setNatural (const QString &def, const QString &indef); + void setFemale (const TQString &def, const TQString &indef); + void setMale (const TQString &def, const TQString &indef); + void setNatural (const TQString &def, const TQString &indef); - void female (QString &def, QString &indef) const; - void male (QString &def, QString &indef) const; - void natural (QString &def, QString &indef) const; + void female (TQString &def, TQString &indef) const; + void male (TQString &def, TQString &indef) const; + void natural (TQString &def, TQString &indef) const; protected: - QString fem_def, fem_indef, + TQString fem_def, fem_indef, mal_def, mal_indef, nat_def, nat_indef; }; @@ -83,25 +83,25 @@ public: Comparison() {} Comparison ( - const QString &l1, - const QString &l2, - const QString &l3 + const TQString &l1, + const TQString &l2, + const TQString &l3 ); - void setL1 (const QString &s) { ls1 = s; } - void setL2 (const QString &s) { ls2 = s; } - void setL3 (const QString &s) { ls3 = s; } + void setL1 (const TQString &s) { ls1 = s; } + void setL2 (const TQString &s) { ls2 = s; } + void setL3 (const TQString &s) { ls3 = s; } - QString l1 () const { return ls1; } - QString l2 () const { return ls2; } - QString l3 () const { return ls3; } + TQString l1 () const { return ls1; } + TQString l2 () const { return ls2; } + TQString l3 () const { return ls3; } bool isEmpty() const; void clear(); protected: - QString ls1, ls2, ls3; + TQString ls1, ls2, ls3; }; @@ -109,15 +109,15 @@ class TenseRelation { public: - TenseRelation (const QString & _short, const QString & _long) + TenseRelation (const TQString & _short, const TQString & _long) : shortId (_short), longId(_long) {} - inline QString shortStr() const { return shortId; } - inline QString longStr() const { return longId; } + inline TQString shortStr() const { return shortId; } + inline TQString longStr() const { return longId; } protected: - QString shortId, longId; + TQString shortId, longId; }; @@ -131,47 +131,47 @@ public: int numEntries() const; static vector getRelation (); - static void setTenseNames (vector names); + static void setTenseNames (vector names); - static QString getName (const QString &abbrev); - static QString getName (int index); - static QString getAbbrev (const QString &name); - static QString getAbbrev (int index); + static TQString getName (const TQString &abbrev); + static TQString getName (int index); + static TQString getAbbrev (const TQString &name); + static TQString getAbbrev (int index); static int numInternalNames(); static int numTenses(); - QString getType (int index); - void setType (int index, const QString & type); + TQString getType (int index); + void setType (int index, const TQString & type); void cleanUp(); bool isEmpty (int idx); - QString pers1Singular(const QString &type) const; - QString pers2Singular(const QString &type) const; - bool pers3SingularCommon(const QString &type) const; - QString pers3FemaleSingular(const QString &type) const; - QString pers3MaleSingular(const QString &type) const; - QString pers3NaturalSingular(const QString &type) const; - - QString pers1Plural(const QString &type) const; - QString pers2Plural(const QString &type) const; - bool pers3PluralCommon(const QString &type) const; - QString pers3FemalePlural(const QString &type) const; - QString pers3MalePlural(const QString &type) const; - QString pers3NaturalPlural(const QString &type) const; - - void setPers1Singular(const QString &type, const QString &str); - void setPers2Singular(const QString &type, const QString &str); - void setPers3SingularCommon(const QString &type, bool f); - void setPers3FemaleSingular(const QString &type, const QString &str); - void setPers3MaleSingular(const QString &type, const QString &str); - void setPers3NaturalSingular(const QString &type, const QString &str); - - void setPers1Plural(const QString &type, const QString &str); - void setPers2Plural(const QString &type, const QString &str); - void setPers3PluralCommon(const QString &type, bool f); - void setPers3FemalePlural(const QString &type, const QString &str); - void setPers3MalePlural(const QString &type, const QString &str); - void setPers3NaturalPlural(const QString &type, const QString &str); + TQString pers1Singular(const TQString &type) const; + TQString pers2Singular(const TQString &type) const; + bool pers3SingularCommon(const TQString &type) const; + TQString pers3FemaleSingular(const TQString &type) const; + TQString pers3MaleSingular(const TQString &type) const; + TQString pers3NaturalSingular(const TQString &type) const; + + TQString pers1Plural(const TQString &type) const; + TQString pers2Plural(const TQString &type) const; + bool pers3PluralCommon(const TQString &type) const; + TQString pers3FemalePlural(const TQString &type) const; + TQString pers3MalePlural(const TQString &type) const; + TQString pers3NaturalPlural(const TQString &type) const; + + void setPers1Singular(const TQString &type, const TQString &str); + void setPers2Singular(const TQString &type, const TQString &str); + void setPers3SingularCommon(const TQString &type, bool f); + void setPers3FemaleSingular(const TQString &type, const TQString &str); + void setPers3MaleSingular(const TQString &type, const TQString &str); + void setPers3NaturalSingular(const TQString &type, const TQString &str); + + void setPers1Plural(const TQString &type, const TQString &str); + void setPers2Plural(const TQString &type, const TQString &str); + void setPers3PluralCommon(const TQString &type, bool f); + void setPers3FemalePlural(const TQString &type, const TQString &str); + void setPers3MalePlural(const TQString &type, const TQString &str); + void setPers3NaturalPlural(const TQString &type, const TQString &str); private: @@ -182,10 +182,10 @@ private: s3common = false; } - QString type; + TQString type; bool p3common, s3common; - QString pers1_sing, + TQString pers1_sing, pers2_sing, pers3_m_sing, pers3_f_sing, @@ -207,7 +207,7 @@ protected: vector conjugations; static conjug_name_t names []; - static vector userTenses; + static vector userTenses; }; diff --git a/kanagram/src/kanagram.cpp b/kanagram/src/kanagram.cpp index 088453a2..42cb90f9 100644 --- a/kanagram/src/kanagram.cpp +++ b/kanagram/src/kanagram.cpp @@ -24,13 +24,13 @@ using namespace std; #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -55,47 +55,47 @@ using namespace std; static const char* m_textRevealWord = I18N_NOOP("reveal word"); static const char* m_textHint = I18N_NOOP("hint"); -Kanagram::Kanagram() : QWidget(0, 0, WStaticContents | WNoAutoErase), m_overNext(false), m_overConfig(false), m_overHelp(false), m_overQuit(false), m_overReveal(false), m_overHint(false), m_overUp(false), m_overHintBox(false), m_showHint(false) +Kanagram::Kanagram() : TQWidget(0, 0, WStaticContents | WNoAutoErase), m_overNext(false), m_overConfig(false), m_overHelp(false), m_overQuit(false), m_overReveal(false), m_overHint(false), m_overUp(false), m_overHintBox(false), m_showHint(false) { m_game = new KanagramGame(this); - m_back = new QPixmap(locate("appdata", "images/kanagram.png")); - m_aboutKDEOverlay = new QPixmap(locate("appdata", "images/kicon.png")); - m_aboutKDEOverlayOver = new QPixmap(locate("appdata", "images/kiconover.png")); - m_aboutAppOverlay = new QPixmap(locate("appdata", "images/appicon.png")); - m_aboutAppOverlayOver = new QPixmap(locate("appdata", "images/appiconover.png")); - m_handbookOverlay = new QPixmap(locate("appdata", "images/handbookicon.png")); - m_handbookOverlayOver = new QPixmap(locate("appdata", "images/handbookiconover.png")); - m_card = new QPixmap(locate("appdata", "images/card.png")); - - m_next = new QPixmap(locate("appdata", "images/next.png")); - m_nextOver = new QPixmap(locate("appdata", "images/nextover.png")); - m_config = new QPixmap(locate("appdata", "images/config.png")); - m_configOver = new QPixmap(locate("appdata", "images/configover.png")); - m_help = new QPixmap(locate("appdata", "images/help.png")); - m_helpOver = new QPixmap(locate("appdata", "images/helpover.png")); - m_quit = new QPixmap(locate("appdata", "images/quit.png")); - m_quitOver = new QPixmap(locate("appdata", "images/quitover.png")); - - m_up = new QPixmap(locate("appdata", "images/up.png")); - m_upOver = new QPixmap(locate("appdata", "images/upover.png")); - m_upDisabled = new QPixmap(locate("appdata", "images/updisabled.png")); - - m_nextRect = QRect(477, 31, 134, 76); - m_configRect = QRect(477, 122, 134, 76); - m_helpRect = QRect(477, 212, 134, 76); - m_quitRect = QRect(453, 352, 182, 104); - - m_hintBoxRect = QRect(446, 207, 171, 85); - m_upRect = QRect(341, 425, 55, 33); - m_aboutKDERect = QRect(567, 213, 44, 44); - m_aboutAppRect = QRect(522, 213, 44, 44); - m_handbookRect = QRect(478, 213, 44, 44); - m_arrowRect = QRect(380, 134, 13, 20); - m_logoRect = QRect(76, 24, 297, 50); + m_back = new TQPixmap(locate("appdata", "images/kanagram.png")); + m_aboutKDEOverlay = new TQPixmap(locate("appdata", "images/kicon.png")); + m_aboutKDEOverlayOver = new TQPixmap(locate("appdata", "images/kiconover.png")); + m_aboutAppOverlay = new TQPixmap(locate("appdata", "images/appicon.png")); + m_aboutAppOverlayOver = new TQPixmap(locate("appdata", "images/appiconover.png")); + m_handbookOverlay = new TQPixmap(locate("appdata", "images/handbookicon.png")); + m_handbookOverlayOver = new TQPixmap(locate("appdata", "images/handbookiconover.png")); + m_card = new TQPixmap(locate("appdata", "images/card.png")); + + m_next = new TQPixmap(locate("appdata", "images/next.png")); + m_nextOver = new TQPixmap(locate("appdata", "images/nextover.png")); + m_config = new TQPixmap(locate("appdata", "images/config.png")); + m_configOver = new TQPixmap(locate("appdata", "images/configover.png")); + m_help = new TQPixmap(locate("appdata", "images/help.png")); + m_helpOver = new TQPixmap(locate("appdata", "images/helpover.png")); + m_quit = new TQPixmap(locate("appdata", "images/quit.png")); + m_quitOver = new TQPixmap(locate("appdata", "images/quitover.png")); + + m_up = new TQPixmap(locate("appdata", "images/up.png")); + m_upOver = new TQPixmap(locate("appdata", "images/upover.png")); + m_upDisabled = new TQPixmap(locate("appdata", "images/updisabled.png")); + + m_nextRect = TQRect(477, 31, 134, 76); + m_configRect = TQRect(477, 122, 134, 76); + m_helpRect = TQRect(477, 212, 134, 76); + m_quitRect = TQRect(453, 352, 182, 104); + + m_hintBoxRect = TQRect(446, 207, 171, 85); + m_upRect = TQRect(341, 425, 55, 33); + m_aboutKDERect = TQRect(567, 213, 44, 44); + m_aboutAppRect = TQRect(522, 213, 44, 44); + m_handbookRect = TQRect(478, 213, 44, 44); + m_arrowRect = TQRect(380, 134, 13, 20); + m_logoRect = TQRect(76, 24, 297, 50); //blackboardRect intentionally wrong to make sure fonts align correctly - m_blackboardRect = QRect(41, 116, 366, 255); + m_blackboardRect = TQRect(41, 116, 366, 255); setupRects(); @@ -103,27 +103,27 @@ Kanagram::Kanagram() : QWidget(0, 0, WStaticContents | WNoAutoErase), m_overNext setFixedSize(650, 471); show(); - m_chalkColor = QColor(155, 155, 155); - m_chalkHighlightColor = QColor(255, 255, 255); - m_fillColor = QColor(45, 45, 45); - m_fontColor = QColor(55, 55, 55); - m_fontHighlightColor = QColor(99, 99, 99); + m_chalkColor = TQColor(155, 155, 155); + m_chalkHighlightColor = TQColor(255, 255, 255); + m_fillColor = TQColor(45, 45, 45); + m_fontColor = TQColor(55, 55, 55); + m_fontHighlightColor = TQColor(99, 99, 99); loadSettings(); - m_hintTimer = new QTimer(this); + m_hintTimer = new TQTimer(this); m_helpMenu = new KHelpMenu(this, kapp->aboutData()); - m_inputBox = new QLineEdit(this); - m_inputBox->setGeometry(QRect(52, 427, 273, 29)); + m_inputBox = new TQLineEdit(this); + m_inputBox->setGeometry(TQRect(52, 427, 273, 29)); m_inputBox->setFrame(false); - connect(m_inputBox, SIGNAL(returnPressed()), this, SLOT(checkWord())); - connect(m_hintTimer, SIGNAL(timeout()), this, SLOT(hideHint())); - connect(m_inputBox, SIGNAL(textChanged(const QString &)), this, SLOT(update())); + connect(m_inputBox, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(checkWord())); + connect(m_hintTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(hideHint())); + connect(m_inputBox, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(update())); - QFont f = QFont(); + TQFont f = TQFont(); f.setPointSize(17); m_inputBox->setFont(f); m_inputBox->show(); @@ -144,7 +144,7 @@ Kanagram::~Kanagram() void Kanagram::loadSettings() { - QString hideTime = KanagramSettings::hintHideTime(); + TQString hideTime = KanagramSettings::hintHideTime(); if(hideTime[0].isDigit()) m_hintHideTime = hideTime[0].digitValue(); else @@ -156,14 +156,14 @@ void Kanagram::loadSettings() if(m_useStandardFonts) { m_blackboardFont = KGlobalSettings::generalFont(); - m_arrow = new QPixmap(locate("appdata", "images/basicarrow.png")); - m_arrowOver = new QPixmap(locate("appdata", "images/basicarrowover.png")); + m_arrow = new TQPixmap(locate("appdata", "images/basicarrow.png")); + m_arrowOver = new TQPixmap(locate("appdata", "images/basicarrowover.png")); } else { - m_blackboardFont = QFont("squeaky chalk sound"); - m_arrow = new QPixmap(locate("appdata", "images/arrow.png")); - m_arrowOver = new QPixmap(locate("appdata", "images/arrowover.png")); + m_blackboardFont = TQFont("squeaky chalk sound"); + m_arrow = new TQPixmap(locate("appdata", "images/arrow.png")); + m_arrowOver = new TQPixmap(locate("appdata", "images/arrowover.png")); } m_game->refreshVocabList(); @@ -171,24 +171,24 @@ void Kanagram::loadSettings() void Kanagram::setupRects() { - QPainter tmpp(this); - QFont font = m_blackboardFont; + TQPainter tmpp(this); + TQFont font = m_blackboardFont; font.setPointSize(14); font.setBold(true); tmpp.setFont(font); int yOffset = 0; //set appropriate yOffset for different fonts if(m_useStandardFonts) yOffset = 6; - QRect r = innerRect(m_blackboardRect, 6, yOffset); + TQRect r = innerRect(m_blackboardRect, 6, yOffset); m_hintRect = tmpp.boundingRect(r, Qt::AlignBottom|Qt::AlignLeft, i18n(m_textHint)); m_revealRect = tmpp.boundingRect(r, Qt::AlignBottom|Qt::AlignRight, i18n(m_textRevealWord)); tmpp.end(); } -void Kanagram::paintEvent(QPaintEvent *) +void Kanagram::paintEvent(TQPaintEvent *) { - QPixmap buf(width(), height()); - QPainter p(&buf); + TQPixmap buf(width(), height()); + TQPainter p(&buf); p.drawPixmap(0, 0, *m_back); @@ -222,10 +222,10 @@ void Kanagram::paintEvent(QPaintEvent *) //draw vocab switcher drawSwitcher(p, 9, 8); - p.setPen(QPen(black, 3)); + p.setPen(TQPen(black, 3)); //Draw the border of the input box - QRect borderRect = m_inputBox->geometry(); + TQRect borderRect = m_inputBox->geometry(); borderRect.setLeft(borderRect.left() - 2); borderRect.setTop(borderRect.top() - 2); borderRect.setWidth(borderRect.width() + 2 * 1); @@ -247,8 +247,8 @@ void Kanagram::paintEvent(QPaintEvent *) if(m_showHint) { p.drawPixmap(439, 204, *m_hintOverlay); - QFont f = QFont(m_font); - f.setWeight(QFont::Bold); + TQFont f = TQFont(m_font); + f.setWeight(TQFont::Bold); f.setPointSize(10); p.setFont(f); p.drawText(459, 217, 148, 67, WordBreak | AlignCenter, m_game->getHint()); @@ -298,10 +298,10 @@ void Kanagram::paintEvent(QPaintEvent *) bitBlt(this, 0, 0, &buf); } -void Kanagram::drawHelpText(QPainter &p, QString text) +void Kanagram::drawHelpText(TQPainter &p, TQString text) { p.save(); - QFont font = m_font; + TQFont font = m_font; font.setPointSize(12); p.setFont(font); p.rotate(-3.29); @@ -311,15 +311,15 @@ void Kanagram::drawHelpText(QPainter &p, QString text) p.restore(); } -void Kanagram::drawSwitcherText(QPainter &p, QString text) +void Kanagram::drawSwitcherText(TQPainter &p, TQString text) { p.save(); - QFont font = m_blackboardFont; + TQFont font = m_blackboardFont; font.setPointSize(14); - QFontMetrics fm(font); + TQFontMetrics fm(font); int width = fm.width(text); int height = fm.height(); - m_switcherRect = QRect(380 - width, 150 - height, width, height); + m_switcherRect = TQRect(380 - width, 150 - height, width, height); p.setFont(font); if(!m_overSwitcher) p.setPen(m_chalkColor); @@ -329,14 +329,14 @@ void Kanagram::drawSwitcherText(QPainter &p, QString text) p.restore(); } -void Kanagram::drawSwitcher(QPainter &p, const int xMargin, const int yMargin) +void Kanagram::drawSwitcher(TQPainter &p, const int xMargin, const int yMargin) { const int padding = 5; - QString text = m_game->getDocTitle(); - QFont font = m_blackboardFont; + TQString text = m_game->getDocTitle(); + TQFont font = m_blackboardFont; font.setPointSize(14); - QFontMetrics fm(font); - QRect r = innerRect(m_blackboardRect, xMargin, yMargin); + TQFontMetrics fm(font); + TQRect r = innerRect(m_blackboardRect, xMargin, yMargin); r.normalize(); r.moveBy(- padding - (m_overSwitcher ? m_arrowOver : m_arrow )->width(), yMargin); r.setHeight( (m_overSwitcher ? m_arrowOver : m_arrow )->height()); @@ -356,9 +356,9 @@ void Kanagram::drawSwitcher(QPainter &p, const int xMargin, const int yMargin) p.drawText(m_switcherRect, Qt::AlignVCenter|Qt::AlignRight, text); } -QRect Kanagram::innerRect(const QRect &rect, const int xMargin, const int yMargin) +TQRect Kanagram::innerRect(const TQRect &rect, const int xMargin, const int yMargin) { - QRect r = rect; + TQRect r = rect; if (xMargin>0) { @@ -374,7 +374,7 @@ QRect Kanagram::innerRect(const QRect &rect, const int xMargin, const int yMargi return r; } -void Kanagram::mousePressEvent(QMouseEvent *e) +void Kanagram::mousePressEvent(TQMouseEvent *e) { if (m_nextRect.contains(e->pos())) @@ -464,8 +464,8 @@ void Kanagram::mousePressEvent(QMouseEvent *e) if(m_inputBox->text().lower().stripWhiteSpace() == m_game->getWord()) { if(m_useSounds) play("right.ogg"); - m_inputBox->setPaletteBackgroundColor(QColor(0, 255, 0)); - QTimer::singleShot(1000, this, SLOT(resetInputBox())); + m_inputBox->setPaletteBackgroundColor(TQColor(0, 255, 0)); + TQTimer::singleShot(1000, this, TQT_SLOT(resetInputBox())); m_inputBox->clear(); hideHint(); m_game->nextAnagram(); @@ -474,20 +474,20 @@ void Kanagram::mousePressEvent(QMouseEvent *e) else { if(m_useSounds) play("wrong.ogg"); - m_inputBox->setPaletteBackgroundColor(QColor(255, 0, 0)); - QTimer::singleShot(1000, this, SLOT(resetInputBox())); + m_inputBox->setPaletteBackgroundColor(TQColor(255, 0, 0)); + TQTimer::singleShot(1000, this, TQT_SLOT(resetInputBox())); m_inputBox->clear(); update(); } } } -void Kanagram::mouseMoveEvent(QMouseEvent *e) +void Kanagram::mouseMoveEvent(TQMouseEvent *e) { updateButtonHighlighting(e->pos()); } -void Kanagram::updateButtonHighlighting(const QPoint &p) +void Kanagram::updateButtonHighlighting(const TQPoint &p) { bool haveToUpdate; haveToUpdate = false; @@ -671,22 +671,22 @@ void Kanagram::updateButtonHighlighting(const QPoint &p) if (haveToUpdate) update(); } -void Kanagram::drawText(QPainter &p, const QString &text, const QPoint ¢er, bool withMargin, int xMargin, int yMargin, QRect *rect, bool highlight, int fontSize) +void Kanagram::drawText(TQPainter &p, const TQString &text, const TQPoint ¢er, bool withMargin, int xMargin, int yMargin, TQRect *rect, bool highlight, int fontSize) { - QRect r; - QFont font = m_blackboardFont; + TQRect r; + TQFont font = m_blackboardFont; font.setPointSize(fontSize); font.setBold(true); p.setFont(font); - r = p.boundingRect(QRect(), Qt::AlignAuto, text); - r = QRect(0, 0, r.width() + xMargin, r.height() + yMargin); + r = p.boundingRect(TQRect(), Qt::AlignAuto, text); + r = TQRect(0, 0, r.width() + xMargin, r.height() + yMargin); r.moveBy(center.x() - r.width() / 2, center.y() - r.height() / 2); if (withMargin) { p.fillRect(r, m_fillColor); - p.setPen(QPen(black, 3)); + p.setPen(TQPen(black, 3)); p.drawRoundRect(r.left(), r.top(), r.width(), r.height(), 15, 15); } @@ -697,10 +697,10 @@ void Kanagram::drawText(QPainter &p, const QString &text, const QPoint ¢er, if(rect) *rect = r; } -void Kanagram::drawTextNew(QPainter &p, const QString &text, int textAlign, int xMargin, int yMargin, const QRect &rect, bool highlight, int fontSize) +void Kanagram::drawTextNew(TQPainter &p, const TQString &text, int textAlign, int xMargin, int yMargin, const TQRect &rect, bool highlight, int fontSize) { - QRect r = innerRect(rect, xMargin, yMargin); - QFont font = m_blackboardFont; + TQRect r = innerRect(rect, xMargin, yMargin); + TQFont font = m_blackboardFont; font.setPointSize(fontSize); font.setBold(true); p.setFont(font); @@ -709,7 +709,7 @@ void Kanagram::drawTextNew(QPainter &p, const QString &text, int textAlign, int if (withMargin) { p.fillRect(r, m_fillColor); - p.setPen(QPen(black, 3)); + p.setPen(TQPen(black, 3)); p.drawRoundRect(r.left(), r.top(), r.width(), r.height(), 15, 15); } @@ -722,16 +722,16 @@ void Kanagram::drawTextNew(QPainter &p, const QString &text, int textAlign, int void Kanagram::checkWord() { - QPoint p = m_upRect.topLeft() + QPoint( 1, 1 ); - QMouseEvent *e = new QMouseEvent( QEvent::MouseButtonPress, p, Qt::LeftButton, Qt::NoButton ); + TQPoint p = m_upRect.topLeft() + TQPoint( 1, 1 ); + TQMouseEvent *e = new TQMouseEvent( TQEvent::MouseButtonPress, p, Qt::LeftButton, Qt::NoButton ); mousePressEvent(e); } void Kanagram::randomHintImage() { unsigned long imageNum = m_randomImage.getLong(8); - QString dir = "images/eyes" + QString::number(imageNum + 1) + ".png"; - m_hintOverlay = new QPixmap(locate("appdata", dir)); + TQString dir = "images/eyes" + TQString::number(imageNum + 1) + ".png"; + m_hintOverlay = new TQPixmap(locate("appdata", dir)); } void Kanagram::showSettings() @@ -744,8 +744,8 @@ void Kanagram::showSettings() m_vocabSettings = new VocabSettings( configDialog ); configDialog->addPage( m_vocabSettings, i18n("Vocabularies"), "edit" ); configDialog->addPage( new NewStuff( configDialog ), i18n("New Stuff"), "knewstuff" ); - connect(configDialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); - connect(configDialog, SIGNAL(applyClicked()), this, SLOT(refreshVocabularies())); + connect(configDialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); + connect(configDialog, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(refreshVocabularies())); configDialog->exec(); delete configDialog; } @@ -774,7 +774,7 @@ void Kanagram::refreshVocabularies() m_vocabSettings->refreshView(); } -void Kanagram::play(QString filename) +void Kanagram::play(TQString filename) { #ifndef WITHOUT_ARTS KDE::PlayObject *playobj = m_artsFactory->createPlayObject(locate("appdata", "sounds/" + filename), true); diff --git a/kanagram/src/kanagram.h b/kanagram/src/kanagram.h index 689495b8..db39fccc 100644 --- a/kanagram/src/kanagram.h +++ b/kanagram/src/kanagram.h @@ -23,8 +23,8 @@ #include -#include -#include +#include +#include #include @@ -69,62 +69,62 @@ Q_OBJECT void refreshVocabularies(); private: - void drawText(QPainter &p, const QString &text, const QPoint ¢er, bool withMargin, int xMargin, int yMargin, QRect *rect, bool highlight, int fontSize = 18); - void drawTextNew(QPainter &p, const QString &text, int textAlign, int xMargin, int yMargin, const QRect &rect, bool highlight, int fontSize = 18); + void drawText(TQPainter &p, const TQString &text, const TQPoint ¢er, bool withMargin, int xMargin, int yMargin, TQRect *rect, bool highlight, int fontSize = 18); + void drawTextNew(TQPainter &p, const TQString &text, int textAlign, int xMargin, int yMargin, const TQRect &rect, bool highlight, int fontSize = 18); void setupRects(); - void play(QString filename); + void play(TQString filename); - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); - void mousePressEvent(QMouseEvent *e); + void mousePressEvent(TQMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); + void mouseMoveEvent(TQMouseEvent *e); - void updateButtonHighlighting(const QPoint &p); + void updateButtonHighlighting(const TQPoint &p); void randomHintImage(); void showSettings(); - void drawHelpText(QPainter &p, QString text); + void drawHelpText(TQPainter &p, TQString text); - void drawSwitcherText(QPainter &p, QString text); - void drawSwitcher(QPainter &p, const int xMargin, const int yMargin); + void drawSwitcherText(TQPainter &p, TQString text); + void drawSwitcher(TQPainter &p, const int xMargin, const int yMargin); - QRect innerRect(const QRect &rect, const int xMargin, const int yMargin); + TQRect innerRect(const TQRect &rect, const int xMargin, const int yMargin); KanagramGame *m_game; - QPixmap *m_back, *m_hintOverlay, *m_aboutKDEOverlay, *m_aboutAppOverlay, *m_handbookOverlay, *m_aboutKDEOverlayOver, *m_aboutAppOverlayOver, *m_handbookOverlayOver, *m_card, *m_arrow, *m_arrowOver, *m_next, *m_nextOver, *m_config, *m_configOver, *m_help, *m_helpOver, *m_quit, *m_quitOver, *m_up, *m_upOver, *m_upDisabled; + TQPixmap *m_back, *m_hintOverlay, *m_aboutKDEOverlay, *m_aboutAppOverlay, *m_handbookOverlay, *m_aboutKDEOverlayOver, *m_aboutAppOverlayOver, *m_handbookOverlayOver, *m_card, *m_arrow, *m_arrowOver, *m_next, *m_nextOver, *m_config, *m_configOver, *m_help, *m_helpOver, *m_quit, *m_quitOver, *m_up, *m_upOver, *m_upDisabled; //Deprecated - //QRect m_newWordRect, m_settingsRect, m_helpRect, m_quitRect; + //TQRect m_newWordRect, m_settingsRect, m_helpRect, m_quitRect; - QRect m_nextRect, m_configRect, m_helpRect, m_quitRect, m_revealRect, m_hintRect, m_upRect, m_aboutKDERect, m_aboutAppRect, m_handbookRect, m_switcherRect, m_arrowRect, m_logoRect, m_hintBoxRect, m_blackboardRect; + TQRect m_nextRect, m_configRect, m_helpRect, m_quitRect, m_revealRect, m_hintRect, m_upRect, m_aboutKDERect, m_aboutAppRect, m_handbookRect, m_switcherRect, m_arrowRect, m_logoRect, m_hintBoxRect, m_blackboardRect; bool m_overNext, m_overConfig, m_overHelp, m_overQuit, m_overReveal, m_overHint, m_overUp, m_overAboutKDE, m_overAboutApp, m_overHandbook, m_overSwitcher, m_overHintBox; bool m_showHint; - QColor m_fillColor, m_fontColor, m_fontHighlightColor, m_chalkColor, m_chalkHighlightColor; + TQColor m_fillColor, m_fontColor, m_fontHighlightColor, m_chalkColor, m_chalkHighlightColor; //Values for settings int m_hintHideTime; bool m_useSounds, m_useStandardFonts; - QFont m_blackboardFont, m_font; + TQFont m_blackboardFont, m_font; KHelpMenu *m_helpMenu; - QLineEdit *m_inputBox; + TQLineEdit *m_inputBox; VocabSettings *m_vocabSettings; KRandomSequence m_randomImage; - QTimer *m_hintTimer; + TQTimer *m_hintTimer; KArtsDispatcher *m_artsDispatcher; KArtsServer *m_artsServer; diff --git a/kanagram/src/kanagramgame.cpp b/kanagram/src/kanagramgame.cpp index 318c285e..67212168 100644 --- a/kanagram/src/kanagramgame.cpp +++ b/kanagram/src/kanagramgame.cpp @@ -20,7 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include +#include #include #include @@ -34,7 +34,7 @@ #include -KanagramGame::KanagramGame(QWidget* parent) : m_index(0) +KanagramGame::KanagramGame(TQWidget* parent) : m_index(0) { m_parent = parent; loadDefaultVocab(); @@ -46,8 +46,8 @@ KanagramGame::~KanagramGame() void KanagramGame::checkFile() { - if (!QFile::exists(locate("appdata", m_filename))) { - QString msg = i18n("File %1 cannot be found.\n Please ensure that Kanagram is properly installed.") + if (!TQFile::exists(locate("appdata", m_filename))) { + TQString msg = i18n("File %1 cannot be found.\n Please ensure that Kanagram is properly installed.") .arg(m_filename); KMessageBox::sorry(m_parent, msg, i18n("Error")); exit(0); @@ -148,12 +148,12 @@ void KanagramGame::nextAnagram() m_hint = doc->getEntry(wordNumber)->getRemark(0); } -QString KanagramGame::getDocTitle() +TQString KanagramGame::getDocTitle() { return m_docTitle; } -QString KanagramGame::getFilename() +TQString KanagramGame::getFilename() { if(m_fileList.empty()) return m_filename; @@ -161,17 +161,17 @@ QString KanagramGame::getFilename() return m_fileList[m_index]; } -QString KanagramGame::getAnagram() +TQString KanagramGame::getAnagram() { return m_anagram; } -QString KanagramGame::getHint() +TQString KanagramGame::getHint() { return m_hint; } -QString KanagramGame::getWord() +TQString KanagramGame::getWord() { return m_originalWord; } @@ -181,10 +181,10 @@ void KanagramGame::restoreWord() m_anagram = m_originalWord; } -QString KanagramGame::createAnagram(QString original) +TQString KanagramGame::createAnagram(TQString original) { - QStringList objData = QStringList::split(QString(""), original); - QString insaneData; + TQStringList objData = TQStringList::split(TQString(""), original); + TQString insaneData; int count; for(int i=0; count = objData.count(); i++) @@ -195,8 +195,8 @@ QString KanagramGame::createAnagram(QString original) else objChunk = m_random.getLong(count); - QStringList::Iterator it = objData.at(objChunk); - QString sd = *it; + TQStringList::Iterator it = objData.at(objChunk); + TQString sd = *it; objData.remove(it); if (insaneData.isEmpty()) insaneData = sd; diff --git a/kanagram/src/kanagramgame.h b/kanagram/src/kanagramgame.h index 940fbd57..cf14cea4 100644 --- a/kanagram/src/kanagramgame.h +++ b/kanagram/src/kanagramgame.h @@ -21,7 +21,7 @@ #ifndef KANAGRAMGAME_H #define KANAGRAMGAME_H -#include +#include #include #include @@ -32,7 +32,7 @@ class KanagramGame : public QObject { Q_OBJECT public: - KanagramGame(QWidget *parent); + KanagramGame(TQWidget *parent); ~KanagramGame(); void refreshVocabList(); void loadDefaultVocab(); @@ -40,26 +40,26 @@ Q_OBJECT void nextAnagram(); void nextVocab(); void previousVocab(); - QString getAnagram(); - QString getHint(); - QString getWord(); + TQString getAnagram(); + TQString getHint(); + TQString getWord(); void restoreWord(); - QString getDocTitle(); - QString getFilename(); + TQString getDocTitle(); + TQString getFilename(); private: - QString createAnagram(QString original); + TQString createAnagram(TQString original); void checkFile(); - QWidget *m_parent; + TQWidget *m_parent; KRandomSequence m_random; - QString m_anagram; - QString m_hint; - QString m_originalWord; + TQString m_anagram; + TQString m_hint; + TQString m_originalWord; int m_index; - QStringList m_fileList; - QStringList m_answeredWords; - QString m_docTitle; - QString m_filename; + TQStringList m_fileList; + TQStringList m_answeredWords; + TQString m_docTitle; + TQString m_filename; }; #endif diff --git a/kanagram/src/keduvocdocument.cpp b/kanagram/src/keduvocdocument.cpp index 1af38f5a..4bfe29fc 100644 --- a/kanagram/src/keduvocdocument.cpp +++ b/kanagram/src/keduvocdocument.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -44,7 +44,7 @@ using namespace std; // KEduVocDocument //******************************************************** -KEduVocDocument::KEduVocDocument(QObject * /*parent*/) +KEduVocDocument::KEduVocDocument(TQObject * /*parent*/) { Init(); } @@ -55,7 +55,7 @@ KEduVocDocument::~KEduVocDocument() } -void KEduVocDocument::setVersion (const QString & vers) +void KEduVocDocument::setVersion (const TQString & vers) { doc_version = vers; } @@ -99,12 +99,12 @@ bool KEduVocDocument::open(const KURL& url, bool /*append*/) if (!url.isEmpty()) doc_url = url; - // TODO EPT connect( this, SIGNAL(progressChanged(KEduVocDocument*,int)), parent, SLOT(slotProgress(KEduVocDocument*,int)) ); + // TODO EPT connect( this, TQT_SIGNAL(progressChanged(KEduVocDocument*,int)), parent, TQT_SLOT(slotProgress(KEduVocDocument*,int)) ); - QString tmpfile; + TQString tmpfile; if (KIO::NetAccess::download( url, tmpfile, 0 )) { - QFile f(tmpfile); + TQFile f(tmpfile); if (!f.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("Cannot open file
%1
").arg(url.path())); @@ -116,7 +116,7 @@ bool KEduVocDocument::open(const KURL& url, bool /*append*/) bool read = false; while (!read) { - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); switch (ft) { case kvtml: { @@ -127,21 +127,21 @@ bool KEduVocDocument::open(const KURL& url, bool /*append*/) case vt_lex: { - QTextStream is (&f); + TQTextStream is (&f); //TODO read = loadFromLex (is); } break; case vt_vcb: { - QTextStream is (&f); + TQTextStream is (&f); //TODO read = loadFromVcb (is); } break; case csv: { - QTextStream is(&f); + TQTextStream is(&f); //TODO read = loadFromCsv(is); } break; @@ -153,7 +153,7 @@ bool KEduVocDocument::open(const KURL& url, bool /*append*/) } } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (!read) { if (unknown_attr || unknown_elem ) { @@ -162,8 +162,8 @@ bool KEduVocDocument::open(const KURL& url, bool /*append*/) } // TODO new readers provide an explicite error message // the two messages should be merged - QString format = i18n("Could not load \"%1\"\nDo you want to try again?"); - QString msg = format.arg(url.path()); + TQString format = i18n("Could not load \"%1\"\nDo you want to try again?"); + TQString msg = format.arg(url.path()); int result = KMessageBox::warningContinueCancel(0, msg, kapp->makeStdCaption(i18n("I/O Failure")), i18n("&Retry")); @@ -180,9 +180,9 @@ bool KEduVocDocument::open(const KURL& url, bool /*append*/) } -bool KEduVocDocument::saveAs(QObject * /*parent*/, const KURL & url, FileType ft, const QString & generator) +bool KEduVocDocument::saveAs(TQObject * /*parent*/, const KURL & url, FileType ft, const TQString & generator) { -// connect( this, SIGNAL(progressChanged(KEduVocDocument*,int)), parent, SLOT(slotProgress(KEduVocDocument*,int)) ); +// connect( this, TQT_SIGNAL(progressChanged(KEduVocDocument*,int)), parent, TQT_SLOT(slotProgress(KEduVocDocument*,int)) ); KURL tmp (url); @@ -207,7 +207,7 @@ bool KEduVocDocument::saveAs(QObject * /*parent*/, const KURL & url, FileType ft while (!saved) { - QFile f(tmp.path()); + TQFile f(tmp.path()); if (!f.open(IO_WriteOnly)) { @@ -215,7 +215,7 @@ bool KEduVocDocument::saveAs(QObject * /*parent*/, const KURL & url, FileType ft return false; } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); switch (ft) { case kvtml: { KEduVocKvtmlWriter kvtmlWriter(&f); @@ -224,19 +224,19 @@ bool KEduVocDocument::saveAs(QObject * /*parent*/, const KURL & url, FileType ft break; case vt_lex: { - QTextStream os( &f ); // serialize using f + TQTextStream os( &f ); // serialize using f //TODO saved = saveToLex(os, title); } break; case vt_vcb: { - QTextStream os( &f ); // serialize using f + TQTextStream os( &f ); // serialize using f //TODO saved = saveToVcb(os, title); } break; case csv: { - QTextStream os( &f ); // serialize using f + TQTextStream os( &f ); // serialize using f //TODO saved = saveToCsv(os, title); } break; @@ -247,13 +247,13 @@ bool KEduVocDocument::saveAs(QObject * /*parent*/, const KURL & url, FileType ft break; } f.close(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (!saved) { // TODO new writers provide an explicite error message // the two messages should be merged - QString format = i18n("Could not save \"%1\"\nDo you want to try again?"); - QString msg = format.arg(tmp.path()); + TQString format = i18n("Could not save \"%1\"\nDo you want to try again?"); + TQString msg = format.arg(tmp.path()); int result = KMessageBox::warningContinueCancel(0, msg, kapp->makeStdCaption(i18n("I/O Failure")), i18n("&Retry")); @@ -283,9 +283,9 @@ void KEduVocDocument::removeEntry(int index) } -int KEduVocDocument::findIdent (const QString &lang) const +int KEduVocDocument::findIdent (const TQString &lang) const { - vector::const_iterator first = langs.begin(); + vector::const_iterator first = langs.begin(); int count = 0; while (first != langs.end()) { if ( *first == lang) @@ -297,7 +297,7 @@ int KEduVocDocument::findIdent (const QString &lang) const } -QString KEduVocDocument::getIdent (int index) const +TQString KEduVocDocument::getIdent (int index) const { if (index >= (int)langs.size() || index < 1 ) return ""; @@ -306,7 +306,7 @@ QString KEduVocDocument::getIdent (int index) const } -void KEduVocDocument::setIdent (int idx, const QString &id) +void KEduVocDocument::setIdent (int idx, const TQString &id) { if (idx < (int)langs.size() && idx >= 1 ) { langs[idx] = id; @@ -314,7 +314,7 @@ void KEduVocDocument::setIdent (int idx, const QString &id) } -QString KEduVocDocument::getTypeName (int index) const +TQString KEduVocDocument::getTypeName (int index) const { if (index >= (int)type_descr.size()) return ""; @@ -323,7 +323,7 @@ QString KEduVocDocument::getTypeName (int index) const } -void KEduVocDocument::setTypeName (int idx, QString &id) +void KEduVocDocument::setTypeName (int idx, TQString &id) { if (idx >= (int)type_descr.size()) for (int i = (int)type_descr.size(); i <= idx; i++) @@ -333,7 +333,7 @@ void KEduVocDocument::setTypeName (int idx, QString &id) } -QString KEduVocDocument::getTenseName (int index) const +TQString KEduVocDocument::getTenseName (int index) const { if (index >= (int)tense_descr.size()) return ""; @@ -342,7 +342,7 @@ QString KEduVocDocument::getTenseName (int index) const } -void KEduVocDocument::setTenseName (int idx, QString &id) +void KEduVocDocument::setTenseName (int idx, TQString &id) { if (idx >= (int)tense_descr.size()) for (int i = (int)tense_descr.size(); i <= idx; i++) @@ -352,7 +352,7 @@ void KEduVocDocument::setTenseName (int idx, QString &id) } -QString KEduVocDocument::getUsageName (int index) const +TQString KEduVocDocument::getUsageName (int index) const { if (index >= (int)usage_descr.size()) return ""; @@ -361,7 +361,7 @@ QString KEduVocDocument::getUsageName (int index) const } -void KEduVocDocument::setUsageName (int idx, QString &id) +void KEduVocDocument::setUsageName (int idx, TQString &id) { if (idx >= (int)usage_descr.size()) for (int i = (int)usage_descr.size(); i <= idx; i++) @@ -490,7 +490,7 @@ void KEduVocDocument::removeIdent (int index) } -QString KEduVocDocument::getOriginalIdent () const +TQString KEduVocDocument::getOriginalIdent () const { if (langs.size() > 0) return langs[0]; @@ -499,7 +499,7 @@ QString KEduVocDocument::getOriginalIdent () const } -void KEduVocDocument::setOriginalIdent (const QString &id) +void KEduVocDocument::setOriginalIdent (const TQString &id) { if (langs.size() > 0) { langs[0] = id; @@ -519,9 +519,9 @@ public: { return !dir - ? (QString::compare(x.getOriginal().upper(), + ? (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) < 0) - : (QString::compare(x.getOriginal().upper(), + : (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) > 0); } @@ -544,16 +544,16 @@ public: if (x.getLesson() != y.getLesson() ) return !dir - ? (QString::compare(doc.getLessonDescr(x.getLesson()).upper(), + ? (TQString::compare(doc.getLessonDescr(x.getLesson()).upper(), doc.getLessonDescr(y.getLesson()).upper() ) < 0) - : (QString::compare(doc.getLessonDescr(x.getLesson()).upper(), + : (TQString::compare(doc.getLessonDescr(x.getLesson()).upper(), doc.getLessonDescr(y.getLesson()).upper() ) > 0); else return !dir - ? (QString::compare(x.getOriginal().upper(), + ? (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) < 0) - : (QString::compare(x.getOriginal().upper(), + : (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) > 0); } @@ -582,9 +582,9 @@ public: else return !dir - ? (QString::compare(x.getOriginal().upper(), + ? (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) < 0) - : (QString::compare(x.getOriginal().upper(), + : (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) > 0); } @@ -606,9 +606,9 @@ public: { return !dir - ? (QString::compare(x.getTranslation(index).upper(), + ? (TQString::compare(x.getTranslation(index).upper(), y.getTranslation(index).upper() ) < 0) - : (QString::compare(x.getTranslation(index).upper(), + : (TQString::compare(x.getTranslation(index).upper(), y.getTranslation(index).upper() ) > 0); } @@ -686,7 +686,7 @@ void KEduVocDocument::setLeitnerSystemActive( bool yes ) void KEduVocDocument::createStandardLeitnerSystem() { LeitnerSystem* tmpSystem = new LeitnerSystem(); - QString name = "Standard"; + TQString name = "Standard"; tmpSystem->setSystemName( name ); tmpSystem->insertBox( "Box 1" ); @@ -792,7 +792,7 @@ void KEduVocDocument::resetEntry (int index, int lesson) } -QString KEduVocDocument::getLessonDescr(int idx) const +TQString KEduVocDocument::getLessonDescr(int idx) const { if (idx == 0) return i18n(""); @@ -830,7 +830,7 @@ void KEduVocDocument::setLessonsInQuery(vector lesson_iq) } -QString KEduVocDocument::getTitle() const +TQString KEduVocDocument::getTitle() const { if (doctitle.isEmpty()) return doc_url.fileName(); @@ -839,49 +839,49 @@ QString KEduVocDocument::getTitle() const } -QString KEduVocDocument::getAuthor() const +TQString KEduVocDocument::getAuthor() const { return author; } -QString KEduVocDocument::getLicense() const +TQString KEduVocDocument::getLicense() const { return license; } -QString KEduVocDocument::getDocRemark() const +TQString KEduVocDocument::getDocRemark() const { return doc_remark; } -void KEduVocDocument::setTitle(const QString & title) +void KEduVocDocument::setTitle(const TQString & title) { doctitle = title.stripWhiteSpace(); } -void KEduVocDocument::setAuthor(const QString & s) +void KEduVocDocument::setAuthor(const TQString & s) { author = s.stripWhiteSpace(); } -void KEduVocDocument::setLicense(const QString & s) +void KEduVocDocument::setLicense(const TQString & s) { license = s.stripWhiteSpace(); } -void KEduVocDocument::setDocRemark(const QString & s) +void KEduVocDocument::setDocRemark(const TQString & s) { doc_remark = s.stripWhiteSpace(); } -int KEduVocDocument::search(QString substr, int id, +int KEduVocDocument::search(TQString substr, int id, int first, int last, bool word_start, bool) @@ -929,12 +929,12 @@ int KEduVocDocument::search(QString substr, int id, #define _BITMASK 0x3F #define _BITUSED 6 -QString KEduVocDocument::compressDate(unsigned long l) const +TQString KEduVocDocument::compressDate(unsigned long l) const { if (l == 0) return ""; - QString res; + TQString res; if (l <= KVD_ZERO_TIME) l = 1; else @@ -948,7 +948,7 @@ QString KEduVocDocument::compressDate(unsigned long l) const } -unsigned long KEduVocDocument::decompressDate(QString s) const +unsigned long KEduVocDocument::decompressDate(TQString s) const { if (s.isEmpty()) return 0; @@ -964,13 +964,13 @@ unsigned long KEduVocDocument::decompressDate(QString s) const } -KEduVocDocument::FileType KEduVocDocument::detectFT(const QString &filename) +KEduVocDocument::FileType KEduVocDocument::detectFT(const TQString &filename) { - QFile f( filename ); + TQFile f( filename ); if (!f.open( IO_ReadOnly )) return csv; - QDataStream is( &f ); + TQDataStream is( &f ); Q_INT8 c1, c2, c3, c4, c5; is >> c1 @@ -979,8 +979,8 @@ KEduVocDocument::FileType KEduVocDocument::detectFT(const QString &filename) >> c4 >> c5; // guess filetype by first x bytes - QTextStream ts (&f); - QString line; + TQTextStream ts (&f); + TQString line; line = ts.readLine(); line.insert (0, c5); line.insert (0, c4); @@ -1017,9 +1017,9 @@ public: bool operator< (const expRef& y) const { - QString s1 = exp->getOriginal(); - QString s2 = y.exp->getOriginal(); - int cmp = QString::compare(s1.upper(), s2.upper()); + TQString s1 = exp->getOriginal(); + TQString s2 = y.exp->getOriginal(); + int cmp = TQString::compare(s1.upper(), s2.upper()); if (cmp != 0) return cmp < 0; @@ -1027,7 +1027,7 @@ public: s1 = exp->getTranslation(i); s2 = y.exp->getTranslation(i); - cmp = QString::compare(s1.upper(), s2.upper() ); + cmp = TQString::compare(s1.upper(), s2.upper() ); if (cmp != 0) return cmp < 0; } diff --git a/kanagram/src/keduvocdocument.h b/kanagram/src/keduvocdocument.h index 4e48e21b..e3b76a85 100644 --- a/kanagram/src/keduvocdocument.h +++ b/kanagram/src/keduvocdocument.h @@ -23,7 +23,7 @@ #include #endif -#include +#include #include @@ -266,7 +266,7 @@ class KEduVocDocument : public QObject * * @param obj calling object */ - KEduVocDocument(QObject* obj); + KEduVocDocument(TQObject* obj); /** Destructor for the fileclass of the application */ ~KEduVocDocument(); @@ -334,25 +334,25 @@ class KEduVocDocument : public QObject /** returns originals identifier */ - QString getOriginalIdent () const; + TQString getOriginalIdent () const; /** set originals identifier */ - void setOriginalIdent (const QString &id); + void setOriginalIdent (const TQString &id); /** returns identifier of translation x * * @param index number of translation 1..x * @result ident string: de=german, en=englisch, .. */ - QString getIdent (int index) const; + TQString getIdent (int index) const; /** sets identifier of translation * * @param index number of translation 1..x * @param lang ident string: de=german, en=englisch, .. */ - void setIdent (int index, const QString &lang); + void setIdent (int index, const TQString &lang); /** removes identifier an the according translation in all entries * @@ -365,67 +365,67 @@ class KEduVocDocument : public QObject * @param lang identifier of language * @result index of translation, 0=original, -1=none */ - int findIdent (const QString &lang) const; + int findIdent (const TQString &lang) const; /** returns attribute string * * @param index number of attribute * @result string */ - QString getTypeName (int index) const; + TQString getTypeName (int index) const; /** sets attribute string * * @param index number of attribute * @param str name of attribute */ - void setTypeName (int index, QString &str); + void setTypeName (int index, TQString &str); /** gets descr of types */ - inline vector getTypeDescr() const { return type_descr; } + inline vector getTypeDescr() const { return type_descr; } /** sets descr of types */ - inline void setTypeDescr(vector names) { type_descr = names; } + inline void setTypeDescr(vector names) { type_descr = names; } /** returns tense string * * @param index number of tense * @result string */ - QString getTenseName (int index) const; + TQString getTenseName (int index) const; /** sets tense string * * @param index number of tense * @param str name of tense */ - void setTenseName (int index, QString &str); + void setTenseName (int index, TQString &str); /** gets descr of tenses */ - inline vector getTenseDescr() const { return tense_descr; } + inline vector getTenseDescr() const { return tense_descr; } /** sets descr of tenses */ - inline void setTenseDescr(vector names) { tense_descr = names; } + inline void setTenseDescr(vector names) { tense_descr = names; } /** returns usage string * * @param index number of usage * @result string */ - QString getUsageName (int index) const; + TQString getUsageName (int index) const; /** sets usage string * * @param index number of usage * @param str name of usage */ - void setUsageName (int index, QString &str); + void setUsageName (int index, TQString &str); /** gets descr of usages */ - inline vector getUsageDescr() const { return usage_descr; } + inline vector getUsageDescr() const { return usage_descr; } /** sets descr of usages */ - inline void setUsageDescr(vector names) { usage_descr = names; } + inline void setUsageDescr(vector names) { usage_descr = names; } /** open a document file * @@ -439,7 +439,7 @@ class KEduVocDocument : public QObject * @param url if url is empty (or NULL) actual name is preserved * @result true if successful */ - bool saveAs(QObject *parent, const KURL & url, FileType ft, const QString & generator); + bool saveAs(TQObject *parent, const KURL & url, FileType ft, const TQString & generator); /** returns count of entries */ @@ -459,7 +459,7 @@ class KEduVocDocument : public QObject /** append new lang ident */ - inline void appendLang(const QString & id) { langs.push_back(id); } + inline void appendLang(const TQString & id) { langs.push_back(id); } /** returns pointer to expression object x * @@ -479,7 +479,7 @@ class KEduVocDocument : public QObject * @param tolerant * @result index of found entry, -1 if none */ - int search(QString substr, int id, + int search(TQString substr, int id, int first=0, int last=-1, bool word_start = false, bool tolerant=false); /** returns url of xml file */ @@ -489,34 +489,34 @@ class KEduVocDocument : public QObject inline void setURL(const KURL& url) {doc_url = url;} /** returns title of xml file */ - QString getTitle() const; + TQString getTitle() const; /** returns author of file */ - QString getAuthor() const; + TQString getAuthor() const; /** returns license of file */ - QString getLicense() const; + TQString getLicense() const; /** returns remark of file */ - QString getDocRemark() const; + TQString getDocRemark() const; - inline void getQueryLang(QString &org, QString &trans) const + inline void getQueryLang(TQString &org, TQString &trans) const { org = queryorg; trans = querytrans; } - inline void setQueryLang(const QString &org, const QString &trans) + inline void setQueryLang(const TQString &org, const TQString &trans) { queryorg = org; querytrans = trans; } /** sets title of xml file */ - void setTitle(const QString & title); + void setTitle(const TQString & title); /** sets author of file */ - void setAuthor(const QString & author); + void setAuthor(const TQString & author); /** sets license of file */ - void setLicense(const QString & license); + void setLicense(const TQString & license); /** sets remark of file */ - void setDocRemark(const QString & rem); + void setDocRemark(const TQString & rem); /** gets version of loaded file */ void getVersion(int &major, int &minor, int &patch); @@ -530,7 +530,7 @@ class KEduVocDocument : public QObject inline void setCurrentLesson(int lesson) { current_lesson = lesson; } /** returns descr of lesson */ - QString getLessonDescr(int index) const; + TQString getLessonDescr(int index) const; /** returns lessons in current query */ vector getLessonsInQuery() const; @@ -538,12 +538,12 @@ class KEduVocDocument : public QObject /** sets lessons in current query */ void setLessonsInQuery(vector); - inline vector getLessonDescr() const { return lesson_descr; } + inline vector getLessonDescr() const { return lesson_descr; } inline int numLessons () const {return (int) lesson_descr.size(); } /** sets descr of lesson */ - inline void setLessonDescr(vector names) { lesson_descr = names; } + inline void setLessonDescr(vector names) { lesson_descr = names; } /** returns pointer to conjugations if available * @@ -572,10 +572,10 @@ class KEduVocDocument : public QObject void setArticle(int index, const Article &art); /** compress date */ - QString compressDate(unsigned long) const; + TQString compressDate(unsigned long) const; /** decompress date */ - unsigned long decompressDate(QString) const; + unsigned long decompressDate(TQString) const; /** returns recommended size * @@ -597,16 +597,16 @@ class KEduVocDocument : public QObject void setLeitnerSystem( LeitnerSystem* system ); LeitnerSystem* getLeitnerSystem(); - bool unknownAttribute (int line, const QString &name, const QString &attr); - void unknownElement (int line, const QString &elem ); - void errorKvtMl (int line, const QString &text ); - void warningKvtMl (int line, const QString &text ); + bool unknownAttribute (int line, const TQString &name, const TQString &attr); + void unknownElement (int line, const TQString &elem ); + void errorKvtMl (int line, const TQString &text ); + void warningKvtMl (int line, const TQString &text ); - void errorLex (int line, const QString &text ); + void errorLex (int line, const TQString &text ); - void errorCsv (int line, const QString &text ); + void errorCsv (int line, const TQString &text ); - FileType detectFT(const QString &filename); + FileType detectFT(const TQString &filename); friend class QueryManager; @@ -619,30 +619,30 @@ protected: void Init(); /** sets version of loaded file */ - void setVersion(const QString & ver); + void setVersion(const TQString & ver); /* TODO - bool saveToLex (QTextStream& os, QString &title); - bool loadFromLex (QTextStream& is); - bool loadLessonLex (QTextStream& is); - bool saveLessonLex (QTextStream& os); - bool saveTypeNameLex (QTextStream& os); - bool loadTypeNameLex (QTextStream& is); - - bool saveToCsv (QTextStream& os, QString &title); - bool loadFromCsv (QTextStream& is); - bool loadLessonCsv (QTextStream& is); - bool saveLessonCsv (QTextStream& os); - bool saveTypeNameCsv (QTextStream& os); - bool loadTypeNameCsv (QTextStream& is); - - bool saveTypeNameVcb (QTextStream &os); - bool loadTypeNameVcb (QTextStream &is); - bool saveLessonVcb (QTextStream &os); - bool loadLessonVcb (QTextStream &is); - bool saveToVcb (QTextStream& os, QString &title); - bool loadFromVcb (QTextStream& is); - void errorVcb (int line, const QString &text ); + bool saveToLex (TQTextStream& os, TQString &title); + bool loadFromLex (TQTextStream& is); + bool loadLessonLex (TQTextStream& is); + bool saveLessonLex (TQTextStream& os); + bool saveTypeNameLex (TQTextStream& os); + bool loadTypeNameLex (TQTextStream& is); + + bool saveToCsv (TQTextStream& os, TQString &title); + bool loadFromCsv (TQTextStream& is); + bool loadLessonCsv (TQTextStream& is); + bool saveLessonCsv (TQTextStream& os); + bool saveTypeNameCsv (TQTextStream& os); + bool loadTypeNameCsv (TQTextStream& is); + + bool saveTypeNameVcb (TQTextStream &os); + bool loadTypeNameVcb (TQTextStream &is); + bool saveLessonVcb (TQTextStream &os); + bool loadLessonVcb (TQTextStream &is); + bool saveToVcb (TQTextStream& os, TQString &title); + bool loadFromVcb (TQTextStream& is); + void errorVcb (int line, const TQString &text ); */ private: @@ -655,26 +655,26 @@ protected: bool sort_allowed; // save these to document - vector langs; //0= origin, 1,.. translations + vector langs; //0= origin, 1,.. translations int cols, lines; int current_lesson; vector extraSizehints; vector sizehints; - QString generator; - QString queryorg, + TQString generator; + TQString queryorg, querytrans; vector vocabulary; vector lessons_in_query; - vector lesson_descr; - vector type_descr; - vector tense_descr; - vector usage_descr; - QString doctitle; - QString author; - QString license; - QString doc_remark; - QString doc_version; + vector lesson_descr; + vector type_descr; + vector tense_descr; + vector usage_descr; + TQString doctitle; + TQString author; + TQString license; + TQString doc_remark; + TQString doc_version; vector
articles; vector conjugations; diff --git a/kanagram/src/keduvocexpression.cpp b/kanagram/src/keduvocexpression.cpp index 9ac29894..8d01c8ba 100644 --- a/kanagram/src/keduvocexpression.cpp +++ b/kanagram/src/keduvocexpression.cpp @@ -34,7 +34,7 @@ void KEduVocExpression::Init() } -KEduVocExpression::KEduVocExpression (QString &expr, int _lesson) +KEduVocExpression::KEduVocExpression (TQString &expr, int _lesson) { Init(); setOriginal(expr.stripWhiteSpace() ); @@ -48,10 +48,10 @@ KEduVocExpression::KEduVocExpression () } -KEduVocExpression::KEduVocExpression (QString &s, QString separator, int _lesson) +KEduVocExpression::KEduVocExpression (TQString &s, TQString separator, int _lesson) { Init(); - QString se; + TQString se; lesson = _lesson; if (separator.length() ) { @@ -90,7 +90,7 @@ int KEduVocExpression::numTranslations() const } -QString KEduVocExpression::getRemark (int idx) const +TQString KEduVocExpression::getRemark (int idx) const { if (idx >= (int)remarks.size() || idx < 0) { return ""; @@ -101,7 +101,7 @@ QString KEduVocExpression::getRemark (int idx) const } -void KEduVocExpression::setRemark (int idx, const QString & expr) +void KEduVocExpression::setRemark (int idx, const TQString & expr) { if ( idx < 0) return; @@ -114,7 +114,7 @@ void KEduVocExpression::setRemark (int idx, const QString & expr) } -void KEduVocExpression::setFauxAmi (int idx, const QString & expr, bool rev_ami) +void KEduVocExpression::setFauxAmi (int idx, const TQString & expr, bool rev_ami) { if (idx < 1) return; @@ -138,7 +138,7 @@ void KEduVocExpression::setFauxAmi (int idx, const QString & expr, bool rev_ami) } -QString KEduVocExpression::getFauxAmi (int idx, bool rev_ami) const +TQString KEduVocExpression::getFauxAmi (int idx, bool rev_ami) const { if (rev_ami) { if (idx >= (int)rev_fauxAmi.size() || idx < 1 ) { @@ -156,7 +156,7 @@ QString KEduVocExpression::getFauxAmi (int idx, bool rev_ami) const } -void KEduVocExpression::setSynonym (int idx, const QString & expr) +void KEduVocExpression::setSynonym (int idx, const TQString & expr) { if ( idx < 0) return; @@ -169,7 +169,7 @@ void KEduVocExpression::setSynonym (int idx, const QString & expr) } -QString KEduVocExpression::getSynonym (int idx) const +TQString KEduVocExpression::getSynonym (int idx) const { if (idx >= (int)synonym.size() || idx < 0) { return ""; @@ -180,7 +180,7 @@ QString KEduVocExpression::getSynonym (int idx) const } -void KEduVocExpression::setExample (int idx, const QString & expr) +void KEduVocExpression::setExample (int idx, const TQString & expr) { if ( idx < 0) return; @@ -193,7 +193,7 @@ void KEduVocExpression::setExample (int idx, const QString & expr) } -QString KEduVocExpression::getExample (int idx) const +TQString KEduVocExpression::getExample (int idx) const { if (idx >= (int)example.size() || idx < 0) { return ""; @@ -204,7 +204,7 @@ QString KEduVocExpression::getExample (int idx) const } -void KEduVocExpression::setUsageLabel (int idx, const QString & expr) +void KEduVocExpression::setUsageLabel (int idx, const TQString & expr) { if ( idx < 0) return; @@ -217,7 +217,7 @@ void KEduVocExpression::setUsageLabel (int idx, const QString & expr) } -QString KEduVocExpression::getUsageLabel (int idx) const +TQString KEduVocExpression::getUsageLabel (int idx) const { if (idx >= (int)usageLabels.size() || idx < 0) { return ""; @@ -228,7 +228,7 @@ QString KEduVocExpression::getUsageLabel (int idx) const } -void KEduVocExpression::setParaphrase (int idx, const QString & expr) +void KEduVocExpression::setParaphrase (int idx, const TQString & expr) { if ( idx < 0) return; @@ -241,7 +241,7 @@ void KEduVocExpression::setParaphrase (int idx, const QString & expr) } -QString KEduVocExpression::getParaphrase (int idx) const +TQString KEduVocExpression::getParaphrase (int idx) const { if (idx >= (int)paraphrases.size() || idx < 0) { return ""; @@ -252,7 +252,7 @@ QString KEduVocExpression::getParaphrase (int idx) const } -void KEduVocExpression::setAntonym (int idx, const QString & expr) +void KEduVocExpression::setAntonym (int idx, const TQString & expr) { if ( idx < 0) return; @@ -265,7 +265,7 @@ void KEduVocExpression::setAntonym (int idx, const QString & expr) } -QString KEduVocExpression::getAntonym (int idx) const +TQString KEduVocExpression::getAntonym (int idx) const { if (idx >= (int)antonym.size() || idx < 0) { return ""; @@ -348,7 +348,7 @@ MultipleChoice KEduVocExpression::getMultipleChoice (int idx) const } -QString KEduVocExpression::getPronunce (int idx) const +TQString KEduVocExpression::getPronunce (int idx) const { if (idx >= (int)pronunces.size() || idx < 0) { return ""; @@ -359,7 +359,7 @@ QString KEduVocExpression::getPronunce (int idx) const } -void KEduVocExpression::setPronunce (int idx, const QString & expr) +void KEduVocExpression::setPronunce (int idx, const TQString & expr) { if ( idx < 0) return; @@ -372,7 +372,7 @@ void KEduVocExpression::setPronunce (int idx, const QString & expr) } -void KEduVocExpression::addTranslation (QString expr, +void KEduVocExpression::addTranslation (TQString expr, grade_t grade, grade_t rev_grade) { if (grade > KV_MAX_GRADE) @@ -387,7 +387,7 @@ void KEduVocExpression::addTranslation (QString expr, } -QString KEduVocExpression::getTranslation (int idx) const +TQString KEduVocExpression::getTranslation (int idx) const { if (idx > (int)translations.size() || idx < 1) return ""; @@ -466,7 +466,7 @@ void KEduVocExpression::removeTranslation (int idx) } -void KEduVocExpression::setTranslation (int idx, const QString & expr) +void KEduVocExpression::setTranslation (int idx, const TQString & expr) { if ( idx <= 0) return; @@ -480,9 +480,9 @@ void KEduVocExpression::setTranslation (int idx, const QString & expr) } -QString KEduVocExpression::gradeStr (int idx, bool rev_grade) const +TQString KEduVocExpression::gradeStr (int idx, bool rev_grade) const { - QString s; + TQString s; s.setNum(getGrade(idx, rev_grade)); return s; } @@ -724,7 +724,7 @@ void KEduVocExpression::setQueryDate (int idx, time_t date, bool rev_date) bool KEduVocExpression::uniqueType () const { bool unique = true; - QString type0 = getType(0); + TQString type0 = getType(0); for (int i = 1; i < numTranslations(); i++) if (type0 != getType(i) ) unique = false; @@ -732,7 +732,7 @@ bool KEduVocExpression::uniqueType () const } -QString KEduVocExpression::getType (int idx) const +TQString KEduVocExpression::getType (int idx) const { if (idx >= (int)exprtypes.size() || idx < 0) { return ""; @@ -760,13 +760,13 @@ void KEduVocExpression::incBadCount (int index, bool rev_count) } -void KEduVocExpression::setOriginal ( const QString & expr) +void KEduVocExpression::setOriginal ( const TQString & expr) { origin = expr; } -QString KEduVocExpression::getOriginal () const +TQString KEduVocExpression::getOriginal () const { return origin; } @@ -778,7 +778,7 @@ void KEduVocExpression::setLesson (int l) } -void KEduVocExpression::setType (int idx, const QString &type) +void KEduVocExpression::setType (int idx, const TQString &type) { if ( idx < 0) return; diff --git a/kanagram/src/keduvocexpression.h b/kanagram/src/keduvocexpression.h index 64b2233b..eb3ac4ec 100644 --- a/kanagram/src/keduvocexpression.h +++ b/kanagram/src/keduvocexpression.h @@ -72,20 +72,20 @@ class KEduVocExpression KEduVocExpression (); - KEduVocExpression (QString &s, QString separator, int lesson = 0); + KEduVocExpression (TQString &s, TQString separator, int lesson = 0); /** Constructor for an expression in different languages * * @param expr expression */ - KEduVocExpression (QString &expr, int lesson = 0); + KEduVocExpression (TQString &expr, int lesson = 0); /** adds a new translation of this entry * @param expr translation * @param grade grade of knowledge of this translation * @param rev_grade dito, in opposite direction */ - void addTranslation (QString expr, grade_t grade=KV_NORM_GRADE, + void addTranslation (TQString expr, grade_t grade=KV_NORM_GRADE, grade_t rev_grade=KV_NORM_GRADE); /** removes translation @@ -104,11 +104,11 @@ class KEduVocExpression /** returns original expression of this entry */ - QString getOriginal () const; + TQString getOriginal () const; /** sets original expression of this entry */ - void setOriginal (const QString & expr); + void setOriginal (const TQString & expr); /** returns number of max. translations of all expressions */ @@ -135,42 +135,42 @@ class KEduVocExpression * @param index number of translation * @result expression or "" if no translation available */ - QString getTranslation (int index) const; + TQString getTranslation (int index) const; /** sets translation of this expression * * @param index number of translation * @param expr expression of this index */ - void setTranslation (int index, const QString & expr); + void setTranslation (int index, const TQString & expr); /** sets remark of this expression * * @param index index of expression * @param expr remark of this index */ - void setPronunce (int index, const QString & expr); + void setPronunce (int index, const TQString & expr); /** returns pronunciation of this expression * * @param index index of expression * @result pronunciation or "" if none available */ - QString getPronunce (int index) const; + TQString getPronunce (int index) const; /** returns remarks of this expression * * @param index index of expression * @result remark or "" if no remark available */ - QString getRemark (int index) const; + TQString getRemark (int index) const; /** sets remark of this expression * * @param index index of expression * @param expr remark of this index */ - void setRemark (int index, const QString & expr); + void setRemark (int index, const TQString & expr); /** sets false friend of this expression @@ -179,7 +179,7 @@ class KEduVocExpression * @param expr false friend of this index * @param rev_grade dito, in opposite direction */ - void setFauxAmi (int index, const QString & expr, bool rev_ami = false); + void setFauxAmi (int index, const TQString & expr, bool rev_ami = false); /** returns false friend of this expression @@ -188,14 +188,14 @@ class KEduVocExpression * @param rev_grade dito, in opposite direction * @result false friend or "" if no string available */ - QString getFauxAmi (int index, bool rev_ami = false) const; + TQString getFauxAmi (int index, bool rev_ami = false) const; /** sets synonym this expression * * @param index index of expression * @param expr synonym of this index */ - void setSynonym (int index, const QString & expr); + void setSynonym (int index, const TQString & expr); /** returns synonym of this expression @@ -203,14 +203,14 @@ class KEduVocExpression * @param index index of expression * @result synonym or "" if no string available */ - QString getSynonym (int index) const; + TQString getSynonym (int index) const; /** sets example this expression * * @param index index of expression * @param expr example of this index */ - void setExample (int index, const QString & expr); + void setExample (int index, const TQString & expr); /** returns example of this expression @@ -218,14 +218,14 @@ class KEduVocExpression * @param index index of expression * @result example or "" if no string available */ - QString getExample (int index) const; + TQString getExample (int index) const; /** sets usage label this expression * * @param index index of expression * @param usage usage label of this index */ - void setUsageLabel (int index, const QString & usage); + void setUsageLabel (int index, const TQString & usage); /** returns usage label of this expression @@ -233,14 +233,14 @@ class KEduVocExpression * @param index index of expression * @result usage or "" if no string available */ - QString getUsageLabel (int index) const; + TQString getUsageLabel (int index) const; /** sets paraphrase of this expression * * @param index index of expression * @param usage paraphrase of this index */ - void setParaphrase (int index, const QString & usage); + void setParaphrase (int index, const TQString & usage); /** returns paraphrase of this expression @@ -248,14 +248,14 @@ class KEduVocExpression * @param index index of expression * @result paraphrase or "" if no string available */ - QString getParaphrase (int index) const; + TQString getParaphrase (int index) const; /** sets antonym this expression * * @param index index of expression * @param expr antonym of this index */ - void setAntonym (int index, const QString & expr); + void setAntonym (int index, const TQString & expr); /** returns antonym of this expression @@ -263,13 +263,13 @@ class KEduVocExpression * @param index index of expression * @result antonym or "" if no string available */ - QString getAntonym (int index) const; + TQString getAntonym (int index) const; /** returns type of this expression * * @result type or "" if no type available */ - QString getType (int index) const; + TQString getType (int index) const; /** all langs have same type ? * @@ -282,7 +282,7 @@ class KEduVocExpression * @param index index of type * @param type type of this expression ("" = none) */ - void setType (int index, const QString &type); + void setType (int index, const TQString &type); /** returns grade of given translation as string * @@ -290,7 +290,7 @@ class KEduVocExpression * @param rev_grade dito, in opposite direction * @result number of knowlegde: 0=known, x=numbers not knows */ - QString gradeStr (int index, bool rev_grade = false) const; + TQString gradeStr (int index, bool rev_grade = false) const; /** sets grade of given translation * @@ -421,20 +421,20 @@ class KEduVocExpression void Init(); private: - QString origin; + TQString origin; // all these vectors must be deleted in removeTranslation() - vector exprtypes; - vector translations; - vector remarks; - vector usageLabels; - vector paraphrases; - vector fauxAmi; - vector rev_fauxAmi; - vector synonym; - vector example; - vector antonym; - vector pronunces; + vector exprtypes; + vector translations; + vector remarks; + vector usageLabels; + vector paraphrases; + vector fauxAmi; + vector rev_fauxAmi; + vector synonym; + vector example; + vector antonym; + vector pronunces; vector grades; vector rev_grades; vector qcounts; diff --git a/kanagram/src/keduvockvtmlreader.cpp b/kanagram/src/keduvockvtmlreader.cpp index 13e6f53a..fc1441f6 100644 --- a/kanagram/src/keduvockvtmlreader.cpp +++ b/kanagram/src/keduvockvtmlreader.cpp @@ -21,13 +21,13 @@ #include #include -#include -#include +#include +#include #include "keduvockvtmlreader.h" #include "keduvocdocument.h" -KEduVocKvtmlReader::KEduVocKvtmlReader(QFile *file) +KEduVocKvtmlReader::KEduVocKvtmlReader(TQFile *file) { // the file must be already open m_inputFile = file; @@ -38,16 +38,16 @@ KEduVocKvtmlReader::~KEduVocKvtmlReader() } -bool KEduVocKvtmlReader::readLesson(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readLesson(TQDomElement &domElementParent) { - QString s; + TQString s; m_doc->lesson_descr.clear(); //------------------------------------------------------------------------- // Attributes //------------------------------------------------------------------------- - QDomAttr domAttrWidth = domElementParent.attributeNode(KV_SIZEHINT); + TQDomAttr domAttrWidth = domElementParent.attributeNode(KV_SIZEHINT); if (!domAttrWidth.isNull()) m_doc->setSizeHint(-1, domAttrWidth.value().toInt()); @@ -55,7 +55,7 @@ bool KEduVocKvtmlReader::readLesson(QDomElement &domElementParent) // Children //------------------------------------------------------------------------- - QDomElement domElementChild = domElementParent.firstChild().toElement(); + TQDomElement domElementChild = domElementParent.firstChild().toElement(); while (!domElementChild.isNull()) { @@ -67,18 +67,18 @@ bool KEduVocKvtmlReader::readLesson(QDomElement &domElementParent) int no = 0; bool isCurr = false; - QDomAttr domAttrNo = domElementChild.attributeNode(KV_LESS_NO); + TQDomAttr domAttrNo = domElementChild.attributeNode(KV_LESS_NO); if (!domAttrNo.isNull()) no = domAttrNo.value().toInt(); - QDomAttr domAttrCurrent = domElementChild.attributeNode(KV_LESS_CURR); + TQDomAttr domAttrCurrent = domElementChild.attributeNode(KV_LESS_CURR); if (!domAttrCurrent.isNull()) isCurr = domAttrCurrent.value().toInt() != 0; if (isCurr && no != 0) m_doc->setCurrentLesson(no); - QDomAttr domAttrQuery = domElementChild.attributeNode(KV_LESS_QUERY); + TQDomAttr domAttrQuery = domElementChild.attributeNode(KV_LESS_QUERY); if (!domAttrQuery.isNull()) m_doc->lessons_in_query.push_back(domAttrQuery.value().toInt() != 0); else @@ -105,7 +105,7 @@ bool KEduVocKvtmlReader::readLesson(QDomElement &domElementParent) } -bool KEduVocKvtmlReader::readArticle(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readArticle(TQDomElement &domElementParent) /*
lang determines also lang order in entries !! @@ -122,10 +122,10 @@ bool KEduVocKvtmlReader::readArticle(QDomElement &domElementParent) bool endOfGroup = false; bool inEntry = false; int count = 0; - QString s; + TQString s; m_doc->articles.clear(); - QDomElement domElementEntry = domElementParent.firstChild().toElement(); + TQDomElement domElementEntry = domElementParent.firstChild().toElement(); while (!domElementEntry.isNull()) { @@ -138,8 +138,8 @@ bool KEduVocKvtmlReader::readArticle(QDomElement &domElementParent) //---------- // Attribute - QString lang; - QDomAttr domAttrLang = domElementEntry.attributeNode(KV_LANG); + TQString lang; + TQDomAttr domAttrLang = domElementEntry.attributeNode(KV_LANG); if ((int)m_doc->langs.size() <= count) { @@ -163,14 +163,14 @@ bool KEduVocKvtmlReader::readArticle(QDomElement &domElementParent) //--------- // Children - QString fem_def = ""; - QString mal_def = ""; - QString nat_def = ""; - QString fem_indef = ""; - QString mal_indef = ""; - QString nat_indef = ""; + TQString fem_def = ""; + TQString mal_def = ""; + TQString nat_def = ""; + TQString fem_indef = ""; + TQString mal_indef = ""; + TQString nat_indef = ""; - QDomElement domElementEntryChild = domElementEntry.firstChild().toElement(); + TQDomElement domElementEntryChild = domElementEntry.firstChild().toElement(); while (!domElementEntryChild.isNull()) { if (domElementEntryChild.tagName() == KV_ART_FD) @@ -230,9 +230,9 @@ bool KEduVocKvtmlReader::readArticle(QDomElement &domElementParent) } -bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, +bool KEduVocKvtmlReader::readConjug(TQDomElement &domElementParent, vector &curr_conjug, - const QString &entry_tag) + const TQString &entry_tag) /* used in header for definiton of "prefix" lang determines also lang order in entries !! @@ -265,13 +265,13 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, */ { - QString s; + TQString s; curr_conjug.clear(); bool p3_common, s3_common; - QString pers1_sing, + TQString pers1_sing, pers2_sing, pers3_m_sing, pers3_f_sing, @@ -282,12 +282,12 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, pers3_f_plur, pers3_n_plur; - QString lang; - QString type; + TQString lang; + TQString type; int count = 0; curr_conjug.push_back(Conjugation()); - QDomElement domElementConjugChild = domElementParent.firstChild().toElement(); + TQDomElement domElementConjugChild = domElementParent.firstChild().toElement(); while (!domElementConjugChild.isNull()) { if (domElementConjugChild.tagName() == KV_CON_ENTRY) @@ -297,8 +297,8 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, //---------- // Attribute - QString lang; - QDomAttr domAttrLang = domElementConjugChild.attributeNode(KV_LANG); + TQString lang; + TQDomAttr domAttrLang = domElementConjugChild.attributeNode(KV_LANG); if ((int)m_doc->langs.size() <= count) { @@ -324,7 +324,7 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, //---------- // Attribute - QDomAttr domAttrLang = domElementConjugChild.attributeNode(KV_CON_NAME); + TQDomAttr domAttrLang = domElementConjugChild.attributeNode(KV_CON_NAME); type = domAttrLang.value(); if (type.isNull()) type = ""; @@ -335,7 +335,7 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, if( num > (int) m_doc->tense_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = m_doc->tense_descr.size(); i < num; i++) { s.setNum (i+1); @@ -359,7 +359,7 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, p3_common = false; s3_common = false; - QDomElement domElementConjugGrandChild = domElementConjugChild.firstChild().toElement(); + TQDomElement domElementConjugGrandChild = domElementConjugChild.firstChild().toElement(); while (!domElementConjugGrandChild.isNull()) { if (domElementConjugGrandChild.tagName() == KV_CON_P1S) @@ -376,7 +376,7 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, } else if (domElementConjugGrandChild.tagName() == KV_CON_P3SF) { - QDomAttr domAttrCommon = domElementConjugGrandChild.attributeNode(KV_CONJ_COMMON); + TQDomAttr domAttrCommon = domElementConjugGrandChild.attributeNode(KV_CONJ_COMMON); if (!domAttrCommon.isNull()) s3_common = domAttrCommon.value().toInt(); // returns 0 if the conversion fails @@ -410,7 +410,7 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, } else if (domElementConjugGrandChild.tagName() == KV_CON_P3PF) { - QDomAttr domAttrCommon = domElementConjugGrandChild.attributeNode(KV_CONJ_COMMON); + TQDomAttr domAttrCommon = domElementConjugGrandChild.attributeNode(KV_CONJ_COMMON); if (!domAttrCommon.isNull()) p3_common = domAttrCommon.value().toInt(); // returns 0 if the conversion fails @@ -466,15 +466,15 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, } -bool KEduVocKvtmlReader::readOptions(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readOptions(TQDomElement &domElementParent) { - QDomElement domElementSort = domElementParent.firstChild().toElement(); + TQDomElement domElementSort = domElementParent.firstChild().toElement(); while (!domElementSort.isNull()) { if (domElementSort.tagName() == KV_OPT_SORT) { m_doc->sort_allowed = true; - QDomAttr domAttrOn = domElementSort.attributeNode(KV_BOOL_FLAG); + TQDomAttr domAttrOn = domElementSort.attributeNode(KV_BOOL_FLAG); if (!domAttrOn.isNull()) { bool ok = true; @@ -491,12 +491,12 @@ bool KEduVocKvtmlReader::readOptions(QDomElement &domElementParent) } -bool KEduVocKvtmlReader::readType(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readType(TQDomElement &domElementParent) { - QString s; + TQString s; m_doc->type_descr.clear(); - QDomElement domElementDesc = domElementParent.firstChild().toElement(); + TQDomElement domElementDesc = domElementParent.firstChild().toElement(); while (!domElementDesc.isNull()) { @@ -508,7 +508,7 @@ bool KEduVocKvtmlReader::readType(QDomElement &domElementParent) int no = 0; bool isCurr = false; - QDomAttr domAttrNo = domElementDesc.attributeNode(KV_TYPE_NO); + TQDomAttr domAttrNo = domElementDesc.attributeNode(KV_TYPE_NO); if (!domAttrNo.isNull()) no = domAttrNo.value().toInt(); @@ -534,12 +534,12 @@ bool KEduVocKvtmlReader::readType(QDomElement &domElementParent) } -bool KEduVocKvtmlReader::readTense(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readTense(TQDomElement &domElementParent) { - QString s; + TQString s; m_doc->tense_descr.clear(); - QDomElement domElementDesc = domElementParent.firstChild().toElement(); + TQDomElement domElementDesc = domElementParent.firstChild().toElement(); while (!domElementDesc.isNull()) { @@ -551,7 +551,7 @@ bool KEduVocKvtmlReader::readTense(QDomElement &domElementParent) int no = 0; bool isCurr = false; - QDomAttr domAttrNo = domElementDesc.attributeNode(KV_TENSE_NO); + TQDomAttr domAttrNo = domElementDesc.attributeNode(KV_TENSE_NO); if (!domAttrNo.isNull()) no = domAttrNo.value().toInt(); @@ -577,12 +577,12 @@ bool KEduVocKvtmlReader::readTense(QDomElement &domElementParent) } -bool KEduVocKvtmlReader::readUsage(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readUsage(TQDomElement &domElementParent) { - QString s; + TQString s; m_doc->usage_descr.clear(); - QDomElement domElementDesc = domElementParent.firstChild().toElement(); + TQDomElement domElementDesc = domElementParent.firstChild().toElement(); while (!domElementDesc.isNull()) { @@ -594,7 +594,7 @@ bool KEduVocKvtmlReader::readUsage(QDomElement &domElementParent) int no = 0; bool isCurr = false; - QDomAttr domAttrNo = domElementDesc.attributeNode(KV_USAGE_NO); + TQDomAttr domAttrNo = domElementDesc.attributeNode(KV_USAGE_NO); if (!domAttrNo.isNull()) no = domAttrNo.value().toInt(); @@ -620,7 +620,7 @@ bool KEduVocKvtmlReader::readUsage(QDomElement &domElementParent) } -bool KEduVocKvtmlReader::readComparison(QDomElement &domElementParent, +bool KEduVocKvtmlReader::readComparison(TQDomElement &domElementParent, Comparison &comp) /* @@ -630,10 +630,10 @@ bool KEduVocKvtmlReader::readComparison(QDomElement &domElementParent, */ { - QString s; + TQString s; comp.clear(); - QDomElement domElementComparisonChild = domElementParent.firstChild().toElement(); + TQDomElement domElementComparisonChild = domElementParent.firstChild().toElement(); while (!domElementComparisonChild.isNull()) { if (domElementComparisonChild.tagName() == KV_COMP_L1) @@ -673,7 +673,7 @@ bool KEduVocKvtmlReader::readComparison(QDomElement &domElementParent, } -bool KEduVocKvtmlReader::readMultipleChoice(QDomElement &domElementParent, +bool KEduVocKvtmlReader::readMultipleChoice(TQDomElement &domElementParent, MultipleChoice &mc) /* @@ -686,10 +686,10 @@ bool KEduVocKvtmlReader::readMultipleChoice(QDomElement &domElementParent, */ { - QString s; + TQString s; mc.clear(); - QDomElement domElementChild = domElementParent.firstChild().toElement(); + TQDomElement domElementChild = domElementParent.firstChild().toElement(); while (!domElementChild.isNull()) { if (domElementChild.tagName() == KV_MC_1) @@ -746,43 +746,43 @@ bool KEduVocKvtmlReader::readMultipleChoice(QDomElement &domElementParent, } -bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementExpressionChild, - QString &lang, +bool KEduVocKvtmlReader::readExpressionChildAttributes( TQDomElement &domElementExpressionChild, + TQString &lang, grade_t &grade, grade_t &rev_grade, int &count, int &rev_count, time_t &date, time_t &rev_date, - QString &remark, + TQString &remark, int &bcount, int &rev_bcount, - QString &query_id, - QString &pronunce, + TQString &query_id, + TQString &pronunce, int &width, - QString &type, - QString &faux_ami_f, - QString &faux_ami_t, - QString &synonym, - QString &example, - QString &antonym, - QString &usage, - QString ¶phrase) + TQString &type, + TQString &faux_ami_f, + TQString &faux_ami_t, + TQString &synonym, + TQString &example, + TQString &antonym, + TQString &usage, + TQString ¶phrase) { int pos; lang = ""; - QDomAttr domAttrLang = domElementExpressionChild.attributeNode(KV_LANG); + TQDomAttr domAttrLang = domElementExpressionChild.attributeNode(KV_LANG); if (!domAttrLang.isNull()) lang = domAttrLang.value(); width = -1; - QDomAttr domAttrWidth = domElementExpressionChild.attributeNode(KV_SIZEHINT); + TQDomAttr domAttrWidth = domElementExpressionChild.attributeNode(KV_SIZEHINT); if (!domAttrWidth.isNull()) width = domAttrWidth.value().toInt(); grade = KV_NORM_GRADE; rev_grade = KV_NORM_GRADE; - QDomAttr domAttrGrade = domElementExpressionChild.attributeNode(KV_LANG); + TQDomAttr domAttrGrade = domElementExpressionChild.attributeNode(KV_LANG); if (!domAttrGrade.isNull()) { - QString s = domAttrGrade.value(); + TQString s = domAttrGrade.value(); if ((pos = s.find(';')) >= 1) { grade = s.left(pos).toInt(); @@ -794,10 +794,10 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE count = 0; rev_count = 0; - QDomAttr domAttrCount = domElementExpressionChild.attributeNode(KV_COUNT); + TQDomAttr domAttrCount = domElementExpressionChild.attributeNode(KV_COUNT); if (!domAttrCount.isNull()) { - QString s = domAttrCount.value(); + TQString s = domAttrCount.value(); if ((pos = s.find(';')) >= 1) { count = s.left(pos).toInt(); @@ -809,10 +809,10 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE bcount = 0; rev_bcount = 0; - QDomAttr domAttrBad = domElementExpressionChild.attributeNode(KV_BAD); + TQDomAttr domAttrBad = domElementExpressionChild.attributeNode(KV_BAD); if (!domAttrBad.isNull()) { - QString s = domAttrBad.value(); + TQString s = domAttrBad.value(); if ((pos = s.find(';')) >= 1) { bcount = s.left(pos).toInt(); @@ -824,10 +824,10 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE date = 0; rev_date = 0; - QDomAttr domAttrDate = domElementExpressionChild.attributeNode(KV_DATE); + TQDomAttr domAttrDate = domElementExpressionChild.attributeNode(KV_DATE); if (!domAttrDate.isNull()) { - QString s = domAttrDate.value(); + TQString s = domAttrDate.value(); if ((pos = s.find(';')) >= 1) { date = s.left(pos).toInt(); @@ -837,10 +837,10 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE date = s.toInt(); } - QDomAttr domAttrDate2 = domElementExpressionChild.attributeNode(KV_DATE2); + TQDomAttr domAttrDate2 = domElementExpressionChild.attributeNode(KV_DATE2); if (!domAttrDate2.isNull()) { - QString s = domAttrDate2.value(); + TQString s = domAttrDate2.value(); if ((pos = s.find(';')) >= 1) { date = m_doc->decompressDate(s.left(pos)); @@ -851,32 +851,32 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE } remark = ""; - QDomAttr domAttrRemark = domElementExpressionChild.attributeNode(KV_REMARK); + TQDomAttr domAttrRemark = domElementExpressionChild.attributeNode(KV_REMARK); if (!domAttrRemark.isNull()) remark = domAttrRemark.value(); faux_ami_f = ""; - QDomAttr domAttrFauxAmiF = domElementExpressionChild.attributeNode(KV_FAUX_AMI_F); + TQDomAttr domAttrFauxAmiF = domElementExpressionChild.attributeNode(KV_FAUX_AMI_F); if (!domAttrFauxAmiF.isNull()) faux_ami_f = domAttrFauxAmiF.value(); faux_ami_t = ""; - QDomAttr domAttrFauxAmiT = domElementExpressionChild.attributeNode(KV_FAUX_AMI_T); + TQDomAttr domAttrFauxAmiT = domElementExpressionChild.attributeNode(KV_FAUX_AMI_T); if (!domAttrFauxAmiT.isNull()) faux_ami_t = domAttrFauxAmiT.value(); synonym = ""; - QDomAttr domAttrSynonym = domElementExpressionChild.attributeNode(KV_SYNONYM); + TQDomAttr domAttrSynonym = domElementExpressionChild.attributeNode(KV_SYNONYM); if (!domAttrSynonym.isNull()) synonym = domAttrSynonym.value(); example = ""; - QDomAttr domAttrExample = domElementExpressionChild.attributeNode(KV_EXAMPLE); + TQDomAttr domAttrExample = domElementExpressionChild.attributeNode(KV_EXAMPLE); if (!domAttrExample.isNull()) example = domAttrExample.value(); usage = ""; - QDomAttr domAttrUsage = domElementExpressionChild.attributeNode(KV_USAGE); + TQDomAttr domAttrUsage = domElementExpressionChild.attributeNode(KV_USAGE); if (!domAttrUsage.isNull()) { usage = domAttrUsage.value(); @@ -886,7 +886,7 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE if( num > (int) m_doc->usage_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = m_doc->usage_descr.size(); i < num; i++) { s.setNum (i+1); @@ -898,16 +898,16 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE } paraphrase = ""; - QDomAttr domAttrParaphrase = domElementExpressionChild.attributeNode(KV_PARAPHRASE); + TQDomAttr domAttrParaphrase = domElementExpressionChild.attributeNode(KV_PARAPHRASE); if (!domAttrParaphrase.isNull()) paraphrase = domAttrParaphrase.value(); antonym = ""; - QDomAttr domAttrAntonym = domElementExpressionChild.attributeNode(KV_ANTONYM); + TQDomAttr domAttrAntonym = domElementExpressionChild.attributeNode(KV_ANTONYM); if (!domAttrAntonym.isNull()) antonym = domAttrAntonym.value(); - QDomAttr domAttrExprType = domElementExpressionChild.attributeNode(KV_EXPRTYPE); + TQDomAttr domAttrExprType = domElementExpressionChild.attributeNode(KV_EXPRTYPE); if (!domAttrExprType.isNull()) { type = domAttrExprType.value(); @@ -924,7 +924,7 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE if( num > (int) m_doc->type_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = m_doc->type_descr.size(); i < num; i++) { s.setNum (i+1); @@ -936,12 +936,12 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE } pronunce = ""; - QDomAttr domAttrPronunce = domElementExpressionChild.attributeNode(KV_PRONUNCE); + TQDomAttr domAttrPronunce = domElementExpressionChild.attributeNode(KV_PRONUNCE); if (!domAttrPronunce.isNull()) pronunce = domAttrPronunce.value(); query_id = ""; - QDomAttr domAttrQuery = domElementExpressionChild.attributeNode(KV_QUERY); + TQDomAttr domAttrQuery = domElementExpressionChild.attributeNode(KV_QUERY); if (!domAttrQuery.isNull()) query_id = domAttrQuery.value(); @@ -949,7 +949,7 @@ bool KEduVocKvtmlReader::readExpressionChildAttributes( QDomElement &domElementE } -bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readExpression(TQDomElement &domElementParent) { grade_t grade, r_grade; @@ -957,30 +957,30 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) r_qcount; int bcount, r_bcount; - QString remark; - QString pronunce; + TQString remark; + TQString pronunce; time_t qdate, r_qdate; bool inquery; bool active; - QString lang; - QString textstr; - QString exprtype; + TQString lang; + TQString textstr; + TQString exprtype; bool org_found = false; - QString q_org, + TQString q_org, q_trans; - QString query_id; + TQString query_id; KEduVocExpression expr; int lesson = 0; int width; - QString type; - QString faux_ami_f; - QString faux_ami_t; - QString synonym; - QString example; - QString antonym; - QString usage; - QString paraphrase; + TQString type; + TQString faux_ami_f; + TQString faux_ami_t; + TQString synonym; + TQString example; + TQString antonym; + TQString usage; + TQString paraphrase; vector conjug; Comparison comparison; MultipleChoice mc; @@ -989,23 +989,23 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) // Attributes //------------------------------------------------------------------------- - QDomAttr domAttrMember = domElementParent.attributeNode(KV_LESS_MEMBER); + TQDomAttr domAttrMember = domElementParent.attributeNode(KV_LESS_MEMBER); if (!domAttrMember.isNull()) lesson = domAttrMember.value().toInt(); - QDomAttr domAttrSelected = domElementParent.attributeNode(KV_SELECTED); + TQDomAttr domAttrSelected = domElementParent.attributeNode(KV_SELECTED); if (!domAttrSelected.isNull()) inquery = domAttrSelected.value().toInt(); else inquery = false; - QDomAttr domAttrInactive = domElementParent.attributeNode(KV_INACTIVE); + TQDomAttr domAttrInactive = domElementParent.attributeNode(KV_INACTIVE); if (!domAttrInactive.isNull()) active = !domAttrInactive.value().toInt(); else active = false; - QDomAttr domAttrType = domElementParent.attributeNode(KV_EXPRTYPE); + TQDomAttr domAttrType = domElementParent.attributeNode(KV_EXPRTYPE); if (!domAttrType.isNull()) { exprtype = !domAttrType.value().toInt(); @@ -1022,7 +1022,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) if( num > (int) m_doc->type_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = m_doc->type_descr.size(); i < num; i++) { s.setNum (i+1); @@ -1036,7 +1036,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) if (lesson && lesson > (int) m_doc->lesson_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = m_doc->lesson_descr.size(); i < lesson; i++) { s.setNum (i+1); @@ -1051,7 +1051,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) // now want "original" and one or more "translations" - QDomElement domElementExpressionChild = domElementParent.firstChild().toElement(); + TQDomElement domElementExpressionChild = domElementParent.firstChild().toElement(); unsigned int count = 0; org_found = false; @@ -1132,7 +1132,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) bool bComparison = false; bool bMultipleChoice = false; - QDomElement domElementOriginalChild = domElementExpressionChild.firstChild().toElement(); + TQDomElement domElementOriginalChild = domElementExpressionChild.firstChild().toElement(); while (!domElementOriginalChild.isNull()) { if (domElementOriginalChild.tagName() == KV_CONJUG_GRP) @@ -1144,7 +1144,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) } bConjug = true; conjug.clear(); - if (!readConjug(domElementOriginalChild, conjug, (QString) KV_CON_TYPE)) + if (!readConjug(domElementOriginalChild, conjug, (TQString) KV_CON_TYPE)) return false; } @@ -1310,7 +1310,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) bool bComparison = false; bool bMultipleChoice = false; - QDomElement domElementOriginalChild = domElementExpressionChild.firstChild().toElement(); + TQDomElement domElementOriginalChild = domElementExpressionChild.firstChild().toElement(); while (!domElementOriginalChild.isNull()) { if (domElementOriginalChild.tagName() == KV_CONJUG_GRP) @@ -1322,7 +1322,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) } bConjug = true; conjug.clear(); - if (!readConjug(domElementOriginalChild, conjug, (QString) KV_CON_TYPE)) + if (!readConjug(domElementOriginalChild, conjug, (TQString) KV_CON_TYPE)) return false; } @@ -1430,7 +1430,7 @@ bool KEduVocKvtmlReader::readExpression(QDomElement &domElementParent) } -bool KEduVocKvtmlReader::readBody(QDomElement &domElementParent) +bool KEduVocKvtmlReader::readBody(TQDomElement &domElementParent) { bool lessgroup = false; bool optgroup = false; @@ -1448,7 +1448,7 @@ if (lines != 0) emit progressChanged(this, 0); */ - QDomElement domElementChild = domElementParent.firstChild().toElement(); + TQDomElement domElementChild = domElementParent.firstChild().toElement(); while (!domElementChild.isNull()) { @@ -1566,8 +1566,8 @@ bool KEduVocKvtmlReader::readDoc(KEduVocDocument *doc) { m_doc = doc; - QDomDocument domDoc("Kvtml" ); - QString errorMsg; + TQDomDocument domDoc("Kvtml" ); + TQString errorMsg; if( !domDoc.setContent( m_inputFile, &errorMsg ) ) { domError(errorMsg); @@ -1586,7 +1586,7 @@ bool KEduVocKvtmlReader::readDoc(KEduVocDocument *doc) m_doc->doc_remark = ""; - QDomElement domElementKvtml = domDoc.documentElement(); + TQDomElement domElementKvtml = domDoc.documentElement(); if( domElementKvtml.tagName() != KV_DOCTYPE ) { domError(i18n("Tag <%1> was expected " @@ -1598,38 +1598,38 @@ bool KEduVocKvtmlReader::readDoc(KEduVocDocument *doc) // Attributes //------------------------------------------------------------------------- - QDomAttr domAttrEncoding = domElementKvtml.attributeNode(KV_ENCODING); + TQDomAttr domAttrEncoding = domElementKvtml.attributeNode(KV_ENCODING); if (!domAttrEncoding.isNull()) { // TODO handle old encodings // Qt DOM API autodetects encoding, so is there anything to do ? } - QDomAttr domAttrTitle = domElementKvtml.attributeNode(KV_TITLE); + TQDomAttr domAttrTitle = domElementKvtml.attributeNode(KV_TITLE); if (!domAttrTitle.isNull()) { m_doc->doctitle = domAttrTitle.value(); } - QDomAttr domAttrAuthor = domElementKvtml.attributeNode(KV_AUTHOR); + TQDomAttr domAttrAuthor = domElementKvtml.attributeNode(KV_AUTHOR); if (!domAttrAuthor.isNull()) { m_doc->author = domAttrAuthor.value(); } - QDomAttr domAttrLicence = domElementKvtml.attributeNode(KV_LICENSE); + TQDomAttr domAttrLicence = domElementKvtml.attributeNode(KV_LICENSE); if (!domAttrLicence.isNull()) { m_doc->license = domAttrLicence.value(); } - QDomAttr domAttrRemark = domElementKvtml.attributeNode(KV_DOC_REM); + TQDomAttr domAttrRemark = domElementKvtml.attributeNode(KV_DOC_REM); if (!domAttrRemark.isNull()) { m_doc->doc_remark = domAttrRemark.value(); } - QDomAttr domAttrGenerator = domElementKvtml.attributeNode(KV_GENERATOR); + TQDomAttr domAttrGenerator = domElementKvtml.attributeNode(KV_GENERATOR); if (!domAttrGenerator.isNull()) { m_doc->generator = domAttrGenerator.value(); @@ -1641,13 +1641,13 @@ bool KEduVocKvtmlReader::readDoc(KEduVocDocument *doc) } } - QDomAttr domAttrCols = domElementKvtml.attributeNode(KV_COLS); + TQDomAttr domAttrCols = domElementKvtml.attributeNode(KV_COLS); if (!domAttrCols.isNull()) { m_doc->cols = domAttrCols.value().toInt(); } - QDomAttr domAttrLines = domElementKvtml.attributeNode(KV_LINES); + TQDomAttr domAttrLines = domElementKvtml.attributeNode(KV_LINES); if (!domAttrLines.isNull()) { m_doc->lines = domAttrLines.value().toInt(); @@ -1665,31 +1665,31 @@ bool KEduVocKvtmlReader::readDoc(KEduVocDocument *doc) } -void KEduVocKvtmlReader::domErrorUnknownElement(const QString &elem) +void KEduVocKvtmlReader::domErrorUnknownElement(const TQString &elem) { - QString ln = i18n("File:\t%1\n").arg(m_doc->URL().path()); + TQString ln = i18n("File:\t%1\n").arg(m_doc->URL().path()); - QString format = i18n( + TQString format = i18n( "Your document contains an unknown tag <%1>. " // keep trailing space "Maybe your version of KVocTrain is too old, " "or the document is damaged.\n" "Loading is aborted because KVocTrain cannot " "read documents with unknown elements.\n" ); - QString msg = format.arg(elem); - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Unknown Element")); + TQString msg = format.arg(elem); + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Unknown Element")); KMessageBox::sorry(0, ln+msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } -void KEduVocKvtmlReader::domError(const QString &text ) +void KEduVocKvtmlReader::domError(const TQString &text ) { - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Error")); - QString ln = i18n("File:\t%1\n").arg(m_doc->URL().path()); - QString msg = text; + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Error")); + TQString ln = i18n("File:\t%1\n").arg(m_doc->URL().path()); + TQString msg = text; KMessageBox::error(0, ln+msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } diff --git a/kanagram/src/keduvockvtmlreader.h b/kanagram/src/keduvockvtmlreader.h index 9d902183..a68d4575 100644 --- a/kanagram/src/keduvockvtmlreader.h +++ b/kanagram/src/keduvockvtmlreader.h @@ -19,8 +19,8 @@ #ifndef KEDUVOCKVTMLREADER_H #define KEDUVOCKVTMLREADER_H -#include -#include +#include +#include #include "keduvocdocument.h" #include "grammarmanager.h" @@ -71,50 +71,50 @@ class KEduVocDocument; class KEduVocKvtmlReader : public QObject { public: - KEduVocKvtmlReader(QFile *file); + KEduVocKvtmlReader(TQFile *file); ~KEduVocKvtmlReader(); bool readDoc(KEduVocDocument *doc); - bool readLesson(QDomElement &domElementParent); - bool readArticle(QDomElement &domElementParent); - bool readConjug(QDomElement &domElementParent, + bool readLesson(TQDomElement &domElementParent); + bool readArticle(TQDomElement &domElementParent); + bool readConjug(TQDomElement &domElementParent, vector &curr_conjug, - const QString &entry_tag); - bool readOptions(QDomElement &domElementParent); - bool readType(QDomElement &domElementParent); - bool readTense(QDomElement &domElementParent); - bool readUsage(QDomElement &domElementParent); - bool readComparison(QDomElement &domElementParent, + const TQString &entry_tag); + bool readOptions(TQDomElement &domElementParent); + bool readType(TQDomElement &domElementParent); + bool readTense(TQDomElement &domElementParent); + bool readUsage(TQDomElement &domElementParent); + bool readComparison(TQDomElement &domElementParent, Comparison &comp); - bool readMultipleChoice(QDomElement &domElementParent, + bool readMultipleChoice(TQDomElement &domElementParent, MultipleChoice &mc); - bool readExpressionChildAttributes( QDomElement &domElementExpressionChild, - QString &lang, + bool readExpressionChildAttributes( TQDomElement &domElementExpressionChild, + TQString &lang, grade_t &grade, grade_t &rev_grade, int &count, int &rev_count, time_t &date, time_t &rev_date, - QString &remark, + TQString &remark, int &bcount, int &rev_bcount, - QString &query_id, - QString &pronunce, + TQString &query_id, + TQString &pronunce, int &width, - QString &type, - QString &faux_ami_f, - QString &faux_ami_t, - QString &synonym, - QString &example, - QString &antonym, - QString &usage, - QString ¶phrase); - bool readExpression(QDomElement &domElementParent); - bool readBody(QDomElement &domElementParent); - - void domErrorUnknownElement(const QString &elem); - void domError(const QString &text ); + TQString &type, + TQString &faux_ami_f, + TQString &faux_ami_t, + TQString &synonym, + TQString &example, + TQString &antonym, + TQString &usage, + TQString ¶phrase); + bool readExpression(TQDomElement &domElementParent); + bool readBody(TQDomElement &domElementParent); + + void domErrorUnknownElement(const TQString &elem); + void domError(const TQString &text ); private: - QFile *m_inputFile; + TQFile *m_inputFile; KEduVocDocument *m_doc; }; diff --git a/kanagram/src/keduvockvtmlwriter.cpp b/kanagram/src/keduvockvtmlwriter.cpp index c859d828..5aef1645 100644 --- a/kanagram/src/keduvockvtmlwriter.cpp +++ b/kanagram/src/keduvockvtmlwriter.cpp @@ -17,13 +17,13 @@ ***************************************************************************/ #include -#include -#include +#include +#include #include "keduvockvtmlwriter.h" #include "keduvocdocument.h" -KEduVocKvtmlWriter::KEduVocKvtmlWriter(QFile *file) +KEduVocKvtmlWriter::KEduVocKvtmlWriter(TQFile *file) { // the file must be already open m_outputFile = file; @@ -33,19 +33,19 @@ KEduVocKvtmlWriter::~KEduVocKvtmlWriter() { } -bool KEduVocKvtmlWriter::saveTypeNameKvtMl (QDomDocument &domDoc, QDomElement &domElementParent) +bool KEduVocKvtmlWriter::saveTypeNameKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent) { if (m_doc->type_descr.size() == 0) return true; - QDomElement domElementType = domDoc.createElement(KV_TYPE_GRP); + TQDomElement domElementType = domDoc.createElement(KV_TYPE_GRP); for (int lfn = 0; lfn < (int) m_doc->type_descr.size(); lfn++) { if (!(m_doc->type_descr[lfn].isNull()) ) { - QDomElement domElementDesc = domDoc.createElement(KV_TYPE_DESC); - QDomText domTextDesc = domDoc.createTextNode(m_doc->type_descr[lfn]); + TQDomElement domElementDesc = domDoc.createElement(KV_TYPE_DESC); + TQDomText domTextDesc = domDoc.createTextNode(m_doc->type_descr[lfn]); domElementDesc.setAttribute(KV_TYPE_NO, lfn+1); domElementDesc.appendChild(domTextDesc); @@ -58,18 +58,18 @@ bool KEduVocKvtmlWriter::saveTypeNameKvtMl (QDomDocument &domDoc, QDomElement &d } -bool KEduVocKvtmlWriter::saveTenseNameKvtMl (QDomDocument &domDoc, QDomElement &domElementParent) +bool KEduVocKvtmlWriter::saveTenseNameKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent) { if (m_doc->tense_descr.size() == 0) return true; - QDomElement domElementTense = domDoc.createElement(KV_TENSE_GRP); + TQDomElement domElementTense = domDoc.createElement(KV_TENSE_GRP); for (int lfn = 0; lfn < (int) m_doc->tense_descr.size(); lfn++) { if (!(m_doc->tense_descr[lfn].isNull()) ) { - QDomElement domElementDesc = domDoc.createElement(KV_TENSE_DESC); - QDomText domTextDesc = domDoc.createTextNode(m_doc->tense_descr[lfn]); + TQDomElement domElementDesc = domDoc.createElement(KV_TENSE_DESC); + TQDomText domTextDesc = domDoc.createTextNode(m_doc->tense_descr[lfn]); domElementDesc.setAttribute(KV_TENSE_NO, lfn+1); domElementDesc.appendChild(domTextDesc); @@ -82,19 +82,19 @@ bool KEduVocKvtmlWriter::saveTenseNameKvtMl (QDomDocument &domDoc, QDomElement & } -bool KEduVocKvtmlWriter::saveUsageNameKvtMl (QDomDocument &domDoc, QDomElement &domElementParent) +bool KEduVocKvtmlWriter::saveUsageNameKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent) { if (m_doc->usage_descr.size() == 0) return true; - QDomElement domElementUsage = domDoc.createElement(KV_USAGE_GRP); + TQDomElement domElementUsage = domDoc.createElement(KV_USAGE_GRP); for (int lfn = 0; lfn < (int) m_doc->usage_descr.size(); lfn++) { if (!(m_doc->usage_descr[lfn].isNull()) ) { - QDomElement domElementDesc = domDoc.createElement(KV_USAGE_DESC); - QDomText domTextDesc = domDoc.createTextNode(m_doc->usage_descr[lfn]); + TQDomElement domElementDesc = domDoc.createElement(KV_USAGE_DESC); + TQDomText domTextDesc = domDoc.createTextNode(m_doc->usage_descr[lfn]); domElementDesc.setAttribute(KV_USAGE_NO, lfn+1); domElementDesc.appendChild(domTextDesc); @@ -107,20 +107,20 @@ bool KEduVocKvtmlWriter::saveUsageNameKvtMl (QDomDocument &domDoc, QDomElement & } -bool KEduVocKvtmlWriter::saveLessonKvtMl (QDomDocument &domDoc, QDomElement &domElementParent) +bool KEduVocKvtmlWriter::saveLessonKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent) { if (m_doc->lesson_descr.size() == 0) return true; - QDomElement domElementLesson = domDoc.createElement(KV_LESS_GRP); + TQDomElement domElementLesson = domDoc.createElement(KV_LESS_GRP); domElementLesson.setAttribute(KV_SIZEHINT, m_doc->getSizeHint(-1)); for (int lfn = 0; lfn < (int) m_doc->lesson_descr.size(); lfn++) { if (!(m_doc->lesson_descr[lfn].isNull()) ) { - QDomElement domElementDesc = domDoc.createElement(KV_LESS_DESC); - QDomText domTextDesc = domDoc.createTextNode(m_doc->lesson_descr[lfn]); + TQDomElement domElementDesc = domDoc.createElement(KV_LESS_DESC); + TQDomText domTextDesc = domDoc.createTextNode(m_doc->lesson_descr[lfn]); domElementDesc.setAttribute(KV_LESS_NO, lfn+1); if (m_doc->getCurrentLesson() == lfn+1) @@ -138,13 +138,13 @@ bool KEduVocKvtmlWriter::saveLessonKvtMl (QDomDocument &domDoc, QDomElement &dom } -bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElementParent, - const Conjugation &curr_conjug, QString type) +bool KEduVocKvtmlWriter::saveConjug(TQDomDocument &domDoc, TQDomElement &domElementParent, + const Conjugation &curr_conjug, TQString type) { if (!curr_conjug.pers1Singular(type).isEmpty() ) { - QDomElement domElementP1s = domDoc.createElement(KV_CON_P1S); - QDomText domTextP1s = domDoc.createTextNode(curr_conjug.pers1Singular(type)); + TQDomElement domElementP1s = domDoc.createElement(KV_CON_P1S); + TQDomText domTextP1s = domDoc.createTextNode(curr_conjug.pers1Singular(type)); domElementP1s.appendChild(domTextP1s); domElementParent.appendChild(domElementP1s); @@ -152,8 +152,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers2Singular(type).isEmpty() ) { - QDomElement domElementP2s = domDoc.createElement(KV_CON_P2S); - QDomText domTextP2s = domDoc.createTextNode(curr_conjug.pers2Singular(type)); + TQDomElement domElementP2s = domDoc.createElement(KV_CON_P2S); + TQDomText domTextP2s = domDoc.createTextNode(curr_conjug.pers2Singular(type)); domElementP2s.appendChild(domTextP2s); domElementParent.appendChild(domElementP2s); @@ -162,8 +162,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers3FemaleSingular(type).isEmpty() || curr_conjug.pers3SingularCommon(type)) { - QDomElement domElementP3sf = domDoc.createElement(KV_CON_P3SF); - QDomText domTextP3sf = domDoc.createTextNode(curr_conjug.pers3FemaleSingular(type)); + TQDomElement domElementP3sf = domDoc.createElement(KV_CON_P3SF); + TQDomText domTextP3sf = domDoc.createTextNode(curr_conjug.pers3FemaleSingular(type)); if (curr_conjug.pers3SingularCommon(type)) domElementP3sf.setAttribute(KV_CONJ_COMMON, 1); @@ -174,8 +174,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers3MaleSingular(type).isEmpty() ) { - QDomElement domElementP3sm = domDoc.createElement(KV_CON_P3SM); - QDomText domTextP3sm = domDoc.createTextNode(curr_conjug.pers3MaleSingular(type)); + TQDomElement domElementP3sm = domDoc.createElement(KV_CON_P3SM); + TQDomText domTextP3sm = domDoc.createTextNode(curr_conjug.pers3MaleSingular(type)); domElementP3sm.appendChild(domTextP3sm); domElementParent.appendChild(domElementP3sm); @@ -183,8 +183,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers3NaturalSingular(type).isEmpty() ) { - QDomElement domElementP3sn = domDoc.createElement(KV_CON_P3SN); - QDomText domTextP3sn = domDoc.createTextNode(curr_conjug.pers3NaturalSingular(type)); + TQDomElement domElementP3sn = domDoc.createElement(KV_CON_P3SN); + TQDomText domTextP3sn = domDoc.createTextNode(curr_conjug.pers3NaturalSingular(type)); domElementP3sn.appendChild(domTextP3sn); domElementParent.appendChild(domElementP3sn); @@ -192,8 +192,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers1Plural(type).isEmpty() ) { - QDomElement domElementP1p = domDoc.createElement(KV_CON_P1P); - QDomText domTextP1p = domDoc.createTextNode(curr_conjug.pers1Plural(type)); + TQDomElement domElementP1p = domDoc.createElement(KV_CON_P1P); + TQDomText domTextP1p = domDoc.createTextNode(curr_conjug.pers1Plural(type)); domElementP1p.appendChild(domTextP1p); domElementParent.appendChild(domElementP1p); @@ -201,8 +201,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers2Plural(type).isEmpty() ) { - QDomElement domElementP2p = domDoc.createElement(KV_CON_P2P); - QDomText domTextP2p = domDoc.createTextNode(curr_conjug.pers2Plural(type)); + TQDomElement domElementP2p = domDoc.createElement(KV_CON_P2P); + TQDomText domTextP2p = domDoc.createTextNode(curr_conjug.pers2Plural(type)); domElementP2p.appendChild(domTextP2p); domElementParent.appendChild(domElementP2p); @@ -211,8 +211,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers3FemalePlural(type).isEmpty() || curr_conjug.pers3PluralCommon(type)) { - QDomElement domElementP3pf = domDoc.createElement(KV_CON_P3PF); - QDomText domTextP3pf = domDoc.createTextNode(curr_conjug.pers3FemalePlural(type)); + TQDomElement domElementP3pf = domDoc.createElement(KV_CON_P3PF); + TQDomText domTextP3pf = domDoc.createTextNode(curr_conjug.pers3FemalePlural(type)); if (curr_conjug.pers3PluralCommon(type)) domElementP3pf.setAttribute(KV_CONJ_COMMON, 1); @@ -223,8 +223,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers3MalePlural(type).isEmpty() ) { - QDomElement domElementP3pm = domDoc.createElement(KV_CON_P3PM); - QDomText domTextP3pm = domDoc.createTextNode(curr_conjug.pers3MalePlural(type)); + TQDomElement domElementP3pm = domDoc.createElement(KV_CON_P3PM); + TQDomText domTextP3pm = domDoc.createTextNode(curr_conjug.pers3MalePlural(type)); domElementP3pm.appendChild(domTextP3pm); domElementParent.appendChild(domElementP3pm); @@ -232,8 +232,8 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen if (!curr_conjug.pers3NaturalPlural(type).isEmpty() ) { - QDomElement domElementP3pn = domDoc.createElement(KV_CON_P3PN); - QDomText domTextP3pn = domDoc.createTextNode(curr_conjug.pers3NaturalPlural(type)); + TQDomElement domElementP3pn = domDoc.createElement(KV_CON_P3PN); + TQDomText domTextP3pn = domDoc.createTextNode(curr_conjug.pers3NaturalPlural(type)); domElementP3pn.appendChild(domTextP3pn); domElementParent.appendChild(domElementP3pn); @@ -242,7 +242,7 @@ bool KEduVocKvtmlWriter::saveConjug(QDomDocument &domDoc, QDomElement &domElemen return true; } -bool KEduVocKvtmlWriter::saveConjugHeader(QDomDocument &domDoc, QDomElement &domElementParent, +bool KEduVocKvtmlWriter::saveConjugHeader(TQDomDocument &domDoc, TQDomElement &domElementParent, vector &curr_conjug) { /* @@ -265,12 +265,12 @@ bool KEduVocKvtmlWriter::saveConjugHeader(QDomDocument &domDoc, QDomElement &dom if (curr_conjug.size() == 0) return true; - QDomElement domElementConjug = domDoc.createElement(KV_CONJUG_GRP); - QString s; + TQDomElement domElementConjug = domDoc.createElement(KV_CONJUG_GRP); + TQString s; for (int ent = 0; ent < QMIN((int) curr_conjug.size(), m_doc->numLangs()); ent++) { - QDomElement domElementEntry = domDoc.createElement(KV_CON_ENTRY); + TQDomElement domElementEntry = domDoc.createElement(KV_CON_ENTRY); if (ent == 0) { @@ -300,7 +300,7 @@ bool KEduVocKvtmlWriter::saveConjugHeader(QDomDocument &domDoc, QDomElement &dom } -bool KEduVocKvtmlWriter::saveComparison(QDomDocument &domDoc, QDomElement &domElementParent, +bool KEduVocKvtmlWriter::saveComparison(TQDomDocument &domDoc, TQDomElement &domElementParent, const Comparison &comp) /* @@ -313,12 +313,12 @@ bool KEduVocKvtmlWriter::saveComparison(QDomDocument &domDoc, QDomElement &domEl if (comp.isEmpty()) return true; - QDomElement domElementComparison = domDoc.createElement(KV_COMPARISON_GRP); + TQDomElement domElementComparison = domDoc.createElement(KV_COMPARISON_GRP); if (!comp.l1().isEmpty() ) { - QDomElement domElementL1 = domDoc.createElement(KV_COMP_L1); - QDomText domTextL1 = domDoc.createTextNode(comp.l1()); + TQDomElement domElementL1 = domDoc.createElement(KV_COMP_L1); + TQDomText domTextL1 = domDoc.createTextNode(comp.l1()); domElementL1.appendChild(domTextL1); domElementComparison.appendChild(domElementL1); @@ -326,8 +326,8 @@ bool KEduVocKvtmlWriter::saveComparison(QDomDocument &domDoc, QDomElement &domEl if (!comp.l2().isEmpty() ) { - QDomElement domElementL2 = domDoc.createElement(KV_COMP_L2); - QDomText domTextL2 = domDoc.createTextNode(comp.l2()); + TQDomElement domElementL2 = domDoc.createElement(KV_COMP_L2); + TQDomText domTextL2 = domDoc.createTextNode(comp.l2()); domElementL2.appendChild(domTextL2); domElementComparison.appendChild(domElementL2); @@ -335,8 +335,8 @@ bool KEduVocKvtmlWriter::saveComparison(QDomDocument &domDoc, QDomElement &domEl if (!comp.l3().isEmpty() ) { - QDomElement domElementL3 = domDoc.createElement(KV_COMP_L3); - QDomText domTextL3 = domDoc.createTextNode(comp.l3()); + TQDomElement domElementL3 = domDoc.createElement(KV_COMP_L3); + TQDomText domTextL3 = domDoc.createTextNode(comp.l3()); domElementL3.appendChild(domTextL3); domElementComparison.appendChild(domElementL3); @@ -347,7 +347,7 @@ bool KEduVocKvtmlWriter::saveComparison(QDomDocument &domDoc, QDomElement &domEl } -bool KEduVocKvtmlWriter::saveMultipleChoice(QDomDocument &domDoc, QDomElement &domElementParent, +bool KEduVocKvtmlWriter::saveMultipleChoice(TQDomDocument &domDoc, TQDomElement &domElementParent, const MultipleChoice &mc) /* @@ -362,12 +362,12 @@ bool KEduVocKvtmlWriter::saveMultipleChoice(QDomDocument &domDoc, QDomElement &d if (mc.isEmpty()) return true; - QDomElement domElementMC = domDoc.createElement(KV_MULTIPLECHOICE_GRP); + TQDomElement domElementMC = domDoc.createElement(KV_MULTIPLECHOICE_GRP); if (!mc.mc1().isEmpty() ) { - QDomElement domElementMC1 = domDoc.createElement(KV_MC_1); - QDomText domTextMC1 = domDoc.createTextNode(mc.mc1()); + TQDomElement domElementMC1 = domDoc.createElement(KV_MC_1); + TQDomText domTextMC1 = domDoc.createTextNode(mc.mc1()); domElementMC1.appendChild(domTextMC1); domElementMC.appendChild(domElementMC1); @@ -375,8 +375,8 @@ bool KEduVocKvtmlWriter::saveMultipleChoice(QDomDocument &domDoc, QDomElement &d if (!mc.mc2().isEmpty() ) { - QDomElement domElementMC2 = domDoc.createElement(KV_MC_2); - QDomText domTextMC2 = domDoc.createTextNode(mc.mc2()); + TQDomElement domElementMC2 = domDoc.createElement(KV_MC_2); + TQDomText domTextMC2 = domDoc.createTextNode(mc.mc2()); domElementMC2.appendChild(domTextMC2); domElementMC.appendChild(domElementMC2); @@ -384,8 +384,8 @@ bool KEduVocKvtmlWriter::saveMultipleChoice(QDomDocument &domDoc, QDomElement &d if (!mc.mc3().isEmpty() ) { - QDomElement domElementMC3 = domDoc.createElement(KV_MC_3); - QDomText domTextMC3 = domDoc.createTextNode(mc.mc3()); + TQDomElement domElementMC3 = domDoc.createElement(KV_MC_3); + TQDomText domTextMC3 = domDoc.createTextNode(mc.mc3()); domElementMC3.appendChild(domTextMC3); domElementMC.appendChild(domElementMC3); @@ -393,8 +393,8 @@ bool KEduVocKvtmlWriter::saveMultipleChoice(QDomDocument &domDoc, QDomElement &d if (!mc.mc4().isEmpty() ) { - QDomElement domElementMC4 = domDoc.createElement(KV_MC_4); - QDomText domTextMC4 = domDoc.createTextNode(mc.mc4()); + TQDomElement domElementMC4 = domDoc.createElement(KV_MC_4); + TQDomText domTextMC4 = domDoc.createTextNode(mc.mc4()); domElementMC4.appendChild(domTextMC4); domElementMC.appendChild(domElementMC4); @@ -402,8 +402,8 @@ bool KEduVocKvtmlWriter::saveMultipleChoice(QDomDocument &domDoc, QDomElement &d if (!mc.mc5().isEmpty() ) { - QDomElement domElementMC5 = domDoc.createElement(KV_MC_5); - QDomText domTextMC5 = domDoc.createTextNode(mc.mc5()); + TQDomElement domElementMC5 = domDoc.createElement(KV_MC_5); + TQDomText domTextMC5 = domDoc.createTextNode(mc.mc5()); domElementMC5.appendChild(domTextMC5); domElementMC.appendChild(domElementMC5); @@ -414,7 +414,7 @@ bool KEduVocKvtmlWriter::saveMultipleChoice(QDomDocument &domDoc, QDomElement &d } -bool KEduVocKvtmlWriter::saveConjugEntry( QDomDocument &domDoc, QDomElement &domElementParent, +bool KEduVocKvtmlWriter::saveConjugEntry( TQDomDocument &domDoc, TQDomElement &domElementParent, Conjugation &curr_conjug) /* in entry for definition of tenses of (irreg.) verbs @@ -437,12 +437,12 @@ bool KEduVocKvtmlWriter::saveConjugEntry( QDomDocument &domDoc, QDomElement &dom if (curr_conjug.numEntries() == 0 ) return true; - QDomElement domElementConjug = domDoc.createElement(KV_CONJUG_GRP); - QString type; + TQDomElement domElementConjug = domDoc.createElement(KV_CONJUG_GRP); + TQString type; for (int lfn = 0; lfn < (int) curr_conjug.numEntries(); lfn++) { - QDomElement domElementType = domDoc.createElement(KV_CON_TYPE); + TQDomElement domElementType = domDoc.createElement(KV_CON_TYPE); type = curr_conjug.getType(lfn); domElementType.setAttribute(KV_CON_NAME, type); @@ -458,7 +458,7 @@ bool KEduVocKvtmlWriter::saveConjugEntry( QDomDocument &domDoc, QDomElement &dom } -bool KEduVocKvtmlWriter::saveArticleKvtMl(QDomDocument &domDoc, QDomElement &domElementParent) +bool KEduVocKvtmlWriter::saveArticleKvtMl(TQDomDocument &domDoc, TQDomElement &domElementParent) /*
lang determines also lang order in entries !! @@ -475,12 +475,12 @@ bool KEduVocKvtmlWriter::saveArticleKvtMl(QDomDocument &domDoc, QDomElement &dom if (m_doc->articles.size() == 0) return true; - QDomElement domElementArticle = domDoc.createElement(KV_ARTICLE_GRP); - QString def, indef, s; + TQDomElement domElementArticle = domDoc.createElement(KV_ARTICLE_GRP); + TQString def, indef, s; for (int lfn = 0; lfn < QMIN((int) m_doc->articles.size(), m_doc->numLangs()); lfn++) { - QDomElement domElementEntry = domDoc.createElement(KV_ART_ENTRY); + TQDomElement domElementEntry = domDoc.createElement(KV_ART_ENTRY); if (lfn == 0) { s = m_doc->getOriginalIdent().stripWhiteSpace(); @@ -501,16 +501,16 @@ bool KEduVocKvtmlWriter::saveArticleKvtMl(QDomDocument &domDoc, QDomElement &dom m_doc->articles[lfn].female(def, indef); if (!def.isEmpty() ) { - QDomElement domElementFD = domDoc.createElement(KV_ART_FD); - QDomText domTextFD = domDoc.createTextNode(def); + TQDomElement domElementFD = domDoc.createElement(KV_ART_FD); + TQDomText domTextFD = domDoc.createTextNode(def); domElementFD.appendChild(domTextFD); domElementEntry.appendChild(domElementFD); } if (!indef.isEmpty() ) { - QDomElement domElementFI = domDoc.createElement(KV_ART_FI); - QDomText domTextFI = domDoc.createTextNode(indef); + TQDomElement domElementFI = domDoc.createElement(KV_ART_FI); + TQDomText domTextFI = domDoc.createTextNode(indef); domElementFI.appendChild(domTextFI); domElementEntry.appendChild(domElementFI); @@ -519,16 +519,16 @@ bool KEduVocKvtmlWriter::saveArticleKvtMl(QDomDocument &domDoc, QDomElement &dom m_doc->articles[lfn].male(def, indef); if (!def.isEmpty() ) { - QDomElement domElementMD = domDoc.createElement(KV_ART_MD); - QDomText domTextMD = domDoc.createTextNode(def); + TQDomElement domElementMD = domDoc.createElement(KV_ART_MD); + TQDomText domTextMD = domDoc.createTextNode(def); domElementMD.appendChild(domTextMD); domElementEntry.appendChild(domElementMD); } if (!indef.isEmpty() ) { - QDomElement domElementMI = domDoc.createElement(KV_ART_MI); - QDomText domTextMI = domDoc.createTextNode(indef); + TQDomElement domElementMI = domDoc.createElement(KV_ART_MI); + TQDomText domTextMI = domDoc.createTextNode(indef); domElementMI.appendChild(domTextMI); domElementEntry.appendChild(domElementMI); @@ -537,16 +537,16 @@ bool KEduVocKvtmlWriter::saveArticleKvtMl(QDomDocument &domDoc, QDomElement &dom m_doc->articles[lfn].natural(def, indef); if (!def.isEmpty() ) { - QDomElement domElementND = domDoc.createElement(KV_ART_ND); - QDomText domTextND = domDoc.createTextNode(def); + TQDomElement domElementND = domDoc.createElement(KV_ART_ND); + TQDomText domTextND = domDoc.createTextNode(def); domElementND.appendChild(domTextND); domElementEntry.appendChild(domElementND); } if (!indef.isEmpty() ) { - QDomElement domElementNI = domDoc.createElement(KV_ART_NI); - QDomText domTextNI = domDoc.createTextNode(indef); + TQDomElement domElementNI = domDoc.createElement(KV_ART_NI); + TQDomText domTextNI = domDoc.createTextNode(indef); domElementNI.appendChild(domTextNI); domElementEntry.appendChild(domElementNI); @@ -560,10 +560,10 @@ bool KEduVocKvtmlWriter::saveArticleKvtMl(QDomDocument &domDoc, QDomElement &dom } -bool KEduVocKvtmlWriter::saveOptionsKvtMl(QDomDocument &domDoc, QDomElement &domElementParent) +bool KEduVocKvtmlWriter::saveOptionsKvtMl(TQDomDocument &domDoc, TQDomElement &domElementParent) { - QDomElement domElementOption = domDoc.createElement(KV_OPTION_GRP); - QDomElement domElementSort = domDoc.createElement(KV_OPT_SORT); + TQDomElement domElementOption = domDoc.createElement(KV_OPTION_GRP); + TQDomElement domElementSort = domDoc.createElement(KV_OPT_SORT); domElementSort.setAttribute(KV_BOOL_FLAG, (m_doc->sort_allowed?1:0)); domElementOption.appendChild(domElementSort); @@ -573,19 +573,19 @@ bool KEduVocKvtmlWriter::saveOptionsKvtMl(QDomDocument &domDoc, QDomElement &dom } -bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator) +bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const TQString &generator) { bool first_expr = true; m_doc = doc; - QDomDocument domDoc( "KEduVocDocument" ); - QDomElement domElementKvtml = domDoc.createElement( "kvtml" ); + TQDomDocument domDoc( "KEduVocDocument" ); + TQDomElement domElementKvtml = domDoc.createElement( "kvtml" ); - QString head( "" ); + TQString head( "" ); domDoc.setContent( head ); - QDomComment domComment = domDoc.createComment(QString( + TQDomComment domComment = domDoc.createComment(TQString( "\nThis is a machine generated file.\n" "Be careful when editing here.\n" "\n" @@ -645,7 +645,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator domDoc.appendChild(domComment); - domElementKvtml.setAttribute(KV_ENCODING, (QString)"UTF-8"); + domElementKvtml.setAttribute(KV_ENCODING, (TQString)"UTF-8"); domElementKvtml.setAttribute(KV_GENERATOR, generator); domElementKvtml.setAttribute(KV_COLS, m_doc->numLangs() ); @@ -684,7 +684,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator if (!saveUsageNameKvtMl(domDoc, domElementKvtml)) return false; - QString q_org, q_trans; + TQString q_org, q_trans; vector::const_iterator first = m_doc->vocabulary.begin (); m_doc->getQueryLang(q_org, q_trans); @@ -695,7 +695,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator while (first != m_doc->vocabulary.end ()) { - QDomElement domElementExpression = domDoc.createElement(KV_EXPR); + TQDomElement domElementExpression = domDoc.createElement(KV_EXPR); ent_no++; if (ent_percent != 0 && (ent_no % ent_percent) == 0 ) @@ -704,7 +704,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator if ((*first).getLesson() != 0) { // entry belongs to lesson x - QString ls; + TQString ls; int lm = (*first).getLesson(); if (lm > (int) m_doc->lesson_descr.size() ) { @@ -719,13 +719,13 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator if ((*first).isInQuery()) { // entry was selected for query - domElementExpression.setAttribute (KV_SELECTED, (QString) "1"); + domElementExpression.setAttribute (KV_SELECTED, (TQString) "1"); } if (!(*first).isActive()) { // entry was inactive - domElementExpression.setAttribute (KV_INACTIVE, (QString) "1"); + domElementExpression.setAttribute (KV_INACTIVE, (TQString) "1"); } if ((*first).uniqueType() && !(*first).getType(0).isEmpty()) @@ -733,11 +733,11 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator domElementExpression.setAttribute (KV_EXPRTYPE, (*first).getType(0)); } - QDomElement domElementOriginal = domDoc.createElement(KV_ORG); + TQDomElement domElementOriginal = domDoc.createElement(KV_ORG); if (first_expr) { // save space, only tell language in first entry - QString s; + TQString s; s.setNum (m_doc->getSizeHint (0)); domElementOriginal.setAttribute(KV_SIZEHINT, s); @@ -746,9 +746,9 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator s = "original"; domElementOriginal.setAttribute (KV_LANG, s); if (s == q_org) - domElementOriginal.setAttribute(KV_QUERY, (QString) KV_O); + domElementOriginal.setAttribute(KV_QUERY, (TQString) KV_O); else if (s == q_trans) - domElementOriginal.setAttribute(KV_QUERY, (QString) KV_T); + domElementOriginal.setAttribute(KV_QUERY, (TQString) KV_T); } @@ -779,8 +779,8 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator if (!saveMultipleChoice(domDoc, domElementOriginal, (*first).getMultipleChoice(0))) return false; - QString s; - QString entype = s = (*first).getType(0); + TQString s; + TQString entype = s = (*first).getType(0); int pos = s.find (QM_TYPE_DIV); if (pos >= 0) entype = s.left (pos); @@ -802,18 +802,18 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator return false; } - QDomText domTextOriginal = domDoc.createTextNode((*first).getOriginal()); + TQDomText domTextOriginal = domDoc.createTextNode((*first).getOriginal()); domElementOriginal.appendChild(domTextOriginal); domElementExpression.appendChild(domElementOriginal); int trans = 1; while (trans < (int)m_doc->langs.size()) { - QDomElement domElementTranslation = domDoc.createElement(KV_TRANS); + TQDomElement domElementTranslation = domDoc.createElement(KV_TRANS); if (first_expr) { // save space, only tell language in first entry - QString s; + TQString s; s.setNum (m_doc->getSizeHint (trans)); domElementTranslation.setAttribute(KV_SIZEHINT, s); @@ -825,12 +825,12 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator } domElementTranslation.setAttribute(KV_LANG, s); if (s == q_org) - domElementTranslation.setAttribute(KV_QUERY, (QString) KV_O); + domElementTranslation.setAttribute(KV_QUERY, (TQString) KV_O); else if (s == q_trans) - domElementTranslation.setAttribute(KV_QUERY, (QString) KV_T); + domElementTranslation.setAttribute(KV_QUERY, (TQString) KV_T); } - QString s1, s2; + TQString s1, s2; if ((*first).getGrade(trans, false) != 0 ||(*first).getGrade(trans, true) != 0) @@ -899,8 +899,8 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator if (!saveMultipleChoice(domDoc, domElementTranslation, (*first).getMultipleChoice(trans))) return false; - QString s; - QString entype = s = (*first).getType(0); + TQString s; + TQString entype = s = (*first).getType(0); int pos = s.find (QM_TYPE_DIV); if (pos >= 0) entype = s.left (pos); @@ -923,7 +923,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator return false; } - QDomText domTextTranslation = domDoc.createTextNode((*first).getTranslation(trans)); + TQDomText domTextTranslation = domDoc.createTextNode((*first).getTranslation(trans)); domElementTranslation.appendChild(domTextTranslation); domElementExpression.appendChild(domElementTranslation); @@ -938,8 +938,8 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator domDoc.appendChild(domElementKvtml); - QTextStream ts( m_outputFile ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( m_outputFile ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << domDoc.toString(); // TODO setModified (false); diff --git a/kanagram/src/keduvockvtmlwriter.h b/kanagram/src/keduvockvtmlwriter.h index dd9e6a78..969cedf0 100644 --- a/kanagram/src/keduvockvtmlwriter.h +++ b/kanagram/src/keduvockvtmlwriter.h @@ -19,8 +19,8 @@ #ifndef KEDUVOCKVTMLWRITER_H #define KEDUVOCKVTMLWRITER_H -#include -#include +#include +#include //#include "keduvocdocument.h" #include "grammarmanager.h" @@ -67,32 +67,32 @@ class KEduVocDocument; class KEduVocKvtmlWriter { public: - KEduVocKvtmlWriter(QFile *file); + KEduVocKvtmlWriter(TQFile *file); ~KEduVocKvtmlWriter(); - bool writeDoc(KEduVocDocument *doc, const QString &generator); + bool writeDoc(KEduVocDocument *doc, const TQString &generator); - bool saveLessonKvtMl (QDomDocument &domDoc, QDomElement &domElementParent); - bool saveTypeNameKvtMl (QDomDocument &domDoc, QDomElement &domElementParent); - bool saveTenseNameKvtMl (QDomDocument &domDoc, QDomElement &domElementParent); - bool saveUsageNameKvtMl (QDomDocument &domDoc, QDomElement &domElementParent); - bool saveOptionsKvtMl (QDomDocument &domDoc, QDomElement &domElementParent); - bool saveArticleKvtMl (QDomDocument &domDoc, QDomElement &domElementParent); - bool saveConjugHeader (QDomDocument &domDoc, QDomElement &domElementParent, + bool saveLessonKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent); + bool saveTypeNameKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent); + bool saveTenseNameKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent); + bool saveUsageNameKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent); + bool saveOptionsKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent); + bool saveArticleKvtMl (TQDomDocument &domDoc, TQDomElement &domElementParent); + bool saveConjugHeader (TQDomDocument &domDoc, TQDomElement &domElementParent, vector &curr_conjug); - bool saveConjug (QDomDocument &domDoc, QDomElement &domElementParent, - const Conjugation &curr_conjug, QString type); - bool saveConjugEntry (QDomDocument &domDoc, QDomElement &domElementParent, + bool saveConjug (TQDomDocument &domDoc, TQDomElement &domElementParent, + const Conjugation &curr_conjug, TQString type); + bool saveConjugEntry (TQDomDocument &domDoc, TQDomElement &domElementParent, Conjugation &curr_conjug); - bool saveComparison (QDomDocument &domDoc, QDomElement &domElementParent, + bool saveComparison (TQDomDocument &domDoc, TQDomElement &domElementParent, const Comparison &comp); - bool saveMultipleChoice(QDomDocument &domDoc, QDomElement &domElementParent, + bool saveMultipleChoice(TQDomDocument &domDoc, TQDomElement &domElementParent, const MultipleChoice &mc); private: - QFile *m_outputFile; + TQFile *m_outputFile; KEduVocDocument *m_doc; }; diff --git a/kanagram/src/leitnerbox.cpp b/kanagram/src/leitnerbox.cpp index 5a86d1fb..4161b784 100644 --- a/kanagram/src/leitnerbox.cpp +++ b/kanagram/src/leitnerbox.cpp @@ -30,7 +30,7 @@ void LeitnerBox::setVocabCount( int count ) m_vocabCount = count; } -const QString& LeitnerBox::getBoxName() const +const TQString& LeitnerBox::getBoxName() const { return m_name; } @@ -45,7 +45,7 @@ LeitnerBox* LeitnerBox::getWrongWordBox() return m_wrongWordBox; } -void LeitnerBox::setBoxName( const QString& name ) +void LeitnerBox::setBoxName( const TQString& name ) { m_name = name; } diff --git a/kanagram/src/leitnerbox.h b/kanagram/src/leitnerbox.h index bf20d6a6..1ead2d78 100644 --- a/kanagram/src/leitnerbox.h +++ b/kanagram/src/leitnerbox.h @@ -12,7 +12,7 @@ #ifndef LEITNERBOX_H #define LEITNERBOX_H -#include +#include /** @author Martin Pfeiffer @@ -26,19 +26,19 @@ public: void setCorrectWordBox( LeitnerBox* ); //sets the correct word box void setWrongWordBox( LeitnerBox* ); //sets the wrong word box - void setBoxName( const QString& ); //sets the boxes name + void setBoxName( const TQString& ); //sets the boxes name void setVocabCount( int count ); int getVocabCount(); LeitnerBox* getCorrectWordBox(); LeitnerBox* getWrongWordBox(); - const QString& getBoxName() const; + const TQString& getBoxName() const; bool operator == ( const LeitnerBox& a ) const; private: - QString m_name; + TQString m_name; int m_vocabCount; diff --git a/kanagram/src/leitnersystem.cpp b/kanagram/src/leitnersystem.cpp index 3f633526..0705c5c2 100644 --- a/kanagram/src/leitnersystem.cpp +++ b/kanagram/src/leitnersystem.cpp @@ -12,7 +12,7 @@ #include "leitnersystem.h" #include -LeitnerSystem::LeitnerSystem(QValueList& boxes, QString name) +LeitnerSystem::LeitnerSystem(TQValueList& boxes, TQString name) { if( !boxes.empty() ) m_boxes = boxes; @@ -29,10 +29,10 @@ LeitnerSystem::~LeitnerSystem() { } -QStringList LeitnerSystem::getBoxNameList() +TQStringList LeitnerSystem::getBoxNameList() { - QStringList boxNameList; - QValueList::iterator it; + TQStringList boxNameList; + TQValueList::iterator it; for(it = m_boxes.begin(); it != m_boxes.end(); ++it) @@ -53,9 +53,9 @@ LeitnerBox* LeitnerSystem::getBoxWithNumber( int number ) return &m_boxes[ number ]; } -LeitnerBox* LeitnerSystem::getBoxWithName( const QString& name ) +LeitnerBox* LeitnerSystem::getBoxWithName( const TQString& name ) { - QValueList::iterator it; + TQValueList::iterator it; for(it = m_boxes.begin(); it != m_boxes.end(); ++it) { @@ -66,12 +66,12 @@ LeitnerBox* LeitnerSystem::getBoxWithName( const QString& name ) return 0; } -QString& LeitnerSystem::getSystemName() +TQString& LeitnerSystem::getSystemName() { return m_systemName; } -const QString& LeitnerSystem::getNextBox( QString& previousBox ) +const TQString& LeitnerSystem::getNextBox( TQString& previousBox ) { for( int i = 0; i < m_boxes.count(); i++ ) { @@ -79,15 +79,15 @@ const QString& LeitnerSystem::getNextBox( QString& previousBox ) return getBox( i ); } - return QString::null; + return TQString::null; } -const QString& LeitnerSystem::getCorrectBox( int box ) +const TQString& LeitnerSystem::getCorrectBox( int box ) { return m_boxes[ box ].getCorrectWordBox()->getBoxName(); } -const QString& LeitnerSystem::getWrongBox( int box ) +const TQString& LeitnerSystem::getWrongBox( int box ) { return m_boxes[ box ].getWrongWordBox()->getBoxName(); } @@ -112,7 +112,7 @@ void LeitnerSystem::deleteBox( LeitnerBox* box ) m_boxes.remove( *box ); } -bool LeitnerSystem::insertBox( const QString& name, int correctWordBox, int wrongWordBox ) +bool LeitnerSystem::insertBox( const TQString& name, int correctWordBox, int wrongWordBox ) { if( getBoxNameList().contains( name ) != 0 ) return false; @@ -126,7 +126,7 @@ bool LeitnerSystem::insertBox( const QString& name, int correctWordBox, int wron return true; } -void LeitnerSystem::setSystemName( const QString& name ) +void LeitnerSystem::setSystemName( const TQString& name ) { m_systemName = name; } @@ -138,7 +138,7 @@ int LeitnerSystem::getNumber( LeitnerBox* box ) return m_boxes.findIndex( *box ); } -bool LeitnerSystem::setBoxName( int box, const QString& name ) +bool LeitnerSystem::setBoxName( int box, const TQString& name ) { if( getBoxWithName( name ) == 0 || getBoxWithName( name ) == getBoxWithNumber( box ) ) { @@ -150,7 +150,7 @@ bool LeitnerSystem::setBoxName( int box, const QString& name ) return false; } -bool LeitnerSystem::setBoxName( LeitnerBox* box, const QString& name ) +bool LeitnerSystem::setBoxName( LeitnerBox* box, const TQString& name ) { if( getBoxWithName( name ) == 0 || getBoxWithName( name ) == box ) { @@ -162,7 +162,7 @@ bool LeitnerSystem::setBoxName( LeitnerBox* box, const QString& name ) return false; } -bool LeitnerSystem::insertBox( const QString& name ) +bool LeitnerSystem::insertBox( const TQString& name ) { if( getBoxNameList().contains( name ) != 0 ) return false; @@ -175,17 +175,17 @@ bool LeitnerSystem::insertBox( const QString& name ) return true; } -void LeitnerSystem::setCorrectBox( const QString& box, const QString& correctWordBox ) +void LeitnerSystem::setCorrectBox( const TQString& box, const TQString& correctWordBox ) { getBoxWithName( box )->setCorrectWordBox( getBoxWithName( correctWordBox ) ); } -void LeitnerSystem::setWrongBox( const QString& box, const QString& wrongWordBox ) +void LeitnerSystem::setWrongBox( const TQString& box, const TQString& wrongWordBox ) { getBoxWithName( box )->setWrongWordBox( getBoxWithName( wrongWordBox ) ); } -const QString& LeitnerSystem::getBox( int i ) +const TQString& LeitnerSystem::getBox( int i ) { return getBoxWithNumber( i )->getBoxName(); } diff --git a/kanagram/src/leitnersystem.h b/kanagram/src/leitnersystem.h index 87e583d9..7d99a667 100644 --- a/kanagram/src/leitnersystem.h +++ b/kanagram/src/leitnersystem.h @@ -10,9 +10,9 @@ // // -#include -#include -#include +#include +#include +#include #include "leitnerbox.h" #ifndef LEITNERSYSTEM_H @@ -26,42 +26,42 @@ class LeitnerSystem { public: LeitnerSystem(); - LeitnerSystem( QValueList& boxes, QString name ); + LeitnerSystem( TQValueList& boxes, TQString name ); ~LeitnerSystem(); int getNumberOfBoxes(); //returns the number of boxes in the system - QStringList getBoxNameList(); //returns a list with the boxes names + TQStringList getBoxNameList(); //returns a list with the boxes names - QString& getSystemName(); //returns the systems name - void setSystemName( const QString& name ); //sets the systems name + TQString& getSystemName(); //returns the systems name + void setSystemName( const TQString& name ); //sets the systems name LeitnerBox* getBoxWithNumber( int number ); //returns box by number - LeitnerBox* getBoxWithName( const QString& name );//returns box by name + LeitnerBox* getBoxWithName( const TQString& name );//returns box by name int getNumber( LeitnerBox* box ); - const QString& getBox( int i ); + const TQString& getBox( int i ); - const QString& getNextBox( QString& previousBox ); //returns the next box for the next question + const TQString& getNextBox( TQString& previousBox ); //returns the next box for the next question - const QString& getCorrectBox( int box ); //returns the correct word box of "int box" - const QString& getWrongBox( int box ); //returns the wrong word box of "int box" + const TQString& getCorrectBox( int box ); //returns the correct word box of "int box" + const TQString& getWrongBox( int box ); //returns the wrong word box of "int box" int getWrongBoxNumber( int box ); int getCorrectBoxNumber( int box ); - void setCorrectBox( const QString& box, const QString& correctWordBox ); - void setWrongBox( const QString& box, const QString& wrongWordBox ); - bool setBoxName( int box, const QString& name ); - bool setBoxName( LeitnerBox* box, const QString& name ); + void setCorrectBox( const TQString& box, const TQString& correctWordBox ); + void setWrongBox( const TQString& box, const TQString& wrongWordBox ); + bool setBoxName( int box, const TQString& name ); + bool setBoxName( LeitnerBox* box, const TQString& name ); //inserts a box with number, name, correct and wrong word box - bool insertBox( const QString& name, int correctWordBox, int wrongWordBox ); - bool insertBox( const QString& name ); + bool insertBox( const TQString& name, int correctWordBox, int wrongWordBox ); + bool insertBox( const TQString& name ); void deleteBox( int box ); void deleteBox( LeitnerBox* box ); private: - QString m_systemName; //the systems name + TQString m_systemName; //the systems name - QValueList m_boxes; + TQValueList m_boxes; }; #endif diff --git a/kanagram/src/leitnersystemview.cpp b/kanagram/src/leitnersystemview.cpp index f8736471..cbbb0400 100644 --- a/kanagram/src/leitnersystemview.cpp +++ b/kanagram/src/leitnersystemview.cpp @@ -16,12 +16,12 @@ #include #include -#include +#include #include -LeitnerSystemView::LeitnerSystemView(QWidget * parent, const char* name, WFlags f) - : QScrollView(parent, name, f) +LeitnerSystemView::LeitnerSystemView(TQWidget * parent, const char* name, WFlags f) + : TQScrollView(parent, name, f) { m_highlightedBox = -1; } @@ -31,7 +31,7 @@ LeitnerSystemView::~LeitnerSystemView() { } -void LeitnerSystemView::drawSystem(QPainter* p) +void LeitnerSystemView::drawSystem(TQPainter* p) { kdDebug() << "drawSystem( )" << endl; @@ -47,7 +47,7 @@ void LeitnerSystemView::drawSystem(QPainter* p) { //p->drawPixmap(12 + i * 64 + i*10, m_imageY, KGlobal::iconLoader()->loadIcon("leitnerbox", KIcon::Panel)); p->drawRect(12 + i * 64 + i*10, m_imageY,64,64); - p->fillRect(12 + i * 64 + i*10, m_imageY,64,64, QBrush(red)); + p->fillRect(12 + i * 64 + i*10, m_imageY,64,64, TQBrush(red)); } else { //for each box 74 = 64(pixmap) + 10(distance between two boxes) @@ -57,14 +57,14 @@ void LeitnerSystemView::drawSystem(QPainter* p) } } -void LeitnerSystemView::drawConnections(QPainter* p) +void LeitnerSystemView::drawConnections(TQPainter* p) { //dist = number of boxes that are in between the two boxes //width = width of the rect for the arc int dist, width = 0; int numberOfBoxes = m_leitnerSystem->getNumberOfBoxes(); - p->setPen( QPen(green, 2) ); + p->setPen( TQPen(green, 2) ); //paint the connections for the correct word boxes, above the boxes for(int i = 0; i < numberOfBoxes; i++) @@ -89,7 +89,7 @@ void LeitnerSystemView::drawConnections(QPainter* p) } //paint the connections for the wrong word boxes, below the boxes - p->setPen(QPen(red, 2)); + p->setPen(TQPen(red, 2)); for(int i = 0; i < numberOfBoxes; i++) { @@ -118,7 +118,7 @@ void LeitnerSystemView::setSystem(LeitnerSystem* leitnersystem) updateContents(); //repaint //update(); - //QPainter* p = new QPainter(this); + //TQPainter* p = new TQPainter(this); //drawContents( p, 0, 0, 0, 0 ); } @@ -128,7 +128,7 @@ void LeitnerSystemView::highlightBox(int box) updateContents(); } -void LeitnerSystemView::drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph) +void LeitnerSystemView::drawContents(TQPainter* p, int clipx, int clipy, int clipw, int cliph) { kdDebug() << "drawContents" << endl; p->eraseRect(0,0,width(),height()); @@ -145,7 +145,7 @@ void LeitnerSystemView::calculateSize() //boxes = 64*64 int numberOfBoxes = m_leitnerSystem->getNumberOfBoxes(); - QString x; + TQString x; int height, dist, tmpMaxC, tmpMaxW; tmpMaxC = 0; tmpMaxW = 0; @@ -180,7 +180,7 @@ void LeitnerSystemView::calculateSize() setMinimumSize( numberOfBoxes * 64 + (numberOfBoxes - 1)*10 + 2 * 12, height ); } -void LeitnerSystemView::mousePressEvent(QMouseEvent* e) +void LeitnerSystemView::mousePressEvent(TQMouseEvent* e) { kdDebug() << "mouseClick" << endl; //if the user has clicked into a box diff --git a/kanagram/src/leitnersystemview.h b/kanagram/src/leitnersystemview.h index be52bc0b..9f540cdf 100644 --- a/kanagram/src/leitnersystemview.h +++ b/kanagram/src/leitnersystemview.h @@ -12,8 +12,8 @@ #ifndef LEITNERSYSTEMVIEW_H #define LEITNERSYSTEMVIEW_H -#include -#include +#include +#include class LeitnerSystem; @@ -27,7 +27,7 @@ class LeitnerSystemView : public QScrollView Q_OBJECT public: - LeitnerSystemView(QWidget* parent = 0, const char* name = 0, WFlags f = 0); + LeitnerSystemView(TQWidget* parent = 0, const char* name = 0, WFlags f = 0); ~LeitnerSystemView(); @@ -38,17 +38,17 @@ signals: void boxClicked(int box); //is emited if the user clicks on a box protected: - virtual void drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph); - virtual void mousePressEvent(QMouseEvent* e); + virtual void drawContents(TQPainter* p, int clipx, int clipy, int clipw, int cliph); + virtual void mousePressEvent(TQMouseEvent* e); private: LeitnerSystem* m_leitnerSystem; //the system which is shown - void drawSystem(QPainter*); //paints the boxes - void drawConnections(QPainter*); //paints the arrows between the boxes + void drawSystem(TQPainter*); //paints the boxes + void drawConnections(TQPainter*); //paints the arrows between the boxes void calculateSize(); - //QRect m_viewArea; + //TQRect m_viewArea; int m_imageY; //high border of the images int m_distPixmap; int m_highlightedBox; //the box which is currently highlighted diff --git a/kanagram/src/main.cpp b/kanagram/src/main.cpp index ec0265b4..5ecbb800 100644 --- a/kanagram/src/main.cpp +++ b/kanagram/src/main.cpp @@ -35,22 +35,22 @@ int main(int argc, char *argv[]) about.addCredit("Artemiy Pavlov", I18N_NOOP("Sound effects"), 0, "http://artemiolabs.com"); KCmdLineArgs::init(argc, argv, &about); KApplication app; - app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); + app.connect(&app, TQT_SIGNAL(lastWindowClosed()), &app, TQT_SLOT(quit())); KanagramSettings::setJustGotFont(false); - QFont f("squeaky chalk sound"); - if (!QFontInfo(f).exactMatch()) + TQFont f("squeaky chalk sound"); + if (!TQFontInfo(f).exactMatch()) { KanagramSettings::setUseStandardFonts(true); } if (KanagramSettings::dataLanguage().isEmpty()) { - QStringList userLanguagesCode = KGlobal::locale()->languageList(); - QStringList::const_iterator itEnd = userLanguagesCode.end(); - QStringList::const_iterator it = userLanguagesCode.begin(); + TQStringList userLanguagesCode = KGlobal::locale()->languageList(); + TQStringList::const_iterator itEnd = userLanguagesCode.end(); + TQStringList::const_iterator it = userLanguagesCode.begin(); for ( ; it != itEnd; ++it) { - QStringList mdirs = KGlobal::dirs()->findDirs("appdata", "data/" + *it); + TQStringList mdirs = KGlobal::dirs()->findDirs("appdata", "data/" + *it); if (!mdirs.isEmpty()) break; } if (it == itEnd) KanagramSettings::setDataLanguage("en"); diff --git a/kanagram/src/mainsettings.cpp b/kanagram/src/mainsettings.cpp index 660a1c5c..1e026758 100644 --- a/kanagram/src/mainsettings.cpp +++ b/kanagram/src/mainsettings.cpp @@ -19,10 +19,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -35,22 +35,22 @@ #include "mainsettings.h" #include "kanagramsettings.h" -MainSettings::MainSettings(QWidget *parent) : MainSettingsWidget(parent) +MainSettings::MainSettings(TQWidget *parent) : MainSettingsWidget(parent) { m_parent = (KConfigDialog*)parent; - connect(parent, SIGNAL(applyClicked()), this, SLOT(slotChangeTranslation())); - connect(cboxTranslation, SIGNAL(activated(int)), this, SLOT(slotUpdateParent())); + connect(parent, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(slotChangeTranslation())); + connect(cboxTranslation, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotUpdateParent())); setupTranslations(); - QStringList languageNames = m_languageCodeMap.keys(); + TQStringList languageNames = m_languageCodeMap.keys(); languageNames.sort(); cboxTranslation->insertStringList(languageNames); //the language code/name KConfig entry(locate("locale", "all_languages")); - QString code = KanagramSettings::dataLanguage(); + TQString code = KanagramSettings::dataLanguage(); entry.setGroup(code); if (code == "sr") cboxTranslation->setCurrentText(entry.readEntry("Name")+" ("+i18n("Cyrillic")+")"); @@ -62,7 +62,7 @@ MainSettings::MainSettings(QWidget *parent) : MainSettingsWidget(parent) else cboxTranslation->setCurrentText(entry.readEntry("Name")); - QFont f("squeaky chalk sound"); + TQFont f("squeaky chalk sound"); if (KanagramSettings::justGotFont()) { getFontsButton->hide(); @@ -70,10 +70,10 @@ MainSettings::MainSettings(QWidget *parent) : MainSettingsWidget(parent) } else { - if (!QFontInfo(f).exactMatch()) + if (!TQFontInfo(f).exactMatch()) { kcfg_useStandardFonts->setEnabled(false); - connect(getFontsButton, SIGNAL(pressed()), this, SLOT(getAndInstallFont())); + connect(getFontsButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(getAndInstallFont())); } else { @@ -94,20 +94,20 @@ void MainSettings::slotUpdateParent() void MainSettings::setupTranslations() { m_languageCodeMap.clear(); - QStringList languages, temp_languages; + TQStringList languages, temp_languages; //the program scans in kdereview/data/ to see what languages data is found - QStringList mdirs = KGlobal::dirs()->findDirs("appdata", "data/"); + TQStringList mdirs = KGlobal::dirs()->findDirs("appdata", "data/"); if (mdirs.isEmpty()) return; - for (QStringList::const_iterator it = mdirs.begin(); it != mdirs.end(); ++it ) + for (TQStringList::const_iterator it = mdirs.begin(); it != mdirs.end(); ++it ) { - QDir dir(*it); - temp_languages = dir.entryList(QDir::Dirs, QDir::Name); + TQDir dir(*it); + temp_languages = dir.entryList(TQDir::Dirs, TQDir::Name); temp_languages.remove("."); temp_languages.remove(".."); - for (QStringList::const_iterator it2 = temp_languages.begin(); it2 != temp_languages.end(); ++it2 ) + for (TQStringList::const_iterator it2 = temp_languages.begin(); it2 != temp_languages.end(); ++it2 ) { if (!languages.contains(*it2)) languages.append(*it2); } @@ -118,8 +118,8 @@ void MainSettings::setupTranslations() //the language code/name KConfig entry(locate("locale", "all_languages")); - const QStringList::ConstIterator itEnd = languages.end(); - for (QStringList::ConstIterator it = languages.begin(); it != itEnd; ++it) { + const TQStringList::ConstIterator itEnd = languages.end(); + for (TQStringList::ConstIterator it = languages.begin(); it != itEnd; ++it) { entry.setGroup(*it); if (*it == "sr") m_languageCodeMap.insert(entry.readEntry("Name")+" ("+i18n("Cyrillic")+")", "sr"); diff --git a/kanagram/src/mainsettings.h b/kanagram/src/mainsettings.h index 3763a047..172b5276 100644 --- a/kanagram/src/mainsettings.h +++ b/kanagram/src/mainsettings.h @@ -31,7 +31,7 @@ class MainSettings : public MainSettingsWidget { Q_OBJECT public: - MainSettings(QWidget *parent); + MainSettings(TQWidget *parent); ~MainSettings(); public slots: @@ -42,7 +42,7 @@ Q_OBJECT void getAndInstallFont(); private: - QMap m_languageCodeMap; + TQMap m_languageCodeMap; void setupTranslations(); KConfigDialog *m_parent; diff --git a/kanagram/src/multiplechoice.cpp b/kanagram/src/multiplechoice.cpp index b27350c3..dcf784ef 100644 --- a/kanagram/src/multiplechoice.cpp +++ b/kanagram/src/multiplechoice.cpp @@ -26,11 +26,11 @@ #include "multiplechoice.h" MultipleChoice::MultipleChoice ( - const QString &mc1, - const QString &mc2, - const QString &mc3, - const QString &mc4, - const QString &mc5 + const TQString &mc1, + const TQString &mc2, + const TQString &mc3, + const TQString &mc4, + const TQString &mc5 ) { setMC1 (mc1); @@ -61,7 +61,7 @@ void MultipleChoice::clear() } -QString MultipleChoice::mc (unsigned idx) const +TQString MultipleChoice::mc (unsigned idx) const { switch (idx) { case 0: return muc1; diff --git a/kanagram/src/multiplechoice.h b/kanagram/src/multiplechoice.h index 6a0b0500..f5fe4800 100644 --- a/kanagram/src/multiplechoice.h +++ b/kanagram/src/multiplechoice.h @@ -27,7 +27,7 @@ #ifndef MultipleChoice_included #define MultipleChoice_included -#include +#include #define MAX_MULTIPLE_CHOICE 5 // select one out of x @@ -39,26 +39,26 @@ public: MultipleChoice() {} MultipleChoice ( - const QString &mc1, - const QString &mc2, - const QString &mc3, - const QString &mc4, - const QString &mc5 + const TQString &mc1, + const TQString &mc2, + const TQString &mc3, + const TQString &mc4, + const TQString &mc5 ); - void setMC1 (const QString &s) { muc1 = s; } - void setMC2 (const QString &s) { muc2 = s; } - void setMC3 (const QString &s) { muc3 = s; } - void setMC4 (const QString &s) { muc4 = s; } - void setMC5 (const QString &s) { muc5 = s; } + void setMC1 (const TQString &s) { muc1 = s; } + void setMC2 (const TQString &s) { muc2 = s; } + void setMC3 (const TQString &s) { muc3 = s; } + void setMC4 (const TQString &s) { muc4 = s; } + void setMC5 (const TQString &s) { muc5 = s; } - QString mc1 () const { return muc1; } - QString mc2 () const { return muc2; } - QString mc3 () const { return muc3; } - QString mc4 () const { return muc4; } - QString mc5 () const { return muc5; } + TQString mc1 () const { return muc1; } + TQString mc2 () const { return muc2; } + TQString mc3 () const { return muc3; } + TQString mc4 () const { return muc4; } + TQString mc5 () const { return muc5; } - QString mc (unsigned idx) const; + TQString mc (unsigned idx) const; bool isEmpty() const; void normalize(); @@ -67,7 +67,7 @@ public: protected: - QString muc1, muc2, muc3, muc4, muc5; + TQString muc1, muc2, muc3, muc4, muc5; }; diff --git a/kanagram/src/newstuff.cpp b/kanagram/src/newstuff.cpp index 19c28272..7c72f938 100644 --- a/kanagram/src/newstuff.cpp +++ b/kanagram/src/newstuff.cpp @@ -1,7 +1,7 @@ #include "newstuff.h" -#include -#include +#include +#include #include #include @@ -11,9 +11,9 @@ #include "kanagramsettings.h" #include "newstuffdialog.h" -NewStuff::NewStuff(QWidget *parent) : NewStuffWidget(parent) +NewStuff::NewStuff(TQWidget *parent) : NewStuffWidget(parent) { - connect(btnGetNew, SIGNAL(clicked()), this, SLOT(slotGetNewVocabs())); + connect(btnGetNew, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGetNewVocabs())); } NewStuff::~NewStuff() diff --git a/kanagram/src/newstuff.h b/kanagram/src/newstuff.h index 2429cca7..cad963f7 100644 --- a/kanagram/src/newstuff.h +++ b/kanagram/src/newstuff.h @@ -7,7 +7,7 @@ class NewStuff : public NewStuffWidget { Q_OBJECT public: - NewStuff(QWidget *parent); + NewStuff(TQWidget *parent); ~NewStuff(); private slots: diff --git a/kanagram/src/newstuffdialog.cpp b/kanagram/src/newstuffdialog.cpp index d58ad56d..302059df 100644 --- a/kanagram/src/newstuffdialog.cpp +++ b/kanagram/src/newstuffdialog.cpp @@ -17,19 +17,19 @@ NewStuffDialog::~NewStuffDialog() { } -bool NewStuffDialog::install(const QString &fileName) +bool NewStuffDialog::install(const TQString &fileName) { return false; } -QString NewStuffDialog::downloadDestination(KNS::Entry *entry) +TQString NewStuffDialog::downloadDestination(KNS::Entry *entry) { - QString fileName = entry->payload().path(); + TQString fileName = entry->payload().path(); fileName = fileName.section('/', -1); return KGlobal::dirs()->saveLocation("data", "kanagram/data/" + KanagramSettings::dataLanguage()) + fileName; } -bool NewStuffDialog::createUploadFile(const QString &fileName) +bool NewStuffDialog::createUploadFile(const TQString &fileName) { return false; } diff --git a/kanagram/src/newstuffdialog.h b/kanagram/src/newstuffdialog.h index f0441623..7c61f12e 100644 --- a/kanagram/src/newstuffdialog.h +++ b/kanagram/src/newstuffdialog.h @@ -8,9 +8,9 @@ class NewStuffDialog : public KNewStuff public: NewStuffDialog(); ~NewStuffDialog(); - bool install(const QString &fileName); - bool createUploadFile(const QString &fileName); - QString downloadDestination(KNS::Entry *entry); + bool install(const TQString &fileName); + bool createUploadFile(const TQString &fileName); + TQString downloadDestination(KNS::Entry *entry); }; #endif diff --git a/kanagram/src/vocabedit.cpp b/kanagram/src/vocabedit.cpp index 7079e566..46a81450 100644 --- a/kanagram/src/vocabedit.cpp +++ b/kanagram/src/vocabedit.cpp @@ -21,12 +21,12 @@ #include "vocabedit.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ #include "kanagramsettings.h" -VocabEdit::VocabEdit(QWidget *parent, QString fileName) : VocabEditWidget(parent), m_fileName("") +VocabEdit::VocabEdit(TQWidget *parent, TQString fileName) : VocabEditWidget(parent), m_fileName("") { if(fileName != "") { @@ -58,20 +58,20 @@ VocabEdit::VocabEdit(QWidget *parent, QString fileName) : VocabEditWidget(parent txtDescription->setText(doc->getDocRemark()); } - connect(btnSave, SIGNAL(clicked()), this, SLOT(slotSave())); - connect(btnNewWord, SIGNAL(clicked()), this, SLOT(slotNewWord())); - connect(btnRemoveWord, SIGNAL(clicked()), this, SLOT(slotRemoveWord())); - connect(btnClose, SIGNAL(clicked()), this, SLOT(slotClose())); + connect(btnSave, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSave())); + connect(btnNewWord, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewWord())); + connect(btnRemoveWord, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRemoveWord())); + connect(btnClose, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClose())); - connect(txtWord, SIGNAL(textChanged(const QString &)), this, SLOT(slotWordTextChanged(const QString &))); - connect(txtHint, SIGNAL(textChanged(const QString &)), this, SLOT(slotHintTextChanged(const QString &))); + connect(txtWord, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotWordTextChanged(const TQString &))); + connect(txtHint, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotHintTextChanged(const TQString &))); //Connect the name and description boxes to a general textChanged slot, so that we can keep track of //whether they've been changed or not - connect(txtVocabName, SIGNAL(textChanged(const QString &)), this, SLOT(slotTextChanged(const QString &))); - connect(txtDescription, SIGNAL(textChanged(const QString &)), this, SLOT(slotTextChanged(const QString &))); + connect(txtVocabName, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotTextChanged(const TQString &))); + connect(txtDescription, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotTextChanged(const TQString &))); - connect(lboxWords, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); + connect(lboxWords, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged())); //Has anything in the dialog changed? m_textChanged = false; @@ -91,7 +91,7 @@ void VocabEdit::slotSave() doc->appendEntry(&m_vocabList[i]); } - QString fileName; + TQString fileName; if(m_fileName == "") { fileName = KGlobal::dirs()->saveLocation("data", "kanagram/data/" + KanagramSettings::dataLanguage()) + txtVocabName->text().lower().replace(" ", "") + ".kvtml"; @@ -140,18 +140,18 @@ void VocabEdit::slotNewWord() void VocabEdit::slotSelectionChanged() { //A little hack to make things work right - disconnect(txtWord, SIGNAL(textChanged(const QString &)), this, SLOT(slotWordTextChanged(const QString &))); - disconnect(txtHint, SIGNAL(textChanged(const QString &)), this, SLOT(slotHintTextChanged(const QString &))); + disconnect(txtWord, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotWordTextChanged(const TQString &))); + disconnect(txtHint, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotHintTextChanged(const TQString &))); if(lboxWords->currentItem() >= 0) { txtWord->setText(m_vocabList[lboxWords->currentItem()].getOriginal()); txtHint->setText(m_vocabList[lboxWords->currentItem()].getRemark(0)); } - connect(txtWord, SIGNAL(textChanged(const QString &)), this, SLOT(slotWordTextChanged(const QString &))); - connect(txtHint, SIGNAL(textChanged(const QString &)), this, SLOT(slotHintTextChanged(const QString &))); + connect(txtWord, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotWordTextChanged(const TQString &))); + connect(txtHint, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotHintTextChanged(const TQString &))); } -void VocabEdit::slotWordTextChanged(const QString &changes) +void VocabEdit::slotWordTextChanged(const TQString &changes) { //Make sure there actually is a currentItem() if(lboxWords->currentItem() != -1) @@ -164,7 +164,7 @@ void VocabEdit::slotWordTextChanged(const QString &changes) m_textChanged = true; } -void VocabEdit::slotHintTextChanged(const QString &changes) +void VocabEdit::slotHintTextChanged(const TQString &changes) { //Make sure there actually is a currentItem() if(lboxWords->currentItem() != -1) @@ -174,7 +174,7 @@ void VocabEdit::slotHintTextChanged(const QString &changes) m_textChanged = true; } -void VocabEdit::slotTextChanged(const QString &changes) +void VocabEdit::slotTextChanged(const TQString &changes) { //Make sure we know when text has been modified and not saved, so we //can notify the user diff --git a/kanagram/src/vocabedit.h b/kanagram/src/vocabedit.h index 342f71cb..d4e84238 100644 --- a/kanagram/src/vocabedit.h +++ b/kanagram/src/vocabedit.h @@ -25,7 +25,7 @@ #include "vocabeditwidget.h" -#include +#include class KEduVocExpression; @@ -33,8 +33,8 @@ class VocabEdit : public VocabEditWidget { Q_OBJECT public: - VocabEdit(QWidget *parent); - VocabEdit(QWidget *parent, QString fileName); + VocabEdit(TQWidget *parent); + VocabEdit(TQWidget *parent, TQString fileName); ~VocabEdit(); public slots: @@ -43,13 +43,13 @@ Q_OBJECT void slotNewWord(); void slotRemoveWord(); void slotSelectionChanged(); - void slotWordTextChanged(const QString &changes); - void slotHintTextChanged(const QString &changes); - void slotTextChanged(const QString &changes); + void slotWordTextChanged(const TQString &changes); + void slotHintTextChanged(const TQString &changes); + void slotTextChanged(const TQString &changes); private: - QValueVector m_vocabList; - QString m_fileName; + TQValueVector m_vocabList; + TQString m_fileName; bool m_textChanged; }; diff --git a/kanagram/src/vocabsettings.cpp b/kanagram/src/vocabsettings.cpp index c7b41ba7..730f9216 100644 --- a/kanagram/src/vocabsettings.cpp +++ b/kanagram/src/vocabsettings.cpp @@ -1,27 +1,27 @@ #include "vocabsettings.h" #include "vocabedit.h" -#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "keduvocdocument.h" #include "kanagramsettings.h" -VocabSettings::VocabSettings(QWidget *parent) : VocabSettingsWidget(parent) +VocabSettings::VocabSettings(TQWidget *parent) : VocabSettingsWidget(parent) { - connect(btnCreateNew, SIGNAL(clicked()), this, SLOT(slotCreateNew())); - connect(btnEdit, SIGNAL(clicked()), this, SLOT(slotEdit())); - connect(btnDelete, SIGNAL(clicked()), this, SLOT(slotDelete())); - connect(lviewVocab, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(slotSelectionChanged(QListViewItem *))); + connect(btnCreateNew, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCreateNew())); + connect(btnEdit, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEdit())); + connect(btnDelete, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDelete())); + connect(lviewVocab, TQT_SIGNAL(selectionChanged(TQListViewItem *)), this, TQT_SLOT(slotSelectionChanged(TQListViewItem *))); refreshView(); } @@ -39,7 +39,7 @@ void VocabSettings::refreshView() { KEduVocDocument *doc = new KEduVocDocument(this); doc->open(KURL(m_fileList[i]), false); - QListViewItem *item = new QListViewItem(lviewVocab, 0); + TQListViewItem *item = new TQListViewItem(lviewVocab, 0); item->setText( 0, doc->getTitle() ); item->setText( 1, doc->getDocRemark() ); m_itemMap[item] = i; @@ -61,7 +61,7 @@ void VocabSettings::slotDelete() if(lviewVocab->selectedItem()) { int index = m_itemMap[lviewVocab->selectedItem()]; - /*bool itWorked = */QFile::remove(m_fileList[index]); + /*bool itWorked = */TQFile::remove(m_fileList[index]); } refreshView(); @@ -73,10 +73,10 @@ void VocabSettings::slotCreateNew() vocabEdit->show(); } -void VocabSettings::slotSelectionChanged(QListViewItem *item) +void VocabSettings::slotSelectionChanged(TQListViewItem *item) { int index = m_itemMap[item]; - QFileInfo info = QFileInfo(m_fileList[index]); + TQFileInfo info = TQFileInfo(m_fileList[index]); if(!info.isWritable()) { btnDelete->setEnabled(false); diff --git a/kanagram/src/vocabsettings.h b/kanagram/src/vocabsettings.h index d321ee2f..7b86720f 100644 --- a/kanagram/src/vocabsettings.h +++ b/kanagram/src/vocabsettings.h @@ -7,19 +7,19 @@ class VocabSettings : public VocabSettingsWidget { Q_OBJECT public: - VocabSettings(QWidget *parent); + VocabSettings(TQWidget *parent); ~VocabSettings(); void refreshView(); private: - QStringList m_fileList; - QMap m_itemMap; + TQStringList m_fileList; + TQMap m_itemMap; private slots: void slotCreateNew(); void slotEdit(); void slotDelete(); - void slotSelectionChanged(QListViewItem *item); + void slotSelectionChanged(TQListViewItem *item); }; #endif diff --git a/kbruch/src/exercisebase.cpp b/kbruch/src/exercisebase.cpp index f8d376c5..649bb6c8 100644 --- a/kbruch/src/exercisebase.cpp +++ b/kbruch/src/exercisebase.cpp @@ -25,8 +25,8 @@ /* ----- public member functions ----- */ /* constructor */ -ExerciseBase::ExerciseBase(QWidget * parent, const char * name): - QWidget(parent, name) +ExerciseBase::ExerciseBase(TQWidget * parent, const char * name): + TQWidget(parent, name) { #ifdef DEBUG kdDebug() << "constructor ExerciseBase()" << endl; diff --git a/kbruch/src/exercisebase.h b/kbruch/src/exercisebase.h index a43992e7..87fe03b5 100644 --- a/kbruch/src/exercisebase.h +++ b/kbruch/src/exercisebase.h @@ -25,9 +25,9 @@ #include #endif -#include +#include -/*! Constructs a QWidget. +/*! Constructs a TQWidget. * * It is the base class for showing the different exercises. * @@ -39,7 +39,7 @@ class ExerciseBase : public QWidget public: /** constructor */ - ExerciseBase(QWidget * parent = 0, const char * name = 0); + ExerciseBase(TQWidget * parent = 0, const char * name = 0); /** destructor */ ~ExerciseBase(); diff --git a/kbruch/src/exercisecompare.cpp b/kbruch/src/exercisecompare.cpp index c0d6466d..f6652e56 100644 --- a/kbruch/src/exercisecompare.cpp +++ b/kbruch/src/exercisecompare.cpp @@ -23,11 +23,11 @@ #include /* these includes are needed for Qt support */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* standard C++ library includes */ #include @@ -35,7 +35,7 @@ /* ----- public member functions ----- */ /* constructor */ -ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name): +ExerciseCompare::ExerciseCompare(TQWidget * parent, const char * name): ExerciseBase(parent, name) { #ifdef DEBUG @@ -43,31 +43,31 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name): #endif /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ createTask(); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // the next thing to do on a button click would be to check the entered // result m_currentState = _CHECK_TASK; - baseWidget = new QWidget(this, "baseWidget"); - baseGrid = new QGridLayout(this, 1, 1, 0, -1, "baseGrid"); + baseWidget = new TQWidget(this, "baseWidget"); + baseGrid = new TQGridLayout(this, 1, 1, 0, -1, "baseGrid"); baseGrid->addWidget(baseWidget, 0, 0); // this is a VBox - realLayout = new QVBoxLayout(baseWidget, 5, 5, "realLayout"); + realLayout = new TQVBoxLayout(baseWidget, 5, 5, "realLayout"); // add a spacer at the top of the VBox - QSpacerItem * v_spacer = new QSpacerItem(1, 1); + TQSpacerItem * v_spacer = new TQSpacerItem(1, 1); realLayout->addItem(v_spacer); // now a line holding the task, input fields and result - QHBoxLayout * taskLineHBoxLayout = new QHBoxLayout(5, "taskLineHBoxLayout"); + TQHBoxLayout * taskLineHBoxLayout = new TQHBoxLayout(5, "taskLineHBoxLayout"); realLayout->addLayout(taskLineHBoxLayout); // spacer - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); taskLineHBoxLayout->addItem(v_spacer); // first the first ratio widget @@ -75,22 +75,22 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name): taskLineHBoxLayout->addWidget(m_firstRatioWidget); // spacer - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); taskLineHBoxLayout->addItem(v_spacer); // now the button where the user has to choose the comparison sign - m_signButton = new QPushButton(baseWidget, "m_signButton"); + m_signButton = new TQPushButton(baseWidget, "m_signButton"); // RTL BUG, see slotSignButtonClicked() for more information - m_signButton->setText( QApplication::reverseLayout()?">":"<"); + m_signButton->setText( TQApplication::reverseLayout()?">":"<"); m_signButtonState = lessThen; taskLineHBoxLayout->addWidget(m_signButton); - QObject::connect(m_signButton, SIGNAL(clicked()), this, SLOT(slotSignButtonClicked())); - QToolTip::add(m_signButton, i18n("Click on this button to change the comparison sign.")); + TQObject::connect(m_signButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSignButtonClicked())); + TQToolTip::add(m_signButton, i18n("Click on this button to change the comparison sign.")); // spacer - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); taskLineHBoxLayout->addItem(v_spacer); // now the second ratio widget @@ -98,11 +98,11 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name): taskLineHBoxLayout->addWidget(m_secondRatioWidget); // spacer - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); taskLineHBoxLayout->addItem(v_spacer); // at the right end we have a label just showing CORRECT or WRONG - result_label = new QLabel(baseWidget, "result_label"); + result_label = new TQLabel(baseWidget, "result_label"); result_label->setText(i18n("WRONG")); taskLineHBoxLayout->addWidget(result_label); result_label->hide(); @@ -110,21 +110,21 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name): // --- that is the end of the horizontal line --- // add another spacer in the middle of the VBox - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); realLayout->addItem(v_spacer); // the lower part of the VBox holds just a right aligned button - QHBoxLayout * lowerHBox = new QHBoxLayout(1, "lowerHBox"); + TQHBoxLayout * lowerHBox = new TQHBoxLayout(1, "lowerHBox"); realLayout->addLayout(lowerHBox); lowerHBox->addStretch(100); // the right aligned button - m_checkButton = new QPushButton( baseWidget, "m_checkButton" ); + m_checkButton = new TQPushButton( baseWidget, "m_checkButton" ); m_checkButton->setText(i18n("&Check Task")); m_checkButton->setDefault(true); // is the default button of the dialog - QToolTip::add(m_checkButton, i18n("Click on this button to check your result.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result.")); lowerHBox->addWidget(m_checkButton, 1, Qt::AlignRight); - QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked())); + TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked())); // that the user can start typing without moving the focus m_signButton->setFocus(); @@ -133,8 +133,8 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name): baseWidget->show(); // add tooltip and qwhatsthis help to the widget - QToolTip::add(this, i18n("In this exercise you have to compare 2 given fractions.")); - QWhatsThis::add(this, i18n("In this exercise you have to compare 2 given fractions by choosing the correct comparison sign. You can change the comparison sign by just clicking on the button showing the sign.")); + TQToolTip::add(this, i18n("In this exercise you have to compare 2 given fractions.")); + TQWhatsThis::add(this, i18n("In this exercise you have to compare 2 given fractions by choosing the correct comparison sign. You can change the comparison sign by just clicking on the button showing the sign.")); } /* destructor */ @@ -178,7 +178,7 @@ void ExerciseCompare::update() m_secondRatioWidget->updateAndRepaint(); // update for itself - ((QWidget *) this)->update(); + ((TQWidget *) this)->update(); } @@ -203,12 +203,12 @@ void ExerciseCompare::createTask() - emits signals if task was solved correctly or wrong */ void ExerciseCompare::showResult() { - QPalette pal; - QColorGroup cg; + TQPalette pal; + TQColorGroup cg; bool result = m_firstRatio < m_secondRatio; // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); // disable sign button m_signButton->setEnabled(false); @@ -223,10 +223,10 @@ void ExerciseCompare::showResult() result_label->setText(i18n("CORRECT")); pal = result_label->palette(); /* set green font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setInactive(cg); result_label->setPalette(pal); result_label->show(); /* show the result at the end of the task */ @@ -238,10 +238,10 @@ void ExerciseCompare::showResult() result_label->setText(i18n("WRONG")); pal = result_label->palette(); /* set red font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setInactive(cg); result_label->setPalette(pal); @@ -255,7 +255,7 @@ void ExerciseCompare::showResult() void ExerciseCompare::nextTask() { // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to check your result.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result.")); // enable sign button m_signButton->setEnabled(true); @@ -264,13 +264,13 @@ void ExerciseCompare::nextTask() // reset the signButton // RTL BUG, see slotSignButtonClicked() for more information - m_signButton->setText( QApplication::reverseLayout()?">":"<"); + m_signButton->setText( TQApplication::reverseLayout()?">":"<"); m_signButtonState = lessThen; /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ createTask(); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // set the ratio widgets with the new ratios m_firstRatioWidget->setRatio(m_firstRatio); @@ -316,10 +316,10 @@ void ExerciseCompare::slotSignButtonClicked() if (m_signButtonState == lessThen) { - m_signButton->setText( QApplication::reverseLayout()?"<":">"); + m_signButton->setText( TQApplication::reverseLayout()?"<":">"); m_signButtonState = greaterThen; } else { - m_signButton->setText( QApplication::reverseLayout()?">":"<"); + m_signButton->setText( TQApplication::reverseLayout()?">":"<"); m_signButtonState = lessThen; } diff --git a/kbruch/src/exercisecompare.h b/kbruch/src/exercisecompare.h index a1c656c2..67d16c61 100644 --- a/kbruch/src/exercisecompare.h +++ b/kbruch/src/exercisecompare.h @@ -34,9 +34,9 @@ class QPushButton; class QVBoxLayout; -#include +#include -/*! Constructs a QWidget, which shows the task to the user. +/*! Constructs a TQWidget, which shows the task to the user. * The class also provides input fields, so that the user can enter the result. * It also controls the interaction, so that the entered result gets checked * and a new task can be generated. @@ -48,7 +48,7 @@ class ExerciseCompare : public ExerciseBase public: /** constructor */ - ExerciseCompare(QWidget * parent = 0, const char * name = 0); + ExerciseCompare(TQWidget * parent = 0, const char * name = 0); /** destructor */ ~ExerciseCompare(); @@ -72,13 +72,13 @@ private: RatioWidget* m_firstRatioWidget; RatioWidget* m_secondRatioWidget; - QPushButton* m_checkButton; - QPushButton* m_signButton; - QLabel* result_label; + TQPushButton* m_checkButton; + TQPushButton* m_signButton; + TQLabel* result_label; - QGridLayout* baseGrid; - QWidget* baseWidget; - QVBoxLayout* realLayout; + TQGridLayout* baseGrid; + TQWidget* baseWidget; + TQVBoxLayout* realLayout; ratio m_firstRatio; ratio m_secondRatio; diff --git a/kbruch/src/exerciseconvert.cpp b/kbruch/src/exerciseconvert.cpp index 1207ecbf..967c960d 100644 --- a/kbruch/src/exerciseconvert.cpp +++ b/kbruch/src/exerciseconvert.cpp @@ -25,12 +25,12 @@ #include /* these includes are needed for Qt support */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* standard C++ library includes */ #include @@ -41,7 +41,7 @@ /* ----- public member functions ----- */ /* constructor */ -ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name): +ExerciseConvert::ExerciseConvert(TQWidget * parent, const char * name): ExerciseBase(parent, name) { #ifdef DEBUG @@ -49,27 +49,27 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name): #endif /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ createTask(); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // the next thing to do on a button click would be to check the entered // result m_currentState = _CHECK_TASK; - baseWidget = new QWidget(this, "baseWidget"); - baseGrid = new QGridLayout(this, 1, 1, 0, -1, "baseGrid"); + baseWidget = new TQWidget(this, "baseWidget"); + baseGrid = new TQGridLayout(this, 1, 1, 0, -1, "baseGrid"); baseGrid->addWidget(baseWidget, 0, 0); // this is a VBox - realLayout = new QVBoxLayout(baseWidget, 5, 5, "realLayout"); + realLayout = new TQVBoxLayout(baseWidget, 5, 5, "realLayout"); // add a spacer at the top of the VBox - QSpacerItem * v_spacer = new QSpacerItem(1, 1); + TQSpacerItem * v_spacer = new TQSpacerItem(1, 1); realLayout->addItem(v_spacer); // now a line holding the task, input fields and result - QHBoxLayout * taskLineHBoxLayout = new QHBoxLayout(5, "taskLineHBoxLayout"); + TQHBoxLayout * taskLineHBoxLayout = new TQHBoxLayout(5, "taskLineHBoxLayout"); realLayout->addLayout(taskLineHBoxLayout); // first left is the rational widget @@ -77,28 +77,28 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name): // taskLineHBoxLayout->addWidget(m_rationalWidget); // now we have the input fields aligned in a VBox - QVBoxLayout * inputLayout = new QVBoxLayout(5, "inputLayout"); + TQVBoxLayout * inputLayout = new TQVBoxLayout(5, "inputLayout"); // taskLineHBoxLayout->addLayout(inputLayout); // to validate, that the input is an int KIntValidator *valnum = new KIntValidator( this ); /* add input box so the user can enter numerator */ - numer_edit = new QLineEdit(baseWidget, "numer_edit"); + numer_edit = new TQLineEdit(baseWidget, "numer_edit"); numer_edit->setValidator( valnum ); // use the int validator - QToolTip::add(numer_edit, i18n("Enter the numerator of your result")); + TQToolTip::add(numer_edit, i18n("Enter the numerator of your result")); inputLayout->addWidget(numer_edit); /* add a line between the edit boxes */ - edit_line = new QFrame(baseWidget, "edit_line"); - edit_line->setGeometry(QRect(100, 100, 20, 20)); - edit_line->setFrameStyle(QFrame::HLine | QFrame::Sunken); + edit_line = new TQFrame(baseWidget, "edit_line"); + edit_line->setGeometry(TQRect(100, 100, 20, 20)); + edit_line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); inputLayout->addWidget(edit_line); /* add input box so the user can enter denominator */ - deno_edit = new QLineEdit(baseWidget, "deno_edit"); + deno_edit = new TQLineEdit(baseWidget, "deno_edit"); deno_edit->setValidator( valnum ); // use the int validator - QToolTip::add(deno_edit, i18n("Enter the denominator of your result")); + TQToolTip::add(deno_edit, i18n("Enter the denominator of your result")); inputLayout->addWidget(deno_edit); // next is the result widget @@ -107,13 +107,13 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name): m_resultWidget->hide(); // at the right end we have a label just showing CORRECT or WRONG - result_label = new QLabel(baseWidget, "result_lable"); + result_label = new TQLabel(baseWidget, "result_lable"); result_label->setText(i18n("WRONG")); // taskLineHBoxLayout->addWidget(result_label); result_label->hide(); // add another spacer in the middle of the VBox - v_spacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); + v_spacer = new TQSpacerItem(1, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum); // taskLineHBoxLayout->addItem(v_spacer); // --- that is the end of the horizontal line --- @@ -126,7 +126,7 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name): // // if you need help with this feel free to contact me - Diego ) // This should fix parts of bug #116831 - if (QApplication::reverseLayout()) + if (TQApplication::reverseLayout()) { taskLineHBoxLayout->addItem(v_spacer); taskLineHBoxLayout->addWidget(result_label); @@ -144,21 +144,21 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name): } // add another spacer in the middle of the VBox - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); realLayout->addItem(v_spacer); // the lower part of the VBox holds just a right aligned button - QHBoxLayout * lowerHBox = new QHBoxLayout(1, "lowerHBox"); + TQHBoxLayout * lowerHBox = new TQHBoxLayout(1, "lowerHBox"); realLayout->addLayout(lowerHBox); lowerHBox->addStretch(100); // the right aligned button - m_checkButton = new QPushButton( baseWidget, "m_checkButton" ); + m_checkButton = new TQPushButton( baseWidget, "m_checkButton" ); m_checkButton->setText(i18n("&Check Task")); m_checkButton->setDefault(true); // is the default button of the dialog - QToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); lowerHBox->addWidget(m_checkButton, 1, Qt::AlignRight); - QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked())); + TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked())); // that the user can start typing without moving the focus numer_edit->setFocus(); @@ -167,8 +167,8 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name): baseWidget->show(); // add tooltip and qwhatsthis help to the widget - QToolTip::add(this, i18n("In this exercise you have to convert a number into a fraction.")); - QWhatsThis::add(this, i18n("In this exercise you have to convert a given number into a fraction by entering numerator and denominator. Do not forget to reduce the result!")); + TQToolTip::add(this, i18n("In this exercise you have to convert a number into a fraction.")); + TQWhatsThis::add(this, i18n("In this exercise you have to convert a given number into a fraction by entering numerator and denominator. Do not forget to reduce the result!")); } /* destructor */ @@ -212,7 +212,7 @@ void ExerciseConvert::update() m_resultWidget->updateAndRepaint(); // update for itself - ((QWidget *) this)->update(); + ((TQWidget *) this)->update(); } @@ -329,13 +329,13 @@ void ExerciseConvert::createTask() - emits signals if task was solved correctly or wrong */ void ExerciseConvert::showResult() { - QString tmp_str; /* to build a string for a label */ - QPalette pal; - QColorGroup cg; + TQString tmp_str; /* to build a string for a label */ + TQPalette pal; + TQColorGroup cg; ratio entered_result; // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); numer_edit->setEnabled(false); deno_edit->setEnabled(false); @@ -372,10 +372,10 @@ void ExerciseConvert::showResult() result_label->setText(i18n("CORRECT")); pal = result_label->palette(); /* set green font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setInactive(cg); result_label->setPalette(pal); result_label->show(); /* show the result at the end of the task */ @@ -387,10 +387,10 @@ void ExerciseConvert::showResult() result_label->setText(i18n("WRONG")); pal = result_label->palette(); /* set red font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setInactive(cg); result_label->setPalette(pal); @@ -420,7 +420,7 @@ void ExerciseConvert::showResult() void ExerciseConvert::nextTask() { // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); numer_edit->setEnabled(true); deno_edit->setEnabled(true); @@ -434,9 +434,9 @@ void ExerciseConvert::nextTask() numer_edit->setFocus(); /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ createTask(); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // update the task widget m_rationalWidget->setRational(m_number, m_periodStart, m_periodLength); diff --git a/kbruch/src/exerciseconvert.h b/kbruch/src/exerciseconvert.h index cfbb3e0c..c4b8ff31 100644 --- a/kbruch/src/exerciseconvert.h +++ b/kbruch/src/exerciseconvert.h @@ -46,7 +46,7 @@ class ExerciseConvert : public ExerciseBase public: /** constructor */ - ExerciseConvert(QWidget * parent = 0, const char * name = 0); + ExerciseConvert(TQWidget * parent = 0, const char * name = 0); /** destructor */ ~ExerciseConvert(); @@ -68,23 +68,23 @@ signals: private: short m_currentState; - QString m_number; + TQString m_number; uint m_periodStart; uint m_periodLength; ratio m_result; RationalWidget* m_rationalWidget; ResultWidget* m_resultWidget; - QLineEdit* numer_edit; - QFrame* edit_line; - QLineEdit* deno_edit; + TQLineEdit* numer_edit; + TQFrame* edit_line; + TQLineEdit* deno_edit; - QPushButton* m_checkButton; - QLabel* result_label; + TQPushButton* m_checkButton; + TQLabel* result_label; - QGridLayout* baseGrid; - QWidget* baseWidget; - QVBoxLayout* realLayout; + TQGridLayout* baseGrid; + TQWidget* baseWidget; + TQVBoxLayout* realLayout; void createTask(); void showResult(); diff --git a/kbruch/src/exercisefactorize.cpp b/kbruch/src/exercisefactorize.cpp index b411e032..3a2d64dd 100644 --- a/kbruch/src/exercisefactorize.cpp +++ b/kbruch/src/exercisefactorize.cpp @@ -25,12 +25,12 @@ #include /* these includes are needed for Qt support */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* standard C++ library includes */ #include @@ -44,27 +44,27 @@ /* ----- public member functions ----- */ /* constructor */ -ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name): +ExerciseFactorize::ExerciseFactorize(TQWidget * parent, const char * name): ExerciseBase(parent, name) { - QPalette pal; - QColorGroup cg; + TQPalette pal; + TQColorGroup cg; #ifdef DEBUG kdDebug() << "constructor ExerciseFactorize()" << endl; #endif /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ createTask(); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // the next thing to do on a button click would be to check the entered // result m_currentState = _CHECK_TASK; - Form1Layout = new QVBoxLayout( this, 11, 6, "Form1Layout"); + Form1Layout = new TQVBoxLayout( this, 11, 6, "Form1Layout"); - layout9 = new QVBoxLayout( 0, 0, 6, "layout9"); + layout9 = new TQVBoxLayout( 0, 0, 6, "layout9"); // The following method fix the problem in // bug #116831, reverse order in RTL desktops. @@ -72,10 +72,10 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name): layout4 = createFactorsLayout(); layout9->addLayout(layout4); - spacer2 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding ); + spacer2 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); layout9->addItem( spacer2 ); - layout2 = new QVBoxLayout( 0, 0, 6, "layout2"); + layout2 = new TQVBoxLayout( 0, 0, 6, "layout2"); // The following method fix the problem in // bug #116831, reverse order in RTL desktops. @@ -83,24 +83,24 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name): layout1 = createButtonsLayout(); layout2->addLayout(layout1); - m_removeLastFactorButton = new QPushButton( this, "m_removeLastFactorButton" ); + m_removeLastFactorButton = new TQPushButton( this, "m_removeLastFactorButton" ); layout2->addWidget( m_removeLastFactorButton ); layout9->addLayout( layout2 ); - spacer4 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding ); + spacer4 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); layout9->addItem( spacer4 ); - layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); - spacer3 = new QSpacerItem( 361, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout7 = new TQHBoxLayout( 0, 0, 6, "layout7"); + spacer3 = new TQSpacerItem( 361, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); layout7->addItem( spacer3 ); - m_checkButton = new QPushButton( this, "m_checkButton" ); + m_checkButton = new TQPushButton( this, "m_checkButton" ); layout7->addWidget( m_checkButton ); layout9->addLayout( layout7 ); Form1Layout->addLayout( layout9 ); // the current task - QString tmp_str; + TQString tmp_str; tmp_str.setNum(m_taskNumber); m_taskLabel->setText(tmp_str); @@ -126,35 +126,35 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name): m_factor13Button->setText( i18n( "13" ) ); m_factor17Button->setText( i18n( "17" ) ); m_factor19Button->setText( i18n( "19" ) ); - QObject::connect(m_factor2Button, SIGNAL(clicked()), this, SLOT(slotFactor2ButtonClicked())); - QObject::connect(m_factor3Button, SIGNAL(clicked()), this, SLOT(slotFactor3ButtonClicked())); - QObject::connect(m_factor5Button, SIGNAL(clicked()), this, SLOT(slotFactor5ButtonClicked())); - QObject::connect(m_factor7Button, SIGNAL(clicked()), this, SLOT(slotFactor7ButtonClicked())); - QObject::connect(m_factor11Button, SIGNAL(clicked()), this, SLOT(slotFactor11ButtonClicked())); - QObject::connect(m_factor13Button, SIGNAL(clicked()), this, SLOT(slotFactor13ButtonClicked())); - QObject::connect(m_factor17Button, SIGNAL(clicked()), this, SLOT(slotFactor17ButtonClicked())); - QObject::connect(m_factor19Button, SIGNAL(clicked()), this, SLOT(slotFactor19ButtonClicked())); + TQObject::connect(m_factor2Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor2ButtonClicked())); + TQObject::connect(m_factor3Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor3ButtonClicked())); + TQObject::connect(m_factor5Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor5ButtonClicked())); + TQObject::connect(m_factor7Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor7ButtonClicked())); + TQObject::connect(m_factor11Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor11ButtonClicked())); + TQObject::connect(m_factor13Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor13ButtonClicked())); + TQObject::connect(m_factor17Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor17ButtonClicked())); + TQObject::connect(m_factor19Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor19ButtonClicked())); // add tooltips to the factor buttons - QToolTip::add(m_factor2Button, i18n("Add prime factor 2.")); - QToolTip::add(m_factor3Button, i18n("Add prime factor 3.")); - QToolTip::add(m_factor5Button, i18n("Add prime factor 5.")); - QToolTip::add(m_factor7Button, i18n("Add prime factor 7.")); - QToolTip::add(m_factor11Button, i18n("Add prime factor 11.")); - QToolTip::add(m_factor13Button, i18n("Add prime factor 13.")); - QToolTip::add(m_factor17Button, i18n("Add prime factor 17.")); - QToolTip::add(m_factor19Button, i18n("Add prime factor 19.")); + TQToolTip::add(m_factor2Button, i18n("Add prime factor 2.")); + TQToolTip::add(m_factor3Button, i18n("Add prime factor 3.")); + TQToolTip::add(m_factor5Button, i18n("Add prime factor 5.")); + TQToolTip::add(m_factor7Button, i18n("Add prime factor 7.")); + TQToolTip::add(m_factor11Button, i18n("Add prime factor 11.")); + TQToolTip::add(m_factor13Button, i18n("Add prime factor 13.")); + TQToolTip::add(m_factor17Button, i18n("Add prime factor 17.")); + TQToolTip::add(m_factor19Button, i18n("Add prime factor 19.")); // the remove last factor button m_removeLastFactorButton->setText( i18n( "&Remove Last Factor" ) ); m_removeLastFactorButton->setEnabled(false); - QObject::connect(m_removeLastFactorButton, SIGNAL(clicked()), this, SLOT(slotRemoveLastFactorButtonClicked())); - QToolTip::add(m_removeLastFactorButton, i18n("Removes the last entered prime factor.")); + TQObject::connect(m_removeLastFactorButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRemoveLastFactorButtonClicked())); + TQToolTip::add(m_removeLastFactorButton, i18n("Removes the last entered prime factor.")); // the check task button m_checkButton->setText( i18n( "&Check Task" ) ); - QToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); - QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked())); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); + TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked())); m_checkButton->setDefault(true); // is the default button of the dialog // that the user can start choosing the prime factors @@ -170,8 +170,8 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name): setTabOrder(m_factor19Button, m_removeLastFactorButton); // add tooltip and qwhatsthis help to the widget - QToolTip::add(this, i18n("In this exercise you have to factorize a given number.")); - QWhatsThis::add(this, i18n("In this exercise you have to factorize a given number. You have to enter all prime factors of the number. You can add a prime factor by clicking on the corresponding button. The chosen prime factors will be shown in the input field. Do not forget to enter all prime factors, even when a prime factor repeats several times!")); + TQToolTip::add(this, i18n("In this exercise you have to factorize a given number.")); + TQWhatsThis::add(this, i18n("In this exercise you have to factorize a given number. You have to enter all prime factors of the number. You can add a prime factor by clicking on the corresponding button. The chosen prime factors will be shown in the input field. Do not forget to enter all prime factors, even when a prime factor repeats several times!")); } /* destructor */ @@ -220,7 +220,7 @@ void ExerciseFactorize::update() m_factorsWidget->updateAndRepaint(); // update for itself - ((QWidget *) this)->update(); + ((TQWidget *) this)->update(); } @@ -234,34 +234,34 @@ void ExerciseFactorize::update() /** Create the layout that hold the exercise widgets */ -QHBoxLayout* ExerciseFactorize::createFactorsLayout() +TQHBoxLayout* ExerciseFactorize::createFactorsLayout() { // first create all widgets - QHBoxLayout* layout = new QHBoxLayout( 0, 0, 6, "layout4"); + TQHBoxLayout* layout = new TQHBoxLayout( 0, 0, 6, "layout4"); - m_taskLabel = new QLabel( this, "m_taskLabel" ); + m_taskLabel = new TQLabel( this, "m_taskLabel" ); - m_equalSignLabel = new QLabel( this, "m_equalSignLabel" ); + m_equalSignLabel = new TQLabel( this, "m_equalSignLabel" ); - m_factorsEnteredEdit = new QLineEdit( this, "m_factorsEnteredEdit" ); + m_factorsEnteredEdit = new TQLineEdit( this, "m_factorsEnteredEdit" ); m_factorsEnteredEdit->setReadOnly(true); m_factorsEnteredEdit->setEnabled(false); - m_factorsEnteredEdit->setPaletteForegroundColor(QColor(0, 0, 0)); + m_factorsEnteredEdit->setPaletteForegroundColor(TQColor(0, 0, 0)); m_factorsWidget = new FactorizedWidget( this, "m_factorsWidget", m_factorsResult); m_factorsWidget->hide(); - result_label = new QLabel( this, "result_label" ); + result_label = new TQLabel( this, "result_label" ); - spacer1 = new QSpacerItem( 25, 20, QSizePolicy::Expanding, - QSizePolicy::Minimum ); + spacer1 = new TQSpacerItem( 25, 20, TQSizePolicy::Expanding, + TQSizePolicy::Minimum ); // now add the widgets to the layout. // if we are in a RTL desktop, add them // in a reverse order - if (QApplication::reverseLayout()) + if (TQApplication::reverseLayout()) { layout->addItem( spacer1 ); layout->addWidget( result_label ); @@ -292,28 +292,28 @@ QHBoxLayout* ExerciseFactorize::createFactorsLayout() /** Create the layout that hold the exercise widgets */ -QGridLayout* ExerciseFactorize::createButtonsLayout() +TQGridLayout* ExerciseFactorize::createButtonsLayout() { const int _COLS = 4; // number of buttons in each row const int _ROWS = 2; // number of rows - QGridLayout* layout = new QGridLayout( 0, 1, 1, 0, 6, "layout1"); + TQGridLayout* layout = new TQGridLayout( 0, 1, 1, 0, 6, "layout1"); // first row buttons - m_factor2Button = new QPushButton( this, "m_factor2Button" ); - m_factor3Button = new QPushButton( this, "m_factor3Button" ); - m_factor5Button = new QPushButton( this, "m_factor5Button" ); - m_factor7Button = new QPushButton( this, "m_factor7Button" ); + m_factor2Button = new TQPushButton( this, "m_factor2Button" ); + m_factor3Button = new TQPushButton( this, "m_factor3Button" ); + m_factor5Button = new TQPushButton( this, "m_factor5Button" ); + m_factor7Button = new TQPushButton( this, "m_factor7Button" ); // second row buttons - m_factor11Button = new QPushButton( this, "m_factor11Button" ); - m_factor13Button = new QPushButton( this, "m_factor13Button" ); - m_factor17Button = new QPushButton( this, "m_factor17Button" ); - m_factor19Button = new QPushButton( this, "m_factor19Button" ); + m_factor11Button = new TQPushButton( this, "m_factor11Button" ); + m_factor13Button = new TQPushButton( this, "m_factor13Button" ); + m_factor17Button = new TQPushButton( this, "m_factor17Button" ); + m_factor19Button = new TQPushButton( this, "m_factor19Button" ); // temp array to help with adding the buttons // to the grid - QPushButton* buttons[_ROWS][_COLS] = + TQPushButton* buttons[_ROWS][_COLS] = { { m_factor2Button, @@ -335,7 +335,7 @@ QGridLayout* ExerciseFactorize::createButtonsLayout() // if we are in a RTL desktop, this helps adding the // buttons in a reverse order - if (QApplication::reverseLayout()) + if (TQApplication::reverseLayout()) { buttonIdxStart = _COLS - 1; step = -1; @@ -390,13 +390,13 @@ void ExerciseFactorize::createTask() - emits signals if task was solved correctly or wrong */ void ExerciseFactorize::showResult() { - QString tmp_str, tmp_str2; /* to build a string for a label */ - QPalette pal; - QColorGroup cg; + TQString tmp_str, tmp_str2; /* to build a string for a label */ + TQPalette pal; + TQColorGroup cg; uint uint_result = 0; // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); // disable prime factor buttons m_factor2Button->setEnabled(false); @@ -435,10 +435,10 @@ void ExerciseFactorize::showResult() result_label->setText(i18n("CORRECT")); pal = result_label->palette(); /* set green font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setInactive(cg); result_label->setPalette(pal); } else { @@ -449,10 +449,10 @@ void ExerciseFactorize::showResult() result_label->setText(i18n("WRONG")); pal = result_label->palette(); /* set red font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setInactive(cg); result_label->setPalette(pal); @@ -467,7 +467,7 @@ void ExerciseFactorize::showResult() void ExerciseFactorize::nextTask() { // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); // enable prime factor buttons m_factor2Button->setEnabled(true); @@ -493,12 +493,12 @@ void ExerciseFactorize::nextTask() m_factor2Button->setFocus(); /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ createTask(); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // update the task widget - QString tmp_str; + TQString tmp_str; tmp_str.setNum(m_taskNumber); m_taskLabel->setText(tmp_str); @@ -522,8 +522,8 @@ void ExerciseFactorize::addFactor(uint factor) void ExerciseFactorize::updateEnteredEdit() { // the string to be shown in the entered edit - QString str_output = ""; - QString str_tmp; + TQString str_output = ""; + TQString str_tmp; // find the end of the list uintList::iterator it; diff --git a/kbruch/src/exercisefactorize.h b/kbruch/src/exercisefactorize.h index 30cc2d8d..a3460c16 100644 --- a/kbruch/src/exercisefactorize.h +++ b/kbruch/src/exercisefactorize.h @@ -24,9 +24,9 @@ #include #endif -#include -#include -#include +#include +#include +#include #include "exercisebase.h" #include "ratio.h" @@ -43,7 +43,7 @@ class QLineEdit; class QPushButton; // a list containing uints -typedef QValueList uintList; +typedef TQValueList uintList; // set a macro how much numbers are given to factorize #define numberPossibleTasks 45 @@ -63,7 +63,7 @@ class ExerciseFactorize : public ExerciseBase public: /** constructor */ - ExerciseFactorize(QWidget * parent = 0, const char * name = 0); + ExerciseFactorize(TQWidget * parent = 0, const char * name = 0); /** destructor */ ~ExerciseFactorize(); @@ -90,27 +90,27 @@ private: uintList m_factorsEntered; uintList m_factorsResult; - QLabel* m_taskLabel; - QLabel* m_equalSignLabel; - QLineEdit* m_factorsEnteredEdit; + TQLabel* m_taskLabel; + TQLabel* m_equalSignLabel; + TQLineEdit* m_factorsEnteredEdit; FactorizedWidget* m_factorsWidget; - QLabel* result_label; + TQLabel* result_label; // buttons for the different prime factors - QPushButton* m_factor2Button; - QPushButton* m_factor3Button; - QPushButton* m_factor5Button; - QPushButton* m_factor7Button; - QPushButton* m_factor11Button; - QPushButton* m_factor13Button; - QPushButton* m_factor17Button; - QPushButton* m_factor19Button; + TQPushButton* m_factor2Button; + TQPushButton* m_factor3Button; + TQPushButton* m_factor5Button; + TQPushButton* m_factor7Button; + TQPushButton* m_factor11Button; + TQPushButton* m_factor13Button; + TQPushButton* m_factor17Button; + TQPushButton* m_factor19Button; // button to remove the last entered factor - QPushButton* m_removeLastFactorButton; - QPushButton* m_checkButton; + TQPushButton* m_removeLastFactorButton; + TQPushButton* m_checkButton; // @@ -120,10 +120,10 @@ private: // /** create the factor widgets layout */ - QHBoxLayout* createFactorsLayout(); + TQHBoxLayout* createFactorsLayout(); /** create the (answer) buttons layout */ - QGridLayout* createButtonsLayout(); + TQGridLayout* createButtonsLayout(); void createTask(); @@ -134,16 +134,16 @@ private: void updateEnteredEdit(); protected: - QVBoxLayout* Form1Layout; - QVBoxLayout* layout9; - QSpacerItem* spacer4; - QHBoxLayout* layout4; - QSpacerItem* spacer1; - QSpacerItem* spacer2; - QVBoxLayout* layout2; - QGridLayout* layout1; - QHBoxLayout* layout7; - QSpacerItem* spacer3; + TQVBoxLayout* Form1Layout; + TQVBoxLayout* layout9; + TQSpacerItem* spacer4; + TQHBoxLayout* layout4; + TQSpacerItem* spacer1; + TQSpacerItem* spacer2; + TQVBoxLayout* layout2; + TQGridLayout* layout1; + TQHBoxLayout* layout7; + TQSpacerItem* spacer3; private slots: void slotCheckButtonClicked(); diff --git a/kbruch/src/factorizedwidget.cpp b/kbruch/src/factorizedwidget.cpp index 6baabc3e..c6501d4e 100644 --- a/kbruch/src/factorizedwidget.cpp +++ b/kbruch/src/factorizedwidget.cpp @@ -19,9 +19,9 @@ #include "factorizedwidget.moc" /* these includes are needed for Qt support */ -#include +#include -FactorizedWidget::FactorizedWidget(QWidget * parent, const char * name, const uintList para_factors) : +FactorizedWidget::FactorizedWidget(TQWidget * parent, const char * name, const uintList para_factors) : FractionBaseWidget(parent, name), m_factors(para_factors) { #ifdef DEBUG @@ -42,7 +42,7 @@ void FactorizedWidget::setFactors(const uintList para_factors) update(); } -void FactorizedWidget::paintEvent(QPaintEvent* /* p_paintEvent */) +void FactorizedWidget::paintEvent(TQPaintEvent* /* p_paintEvent */) { // our x position, we paint from left to right; // we don't want to start directly on the border, so add the margin @@ -51,24 +51,24 @@ void FactorizedWidget::paintEvent(QPaintEvent* /* p_paintEvent */) int fontWidth; // to store the width of the last thing painted // start the painter - QPainter paint(this); + TQPainter paint(this); // ratios and operation signs are painted with the same font paint.setFont(m_font); // set the pen for painting - QPen pen(Qt::SolidLine); + TQPen pen(Qt::SolidLine); pen.setWidth(0); paint.setPen(pen); // get the font height; the font height doesn't change while painting - QFontMetrics fm(paint.fontMetrics()); + TQFontMetrics fm(paint.fontMetrics()); // now we can correctly set the height of the widget setMinimumHeight(fm.lineSpacing()); setMaximumHeight(fm.lineSpacing()); - QString tmpStr; + TQString tmpStr; int fontHeight = fm.lineSpacing(); // get the font height for (uint tmpInt = 0; tmpInt < m_factors.count(); tmpInt++) diff --git a/kbruch/src/factorizedwidget.h b/kbruch/src/factorizedwidget.h index 2626d445..0ed79511 100644 --- a/kbruch/src/factorizedwidget.h +++ b/kbruch/src/factorizedwidget.h @@ -24,10 +24,10 @@ #include "fractionbasewidget.h" -#include +#include // a list containing uints -typedef QValueList uintList; +typedef TQValueList uintList; /*! class to paint the factorization of a number * @@ -38,7 +38,7 @@ class FactorizedWidget : public FractionBaseWidget public: /** constructor */ - FactorizedWidget(QWidget * parent, const char * name, const uintList para_factors); + FactorizedWidget(TQWidget * parent, const char * name, const uintList para_factors); /** destructor */ ~FactorizedWidget(); @@ -52,7 +52,7 @@ private: uintList m_factors; /** overrideing the paint event of FractionBaseWidget */ - void paintEvent(QPaintEvent*); + void paintEvent(TQPaintEvent*); }; #endif diff --git a/kbruch/src/fractionbasewidget.cpp b/kbruch/src/fractionbasewidget.cpp index 77ff3056..07f60c84 100644 --- a/kbruch/src/fractionbasewidget.cpp +++ b/kbruch/src/fractionbasewidget.cpp @@ -22,12 +22,12 @@ #include /* these includes are needed for Qt support */ -#include +#include #include "settingsclass.h" -FractionBaseWidget::FractionBaseWidget(QWidget * parent = 0, const char * name = 0) : - QWidget(parent, name) +FractionBaseWidget::FractionBaseWidget(TQWidget * parent = 0, const char * name = 0) : + TQWidget(parent, name) { #ifdef DEBUG kdDebug() << "constructor FractionBaseWidget" << endl; @@ -50,14 +50,14 @@ void FractionBaseWidget::updateAndRepaint() update(); } -void FractionBaseWidget::paintRatio(QPainter & paint, ratio tmp_ratio, int & x_pos, QFontMetrics & fm, bool show_mixed, bool addMargin) +void FractionBaseWidget::paintRatio(TQPainter & paint, ratio tmp_ratio, int & x_pos, TQFontMetrics & fm, bool show_mixed, bool addMargin) { - QPen pen = paint.pen(); // get the pen + TQPen pen = paint.pen(); // get the pen int fontHeight = fm.lineSpacing(); // get the font height int int_numerator, int_denominator, int_mixed; - QString str_numerator, str_denominator; - QString str_mixed; + TQString str_numerator, str_denominator; + TQString str_mixed; int fontWidth; // to store the width of the last thing painted int tmp_int; @@ -129,10 +129,10 @@ void FractionBaseWidget::paintRatio(QPainter & paint, ratio tmp_ratio, int & x_p return; } -void FractionBaseWidget::paintMiddle(QPainter & paint, const QString& paint_str, int & x_pos, QFontMetrics & fm, QColor color, bool addMargin) +void FractionBaseWidget::paintMiddle(TQPainter & paint, const TQString& paint_str, int & x_pos, TQFontMetrics & fm, TQColor color, bool addMargin) { // get the pen, font height and font width - QPen pen = paint.pen(); + TQPen pen = paint.pen(); int fontHeight = fm.lineSpacing(); int fontWidth = fm.width(paint_str); diff --git a/kbruch/src/fractionbasewidget.h b/kbruch/src/fractionbasewidget.h index 4472ade3..21b2fdc8 100644 --- a/kbruch/src/fractionbasewidget.h +++ b/kbruch/src/fractionbasewidget.h @@ -27,7 +27,7 @@ #include "ratio.h" -#include +#include /*! base class for painting fractions @@ -39,7 +39,7 @@ class FractionBaseWidget : public QWidget public: /** constructor */ - FractionBaseWidget(QWidget * parent, const char * name); + FractionBaseWidget(TQWidget * parent, const char * name); /** destructor */ ~FractionBaseWidget(); @@ -50,21 +50,21 @@ public: protected: /* store the different colors */ - QColor m_colorNumber; - QColor m_colorLine; - QColor m_colorOperation; + TQColor m_colorNumber; + TQColor m_colorLine; + TQColor m_colorOperation; /* the font to paint with */ - QFont m_font; + TQFont m_font; - /** overrideing the paint event of QWidget */ - virtual void paintEvent(QPaintEvent*) = 0; + /** overrideing the paint event of TQWidget */ + virtual void paintEvent(TQPaintEvent*) = 0; /** paints a ratio at the given position */ - void paintRatio(QPainter & paint, ratio tmp_ratio, int & x_pos, QFontMetrics & fm, bool show_mixed, bool addMargin = true); + void paintRatio(TQPainter & paint, ratio tmp_ratio, int & x_pos, TQFontMetrics & fm, bool show_mixed, bool addMargin = true); /** paints a string in the vertical middle (aligned to the operation signs) */ - void paintMiddle(QPainter & paint, const QString& paint_str, int & x_pos, QFontMetrics & fm, QColor color, bool addMargin = true); + void paintMiddle(TQPainter & paint, const TQString& paint_str, int & x_pos, TQFontMetrics & fm, TQColor color, bool addMargin = true); private: /** sets the font and color; values taken from settingsclass */ diff --git a/kbruch/src/mainqtwidget.cpp b/kbruch/src/mainqtwidget.cpp index 069a4d83..3ac59d46 100644 --- a/kbruch/src/mainqtwidget.cpp +++ b/kbruch/src/mainqtwidget.cpp @@ -27,11 +27,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -62,13 +62,13 @@ MainQtWidget::MainQtWidget() // we split the main view into 2 parts, one for the tasks, one for the // statistics - QSplitter* splitter = new QSplitter(QSplitter::Horizontal, this,"QSplitter"); + TQSplitter* splitter = new TQSplitter(TQSplitter::Horizontal, this,"TQSplitter"); setCentralWidget(splitter); // the iconlist, where the user can choose the different exercises m_exercises = new KJanusWidget(splitter, "KJanusWidget", KJanusWidget::IconList); - QToolTip::add(m_exercises, i18n("Choose another exercise by clicking on an icon.")); - QWhatsThis::add(m_exercises, i18n("Click on the different icons to choose another exercise. The exercises help you to practice different aspects of calculating with fractions.")); + TQToolTip::add(m_exercises, i18n("Choose another exercise by clicking on an icon.")); + TQWhatsThis::add(m_exercises, i18n("Click on the different icons to choose another exercise. The exercises help you to practice different aspects of calculating with fractions.")); // create the statistic view m_statview = new StatisticsView(splitter, "StatisticsView"); @@ -76,40 +76,40 @@ MainQtWidget::MainQtWidget() // add the pages // // we have the exercise to solve fraction tasks - QVBox * page = m_exercises->addVBoxPage(i18n("Fraction Task"), "", DesktopIcon("kbruch_exercise_common")); - m_taskview = new TaskView((QWidget *) page, "TaskView", m_addSub, m_mulDiv, m_nrRatios, m_maxMainDenominator); + TQVBox * page = m_exercises->addVBoxPage(i18n("Fraction Task"), "", DesktopIcon("kbruch_exercise_common")); + m_taskview = new TaskView((TQWidget *) page, "TaskView", m_addSub, m_mulDiv, m_nrRatios, m_maxMainDenominator); // we have the exercise to compare ratios page = m_exercises->addVBoxPage(i18n("Comparison"), "", DesktopIcon("kbruch_exercise_compare")); - m_exerciseCompare = new ExerciseCompare((QWidget *) page, "ExerciseCompare"); + m_exerciseCompare = new ExerciseCompare((TQWidget *) page, "ExerciseCompare"); // we have the exercise to convert rational numbers into ratios page = m_exercises->addVBoxPage(i18n("Conversion"), "", DesktopIcon("kbruch_exercise_conversion")); - m_exerciseConvert = new ExerciseConvert((QWidget *) page, "ExerciseConvert"); + m_exerciseConvert = new ExerciseConvert((TQWidget *) page, "ExerciseConvert"); // we have the exercise to factorize a given number into prime factors page = m_exercises->addVBoxPage(i18n("Factorization"), "", DesktopIcon("kbruch_exercise_factorisation")); - m_exerciseFactorize = new ExerciseFactorize((QWidget *) page, "ExerciseFactorize"); + m_exerciseFactorize = new ExerciseFactorize((TQWidget *) page, "ExerciseFactorize"); - splitter->setResizeMode(m_statview, QSplitter::FollowSizeHint); + splitter->setResizeMode(m_statview, TQSplitter::FollowSizeHint); // we must change the status of the menubar before another page is shown - QObject::connect(m_exercises, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShowPage(QWidget *))); + TQObject::connect(m_exercises, TQT_SIGNAL(aboutToShowPage(TQWidget *)), this, TQT_SLOT(slotAboutToShowPage(TQWidget *))); // connect signals of the exercises and StatisticView, so that StatisticView // gets informed about how the user solved a given task (wrong or correct) - QObject::connect(m_taskview, SIGNAL(signalTaskSolvedCorrect()), m_statview, SLOT(addCorrect())); - QObject::connect(m_taskview, SIGNAL(signalTaskSolvedWrong()), m_statview, SLOT(addWrong())); - QObject::connect(m_exerciseCompare, SIGNAL(signalExerciseSolvedCorrect()), m_statview, SLOT(addCorrect())); - QObject::connect(m_exerciseCompare, SIGNAL(signalExerciseSolvedWrong()), m_statview, SLOT(addWrong())); - QObject::connect(m_exerciseConvert, SIGNAL(signalExerciseSolvedCorrect()), m_statview, SLOT(addCorrect())); - QObject::connect(m_exerciseConvert, SIGNAL(signalExerciseSolvedWrong()), m_statview, SLOT(addWrong())); - QObject::connect(m_exerciseFactorize, SIGNAL(signalExerciseSolvedCorrect()), m_statview, SLOT(addCorrect())); - QObject::connect(m_exerciseFactorize, SIGNAL(signalExerciseSolvedWrong()), m_statview, SLOT(addWrong())); + TQObject::connect(m_taskview, TQT_SIGNAL(signalTaskSolvedCorrect()), m_statview, TQT_SLOT(addCorrect())); + TQObject::connect(m_taskview, TQT_SIGNAL(signalTaskSolvedWrong()), m_statview, TQT_SLOT(addWrong())); + TQObject::connect(m_exerciseCompare, TQT_SIGNAL(signalExerciseSolvedCorrect()), m_statview, TQT_SLOT(addCorrect())); + TQObject::connect(m_exerciseCompare, TQT_SIGNAL(signalExerciseSolvedWrong()), m_statview, TQT_SLOT(addWrong())); + TQObject::connect(m_exerciseConvert, TQT_SIGNAL(signalExerciseSolvedCorrect()), m_statview, TQT_SLOT(addCorrect())); + TQObject::connect(m_exerciseConvert, TQT_SIGNAL(signalExerciseSolvedWrong()), m_statview, TQT_SLOT(addWrong())); + TQObject::connect(m_exerciseFactorize, TQT_SIGNAL(signalExerciseSolvedCorrect()), m_statview, TQT_SLOT(addCorrect())); + TQObject::connect(m_exerciseFactorize, TQT_SIGNAL(signalExerciseSolvedWrong()), m_statview, TQT_SLOT(addWrong())); #if (KDE_VERSION_MINOR>=3) && (KDE_VERSION_MAJOR>=3) #else - resize(QSize(QMAX(toolBar()->sizeHint().width(), sizeHint().width()), sizeHint().height())); + resize(TQSize(QMAX(toolBar()->sizeHint().width(), sizeHint().width()), sizeHint().height())); #endif // now show the last exercise m_exercises->showPage(SettingsClass::activeExercise()); @@ -155,49 +155,49 @@ void MainQtWidget::setupActions() { // new task action m_NewTaskAction = new KAction(i18n("&New"), "filenew", KStdAccel::shortcut(KStdAccel::New), - this, SLOT(NewTask()), + this, TQT_SLOT(NewTask()), actionCollection(), "NewTask"); // quit action - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); // - KStdAction::preferences(this, SLOT( slotPrefs() ), actionCollection()); + KStdAction::preferences(this, TQT_SLOT( slotPrefs() ), actionCollection()); // a label just describing the Number of terms ComboBox - m_NrOfTermsLabel = new QLabel(i18n("Terms:"), 0, "kde toolbar widget"); + m_NrOfTermsLabel = new TQLabel(i18n("Terms:"), 0, "kde toolbar widget"); m_NrOfTermsLabelAction = new KWidgetAction(m_NrOfTermsLabel, i18n("Terms:"), ALT+Key_E, - this, SLOT(NrOfTermsBoxSlot()), + this, TQT_SLOT(NrOfTermsBoxSlot()), actionCollection(), "NrOfTermsLabelAction"); // the ComboBox holding possible values for term number - m_NrOfTermsBox = new QComboBox(); + m_NrOfTermsBox = new TQComboBox(); m_NrOfTermsBox->insertItem("2"); m_NrOfTermsBox->insertItem("3"); m_NrOfTermsBox->insertItem("4"); m_NrOfTermsBox->insertItem("5"); m_NrOfTermsBox->setCurrentItem(m_nrRatios - 2); - QToolTip::add( m_NrOfTermsBox, i18n( "The number of terms you want" ) ); - QWhatsThis::add( m_NrOfTermsBox, i18n( "Choose the number of terms (2, 3, 4 or 5) you want for calculating fractions." ) ); - m_NrOfTermsBoxAction = new KWidgetAction(m_NrOfTermsBox, i18n("Number of Terms"), ALT+Key_E, this, SLOT(NrOfTermsBoxSlot()), actionCollection(), "NrOfTermsBoxAction"); + TQToolTip::add( m_NrOfTermsBox, i18n( "The number of terms you want" ) ); + TQWhatsThis::add( m_NrOfTermsBox, i18n( "Choose the number of terms (2, 3, 4 or 5) you want for calculating fractions." ) ); + m_NrOfTermsBoxAction = new KWidgetAction(m_NrOfTermsBox, i18n("Number of Terms"), ALT+Key_E, this, TQT_SLOT(NrOfTermsBoxSlot()), actionCollection(), "NrOfTermsBoxAction"); // now connect the ComboBox's signal textChanged() to the slot function - QObject::connect(m_NrOfTermsBox, SIGNAL(activated(int)), this, SLOT(NrOfTermsBoxSlot())); + TQObject::connect(m_NrOfTermsBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(NrOfTermsBoxSlot())); // a label just describing the max. main denominator ComboBox - m_MaxMainDenominatorLabel = new QLabel(i18n("Max. main denominator:"), 0, "kde toolbar widget"); + m_MaxMainDenominatorLabel = new TQLabel(i18n("Max. main denominator:"), 0, "kde toolbar widget"); m_MaxMainDenominatorLabelAction = new KWidgetAction(m_MaxMainDenominatorLabel, i18n("Max. main denominator:"), ALT+Key_D, - this, SLOT(MaxMainDenominatorBoxSlot()), + this, TQT_SLOT(MaxMainDenominatorBoxSlot()), actionCollection(), "MaxMainDenominatorLabelAction"); // the ComboBox holding possible values for the max. main denominator - m_MaxMainDenominatorBox = new QComboBox(this); + m_MaxMainDenominatorBox = new TQComboBox(this); m_MaxMainDenominatorBox->insertItem("10"); m_MaxMainDenominatorBox->insertItem("20"); m_MaxMainDenominatorBox->insertItem("30"); m_MaxMainDenominatorBox->insertItem("50"); - QToolTip::add( m_MaxMainDenominatorBox, i18n( "The maximum number you can have as main denominator" ) ); - QWhatsThis::add( m_MaxMainDenominatorBox, i18n( "Choose the number which will be the maximum for the main denominator: 10, 20, 30, 40 or 50." ) ); + TQToolTip::add( m_MaxMainDenominatorBox, i18n( "The maximum number you can have as main denominator" ) ); + TQWhatsThis::add( m_MaxMainDenominatorBox, i18n( "Choose the number which will be the maximum for the main denominator: 10, 20, 30, 40 or 50." ) ); switch (m_maxMainDenominator) { case 10 : m_MaxMainDenominatorBox->setCurrentItem(0); @@ -209,20 +209,20 @@ void MainQtWidget::setupActions() case 50 : m_MaxMainDenominatorBox->setCurrentItem(3); break; } - m_MaxMainDenominatorBoxAction = new KWidgetAction(m_MaxMainDenominatorBox, i18n("Maximal Main Denominator"), ALT+Key_D, this, SLOT(MaxMainDenominatorBoxSlot()), actionCollection(), "MaxMainDenominatorBoxAction"); + m_MaxMainDenominatorBoxAction = new KWidgetAction(m_MaxMainDenominatorBox, i18n("Maximal Main Denominator"), ALT+Key_D, this, TQT_SLOT(MaxMainDenominatorBoxSlot()), actionCollection(), "MaxMainDenominatorBoxAction"); // now connect the ComboBox's signal textChanged() to the slot function - QObject::connect(m_MaxMainDenominatorBox, SIGNAL(activated(int)), - this, SLOT(MaxMainDenominatorBoxSlot())); + TQObject::connect(m_MaxMainDenominatorBox, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(MaxMainDenominatorBoxSlot())); // a label just describing the operation ComboBox - m_OperationLabel = new QLabel(i18n("Operations:"), 0, "kde toolbar widget"); + m_OperationLabel = new TQLabel(i18n("Operations:"), 0, "kde toolbar widget"); m_OperationLabelAction = new KWidgetAction(m_OperationLabel, i18n("Operations:"), ALT+Key_O, - this, SLOT(OperationBoxSlot()), + this, TQT_SLOT(OperationBoxSlot()), actionCollection(), "OperationLabelAction"); // the ComboBox holding possible combinations for operations - m_OperationBox = new QComboBox(this); + m_OperationBox = new TQComboBox(this); m_OperationBox->insertItem(i18n("Addition/Subtraction")); m_OperationBox->insertItem(i18n("Multiplication/Division")); m_OperationBox->insertItem(i18n("All Operations Mixed")); @@ -234,16 +234,16 @@ void MainQtWidget::setupActions() } else if (m_addSub == true && m_mulDiv == true) { m_OperationBox->setCurrentItem(2); } - QToolTip::add( m_OperationBox, i18n( "The operations you want" ) ); - QWhatsThis::add( m_OperationBox, i18n( "Choose the type of operations you want for calculating fractions: Addition/Substraction, Multiplication/Division or All Operations Mixed. If you choose All Operations Mixed, the program will randomly choose addition, substraction, multiplication and/or division." ) ); - m_OperationBoxAction = new KWidgetAction(m_OperationBox, i18n("Operations:"), ALT+Key_O, this, SLOT(OperationBoxSlot()), actionCollection(), "OperationBoxAction"); + TQToolTip::add( m_OperationBox, i18n( "The operations you want" ) ); + TQWhatsThis::add( m_OperationBox, i18n( "Choose the type of operations you want for calculating fractions: Addition/Substraction, Multiplication/Division or All Operations Mixed. If you choose All Operations Mixed, the program will randomly choose addition, substraction, multiplication and/or division." ) ); + m_OperationBoxAction = new KWidgetAction(m_OperationBox, i18n("Operations:"), ALT+Key_O, this, TQT_SLOT(OperationBoxSlot()), actionCollection(), "OperationBoxAction"); // now connect the ComboBox's signal textChanged() to the slot function - QObject::connect(m_OperationBox, SIGNAL(activated(int)), this, SLOT(OperationBoxSlot())); + TQObject::connect(m_OperationBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(OperationBoxSlot())); #if (KDE_VERSION_MINOR>=3) && (KDE_VERSION_MAJOR>=3) if (!initialGeometrySet()) - resize( QSize(725, 330).expandedTo(minimumSizeHint())); + resize( TQSize(725, 330).expandedTo(minimumSizeHint())); setupGUI(ToolBar | Keys | StatusBar | Create); setAutoSaveSettings(); #endif @@ -312,7 +312,7 @@ void MainQtWidget::NrOfTermsBoxSlot() #ifdef DEBUG kdDebug() << "MainQtWidget::NrOfTermsBoxSlot()" << endl; #endif - QString curr_nr = m_NrOfTermsBox->currentText(); + TQString curr_nr = m_NrOfTermsBox->currentText(); m_MaxMainDenominatorBox->clear(); if (m_mulDiv == true) @@ -371,7 +371,7 @@ void MainQtWidget::MaxMainDenominatorBoxSlot() // get the max. size from the ComboBox, convert it to a number and store // it in the private member - QString curr_md = m_MaxMainDenominatorBox->currentText(); + TQString curr_md = m_MaxMainDenominatorBox->currentText(); m_maxMainDenominator = curr_md.toUInt(); // set the new task parameters @@ -428,12 +428,12 @@ void MainQtWidget::slotPrefs() // User edited the configuration - update your local copies of the // configuration data - connect(configDialog, SIGNAL(settingsChanged()), this, SLOT(slotApplySettings()) ); + connect(configDialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotApplySettings()) ); configDialog->show(); /* SettingsDialog * dlg = new SettingsDialog(this); - connect(dlg, SIGNAL(configChanged()), this, SLOT(slotApplySettings())); + connect(dlg, TQT_SIGNAL(configChanged()), this, TQT_SLOT(slotApplySettings())); dlg->exec(); @@ -455,7 +455,7 @@ void MainQtWidget::slotApplySettings() return; } -void MainQtWidget::slotAboutToShowPage(QWidget * page) +void MainQtWidget::slotAboutToShowPage(TQWidget * page) { #ifdef DEBUG kdDebug() << "slotAboutToShowPage MainQtWidget" << endl; diff --git a/kbruch/src/mainqtwidget.h b/kbruch/src/mainqtwidget.h index 33c1f2e5..bed32617 100644 --- a/kbruch/src/mainqtwidget.h +++ b/kbruch/src/mainqtwidget.h @@ -84,18 +84,18 @@ class MainQtWidget : public KMainWindow void setupActions(); - QComboBox * m_NrOfTermsBox; - QLabel * m_NrOfTermsLabel; + TQComboBox * m_NrOfTermsBox; + TQLabel * m_NrOfTermsLabel; KWidgetAction * m_NrOfTermsBoxAction; KWidgetAction * m_NrOfTermsLabelAction; - QComboBox * m_MaxMainDenominatorBox; - QLabel * m_MaxMainDenominatorLabel; + TQComboBox * m_MaxMainDenominatorBox; + TQLabel * m_MaxMainDenominatorLabel; KWidgetAction * m_MaxMainDenominatorBoxAction; KWidgetAction * m_MaxMainDenominatorLabelAction; - QComboBox * m_OperationBox; - QLabel * m_OperationLabel; + TQComboBox * m_OperationBox; + TQLabel * m_OperationLabel; KWidgetAction * m_OperationBoxAction; KWidgetAction * m_OperationLabelAction; @@ -133,7 +133,7 @@ class MainQtWidget : public KMainWindow /** * called just before another page is shown */ - void slotAboutToShowPage(QWidget * page); + void slotAboutToShowPage(TQWidget * page); protected: /** Function is called when user calls termination. diff --git a/kbruch/src/primenumber.h b/kbruch/src/primenumber.h index 8f135b26..f0a27678 100644 --- a/kbruch/src/primenumber.h +++ b/kbruch/src/primenumber.h @@ -18,9 +18,9 @@ #ifndef PRIMZAHL_H #define PRIMZAHL_H -#include +#include -typedef QValueVector UnsignedIntArray; +typedef TQValueVector UnsignedIntArray; /** Class to handle prime numbers. * The prime numbers are stored in a static vector, so that different instances diff --git a/kbruch/src/ratio.cpp b/kbruch/src/ratio.cpp index 289e79f9..e3a79a36 100644 --- a/kbruch/src/ratio.cpp +++ b/kbruch/src/ratio.cpp @@ -57,7 +57,7 @@ ratio::~ratio() } /* displays the ratio on stdout; just for debugging */ -QTextStream & ratio::display(QTextStream & str) const +TQTextStream & ratio::display(TQTextStream & str) const { int tmp_width = str.width(); str << qSetW(5) << " "; @@ -362,7 +362,7 @@ void ratio::change_sign() /* ------ some prototyps of non class functions ------ */ // it is possible to stram ratio_object -QTextStream & operator<<(QTextStream & str, const ratio & pratio) +TQTextStream & operator<<(TQTextStream & str, const ratio & pratio) { return pratio.display(str); } diff --git a/kbruch/src/ratio.h b/kbruch/src/ratio.h index 3e3ca44a..c9ee687a 100644 --- a/kbruch/src/ratio.h +++ b/kbruch/src/ratio.h @@ -18,7 +18,7 @@ #ifndef RATIO_H #define RATIO_H -#include +#include /** Represents a ratio * This class represents 1 ratio. There are several functions provided to @@ -38,8 +38,8 @@ public: /** destructor */ ~ratio(); - /** returns the ratio as QTextStream object */ - QTextStream & display(QTextStream & str) const; + /** returns the ratio as TQTextStream object */ + TQTextStream & display(TQTextStream & str) const; /** returns the numerator */ int numerator() const; @@ -97,6 +97,6 @@ private: /* ------ some prototyps of non class functions ------ */ /** it is possible to code: cout << ratio_object << endl; */ -QTextStream & operator<<(QTextStream & str, const ratio & pratio); +TQTextStream & operator<<(TQTextStream & str, const ratio & pratio); #endif diff --git a/kbruch/src/rationalwidget.cpp b/kbruch/src/rationalwidget.cpp index 7184cafd..f930d882 100644 --- a/kbruch/src/rationalwidget.cpp +++ b/kbruch/src/rationalwidget.cpp @@ -19,10 +19,10 @@ #include "rationalwidget.moc" /* these includes are needed for Qt support */ -#include -#include +#include +#include -RationalWidget::RationalWidget(QWidget * parent, const char * name, const QString pnumber, const uint pperiodStart, const uint pperiodLength): +RationalWidget::RationalWidget(TQWidget * parent, const char * name, const TQString pnumber, const uint pperiodStart, const uint pperiodLength): FractionBaseWidget(parent, name), m_number(pnumber), m_periodStart(pperiodStart), m_periodLength(pperiodLength) { @@ -38,7 +38,7 @@ RationalWidget::~RationalWidget() #endif } -void RationalWidget::setRational(const QString pnumber, const uint pperiodStart, const uint pperiodLength) +void RationalWidget::setRational(const TQString pnumber, const uint pperiodStart, const uint pperiodLength) { m_number = pnumber; m_periodStart = pperiodStart; @@ -49,7 +49,7 @@ void RationalWidget::setRational(const QString pnumber, const uint pperiodStart, return; } -void RationalWidget::paintEvent(QPaintEvent* /* p_paintEvent */) +void RationalWidget::paintEvent(TQPaintEvent* /* p_paintEvent */) { // our x position, we paint from left to right; // we don't want to start directly on the border, so add the margin @@ -58,18 +58,18 @@ void RationalWidget::paintEvent(QPaintEvent* /* p_paintEvent */) bool tmp_painting = false; // start the painter - QPainter paint(this); + TQPainter paint(this); // ratios and operation signs are painted with the same font paint.setFont(m_font); // set the pen for painting - QPen pen(Qt::SolidLine); + TQPen pen(Qt::SolidLine); pen.setWidth(0); paint.setPen(pen); // get the font height; the font height doesn't change while painting - QFontMetrics fm(paint.fontMetrics()); + TQFontMetrics fm(paint.fontMetrics()); int fontHeight = fm.lineSpacing(); // get the font height // now we can correctly set the height of the widget @@ -87,7 +87,7 @@ void RationalWidget::paintEvent(QPaintEvent* /* p_paintEvent */) } // paint the current number (or comma) - paintMiddle(paint, QString(m_number[stringPos]), x_pos, fm, m_colorNumber, false); + paintMiddle(paint, TQString(m_number[stringPos]), x_pos, fm, m_colorNumber, false); // check if the period line ends over the current number; in this case // draw the period line diff --git a/kbruch/src/rationalwidget.h b/kbruch/src/rationalwidget.h index bb668bcd..f75b6ddb 100644 --- a/kbruch/src/rationalwidget.h +++ b/kbruch/src/rationalwidget.h @@ -37,18 +37,18 @@ class RationalWidget : public FractionBaseWidget public: /** constructor */ - RationalWidget(QWidget * parent, const char * name, const QString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0); + RationalWidget(TQWidget * parent, const char * name, const TQString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0); /** destructor */ ~RationalWidget(); /** set the task to be displayed */ - void setRational(const QString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0); + void setRational(const TQString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0); private: /** the rational number to be displayed */ - QString m_number; + TQString m_number; /** starting of the period */ uint m_periodStart; @@ -57,7 +57,7 @@ private: uint m_periodLength; /** overrideing the paint event of FractionBaseWidget */ - void paintEvent(QPaintEvent*); + void paintEvent(TQPaintEvent*); }; #endif diff --git a/kbruch/src/ratiowidget.cpp b/kbruch/src/ratiowidget.cpp index 43d4d317..17f1cf04 100644 --- a/kbruch/src/ratiowidget.cpp +++ b/kbruch/src/ratiowidget.cpp @@ -19,9 +19,9 @@ #include "ratiowidget.moc" /* these includes are needed for Qt support */ -#include +#include -RatioWidget::RatioWidget(QWidget * parent = 0, const char * name = 0, +RatioWidget::RatioWidget(TQWidget * parent = 0, const char * name = 0, const ratio para_ratio = *new ratio()) : FractionBaseWidget(parent, name), m_ratio(para_ratio) { @@ -43,25 +43,25 @@ void RatioWidget::setRatio(const ratio para_ratio) update(); } -void RatioWidget::paintEvent(QPaintEvent* /* p_paintEvent */) +void RatioWidget::paintEvent(TQPaintEvent* /* p_paintEvent */) { // our x position, we paint from left to right; // we don't want to start directly on the border, so add the margin int x_pos = _MARGIN_X; // start the painter - QPainter paint(this); + TQPainter paint(this); // ratios and operation signs are painted with the same font paint.setFont(m_font); // set the pen for painting - QPen pen(Qt::SolidLine); + TQPen pen(Qt::SolidLine); pen.setWidth(0); paint.setPen(pen); // get the font height; the font height doesn't change while painting - QFontMetrics fm(paint.fontMetrics()); + TQFontMetrics fm(paint.fontMetrics()); // now we can correctly set the height of the widget setMinimumHeight(2 * fm.lineSpacing() + 10); diff --git a/kbruch/src/ratiowidget.h b/kbruch/src/ratiowidget.h index f2422043..8a64d3d4 100644 --- a/kbruch/src/ratiowidget.h +++ b/kbruch/src/ratiowidget.h @@ -25,7 +25,7 @@ #include "fractionbasewidget.h" #include "ratio.h" -#include +#include /*! class to paint the ratio * @@ -36,7 +36,7 @@ class RatioWidget : public FractionBaseWidget public: /** constructor */ - RatioWidget(QWidget * parent, const char * name, const ratio para_ratio); + RatioWidget(TQWidget * parent, const char * name, const ratio para_ratio); /** destructor */ ~RatioWidget(); @@ -50,7 +50,7 @@ private: ratio m_ratio; /** overrideing the paint event of FractionBaseWidget */ - void paintEvent(QPaintEvent*); + void paintEvent(TQPaintEvent*); }; #endif diff --git a/kbruch/src/resultwidget.cpp b/kbruch/src/resultwidget.cpp index bc9fb285..7f493408 100644 --- a/kbruch/src/resultwidget.cpp +++ b/kbruch/src/resultwidget.cpp @@ -19,11 +19,11 @@ #include "resultwidget.moc" /* these includes are needed for Qt support */ -#include +#include #include "settingsclass.h" -ResultWidget::ResultWidget(QWidget * parent = 0, const char * name = 0, +ResultWidget::ResultWidget(TQWidget * parent = 0, const char * name = 0, const ratio para_result = *new ratio()) : FractionBaseWidget(parent, name), m_result(para_result) { @@ -45,38 +45,38 @@ void ResultWidget::setResult(const ratio para_result) update(); } -void ResultWidget::paintEvent(QPaintEvent* /* p_paintEvent */) +void ResultWidget::paintEvent(TQPaintEvent* /* p_paintEvent */) { // our x position, we paint from left to right; // we don't want to start directly on the border, so add the margin int old_x = _MARGIN_X; // start the painter - QPainter paint(this); + TQPainter paint(this); // ratios and operation signs are painted with the same font paint.setFont(m_font); // set the pen for painting - QPen pen(Qt::SolidLine); + TQPen pen(Qt::SolidLine); pen.setWidth(0); paint.setPen(pen); // get the font height; the font height doesn't change while painting - QFontMetrics fm(paint.fontMetrics()); + TQFontMetrics fm(paint.fontMetrics()); // now we can correctly set the height of the widget setMinimumHeight(2 * fm.lineSpacing() + 10); setMaximumHeight(2 * fm.lineSpacing() + 10); // result as normal ratio - paintMiddle(paint, QString("="), old_x, fm, m_colorOperation); + paintMiddle(paint, TQString("="), old_x, fm, m_colorOperation); paintRatio(paint, m_result, old_x, fm, false); if (SettingsClass::showSpecialRatioNotation() == true && QABS(m_result.numerator()) >= QABS(m_result.denominator())) { // result as mixed number - paintMiddle(paint, QString("="), old_x, fm, m_colorOperation); + paintMiddle(paint, TQString("="), old_x, fm, m_colorOperation); paintRatio(paint, m_result, old_x, fm, true); } diff --git a/kbruch/src/resultwidget.h b/kbruch/src/resultwidget.h index 4570df1d..b42c3776 100644 --- a/kbruch/src/resultwidget.h +++ b/kbruch/src/resultwidget.h @@ -25,7 +25,7 @@ #include "fractionbasewidget.h" #include "ratio.h" -#include +#include /*! class to paint the result * @@ -36,7 +36,7 @@ class ResultWidget : public FractionBaseWidget public: /** constructor */ - ResultWidget(QWidget * parent, const char * name, const ratio para_result); + ResultWidget(TQWidget * parent, const char * name, const ratio para_result); /** destructor */ ~ResultWidget(); @@ -50,7 +50,7 @@ private: ratio m_result; /** overrideing the paint event of FractionBaseWidget */ - void paintEvent(QPaintEvent*); + void paintEvent(TQPaintEvent*); }; #endif diff --git a/kbruch/src/statisticsview.cpp b/kbruch/src/statisticsview.cpp index b19779f6..d6b8ff37 100644 --- a/kbruch/src/statisticsview.cpp +++ b/kbruch/src/statisticsview.cpp @@ -19,11 +19,11 @@ #include "statisticsview.moc" /* the includes are needed for Qt support */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -31,8 +31,8 @@ #include "settingsclass.h" /* constructor */ -StatisticsView::StatisticsView(QWidget * parent, const char * name): - QWidget(parent, name), m_count(0), m_correct(0) +StatisticsView::StatisticsView(TQWidget * parent, const char * name): + TQWidget(parent, name), m_count(0), m_correct(0) { #ifdef DEBUG kdDebug() << "constructor StatisticsView()" << endl; @@ -42,93 +42,93 @@ StatisticsView::StatisticsView(QWidget * parent, const char * name): m_count = SettingsClass::count(); m_correct = SettingsClass::correct(); - QPalette pal; - QColorGroup cg; + TQPalette pal; + TQColorGroup cg; /* set the caption of the window */ // setCaption(i18n("Statistics")); /* add a layout as a base */ - layout1 = new QVBoxLayout(this); + layout1 = new TQVBoxLayout(this); layout1->setSpacing(6); layout1->setMargin(6); /* now add a v-spacer */ - QSpacerItem * v_spacer = new QSpacerItem(1, 1); + TQSpacerItem * v_spacer = new TQSpacerItem(1, 1); layout1->addItem(v_spacer); /* create a grid to show the labels */ - labelGrid = new QGridLayout(layout1, 3, 2); + labelGrid = new TQGridLayout(layout1, 3, 2); /* add 6 labels to the grid */ - info1Label = new QLabel(this); + info1Label = new TQLabel(this); info1Label->setText(i18n("Tasks so far:")); labelGrid->addWidget(info1Label, 1, 0); - result1Label = new QLabel(this); + result1Label = new TQLabel(this); labelGrid->addWidget(result1Label, 1, 1); - QToolTip::add(result1Label, + TQToolTip::add(result1Label, i18n("This is the current total number of solved tasks.")); - info2Label = new QLabel(this); + info2Label = new TQLabel(this); info2Label->setText(i18n("Correct:")); labelGrid->addWidget(info2Label, 2, 0); - result2Label = new QLabel(this); + result2Label = new TQLabel(this); /* set green text color for this label */ pal = result2Label->palette(); cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setInactive(cg); result2Label->setPalette(pal); labelGrid->addWidget(result2Label, 2, 1); - QToolTip::add(result2Label, + TQToolTip::add(result2Label, i18n("This is the current total number of correctly solved tasks.")); - info3Label = new QLabel(this); + info3Label = new TQLabel(this); info3Label->setText(i18n("Incorrect:")); labelGrid->addWidget(info3Label, 3, 0); - result3Label = new QLabel(this); + result3Label = new TQLabel(this); /* set red text color for this label */ pal = result3Label->palette(); cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setInactive(cg); result3Label->setPalette(pal); labelGrid->addWidget(result3Label, 3, 1); - QToolTip::add(result3Label, + TQToolTip::add(result3Label, i18n("This is the current total number of unsolved tasks.")); /* now add a v-spacer */ - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); layout1->addItem(v_spacer); /* the Reset button */ - buttonLayout = new QHBoxLayout(layout1); - resetBtn = new QPushButton(i18n("&Reset"), this); - QObject::connect(resetBtn, SIGNAL(clicked()), this, SLOT(resetStatistics())); + buttonLayout = new TQHBoxLayout(layout1); + resetBtn = new TQPushButton(i18n("&Reset"), this); + TQObject::connect(resetBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(resetStatistics())); buttonLayout->addWidget(resetBtn); - QToolTip::add(resetBtn, i18n("Press the button to reset the statistics.")); - QSpacerItem* spacer = new QSpacerItem(0,0); + TQToolTip::add(resetBtn, i18n("Press the button to reset the statistics.")); + TQSpacerItem* spacer = new TQSpacerItem(0,0); buttonLayout->addItem(spacer); /* calculate the statistics */ (void) calc(); // add tooltip and qwhatsthis help to the widget - QToolTip::add(this, i18n("This part of the window shows the statistics.")); - QWhatsThis::add(this, i18n("This part of the window shows the statistics. Each exercise you do is counted. You can reset the statistics by clicking on the button below. Also, if you do not want to see the statistics, use the vertical bar on the left to reduce the size of this window part.")); + TQToolTip::add(this, i18n("This part of the window shows the statistics.")); + TQWhatsThis::add(this, i18n("This part of the window shows the statistics. Each exercise you do is counted. You can reset the statistics by clicking on the button below. Also, if you do not want to see the statistics, use the vertical bar on the left to reduce the size of this window part.")); } /* destructor */ @@ -166,10 +166,10 @@ void StatisticsView::addWrong() /* recalculates the statistics and changes the corresponding labels */ void StatisticsView::calc() { - QString new_text; - QString number; + TQString new_text; + TQString number; - new_text = QString("%1").arg(m_count); + new_text = TQString("%1").arg(m_count); result1Label->setText(new_text); /* we have to be careful with division by 0 */ @@ -179,11 +179,11 @@ void StatisticsView::calc() result3Label->setText("- (- %)"); } else { /* set the correct label */ - new_text = QString("%1 (%2 %)").arg(m_correct).arg(int(double(m_correct) / m_count * 100)); + new_text = TQString("%1 (%2 %)").arg(m_correct).arg(int(double(m_correct) / m_count * 100)); result2Label->setText(new_text); /* set the incorrect label */ - new_text = QString("%1 (%2 %)").arg(m_count - m_correct).arg(int(double(m_count - m_correct) / m_count * 100)); + new_text = TQString("%1 (%2 %)").arg(m_count - m_correct).arg(int(double(m_count - m_correct) / m_count * 100)); result3Label->setText(new_text); } } diff --git a/kbruch/src/statisticsview.h b/kbruch/src/statisticsview.h index 9de0c24d..6cbdf466 100644 --- a/kbruch/src/statisticsview.h +++ b/kbruch/src/statisticsview.h @@ -24,7 +24,7 @@ class QVBoxLayout; class QHBoxLayout; class QGridLayout; -#include +#include /*! * StatisticsView takes care of the statistics of a test. @@ -40,7 +40,7 @@ class StatisticsView : public QWidget public: /** constructor */ - StatisticsView(QWidget * parent = 0, const char * name = 0); + StatisticsView(TQWidget * parent = 0, const char * name = 0); /** destructor */ ~StatisticsView(); @@ -63,16 +63,16 @@ private: unsigned int m_count; unsigned int m_correct; - QPushButton * resetBtn; - QHBoxLayout * buttonLayout; - QVBoxLayout * layout1; - QGridLayout * labelGrid; - QLabel * result1Label; - QLabel * result2Label; - QLabel * result3Label; - QLabel * info1Label; - QLabel * info2Label; - QLabel * info3Label; + TQPushButton * resetBtn; + TQHBoxLayout * buttonLayout; + TQVBoxLayout * layout1; + TQGridLayout * labelGrid; + TQLabel * result1Label; + TQLabel * result2Label; + TQLabel * result3Label; + TQLabel * info1Label; + TQLabel * info2Label; + TQLabel * info3Label; }; #endif diff --git a/kbruch/src/task.cpp b/kbruch/src/task.cpp index 4c3748a3..50cd2f28 100644 --- a/kbruch/src/task.cpp +++ b/kbruch/src/task.cpp @@ -176,7 +176,7 @@ void task::add_operation(short operation) } /** just outputs the whole given task to stdout; for debugging */ -QTextStream & task::display(QTextStream & str) +TQTextStream & task::display(TQTextStream & str) { /* this is our pointer on the ratio_vector, set it to the beginning */ RatioArray::iterator ratio_pointer = ratio_vector.begin(); @@ -706,7 +706,7 @@ void task::make_denominators(int main_denominator, short pmax_md, /* ------ some prototyps of non class functions ------ */ /** it is possible to code: cout << task_object << endl; */ -QTextStream & operator<<(QTextStream & str, task & ptask) +TQTextStream & operator<<(TQTextStream & str, task & ptask) { return ptask.display(str); } diff --git a/kbruch/src/task.h b/kbruch/src/task.h index 3e4c15b6..57c80b86 100644 --- a/kbruch/src/task.h +++ b/kbruch/src/task.h @@ -52,9 +52,9 @@ typedef struct PRIME_FACTOR Tprime_factor; /** we use the vector template class to create 3 dynamic types */ -typedef QValueVector RatioArray; -typedef QValueVector ShortArray; -typedef QValueVector PrimeFactorArray; +typedef TQValueVector RatioArray; +typedef TQValueVector ShortArray; +typedef TQValueVector PrimeFactorArray; /*! class to handle mathematical tasks with ratios * naming: @@ -101,7 +101,7 @@ public: void add_operation(short operation = ADD); /** display the whole task, mainly for debug */ - QTextStream & display(QTextStream & str); + TQTextStream & display(TQTextStream & str); /** solves the task and returns the result as ratio */ ratio solve(); @@ -162,6 +162,6 @@ private: /* ------ some prototypes of non class functions ------ */ /** it is possible to code: cout << task_object << endl; */ -QTextStream & operator<<(QTextStream & str, task & ptask); +TQTextStream & operator<<(TQTextStream & str, task & ptask); #endif diff --git a/kbruch/src/taskview.cpp b/kbruch/src/taskview.cpp index aba064a1..a15520a8 100644 --- a/kbruch/src/taskview.cpp +++ b/kbruch/src/taskview.cpp @@ -25,12 +25,12 @@ #include /* these includes are needed for Qt support */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* standard C++ library includes */ #include @@ -38,7 +38,7 @@ /* ----- public member functions ----- */ /* constructor */ -TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub, +TaskView::TaskView(TQWidget * parent, const char * name, bool padd_sub, bool pmul_div, unsigned int pnr_ratios, unsigned int pmax_md): ExerciseBase(parent, name), add_sub(padd_sub), mul_div(pmul_div), nr_ratios(pnr_ratios), max_md(pmax_md) @@ -50,66 +50,66 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub, curr_nr_ratios = nr_ratios; /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ current_task.create_task(max_md, nr_ratios, add_sub, mul_div); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // the next thing to do on a button click would be to check the entered // result m_currentState = _CHECK_TASK; - baseWidget = new QWidget(this, "baseWidget"); - baseGrid = new QGridLayout(this, 1, 1, 0, -1, "baseGrid"); + baseWidget = new TQWidget(this, "baseWidget"); + baseGrid = new TQGridLayout(this, 1, 1, 0, -1, "baseGrid"); baseGrid->addWidget(baseWidget, 0, 0); // this is a VBox - realLayout = new QVBoxLayout(baseWidget, 5, 5, "realLayout"); + realLayout = new TQVBoxLayout(baseWidget, 5, 5, "realLayout"); // add a spacer at the top of the VBox - QSpacerItem * v_spacer = new QSpacerItem(1, 1); + TQSpacerItem * v_spacer = new TQSpacerItem(1, 1); realLayout->addItem(v_spacer); // now a line holding the task, input fields and result - QHBoxLayout * taskLineHBoxLayout = new QHBoxLayout(5, "taskLineHBoxLayout"); + TQHBoxLayout * taskLineHBoxLayout = new TQHBoxLayout(5, "taskLineHBoxLayout"); realLayout->addLayout(taskLineHBoxLayout); // first left is the task widget m_taskWidget = new TaskWidget(baseWidget, "m_taskWidget", current_task); // now we have the input fields aligned in a VBox - QVBoxLayout * inputLayout = new QVBoxLayout(5, "inputLayout"); + TQVBoxLayout * inputLayout = new TQVBoxLayout(5, "inputLayout"); // to validate, that the input is an int KIntValidator *valnum = new KIntValidator( this ); /* add input box so the user can enter numerator */ - numer_edit = new QLineEdit(baseWidget, "numer_edit"); + numer_edit = new TQLineEdit(baseWidget, "numer_edit"); numer_edit->setValidator( valnum ); // use the int validator - QToolTip::add(numer_edit, i18n("Enter the numerator of your result")); + TQToolTip::add(numer_edit, i18n("Enter the numerator of your result")); inputLayout->addWidget(numer_edit); /* add a line between the edit boxes */ - edit_line = new QFrame(baseWidget, "edit_line"); - edit_line->setGeometry(QRect(100, 100, 20, 20)); - edit_line->setFrameStyle(QFrame::HLine | QFrame::Sunken); + edit_line = new TQFrame(baseWidget, "edit_line"); + edit_line->setGeometry(TQRect(100, 100, 20, 20)); + edit_line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); inputLayout->addWidget(edit_line); /* add input box so the user can enter denominator */ - deno_edit = new QLineEdit(baseWidget, "deno_edit"); + deno_edit = new TQLineEdit(baseWidget, "deno_edit"); deno_edit->setValidator( valnum ); // use the int validator - QToolTip::add(deno_edit, i18n("Enter the denominator of your result")); + TQToolTip::add(deno_edit, i18n("Enter the denominator of your result")); inputLayout->addWidget(deno_edit); // next is the result widget m_resultWidget = new ResultWidget(baseWidget, "m_resultWidget", *new ratio()); // at the right end we have a label just showing CORRECT or WRONG - result_label = new QLabel(baseWidget, "result_label"); + result_label = new TQLabel(baseWidget, "result_label"); result_label->setText(i18n("WRONG")); result_label->hide(); // add another spacer in the middle of the VBox - v_spacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); + v_spacer = new TQSpacerItem(1, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum); // --- that is the end of the horizontal line --- // in RTL desktops, we still need to allign the @@ -120,7 +120,7 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub, // // if you need help with this feel free to contact me - Diego ) // This should fix parts of bug #116831 - if (QApplication::reverseLayout()) + if (TQApplication::reverseLayout()) { taskLineHBoxLayout->addItem(v_spacer); taskLineHBoxLayout->addWidget(result_label); @@ -138,22 +138,22 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub, } // add another spacer in the middle of the VBox - v_spacer = new QSpacerItem(1, 1); + v_spacer = new TQSpacerItem(1, 1); realLayout->addItem(v_spacer); // the lower part of the VBox holds just a right aligned button - QHBoxLayout * lowerHBox = new QHBoxLayout(1, "lowerHBox"); + TQHBoxLayout * lowerHBox = new TQHBoxLayout(1, "lowerHBox"); realLayout->addLayout(lowerHBox); lowerHBox->addStretch(100); // the right aligned button - m_checkButton = new QPushButton( baseWidget, "m_checkButton" ); + m_checkButton = new TQPushButton( baseWidget, "m_checkButton" ); m_checkButton->setText(i18n("&Check Task")); m_checkButton->setDefault(true); // is the default button of the dialog - QToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); lowerHBox->addWidget(m_checkButton, 1, Qt::AlignRight); - QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked())); + TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked())); // that the user can start typing without moving the focus numer_edit->setFocus(); @@ -166,8 +166,8 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub, m_resultWidget->hide(); // add tooltip and qwhatsthis help to the widget - QToolTip::add(this, i18n("In this exercise you have to solve a given task with fractions.")); - QWhatsThis::add(this, i18n("In this exercise you have to solve the generated task. You have to enter numerator and denominator. You can adjust the difficulty of the task with the boxes in the toolbar. Do not forget to reduce the result!")); + TQToolTip::add(this, i18n("In this exercise you have to solve a given task with fractions.")); + TQWhatsThis::add(this, i18n("In this exercise you have to solve the generated task. You have to enter numerator and denominator. You can adjust the difficulty of the task with the boxes in the toolbar. Do not forget to reduce the result!")); } /* destructor */ @@ -241,7 +241,7 @@ void TaskView::update() m_resultWidget->updateAndRepaint(); // update for itself - ((QWidget *) this)->update(); + ((TQWidget *) this)->update(); } @@ -255,12 +255,12 @@ void TaskView::update() - emits signals if task was solved right or wrong */ void TaskView::showResult() { - QString tmp_str; /* to build a string for a label */ - QPalette pal; - QColorGroup cg; + TQString tmp_str; /* to build a string for a label */ + TQPalette pal; + TQColorGroup cg; // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task.")); numer_edit->setEnabled(false); deno_edit->setEnabled(false); @@ -298,10 +298,10 @@ void TaskView::showResult() result_label->setText(i18n("CORRECT")); pal = result_label->palette(); /* set green font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0)); + cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0)); pal.setInactive(cg); result_label->setPalette(pal); result_label->show(); /* show the result at the end of the task */ @@ -313,10 +313,10 @@ void TaskView::showResult() result_label->setText(i18n("WRONG")); pal = result_label->palette(); /* set red font color */ cg = pal.active(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setActive(cg); cg = pal.inactive(); - cg.setColor(QColorGroup::Foreground, QColor(red)); + cg.setColor(TQColorGroup::Foreground, TQColor(red)); pal.setInactive(cg); result_label->setPalette(pal); @@ -344,7 +344,7 @@ void TaskView::showResult() void TaskView::nextTask() { // change the tooltip of the check button - QToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); + TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet.")); numer_edit->setEnabled(true); deno_edit->setEnabled(true); @@ -358,9 +358,9 @@ void TaskView::nextTask() numer_edit->setFocus(); /* create a new task */ - QApplication::setOverrideCursor(waitCursor); /* show the sand clock */ + TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */ current_task.create_task(max_md, nr_ratios, add_sub, mul_div); - QApplication::restoreOverrideCursor(); /* show the normal cursor */ + TQApplication::restoreOverrideCursor(); /* show the normal cursor */ // update the task widget m_taskWidget->setTask((const task) (current_task)); diff --git a/kbruch/src/taskview.h b/kbruch/src/taskview.h index 60c3e75c..f629fac8 100644 --- a/kbruch/src/taskview.h +++ b/kbruch/src/taskview.h @@ -30,7 +30,7 @@ #include #endif -#include +#include class QVBoxLayout; @@ -42,7 +42,7 @@ class QPushButton; class QLineEdit; class QFrame; -/*! Constructs a QWidget, which shows the task to the user. +/*! Constructs a TQWidget, which shows the task to the user. * The class also provides input fields, so that the user can enter the result. * It also controls the interaction, so that the entered result gets checked * and a new task can be generated. @@ -54,7 +54,7 @@ class TaskView : public ExerciseBase public: /** constructor */ - TaskView(QWidget * parent = 0, const char * name = 0, + TaskView(TQWidget * parent = 0, const char * name = 0, bool padd_sub = true, bool pmul_div = false, unsigned int pnr_ratios = 2, unsigned int pmax_md = 10); @@ -88,16 +88,16 @@ private: short m_currentState; ResultWidget* m_resultWidget; - QPushButton* m_checkButton; - QLabel* result_label; + TQPushButton* m_checkButton; + TQLabel* result_label; TaskWidget* m_taskWidget; - QLineEdit* numer_edit; - QFrame* edit_line; - QLineEdit* deno_edit; + TQLineEdit* numer_edit; + TQFrame* edit_line; + TQLineEdit* deno_edit; - QGridLayout* baseGrid; - QWidget* baseWidget; - QVBoxLayout* realLayout; + TQGridLayout* baseGrid; + TQWidget* baseWidget; + TQVBoxLayout* realLayout; task current_task; ratio result; diff --git a/kbruch/src/taskwidget.cpp b/kbruch/src/taskwidget.cpp index 378b7afb..1807283e 100644 --- a/kbruch/src/taskwidget.cpp +++ b/kbruch/src/taskwidget.cpp @@ -22,9 +22,9 @@ #include /* these includes are needed for Qt support */ -#include +#include -TaskWidget::TaskWidget(QWidget * parent = 0, const char * name = 0, +TaskWidget::TaskWidget(TQWidget * parent = 0, const char * name = 0, const task para_task = *new task()) : FractionBaseWidget(parent, name), m_task(para_task) { @@ -46,31 +46,31 @@ void TaskWidget::setTask(const task para_task) update(); } -void TaskWidget::paintEvent(QPaintEvent* /* p_paintEvent */) +void TaskWidget::paintEvent(TQPaintEvent* /* p_paintEvent */) { // our x position, we paint from left to right; // we don't want to start directly on the border, so add the margin int old_x = _MARGIN_X; // strings holding numerator, denominator and the operation sign - QString str_numerator, str_denominator, str_operation; + TQString str_numerator, str_denominator, str_operation; // operation sign as number short tmp_operation; // start the painter - QPainter paint(this); + TQPainter paint(this); // ratios and operation signs are painted with the same font paint.setFont(m_font); // set the pen for painting - QPen pen(Qt::SolidLine); + TQPen pen(Qt::SolidLine); pen.setWidth(0); paint.setPen(pen); // get the font height; the font height doesn't change while painting - QFontMetrics fm(paint.fontMetrics()); + TQFontMetrics fm(paint.fontMetrics()); // now we can correctly set the height of the widget setMinimumHeight(2 * fm.lineSpacing() + 10); diff --git a/kbruch/src/taskwidget.h b/kbruch/src/taskwidget.h index e25ef3d3..2d7238ae 100644 --- a/kbruch/src/taskwidget.h +++ b/kbruch/src/taskwidget.h @@ -25,7 +25,7 @@ #include "fractionbasewidget.h" #include "task.h" -#include +#include /** important for add_sub and mul_div */ #define YES 1 @@ -46,7 +46,7 @@ class TaskWidget : public FractionBaseWidget public: /** constructor */ - TaskWidget(QWidget * parent, const char * name, const task para_task); + TaskWidget(TQWidget * parent, const char * name, const task para_task); /** destructor */ ~TaskWidget(); @@ -60,7 +60,7 @@ private: task m_task; /** overrideing the paint event of FractionBaseWidget */ - void paintEvent(QPaintEvent*); + void paintEvent(TQPaintEvent*); }; #endif diff --git a/keduca/keduca/kcheckeduca.cpp b/keduca/keduca/kcheckeduca.cpp index 8fe6b557..a75c8478 100644 --- a/keduca/keduca/kcheckeduca.cpp +++ b/keduca/keduca/kcheckeduca.cpp @@ -18,10 +18,10 @@ #include "kcheckeduca.h" #include "kcheckeduca.moc" -#include +#include #include -KCheckEduca::KCheckEduca(QWidget *parent, const char *name ) : QCheckBox(parent,name) +KCheckEduca::KCheckEduca(TQWidget *parent, const char *name ) : TQCheckBox(parent,name) { _doc = 0; KAcceleratorManager::setNoAccel( this ); @@ -33,21 +33,21 @@ KCheckEduca::~KCheckEduca() } /** */ -void KCheckEduca::drawButtonLabel( QPainter *p){ +void KCheckEduca::drawButtonLabel( TQPainter *p){ int x, y, w, h; int extra_width, indicator_width; extra_width = 8; - indicator_width = style().pixelMetric(QStyle::PM_IndicatorWidth, 0); + indicator_width = style().pixelMetric(TQStyle::PM_IndicatorWidth, 0); y = 0; x = indicator_width + extra_width; //### w = width() - x; h = height(); - QRect cr(x,y,w,h); + TQRect cr(x,y,w,h); - _doc = new QSimpleRichText( text(), font() ); + _doc = new TQSimpleRichText( text(), font() ); _doc->setWidth( 10 ); _doc->setWidth(p, cr.width() ); @@ -61,25 +61,25 @@ void KCheckEduca::drawButtonLabel( QPainter *p){ yo = (cr.height()-rh)/2; if ( !isEnabled() ) { - QColorGroup cg = colorGroup(); - cg.setColor( QColorGroup::Text, cg.light() ); + TQColorGroup cg = colorGroup(); + cg.setColor( TQColorGroup::Text, cg.light() ); _doc->draw(p, cr.x()+xo+1, cr.y()+yo+1, cr, cg, 0); } _doc->draw(p, cr.x()+xo, cr.y()+yo, cr, colorGroup(), 0); if ( hasFocus() ) { -// QRect br = style().itemRect( p, x, y, rw, rh+yo, +// TQRect br = style().itemRect( p, x, y, rw, rh+yo, // AlignLeft|AlignVCenter|ShowPrefix, // isEnabled(), // pixmap(), text().visual() ); - QRect br(x,y,rw,rh+yo); + TQRect br(x,y,rw,rh+yo); br.setLeft( br.left()-3 ); br.setRight( br.right()+2 ); br.setTop( br.top()-2 ); br.setBottom( br.bottom()+2); - br = br.intersect( QRect(0,0,rw, rh+yo ) ); + br = br.intersect( TQRect(0,0,rw, rh+yo ) ); - style().drawPrimitive( QStyle::PE_FocusRect, p, br, colorGroup()); + style().drawPrimitive( TQStyle::PE_FocusRect, p, br, colorGroup()); } } diff --git a/keduca/keduca/kcheckeduca.h b/keduca/keduca/kcheckeduca.h index a874b62d..32ff3b81 100644 --- a/keduca/keduca/kcheckeduca.h +++ b/keduca/keduca/kcheckeduca.h @@ -18,27 +18,27 @@ #ifndef KCHECKEDUCA_H #define KCHECKEDUCA_H -#include +#include -#include +#include /**KCheck with wordwrap and rich text support *@author Javier Campos Morales */ -class KCheckEduca : public QCheckBox { +class KCheckEduca : public TQCheckBox { Q_OBJECT public: - KCheckEduca(QWidget *parent=0, const char *name=0); + KCheckEduca(TQWidget *parent=0, const char *name=0); ~KCheckEduca(); protected: - void drawButtonLabel( QPainter *); + void drawButtonLabel( TQPainter *); private: /** Rich text */ - QSimpleRichText *_doc; + TQSimpleRichText *_doc; }; #endif diff --git a/keduca/keduca/keduca.cpp b/keduca/keduca/keduca.cpp index 8abc874b..2ab99ea0 100644 --- a/keduca/keduca/keduca.cpp +++ b/keduca/keduca/keduca.cpp @@ -28,9 +28,9 @@ #include -#include +#include -Keduca::Keduca( QWidget* parent, const char *name, WFlags f ) +Keduca::Keduca( TQWidget* parent, const char *name, WFlags f ) : KParts::MainWindow( parent, name, f ), _part( 0 ) { setXMLFile( "keducaui.rc" ); @@ -53,7 +53,7 @@ Keduca::Keduca( QWidget* parent, const char *name, WFlags f ) kdFatal() << "The library \"libkeducapart\" could not be found. Aborting." << endl; } if (!initialGeometrySet()) - resize( QSize(550, 450).expandedTo(minimumSizeHint())); + resize( TQSize(550, 450).expandedTo(minimumSizeHint())); } Keduca::~Keduca() @@ -63,17 +63,17 @@ Keduca::~Keduca() void Keduca::setupActions() { - KStdAction::open( this, SLOT( slotFileOpen() ), actionCollection() ); - (void)new KAction( i18n( "Open &Gallery..." ), 0, 0, this, SLOT( slotGallery() ), + KStdAction::open( this, TQT_SLOT( slotFileOpen() ), actionCollection() ); + (void)new KAction( i18n( "Open &Gallery..." ), 0, 0, this, TQT_SLOT( slotGallery() ), actionCollection(), "open_gallery" ); - _recentFiles = KStdAction::openRecent(this, SLOT ( slotFileOpenURL(const KURL &) ), + _recentFiles = KStdAction::openRecent(this, TQT_SLOT ( slotFileOpenURL(const KURL &) ), actionCollection()); - KStdAction::quit(kapp, SLOT( quit() ), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT( quit() ), actionCollection()); } void Keduca::slotFileOpen() { - KURL url = KFileDialog::getOpenURL( QString::null, "application/x-edu", this, i18n("Open Educa File") ); + KURL url = KFileDialog::getOpenURL( TQString::null, "application/x-edu", this, i18n("Open Educa File") ); if( !url.isEmpty() ) slotFileOpenURL( url ); } @@ -125,6 +125,6 @@ void Keduca::initGallery(const KURL &urlFile) if( !urlFile.url().isEmpty() ) galleries.putURL( urlFile ); - if( galleries.exec() == QDialog::Accepted ) + if( galleries.exec() == TQDialog::Accepted ) slotFileOpenURL( galleries.getURL() ); } diff --git a/keduca/keduca/keduca.h b/keduca/keduca/keduca.h index c5c5c99b..a997d36e 100644 --- a/keduca/keduca/keduca.h +++ b/keduca/keduca/keduca.h @@ -37,7 +37,7 @@ class Keduca : public KParts::MainWindow public: /** construtor */ - Keduca(QWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); + Keduca(TQWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); /** destructor */ ~Keduca(); /** Open gallery window */ diff --git a/keduca/keduca/keduca_part.cpp b/keduca/keduca/keduca_part.cpp index c5d13f68..bc9e5485 100644 --- a/keduca/keduca/keduca_part.cpp +++ b/keduca/keduca/keduca_part.cpp @@ -34,9 +34,9 @@ typedef KParts::GenericFactory KEducaPartFactory; K_EXPORT_COMPONENT_FACTORY( libkeducapart, KEducaPartFactory ) -KEducaPart::KEducaPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const QStringList &/*args*/ ) +KEducaPart::KEducaPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const TQStringList &/*args*/ ) : KParts::ReadOnlyPart( parent, name ) { setInstance( KEducaPartFactory::instance() ); @@ -71,7 +71,7 @@ bool KEducaPart::openFile() void KEducaPart::setupActions() { - KStdAction::preferences( this, SLOT( slotConfigure() ), actionCollection(), "configure" ); + KStdAction::preferences( this, TQT_SLOT( slotConfigure() ), actionCollection(), "configure" ); } void KEducaPart::slotConfigure() @@ -83,7 +83,7 @@ void KEducaPart::slotConfigure() ConfigDialogBase *confDlg = new ConfigDialogBase( 0, "ConfigDialogBase" ); dialog->addPage( confDlg, i18n("General"), "keduca" ); - connect( dialog, SIGNAL( settingsChanged() ), SLOT( updateConfiguration() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), TQT_SLOT( updateConfiguration() ) ); dialog->show(); } diff --git a/keduca/keduca/keduca_part.h b/keduca/keduca/keduca_part.h index 98a720fc..418209a8 100644 --- a/keduca/keduca/keduca_part.h +++ b/keduca/keduca/keduca_part.h @@ -40,8 +40,8 @@ class KEducaPart : public KParts::ReadOnlyPart /* * Constructor. */ - KEducaPart( QWidget *parentWidget, const char *widgetName, QObject *parent, - const char *name, const QStringList &args ); + KEducaPart( TQWidget *parentWidget, const char *widgetName, TQObject *parent, + const char *name, const TQStringList &args ); /* * Destructor. diff --git a/keduca/keduca/keducaprefs.cpp b/keduca/keduca/keducaprefs.cpp index b43f59e2..bdd07677 100644 --- a/keduca/keduca/keducaprefs.cpp +++ b/keduca/keduca/keducaprefs.cpp @@ -22,12 +22,12 @@ #include #include -#include -#include -#include +#include +#include +#include -KEducaPrefs::KEducaPrefs(QWidget *parent, const char *name, bool modal ) : KDialogBase(IconList, i18n("Configure"), Ok|Cancel, Ok, parent, name, modal, true) +KEducaPrefs::KEducaPrefs(TQWidget *parent, const char *name, bool modal ) : KDialogBase(IconList, i18n("Configure"), Ok|Cancel, Ok, parent, name, modal, true) { setPageGeneral(); configRead(); @@ -38,43 +38,43 @@ KEducaPrefs::~KEducaPrefs(){} /** Set page general */ void KEducaPrefs::setPageGeneral() { - QVBox *mainFrame = addVBoxPage( i18n("Miscellaneous"), i18n("Various Settings"), DesktopIcon("misc")); + TQVBox *mainFrame = addVBoxPage( i18n("Miscellaneous"), i18n("Various Settings"), DesktopIcon("misc")); - QButtonGroup *buttonGroup1 = new QButtonGroup( mainFrame, "ButtonGroup1" ); + TQButtonGroup *buttonGroup1 = new TQButtonGroup( mainFrame, "ButtonGroup1" ); buttonGroup1->setTitle( i18n( "General" ) ); buttonGroup1->setColumnLayout(0, Qt::Vertical ); buttonGroup1->layout()->setSpacing( 0 ); buttonGroup1->layout()->setMargin( 0 ); - QVBoxLayout *buttonGroup1Layout = new QVBoxLayout( buttonGroup1->layout() ); + TQVBoxLayout *buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->layout() ); buttonGroup1Layout->setAlignment( Qt::AlignTop ); buttonGroup1Layout->setSpacing( 6 ); buttonGroup1Layout->setMargin( 11 ); - _resultAfterNext = new QRadioButton( buttonGroup1, "RadioButton1" ); + _resultAfterNext = new TQRadioButton( buttonGroup1, "RadioButton1" ); _resultAfterNext->setText( i18n( "Show results of the answer after press next" ) ); buttonGroup1Layout->addWidget( _resultAfterNext ); - _resultAfterFinish = new QRadioButton( buttonGroup1, "RadioButton2" ); + _resultAfterFinish = new TQRadioButton( buttonGroup1, "RadioButton2" ); _resultAfterFinish->setText( i18n( "Show results when finish the test" ) ); buttonGroup1Layout->addWidget( _resultAfterFinish ); - QGroupBox *GroupBox1 = new QGroupBox( mainFrame, "GroupBox7" ); + TQGroupBox *GroupBox1 = new TQGroupBox( mainFrame, "GroupBox7" ); GroupBox1->setTitle( i18n( "Order" ) ); GroupBox1->setColumnLayout(0, Qt::Vertical ); GroupBox1->layout()->setSpacing( 0 ); GroupBox1->layout()->setMargin( 0 ); - QVBoxLayout *GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() ); + TQVBoxLayout *GroupBox1Layout = new TQVBoxLayout( GroupBox1->layout() ); GroupBox1Layout->setAlignment( Qt::AlignTop ); GroupBox1Layout->setSpacing( 6 ); GroupBox1Layout->setMargin( 11 ); - _randomQuestions = new QCheckBox( GroupBox1, "CheckBox1" ); + _randomQuestions = new TQCheckBox( GroupBox1, "CheckBox1" ); _randomQuestions->setText( i18n( "Show questions in random order" ) ); GroupBox1Layout->addWidget( _randomQuestions ); - _randomAnswers = new QCheckBox( GroupBox1, "CheckBox2" ); + _randomAnswers = new TQCheckBox( GroupBox1, "CheckBox2" ); _randomAnswers->setText( i18n( "Show answers in random order" ) ); GroupBox1Layout->addWidget( _randomAnswers ); } @@ -84,7 +84,7 @@ void KEducaPrefs::configRead() { KConfig *config = KGlobal::config(); config->setGroup("Options"); - QSize defaultSize(500,400); + TQSize defaultSize(500,400); resize( config->readSizeEntry("Geometry", &defaultSize ) ); config->readBoolEntry("ResultFinish", true ) ? _resultAfterFinish->setChecked(true) : _resultAfterNext->setChecked(true); config->readBoolEntry("RandomQuestions", false ) ? _randomQuestions->setChecked(true) : _randomQuestions->setChecked(false); diff --git a/keduca/keduca/keducaprefs.h b/keduca/keduca/keducaprefs.h index b1493798..39efb2e2 100644 --- a/keduca/keduca/keducaprefs.h +++ b/keduca/keduca/keducaprefs.h @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include /** Preferences for KEduca TestMaster (class KEduca) *@author Javier Campos @@ -31,7 +31,7 @@ class KEducaPrefs : public KDialogBase { Q_OBJECT public: - KEducaPrefs(QWidget *parent=0, const char *name=0, bool modal=true); + KEducaPrefs(TQWidget *parent=0, const char *name=0, bool modal=true); ~KEducaPrefs(); private: @@ -48,11 +48,11 @@ private: // Private attributes /** Show result after next */ - QRadioButton *_resultAfterNext; + TQRadioButton *_resultAfterNext; /** Show results after finish */ - QRadioButton *_resultAfterFinish; - QCheckBox *_randomQuestions; - QCheckBox *_randomAnswers; + TQRadioButton *_resultAfterFinish; + TQCheckBox *_randomQuestions; + TQCheckBox *_randomAnswers; private slots: /** Push ok button */ diff --git a/keduca/keduca/keducaview.cpp b/keduca/keduca/keducaview.cpp index cd6c1782..5c07c9c3 100644 --- a/keduca/keduca/keducaview.cpp +++ b/keduca/keduca/keducaview.cpp @@ -32,13 +32,13 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -KEducaView::KEducaView( QWidget *parent, const char *name ) - : QWidgetStack( parent, name ), _keducaFile( 0 ), _timeoutTimer( 0 ) +KEducaView::KEducaView( TQWidget *parent, const char *name ) + : TQWidgetStack( parent, name ), _keducaFile( 0 ), _timeoutTimer( 0 ) { init(); } @@ -58,43 +58,43 @@ KEducaView::~KEducaView() void KEducaView::init() { // Intro Screen - _introWidget = new QLabel( this, "introScreen" ); + _introWidget = new TQLabel( this, "introScreen" ); _introWidget->setBackgroundColor( Qt::white ); _introWidget->setAlignment( AlignCenter ); - _introWidget->setPixmap( QPixmap( locate("data","keduca/pics/keduca_init.png") ) ); + _introWidget->setPixmap( TQPixmap( locate("data","keduca/pics/keduca_init.png") ) ); addWidget( _introWidget, 0 ); // Info Widget - _infoWidget = new QVBox( this, "infoWidget" ); - _viewInfo = new QTextEdit( _infoWidget ); + _infoWidget = new TQVBox( this, "infoWidget" ); + _viewInfo = new TQTextEdit( _infoWidget ); _viewInfo->setReadOnly( true ); _buttonStartTest = new KPushButton( i18n( "&Start Test" ), _infoWidget ); - connect( _buttonStartTest, SIGNAL( clicked() ), SLOT( slotButtonNext() ) ); + connect( _buttonStartTest, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonNext() ) ); addWidget( _infoWidget, 1 ); // Question Widget - _questionWidget = new QVBox( this, "questionWidget" ); - _split = new QSplitter( QSplitter::Vertical, _questionWidget ); + _questionWidget = new TQVBox( this, "questionWidget" ); + _split = new TQSplitter( TQSplitter::Vertical, _questionWidget ); _questionText = new KQuestion( _split, "kquestion" ); _buttonGroup = new KGroupEduca( _split, "ButtonGroup" ); _buttonGroup->setRadioButtonExclusive( true ); _buttonNext = new KPushButton( i18n( "&Next >>" ), _questionWidget, "ButtonNext" ); - connect( _buttonNext, SIGNAL( clicked() ), SLOT( slotButtonNext() ) ); + connect( _buttonNext, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonNext() ) ); addWidget( _questionWidget, 2 ); // Results Widget - _resultsWidget = new QVBox( this, "resultsWidget" ); - _viewResults = new QTextEdit( _resultsWidget ); + _resultsWidget = new TQVBox( this, "resultsWidget" ); + _viewResults = new TQTextEdit( _resultsWidget ); _viewResults->setReadOnly( true ); _buttonSave = new KPushButton( i18n( "&Save Results..." ), _resultsWidget ); - connect( _buttonSave, SIGNAL( clicked() ), SLOT( slotButtonSave() ) ); + connect( _buttonSave, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonSave() ) ); /* FIXME: This is a hack * The results widget can be shown only in the end of the test (when you should be shown the * option to save the results) or at the middle of the test, after each question (when there should * be a "Next" button). */ _buttonResultsNext = new KPushButton( i18n( "&Next >>" ), _resultsWidget ); - connect( _buttonResultsNext, SIGNAL( clicked() ), SLOT( slotButtonNext() ) ); + connect( _buttonResultsNext, TQT_SIGNAL( clicked() ), TQT_SLOT( slotButtonNext() ) ); _buttonResultsNext->hide(); addWidget( _resultsWidget, 3 ); @@ -147,19 +147,19 @@ void KEducaView::slotButtonNext() /** Button Save action */ void KEducaView::slotButtonSave() { - KFileDialog *dialog=new KFileDialog(QString::null, QString::null, this, "file dialog", true); + KFileDialog *dialog=new KFileDialog(TQString::null, TQString::null, this, "file dialog", true); dialog->setCaption( i18n("Save Results As") ); dialog->setKeepLocation( true ); dialog->setOperationMode( KFileDialog::Saving ); - QStringList mimeFilter( "text/html"); + TQStringList mimeFilter( "text/html"); dialog->setMimeFilter( mimeFilter ); KURL newURL; - QString outputFormat ("text/html"); + TQString outputFormat ("text/html"); bool bOk; do { bOk=true; - if(dialog->exec()==QDialog::Accepted) { + if(dialog->exec()==TQDialog::Accepted) { newURL=dialog->selectedURL(); outputFormat=dialog->currentMimeFilter(); } @@ -170,9 +170,9 @@ void KEducaView::slotButtonSave() } kdDebug()<<"Requested saving to file "< tmpRandom; + TQValueList tmpRandom; unsigned int index; for( index = 0 ; index < _keducaFile->recordAnswerCount() ; index ++ ) { tmpRandom.append( index ); } for( index = 0 ; index < _keducaFile->recordAnswerCount() ; index ++ ) { unsigned int random = rand() % tmpRandom.count(); - QValueList::iterator itTmpRandom = tmpRandom.begin(); + TQValueList::iterator itTmpRandom = tmpRandom.begin(); for( unsigned int i = 0; i < random; i++) { ++itTmpRandom; } _keducaFile->recordAnswerAt( (*itTmpRandom) ); _randomAnswers.append( (*itTmpRandom) ); @@ -274,9 +274,9 @@ void KEducaView::showRecord() { if (!_timeoutTimer) { - _timeoutTimer = new QTimer(this); - connect(_timeoutTimer, SIGNAL(timeout()), - this, SLOT(questionTimedOut())); + _timeoutTimer = new TQTimer(this); + connect(_timeoutTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(questionTimedOut())); } _timeoutTimer->start(1000*timeout); _questionText->countdown(timeout); @@ -295,7 +295,7 @@ void KEducaView::questionTimedOut() } /** Show results */ -void KEducaView::showResults( const QString &text ) +void KEducaView::showResults( const TQString &text ) { _viewResults->setText( text ); @@ -317,15 +317,15 @@ void KEducaView::showResults( const QString &text ) void KEducaView::setResults() { bool isCorrect = true; - QString yourAnswer = ""; - QString correctAnswer = ""; - QValueList::iterator itRandom = _randomAnswers.begin(); + TQString yourAnswer = ""; + TQString correctAnswer = ""; + TQValueList::iterator itRandom = _randomAnswers.begin(); Settings::randomAnswers() ? _keducaFile->recordAnswerAt(*itRandom) : _keducaFile->recordAnswerFirst(); for( unsigned index = 0 ; index < _keducaFile->recordAnswerCount() ; index++ ) { - QString answertext = _keducaFile->getAnswer( FileRead::AF_TEXT ); + TQString answertext = _keducaFile->getAnswer( FileRead::AF_TEXT ); if( !answertext.isEmpty() ) { if(_buttonGroup->isChecked(index) != _keducaFile->getAnswerValue()) @@ -366,9 +366,9 @@ void KEducaView::setResults() } /** Set results */ -QString KEducaView::setFinalResult() +TQString KEducaView::setFinalResult() { - QString finalResult = ""; + TQString finalResult = ""; if( !_keducaFile->isResult() ) return ""; @@ -437,36 +437,36 @@ void KEducaView::configWrite() } /** current Status Points */ -QString KEducaView::currentStatusPoints() +TQString KEducaView::currentStatusPoints() { - QString tempStatus; + TQString tempStatus; tempStatus = insertTable() + insertRow( i18n("Statistics"), true, 4) + insertRow( i18n("Correct questions"), - QString().setNum( _correctAnswer ), + TQString().setNum( _correctAnswer ), i18n("Incorrect questions"), - QString().setNum( _incorrectAnswer ), true); + TQString().setNum( _incorrectAnswer ), true); if( _keducaFile->getTotalPoints() > 0 ) tempStatus += insertRow( i18n("Total points"), true, 4 ) + insertRow( i18n("Correct points"), - QString().setNum( _correctPoints ), + TQString().setNum( _correctPoints ), i18n("Incorrect points"), - QString().setNum( _incorrectPoints ), true ); + TQString().setNum( _incorrectPoints ), true ); if( _keducaFile->getTotalTime() > 0 ) tempStatus += insertRow( i18n("Time"), true, 4 ) + insertRow( i18n("Total time"), - QString().setNum( _keducaFile->getTotalTime() ), + TQString().setNum( _keducaFile->getTotalTime() ), i18n("Time in tests"), - QString().setNum( _currentTime ), true ); + TQString().setNum( _currentTime ), true ); tempStatus += insertTableClose(); return tempStatus; } /** Set HTML table view with correct and incorrect answers */ -QString KEducaView::getTableQuestion( bool isCorrect, const QString &correct, const QString &incorrect) +TQString KEducaView::getTableQuestion( bool isCorrect, const TQString &correct, const TQString &incorrect) { _currentResults = "
" + i18n( "Wavelength: %1 nm" ).arg( ( *it ).wavelength ) + "" + i18n( "Intensity: %1" ).arg( ( *it ).intensity ) + "" + i18n( "Probability: %1 108s-1" ).arg( ( *it ).aki ) + "
0 ) tmp+= " COLSPAN=" + QString().setNum(colSpan); + if( colSpan>0 ) tmp+= " COLSPAN=" + TQString().setNum(colSpan); if( title ) tmp += " ALIGN=CENTER"; tmp += ">"; if( title ) tmp += ""; @@ -596,8 +596,8 @@ QString KEducaView::insertRow( const QString &text, bool title, unsigned colSpan } /** Insert row */ -QString KEducaView::insertRow( const QString &label, const QString &field, bool formBased ){ - QString tmp; +TQString KEducaView::insertRow( const TQString &label, const TQString &field, bool formBased ){ + TQString tmp; tmp = ""; } diff --git a/keduca/keduca/keducaview.h b/keduca/keduca/keducaview.h index 78bce53c..d710ef4f 100644 --- a/keduca/keduca/keducaview.h +++ b/keduca/keduca/keducaview.h @@ -20,9 +20,9 @@ #include -#include -#include -#include +#include +#include +#include class QTimer; class QTextEdit; @@ -45,7 +45,7 @@ class KEducaView : public QWidgetStack Q_OBJECT public: - KEducaView(QWidget *parent=0, const char *name=0); + KEducaView(TQWidget *parent=0, const char *name=0); ~KEducaView(); /** Open url */ bool openURL( const KURL &url); @@ -60,35 +60,35 @@ private: /** Show record, returns false if there is no record to show. */ void showRecord(); /** Show results */ - void showResults( const QString &text ); + void showResults( const TQString &text ); /** Set results */ void setResults(); /** Set results */ - QString setFinalResult(); + TQString setFinalResult(); /** Write settings */ void configWrite(); /** current results Points */ - QString currentStatusPoints(); + TQString currentStatusPoints(); /** Set HTML table view with correct and incorrect answers */ - QString getTableQuestion( bool isCorrect, const QString &correct, const QString &incorrect); + TQString getTableQuestion( bool isCorrect, const TQString &correct, const TQString &incorrect); /** Define the next questions (random, secuencial) */ bool questionNext(); - QString getInformation(); + TQString getInformation(); /** Init table with title and colspan */ - QString insertTable( const QString &title = "", unsigned int col=0); + TQString insertTable( const TQString &title = "", unsigned int col=0); /** Insert row */ - QString insertRow( const QString &text, bool title, unsigned int colSpan=0 ); - QString insertRow( const QString &label, const QString &field, bool formBased ); - QString insertRow( const QString &label1, const QString &field1, const QString &label2, const QString &field2, bool formBased ); + TQString insertRow( const TQString &text, bool title, unsigned int colSpan=0 ); + TQString insertRow( const TQString &label, const TQString &field, bool formBased ); + TQString insertRow( const TQString &label1, const TQString &field1, const TQString &label2, const TQString &field2, bool formBased ); /** Close current table */ - QString insertTableClose(); + TQString insertTableClose(); // Private attributes /** Widgets */ - QLabel *_introWidget; - QWidget *_infoWidget, *_questionWidget, *_resultsWidget; + TQLabel *_introWidget; + TQWidget *_infoWidget, *_questionWidget, *_resultsWidget; /** Push Buttons */ KPushButton *_buttonNext; KPushButton *_buttonSave; @@ -101,21 +101,21 @@ private: /** A question text with pixmaps and movies support */ KQuestion *_questionText; /** A question text with pixmaps and movies support */ - QTextEdit *_viewResults; - QTextEdit *_viewInfo; + TQTextEdit *_viewResults; + TQTextEdit *_viewInfo; /** Current record */ int _keducaFileIndex; /** Current results */ - QString _results; + TQString _results; /** Main vbox */ - QVBoxLayout *_vbox2; + TQVBoxLayout *_vbox2; /** Main splitt */ - QSplitter *_split; + TQSplitter *_split; /** Current results */ - QString _currentResults; + TQString _currentResults; /** If is init window */ bool _isInitStatus; - QTimer *_timeoutTimer; + TQTimer *_timeoutTimer; /** Num of correct answers */ int _correctAnswer; /** Number of incorrect answers */ @@ -133,9 +133,9 @@ private: /** Show random answers */ bool _showRandomAnswers; /** Save real order by random questions */ - QValueList _randomQuestions; + TQValueList _randomQuestions; /** Save real order by random answers */ - QValueList _randomAnswers; + TQValueList _randomAnswers; private slots: /** Button Next action */ void slotButtonNext(); diff --git a/keduca/keduca/kgroupeduca.cpp b/keduca/keduca/kgroupeduca.cpp index 7cdb8b38..9f7a2413 100644 --- a/keduca/keduca/kgroupeduca.cpp +++ b/keduca/keduca/kgroupeduca.cpp @@ -22,13 +22,13 @@ #include -KGroupEduca::KGroupEduca(QWidget *parent, const char *name ) : QVButtonGroup(i18n("Answers"), parent, name) +KGroupEduca::KGroupEduca(TQWidget *parent, const char *name ) : TQVButtonGroup(i18n("Answers"), parent, name) { - _sv = new QScrollView(this); - _sv->setVScrollBarMode(QScrollView::Auto); - _sv->setHScrollBarMode(QScrollView::Auto); - _sv->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); - _vbox2 = new QVBox( _sv->viewport() ); + _sv = new TQScrollView(this); + _sv->setVScrollBarMode(TQScrollView::Auto); + _sv->setHScrollBarMode(TQScrollView::Auto); + _sv->setFrameStyle( TQFrame::NoFrame | TQFrame::Plain ); + _vbox2 = new TQVBox( _sv->viewport() ); _vbox2->setSpacing( 6 ); _vbox2->setMargin( 11 ); _sv->viewport()->setBackgroundMode( _vbox2->backgroundMode() ); @@ -41,9 +41,9 @@ KGroupEduca::~KGroupEduca(){ } /** Insert a check or radio button */ -void KGroupEduca::insertAnswer( const QString& text) +void KGroupEduca::insertAnswer( const TQString& text) { - QButton *answer = 0; + TQButton *answer = 0; switch( _typeMode ) { @@ -54,7 +54,7 @@ void KGroupEduca::insertAnswer( const QString& text) answer = new KCheckEduca( _vbox2 ); break; } - answer->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0 ) ); + answer->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0 ) ); answer->setText( text ); answer->show(); insert(answer); @@ -72,7 +72,7 @@ void KGroupEduca::clearAnswers() unsigned int maxButton = count(); for( unsigned int i=0 ; i -#include -#include +#include +#include +#include /** *@author Javier Campos Morales */ -class KGroupEduca : public QVButtonGroup { +class KGroupEduca : public TQVButtonGroup { Q_OBJECT public: enum ButtonType { Radio, Check }; - KGroupEduca(QWidget *parent=0, const char *name=0); + KGroupEduca(TQWidget *parent=0, const char *name=0); ~KGroupEduca(); /** Insert a check or radio button */ - void insertAnswer( const QString& text); + void insertAnswer( const TQString& text); /** Set type */ void setType(ButtonType Type); /** Clear all kradio or kcheck answers */ @@ -43,13 +43,13 @@ public: bool isChecked(int id); protected: - QVBox* _vbox2; + TQVBox* _vbox2; private: // Private attributes - QScrollView *_sv; + TQScrollView *_sv; /** Type mode */ ButtonType _typeMode; }; diff --git a/keduca/keduca/kquestion.cpp b/keduca/keduca/kquestion.cpp index 262f89b3..69a90fdd 100644 --- a/keduca/keduca/kquestion.cpp +++ b/keduca/keduca/kquestion.cpp @@ -19,16 +19,16 @@ #include "kquestion.h" #include "kquestion.moc" -#include -#include -#include -#include +#include +#include +#include +#include #include #include -KQuestion::KQuestion( QWidget *parent, const char *name ) - : QHBox( parent, name ), _countdownTimer( 0 ) +KQuestion::KQuestion( TQWidget *parent, const char *name ) + : TQHBox( parent, name ), _countdownTimer( 0 ) { initGUI(); } @@ -40,37 +40,37 @@ KQuestion::~KQuestion() /** Init graphical interface */ void KQuestion::initGUI() { - setFrameShape( QFrame::Box ); - setFrameShadow( QFrame::Plain ); - setPalette( QPalette( Qt::white ) ); + setFrameShape( TQFrame::Box ); + setFrameShadow( TQFrame::Plain ); + setPalette( TQPalette( Qt::white ) ); - QVBox *picBox = new QVBox( this ); + TQVBox *picBox = new TQVBox( this ); - _picture = new QLabel( picBox, "PixmapLabel1" ); + _picture = new TQLabel( picBox, "PixmapLabel1" ); _picture->setScaledContents( FALSE ); - _picture->setPalette( QPalette( Qt::white ) ); + _picture->setPalette( TQPalette( Qt::white ) ); _countdownWidget = new KProgress( picBox ); - _countdownWidget->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, - QSizePolicy::Preferred ) ); + _countdownWidget->setSizePolicy( TQSizePolicy( TQSizePolicy::Preferred, + TQSizePolicy::Preferred ) ); _countdownWidget->setFormat( i18n( "%v seconds left" ) ); - _view = new QTextEdit( this, "TextView1" ); + _view = new TQTextEdit( this, "TextView1" ); _view->setReadOnly( true ); - _view->setFrameShape( QTextEdit::NoFrame ); - _view->setHScrollBarMode( QTextEdit::AlwaysOff ); - _view->setTextFormat( QTextEdit::RichText ); - _view->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, true ) ); + _view->setFrameShape( TQTextEdit::NoFrame ); + _view->setHScrollBarMode( TQTextEdit::AlwaysOff ); + _view->setTextFormat( TQTextEdit::RichText ); + _view->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, true ) ); } /** Set text */ -void KQuestion::setText( const QString &text) +void KQuestion::setText( const TQString &text) { _view->setText( text ); } /** Set pixmap */ -void KQuestion::setPixmap( const QPixmap pixmap) +void KQuestion::setPixmap( const TQPixmap pixmap) { _picture->setPixmap( pixmap ); } @@ -83,9 +83,9 @@ void KQuestion::countdown(int starttime) { if (!_countdownTimer) { - _countdownTimer = new QTimer(this); - connect(_countdownTimer, SIGNAL(timeout()), - this, SLOT(countDownOne())); + _countdownTimer = new TQTimer(this); + connect(_countdownTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(countDownOne())); } _countdownTimer->start(1000); // make one step less than time passes by in seconds diff --git a/keduca/keduca/kquestion.h b/keduca/keduca/kquestion.h index 1753375e..2cd53a30 100644 --- a/keduca/keduca/kquestion.h +++ b/keduca/keduca/kquestion.h @@ -19,9 +19,9 @@ #ifndef KQUESTION_H #define KQUESTION_H -#include -#include -#include +#include +#include +#include class QTimer; class KProgress; @@ -35,12 +35,12 @@ class KQuestion : public QHBox Q_OBJECT public: - KQuestion(QWidget *parent=0, const char *name=0); + KQuestion(TQWidget *parent=0, const char *name=0); ~KQuestion(); /** Set pixmap */ - void setPixmap( const QPixmap pixmap); + void setPixmap( const TQPixmap pixmap); /** Set text */ - void setText( const QString &text); + void setText( const TQString &text); /** show a countdown, starting at "starttime" and counting down to 0, each second one count. @@ -67,10 +67,10 @@ private: // Private attributes /** Main View */ - QTextEdit *_view; + TQTextEdit *_view; /** Main Picture */ - QLabel *_picture; - QTimer *_countdownTimer; + TQLabel *_picture; + TQTimer *_countdownTimer; KProgress *_countdownWidget; int _currentCount; int _totalCount; diff --git a/keduca/keduca/kradioeduca.cpp b/keduca/keduca/kradioeduca.cpp index 94f26eeb..89b3e830 100644 --- a/keduca/keduca/kradioeduca.cpp +++ b/keduca/keduca/kradioeduca.cpp @@ -17,10 +17,10 @@ #include "kradioeduca.h" #include "kradioeduca.moc" -#include +#include #include -KRadioEduca::KRadioEduca(QWidget *parent, const char *name) : QRadioButton(parent,name) +KRadioEduca::KRadioEduca(TQWidget *parent, const char *name) : TQRadioButton(parent,name) { _doc=0; KAcceleratorManager::setNoAccel(this); @@ -32,21 +32,21 @@ KRadioEduca::~KRadioEduca() } /** reimpl */ -void KRadioEduca::drawButtonLabel( QPainter *p) +void KRadioEduca::drawButtonLabel( TQPainter *p) { int x, y, w, h; int extra_width, indicator_width; extra_width = 8; - indicator_width = style().pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, 0); + indicator_width = style().pixelMetric(TQStyle::PM_ExclusiveIndicatorWidth, 0); y = 0; x = indicator_width + extra_width; //### w = width() - x; h = height(); - QRect cr(x,y,w,h); + TQRect cr(x,y,w,h); - _doc = new QSimpleRichText( text(), font() ); + _doc = new TQSimpleRichText( text(), font() ); _doc->setWidth( 10 ); _doc->setWidth(p, cr.width() ); @@ -60,24 +60,24 @@ void KRadioEduca::drawButtonLabel( QPainter *p) yo = (cr.height()-rh)/2; if (!isEnabled() ) { - QColorGroup cg = colorGroup(); - cg.setColor( QColorGroup::Text, cg.light() ); + TQColorGroup cg = colorGroup(); + cg.setColor( TQColorGroup::Text, cg.light() ); _doc->draw(p, cr.x()+xo+1, cr.y()+yo+1, cr, cg, 0); } _doc->draw(p, cr.x()+xo, cr.y()+yo, cr, colorGroup(), 0); if ( hasFocus() ) { -// QRect br = style().itemRect( p, x, y, rw, rh+yo, +// TQRect br = style().itemRect( p, x, y, rw, rh+yo, // AlignLeft|AlignVCenter|ShowPrefix, // isEnabled(), // pixmap(), text().visual() ); - QRect br(x,y,rw,rh+yo); + TQRect br(x,y,rw,rh+yo); br.setLeft( br.left()-3 ); br.setRight( br.right()+2 ); br.setTop( br.top()-2 ); br.setBottom( br.bottom()+2); - br = br.intersect( QRect(0,0,rw, rh+yo ) ); - style().drawPrimitive( QStyle::PE_FocusRect, p, br, colorGroup()); + br = br.intersect( TQRect(0,0,rw, rh+yo ) ); + style().drawPrimitive( TQStyle::PE_FocusRect, p, br, colorGroup()); } } diff --git a/keduca/keduca/kradioeduca.h b/keduca/keduca/kradioeduca.h index b17276d9..f23c74a1 100644 --- a/keduca/keduca/kradioeduca.h +++ b/keduca/keduca/kradioeduca.h @@ -19,17 +19,17 @@ #define KRADIOEDUCA_H -#include -#include +#include +#include -/**QRadioButton with wordwrap and richtext features +/**TQRadioButton with wordwrap and richtext features *@author Javier Campos Morales */ -class KRadioEduca : public QRadioButton { +class KRadioEduca : public TQRadioButton { Q_OBJECT public: - KRadioEduca(QWidget *parent=0, const char *name=0); + KRadioEduca(TQWidget *parent=0, const char *name=0); ~KRadioEduca(); protected: @@ -37,14 +37,14 @@ protected: // Protected methods /** reimpl */ - void drawButtonLabel( QPainter *p); + void drawButtonLabel( TQPainter *p); private: // Private attributes /** Rich Text */ - QSimpleRichText *_doc; + TQSimpleRichText *_doc; }; diff --git a/keduca/keduca/main.cpp b/keduca/keduca/main.cpp index 9b33280b..ec7f8063 100644 --- a/keduca/keduca/main.cpp +++ b/keduca/keduca/main.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "keduca.h" static const char description[] = I18N_NOOP("Form-based tests and exams"); @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) if ( args->count() > 0 ) { - if( QFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) + if( TQFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) keducaTestMaster->initGallery( args->url(0) ); else keducaTestMaster->slotFileOpenURL( args->url(0) ); diff --git a/keduca/keducabuilder/kcontroladdedit.cpp b/keduca/keducabuilder/kcontroladdedit.cpp index 76715e27..f8b60562 100644 --- a/keduca/keducabuilder/kcontroladdedit.cpp +++ b/keduca/keducabuilder/kcontroladdedit.cpp @@ -28,10 +28,10 @@ //#include <.h> // Qt includes -#include -#include +#include +#include -KControlAddEdit::KControlAddEdit(QWidget *parent, const char *name, bool modal, WFlags f) +KControlAddEdit::KControlAddEdit(TQWidget *parent, const char *name, bool modal, WFlags f) : KControlAddEditBase(parent, name, modal, f), _currentAnswerItem(0) { @@ -90,16 +90,16 @@ void KControlAddEdit::fillPage() _keducaFile->recordAnswerFirst(); while( !_keducaFile->recordAnswerEOF() ) { - QListViewItem *newItem = new QListViewItem(_listAnswers); + TQListViewItem *newItem = new TQListViewItem(_listAnswers); newItem->setText(0,_keducaFile->getAnswer( FileRead::AF_TEXT )); newItem->setText(1,_keducaFile->getAnswerValue()?i18n("True"):i18n("False")); - newItem->setText(2,QString::number(_keducaFile->getAnswerPoints())); + newItem->setText(2,TQString::number(_keducaFile->getAnswerPoints())); _keducaFile->recordAnswerNext(); }; } -void KControlAddEdit::setCurrentAnswerItem(QListViewItem *item) +void KControlAddEdit::setCurrentAnswerItem(TQListViewItem *item) { _currentAnswerItem = item; if (item) @@ -114,12 +114,12 @@ void KControlAddEdit::slotAddAnswer() if( !_answerText->text().isEmpty() ) { // add new listview item - QListViewItem *newItem = _currentAnswerItem + TQListViewItem *newItem = _currentAnswerItem ? _currentAnswerItem - : new QListViewItem(_listAnswers,_listAnswers->lastItem()); + : new TQListViewItem(_listAnswers,_listAnswers->lastItem()); newItem->setText(0,_answerText->text()); newItem->setText(1,_answerValue->currentItem() == 1 ?i18n("True"):i18n("False")); - newItem->setText(2,QString::number(_answerPoints->value())); + newItem->setText(2,TQString::number(_answerPoints->value())); // reset values newItem->setSelected(false); @@ -150,7 +150,7 @@ void KControlAddEdit::slotRemoveAnswer() /** Button Up */ void KControlAddEdit::slotMoveUpAnswer() { - QListViewItem *item = _listAnswers->currentItem(); + TQListViewItem *item = _listAnswers->currentItem(); if (item && item->itemAbove()) item->itemAbove()->moveItem(item); @@ -162,7 +162,7 @@ void KControlAddEdit::slotMoveUpAnswer() /** Button Down */ void KControlAddEdit::slotMoveDownAnswer() { - QListViewItem *item = _listAnswers->currentItem(); + TQListViewItem *item = _listAnswers->currentItem(); if (item) item->moveItem(item->itemBelow()); @@ -171,7 +171,7 @@ void KControlAddEdit::slotMoveDownAnswer() _buttonDown->setEnabled(item->itemBelow()!=0); } -void KControlAddEdit::slotAnswerSelected(QListViewItem *item) +void KControlAddEdit::slotAnswerSelected(TQListViewItem *item) { if (!item) return; @@ -198,7 +198,7 @@ void KControlAddEdit::accept() addQuestion(); configWrite(); - done( QDialog::Accepted ); + done( TQDialog::Accepted ); } /** Add question with form data */ @@ -213,7 +213,7 @@ void KControlAddEdit::addQuestion() _keducaFile->setQuestion( FileRead::QF_EXPLAIN, _questionExplain->text() ); _keducaFile->clearAnswers(); - QListViewItem *item = _listAnswers->firstChild(); + TQListViewItem *item = _listAnswers->firstChild(); while (item) { _keducaFile->setAnswer( item->text(0), // The Answer text @@ -227,7 +227,7 @@ void KControlAddEdit::configRead() { KConfig *config = KGlobal::config(); config->setGroup("AddModify Window"); - QSize defaultSize(500,400); + TQSize defaultSize(500,400); resize( config->readSizeEntry("Geometry", &defaultSize ) ); } @@ -255,18 +255,18 @@ void KControlAddEdit::slotDataChanged() /** Preview image */ -void KControlAddEdit::slotPreviewImage( const QString &text) +void KControlAddEdit::slotPreviewImage( const TQString &text) { if( text.isEmpty() ) { _questionPreview->setText(""); _answerPreview->setText(""); return; } - _questionPreview->setPixmap( QPixmap( text ) ); - _answerPreview->setPixmap( QPixmap( text ) ); + _questionPreview->setPixmap( TQPixmap( text ) ); + _answerPreview->setPixmap( TQPixmap( text ) ); } /** show current Page */ -void KControlAddEdit::showPage(QWidget *page) +void KControlAddEdit::showPage(TQWidget *page) { - QWizard::showPage(page); + TQWizard::showPage(page); slotDataChanged(); if ( page == _pageQuestion ) { diff --git a/keduca/keducabuilder/kcontroladdedit.h b/keduca/keducabuilder/kcontroladdedit.h index d700ec43..3144f41e 100644 --- a/keduca/keducabuilder/kcontroladdedit.h +++ b/keduca/keducabuilder/kcontroladdedit.h @@ -37,12 +37,12 @@ class KControlAddEdit : public KControlAddEditBase { Q_OBJECT public: - KControlAddEdit(QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); + KControlAddEdit(TQWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); ~KControlAddEdit(); /** Init keducaFile pointer and EditMode */ void init(FileRead *keducaFile, bool editMode); /** show current Page */ - void showPage(QWidget *page); + void showPage(TQWidget *page); private: @@ -58,14 +58,14 @@ private: void configWrite(); /** Read config settings */ void configRead(); - void setCurrentAnswerItem(QListViewItem *item); + void setCurrentAnswerItem(TQListViewItem *item); void resetAnswerValues(); // Private attributes /** Pointer to keduca of kcontrol page */ FileRead *_keducaFile; /** The currently selected answer item, important for editing of the answer*/ - QListViewItem *_currentAnswerItem; + TQListViewItem *_currentAnswerItem; /** Is a edit modify? */ bool _editMode; @@ -73,7 +73,7 @@ private slots: /** Accept changes */ void accept(); /** An Answer has been selected */ - void slotAnswerSelected(QListViewItem *item); + void slotAnswerSelected(TQListViewItem *item); /** Remove answer */ void slotRemoveAnswer(); /** Button insert */ @@ -85,7 +85,7 @@ private slots: /** Question or Answer data changed */ void slotDataChanged(); /** Preview image */ - void slotPreviewImage( const QString & ); + void slotPreviewImage( const TQString & ); /** Change question type */ void slotQuestionTypeChanged( int index ); }; diff --git a/keduca/keducabuilder/kcontrolheader.cpp b/keduca/keducabuilder/kcontrolheader.cpp index d7a2090a..bdb1e0bb 100644 --- a/keduca/keducabuilder/kcontrolheader.cpp +++ b/keduca/keducabuilder/kcontrolheader.cpp @@ -24,10 +24,10 @@ #include #include -#include -#include +#include +#include -KControlHeader::KControlHeader(FileRead *keducaFile, QWidget *parent, const char *name ) : KDialogBase(Swallow, i18n("Document Information"), Ok|Cancel, Ok, parent, name, true, true) +KControlHeader::KControlHeader(FileRead *keducaFile, TQWidget *parent, const char *name ) : KDialogBase(Swallow, i18n("Document Information"), Ok|Cancel, Ok, parent, name, true, true) { _keducaFile = keducaFile; init(); @@ -39,122 +39,122 @@ KControlHeader::~KControlHeader(){} /** Init graphical interface */ void KControlHeader::init() { - QWidget *mainView = new QWidget(this); + TQWidget *mainView = new TQWidget(this); - QVBoxLayout *Form2Layout = new QVBoxLayout( mainView ); + TQVBoxLayout *Form2Layout = new TQVBoxLayout( mainView ); Form2Layout->setSpacing( 6 ); Form2Layout->setMargin( 0 ); - QFrame *Frame16 = new QFrame( mainView, "Frame16" ); - Frame16->setMinimumSize( QSize( 0, 50 ) ); - Frame16->setMaximumSize( QSize( 32767, 50 ) ); - Frame16->setFrameShape( QFrame::Box ); - Frame16->setFrameShadow( QFrame::Plain ); - Frame16->setPalette( QPalette( QColor(255, 255, 255) ) ); - QHBoxLayout *Frame16Layout = new QHBoxLayout( Frame16 ); + TQFrame *Frame16 = new TQFrame( mainView, "Frame16" ); + Frame16->setMinimumSize( TQSize( 0, 50 ) ); + Frame16->setMaximumSize( TQSize( 32767, 50 ) ); + Frame16->setFrameShape( TQFrame::Box ); + Frame16->setFrameShadow( TQFrame::Plain ); + Frame16->setPalette( TQPalette( TQColor(255, 255, 255) ) ); + TQHBoxLayout *Frame16Layout = new TQHBoxLayout( Frame16 ); Frame16Layout->setSpacing( 6 ); Frame16Layout->setMargin( 1 ); - QFrame *Frame17 = new QFrame( Frame16, "Frame17" ); - Frame17->setMinimumSize( QSize( 125, 0 ) ); - Frame17->setMaximumSize( QSize( 125, 32767 ) ); - Frame17->setFrameShape( QFrame::NoFrame ); - Frame17->setFrameShadow( QFrame::Raised ); - Frame17->setBackgroundPixmap( QPixmap(locate("appdata","pics/bk_frame.png") ) ); - QVBoxLayout *Frame17Layout = new QVBoxLayout( Frame17 ); + TQFrame *Frame17 = new TQFrame( Frame16, "Frame17" ); + Frame17->setMinimumSize( TQSize( 125, 0 ) ); + Frame17->setMaximumSize( TQSize( 125, 32767 ) ); + Frame17->setFrameShape( TQFrame::NoFrame ); + Frame17->setFrameShadow( TQFrame::Raised ); + Frame17->setBackgroundPixmap( TQPixmap(locate("appdata","pics/bk_frame.png") ) ); + TQVBoxLayout *Frame17Layout = new TQVBoxLayout( Frame17 ); Frame17Layout->setSpacing( 6 ); Frame17Layout->setMargin( 11 ); - QLabel *TextLabel1 = new QLabel( Frame17, "TextLabel1" ); + TQLabel *TextLabel1 = new TQLabel( Frame17, "TextLabel1" ); TextLabel1->setText( ""+i18n("Information")+"" ); - TextLabel1->setBackgroundPixmap( QPixmap(locate("appdata","pics/bk_frame.png") ) ); + TextLabel1->setBackgroundPixmap( TQPixmap(locate("appdata","pics/bk_frame.png") ) ); Frame17Layout->addWidget( TextLabel1 ); Frame16Layout->addWidget( Frame17 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); Frame16Layout->addItem( spacer ); - QLabel *TextLabel2 = new QLabel( Frame16, "TextLabel2" ); + TQLabel *TextLabel2 = new TQLabel( Frame16, "TextLabel2" ); TextLabel2->setText( i18n( "Description and rules of the project." ) ); - TextLabel2->setPalette( QPalette( QColor(255, 255, 255) ) ); + TextLabel2->setPalette( TQPalette( TQColor(255, 255, 255) ) ); Frame16Layout->addWidget( TextLabel2 ); Form2Layout->addWidget( Frame16 ); - QGroupBox *GroupBox7 = new QGroupBox( mainView, "GroupBox7" ); + TQGroupBox *GroupBox7 = new TQGroupBox( mainView, "GroupBox7" ); GroupBox7->setTitle( i18n( "Description" ) ); GroupBox7->setColumnLayout(0, Qt::Vertical ); GroupBox7->layout()->setSpacing( 0 ); GroupBox7->layout()->setMargin( 0 ); - QVBoxLayout *GroupBox7Layout = new QVBoxLayout( GroupBox7->layout() ); + TQVBoxLayout *GroupBox7Layout = new TQVBoxLayout( GroupBox7->layout() ); GroupBox7Layout->setAlignment( Qt::AlignTop ); GroupBox7Layout->setSpacing( 6 ); GroupBox7Layout->setMargin( 11 ); - QGridLayout *Layout13 = new QGridLayout; + TQGridLayout *Layout13 = new QGridLayout; Layout13->setSpacing( 6 ); Layout13->setMargin( 0 ); - QLabel *TextLabel10 = new QLabel( GroupBox7, "TextLabel10" ); + TQLabel *TextLabel10 = new TQLabel( GroupBox7, "TextLabel10" ); TextLabel10->setText( i18n( "Type:" )); - TextLabel10->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel10->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel10, 2, 0 ); - QHBoxLayout *Layout12 = new QHBoxLayout; + TQHBoxLayout *Layout12 = new QHBoxLayout; Layout12->setSpacing( 6 ); Layout12->setMargin( 0 ); _headerType = new KComboBox( FALSE, GroupBox7, "_headerType" ); Layout12->addWidget( _headerType ); - QLabel *TextLabel11 = new QLabel( GroupBox7, "TextLabel11" ); + TQLabel *TextLabel11 = new TQLabel( GroupBox7, "TextLabel11" ); TextLabel11->setText( i18n( "Level:" )); - TextLabel11->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel11->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout12->addWidget( TextLabel11 ); _headerLevel = new KComboBox( FALSE, GroupBox7, "_headerLevel" ); Layout12->addWidget( _headerLevel ); Layout13->addLayout( Layout12, 2, 1 ); - QLabel *TextLabel12 = new QLabel( GroupBox7, "TextLabel12" ); + TQLabel *TextLabel12 = new TQLabel( GroupBox7, "TextLabel12" ); TextLabel12->setText( i18n( "Language:" )); - TextLabel12->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel12->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel12, 3, 0 ); _headerLang = new KLanguageCombo( GroupBox7, "_headerLang" ); loadCountryList( _headerLang ); Layout13->addWidget( _headerLang, 3, 1 ); - QLabel *TextLabel9 = new QLabel( GroupBox7, "TextLabel9" ); + TQLabel *TextLabel9 = new TQLabel( GroupBox7, "TextLabel9" ); TextLabel9->setText( i18n( "Category:" )); - TextLabel9->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel9->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel9, 1, 0 ); _headerCategory = new KComboBox( true, GroupBox7, "_headerCategory" ); Layout13->addWidget( _headerCategory, 1, 1 ); - _headerTitle = new QLineEdit( GroupBox7, "_headerTitle" ); + _headerTitle = new TQLineEdit( GroupBox7, "_headerTitle" ); Layout13->addWidget( _headerTitle, 0, 1 ); - QLabel *TextLabel8 = new QLabel( GroupBox7, "TextLabel8" ); + TQLabel *TextLabel8 = new TQLabel( GroupBox7, "TextLabel8" ); TextLabel8->setText( i18n( "Title:" )); - TextLabel8->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel8->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); Layout13->addWidget( TextLabel8, 0, 0 ); GroupBox7Layout->addLayout( Layout13 ); Form2Layout->addWidget( GroupBox7 ); - QGroupBox *GroupBox8 = new QGroupBox( mainView, "GroupBox8" ); + TQGroupBox *GroupBox8 = new TQGroupBox( mainView, "GroupBox8" ); GroupBox8->setTitle( i18n( "Picture" ) ); GroupBox8->setColumnLayout(0, Qt::Vertical ); GroupBox8->layout()->setSpacing( 0 ); GroupBox8->layout()->setMargin( 0 ); - QHBoxLayout *GroupBox8Layout = new QHBoxLayout( GroupBox8->layout() ); + TQHBoxLayout *GroupBox8Layout = new TQHBoxLayout( GroupBox8->layout() ); GroupBox8Layout->setAlignment( Qt::AlignTop ); GroupBox8Layout->setSpacing( 6 ); GroupBox8Layout->setMargin( 11 ); - QLabel *TextLabel13 = new QLabel( GroupBox8, "TextLabel13" ); + TQLabel *TextLabel13 = new TQLabel( GroupBox8, "TextLabel13" ); TextLabel13->setText( i18n( "Default picture:" )); GroupBox8Layout->addWidget( TextLabel13 ); @@ -162,43 +162,43 @@ void KControlHeader::init() GroupBox8Layout->addWidget( _headerPicture ); Form2Layout->addWidget( GroupBox8 ); - QGroupBox *GroupBox6 = new QGroupBox( mainView, "GroupBox6" ); + TQGroupBox *GroupBox6 = new TQGroupBox( mainView, "GroupBox6" ); GroupBox6->setTitle( i18n( "Author" ) ); GroupBox6->setColumnLayout(0, Qt::Vertical ); GroupBox6->layout()->setSpacing( 0 ); GroupBox6->layout()->setMargin( 0 ); - QGridLayout *GroupBox6Layout = new QGridLayout( GroupBox6->layout() ); + TQGridLayout *GroupBox6Layout = new TQGridLayout( GroupBox6->layout() ); GroupBox6Layout->setAlignment( Qt::AlignTop ); GroupBox6Layout->setSpacing( 6 ); GroupBox6Layout->setMargin( 11 ); - _headerName = new QLineEdit( GroupBox6, "_headerName" ); + _headerName = new TQLineEdit( GroupBox6, "_headerName" ); GroupBox6Layout->addWidget( _headerName, 0, 1 ); - _headerEmail = new QLineEdit( GroupBox6, "_headerEmail" ); + _headerEmail = new TQLineEdit( GroupBox6, "_headerEmail" ); GroupBox6Layout->addWidget( _headerEmail, 1, 1 ); - QLabel *TextLabel7 = new QLabel( GroupBox6, "TextLabel7" ); + TQLabel *TextLabel7 = new TQLabel( GroupBox6, "TextLabel7" ); TextLabel7->setText( i18n( "Web page:" )); - TextLabel7->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel7->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); GroupBox6Layout->addWidget( TextLabel7, 2, 0 ); - QLabel *TextLabel6 = new QLabel( GroupBox6, "TextLabel6" ); + TQLabel *TextLabel6 = new TQLabel( GroupBox6, "TextLabel6" ); TextLabel6->setText( i18n( "Email:" )); - TextLabel6->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel6->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); GroupBox6Layout->addWidget( TextLabel6, 1, 0 ); - QLabel *TextLabel5 = new QLabel( GroupBox6, "TextLabel5" ); + TQLabel *TextLabel5 = new TQLabel( GroupBox6, "TextLabel5" ); TextLabel5->setText( i18n( "Name:" )); - TextLabel5->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel5->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); GroupBox6Layout->addWidget( TextLabel5, 0, 0 ); - _headerWWW = new QLineEdit( GroupBox6, "_headerWWW" ); + _headerWWW = new TQLineEdit( GroupBox6, "_headerWWW" ); GroupBox6Layout->addWidget( _headerWWW, 2, 1 ); Form2Layout->addWidget( GroupBox6 ); @@ -223,7 +223,7 @@ void KControlHeader::init() /** Insert header */ void KControlHeader::insertHeader() { - QStringList tmpResult = _defaultCategories.grep( _headerCategory->currentText() ); + TQStringList tmpResult = _defaultCategories.grep( _headerCategory->currentText() ); if( tmpResult.count() == 0 ) { KConfig *appconfig = KGlobal::config(); @@ -235,8 +235,8 @@ void KControlHeader::insertHeader() _keducaFile->setHeader( "category", _headerCategory->currentText() ); _keducaFile->setHeader( "title", _headerTitle->text() ); _keducaFile->setHeader( "image", _headerPicture->url() ); - _keducaFile->setHeader( "type", QString().setNum( _headerType->currentItem() + 1 ) ); - _keducaFile->setHeader( "level", QString().setNum( _headerLevel->currentItem() + 1 ) ); + _keducaFile->setHeader( "type", TQString().setNum( _headerType->currentItem() + 1 ) ); + _keducaFile->setHeader( "level", TQString().setNum( _headerLevel->currentItem() + 1 ) ); _keducaFile->setHeader( "language", _headerLang->currentTag() ); _keducaFile->setHeader( "name", _headerName->text() ); _keducaFile->setHeader( "email", _headerEmail->text() ); @@ -246,19 +246,19 @@ void KControlHeader::insertHeader() /** Load country list */ void KControlHeader::loadCountryList(KLanguageCombo *combo) { - QString sub = QString::fromLatin1("l10n/"); + TQString sub = TQString::fromLatin1("l10n/"); // clear the list combo->clear(); - QStringList regionlist = KGlobal::dirs()->findAllResources("locale", sub + QString::fromLatin1("*.desktop")); + TQStringList regionlist = KGlobal::dirs()->findAllResources("locale", sub + TQString::fromLatin1("*.desktop")); regionlist.sort(); - for ( QStringList::ConstIterator it = regionlist.begin(); + for ( TQStringList::ConstIterator it = regionlist.begin(); it != regionlist.end(); ++it ) { - QString tag = *it; + TQString tag = *it; int index; index = tag.findRev('/'); @@ -268,25 +268,25 @@ void KControlHeader::loadCountryList(KLanguageCombo *combo) if (index != -1) tag.truncate(index); KSimpleConfig entry(*it); - entry.setGroup(QString::fromLatin1("KCM Locale")); - QString name = entry.readEntry(QString::fromLatin1("Name")); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name")); combo->insertSubmenu( name, '-' + tag, sub ); } // add all languages to the list - QStringList countrylist = KGlobal::dirs()->findAllResources("locale", sub + QString::fromLatin1("*/entry.desktop")); + TQStringList countrylist = KGlobal::dirs()->findAllResources("locale", sub + TQString::fromLatin1("*/entry.desktop")); countrylist.sort(); - for ( QStringList::ConstIterator it = countrylist.begin(); + for ( TQStringList::ConstIterator it = countrylist.begin(); it != countrylist.end(); ++it ) { KSimpleConfig entry(*it); - entry.setGroup(QString::fromLatin1("KCM Locale")); - QString name = entry.readEntry(QString::fromLatin1("Name")); - QString submenu = '-' + entry.readEntry(QString::fromLatin1("Region")); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name")); + TQString submenu = '-' + entry.readEntry(TQString::fromLatin1("Region")); - QString tag = *it; + TQString tag = *it; int index = tag.findRev('/'); tag.truncate(index); index = tag.findRev('/'); @@ -312,12 +312,12 @@ void KControlHeader::configRead() config->setGroup("UserInfo"); if( _keducaFile->getHeader( "name" ).isEmpty() ) - _headerName->setText(config->readEntry("FullName", QString::null )); + _headerName->setText(config->readEntry("FullName", TQString::null )); else _headerName->setText( _keducaFile->getHeader("name") ); if( _keducaFile->getHeader( "email" ).isEmpty() ) - _headerEmail->setText(config->readEntry("EmailAddress", QString::null )); + _headerEmail->setText(config->readEntry("EmailAddress", TQString::null )); else _headerEmail->setText( _keducaFile->getHeader("email") ); @@ -349,19 +349,19 @@ void KControlHeader::configRead() _headerType->insertItem( i18n("Slidershow") ); _headerType->insertItem( i18n("Exam") ); _headerType->insertItem( i18n("Psychotechnic Test") ); - if( QString(_keducaFile->getHeader("type")).toInt() > 0 ) _headerType->setCurrentItem( QString(_keducaFile->getHeader("type")).toInt() -1 ); + if( TQString(_keducaFile->getHeader("type")).toInt() > 0 ) _headerType->setCurrentItem( TQString(_keducaFile->getHeader("type")).toInt() -1 ); _headerLevel->insertItem( i18n("Easy") ); _headerLevel->insertItem( i18n("Normal") ); _headerLevel->insertItem( i18n("Expert") ); _headerLevel->insertItem( i18n("Supreme") ); - if( QString(_keducaFile->getHeader("level")).toInt() >0 ) _headerLevel->setCurrentItem( QString(_keducaFile->getHeader("level")).toInt() -1 ); + if( TQString(_keducaFile->getHeader("level")).toInt() >0 ) _headerLevel->setCurrentItem( TQString(_keducaFile->getHeader("level")).toInt() -1 ); _headerPicture->setURL( _keducaFile->getHeader("image") ); _headerTitle->setText( _keducaFile->getHeader("title") ); appconfig->setGroup("kcontrolheader"); - QSize *defaultSize = new QSize(500,400); + TQSize *defaultSize = new TQSize(500,400); resize( appconfig->readSizeEntry("Geometry", defaultSize ) ); delete config; } diff --git a/keduca/keducabuilder/kcontrolheader.h b/keduca/keducabuilder/kcontrolheader.h index 86752ae0..ff1e64ff 100644 --- a/keduca/keducabuilder/kcontrolheader.h +++ b/keduca/keducabuilder/kcontrolheader.h @@ -35,7 +35,7 @@ class KControlHeader : public KDialogBase { Q_OBJECT public: - KControlHeader(FileRead *keducaFile, QWidget *parent=0, const char *name=0); + KControlHeader(FileRead *keducaFile, TQWidget *parent=0, const char *name=0); ~KControlHeader(); private: @@ -45,7 +45,7 @@ private: /** Keduca pointer */ FileRead *_keducaFile; /** Title */ - QLineEdit *_headerTitle; + TQLineEdit *_headerTitle; /** Header type */ KComboBox *_headerType; /** Header category */ @@ -57,13 +57,13 @@ private: /** Header picture */ KURLRequester *_headerPicture; /** Header name */ - QLineEdit *_headerName; + TQLineEdit *_headerName; /** Header email */ - QLineEdit *_headerEmail; + TQLineEdit *_headerEmail; /** Header www */ - QLineEdit *_headerWWW; + TQLineEdit *_headerWWW; /** Default categories */ - QStringList _defaultCategories; + TQStringList _defaultCategories; // Private methods diff --git a/keduca/keducabuilder/keducabuilder.cpp b/keduca/keducabuilder/keducabuilder.cpp index 08487cc9..fa7da986 100644 --- a/keduca/keducabuilder/keducabuilder.cpp +++ b/keduca/keducabuilder/keducabuilder.cpp @@ -32,10 +32,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include static const char* const keducabuilder_data[] = { "15 16 4 1", @@ -60,7 +60,7 @@ static const char* const keducabuilder_data[] = { ".#############.", "..............."}; -KEducaBuilder::KEducaBuilder(QWidget* parent, const char *name, WFlags f ) +KEducaBuilder::KEducaBuilder(TQWidget* parent, const char *name, WFlags f ) : KMainWindow(parent,name,f), _nativeFormat("application/x-edu") { @@ -81,29 +81,29 @@ KEducaBuilder::~KEducaBuilder() /** Init graphical interface */ void KEducaBuilder::init() { - QWidget *mainView = new QWidget(this, "mainview"); + TQWidget *mainView = new TQWidget(this, "mainview"); - QVBoxLayout *form2Layout = new QVBoxLayout( mainView ); + TQVBoxLayout *form2Layout = new TQVBoxLayout( mainView ); form2Layout->setSpacing( 2 ); form2Layout->setMargin( 0 ); - _split = new QSplitter( mainView ); - _split->setOrientation( QSplitter::Vertical ); + _split = new TQSplitter( mainView ); + _split->setOrientation( TQSplitter::Vertical ); _listAnswer = new KListBox( _split, "_listAnswer" ); - _listAnswer->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, _listAnswer->sizePolicy().hasHeightForWidth() ) ); - connect( _listAnswer, SIGNAL( highlighted(QListBoxItem *) ), this, SLOT( slotPreview(QListBoxItem *) ) ); - connect( _listAnswer, SIGNAL( doubleClicked(QListBoxItem *) ), this, SLOT( slotEditbyList(QListBoxItem *) ) ); + _listAnswer->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, _listAnswer->sizePolicy().hasHeightForWidth() ) ); + connect( _listAnswer, TQT_SIGNAL( highlighted(TQListBoxItem *) ), this, TQT_SLOT( slotPreview(TQListBoxItem *) ) ); + connect( _listAnswer, TQT_SIGNAL( doubleClicked(TQListBoxItem *) ), this, TQT_SLOT( slotEditbyList(TQListBoxItem *) ) ); - _preview = new QTextView( _split, "_preview" ); - _preview->setFrameShape( QTextView::NoFrame ); + _preview = new TQTextView( _split, "_preview" ); + _preview->setFrameShape( TQTextView::NoFrame ); _preview->setLineWidth( 1 ); form2Layout->addWidget( _split ); setCentralWidget( mainView ); if (!initialGeometrySet()) - resize( QSize(500, 400).expandedTo(minimumSizeHint())); + resize( TQSize(500, 400).expandedTo(minimumSizeHint())); setupGUI( ToolBar | Keys | StatusBar | Create, "keducabuilderui.rc" ); setAutoSaveSettings(); } @@ -111,21 +111,21 @@ void KEducaBuilder::init() /** Init menu bar settings */ void KEducaBuilder::initMenuBar() { - KStdAction::openNew(this, SLOT( slotFileOpenNew() ), actionCollection()); - KStdAction::open (this, SLOT( slotFileOpen() ), actionCollection()); - (void)new KAction(i18n("Open &Gallery..."), 0, 0, this, SLOT( slotGallery() ), actionCollection(), "open_gallery"); - _recentFiles = KStdAction::openRecent(this, SLOT ( slotFileOpenURL(const KURL &)), actionCollection()); - KStdAction::save (this, SLOT( slotFileSave() ), actionCollection()); - KStdAction::saveAs (this, SLOT( slotFileSaveAs() ), actionCollection()); - KStdAction::print (this, SLOT( slotFilePrint() ), actionCollection()); - (void)new KAction(i18n("Document Info"), "info", 0, this, SLOT( slotHeader() ), actionCollection(), "info_doc"); - KStdAction::quit(this, SLOT( close() ), actionCollection()); - - (void)new KAction(i18n("&Add..."), "addquestion", 0, this, SLOT( slotAdd() ), actionCollection(), "question_add"); - (void)new KAction(i18n("&Edit..."), "editquestion", 0, this, SLOT( slotEdit() ), actionCollection(), "question_edit"); - (void)new KAction(i18n("&Remove"), "delquestion", 0, this, SLOT( slotRemove() ), actionCollection(), "question_remove"); - (void)new KAction(i18n("&Up"), "up", 0, this, SLOT( slotUp() ), actionCollection(), "question_up"); - (void)new KAction(i18n("&Down"), "down", 0, this, SLOT( slotDown() ), actionCollection(), "question_down"); + KStdAction::openNew(this, TQT_SLOT( slotFileOpenNew() ), actionCollection()); + KStdAction::open (this, TQT_SLOT( slotFileOpen() ), actionCollection()); + (void)new KAction(i18n("Open &Gallery..."), 0, 0, this, TQT_SLOT( slotGallery() ), actionCollection(), "open_gallery"); + _recentFiles = KStdAction::openRecent(this, TQT_SLOT ( slotFileOpenURL(const KURL &)), actionCollection()); + KStdAction::save (this, TQT_SLOT( slotFileSave() ), actionCollection()); + KStdAction::saveAs (this, TQT_SLOT( slotFileSaveAs() ), actionCollection()); + KStdAction::print (this, TQT_SLOT( slotFilePrint() ), actionCollection()); + (void)new KAction(i18n("Document Info"), "info", 0, this, TQT_SLOT( slotHeader() ), actionCollection(), "info_doc"); + KStdAction::quit(this, TQT_SLOT( close() ), actionCollection()); + + (void)new KAction(i18n("&Add..."), "addquestion", 0, this, TQT_SLOT( slotAdd() ), actionCollection(), "question_add"); + (void)new KAction(i18n("&Edit..."), "editquestion", 0, this, TQT_SLOT( slotEdit() ), actionCollection(), "question_edit"); + (void)new KAction(i18n("&Remove"), "delquestion", 0, this, TQT_SLOT( slotRemove() ), actionCollection(), "question_remove"); + (void)new KAction(i18n("&Up"), "up", 0, this, TQT_SLOT( slotUp() ), actionCollection(), "question_up"); + (void)new KAction(i18n("&Down"), "down", 0, this, TQT_SLOT( slotDown() ), actionCollection(), "question_down"); } /** Delete current document and start new */ @@ -148,7 +148,7 @@ void KEducaBuilder::slotFileOpenNew() /** Open new document. */ void KEducaBuilder::slotFileOpen() { - KURL url = KFileDialog::getOpenURL( QString::null, _nativeFormat, this, i18n("Open Educa File") ); + KURL url = KFileDialog::getOpenURL( TQString::null, _nativeFormat, this, i18n("Open Educa File") ); if( !url.isEmpty() ) slotFileOpenURL( url ); @@ -160,7 +160,7 @@ void KEducaBuilder::slotFileOpenURL( const KURL &url ) if (!currentFileMayBeReplaced()) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); delete _keducaFile; _keducaFile = new FileRead(); if( !_keducaFile->openFile(url) ) { return; } @@ -177,10 +177,10 @@ void KEducaBuilder::slotFileOpenURL( const KURL &url ) } /** Item select */ -void KEducaBuilder::slotPreview( QListBoxItem *item ) +void KEducaBuilder::slotPreview( TQListBoxItem *item ) { // bool match = false; - QString tmpListanswer; + TQString tmpListanswer; // FIND THE SELECT RECORD if( !item ) return; @@ -318,7 +318,7 @@ bool KEducaBuilder::queryClose () /** Add question */ void KEducaBuilder::slotAdd() { - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); KControlAddEdit edit(this); edit.init( _keducaFile, false ); @@ -334,7 +334,7 @@ void KEducaBuilder::slotEdit() { if( _listAnswer->currentItem() == -1 ) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); KControlAddEdit edit(this); edit.init( _keducaFile, true ); @@ -359,10 +359,10 @@ void KEducaBuilder::slotUp() int current = _listAnswer->currentItem(); if( current < 1 ) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); _keducaFile->recordSwap( true ); - QString tmpString = _listAnswer->text( current-1 ); + TQString tmpString = _listAnswer->text( current-1 ); _listAnswer->changeItem( image0, _listAnswer->text( current ), current-1 ); _listAnswer->changeItem( image0, tmpString, current ); _listAnswer->setCurrentItem( current-1 ); @@ -374,10 +374,10 @@ void KEducaBuilder::slotDown() int current = _listAnswer->currentItem(); if( current == -1 || current == (signed)(_listAnswer->count()-1) ) return; - QPixmap image0( ( const char** ) keducabuilder_data ); + TQPixmap image0( ( const char** ) keducabuilder_data ); _keducaFile->recordSwap( true ); - QString tmpString = _listAnswer->text( current+1 ); + TQString tmpString = _listAnswer->text( current+1 ); _listAnswer->changeItem( image0, _listAnswer->text( current ), current+1 ); _listAnswer->changeItem( image0, tmpString, current ); _listAnswer->setCurrentItem( current+1 ); @@ -406,22 +406,22 @@ bool KEducaBuilder::fileSaveAs() { if( !checkSave() ) return false; - QCheckBox *saveCompressedCheckBox = new QCheckBox( i18n( "Compress the file" ), 0 ); + TQCheckBox *saveCompressedCheckBox = new TQCheckBox( i18n( "Compress the file" ), 0 ); saveCompressedCheckBox->setChecked( true ); - KFileDialog *dialog=new KFileDialog(QString::null, QString::null, this, "file dialog", true, saveCompressedCheckBox); + KFileDialog *dialog=new KFileDialog(TQString::null, TQString::null, this, "file dialog", true, saveCompressedCheckBox); dialog->setCaption( i18n("Save Document As") ); dialog->setKeepLocation( true ); dialog->setOperationMode( KFileDialog::Saving ); - QStringList mimeFilter(_nativeFormat); + TQStringList mimeFilter(_nativeFormat); dialog->setMimeFilter( mimeFilter, _nativeFormat ); KURL newURL; - QString outputFormat (_nativeFormat); + TQString outputFormat (_nativeFormat); bool bOk; do { bOk=true; - if(dialog->exec()==QDialog::Accepted) { + if(dialog->exec()==TQDialog::Accepted) { newURL=dialog->selectedURL(); outputFormat=dialog->currentMimeFilter(); } @@ -437,10 +437,10 @@ bool KEducaBuilder::fileSaveAs() break; } - if ( QFileInfo( newURL.path() ).extension().isEmpty() ) { + if ( TQFileInfo( newURL.path() ).extension().isEmpty() ) { // No more extensions in filters. We need to get it from the mimetype. KMimeType::Ptr mime = KMimeType::mimeType( outputFormat ); - QString extension = mime->property( "X-KDE-NativeExtension" ).toString(); + TQString extension = mime->property( "X-KDE-NativeExtension" ).toString(); kdDebug() << "KEducaBuilder::slotFileSaveAs outputFormat=" << outputFormat << " extension=" << extension << endl; newURL.setPath( newURL.path() + extension ); } @@ -482,21 +482,21 @@ void KEducaBuilder::slotFilePrint() { KPrinter *printer = new KPrinter(); - QString file = _keducaFile->getCurrentURL().fileName(); + TQString file = _keducaFile->getCurrentURL().fileName(); if (file.isEmpty()) file = i18n("Test"); if(printer->setup(this, i18n("Print %1").arg(file))) { - QPaintDeviceMetrics metrics(printer); - QPainter p; + TQPaintDeviceMetrics metrics(printer); + TQPainter p; const int margin=20; int yPos=0; - QString text; + TQString text; p.begin(printer); - p.setFont( QFont(font().family(), 12, QFont::Bold) ); - QFontMetrics fm = p.fontMetrics(); + p.setFont( TQFont(font().family(), 12, TQFont::Bold) ); + TQFontMetrics fm = p.fontMetrics(); _keducaFile->recordFirst(); while(!_keducaFile->recordEOF()) @@ -533,7 +533,7 @@ bool KEducaBuilder::checkSave() _keducaFile->getHeader("level").isEmpty() || _keducaFile->getHeader("language").isEmpty() ) { - if (KMessageBox::warningContinueCancel(this, i18n("Unable to save file.\n\nYou must complete the Document Info\n(Only the description is necessary)"), QString::null, i18n("Complete Document Info...")) + if (KMessageBox::warningContinueCancel(this, i18n("Unable to save file.\n\nYou must complete the Document Info\n(Only the description is necessary)"), TQString::null, i18n("Complete Document Info...")) == KMessageBox::Continue) { if (slotHeader()!=KControlHeader::Accepted) return false; @@ -544,7 +544,7 @@ bool KEducaBuilder::checkSave() if( _listAnswer->count() < 1 ) { if (KMessageBox::warningContinueCancel(this, i18n("Unable to save file.\n\nYou must insert a question."), - QString::null, i18n("Insert Question"))==KMessageBox::Continue) + TQString::null, i18n("Insert Question"))==KMessageBox::Continue) slotAdd(); else return false; @@ -582,7 +582,7 @@ void KEducaBuilder::initGallery(const KURL &urlFile) if( !urlFile.url().isEmpty() ) galleries.putURL( urlFile ); - if( galleries.exec() == QDialog::Accepted ) + if( galleries.exec() == TQDialog::Accepted ) slotFileOpenURL( galleries.getURL() ); } @@ -593,7 +593,7 @@ void KEducaBuilder::slotGallery() } /** Double click in list, edit question */ -void KEducaBuilder::slotEditbyList(QListBoxItem *item) +void KEducaBuilder::slotEditbyList(TQListBoxItem *item) { if( item ) slotEdit(); diff --git a/keduca/keducabuilder/keducabuilder.h b/keduca/keducabuilder/keducabuilder.h index 74c5eb58..c3a736a7 100644 --- a/keduca/keducabuilder/keducabuilder.h +++ b/keduca/keducabuilder/keducabuilder.h @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include /**Main control documents * The Editor. This is the new main window of KEduca. @@ -38,7 +38,7 @@ class KEducaBuilder : public KMainWindow { Q_OBJECT public: - KEducaBuilder(QWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); + KEducaBuilder(TQWidget* parent=0, const char *name=0, WFlags f = WType_TopLevel | WDestructiveClose); ~KEducaBuilder(); /** start a dialog that asks the user what he wants to do to start*/ bool startChooser(); @@ -79,12 +79,12 @@ private: /** List of answers */ KListBox *_listAnswer; /** Preview */ - QTextView *_preview; + TQTextView *_preview; /** Main splitter */ - QSplitter *_split; + TQSplitter *_split; /** I open a file */ bool _isOpenFile; - QString _nativeFormat; + TQString _nativeFormat; public slots: /** Open new file */ @@ -96,7 +96,7 @@ private slots: /** Open new document. */ void slotFileOpen(); /** Item select */ - void slotPreview( QListBoxItem *item ); + void slotPreview( TQListBoxItem *item ); /** Close the window */ bool queryClose(); /** Edit question */ @@ -120,7 +120,7 @@ private slots: /** Init Gallery */ void slotGallery(); /** Double click in list, edit question */ - void slotEditbyList(QListBoxItem *item); + void slotEditbyList(TQListBoxItem *item); }; #endif diff --git a/keduca/keducabuilder/keducaeditorstartdialog.cpp b/keduca/keducabuilder/keducaeditorstartdialog.cpp index 88cf9305..8528b6ba 100644 --- a/keduca/keducabuilder/keducaeditorstartdialog.cpp +++ b/keduca/keducabuilder/keducaeditorstartdialog.cpp @@ -14,8 +14,8 @@ * (at your option) any later version. * * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -42,17 +42,17 @@ KEducaEditorStartDialog::KEducaEditorStartDialog(KEducaBuilder * parent, const c // setup connections urlRequester->setFilter( "application/x-edu"); - connect( startChoiceBtnGrp, SIGNAL( clicked(int) ), - this, SLOT( slotChoiceChanged(int) ) ); + connect( startChoiceBtnGrp, TQT_SIGNAL( clicked(int) ), + this, TQT_SLOT( slotChoiceChanged(int) ) ); } /** based on code in kaction.cpp */ void KEducaEditorStartDialog::buildRecentFilesList() { - QString key; - QString value; - QString oldGroup; + TQString key; + TQString value; + TQString oldGroup; KConfig *config = KGlobal::config(); oldGroup = config->group(); @@ -62,8 +62,8 @@ void KEducaEditorStartDialog::buildRecentFilesList() // read file list for( unsigned int i = 1 ; i <= _maxRecentDocumentItems ; i++ ) { - key = QString( "File%1" ).arg( i ); - value = config->readEntry( key, QString::null ); + key = TQString( "File%1" ).arg( i ); + value = config->readEntry( key, TQString::null ); if (!value.isNull()) recentDocumentCB->insertURL( KURL(value) ); diff --git a/keduca/keducabuilder/klangcombo.cpp b/keduca/keducabuilder/klangcombo.cpp index ebedd9dd..1d86c09e 100644 --- a/keduca/keducabuilder/klangcombo.cpp +++ b/keduca/keducabuilder/klangcombo.cpp @@ -31,21 +31,21 @@ KLanguageCombo::~KLanguageCombo () { } -KLanguageCombo::KLanguageCombo (QWidget * parent, const char *name) +KLanguageCombo::KLanguageCombo (TQWidget * parent, const char *name) : KTagComboBox(parent, name) { } -void KLanguageCombo::insertLanguage(const QString& path, const QString& name, const QString& sub, const QString &submenu) +void KLanguageCombo::insertLanguage(const TQString& path, const TQString& name, const TQString& sub, const TQString &submenu) { - QString output = name + QString::fromLatin1(" (") + path + QString::fromLatin1(")"); - QPixmap flag(locate("locale", sub + path + QString::fromLatin1("/flag.png"))); - insertItem(QIconSet(flag), output, path, submenu); + TQString output = name + TQString::fromLatin1(" (") + path + TQString::fromLatin1(")"); + TQPixmap flag(locate("locale", sub + path + TQString::fromLatin1("/flag.png"))); + insertItem(TQIconSet(flag), output, path, submenu); } -void KLanguageCombo::changeLanguage(const QString& name, int i) +void KLanguageCombo::changeLanguage(const TQString& name, int i) { if (i < 0 || i >= count()) return; - QString output = name + QString::fromLatin1(" (") + tag(i) + QString::fromLatin1(")"); + TQString output = name + TQString::fromLatin1(" (") + tag(i) + TQString::fromLatin1(")"); changeItem(output, i); } diff --git a/keduca/keducabuilder/klangcombo.h b/keduca/keducabuilder/klangcombo.h index 4c9fb801..2aca5753 100644 --- a/keduca/keducabuilder/klangcombo.h +++ b/keduca/keducabuilder/klangcombo.h @@ -37,11 +37,11 @@ class KLanguageCombo : public KTagComboBox Q_OBJECT public: - KLanguageCombo(QWidget *parent=0, const char *name=0); + KLanguageCombo(TQWidget *parent=0, const char *name=0); ~KLanguageCombo(); - void insertLanguage(const QString& path, const QString& name, const QString& sub = QString::null, const QString &submenu = QString::null); - void changeLanguage(const QString& name, int i); + void insertLanguage(const TQString& path, const TQString& name, const TQString& sub = TQString::null, const TQString &submenu = TQString::null); + void changeLanguage(const TQString& name, int i); }; #endif diff --git a/keduca/keducabuilder/ktagcombobox.cpp b/keduca/keducabuilder/ktagcombobox.cpp index 9b7e969e..6d8951ec 100644 --- a/keduca/keducabuilder/ktagcombobox.cpp +++ b/keduca/keducabuilder/ktagcombobox.cpp @@ -22,8 +22,8 @@ */ #define INCLUDE_MENUITEM_DEF 1 -#include -#include +#include +#include #include @@ -36,23 +36,23 @@ KTagComboBox::~KTagComboBox () delete _tags; } -KTagComboBox::KTagComboBox (QWidget * parent, const char *name) - : QComboBox(parent, name) +KTagComboBox::KTagComboBox (TQWidget * parent, const char *name) + : TQComboBox(parent, name) { - _popup = new QPopupMenu(this); + _popup = new TQPopupMenu(this); _tags = new QStringList; - connect( _popup, SIGNAL(activated(int)), - SLOT(internalActivate(int)) ); - connect( _popup, SIGNAL(highlighted(int)), - SLOT(internalHighlight(int)) ); + connect( _popup, TQT_SIGNAL(activated(int)), + TQT_SLOT(internalActivate(int)) ); + connect( _popup, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(internalHighlight(int)) ); } void KTagComboBox::popupMenu() { - _popup->popup( mapToGlobal( QPoint(0,0) ), _current ); + _popup->popup( mapToGlobal( TQPoint(0,0) ), _current ); } -void KTagComboBox::keyPressEvent( QKeyEvent *e ) +void KTagComboBox::keyPressEvent( TQKeyEvent *e ) { int c; @@ -74,7 +74,7 @@ void KTagComboBox::keyPressEvent( QKeyEvent *e ) emit activated( c ); } -void KTagComboBox::mousePressEvent( QMouseEvent * ) +void KTagComboBox::mousePressEvent( TQMouseEvent * ) { popupMenu(); } @@ -103,14 +103,14 @@ int KTagComboBox::count() const return _tags->count(); } -static inline QPopupMenu *checkInsertIndex(QPopupMenu *popup, const QStringList *tags, const QString &submenu, int *index) +static inline TQPopupMenu *checkInsertIndex(TQPopupMenu *popup, const TQStringList *tags, const TQString &submenu, int *index) { int pos = tags->findIndex(submenu); - QPopupMenu *pi = 0; + TQPopupMenu *pi = 0; if (pos != -1) { - QMenuItem *p = popup->findItem(popup->idAt(pos)); + TQMenuItem *p = popup->findItem(popup->idAt(pos)); pi = p?p->popup():0; } if (!pi) pi = popup; @@ -121,82 +121,82 @@ static inline QPopupMenu *checkInsertIndex(QPopupMenu *popup, const QStringList return pi; } -void KTagComboBox::insertItem(const QIconSet& icon, const QString &text, const QString &tag, const QString &submenu, int index ) +void KTagComboBox::insertItem(const TQIconSet& icon, const TQString &text, const TQString &tag, const TQString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); pi->insertItem(icon, text, count(), index); _tags->append(tag); } -void KTagComboBox::insertItem(const QString &text, const QString &tag, const QString &submenu, int index ) +void KTagComboBox::insertItem(const TQString &text, const TQString &tag, const TQString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); pi->insertItem(text, count(), index); _tags->append(tag); } -void KTagComboBox::insertSeparator(const QString &submenu, int index) +void KTagComboBox::insertSeparator(const TQString &submenu, int index) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); pi->insertSeparator(index); - _tags->append(QString::null); + _tags->append(TQString::null); } -void KTagComboBox::insertSubmenu(const QString &text, const QString &tag, const QString &submenu, int index) +void KTagComboBox::insertSubmenu(const TQString &text, const TQString &tag, const TQString &submenu, int index) { - QPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); - QPopupMenu *p = new QPopupMenu(pi); + TQPopupMenu *pi = checkInsertIndex(_popup, _tags, submenu, &index); + TQPopupMenu *p = new TQPopupMenu(pi); pi->insertItem(text, p, count(), index); _tags->append(tag); - connect( p, SIGNAL(activated(int)), - SLOT(internalActivate(int)) ); - connect( p, SIGNAL(highlighted(int)), - SLOT(internalHighlight(int)) ); + connect( p, TQT_SIGNAL(activated(int)), + TQT_SLOT(internalActivate(int)) ); + connect( p, TQT_SIGNAL(highlighted(int)), + TQT_SLOT(internalHighlight(int)) ); } -void KTagComboBox::changeItem( const QString &text, int index ) +void KTagComboBox::changeItem( const TQString &text, int index ) { _popup->changeItem( text, index); if (index == _current) repaint(); } -void KTagComboBox::paintEvent( QPaintEvent * ev) +void KTagComboBox::paintEvent( TQPaintEvent * ev) { - QComboBox::paintEvent(ev); + TQComboBox::paintEvent(ev); - QPainter p (this); + TQPainter p (this); // Text - QRect clip(2, 2, width() - 4, height() - 4); + TQRect clip(2, 2, width() - 4, height() - 4); if ( hasFocus()) p.setPen( colorGroup().highlightedText() ); p.drawText(clip, AlignCenter | SingleLine, _popup->text( _current )); // Icon - QIconSet *icon = _popup->iconSet( _current ); + TQIconSet *icon = _popup->iconSet( _current ); if (icon) { - QPixmap pm = icon->pixmap(); + TQPixmap pm = icon->pixmap(); p.drawPixmap( 4, (height()-pm.height())/2, pm ); } } -bool KTagComboBox::containsTag( const QString &str ) const +bool KTagComboBox::containsTag( const TQString &str ) const { return _tags->contains(str) > 0; } -QString KTagComboBox::currentTag() const +TQString KTagComboBox::currentTag() const { return *_tags->at(currentItem()); } -QString KTagComboBox::tag(int i) const +TQString KTagComboBox::tag(int i) const { if (i < 0 || i >= count()) { kdDebug() << "KTagComboBox::tag(), unknown tag " << i << endl; - return QString::null; + return TQString::null; } return *_tags->at(i); } @@ -213,7 +213,7 @@ void KTagComboBox::setCurrentItem(int i) repaint(); } -void KTagComboBox::setCurrentItem(const QString &code) +void KTagComboBox::setCurrentItem(const TQString &code) { int i = _tags->findIndex(code); if (code.isNull()) @@ -222,8 +222,8 @@ void KTagComboBox::setCurrentItem(const QString &code) setCurrentItem(i); } -void KTagComboBox::setFont( const QFont &font ) +void KTagComboBox::setFont( const TQFont &font ) { - QComboBox::setFont( font ); + TQComboBox::setFont( font ); _popup->setFont( font ); } diff --git a/keduca/keducabuilder/ktagcombobox.h b/keduca/keducabuilder/ktagcombobox.h index 099c6561..1644d6a7 100644 --- a/keduca/keducabuilder/ktagcombobox.h +++ b/keduca/keducabuilder/ktagcombobox.h @@ -25,14 +25,14 @@ #ifndef __KTAGCOMBOBOX_H__ #define __KTAGCOMBOBOX_H__ -#include -#include +#include +#include class QPopupMenu; class QStringList; /* * This class should be just like qcombobox, but it should be possible - * to have have a QIconSet for each entry, and each entry should have a tag. + * to have have a TQIconSet for each entry, and each entry should have a tag. * * It has also support for sub menues. */ @@ -41,14 +41,14 @@ class KTagComboBox : public QComboBox Q_OBJECT public: - KTagComboBox(QWidget *parent=0, const char *name=0); + KTagComboBox(TQWidget *parent=0, const char *name=0); ~KTagComboBox(); - void insertItem(const QIconSet& icon, const QString &text, const QString &tag, const QString &submenu = QString::null, int index=-1 ); - void insertItem(const QString &text, const QString &tag, const QString &submenu = QString::null, int index=-1 ); - void insertSeparator(const QString &submenu = QString::null, int index=-1 ); - void insertSubmenu(const QString &text, const QString &tag, const QString &submenu = QString::null, int index=-1); - void changeItem( const QString &text, int index ); + void insertItem(const TQIconSet& icon, const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 ); + void insertItem(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1 ); + void insertSeparator(const TQString &submenu = TQString::null, int index=-1 ); + void insertSubmenu(const TQString &text, const TQString &tag, const TQString &submenu = TQString::null, int index=-1); + void changeItem( const TQString &text, int index ); int count() const; void clear(); @@ -56,19 +56,19 @@ public: /* * Tag of the selected item */ - QString currentTag() const; - QString tag ( int i ) const; - bool containsTag (const QString &str ) const; + TQString currentTag() const; + TQString tag ( int i ) const; + bool containsTag (const TQString &str ) const; /* * Set the current item */ int currentItem() const; void setCurrentItem(int i); - void setCurrentItem(const QString &code); + void setCurrentItem(const TQString &code); // widget stuff - virtual void setFont( const QFont & ); + virtual void setFont( const TQFont & ); signals: void activated( int index ); @@ -79,15 +79,15 @@ private slots: void internalHighlight( int ); protected: - void paintEvent( QPaintEvent * ); - void mousePressEvent( QMouseEvent * ); - void keyPressEvent( QKeyEvent *e ); + void paintEvent( TQPaintEvent * ); + void mousePressEvent( TQMouseEvent * ); + void keyPressEvent( TQKeyEvent *e ); void popupMenu(); private: // work space for the new class - QStringList *_tags; - QPopupMenu *_popup; + TQStringList *_tags; + TQPopupMenu *_popup; int _current; }; diff --git a/keduca/keducabuilder/main.cpp b/keduca/keducabuilder/main.cpp index 93a49cdf..00032f08 100644 --- a/keduca/keducabuilder/main.cpp +++ b/keduca/keducabuilder/main.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "keducabuilder.h" static const char description[] = I18N_NOOP("Form-based tests and exams builder"); @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) keducaEditor->show(); if ( args->count() > 0 ){ - if( QFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) + if( TQFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" ) keducaEditor->initGallery( args->url(0) ); else keducaEditor->slotFileOpenURL( args->url(0) ); diff --git a/keduca/libkeduca/fileread.cpp b/keduca/libkeduca/fileread.cpp index db8f56cb..7632b6fd 100644 --- a/keduca/libkeduca/fileread.cpp +++ b/keduca/libkeduca/fileread.cpp @@ -25,12 +25,12 @@ #include #include -#include -#include -#include +#include +#include +#include -FileRead::FileRead( QObject *parent, const char *name ) - :QObject(parent, name), +FileRead::FileRead( TQObject *parent, const char *name ) + :TQObject(parent, name), _changed(false), _tmpfile(0) { @@ -41,7 +41,7 @@ FileRead::~FileRead() } bool FileRead::openFile(const KURL &url) { - QString tmpFile; + TQString tmpFile; bool returnval=false; if( KIO::NetAccess::download( url, tmpFile, 0 ) ) { @@ -58,15 +58,15 @@ bool FileRead::openFile(const KURL &url) { return returnval; } -bool FileRead::loadFile(const QString &filename) +bool FileRead::loadFile(const TQString &filename) { - QDomDocument doc("document.xml"); + TQDomDocument doc("document.xml"); KMimeType::Ptr type = KMimeType::findByFileContent(filename); kdDebug() << "FileRead::loadFile(): MIME-Type is " << type->name() << endl; - QFile file(filename); + TQFile file(filename); if(!file.open(IO_ReadOnly)) { @@ -82,26 +82,26 @@ bool FileRead::loadFile(const QString &filename) doc.setContent(qUncompress(file.readAll())); } - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); if( (doc.doctype().isNull()) || (doc.doctype().name() != "educa") ) { file.close(); return false; } - QDomNode n = docElem.firstChild(); + TQDomNode n = docElem.firstChild(); - QDomNodeList dnList = n.childNodes(); + TQDomNodeList dnList = n.childNodes(); for( unsigned int i = 0; i < dnList.count(); ++i) { // ------------------- INFORMATION BODY ----------------------- - QDomElement element = dnList.item(i).toElement(); + TQDomElement element = dnList.item(i).toElement(); if( element.tagName() == "default" || element.tagName() == "author" ) { if( element.tagName() == "default" ) { _header.insert( "image", element.attribute( "image", "default.png" ) ); } if( element.tagName() == "author" ) { - QDomNodeList AuthordnList = element.childNodes(); + TQDomNodeList AuthordnList = element.childNodes(); for( unsigned int i = 0; i < AuthordnList.count(); ++i) { - QDomElement authorelement = AuthordnList.item(i).toElement(); + TQDomElement authorelement = AuthordnList.item(i).toElement(); _header.insert( authorelement.tagName(), authorelement.text() ); } } @@ -117,17 +117,17 @@ bool FileRead::loadFile(const QString &filename) { insertQuestion(); // --------------------- QUESTION ATTRIBUTE------------------------ - QDomElement elementNODE = dnList.item(i).toElement(); + TQDomElement elementNODE = dnList.item(i).toElement(); setQuestion( QF_TYPE, elementNODE.attribute( "type", "1" ).toInt() ); setQuestion( QF_PICTURE, elementNODE.attribute( "image", "" ) ); setQuestion( QF_TIME, elementNODE.attribute( "time", "0" ).toInt() ); setQuestion( QF_POINTS, elementNODE.attribute( "points", "0" ).toInt() ); - QDomNodeList quList = elementNODE.childNodes(); + TQDomNodeList quList = elementNODE.childNodes(); for( unsigned int x = 0; x < quList.count(); ++x) { // --------------------- QUESTION AND RESPONSES------------------ - QDomElement element = quList.item(x).toElement(); + TQDomElement element = quList.item(x).toElement(); if( element.tagName() == "text" ) setQuestion( QF_TEXT, element.text() ); if( element.tagName() == "true" ) setAnswer( element.text(), true, element.attribute( "points", "0" ).toInt() ); if( element.tagName() == "false" ) setAnswer( element.text(), false,element.attribute( "points", "0" ).toInt() ); @@ -146,7 +146,7 @@ bool FileRead::loadFile(const QString &filename) { insertResult(); // --------------------- QUESTION ATTRIBUTE------------------------ - QDomElement elementNODE = dnList.item(i).toElement(); + TQDomElement elementNODE = dnList.item(i).toElement(); setResult( RS_TEXT, elementNODE.text() ); setResult( RS_PICTURE, elementNODE.attribute( "image", "" ) ); setResult( RS_MIN, elementNODE.attribute( "min", "0" ).toInt() ); @@ -162,7 +162,7 @@ bool FileRead::loadFile(const QString &filename) return true; } -void FileRead::setQuestion( QuestionField field, const QString& text) +void FileRead::setQuestion( QuestionField field, const TQString& text) { // QF_text, QF_picture, QF_type, QF_time, QF_tip, QF_explain switch( field ) @@ -180,7 +180,7 @@ void FileRead::setQuestion( QuestionField field, const QString& text) (*_recordQuestions).explain = text; break; default: - kdDebug()<<"FileRead::setQuestion(QuestionField field, QString text) called for not handled field value "<name(), copyimages, saveCompressed) ) { // upload the file KIO::Job * job = KIO::file_copy( KURL::fromPathOrURL( _tmpfile->name() ), _currentURL, -1, true /*overwrite*/ ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotUploadFinished (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotUploadFinished (KIO::Job *) ) ); return true; } } @@ -679,15 +679,15 @@ bool FileRead::saveFile( const KURL &url, bool copyimages, bool saveCompressed ) return false; } -bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveCompressed ) +bool FileRead::saveFile( const TQString &filename, bool copyimages, bool saveCompressed ) { - QDomDocument doc("document.xml"); - QTextStream stream; - QString line; - QByteArray data; - QBuffer buffer(data); - QFile file(filename); - QStringList copyJOB; + TQDomDocument doc("document.xml"); + TQTextStream stream; + TQString line; + TQByteArray data; + TQBuffer buffer(data); + TQFile file(filename); + TQStringList copyJOB; stream.setDevice(&buffer); @@ -705,13 +705,13 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp } */ - QString head( "" ); + TQString head( "" ); doc.setContent( head ); - QDomElement Root = doc.createElement("Document"); + TQDomElement Root = doc.createElement("Document"); doc.appendChild( Root ); - QDomElement NodeInfo = doc.createElement("Info"); + TQDomElement NodeInfo = doc.createElement("Info"); Root.appendChild( NodeInfo ); insertXML( doc, NodeInfo, "title", _header["title"] ); @@ -722,12 +722,12 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp if( !(_header["image"]).isEmpty() ) { - QDomElement Nodedefault = doc.createElement("default"); + TQDomElement Nodedefault = doc.createElement("default"); if( copyimages ) { copyJOB.append( _header["image"] ); - Nodedefault.setAttribute( "image", QFileInfo(_header["image"]).fileName() ); + Nodedefault.setAttribute( "image", TQFileInfo(_header["image"]).fileName() ); } else { Nodedefault.setAttribute( "image", _header["image"]); } @@ -736,26 +736,26 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp if( !_header["name"].isEmpty() || !_header["email"].isEmpty() || !_header["www"].isEmpty() ) { - QDomElement Nodeauthor = doc.createElement("author"); + TQDomElement Nodeauthor = doc.createElement("author"); NodeInfo.appendChild( Nodeauthor ); if( !_header["name"].isEmpty() ) insertXML( doc, Nodeauthor, "name", _header["name"] ); if( !_header["email"].isEmpty() ) insertXML( doc, Nodeauthor, "email", _header["email"] ); if( !_header["www"].isEmpty() ) insertXML( doc, Nodeauthor, "www", _header["www"] ); } - QDomElement NodeData = doc.createElement("Data"); + TQDomElement NodeData = doc.createElement("Data"); Root.appendChild( NodeData ); recordFirst(); while ( !recordEOF() ) { - QDomElement question = doc.createElement("question"); + TQDomElement question = doc.createElement("question"); if( !getQuestion( QF_PICTURE ).isEmpty() ) { if( copyimages ) { copyJOB.append( getQuestion( QF_PICTURE ) ); - question.setAttribute("image", QFileInfo( getQuestion( QF_PICTURE ) ).fileName() ); + question.setAttribute("image", TQFileInfo( getQuestion( QF_PICTURE ) ).fileName() ); } else { question.setAttribute("image", getQuestion( QF_PICTURE ) ); } @@ -770,16 +770,16 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp { if( getAnswerValue() ) { - QDomElement domELEMENT = doc.createElement( "true" ); + TQDomElement domELEMENT = doc.createElement( "true" ); if( getAnswerPoints() > 0 ) domELEMENT.setAttribute("points", getAnswerPoints() ); - QDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); + TQDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); question.appendChild( domELEMENT ); domELEMENT.appendChild( DATAelement ); } else { // insertXML( doc, question, "false", getAnswer( AF_text ) ); - QDomElement domELEMENT = doc.createElement( "false" ); + TQDomElement domELEMENT = doc.createElement( "false" ); if( getAnswerPoints() > 0 ) domELEMENT.setAttribute("points", getAnswerPoints() ); - QDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); + TQDomText DATAelement = doc.createTextNode( getAnswer( AF_TEXT ) ); question.appendChild( domELEMENT ); domELEMENT.appendChild( DATAelement ); } @@ -814,7 +814,7 @@ bool FileRead::saveFile( const QString &filename, bool copyimages, bool saveComp } /** Save results */ -bool FileRead::saveResults( const KURL &url, const QString &results ) +bool FileRead::saveResults( const KURL &url, const TQString &results ) { if (url.isValid()) { @@ -847,7 +847,7 @@ bool FileRead::saveResults( const KURL &url, const QString &results ) if( saveResults(_tmpfile->name(), results) ) { // upload the file KIO::Job * job = KIO::file_copy( KURL::fromPathOrURL( _tmpfile->name() ), _currentURL, -1, true /*overwrite*/ ); - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotUploadFinished (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotUploadFinished (KIO::Job *) ) ); return true; } } @@ -856,11 +856,11 @@ bool FileRead::saveResults( const KURL &url, const QString &results ) return false; } -bool FileRead::saveResults( const QString &filename, const QString &results ) +bool FileRead::saveResults( const TQString &filename, const TQString &results ) { - QTextStream stream; - QFile file(filename); - QStringList copyJOB; + TQTextStream stream; + TQFile file(filename); + TQStringList copyJOB; stream.setDevice(&file); @@ -875,30 +875,30 @@ bool FileRead::saveResults( const QString &filename, const QString &results ) } /** Insert xml format data */ -void FileRead::insertXML( QDomDocument &doc, QDomElement &parent, const QString &tagName, const QString &data) +void FileRead::insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &tagName, const TQString &data) { - QDomElement domELEMENT = doc.createElement( tagName ); - QDomText DATAelement = doc.createTextNode( data ); + TQDomElement domELEMENT = doc.createElement( tagName ); + TQDomText DATAelement = doc.createTextNode( data ); parent.appendChild( domELEMENT ); domELEMENT.appendChild( DATAelement ); } /** Insert xml data format */ -void FileRead::insertXML( QDomDocument &doc, QDomElement &parent, const QString &data) +void FileRead::insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &data) { - QDomText DATAelement = doc.createTextNode( data ); + TQDomText DATAelement = doc.createTextNode( data ); parent.appendChild( DATAelement ); } /** Get Header */ -QString FileRead::getHeader(const QString &head) +TQString FileRead::getHeader(const TQString &head) { return _header[head]; } /** Set header data */ -void FileRead::setHeader( const QString field, const QString value) +void FileRead::setHeader( const TQString field, const TQString value) { _changed = _header[field]!=value; diff --git a/keduca/libkeduca/fileread.h b/keduca/libkeduca/fileread.h index 3dc82a0b..679d2cc5 100644 --- a/keduca/libkeduca/fileread.h +++ b/keduca/libkeduca/fileread.h @@ -20,7 +20,7 @@ #include -#include +#include // forward declarations class KTempFile; @@ -32,11 +32,11 @@ class QFile; *@author Klas Kalass */ -class FileRead : public QObject { +class FileRead : public TQObject { Q_OBJECT public: - FileRead( QObject *parent=0, const char *name=0 ); + FileRead( TQObject *parent=0, const char *name=0 ); virtual ~FileRead(); enum QuestionField { QF_TEXT, QF_PICTURE, QF_POINTS, QF_TYPE, QF_TIME, QF_TIP, QF_EXPLAIN }; enum AnswerField { AF_TEXT, AF_VALUE, AF_POINT }; @@ -45,15 +45,15 @@ public: /** Open keduca file. This function can open a remote or local url. */ bool openFile( const KURL &url ); /** Set value to questions fields */ - void setQuestion( QuestionField field, const QString& text); + void setQuestion( QuestionField field, const TQString& text); /** Set value to questions fields */ void setQuestion( QuestionField field, int value ); /** Set value to results fields */ - void setResult( ResultField field, const QString& text); + void setResult( ResultField field, const TQString& text); /** Set value to results fields */ void setResult( ResultField field, int value ); /** Insert an answer field */ - void setAnswer( const QString& text, bool value, int points=0); + void setAnswer( const TQString& text, bool value, int points=0); /** Go to the Last Record */ void recordLast(); /** Go to the First record */ @@ -87,17 +87,17 @@ public: /** Record answer count */ unsigned int recordAnswerCount(); /** Get the value of the field question */ - QString getQuestion( QuestionField field ); + TQString getQuestion( QuestionField field ); /** Get the value of the field questions in integer */ int getQuestionInt( QuestionField field ); /** Get Answer field */ - QString getAnswer( AnswerField field ); + TQString getAnswer( AnswerField field ); /** Get answer field */ int getAnswerPoints(); /** Get Answer field */ bool getAnswerValue(); /** Get the value of the field result */ - QString getResult( ResultField field ); + TQString getResult( ResultField field ); /** Get the value of the field result */ int getResultInt( ResultField field ); /** Returns if this record is a begin of file */ @@ -121,15 +121,15 @@ public: /** Save file */ bool saveFile( const KURL &url = KURL(), bool copyimages = false, bool saveCompressed = true ); /** Save results */ - bool saveResults( const KURL &url, const QString &results ); + bool saveResults( const KURL &url, const TQString &results ); /** Get real picture */ - QString getPicture(); + TQString getPicture(); /** Get real picture */ - QPixmap getPicturePixmap(); + TQPixmap getPicturePixmap(); /** Set header data */ - void setHeader( const QString field, const QString value); + void setHeader( const TQString field, const TQString value); /** Get Header */ - QString getHeader(const QString &head); + TQString getHeader(const TQString &head); /** is Multi Answer */ bool isMultiAnswer(); /** is Result */ @@ -153,42 +153,42 @@ private: bool _changed; /** List of General Variables of the header */ - QMap _header; + TQMap _header; struct Answers { - QString text; + TQString text; bool value; int points; }; struct Results { - QString text; - QString picture; + TQString text; + TQString picture; int min; int max; }; struct Questions { - QString text; + TQString text; int type; - QString picture; + TQString picture; int time; int points; - QString tip; - QString explain; - QValueList listAnswers; - QValueListIterator recordAnswers; + TQString tip; + TQString explain; + TQValueList listAnswers; + TQValueListIterator recordAnswers; }; /** List to Data struct */ - QValueList _listQuestions; - QValueListIterator _recordQuestions; + TQValueList _listQuestions; + TQValueListIterator _recordQuestions; - QValueList _listResults; - QValueListIterator _recordResults; + TQValueList _listResults; + TQValueListIterator _recordResults; /** Returns if the database finds End Of File */ bool _fileEOF; @@ -207,7 +207,7 @@ private: /** the temporary file to which the document is saved, NULL if no temporary file is needed */ KTempFile *_tmpfile; /** the temporary image file */ - QString _tmpfileImage; + TQString _tmpfileImage; /** Total Questions */ uint _totalQuestions; /** Total Time */ @@ -218,17 +218,17 @@ private: // Private methods /** Insert xml format data */ - void insertXML( QDomDocument &doc, QDomElement &parent, const QString &tagName, const QString &data); + void insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &tagName, const TQString &data); /** Insert xml data format */ - void insertXML( QDomDocument &doc, QDomElement &parent, const QString &data); + void insertXML( TQDomDocument &doc, TQDomElement &parent, const TQString &data); protected: /** Open keduca file. This function does the actual work and expects a local filename . */ - bool loadFile( const QString &filename ); + bool loadFile( const TQString &filename ); /** Save KEduca file to the file*/ - bool saveFile( const QString &filename, bool copyimages, bool saveCompressed = true ); + bool saveFile( const TQString &filename, bool copyimages, bool saveCompressed = true ); /** Save Results file to the file */ - bool saveResults( const QString &filename, const QString &results ); + bool saveResults( const TQString &filename, const TQString &results ); protected slots: void slotUploadFinished( KIO::Job * job ); @@ -261,13 +261,13 @@ signals: /** * Emit this if loading is canceled by the user or by an error. **/ - void canceled( const QString &errMsg ); + void canceled( const TQString &errMsg ); /** * Emitted by the part, to set the caption of the window(s) * hosting this part */ - void setWindowCaption( const QString & caption ); + void setWindowCaption( const TQString & caption ); }; diff --git a/keduca/libkeduca/kgallerydialog.cpp b/keduca/libkeduca/kgallerydialog.cpp index 0ab2d126..b1ec43e2 100644 --- a/keduca/libkeduca/kgallerydialog.cpp +++ b/keduca/libkeduca/kgallerydialog.cpp @@ -24,13 +24,13 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -KGalleryDialog::KGalleryDialog(QWidget *parent, const char *name ) +KGalleryDialog::KGalleryDialog(TQWidget *parent, const char *name ) :KGalleryDialogBase(parent,name) { configRead(); @@ -42,7 +42,7 @@ KGalleryDialog::~KGalleryDialog() /** Open keduca file. This function can open a remote or local url. */ bool KGalleryDialog::openFile(const KURL &url) { - QString tmpFile; + TQString tmpFile; bool returnval=false; if( KIO::NetAccess::download( url, tmpFile, this ) ) { @@ -59,11 +59,11 @@ bool KGalleryDialog::openFile(const KURL &url) { return returnval; } -bool KGalleryDialog::loadFile( const QString &filename ) +bool KGalleryDialog::loadFile( const TQString &filename ) { - QDomDocument doc("document.xml"); + TQDomDocument doc("document.xml"); - QFile file(filename); + TQFile file(filename); if(!file.open(IO_ReadOnly)) { @@ -74,16 +74,16 @@ bool KGalleryDialog::loadFile( const QString &filename ) if( doc.doctype().name() != "educagallery" ) { return false; } - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + TQDomElement docElem = doc.documentElement(); + TQDomNode n = docElem.firstChild(); kdDebug()<<"... load attributes: "<< docElem.tagName() <setGroup( "kgallerydialog" ); _split->setSizes( appconfig->readIntListEntry("Splitter_size") ); - QSize defaultSize(500,400); + TQSize defaultSize(500,400); resize( appconfig->readSizeEntry("Geometry", &defaultSize ) ); appconfig->setGroup("Galleries Servers"); @@ -125,9 +125,9 @@ void KGalleryDialog::configRead() } it_ipservers=ipservers.begin(); - for ( QStringList::Iterator it_servers = servers.begin(); it_servers != servers.end(); ++it_servers ) + for ( TQStringList::Iterator it_servers = servers.begin(); it_servers != servers.end(); ++it_servers ) { - QListViewItem *newItem = new QListViewItem(listServers); + TQListViewItem *newItem = new TQListViewItem(listServers); newItem->setText(0,*it_servers); newItem->setText(1,*it_ipservers); newItem->setSelected(false); @@ -138,8 +138,8 @@ void KGalleryDialog::configRead() /** Write servers lists */ void KGalleryDialog::configWrite() { - QStringList servers; - QStringList ipservers; + TQStringList servers; + TQStringList ipservers; KConfig *config = KGlobal::config(); config->setGroup( "kgallerydialog" ); @@ -148,7 +148,7 @@ void KGalleryDialog::configWrite() config->sync(); config->setGroup("Galleries Servers"); - QListViewItem *item = listServers->firstChild(); + TQListViewItem *item = listServers->firstChild(); while (item) { servers.append( item->text(0) ); ipservers.append( item->text(1) ); @@ -169,7 +169,7 @@ void KGalleryDialog::slotButtonAdd() return; } - QListViewItem *newItem = new QListViewItem(listServers); + TQListViewItem *newItem = new TQListViewItem(listServers); newItem->setText(0,lineName->text()); newItem->setText(1,lineAddress->text()); newItem->setSelected(false); @@ -185,11 +185,11 @@ void KGalleryDialog::accept() configWrite(); KGalleryDialogBase::accept(); } -// done( QDialog::Accepted ); +// done( TQDialog::Accepted ); } /** Select Server */ -void KGalleryDialog::slotServerSelected( QListViewItem *item ) +void KGalleryDialog::slotServerSelected( TQListViewItem *item ) { if (!item) return; @@ -203,16 +203,16 @@ void KGalleryDialog::slotServerSelected( QListViewItem *item ) /** Get keduca test url */ KURL KGalleryDialog::getURL() { - QListViewItem *item = listDocuments->currentItem(); + TQListViewItem *item = listDocuments->currentItem(); if (!item) return KURL(); - QString urlAddress = item->text(5); + TQString urlAddress = item->text(5); if( _currentURL.isLocalFile() && !KURL(urlAddress).isValid() ) { - if( !QFileInfo(urlAddress).exists() ) + if( !TQFileInfo(urlAddress).exists() ) urlAddress = _currentURL.directory(false,true) + urlAddress; kdDebug()<< "Imagen en local" <setText( 1, urlFile.url() ); newItem->setSelected(false); } diff --git a/keduca/libkeduca/kgallerydialog.h b/keduca/libkeduca/kgallerydialog.h index a662bde6..41383091 100644 --- a/keduca/libkeduca/kgallerydialog.h +++ b/keduca/libkeduca/kgallerydialog.h @@ -36,7 +36,7 @@ namespace KIO { class Job; } class KGalleryDialog : public KGalleryDialogBase { Q_OBJECT public: - KGalleryDialog(QWidget *parent=0, const char *name=0); + KGalleryDialog(TQWidget *parent=0, const char *name=0); ~KGalleryDialog(); /** Open keduca file. This function can open a remote or local url. */ bool openFile( const KURL &url ); @@ -50,10 +50,10 @@ protected slots: // Private slots /** Open selected document */ void accept(); /** Select Server */ - void slotServerSelected( QListViewItem *item ); + void slotServerSelected( TQListViewItem *item ); protected: /** Open keduca file. This function does the actual work and expects a local filename . */ - bool loadFile( const QString &filename ); + bool loadFile( const TQString &filename ); private: // Private attributes /** Current url */ KURL _currentURL; diff --git a/kgeography/src/answer.cpp b/kgeography/src/answer.cpp index a468333c..f4931df3 100644 --- a/kgeography/src/answer.cpp +++ b/kgeography/src/answer.cpp @@ -8,9 +8,9 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include @@ -37,12 +37,12 @@ userAnswer &userAnswer::operator=(const userAnswer &r) return *this; } -void userAnswer::setQuestion(QVariant question) +void userAnswer::setQuestion(TQVariant question) { p_question = question; } -void userAnswer::setAnswer(QVariant answer) +void userAnswer::setAnswer(TQVariant answer) { p_answer = answer; } @@ -52,15 +52,15 @@ void userAnswer::setAnswerCorrect(bool correct) p_correct = correct; } -void userAnswer::setCorrectAnswer(QVariant correctAnswer) +void userAnswer::setCorrectAnswer(TQVariant correctAnswer) { p_correctAnswer = correctAnswer; } -void userAnswer::putWidgets(QWidget *w, QGridLayout *lay, int row) const +void userAnswer::putWidgets(TQWidget *w, TQGridLayout *lay, int row) const { - QWidget *widgets[3]; - const QVariant *v; + TQWidget *widgets[3]; + const TQVariant *v; for (int i = 0; i < 3; i++) { @@ -68,30 +68,30 @@ void userAnswer::putWidgets(QWidget *w, QGridLayout *lay, int row) const else if (i == 1) v = &p_answer; else v = &p_correctAnswer; - if (v -> type() == QVariant::String) + if (v -> type() == TQVariant::String) { - QLabel *l; - l = new QLabel(w); + TQLabel *l; + l = new TQLabel(w); l -> setText(v -> toString()); l -> setMargin(KDialog::marginHint() / 2); widgets[i] = l; } - else if (v -> type() == QVariant::Color) + else if (v -> type() == TQVariant::Color) { - QWidget *aux = new QWidget(w); - QHBoxLayout *lay = new QHBoxLayout(aux); + TQWidget *aux = new TQWidget(w); + TQHBoxLayout *lay = new TQHBoxLayout(aux); - QFrame *inner = new QFrame(aux); + TQFrame *inner = new TQFrame(aux); lay -> addWidget(inner); inner -> setBackgroundColor(v -> toColor()); inner -> setLineWidth(1); lay -> setMargin(KDialog::marginHint() / 2); widgets[i] = aux; } - else if (v -> type() == QVariant::Image) + else if (v -> type() == TQVariant::Image) { - QLabel *l; - l = new QLabel(w); + TQLabel *l; + l = new TQLabel(w); l -> setPixmap(v -> toImage()); l -> setAlignment(Qt::AlignHCenter); l -> setMargin(KDialog::marginHint() / 2); @@ -103,7 +103,7 @@ void userAnswer::putWidgets(QWidget *w, QGridLayout *lay, int row) const if (!p_correct) { - QColor back, fore; + TQColor back, fore; back = widgets[0] -> colorGroup().highlight(); fore = widgets[0] -> colorGroup().highlightedText(); for (int i = 0; i < 3; i++) diff --git a/kgeography/src/answer.h b/kgeography/src/answer.h index 02190ab4..b5169a0b 100644 --- a/kgeography/src/answer.h +++ b/kgeography/src/answer.h @@ -11,7 +11,7 @@ #ifndef RESULT_H #define RESULT_H -#include +#include class QGridLayout; @@ -23,15 +23,15 @@ class userAnswer userAnswer &operator=(const userAnswer &qa); - void setQuestion(QVariant question); - void setAnswer(QVariant answer); + void setQuestion(TQVariant question); + void setAnswer(TQVariant answer); void setAnswerCorrect(bool correct); - void setCorrectAnswer(QVariant correctAnswer); + void setCorrectAnswer(TQVariant correctAnswer); - void putWidgets(QWidget *w, QGridLayout *lay, int row) const; + void putWidgets(TQWidget *w, TQGridLayout *lay, int row) const; private: - QVariant p_question, p_answer, p_correctAnswer; + TQVariant p_question, p_answer, p_correctAnswer; bool p_correct; }; diff --git a/kgeography/src/answersdialog.cpp b/kgeography/src/answersdialog.cpp index a9925b6d..c6d9d292 100644 --- a/kgeography/src/answersdialog.cpp +++ b/kgeography/src/answersdialog.cpp @@ -10,27 +10,27 @@ #include -#include -#include -#include +#include +#include +#include #include "answer.h" #include "answersdialog.h" -answersDialog::answersDialog(QWidget *parent, const QValueVector &userAnswers, QString question, int correctAnswers) : KDialogBase(parent, 0, true, i18n("Your Answers Were"), Ok) +answersDialog::answersDialog(TQWidget *parent, const TQValueVector &userAnswers, TQString question, int correctAnswers) : KDialogBase(parent, 0, true, i18n("Your Answers Were"), Ok) { - QLabel *l1, *l2, *l3; - QFont boldFont, bigFont; + TQLabel *l1, *l2, *l3; + TQFont boldFont, bigFont; uint totalAnswers; totalAnswers = userAnswers.count(); - p_sv = new QScrollView(this); + p_sv = new TQScrollView(this); setMainWidget(p_sv); - p_container = new QWidget(p_sv -> viewport()); + p_container = new TQWidget(p_sv -> viewport()); p_sv -> viewport() -> setPaletteBackgroundColor(p_container -> paletteBackgroundColor()); - QGridLayout *lay = new QGridLayout(p_container); + TQGridLayout *lay = new TQGridLayout(p_container); lay -> setColStretch(0, 1); lay -> setColStretch(4, 1); lay -> setRowStretch(totalAnswers + 4, 1); @@ -38,7 +38,7 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector &us // Title bigFont = p_container -> font(); bigFont.setPointSize(24); - l1 = new QLabel(question, p_container); + l1 = new TQLabel(question, p_container); l1 -> setFont(bigFont); l1 -> setAlignment(Qt::AlignCenter); lay->addMultiCellWidget(l1, 0, 0, 0, 4); @@ -47,11 +47,11 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector &us boldFont = p_container -> font(); boldFont.setBold(true); - l1 = new QLabel(i18n("Question"), p_container); + l1 = new TQLabel(i18n("Question"), p_container); l1 -> setFont(boldFont); - l2 = new QLabel(i18n("Your Answer"), p_container); + l2 = new TQLabel(i18n("Your Answer"), p_container); l2 -> setFont(boldFont); - l3 = new QLabel(i18n("Correct Answer"), p_container); + l3 = new TQLabel(i18n("Correct Answer"), p_container); l3 -> setFont(boldFont); l1 -> setMargin(KDialog::marginHint() / 2); l2 -> setMargin(KDialog::marginHint() / 2); @@ -65,9 +65,9 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector &us userAnswers[i].putWidgets(p_container, lay, i + 2); } - lay -> addItem(new QSpacerItem(20, 20, QSizePolicy::Fixed, QSizePolicy::Fixed), totalAnswers + 3, 2); + lay -> addItem(new TQSpacerItem(20, 20, TQSizePolicy::Fixed, TQSizePolicy::Fixed), totalAnswers + 3, 2); - l1 = new QLabel(i18n("You answered correctly %1 out of %2 questions.").arg(correctAnswers).arg(totalAnswers), p_container); + l1 = new TQLabel(i18n("You answered correctly %1 out of %2 questions.").arg(correctAnswers).arg(totalAnswers), p_container); l1 -> setAlignment(Qt::AlignCenter); lay->addMultiCellWidget(l1, totalAnswers + 4, totalAnswers + 4, 0, 4); @@ -75,12 +75,12 @@ answersDialog::answersDialog(QWidget *parent, const QValueVector &us resize(500, 500); } -void answersDialog::showEvent(QShowEvent *) +void answersDialog::showEvent(TQShowEvent *) { positionContainer(); } -void answersDialog::resizeEvent(QResizeEvent *) +void answersDialog::resizeEvent(TQResizeEvent *) { positionContainer(); } diff --git a/kgeography/src/answersdialog.h b/kgeography/src/answersdialog.h index acd930a9..730a1142 100644 --- a/kgeography/src/answersdialog.h +++ b/kgeography/src/answersdialog.h @@ -13,7 +13,7 @@ #include -#include +#include class QScrollView; class QWidget; @@ -23,17 +23,17 @@ class userAnswer; class answersDialog : public KDialogBase { public: - answersDialog(QWidget *parent, const QValueVector &userAnswers, QString question, int correctAnswers); + answersDialog(TQWidget *parent, const TQValueVector &userAnswers, TQString question, int correctAnswers); protected: - void showEvent(QShowEvent *e); - void resizeEvent(QResizeEvent *e); + void showEvent(TQShowEvent *e); + void resizeEvent(TQResizeEvent *e); private: void positionContainer(); - QWidget *p_container; - QScrollView *p_sv; + TQWidget *p_container; + TQScrollView *p_sv; }; #endif diff --git a/kgeography/src/askwidget.cpp b/kgeography/src/askwidget.cpp index d0d38548..87d1d09a 100644 --- a/kgeography/src/askwidget.cpp +++ b/kgeography/src/askwidget.cpp @@ -11,16 +11,16 @@ #include #include -#include +#include #include "askwidget.h" #include "map.h" -askWidget::askWidget(QWidget *parent, KGmap *m, QWidget *w, uint count, bool showLabel) : QWidget(parent), p_map(m), p_count(count) +askWidget::askWidget(TQWidget *parent, KGmap *m, TQWidget *w, uint count, bool showLabel) : TQWidget(parent), p_map(m), p_count(count) { if (showLabel) { - p_answers = new QLabel(w); + p_answers = new TQLabel(w); p_answers -> setAlignment(AlignTop | AlignHCenter); resetAnswers(); p_answers -> show(); @@ -38,7 +38,7 @@ int askWidget::correctAnswers() const return p_correctAnswers; } -QValueVector askWidget::userAnswers() const +TQValueVector askWidget::userAnswers() const { return p_userAnswers; } @@ -60,14 +60,14 @@ void askWidget::clearAsked() p_asked.clear(); } -QString askWidget::lastDivisionAsked() +TQString askWidget::lastDivisionAsked() { return p_asked.last(); } void askWidget::nextQuestion() { - QString aux; + TQString aux; if (p_asked.count() < p_count) { diff --git a/kgeography/src/askwidget.h b/kgeography/src/askwidget.h index 9e7450ae..5cc01943 100644 --- a/kgeography/src/askwidget.h +++ b/kgeography/src/askwidget.h @@ -11,8 +11,8 @@ #ifndef ASKWIDGET_H #define ASKWIDGET_H -#include -#include +#include +#include #include "answer.h" @@ -24,13 +24,13 @@ class askWidget : public QWidget { Q_OBJECT public: - askWidget(QWidget *parent, KGmap *m, QWidget *w, uint count, bool showLabel = true); + askWidget(TQWidget *parent, KGmap *m, TQWidget *w, uint count, bool showLabel = true); virtual ~askWidget(); - virtual QString getQuestionHook() const = 0; + virtual TQString getQuestionHook() const = 0; virtual bool isClickOnDivision() const { return false; } int correctAnswers() const; - QValueVector userAnswers() const; + TQValueVector userAnswers() const; public slots: virtual void setMovement(bool b); @@ -45,25 +45,25 @@ Q_OBJECT protected: void clearAsked(); - QString lastDivisionAsked(); + TQString lastDivisionAsked(); void nextQuestion(); - virtual void nextQuestionHook(const QString &division) = 0; + virtual void nextQuestionHook(const TQString &division) = 0; void questionAnswered(bool wasCorrect); void resetAnswers(); KGmap *p_map; userAnswer p_currentAnswer; - QLabel *p_answers; + TQLabel *p_answers; private: void updateLabel(); int p_correctAnswers, p_incorrectAnswers; - QValueVector p_userAnswers; + TQValueVector p_userAnswers; // the list of asked divisions - QStringList p_asked; + TQStringList p_asked; // the number of questions to do uint p_count; diff --git a/kgeography/src/boxasker.cpp b/kgeography/src/boxasker.cpp index 0634c622..dc6d526d 100644 --- a/kgeography/src/boxasker.cpp +++ b/kgeography/src/boxasker.cpp @@ -15,25 +15,25 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "boxasker.h" #include "map.h" -boxAsker::boxAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : askWidget(parent, m, w, count) +boxAsker::boxAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : askWidget(parent, m, w, count) { - p_lay = new QVBoxLayout(this); + p_lay = new TQVBoxLayout(this); - QVButtonGroup *bg = new QVButtonGroup(this); - p_label = new QLabel(this); - p_rb = new QRadioButton*[4]; + TQVButtonGroup *bg = new TQVButtonGroup(this); + p_label = new TQLabel(this); + p_rb = new TQRadioButton*[4]; for(int i = 0; i < 4; i++) { - p_rb[i] = new QRadioButton(bg); - p_rb[i]->setFocusPolicy(QWidget::StrongFocus); + p_rb[i] = new TQRadioButton(bg); + p_rb[i]->setFocusPolicy(TQWidget::StrongFocus); } p_accept = new KPushButton(this); @@ -48,21 +48,21 @@ boxAsker::~boxAsker() delete[] p_rb; } -void boxAsker::setQuestion(const QString &q) +void boxAsker::setQuestion(const TQString &q) { p_label -> setText(q); } -void boxAsker::keyReleaseEvent(QKeyEvent *e) +void boxAsker::keyReleaseEvent(TQKeyEvent *e) { if (e -> key() == Qt::Key_Return || e -> key() == Qt::Key_Enter) checkAnswer(); else askWidget::keyReleaseEvent(e); } -void boxAsker::nextQuestionHook(const QString &division) +void boxAsker::nextQuestionHook(const TQString &division) { - QString otherDivision; - QStringList auxList; + TQString otherDivision; + TQStringList auxList; int i; setFocus(); @@ -122,7 +122,7 @@ void boxAsker::init() nextQuestion(); p_accept -> disconnect(); - connect(p_accept, SIGNAL(clicked()), this, SLOT(checkAnswer())); + connect(p_accept, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswer())); } #include "boxasker.moc" diff --git a/kgeography/src/boxasker.h b/kgeography/src/boxasker.h index a9391f43..f48878ef 100644 --- a/kgeography/src/boxasker.h +++ b/kgeography/src/boxasker.h @@ -23,19 +23,19 @@ class boxAsker : public askWidget { Q_OBJECT public: - boxAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + boxAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); ~boxAsker(); protected: - virtual bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) = 0; - void nextQuestionHook(const QString &division); - void setQuestion(const QString &q); + virtual bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) = 0; + void nextQuestionHook(const TQString &division); + void setQuestion(const TQString &q); virtual void setAnswerHook(int userSays) = 0; - void keyReleaseEvent(QKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); - QVBoxLayout *p_lay; - QRadioButton **p_rb; + TQVBoxLayout *p_lay; + TQRadioButton **p_rb; protected slots: void init(); @@ -51,7 +51,7 @@ Q_OBJECT // the position the correct answer is in int p_position; - QLabel *p_label; + TQLabel *p_label; }; #endif diff --git a/kgeography/src/capitaldivisionasker.cpp b/kgeography/src/capitaldivisionasker.cpp index 623cffa4..ffea1407 100644 --- a/kgeography/src/capitaldivisionasker.cpp +++ b/kgeography/src/capitaldivisionasker.cpp @@ -10,17 +10,17 @@ #include -#include +#include #include "capitaldivisionasker.h" #include "map.h" -capitalDivisionAsker::capitalDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +capitalDivisionAsker::capitalDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { init(); } -bool capitalDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool capitalDivisionAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { bool b; if (isAnswer) @@ -29,16 +29,16 @@ bool capitalDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int p_currentAnswer.setQuestion(i18n(p_map -> getFileName().utf8(), p_capital.utf8())); p_currentAnswer.setCorrectAnswer(i18n(p_map -> getFileName().utf8(), division.utf8())); - QString sw = i18n("There are two ways of dealing with the translation of \"%1 is the capital of...\". The first option simply replaces %1 with the translated name of the relevant city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"%1 is the capital of...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"%1 is the capital of...\". The first option simply replaces %1 with the translated name of the relevant city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"%1 is the capital of...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString capitalName = i18n(p_map -> getFileName().utf8(), p_capital.utf8()); - QString text = i18n("%1 is the capital of..."); + TQString capitalName = i18n(p_map -> getFileName().utf8(), p_capital.utf8()); + TQString text = i18n("%1 is the capital of..."); setQuestion(text.arg(capitalName)); } else { - QString s = QString("%1 is the capital of...").arg(p_capital); + TQString s = TQString("%1 is the capital of...").arg(p_capital); setQuestion(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_rb[i] -> setText(i18n(p_map -> getFileName().utf8(), division.utf8())); @@ -68,7 +68,7 @@ void capitalDivisionAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> text()); } -QString capitalDivisionAsker::getQuestionHook() const +TQString capitalDivisionAsker::getQuestionHook() const { return i18n("Division From Its Capital"); } diff --git a/kgeography/src/capitaldivisionasker.h b/kgeography/src/capitaldivisionasker.h index 6464d62b..9d9b9ec8 100644 --- a/kgeography/src/capitaldivisionasker.h +++ b/kgeography/src/capitaldivisionasker.h @@ -18,15 +18,15 @@ class QLabel; class capitalDivisionAsker : public boxAsker { public: - capitalDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + capitalDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; private: - QString p_capital; + TQString p_capital; }; #endif diff --git a/kgeography/src/division.cpp b/kgeography/src/division.cpp index 733b6d3f..7ef70353 100644 --- a/kgeography/src/division.cpp +++ b/kgeography/src/division.cpp @@ -8,7 +8,7 @@ * (at your option) any later version. * ***************************************************************************/ -#include +#include #include "division.h" @@ -16,7 +16,7 @@ division::division() { p_canAskAlways = true; p_canAskClickDivision = true; - p_flagFile = QString::null; + p_flagFile = TQString::null; } bool division::canAsk(bool clickDivisionMode) const @@ -25,7 +25,7 @@ bool division::canAsk(bool clickDivisionMode) const else return p_canAskAlways; } -QString division::getName() const +TQString division::getName() const { return p_name; } @@ -35,18 +35,18 @@ QRgb division::getRGB() const return p_color; } -QString division::getFlagFile() const +TQString division::getFlagFile() const { return p_flagFile; } -QString division::getCapital() const +TQString division::getCapital() const { if (p_capital.isEmpty()) return ""; return p_capital; } -void division::setCapital(const QString &name) +void division::setCapital(const TQString &name) { p_capital = name; } @@ -65,7 +65,7 @@ void division::setIgnore(bool ignore, bool canAskClickDivision) } } -void division::setName(const QString &name) +void division::setName(const TQString &name) { p_name = name; } @@ -75,8 +75,8 @@ void division::setRGB(int r, int g, int b) p_color = qRgb(r, g, b); } -bool division::setFlagFile(const QString &path) +bool division::setFlagFile(const TQString &path) { p_flagFile = path; - return QFile::exists(path); + return TQFile::exists(path); } diff --git a/kgeography/src/division.h b/kgeography/src/division.h index cc8119a3..69b347f3 100644 --- a/kgeography/src/division.h +++ b/kgeography/src/division.h @@ -11,8 +11,8 @@ #ifndef DIVISION_H #define DIVISION_H -#include -#include +#include +#include class division { @@ -20,19 +20,19 @@ class division division(); bool canAsk(bool clickDivisionMode) const; - QString getName() const; + TQString getName() const; QRgb getRGB() const; - QString getFlagFile() const; - QString getCapital() const; + TQString getFlagFile() const; + TQString getCapital() const; - void setCapital(const QString &name); + void setCapital(const TQString &name); void setIgnore(bool ignore, bool canAskClickDivision); - void setName(const QString &name); + void setName(const TQString &name); void setRGB(int r, int g, int b); - bool setFlagFile(const QString &path); + bool setFlagFile(const TQString &path); private: - QString p_name, p_flagFile, p_capital; + TQString p_name, p_flagFile, p_capital; QRgb p_color; bool p_canAskAlways, p_canAskClickDivision; }; diff --git a/kgeography/src/divisioncapitalasker.cpp b/kgeography/src/divisioncapitalasker.cpp index 0fcdb8b8..b87437a2 100644 --- a/kgeography/src/divisioncapitalasker.cpp +++ b/kgeography/src/divisioncapitalasker.cpp @@ -10,31 +10,31 @@ #include -#include +#include #include "divisioncapitalasker.h" #include "map.h" -divisionCapitalAsker::divisionCapitalAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +divisionCapitalAsker::divisionCapitalAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { init(); } -bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool divisionCapitalAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { bool b; if (isAnswer) { - QString sw = i18n("There are two ways of dealing with the translation of \"The capital of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The capital of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"The capital of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The capital of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); - QString text = i18n("The capital of %1 is..."); + TQString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); + TQString text = i18n("The capital of %1 is..."); setQuestion(text.arg(divisionName)); } else { - QString s = QString("The capital of %1 is...").arg(division); + TQString s = TQString("The capital of %1 is...").arg(division); setQuestion(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_currentAnswer.setQuestion(i18n(p_map -> getFileName().utf8(), division.utf8())); @@ -45,7 +45,7 @@ bool divisionCapitalAsker::nextBoxAskerQuestionHook(const QString &division, int } else { - QString capital; + TQString capital; capital = p_map -> getDivisionCapital(division); // There are crazy countries like Norway where two different divisions // have the same capital, avoid asking @@ -69,7 +69,7 @@ void divisionCapitalAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> text()); } -QString divisionCapitalAsker::getQuestionHook() const +TQString divisionCapitalAsker::getQuestionHook() const { return i18n("Capital of Division"); } diff --git a/kgeography/src/divisioncapitalasker.h b/kgeography/src/divisioncapitalasker.h index e63901c5..e4bc5514 100644 --- a/kgeography/src/divisioncapitalasker.h +++ b/kgeography/src/divisioncapitalasker.h @@ -16,15 +16,15 @@ class divisionCapitalAsker : public boxAsker { public: - divisionCapitalAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + divisionCapitalAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; private: - QString p_capital; + TQString p_capital; }; #endif diff --git a/kgeography/src/divisionflagasker.cpp b/kgeography/src/divisionflagasker.cpp index cc5f2430..79641b25 100644 --- a/kgeography/src/divisionflagasker.cpp +++ b/kgeography/src/divisionflagasker.cpp @@ -10,34 +10,34 @@ #include -#include -#include +#include +#include #include "divisionflagasker.h" #include "map.h" -divisionFlagAsker::divisionFlagAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +divisionFlagAsker::divisionFlagAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { init(); } -bool divisionFlagAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool divisionFlagAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { - QImage im(p_map -> getDivisionFlagFile(division)); + TQImage im(p_map -> getDivisionFlagFile(division)); im = im.smoothScale(im.width()/5, im.height()/5); p_rb[i] -> setPixmap(im); if (isAnswer) { - QString sw = i18n("There are two ways of dealing with the translation of \"The flag of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The flag of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"The flag of %1 is...\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"The flag of %1 is...\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); - QString text = i18n("The flag of %1 is..."); + TQString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); + TQString text = i18n("The flag of %1 is..."); setQuestion(text.arg(divisionName)); } else { - QString s = QString("The flag of %1 is...").arg(division); + TQString s = TQString("The flag of %1 is...").arg(division); setQuestion(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_currentAnswer.setCorrectAnswer(im); @@ -51,7 +51,7 @@ void divisionFlagAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> pixmap() -> convertToImage()); } -QString divisionFlagAsker::getQuestionHook() const +TQString divisionFlagAsker::getQuestionHook() const { return i18n("Flag of Division"); } diff --git a/kgeography/src/divisionflagasker.h b/kgeography/src/divisionflagasker.h index a0611d28..5e1eaef2 100644 --- a/kgeography/src/divisionflagasker.h +++ b/kgeography/src/divisionflagasker.h @@ -16,12 +16,12 @@ class divisionFlagAsker : public boxAsker { public: - divisionFlagAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + divisionFlagAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; }; #endif diff --git a/kgeography/src/flagdivisionasker.cpp b/kgeography/src/flagdivisionasker.cpp index 365da9ef..f6c305ab 100644 --- a/kgeography/src/flagdivisionasker.cpp +++ b/kgeography/src/flagdivisionasker.cpp @@ -10,27 +10,27 @@ #include -#include -#include -#include +#include +#include +#include #include "flagdivisionasker.h" #include "map.h" -flagDivisionAsker::flagDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count) : boxAsker(parent, m, w, count) +flagDivisionAsker::flagDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count) : boxAsker(parent, m, w, count) { - p_flag = new QWidget(this); + p_flag = new TQWidget(this); p_lay -> insertWidget(0, p_flag); setQuestion(i18n("This flag belongs to:")); init(); } -bool flagDivisionAsker::nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) +bool flagDivisionAsker::nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer) { if (isAnswer) { // we put the flag image - QImage image(p_map -> getDivisionFlagFile(division)); + TQImage image(p_map -> getDivisionFlagFile(division)); p_flag -> setPaletteBackgroundPixmap(image); p_flag -> setFixedSize(image.size()); @@ -46,7 +46,7 @@ void flagDivisionAsker::setAnswerHook(int userSays) p_currentAnswer.setAnswer(p_rb[userSays] -> text()); } -QString flagDivisionAsker::getQuestionHook() const +TQString flagDivisionAsker::getQuestionHook() const { return i18n("Division From Its Flag"); } diff --git a/kgeography/src/flagdivisionasker.h b/kgeography/src/flagdivisionasker.h index 5e351f4c..dfd4f662 100644 --- a/kgeography/src/flagdivisionasker.h +++ b/kgeography/src/flagdivisionasker.h @@ -16,15 +16,15 @@ class flagDivisionAsker : public boxAsker { public: - flagDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count); + flagDivisionAsker(TQWidget *parent, KGmap *m, TQWidget *w, uint count); protected: - bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer); + bool nextBoxAskerQuestionHook(const TQString &division, int i, bool isAnswer); void setAnswerHook(int userSays); - QString getQuestionHook() const; + TQString getQuestionHook() const; private: - QWidget *p_flag; + TQWidget *p_flag; }; #endif diff --git a/kgeography/src/kgeography.cpp b/kgeography/src/kgeography.cpp index 26ce7819..33740e66 100644 --- a/kgeography/src/kgeography.cpp +++ b/kgeography/src/kgeography.cpp @@ -17,12 +17,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "answersdialog.h" #include "capitaldivisionasker.h" @@ -41,40 +41,40 @@ kgeography::kgeography() : KMainWindow(), p_firstShow(true), p_mustShowResultsDi p_map = 0; p_askWidget = 0; - p_bigWidget = new QHBox(this); + p_bigWidget = new TQHBox(this); - QVBox *p_leftWidget = new QVBox(p_bigWidget); - p_currentMap = new QLabel(p_leftWidget); + TQVBox *p_leftWidget = new TQVBox(p_bigWidget); + p_currentMap = new TQLabel(p_leftWidget); p_currentMap -> setAlignment(AlignCenter); p_consult = new KPushButton(i18n("&Browse Map"), p_leftWidget); - QWhatsThis::add(p_consult, i18n("In this section left click on any part of the map to learn about the divisions" )); + TQWhatsThis::add(p_consult, i18n("In this section left click on any part of the map to learn about the divisions" )); p_askMap = new KPushButton(i18n("&Click Division in Map..."), p_leftWidget); - QWhatsThis::add(p_askMap, i18n("In this challenge you are given a division name on the left under the menu and you must find it on the map and click on it")); + TQWhatsThis::add(p_askMap, i18n("In this challenge you are given a division name on the left under the menu and you must find it on the map and click on it")); p_askCapitalDivisions = new KPushButton(i18n("Guess Division From Its &Capital..."), p_leftWidget); - QWhatsThis::add(p_askCapitalDivisions, i18n("In this quiz you have to guess the division name given its capital")); + TQWhatsThis::add(p_askCapitalDivisions, i18n("In this quiz you have to guess the division name given its capital")); p_askDivisionCapitals = new KPushButton(i18n("Guess Capital of &Division..."), p_leftWidget); - QWhatsThis::add(p_askDivisionCapitals, i18n("In this quiz you have to guess the capital of a given division name")); + TQWhatsThis::add(p_askDivisionCapitals, i18n("In this quiz you have to guess the capital of a given division name")); p_askFlagDivisions = new KPushButton(i18n("&Guess Division From Its Flag..."), p_leftWidget); - QWhatsThis::add(p_askFlagDivisions, i18n("In this quiz you have to guess the division name given its flag")); + TQWhatsThis::add(p_askFlagDivisions, i18n("In this quiz you have to guess the division name given its flag")); p_askDivisionFlags = new KPushButton(i18n("G&uess Flag of Division..."), p_leftWidget); - QWhatsThis::add(p_askDivisionFlags, i18n("In this quiz you have to guess the flag of a division given its name")); - p_underLeftWidget = new QVBox(p_leftWidget); + TQWhatsThis::add(p_askDivisionFlags, i18n("In this quiz you have to guess the flag of a division given its name")); + p_underLeftWidget = new TQVBox(p_leftWidget); p_underLeftWidget -> layout() -> setSpacing(KDialog::spacingHint()); p_underLeftWidget -> layout() -> setMargin(KDialog::marginHint()); p_leftWidget -> setStretchFactor(p_underLeftWidget, 1); setCentralWidget(p_bigWidget); - connect(p_consult, SIGNAL(clicked()), this, SLOT(consult())); - connect(p_askMap, SIGNAL(clicked()), this, SLOT(askMap())); - connect(p_askCapitalDivisions, SIGNAL(clicked()), this, SLOT(askCapitalDivisions())); - connect(p_askDivisionCapitals, SIGNAL(clicked()), this, SLOT(askDivisionCapitals())); - connect(p_askFlagDivisions, SIGNAL(clicked()), this, SLOT(askFlagDivisions())); - connect(p_askDivisionFlags, SIGNAL(clicked()), this, SLOT(askDivisionFlags())); + connect(p_consult, TQT_SIGNAL(clicked()), this, TQT_SLOT(consult())); + connect(p_askMap, TQT_SIGNAL(clicked()), this, TQT_SLOT(askMap())); + connect(p_askCapitalDivisions, TQT_SIGNAL(clicked()), this, TQT_SLOT(askCapitalDivisions())); + connect(p_askDivisionCapitals, TQT_SIGNAL(clicked()), this, TQT_SLOT(askDivisionCapitals())); + connect(p_askFlagDivisions, TQT_SIGNAL(clicked()), this, TQT_SLOT(askFlagDivisions())); + connect(p_askDivisionFlags, TQT_SIGNAL(clicked()), this, TQT_SLOT(askDivisionFlags())); - KAction *a = KStdAction::open(this, SLOT(openMap()), actionCollection(), "openMap"); + KAction *a = KStdAction::open(this, TQT_SLOT(openMap()), actionCollection(), "openMap"); a -> setText(i18n("&Open Map...")); - KStdAction::quit(this, SLOT(close()), actionCollection(), "quit"); + KStdAction::quit(this, TQT_SLOT(close()), actionCollection(), "quit"); p_zoom = new KToggleAction(i18n("&Zoom"), "viewmagfit", 0, 0, 0, actionCollection(), "zoom_select"); p_zoom -> setEnabled(false); @@ -85,7 +85,7 @@ kgeography::kgeography() : KMainWindow(), p_firstShow(true), p_mustShowResultsDi p_move = new KToggleAction(i18n("&Move"), "move", 0, 0, 0, actionCollection(), "move"); p_move -> setEnabled(false); - new KAction(i18n("Disclaimer"), 0, this, SLOT(disclaimer()), actionCollection(), "disclaimer"); + new KAction(i18n("Disclaimer"), 0, this, TQT_SLOT(disclaimer()), actionCollection(), "disclaimer"); setupGUI(Keys | ToolBar | Save | Create); @@ -98,13 +98,13 @@ kgeography::~kgeography() delete p_map; } -void kgeography::showEvent(QShowEvent *) +void kgeography::showEvent(TQShowEvent *) { if (p_firstShow) { - QString file = kgeographySettings::self() -> lastMap(); + TQString file = kgeographySettings::self() -> lastMap(); - if (QFile::exists(file)) + if (TQFile::exists(file)) { mapReader reader; if (reader.parseMap(file)) @@ -132,7 +132,7 @@ void kgeography::showEvent(QShowEvent *) } // if anyone can explain why with the slot works and now without // i'll be glad to learn - QTimer::singleShot(0, this, SLOT(resizeMainWindow())); + TQTimer::singleShot(0, this, TQT_SLOT(resizeMainWindow())); // resizeMainWindow(); p_firstShow = false; @@ -257,25 +257,25 @@ void kgeography::removeOldAskWidget() p_move -> setChecked(false); } -QSize kgeography::getPreferredSize() +TQSize kgeography::getPreferredSize() { int ySize = 0; ySize = menuBar() -> size().height() + toolBar() -> size().height() + ((mapAsker*) p_askWidget)->mapSize().height(); - return QSize(p_underLeftWidget -> size().width() + ((mapAsker*) p_askWidget)->mapSize().width() + 1, ySize + 1); + return TQSize(p_underLeftWidget -> size().width() + ((mapAsker*) p_askWidget)->mapSize().width() + 1, ySize + 1); } void kgeography::putAskWidget() { p_bigWidget -> setStretchFactor(p_askWidget, 1); p_askWidget -> show(); - connect(p_askWidget, SIGNAL(setZoomActionChecked(bool)), p_zoom, SLOT(setChecked(bool))); - connect(p_zoom, SIGNAL(toggled(bool)), p_askWidget, SLOT(setZoom(bool))); - connect(p_zoomOriginal, SIGNAL(activated()), p_askWidget, SLOT(setOriginalZoom())); - connect(p_askWidget, SIGNAL(setMoveActionEnabled(bool)), p_move, SLOT(setEnabled(bool))); - connect(p_askWidget, SIGNAL(setMoveActionChecked(bool)), p_move, SLOT(setChecked(bool))); - connect(p_move, SIGNAL(toggled(bool)), p_askWidget, SLOT(setMovement(bool))); - connect(p_askWidget, SIGNAL(questionsEnded()), this, SLOT(showResultsDialog())); + connect(p_askWidget, TQT_SIGNAL(setZoomActionChecked(bool)), p_zoom, TQT_SLOT(setChecked(bool))); + connect(p_zoom, TQT_SIGNAL(toggled(bool)), p_askWidget, TQT_SLOT(setZoom(bool))); + connect(p_zoomOriginal, TQT_SIGNAL(activated()), p_askWidget, TQT_SLOT(setOriginalZoom())); + connect(p_askWidget, TQT_SIGNAL(setMoveActionEnabled(bool)), p_move, TQT_SLOT(setEnabled(bool))); + connect(p_askWidget, TQT_SIGNAL(setMoveActionChecked(bool)), p_move, TQT_SLOT(setChecked(bool))); + connect(p_move, TQT_SIGNAL(toggled(bool)), p_askWidget, TQT_SLOT(setMovement(bool))); + connect(p_askWidget, TQT_SIGNAL(questionsEnded()), this, TQT_SLOT(showResultsDialog())); } void kgeography::setMap(KGmap *m) @@ -287,16 +287,16 @@ void kgeography::setMap(KGmap *m) delete p_map; p_map = m; - QString sw = i18n("There are two ways of dealing with the translation of \"Current map: %1\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Current map: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"Current map: %1\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Current map: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString mapName = i18n(p_map -> getFileName().utf8(), p_map -> getName().utf8()); - QString text = i18n("Current map:
%1
"); + TQString mapName = i18n(p_map -> getFileName().utf8(), p_map -> getName().utf8()); + TQString text = i18n("Current map:
%1
"); p_currentMap -> setText(text.arg(mapName)); } else { - QString s = QString("Current map:
%1
").arg(p_map -> getName()); + TQString s = TQString("Current map:
%1
").arg(p_map -> getName()); p_currentMap -> setText(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_consult -> setEnabled(true); @@ -324,8 +324,8 @@ void kgeography::showResultsDialog() { p_mustShowResultsDialog = false; int ca = p_askWidget -> correctAnswers(); - QString q = p_askWidget -> getQuestionHook(); - QValueVector ua = p_askWidget -> userAnswers(); + TQString q = p_askWidget -> getQuestionHook(); + TQValueVector ua = p_askWidget -> userAnswers(); consult(); diff --git a/kgeography/src/kgeography.h b/kgeography/src/kgeography.h index 86e79cc5..008b36ba 100644 --- a/kgeography/src/kgeography.h +++ b/kgeography/src/kgeography.h @@ -32,7 +32,7 @@ Q_OBJECT ~kgeography(); protected: - void showEvent(QShowEvent *e); + void showEvent(TQShowEvent *e); private slots: void openMap(); @@ -48,14 +48,14 @@ Q_OBJECT void showResultsDialog(); private: - QSize getPreferredSize(); + TQSize getPreferredSize(); void putAskWidget(); void removeOldAskWidget(); void setMap(KGmap *m); - QHBox *p_bigWidget; - QVBox *p_underLeftWidget; + TQHBox *p_bigWidget; + TQVBox *p_underLeftWidget; KPushButton *p_consult; KPushButton *p_askCapitalDivisions; @@ -65,7 +65,7 @@ Q_OBJECT KPushButton *p_askDivisionFlags; KToggleAction *p_zoom, *p_move; KAction *p_zoomOriginal; - QLabel *p_currentMap; + TQLabel *p_currentMap; KGmap *p_map; askWidget *p_askWidget; diff --git a/kgeography/src/map.cpp b/kgeography/src/map.cpp index be681191..9cef054f 100644 --- a/kgeography/src/map.cpp +++ b/kgeography/src/map.cpp @@ -13,8 +13,8 @@ #include #include -#include -#include +#include +#include #include "division.h" #include "map.h" @@ -26,7 +26,7 @@ KGmap::KGmap() KGmap::~KGmap() { - QMap::iterator it; + TQMap::iterator it; it = p_colorMap.begin(); while (it != p_colorMap.end()) { @@ -51,27 +51,27 @@ bool KGmap::addDivision(division *c) return b; } -void KGmap::setFile(const QString &s) +void KGmap::setFile(const TQString &s) { p_file = s; } -bool KGmap::setMapFile(const QString &s) +bool KGmap::setMapFile(const TQString &s) { p_mapFile = s; - return QFile::exists(s); + return TQFile::exists(s); } -void KGmap::setName(const QString &s) +void KGmap::setName(const TQString &s) { p_name = s; } uint KGmap::count(bool clickDivisionMode) const { - QValueList aux = p_nameMap.values(); - QValueList::const_iterator it = aux.begin(); - QValueList::const_iterator end = aux.end(); + TQValueList aux = p_nameMap.values(); + TQValueList::const_iterator it = aux.begin(); + TQValueList::const_iterator end = aux.end(); uint count = 0; for( ; it != end; ++it) { @@ -85,50 +85,50 @@ bool KGmap::hasAllFlags() const return p_hasAllFlags; } -QString KGmap::getDivisionFlagFile(const QString &s) const +TQString KGmap::getDivisionFlagFile(const TQString &s) const { return p_nameMap[s] -> getFlagFile(); } -QString KGmap::getDivisionCapital(const QString &s) const +TQString KGmap::getDivisionCapital(const TQString &s) const { return p_nameMap[s] -> getCapital(); } -QString KGmap::getFile() const +TQString KGmap::getFile() const { return p_file; } -QString KGmap::getFileName() const +TQString KGmap::getFileName() const { - QFileInfo fi(p_file); + TQFileInfo fi(p_file); return fi.fileName(); } -QString KGmap::getMapFile() const +TQString KGmap::getMapFile() const { return p_mapFile; } -QString KGmap::getName() const +TQString KGmap::getName() const { return p_name; } -QString KGmap::getRandomDivision(bool clickDivisionMode) const +TQString KGmap::getRandomDivision(bool clickDivisionMode) const { - QValueList aux; + TQValueList aux; int i = (int)((float)p_nameMap.size() * kapp -> random() / (RAND_MAX + 1.0)); aux = p_nameMap.values(); if (!aux[i] -> canAsk(clickDivisionMode)) return getRandomDivision(clickDivisionMode); else return aux[i] -> getName(); } -QString KGmap::getWhatIs(QRgb c, bool all) const +TQString KGmap::getWhatIs(QRgb c, bool all) const { // this is only asked from mapasker.cpp hence the true in canAsk - QMap::const_iterator it; + TQMap::const_iterator it; it = p_colorMap.find(c); if (it == p_colorMap.end()) return "nothing"; else @@ -139,10 +139,10 @@ QString KGmap::getWhatIs(QRgb c, bool all) const } } -QColor KGmap::getColor(const QString &s) const +TQColor KGmap::getColor(const TQString &s) const { - QValueList divisions; - QValueList colors; + TQValueList divisions; + TQValueList colors; division *d; int i; @@ -152,5 +152,5 @@ QColor KGmap::getColor(const QString &s) const i = 0; while(divisions[i] != d) i++; - return QColor(colors[i]); + return TQColor(colors[i]); } diff --git a/kgeography/src/map.h b/kgeography/src/map.h index 0eb08f53..7f606320 100644 --- a/kgeography/src/map.h +++ b/kgeography/src/map.h @@ -11,8 +11,8 @@ #ifndef MAP_H #define MAP_H -#include -#include +#include +#include class division; @@ -24,28 +24,28 @@ class KGmap bool addDivision(division *d); - void setFile(const QString &s); - bool setMapFile(const QString &s); - void setName(const QString &s); + void setFile(const TQString &s); + bool setMapFile(const TQString &s); + void setName(const TQString &s); // return the number of askable divisions uint count(bool clickDivisionMode) const; bool hasAllFlags() const; - QString getDivisionFlagFile(const QString &s) const; - QString getDivisionCapital(const QString &s) const; - QString getFile() const; - QString getFileName() const; - QString getMapFile() const; - QString getName() const; - QString getRandomDivision(bool clickDivisionMode) const; - QString getWhatIs(QRgb c, bool all) const; - QColor getColor(const QString &s) const; + TQString getDivisionFlagFile(const TQString &s) const; + TQString getDivisionCapital(const TQString &s) const; + TQString getFile() const; + TQString getFileName() const; + TQString getMapFile() const; + TQString getName() const; + TQString getRandomDivision(bool clickDivisionMode) const; + TQString getWhatIs(QRgb c, bool all) const; + TQColor getColor(const TQString &s) const; private: - QMap p_colorMap; - QMap p_nameMap; + TQMap p_colorMap; + TQMap p_nameMap; - QString p_name, p_file, p_mapFile; + TQString p_name, p_file, p_mapFile; bool p_hasAllFlags; }; diff --git a/kgeography/src/mapasker.cpp b/kgeography/src/mapasker.cpp index aca0b379..27c7c83d 100644 --- a/kgeography/src/mapasker.cpp +++ b/kgeography/src/mapasker.cpp @@ -11,25 +11,25 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "map.h" #include "mapasker.h" #include "mapwidget.h" -mapAsker::mapAsker(QWidget *parent, KGmap *m, QWidget *w, bool asker, uint count) : askWidget(parent, m, w, count, asker), p_popupManager(this), p_asker(asker), p_firstShow(true) +mapAsker::mapAsker(TQWidget *parent, KGmap *m, TQWidget *w, bool asker, uint count) : askWidget(parent, m, w, count, asker), p_popupManager(this), p_asker(asker), p_firstShow(true) { - QGridLayout *lay = new QGridLayout(this, 2, 2); + TQGridLayout *lay = new TQGridLayout(this, 2, 2); p_mapWidget = new mapWidget(this); lay -> addWidget(p_mapWidget, 0, 0); - p_hsb = new QScrollBar(Horizontal, this); + p_hsb = new TQScrollBar(Horizontal, this); lay -> addWidget(p_hsb, 1, 0); - p_vsb = new QScrollBar(Vertical, this); + p_vsb = new TQScrollBar(Vertical, this); lay -> addWidget(p_vsb, 0, 1); lay -> setRowStretch(2, 1); @@ -37,24 +37,24 @@ mapAsker::mapAsker(QWidget *parent, KGmap *m, QWidget *w, bool asker, uint count p_shouldClearPopup = false; - connect(p_mapWidget, SIGNAL(clicked(QRgb, const QPoint&)), this, SLOT(handleMapClick(QRgb, const QPoint&))); - connect(p_mapWidget, SIGNAL(setMoveActionChecked(bool)), this, SIGNAL(setMoveActionChecked(bool))); - connect(p_mapWidget, SIGNAL(setZoomActionChecked(bool)), this, SIGNAL(setZoomActionChecked(bool))); - connect(p_mapWidget, SIGNAL(setMoveActionEnabled(bool)), this, SIGNAL(setMoveActionEnabled(bool))); - connect(p_mapWidget, SIGNAL(setMoveActionEnabled(bool)), this, SLOT(showScrollBars(bool))); - connect(p_mapWidget, SIGNAL(updatePosition(int, int)), this, SLOT(setScrollBarsPosition(int, int))); - connect(p_mapWidget, SIGNAL(updateVisibleSize(int, int)), this, SLOT(setScrollBarsVisibleSize(int, int))); - connect(p_mapWidget, SIGNAL(updateMaximumSize(int, int)), this, SLOT(setScrollBarsMaximumSize(int, int))); + connect(p_mapWidget, TQT_SIGNAL(clicked(QRgb, const TQPoint&)), this, TQT_SLOT(handleMapClick(QRgb, const TQPoint&))); + connect(p_mapWidget, TQT_SIGNAL(setMoveActionChecked(bool)), this, TQT_SIGNAL(setMoveActionChecked(bool))); + connect(p_mapWidget, TQT_SIGNAL(setZoomActionChecked(bool)), this, TQT_SIGNAL(setZoomActionChecked(bool))); + connect(p_mapWidget, TQT_SIGNAL(setMoveActionEnabled(bool)), this, TQT_SIGNAL(setMoveActionEnabled(bool))); + connect(p_mapWidget, TQT_SIGNAL(setMoveActionEnabled(bool)), this, TQT_SLOT(showScrollBars(bool))); + connect(p_mapWidget, TQT_SIGNAL(updatePosition(int, int)), this, TQT_SLOT(setScrollBarsPosition(int, int))); + connect(p_mapWidget, TQT_SIGNAL(updateVisibleSize(int, int)), this, TQT_SLOT(setScrollBarsVisibleSize(int, int))); + connect(p_mapWidget, TQT_SIGNAL(updateMaximumSize(int, int)), this, TQT_SLOT(setScrollBarsMaximumSize(int, int))); - connect(p_hsb, SIGNAL(valueChanged(int)), p_mapWidget, SLOT(updateHPosition(int))); - connect(p_vsb, SIGNAL(valueChanged(int)), p_mapWidget, SLOT(updateVPosition(int))); + connect(p_hsb, TQT_SIGNAL(valueChanged(int)), p_mapWidget, TQT_SLOT(updateHPosition(int))); + connect(p_vsb, TQT_SIGNAL(valueChanged(int)), p_mapWidget, TQT_SLOT(updateVPosition(int))); if (asker) { - QBoxLayout *vbl = dynamic_cast(w -> layout()); - p_next = new QLabel(w); + TQBoxLayout *vbl = dynamic_cast(w -> layout()); + p_next = new TQLabel(w); p_next -> setAlignment(AlignTop | AlignHCenter); - p_fill = new QWidget(w); + p_fill = new TQWidget(w); p_fill -> show(); vbl -> setStretchFactor(p_fill, 1); nextQuestion(); @@ -77,7 +77,7 @@ bool mapAsker::isAsker() const return p_answers; } -void mapAsker::mousePressEvent(QMouseEvent*) +void mapAsker::mousePressEvent(TQMouseEvent*) { p_popupManager.clear(); } @@ -100,9 +100,9 @@ void mapAsker::setOriginalZoom() p_popupManager.clear(); } -void mapAsker::handleMapClick(QRgb c, const QPoint &p) +void mapAsker::handleMapClick(QRgb c, const TQPoint &p) { - QString aux, cap; + TQString aux, cap; aux = p_map -> getWhatIs(c, !p_asker); if (aux == "nothing") KMessageBox::error(this, i18n("You have found a bug in a map. Please contact the author and tell the %1 map has nothing associated to color %2,%3,%4.").arg(p_map -> getFile()).arg(qRed(c)).arg(qGreen(c)).arg(qBlue(c))); else if (p_shouldClearPopup) @@ -112,7 +112,7 @@ void mapAsker::handleMapClick(QRgb c, const QPoint &p) } else if (!p_asker) { - QString flagFile; + TQString flagFile; cap = p_map -> getDivisionCapital(aux); if (!cap.isEmpty()) { @@ -128,7 +128,7 @@ void mapAsker::handleMapClick(QRgb c, const QPoint &p) } else if (!aux.isEmpty()) { - p_currentAnswer.setAnswer(QColor(c)); + p_currentAnswer.setAnswer(TQColor(c)); questionAnswered(aux == lastDivisionAsked()); nextQuestion(); } @@ -168,18 +168,18 @@ void mapAsker::setScrollBarsMaximumSize(int w, int h) p_vsbms = h; } -void mapAsker::nextQuestionHook(const QString &division) +void mapAsker::nextQuestionHook(const TQString &division) { - QString sw = i18n("There are two ways of dealing with the translation of \"Please click on: %1\". The first option simply replaces %1 with the translated name of the relevant region/city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Please click on: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); + TQString sw = i18n("There are two ways of dealing with the translation of \"Please click on: %1\". The first option simply replaces %1 with the translated name of the relevant region/city. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Please click on: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { - QString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); - QString text = i18n("Please click on:\n%1"); + TQString divisionName = i18n(p_map -> getFileName().utf8(), division.utf8()); + TQString text = i18n("Please click on:\n%1"); p_next -> setText(text.arg(divisionName)); } else { - QString s = QString("Please click on:\n%1").arg(division); + TQString s = TQString("Please click on:\n%1").arg(division); p_next -> setText(i18n(p_map -> getFileName().utf8(), s.utf8())); } p_currentAnswer.setQuestion(i18n(p_map -> getFileName().utf8(), division.utf8())); @@ -187,12 +187,12 @@ void mapAsker::nextQuestionHook(const QString &division) p_currentAnswer.setCorrectAnswer(p_map -> getColor(division)); } -QString mapAsker::getQuestionHook() const +TQString mapAsker::getQuestionHook() const { return i18n("Division in Map"); } -void mapAsker::showEvent(QShowEvent *) +void mapAsker::showEvent(TQShowEvent *) { if (p_firstShow) { @@ -201,7 +201,7 @@ void mapAsker::showEvent(QShowEvent *) } } -QSize mapAsker::mapSize() const +TQSize mapAsker::mapSize() const { return p_mapWidget -> mapSize(); } diff --git a/kgeography/src/mapasker.h b/kgeography/src/mapasker.h index fbddae96..eba521b2 100644 --- a/kgeography/src/mapasker.h +++ b/kgeography/src/mapasker.h @@ -26,18 +26,18 @@ class mapAsker : public askWidget { Q_OBJECT public: - mapAsker(QWidget *parent, KGmap *m, QWidget *w, bool asker, uint count = 0); + mapAsker(TQWidget *parent, KGmap *m, TQWidget *w, bool asker, uint count = 0); ~mapAsker(); - QSize mapSize() const; + TQSize mapSize() const; bool isAsker() const; virtual bool isClickOnDivision() const { return true; } protected: - void nextQuestionHook(const QString &division); - void mousePressEvent(QMouseEvent *e); - QString getQuestionHook() const; - void showEvent(QShowEvent *e); + void nextQuestionHook(const TQString &division); + void mousePressEvent(TQMouseEvent *e); + TQString getQuestionHook() const; + void showEvent(TQShowEvent *e); public slots: void setMovement(bool b); @@ -45,16 +45,16 @@ Q_OBJECT void setOriginalZoom(); private slots: - void handleMapClick(QRgb c, const QPoint &p); + void handleMapClick(QRgb c, const TQPoint &p); void setScrollBarsPosition(int x, int y); void setScrollBarsVisibleSize(int w, int h); void setScrollBarsMaximumSize(int w, int h); void showScrollBars(bool b); private: - QLabel *p_next; - QWidget *p_fill; - QScrollBar *p_hsb, *p_vsb; + TQLabel *p_next; + TQWidget *p_fill; + TQScrollBar *p_hsb, *p_vsb; int p_hsbms, p_vsbms; //H and V maximum size for scrollbars infoWidget *p_infoWidget; diff --git a/kgeography/src/mapchooser.cpp b/kgeography/src/mapchooser.cpp index 57dcb1c9..11410d39 100644 --- a/kgeography/src/mapchooser.cpp +++ b/kgeography/src/mapchooser.cpp @@ -13,25 +13,25 @@ #include #include -#include -#include -#include +#include +#include +#include #include "mapchooser.h" -mapChooser::mapChooser(QWidget *parent) : KDialogBase(parent, 0, true, i18n("Choose Map to Use"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true) +mapChooser::mapChooser(TQWidget *parent) : KDialogBase(parent, 0, true, i18n("Choose Map to Use"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true) { - QHBox *mainHB; - QStringList list; + TQHBox *mainHB; + TQStringList list; KGmap *m; - QWidget *mapArea; - QGridLayout *mapLay; + TQWidget *mapArea; + TQGridLayout *mapLay; - mainHB = new QHBox(this); + mainHB = new TQHBox(this); mainHB -> setSpacing(KDialog::spacingHint()); list = KGlobal::dirs() -> findAllResources("appdata", "*.kgm"); - p_listBox = new QListBox(mainHB); - QStringList::iterator it; + p_listBox = new TQListBox(mainHB); + TQStringList::iterator it; for(it = list.begin(); it != list.end(); ++it) { if (!p_reader.parseMap(*it)) @@ -42,22 +42,22 @@ mapChooser::mapChooser(QWidget *parent) : KDialogBase(parent, 0, true, i18n("Cho else { m = p_reader.getMap(); - QString text = i18n(m -> getFileName().utf8(), m -> getName().utf8()); + TQString text = i18n(m -> getFileName().utf8(), m -> getName().utf8()); p_listBox -> insertItem(text); p_maps.insert(text, m); } } - mapArea = new QWidget(mainHB); + mapArea = new TQWidget(mainHB); mapArea -> setFixedSize(300, 225); - mapLay = new QGridLayout(mapArea, 3, 3); + mapLay = new TQGridLayout(mapArea, 3, 3); - p_image = new QWidget(mapArea); + p_image = new TQWidget(mapArea); mapLay -> addWidget(p_image, 1, 1); - connect(p_listBox, SIGNAL(highlighted(const QString&)), this, SLOT(putImage(const QString&))); - connect(p_listBox, SIGNAL(selected(int)), this, SLOT(slotOk())); + connect(p_listBox, TQT_SIGNAL(highlighted(const TQString&)), this, TQT_SLOT(putImage(const TQString&))); + connect(p_listBox, TQT_SIGNAL(selected(int)), this, TQT_SLOT(slotOk())); setMainWidget(mainHB); @@ -80,12 +80,12 @@ KGmap *mapChooser::getMap() return m; } -void mapChooser::putImage(const QString &mapName) +void mapChooser::putImage(const TQString &mapName) { KGmap *m; m = p_maps[mapName]; - QImage image(m -> getMapFile()); - image = image.smoothScale(300, 225, QImage::ScaleMin); + TQImage image(m -> getMapFile()); + image = image.smoothScale(300, 225, TQImage::ScaleMin); p_image -> setPaletteBackgroundPixmap(image); p_image -> setFixedSize(image.size()); } diff --git a/kgeography/src/mapchooser.h b/kgeography/src/mapchooser.h index 8fc5be08..a95d16ba 100644 --- a/kgeography/src/mapchooser.h +++ b/kgeography/src/mapchooser.h @@ -13,7 +13,7 @@ #include -#include +#include #include "map.h" #include "mapparser.h" @@ -22,19 +22,19 @@ class mapChooser : public KDialogBase { Q_OBJECT public: - mapChooser(QWidget *parent); + mapChooser(TQWidget *parent); ~mapChooser(); KGmap *getMap(); private slots: - void putImage(const QString &mapName); + void putImage(const TQString &mapName); private: - QListBox *p_listBox; - QWidget *p_image; + TQListBox *p_listBox; + TQWidget *p_image; mapReader p_reader; - QDict p_maps; + TQDict p_maps; }; #endif diff --git a/kgeography/src/mapparser.cpp b/kgeography/src/mapparser.cpp index 97ca5306..8a4cf200 100644 --- a/kgeography/src/mapparser.cpp +++ b/kgeography/src/mapparser.cpp @@ -16,21 +16,21 @@ /* unitReader */ -mapReader::mapReader() : QXmlSimpleReader() +mapReader::mapReader() : TQXmlSimpleReader() { } -bool mapReader::parseMap(const QString &path) +bool mapReader::parseMap(const TQString &path) { - QString aux; + TQString aux; p_map = new KGmap(); p_map -> setFile(path); aux = path.left(path.findRev('/') + 1); // aux = path but without the file name mapParser handler(p_map, aux); - QFile xmlFile(path); + TQFile xmlFile(path); if (xmlFile.exists()) { - QXmlInputSource source(&xmlFile); + TQXmlInputSource source(&xmlFile); setContentHandler(&handler); if (parse(source)) return true; p_error = handler.errorString(); @@ -42,7 +42,7 @@ bool mapReader::parseMap(const QString &path) return false; } -QString mapReader::getError() +TQString mapReader::getError() { return p_error; } @@ -54,7 +54,7 @@ KGmap *mapReader::getMap() /* mapParser */ -mapParser::mapParser(KGmap *m, const QString &path) : QXmlDefaultHandler(), p_map(m), p_path(path) +mapParser::mapParser(KGmap *m, const TQString &path) : TQXmlDefaultHandler(), p_map(m), p_path(path) { } @@ -65,9 +65,9 @@ bool mapParser::startDocument() return true; } -bool mapParser::startElement(const QString&, const QString &name, const QString&, const QXmlAttributes&) +bool mapParser::startElement(const TQString&, const TQString &name, const TQString&, const TQXmlAttributes&) { - QString prev; + TQString prev; bool b = true; prev = getPreviousTag(); p_previousTags += ":" + name; @@ -131,9 +131,9 @@ bool mapParser::startElement(const QString&, const QString &name, const QString& return b; } -bool mapParser::endElement(const QString &, const QString &, const QString &) +bool mapParser::endElement(const TQString &, const TQString &, const TQString &) { - QString aux; + TQString aux; bool b; aux = getPreviousTag(); b = true; @@ -231,13 +231,13 @@ bool mapParser::endElement(const QString &, const QString &, const QString &) } else b = false; removeLastTag(); - p_contents = QString::null; + p_contents = TQString::null; return b; } -bool mapParser::characters(const QString &ch) +bool mapParser::characters(const TQString &ch) { - QString aux; + TQString aux; if (ch.simplifyWhiteSpace().length() == 0) return true; aux = getPreviousTag(); if (aux == "mapFile" || aux == "name" || aux == "red" || aux == "green" || aux == "blue" || aux == "ignore" || aux == "flag" || aux == "capital") @@ -251,7 +251,7 @@ bool mapParser::characters(const QString &ch) bool mapParser::endDocument() { - QString aux; + TQString aux; if (p_mapNameSet && p_mapFileSet) { return true; @@ -262,13 +262,13 @@ bool mapParser::endDocument() return false; } -QString mapParser::errorString() +TQString mapParser::errorString() { if (!p_error.isEmpty()) return p_error; return i18n("The XML document is malformed."); } -QString mapParser::getPreviousTag() const +TQString mapParser::getPreviousTag() const { return p_previousTags.right(p_previousTags.length() - p_previousTags.findRev(':') - 1); } diff --git a/kgeography/src/mapparser.h b/kgeography/src/mapparser.h index af3d6d1f..9db844ae 100644 --- a/kgeography/src/mapparser.h +++ b/kgeography/src/mapparser.h @@ -11,7 +11,7 @@ #ifndef MAPPARSER_H #define MAPPARSER_H -#include +#include class division; class KGmap; @@ -21,28 +21,28 @@ class mapReader : public QXmlSimpleReader public: mapReader(); - bool parseMap(const QString &path); - QString getError(); + bool parseMap(const TQString &path); + TQString getError(); KGmap *getMap(); private: - QString p_error; + TQString p_error; KGmap *p_map; }; class mapParser : public QXmlDefaultHandler { public: - mapParser(KGmap *m, const QString &path); + mapParser(KGmap *m, const TQString &path); bool startDocument(); - bool startElement(const QString&, const QString&, const QString&, const QXmlAttributes&); - bool endElement(const QString &, const QString &name, const QString &); - bool characters(const QString &ch); + bool startElement(const TQString&, const TQString&, const TQString&, const TQXmlAttributes&); + bool endElement(const TQString &, const TQString &name, const TQString &); + bool characters(const TQString &ch); bool endDocument(); - QString errorString(); + TQString errorString(); private: - QString getPreviousTag() const; + TQString getPreviousTag() const; void removeLastTag(); division *p_division; @@ -50,8 +50,8 @@ class mapParser : public QXmlDefaultHandler KGmap *p_map; bool p_allowChars, p_mapNameSet, p_mapFileSet; bool p_divisionNameSet, p_colorSet, p_divisionIgnoreSet, p_flagFileSet, p_capitalSet; - const QString &p_path; - QString p_error, p_contents, p_previousTags; + const TQString &p_path; + TQString p_error, p_contents, p_previousTags; }; #endif diff --git a/kgeography/src/mapwidget.cpp b/kgeography/src/mapwidget.cpp index 754179ef..f551940f 100644 --- a/kgeography/src/mapwidget.cpp +++ b/kgeography/src/mapwidget.cpp @@ -14,12 +14,12 @@ #include #include -#include -#include +#include +#include #include "mapwidget.h" -mapWidget::mapWidget(QWidget *parent) : QWidget(parent) +mapWidget::mapWidget(TQWidget *parent) : TQWidget(parent) { p_wantZoom = false; p_zooming = false; @@ -32,7 +32,7 @@ mapWidget::mapWidget(QWidget *parent) : QWidget(parent) p_scrollBarsVisible = 0; } -void mapWidget::init(const QString &path, int scrollBarWidth, int scrollBarHeight) +void mapWidget::init(const TQString &path, int scrollBarWidth, int scrollBarHeight) { p_scrollBarWidth = scrollBarWidth; p_scrollBarHeight = scrollBarHeight; @@ -61,7 +61,7 @@ void mapWidget::setMapZoom(bool b) } } -QSize mapWidget::sizeHint() const +TQSize mapWidget::sizeHint() const { return maximumSize(); } @@ -78,7 +78,7 @@ void mapWidget::updateVPosition(int value) updateShownImage(); } -void mapWidget::mousePressEvent(QMouseEvent *e) +void mapWidget::mousePressEvent(TQMouseEvent *e) { if (e -> button() == Qt::LeftButton) { @@ -97,7 +97,7 @@ void mapWidget::mousePressEvent(QMouseEvent *e) else { QRgb rgb; - QImage *currentImage; + TQImage *currentImage; currentImage = getCurrentImage(); @@ -115,19 +115,19 @@ void mapWidget::mousePressEvent(QMouseEvent *e) } } -void mapWidget::mouseMoveEvent(QMouseEvent *e) +void mapWidget::mouseMoveEvent(TQMouseEvent *e) { if (p_zooming) { - QPainter p(this); + TQPainter p(this); p.setRasterOp(Qt::XorROP); - p.setPen(QPen(Qt::white, 1, Qt::DotLine)); + p.setPen(TQPen(Qt::white, 1, Qt::DotLine)); // remove previous rectangle - p.drawRect(QRect(p_initial, p_prev)); + p.drawRect(TQRect(p_initial, p_prev)); // put new rectangle - p.drawRect(QRect(p_initial, e -> pos())); + p.drawRect(TQRect(p_initial, e -> pos())); p_prev = e -> pos(); } @@ -169,15 +169,15 @@ void mapWidget::mouseMoveEvent(QMouseEvent *e) } } -void mapWidget::mouseReleaseEvent(QMouseEvent *e) +void mapWidget::mouseReleaseEvent(TQMouseEvent *e) { if (p_zooming) { - QPainter p(this); - QRect r(p_initial, e -> pos()); + TQPainter p(this); + TQRect r(p_initial, e -> pos()); p.setRasterOp(Qt::XorROP); - p.setPen(QPen(Qt::white, 1, Qt::DotLine)); + p.setPen(TQPen(Qt::white, 1, Qt::DotLine)); // remove previous rectangle p.drawRect(r); @@ -234,7 +234,7 @@ void mapWidget::mouseReleaseEvent(QMouseEvent *e) } } -void mapWidget::resizeEvent(QResizeEvent *e) +void mapWidget::resizeEvent(TQResizeEvent *e) { if (p_originalImage.isNull()) return; @@ -271,7 +271,7 @@ void mapWidget::emitMoveActionEnabled() } } -QImage *mapWidget::getCurrentImage() +TQImage *mapWidget::getCurrentImage() { if (p_zoomedImageShown.isNull()) return &p_originalImage; else return &p_zoomedImageShown; @@ -281,7 +281,7 @@ void mapWidget::setOriginalImage() { setPaletteBackgroundPixmap(p_originalImage); erase(); - p_zoomedImageShown = QImage(); + p_zoomedImageShown = TQImage(); p_lastFactorX = 1; p_lastFactorY = 1; p_zoomX = 0; @@ -324,7 +324,7 @@ void mapWidget::updateShownImage() } } -QSize mapWidget::mapSize() const +TQSize mapWidget::mapSize() const { return p_originalImage.size(); } diff --git a/kgeography/src/mapwidget.h b/kgeography/src/mapwidget.h index 282fa1b4..1bc37cb3 100644 --- a/kgeography/src/mapwidget.h +++ b/kgeography/src/mapwidget.h @@ -11,23 +11,23 @@ #ifndef MAPWIDGET_H #define MAPWIDGET_H -#include -#include -#include +#include +#include +#include class mapWidget : public QWidget { Q_OBJECT public: - mapWidget(QWidget *parent); + mapWidget(TQWidget *parent); - void init(const QString &path, int scrollBarWidth, int scrollBarHeight); + void init(const TQString &path, int scrollBarWidth, int scrollBarHeight); void setMapMove(bool b); void setMapZoom(bool b); - QSize sizeHint() const; - QSize mapSize() const; + TQSize sizeHint() const; + TQSize mapSize() const; public slots: void updateHPosition(int value); @@ -38,29 +38,29 @@ Q_OBJECT void setMoveActionChecked(bool b); void setZoomActionChecked(bool b); void setMoveActionEnabled(bool b); - void clicked(QRgb, const QPoint&); + void clicked(QRgb, const TQPoint&); void updatePosition(int X, int Y); void updateVisibleSize(int w, int h); void updateMaximumSize(int w, int h); protected: - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void resizeEvent(QResizeEvent *e); + void mousePressEvent(TQMouseEvent *e); + void mouseMoveEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + void resizeEvent(TQResizeEvent *e); private: void emitMoveActionEnabled(); - QImage *getCurrentImage(); + TQImage *getCurrentImage(); void updateShownImage(); - QImage p_originalImage, p_zoomedImageShown; + TQImage p_originalImage, p_zoomedImageShown; bool p_zooming, p_wantZoom, p_moving, p_wantMove; - QPoint p_initial, p_prev; // rubberbanding and moving + TQPoint p_initial, p_prev; // rubberbanding and moving int p_zoomX, p_zoomY, p_zoomW, p_zoomH; double p_lastFactorX, p_lastFactorY; // useful to not do that many updateShownImage - QSize p_oldSize; + TQSize p_oldSize; int p_oldZoomX, p_oldZoomY, p_oldZoomW, p_oldZoomH; int p_scrollBarWidth, p_scrollBarHeight; bool p_scrollBarsVisible; diff --git a/kgeography/src/mypopup.cpp b/kgeography/src/mypopup.cpp index c7dede67..b9f1c78e 100644 --- a/kgeography/src/mypopup.cpp +++ b/kgeography/src/mypopup.cpp @@ -8,57 +8,57 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include "mypopup.h" -myPopup::myPopup(QWidget *parent, const QString &text, const QString &text2, const QString &flagFile) : QFrame(parent) +myPopup::myPopup(TQWidget *parent, const TQString &text, const TQString &text2, const TQString &flagFile) : TQFrame(parent) { - QHBoxLayout *lay = new QHBoxLayout(this); + TQHBoxLayout *lay = new TQHBoxLayout(this); lay -> setMargin(4); lay -> setSpacing(4); - QWidget *vbox = new QWidget(this); + TQWidget *vbox = new TQWidget(this); lay -> addWidget(vbox); - QVBoxLayout *vboxLayout = new QVBoxLayout(vbox); + TQVBoxLayout *vboxLayout = new TQVBoxLayout(vbox); vboxLayout -> setMargin(0); vboxLayout -> setSpacing(0); - QLabel *l = new QLabel(text, vbox); + TQLabel *l = new TQLabel(text, vbox); vboxLayout -> addWidget(l); if (!text2.isNull()) { - QLabel *l2 = new QLabel(text2, vbox); + TQLabel *l2 = new TQLabel(text2, vbox); l2 -> setAlignment(Qt::AlignCenter); vboxLayout -> addWidget(l2); } if (!flagFile.isNull()) { - QLabel *flag = new QLabel(this); + TQLabel *flag = new TQLabel(this); lay -> addWidget(flag); - QImage flagImg(flagFile); + TQImage flagImg(flagFile); flag -> setPixmap(flagImg.smoothScale(flagImg.width() / 5, flagImg. height() / 5)); flag -> setAlignment(Qt::AlignCenter); } l -> setAlignment(Qt::AlignCenter); - QFont f = l -> font(); + TQFont f = l -> font(); f.setBold(true); l -> setFont(f); - setFrameStyle(QFrame::Box | QFrame::Plain); + setFrameStyle(TQFrame::Box | TQFrame::Plain); setLineWidth(2); setFixedSize(sizeHint()); } -void myPopup::mousePressEvent(QMouseEvent *) +void myPopup::mousePressEvent(TQMouseEvent *) { emit deleteMe(); } diff --git a/kgeography/src/mypopup.h b/kgeography/src/mypopup.h index 3b0dd421..c768a308 100644 --- a/kgeography/src/mypopup.h +++ b/kgeography/src/mypopup.h @@ -11,7 +11,7 @@ #ifndef MYPOPUP_H #define MYPOPUP_H -#include +#include class myPopup : public QFrame { @@ -19,13 +19,13 @@ Q_OBJECT friend class popupManager; private: - myPopup(QWidget *parent, const QString &text, const QString &text2 = QString::null, const QString &flagFile = QString::null); + myPopup(TQWidget *parent, const TQString &text, const TQString &text2 = TQString::null, const TQString &flagFile = TQString::null); signals: void deleteMe(); protected: - void mousePressEvent(QMouseEvent *); + void mousePressEvent(TQMouseEvent *); }; #endif diff --git a/kgeography/src/popupmanager.cpp b/kgeography/src/popupmanager.cpp index 4b19d4d5..1a457f81 100644 --- a/kgeography/src/popupmanager.cpp +++ b/kgeography/src/popupmanager.cpp @@ -11,13 +11,13 @@ #include "mypopup.h" #include "popupmanager.h" -popupManager::popupManager(QWidget *parent) +popupManager::popupManager(TQWidget *parent) { p_parent = parent; p_mp = 0; } -void popupManager::show(const QString &text, const QString &text2, const QPoint &p, const QString &flagFile) +void popupManager::show(const TQString &text, const TQString &text2, const TQPoint &p, const TQString &flagFile) { delete p_mp; @@ -25,7 +25,7 @@ void popupManager::show(const QString &text, const QString &text2, const QPoint init(p); } -void popupManager::show(const QString &text, const QString &text2, const QPoint &p) +void popupManager::show(const TQString &text, const TQString &text2, const TQPoint &p) { delete p_mp; @@ -33,7 +33,7 @@ void popupManager::show(const QString &text, const QString &text2, const QPoint init(p); } -void popupManager::show(const QString &text, const QPoint &p) +void popupManager::show(const TQString &text, const TQPoint &p) { delete p_mp; @@ -50,7 +50,7 @@ void popupManager::clear() } } -void popupManager::init(const QPoint &p) +void popupManager::init(const TQPoint &p) { int x, y, maxX, maxY; maxX = p_parent -> width() - p_mp -> width(); @@ -61,7 +61,7 @@ void popupManager::init(const QPoint &p) else y = maxY; p_mp -> move(x, y); p_mp -> show(); - connect(p_mp, SIGNAL(deleteMe()), this, SLOT(clear())); + connect(p_mp, TQT_SIGNAL(deleteMe()), this, TQT_SLOT(clear())); } #include "popupmanager.moc" diff --git a/kgeography/src/popupmanager.h b/kgeography/src/popupmanager.h index 8fdfeef7..b66d574d 100644 --- a/kgeography/src/popupmanager.h +++ b/kgeography/src/popupmanager.h @@ -11,7 +11,7 @@ #ifndef POPUPMANAGER_H #define POPUPMANAGER_H -#include +#include class QWidget; @@ -21,25 +21,25 @@ class popupManager : public QObject { Q_OBJECT public: - popupManager(QWidget *parent); + popupManager(TQWidget *parent); // shows text at p and the flag - void show(const QString &text, const QString &text2, const QPoint &p, const QString &flagFile); + void show(const TQString &text, const TQString &text2, const TQPoint &p, const TQString &flagFile); // shows text at p - void show(const QString &text, const QString &text2, const QPoint &p); + void show(const TQString &text, const TQString &text2, const TQPoint &p); // shows text at p - void show(const QString &text, const QPoint &p); + void show(const TQString &text, const TQPoint &p); public slots: void clear(); private: - void init(const QPoint &p); + void init(const TQPoint &p); myPopup *p_mp; - QWidget *p_parent; + TQWidget *p_parent; }; #endif diff --git a/kgeography/src/script.cpp b/kgeography/src/script.cpp index b23d31d0..bae8e3c8 100644 --- a/kgeography/src/script.cpp +++ b/kgeography/src/script.cpp @@ -10,10 +10,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include int main(int argc, char *argv[]) { @@ -23,26 +23,26 @@ int main(int argc, char *argv[]) return 1; } - QDir d(argv[1], "*.kgm"); + TQDir d(argv[1], "*.kgm"); if (!d.exists()) return 2; - QFile *output = new QFile(argv[2]); + TQFile *output = new TQFile(argv[2]); output->open(IO_WriteOnly | IO_Truncate); - QTextStream os(output); - os.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream os(output); + os.setEncoding(TQTextStream::UnicodeUTF8); - QStringList files = d.entryList(); - QStringList::const_iterator it; - QDomDocument dd; + TQStringList files = d.entryList(); + TQStringList::const_iterator it; + TQDomDocument dd; for (it = files.begin(); it != files.end(); ++it) { - QFile *f = new QFile(d.absPath() + "/" + *it); + TQFile *f = new TQFile(d.absPath() + "/" + *it); f -> open(IO_ReadOnly); dd.setContent(f); - QDomNode n, n2, n3, n4, n5; - QDomNodeList nodes = dd.firstChild().childNodes(); + TQDomNode n, n2, n3, n4, n5; + TQDomNodeList nodes = dd.firstChild().childNodes(); for (uint i = 0; i < nodes.count(); i++) { n = nodes.item(i); diff --git a/khangman/khangman/fontchecker.cpp b/khangman/khangman/fontchecker.cpp index 684afaaa..55e18601 100644 --- a/khangman/khangman/fontchecker.cpp +++ b/khangman/khangman/fontchecker.cpp @@ -7,16 +7,16 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include +#include +#include #include #include "fontchecker.h" -bool fontChecker::checkInstalled(const QFont &font, const QString &fontPath) +bool fontChecker::checkInstalled(const TQFont &font, const TQString &fontPath) { - QFontInfo fi(font); + TQFontInfo fi(font); // Works with Steve may need some tweaking to work with other fonts if (!fi.exactMatch()) { diff --git a/khangman/khangman/fontchecker.h b/khangman/khangman/fontchecker.h index b8b60b6f..a65c95e9 100644 --- a/khangman/khangman/fontchecker.h +++ b/khangman/khangman/fontchecker.h @@ -15,7 +15,7 @@ class QFont; class fontChecker { public: - static bool checkInstalled(const QFont &font, const QString &fontPath); + static bool checkInstalled(const TQFont &font, const TQString &fontPath); }; #endif diff --git a/khangman/khangman/khangman.cpp b/khangman/khangman/khangman.cpp index 05396587..0b14829e 100644 --- a/khangman/khangman/khangman.cpp +++ b/khangman/khangman/khangman.cpp @@ -26,10 +26,10 @@ #include "timer.h" #include "khnewstuff.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -74,30 +74,30 @@ KHangMan::~KHangMan() void KHangMan::setupActions() { // Game->New - KAction *action = new KAction(i18n("&New"), "filenew", CTRL+Key_N , m_view, SLOT(slotNewGame()), actionCollection(), "file_new"); + KAction *action = new KAction(i18n("&New"), "filenew", CTRL+Key_N , m_view, TQT_SLOT(slotNewGame()), actionCollection(), "file_new"); action->setToolTip(i18n( "Play with a new word" )); // Game->Get Words in New Language - new KAction( i18n("&Get Words in New Language..."), "knewstuff", CTRL+Key_G, this, SLOT( slotDownloadNewStuff() ), actionCollection(), "downloadnewstuff" ); + new KAction( i18n("&Get Words in New Language..."), "knewstuff", CTRL+Key_G, this, TQT_SLOT( slotDownloadNewStuff() ), actionCollection(), "downloadnewstuff" ); - KStdAction::quit(this, SLOT(slotQuit()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(slotQuit()), actionCollection()); m_levelAction = new KSelectAction(i18n("Le&vel"), 0, actionCollection(), "combo_level"); m_levelAction->setToolTip(i18n( "Choose the level" )); m_levelAction->setWhatsThis(i18n( "Choose the level of difficulty" )); - connect(m_levelAction, SIGNAL(activated(int)), this, SLOT(slotChangeLevel(int))); + connect(m_levelAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeLevel(int))); // Action for selecting language. m_languageAction = new KSelectAction(i18n("&Language"), 0, actionCollection(), "languages"); m_languageAction->setItems(m_languageNames); m_languageAction->setCurrentItem(m_languages.findIndex(Prefs::selectedLanguage())); - connect(m_languageAction, SIGNAL(activated(int)), this, SLOT(slotChangeLanguage(int))); + connect(m_languageAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeLanguage(int))); - KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(optionsPreferences()), actionCollection()); // Mode. Currently hard coded into Sea and Desert themes. - QStringList modes; - m_modeAction = new KSelectAction(i18n("L&ook"), 0, this, SLOT(slotChangeMode()), actionCollection(), "combo_mode"); + TQStringList modes; + m_modeAction = new KSelectAction(i18n("L&ook"), 0, this, TQT_SLOT(slotChangeMode()), actionCollection(), "combo_mode"); modes += i18n("&Sea Theme"); modes += i18n("&Desert Theme"); m_modeAction->setItems(modes); @@ -120,7 +120,7 @@ void KHangMan::setupStatusbar() // FIXME: Make this into a slot? -void KHangMan::changeStatusbar(const QString& text, int id) +void KHangMan::changeStatusbar(const TQString& text, int id) { statusBar()->changeItem(text, id); } @@ -191,11 +191,11 @@ void KHangMan::setLanguages() m_languageNames.clear(); m_sortedNames.clear(); //the program scans in khangman/data/ to see what languages data is found - QStringList mdirs = KGlobal::dirs()->findDirs("data", "khangman/data/"); + TQStringList mdirs = KGlobal::dirs()->findDirs("data", "khangman/data/"); if (mdirs.isEmpty()) return; - for (QStringList::Iterator it =mdirs.begin(); it !=mdirs.end(); ++it ) { - QDir dir(*it); - m_languages += dir.entryList(QDir::Dirs, QDir::Name); + for (TQStringList::Iterator it =mdirs.begin(); it !=mdirs.end(); ++it ) { + TQDir dir(*it); + m_languages += dir.entryList(TQDir::Dirs, TQDir::Name); m_languages.remove(m_languages.find(".")); m_languages.remove(m_languages.find("..")); } @@ -207,7 +207,7 @@ void KHangMan::setLanguages() return; //find duplicated entries in KDEDIR and KDEHOME - QStringList temp_languages; + TQStringList temp_languages; for (uint i=0; i1) { temp_languages.append(m_languages[i]); @@ -226,17 +226,17 @@ void KHangMan::setLanguages() KConfig *config=kapp->config(); config->setGroup("KNewStuffStatus"); for (uint i=0; ireadEntry(tmp)) - config->writeEntry(tmp, QDate::currentDate().toString(Qt::ISODate)); + config->writeEntry(tmp, TQDate::currentDate().toString(Qt::ISODate)); } // We look in $KDEDIR/share/locale/all_languages from // kdelibs/kdecore/all_languages to find the name of the country // corresponding to the code and the language the user set. KConfig entry(locate("locale", "all_languages")); - const QStringList::ConstIterator itEnd = m_languages.end(); - for (QStringList::Iterator it = m_languages.begin(); + const TQStringList::ConstIterator itEnd = m_languages.end(); + for (TQStringList::Iterator it = m_languages.begin(); it != m_languages.end(); ++it) { entry.setGroup(*it); if (*it == "sr") @@ -283,18 +283,18 @@ void KHangMan::setLevel() void KHangMan::loadLevels() { //build the Level combobox menu dynamically depending of the data for each language - levels.clear();//initialize QStringList levels + levels.clear();//initialize TQStringList levels KStandardDirs *dirs = KGlobal::dirs(); - QStringList mfiles = dirs->findAllResources("data","khangman/data/" + Prefs::selectedLanguage() + "/*.kvtml"); + TQStringList mfiles = dirs->findAllResources("data","khangman/data/" + Prefs::selectedLanguage() + "/*.kvtml"); bool levelBool = false; if (!mfiles.isEmpty()) { - for (QStringList::Iterator it = mfiles.begin(); it != mfiles.end(); ++it ) { - QFile f( *it); + for (TQStringList::Iterator it = mfiles.begin(); it != mfiles.end(); ++it ) { + TQFile f( *it); //find the last / in the file name int location = f.name().findRev("/"); //strip the string to keep only the filename and not the path - QString mString = f.name().right(f.name().length()-location-1); + TQString mString = f.name().right(f.name().length()-location-1); if (mString == Prefs::levelFile()) levelBool = true; mString = mString.left(mString.length()-6); @@ -307,7 +307,7 @@ void KHangMan::loadLevels() // Sort easy, medium, hard at bottom, with the other categories at the top levels.sort(); - QString replace[3] = { "Easy", "Medium", "Hard" }; + TQString replace[3] = { "Easy", "Medium", "Hard" }; for ( int i = 0; i < 3; ++i ) { if ( levels.findIndex( replace[i] ) > -1 ) @@ -318,10 +318,10 @@ void KHangMan::loadLevels() } //find duplicated entries in KDEDIR and KDEHOME - QString last; - for ( QStringList::Iterator it = levels.begin(); it != levels.end(); ) + TQString last; + for ( TQStringList::Iterator it = levels.begin(); it != levels.end(); ) { - QStringList::Iterator it2 = it++; + TQStringList::Iterator it2 = it++; if (*it2 == last) { // remove duplicate @@ -343,14 +343,14 @@ void KHangMan::loadLevels() currentLevel =0; Prefs::writeConfig(); } - QStringList translatedLevels; - for (QStringList::Iterator it = levels.begin(); it != levels.end(); ++it ) + TQStringList translatedLevels; + for (TQStringList::Iterator it = levels.begin(); it != levels.end(); ++it ) translatedLevels+=i18n((*it).utf8()); m_levelAction->setItems(translatedLevels); m_levelAction->setCurrentItem(Prefs::currentLevel()); setLevel(); - QString m_lstring = translatedLevels[currentLevel].utf8(); + TQString m_lstring = translatedLevels[currentLevel].utf8(); m_lstring.replace(0, 1, m_lstring.left(1).upper()); changeStatusbar(m_lstring, IDS_LEVEL); } @@ -380,7 +380,7 @@ void KHangMan::optionsPreferences() Timer *m_timer = new Timer(); dialog->addPage(m_timer, i18n("Timers"), "clock"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(updateSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateSettings())); dialog->show(); } @@ -420,13 +420,13 @@ void KHangMan::loadLangToolBar() m_allData.clear(); if (!m_noSpecialChars) { - QString myString=QString("khangman/%1.txt").arg(Prefs::selectedLanguage()); - QFile myFile; + TQString myString=TQString("khangman/%1.txt").arg(Prefs::selectedLanguage()); + TQFile myFile; myFile.setName(locate("data", myString)); // Let's look in local KDEHOME dir then if (!myFile.exists()) { - QString myString=QString("khangman/data/%1/%1.txt") + TQString myString=TQString("khangman/data/%1/%1.txt") .arg(Prefs::selectedLanguage()) .arg(Prefs::selectedLanguage()); myFile.setName(locate("data",myString)); @@ -434,7 +434,7 @@ void KHangMan::loadLangToolBar() } if (!myFile.exists()) { - QString mString=i18n("File $KDEDIR/share/apps/khangman/%1.txt not found;\n" + TQString mString=i18n("File $KDEDIR/share/apps/khangman/%1.txt not found;\n" "check your installation.").arg(Prefs::selectedLanguage()); KMessageBox::sorry( this, mString, i18n("Error") ); @@ -443,20 +443,20 @@ void KHangMan::loadLangToolBar() update(); // We open the file and store info into the stream... - QFile openFileStream(myFile.name()); + TQFile openFileStream(myFile.name()); openFileStream.open(IO_ReadOnly); - QTextStream readFileStr(&openFileStream); - readFileStr.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream readFileStr(&openFileStream); + readFileStr.setEncoding(TQTextStream::UnicodeUTF8); // m_allData contains all the words from the file // FIXME: Better name - m_allData = QStringList::split("\n", readFileStr.read(), true); + m_allData = TQStringList::split("\n", readFileStr.read(), true); openFileStream.close(); for (int i=0; i<(int) m_allData.count(); i++) secondToolbar->insertButton (charIcon(m_allData[i].at(0)), i, - SIGNAL( clicked() ), this, - SLOT( slotPasteChar()), true, + TQT_SIGNAL( clicked() ), this, + TQT_SLOT( slotPasteChar()), true, i18n("Inserts the character %1").arg(m_allData[i]), i+1 ); } @@ -477,34 +477,34 @@ void KHangMan::slotPasteChar() m_view->enterLetter(m_allData[charBut->id()]); } -QString KHangMan::charIcon(const QChar & c) +TQString KHangMan::charIcon(const TQChar & c) { ///Create a name and path for the icon - QString s = locateLocal("icon", "char" + QString::number(c.unicode()) + ".png"); + TQString s = locateLocal("icon", "char" + TQString::number(c.unicode()) + ".png"); - QRect r(4, 4, 120, 120); + TQRect r(4, 4, 120, 120); ///A font to draw the character with - QFont font; + TQFont font; font.setFamily( "Sans Serif" ); font.setPointSize(96); - font.setWeight(QFont::Normal); + font.setWeight(TQFont::Normal); ///Create the pixmap - QPixmap pm(128, 128); + TQPixmap pm(128, 128); pm.fill(Qt::white); - QPainter p(&pm); + TQPainter p(&pm); p.setFont(font); p.setPen(Qt::black); - p.drawText(r, Qt::AlignCenter, (QString) c); + p.drawText(r, Qt::AlignCenter, (TQString) c); ///Create transparency mask - QBitmap bm(128, 128); + TQBitmap bm(128, 128); bm.fill(Qt::color0); - QPainter b(&bm); + TQPainter b(&bm); b.setFont(font); b.setPen(Qt::color1); - b.drawText(r, Qt::AlignCenter, (QString) c); + b.drawText(r, Qt::AlignCenter, (TQString) c); ///Mask the pixmap pm.setMask(bm); diff --git a/khangman/khangman/khangman.h b/khangman/khangman/khangman.h index b7832db5..7c47711a 100644 --- a/khangman/khangman/khangman.h +++ b/khangman/khangman/khangman.h @@ -67,7 +67,7 @@ public: @param text the text that will be written in the statusbar @param id the label in which the text will be written */ - void changeStatusbar(const QString& text, int id); + void changeStatusbar(const TQString& text, int id); ///Action that sets up the Language menu KSelectAction *m_languageAction; @@ -76,9 +76,9 @@ public: void setLanguages(); ///Translated names of languages - QStringList m_languageNames; + TQStringList m_languageNames; ///Language codes of available languages - QStringList m_languages; + TQStringList m_languages; ///Display the correct messages in the statusbar void setMessages(); @@ -90,16 +90,16 @@ public: void setupStatusbar(); ///Selected language - QString selectedLanguage; + TQString selectedLanguage; ///Translated and sorted names of languages - QStringList m_sortedNames; + TQStringList m_sortedNames; ///the different data files in each language dir - QStringList levels; + TQStringList levels; ///Current level ID uint currentLevel; ///hold the current level - QString levelString; + TQString levelString; ///At start, restore settings from config file and apply them void loadSettings(); @@ -115,7 +115,7 @@ public: void loadLangToolBar(); ///Create a png image with the argument (special character) and return the path to this png image - QString charIcon(const QChar &); + TQString charIcon(const TQChar &); public slots: ///When the langugae is changed in the Language menu @@ -156,7 +156,7 @@ private: bool m_noSpecialChars; // Contains all the words that are read from the data file. - QStringList m_allData; + TQStringList m_allData; ///Instance of an advanced page of the config dialog advanced *mAdvanced; diff --git a/khangman/khangman/khangmanview.cpp b/khangman/khangman/khangmanview.cpp index f53a7f99..8fc5bcc5 100644 --- a/khangman/khangman/khangmanview.cpp +++ b/khangman/khangman/khangmanview.cpp @@ -25,15 +25,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //project headers #include "prefs.h" @@ -42,23 +42,23 @@ KHangManView::KHangManView(KHangMan*parent, const char *name) - : QWidget(parent, name, WStaticContents | WNoAutoErase) + : TQWidget(parent, name, WStaticContents | WNoAutoErase) { khangman = parent; // The widget for entering letters. m_letterInput = new KLineEdit( this, "charWrite" ); - m_letterInput->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType) 1, - (QSizePolicy::SizeType) 0, + m_letterInput->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType) 1, + (TQSizePolicy::SizeType) 0, 0, 0, m_letterInput->sizePolicy().hasHeightForWidth() ) ); m_letterInput->setMaxLength( 1 ); - m_letterInput->setAlignment( int( QLineEdit::AlignHCenter ) ); + m_letterInput->setAlignment( int( TQLineEdit::AlignHCenter ) ); // Press this button to enter a letter (or press enter) m_guessButton = new KPushButton( this, "guessButton" ); - m_guessButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType) 1, - (QSizePolicy::SizeType) 0, + m_guessButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType) 1, + (TQSizePolicy::SizeType) 0, 0, 0, m_guessButton->sizePolicy().hasHeightForWidth() ) ); m_guessButton->setAutoMask( true ); @@ -68,7 +68,7 @@ KHangManView::KHangManView(KHangMan*parent, const char *name) // Get background from config file - default is sea loadAnimation(); - setMinimumSize( QSize( 660, 370 ) ); + setMinimumSize( TQSize( 660, 370 ) ); setBackground( m_originalBackground ); // Some misc initializations. @@ -77,10 +77,10 @@ KHangManView::KHangManView(KHangMan*parent, const char *name) m_accentedLetters = true; m_hintExists = true; // Assume hint exists - connect( m_letterInput, SIGNAL( returnPressed() ), - this, SLOT( slotTry() ) ); - connect( m_guessButton, SIGNAL( clicked() ), - this, SLOT( slotTry() )); + connect( m_letterInput, TQT_SIGNAL( returnPressed() ), + this, TQT_SLOT( slotTry() ) ); + connect( m_guessButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotTry() )); } @@ -92,7 +92,7 @@ KHangManView::~KHangManView() // Handle a guess of the letter in sChar. // -void KHangManView::replaceLetters(const QString& sChar) +void KHangManView::replaceLetters(const TQString& sChar) { int index = 0; bool b_end = false; @@ -131,17 +131,17 @@ void KHangManView::replaceLetters(const QString& sChar) } if (m_accentedLetters && !Prefs::accentedLetters()) { - if (sChar=="i") replaceLetters(QString::fromUtf8("í")); - if (sChar=="a") replaceLetters(QString::fromUtf8("à")); - if (sChar=="a") replaceLetters(QString::fromUtf8("á")); - if (sChar=="a") replaceLetters(QString::fromUtf8("ã")); - if (sChar=="u") replaceLetters(QString::fromUtf8("ü")); - if (sChar=="o") replaceLetters(QString::fromUtf8("ò")); - if (sChar=="o") replaceLetters(QString::fromUtf8("ó")); - if (sChar=="o") replaceLetters(QString::fromUtf8("õ")); - if (sChar=="e") replaceLetters(QString::fromUtf8("è")); - if (sChar=="e") replaceLetters(QString::fromUtf8("é")); - if (sChar=="u") replaceLetters(QString::fromUtf8("ù")); + if (sChar=="i") replaceLetters(TQString::fromUtf8("í")); + if (sChar=="a") replaceLetters(TQString::fromUtf8("à")); + if (sChar=="a") replaceLetters(TQString::fromUtf8("á")); + if (sChar=="a") replaceLetters(TQString::fromUtf8("ã")); + if (sChar=="u") replaceLetters(TQString::fromUtf8("ü")); + if (sChar=="o") replaceLetters(TQString::fromUtf8("ò")); + if (sChar=="o") replaceLetters(TQString::fromUtf8("ó")); + if (sChar=="o") replaceLetters(TQString::fromUtf8("õ")); + if (sChar=="e") replaceLetters(TQString::fromUtf8("è")); + if (sChar=="e") replaceLetters(TQString::fromUtf8("é")); + if (sChar=="u") replaceLetters(TQString::fromUtf8("ù")); } if (!Prefs::oneLetter()) m_guessedLetters << sChar; //appends the list only if not in One Letter only mode... @@ -154,30 +154,30 @@ void KHangManView::replaceLetters(const QString& sChar) } -bool KHangManView::containsChar(const QString &sChar) +bool KHangManView::containsChar(const TQString &sChar) { bool b = false; if (m_accentedLetters && !Prefs::accentedLetters()) { if (sChar=="i") - b = m_word.contains(QString::fromUtf8("í"), false); + b = m_word.contains(TQString::fromUtf8("í"), false); if (sChar=="a") - b = m_word.contains(QString::fromUtf8("à"), false) - || m_word.contains(QString::fromUtf8("á"), false) - || m_word.contains(QString::fromUtf8("ã"), false); + b = m_word.contains(TQString::fromUtf8("à"), false) + || m_word.contains(TQString::fromUtf8("á"), false) + || m_word.contains(TQString::fromUtf8("ã"), false); if (sChar=="u") - b = m_word.contains(QString::fromUtf8("ü"), false) - || m_word.contains(QString::fromUtf8("ù"), false); + b = m_word.contains(TQString::fromUtf8("ü"), false) + || m_word.contains(TQString::fromUtf8("ù"), false); if (sChar=="o") - b = m_word.contains(QString::fromUtf8("ò"), false) - || m_word.contains(QString::fromUtf8("ó"), false) - || m_word.contains(QString::fromUtf8("õ"), false); + b = m_word.contains(TQString::fromUtf8("ò"), false) + || m_word.contains(TQString::fromUtf8("ó"), false) + || m_word.contains(TQString::fromUtf8("õ"), false); if (sChar=="e") - b = m_word.contains(QString::fromUtf8("è"), false) - || m_word.contains(QString::fromUtf8("é"), false); + b = m_word.contains(TQString::fromUtf8("è"), false) + || m_word.contains(TQString::fromUtf8("é"), false); } return (b || m_word.contains(sChar, false)); @@ -188,21 +188,21 @@ bool KHangManView::containsChar(const QString &sChar) // Event handlers -void KHangManView::mousePressEvent(QMouseEvent *mouse) +void KHangManView::mousePressEvent(TQMouseEvent *mouse) { if (mouse->button() == RightButton && m_hintExists && Prefs::hint()) { KPassivePopup *myPopup = new KPassivePopup( m_letterInput); myPopup->setView(i18n("Hint"), m_hint ); - myPopup->setPalette(QToolTip::palette()); + myPopup->setPalette(TQToolTip::palette()); myPopup->setTimeout(Prefs::hintTimer()*1000); //show for 4 seconds as default int x=0, y=0; - QPoint abspos = mapToGlobal( QPoint( 0, 0 ) ); + TQPoint abspos = mapToGlobal( TQPoint( 0, 0 ) ); x = abspos.x() + width()*70/700; y = abspos.y() + height()*150/535; - QPoint point = QPoint(x, y); + TQPoint point = TQPoint(x, y); myPopup->show(mapToGlobal(point)); // Maybe it's better to popup where the mouse clicks, in that @@ -231,14 +231,14 @@ void KHangManView::setTheme() // Painting -void KHangManView::paintEvent( QPaintEvent * ) +void KHangManView::paintEvent( TQPaintEvent * ) { // This pixmap implements double buffering to remove all forms of // flicker in the repainting. - QPixmap buf(width(), height()); + TQPixmap buf(width(), height()); // Repaint the contents of the khangman view into the pixmap. - QPainter p(&buf); + TQPainter p(&buf); p.drawPixmap(0, 0, m_resizedBackground); paintHangman(p); paintWord(p); @@ -249,35 +249,35 @@ void KHangManView::paintEvent( QPaintEvent * ) } -void KHangManView::paintHangman(QPainter &p) +void KHangManView::paintHangman(TQPainter &p) { // Draw the animated hanged K if (Prefs::mode() == 0) // sea - p.drawPixmap(QRect(0, 0, + p.drawPixmap(TQRect(0, 0, width()*630/700, height()*285/535), m_animationPics[m_numMissedLetters]); else - p.drawPixmap(QRect(width()*68/700, height()*170/535, + p.drawPixmap(TQRect(width()*68/700, height()*170/535, width()*259/700, height()*228/535), m_animationPics[m_numMissedLetters]); } -void KHangManView::paintWord(QPainter &p) +void KHangManView::paintWord(TQPainter &p) { - QRect myRect; + TQRect myRect; if (Prefs::mode() == 0) //sea - myRect = QRect(0, height()-height()*126/535, + myRect = TQRect(0, height()-height()*126/535, width()*417/700, height()*126/535); else - myRect = QRect(0, height()-height()*126/535, + myRect = TQRect(0, height()-height()*126/535, width()*327/700, height()*126/535); - QFont tFont; + TQFont tFont; if (Prefs::mode() == 0) //sea - p.setPen( QColor(148, 156, 167)); + p.setPen( TQColor(148, 156, 167)); else - p.setPen( QColor(87, 0, 0)); + p.setPen( TQColor(87, 0, 0)); if (Prefs::selectedLanguage() =="tg") tFont.setFamily( "URW Bookman" ); @@ -292,17 +292,17 @@ void KHangManView::paintWord(QPainter &p) } -void KHangManView::paintMisses(QPainter &p) +void KHangManView::paintMisses(TQPainter &p) { // Get the color for the letters. - QColor letterColor; + TQColor letterColor; if (Prefs::mode() == 0) //sea - letterColor = QColor(148, 156, 167); + letterColor = TQColor(148, 156, 167); else - letterColor = QColor(87, 0, 0); + letterColor = TQColor(87, 0, 0); // Draw the missed letters - QFont tFont; + TQFont tFont; if (Prefs::selectedLanguage() =="tg") tFont.setFamily( "URW Bookman" ); else @@ -311,21 +311,21 @@ void KHangManView::paintMisses(QPainter &p) p.setPen( letterColor ); p.setFont(tFont); - QFontMetrics fm(tFont); - QRect fmRect(fm.boundingRect(m_missedLetters)); - QRect myRect = QRect(width() - fmRect.width(), 15, + TQFontMetrics fm(tFont); + TQRect fmRect(fm.boundingRect(m_missedLetters)); + TQRect myRect = TQRect(width() - fmRect.width(), 15, fmRect.width(), fm.height()); p.drawText(myRect, AlignLeft, m_missedLetters); // Draw the "Misses" word - QString misses = i18n("Misses"); - QFont mFont = QFont(Prefs::missesFontFamily()); + TQString misses = i18n("Misses"); + TQFont mFont = TQFont(Prefs::missesFontFamily()); mFont.setPointSize(30); p.setFont(mFont); - QFontMetrics fm2(mFont); - QRect fmRect2(fm2.boundingRect(misses)); - QRect myRect2(width()- fmRect.width() - fmRect2.width() - 15, + TQFontMetrics fm2(mFont); + TQRect fmRect2(fm2.boundingRect(misses)); + TQRect myRect2(width()- fmRect.width() - fmRect2.width() - 15, 15 - fm2.height() + fm.height(), fmRect2.width(), fm2.height()); p.setPen( letterColor ); @@ -333,21 +333,21 @@ void KHangManView::paintMisses(QPainter &p) } -void KHangManView::resizeEvent(QResizeEvent *) +void KHangManView::resizeEvent(TQResizeEvent *) { if(!m_originalBackground.isNull()) setBackground(m_originalBackground); - m_letterInput->setMinimumSize( QSize( height()/18, 0 ) ); + m_letterInput->setMinimumSize( TQSize( height()/18, 0 ) ); - QFont charWrite_font( m_letterInput->font() ); + TQFont charWrite_font( m_letterInput->font() ); charWrite_font.setPointSize( height()/18 ); charWrite_font.setFamily( "Sans Serif" ); m_letterInput->setFont( charWrite_font ); m_letterInput->setGeometry(width()-2*height()/12, height()-2*height()/16, height()/10, height()/10); - m_guessButton->setFont(QFont(Prefs::guessFontFamily(), height()/22)); + m_guessButton->setFont(TQFont(Prefs::guessFontFamily(), height()/22)); m_guessButton->setGeometry(width() - 2*height()/12 - m_guessButton->width()-5, height() - 2*height()/16, @@ -359,9 +359,9 @@ void KHangManView::resizeEvent(QResizeEvent *) // Slots -void KHangManView::setBackground(QPixmap& bgPix) +void KHangManView::setBackground(TQPixmap& bgPix) { - QImage img = bgPix.convertToImage(); + TQImage img = bgPix.convertToImage(); m_resizedBackground.resize(size()); m_resizedBackground.convertFromImage(img.smoothScale( width(), height())); } @@ -369,7 +369,7 @@ void KHangManView::setBackground(QPixmap& bgPix) void KHangManView::slotTry() { - QString guess = m_letterInput->text(); + TQString guess = m_letterInput->text(); kdDebug() << "guess as entered: " << guess << endl; // If the char is not a letter, empty the input and return. @@ -386,8 +386,8 @@ void KHangManView::slotTry() replaceLetters(guess); // This is needed because of the white spaces. - QString stripWord = m_goodWord; - QString sword = m_word; + TQString stripWord = m_goodWord; + TQString sword = m_word; if (dd > 0) { stripWord.replace(2*c, 1, ""); stripWord.replace(2*c-1, 1, ""); @@ -396,10 +396,10 @@ void KHangManView::slotTry() stripWord.replace(2*(dd-1)-1, 1, ""); } - QStringList rightChars = QStringList::split(" ", stripWord, true); - QString rightWord = rightChars.join(""); + TQStringList rightChars = TQStringList::split(" ", stripWord, true); + TQString rightWord = rightChars.join(""); update(); - sword.remove(QRegExp(" ")); + sword.remove(TQRegExp(" ")); // If the user made it... if (rightWord.stripWhiteSpace().lower() @@ -410,28 +410,28 @@ void KHangManView::slotTry() //TODO find a better way to finish // if (Prefs::sound()) { - QString soundFile = locate("data", "khangman/sounds/EW_Dialogue_Appear.ogg"); + TQString soundFile = locate("data", "khangman/sounds/EW_Dialogue_Appear.ogg"); if (soundFile != 0) KAudioPlayer::play(soundFile); } if (Prefs::wonDialog()) { // TODO: hide Hint KPassivePopup if any - QPoint point; + TQPoint point; KPassivePopup *popup = new KPassivePopup( this, "popup" ); popup->setAutoDelete( true ); popup->setTimeout( 4*1000 ); popup->setView(i18n("Congratulations,\nyou won!") ); int x =0, y = 0; - QPoint abspos = popup->pos(); + TQPoint abspos = popup->pos(); x = abspos.x() + width()*50/700; y = abspos.y() + height()*20/535; - point = QPoint(x, y); + point = TQPoint(x, y); popup->show(mapToGlobal(point)); - QTimer::singleShot( 4*1000, this, SLOT(slotNewGame()) ); + TQTimer::singleShot( 4*1000, this, TQT_SLOT(slotNewGame()) ); } - else if (KMessageBox::questionYesNo(this, i18n("Congratulations! You won! Do you want to play again?"),QString::null,i18n("Play Again"), i18n("Do Not Play")) == 3) + else if (KMessageBox::questionYesNo(this, i18n("Congratulations! You won! Do you want to play again?"),TQString::null,i18n("Play Again"), i18n("Do Not Play")) == 3) slotNewGame(); else kapp->quit(); @@ -451,33 +451,33 @@ void KHangManView::slotTry() if (m_numMissedLetters >= MAXWRONGGUESSES) { //TODO sequence to finish when hanged - QStringList charList=QStringList::split("", m_word); - QString theWord=charList.join(" "); + TQStringList charList=TQStringList::split("", m_word); + TQString theWord=charList.join(" "); m_goodWord = theWord; //usability: find another way to start a new game - QString newGameString = i18n("You lost. Do you want to play again?"); + TQString newGameString = i18n("You lost. Do you want to play again?"); if (Prefs::wonDialog()) { // TODO: hide Hint KPassivePopup if any - QPoint point; + TQPoint point; KPassivePopup *popup = new KPassivePopup(KPassivePopup::Boxed, this, "popup" ); popup->setAutoDelete( true ); popup->setTimeout( 4*1000 ); - QVBox *vb = new QVBox( popup ); + TQVBox *vb = new TQVBox( popup ); - QLabel *popLabel = new QLabel( vb); - popLabel->setFont(QFont("Sans Serif", 14, QFont::Normal)); + TQLabel *popLabel = new TQLabel( vb); + popLabel->setFont(TQFont("Sans Serif", 14, TQFont::Normal)); popLabel->setText(i18n("You lost!\nThe word was\n%1").arg(m_word)); popup->setView( vb ); - QPoint abspos = popup->pos(); + TQPoint abspos = popup->pos(); int x = abspos.x() + width() * 50 / 700; int y = abspos.y() + height() * 20 / 535; - popup->show(mapToGlobal(QPoint(x, y))); + popup->show(mapToGlobal(TQPoint(x, y))); - QTimer::singleShot( 4 * 1000, this, SLOT(slotNewGame()) ); + TQTimer::singleShot( 4 * 1000, this, TQT_SLOT(slotNewGame()) ); } - else if (KMessageBox::questionYesNo(this, newGameString, QString::null, i18n("Play Again"), i18n("Do Not Play")) == 3) + else if (KMessageBox::questionYesNo(this, newGameString, TQString::null, i18n("Play Again"), i18n("Do Not Play")) == 3) slotNewGame(); else kapp->quit(); @@ -488,7 +488,7 @@ void KHangManView::slotTry() // The letter is already guessed. // Show a popup that says as much. - QPoint point; + TQPoint point; KPassivePopup *popup = new KPassivePopup(KPassivePopup::Balloon, this, "popup" ); popup->setAutoDelete( true ); popup->setTimeout( 1000 ); @@ -499,22 +499,22 @@ void KHangManView::slotTry() if (m_missedLetters.contains(guess, false) > 0) { // FIXME: popup should be better placed. - QPoint abspos = popup->pos(); + TQPoint abspos = popup->pos(); x = abspos.x() + width()*400/700; y = abspos.y() + height()*50/535; - point = QPoint(x, y); + point = TQPoint(x, y); // Create a 1 second single-shot timer, and reenable user // input after this time. - QTimer::singleShot( Prefs::missedTimer() * 1000, - this, SLOT(enableUserInput()) ); + TQTimer::singleShot( Prefs::missedTimer() * 1000, + this, TQT_SLOT(enableUserInput()) ); // Disable any possible entry m_letterInput->setEnabled(false); } if (m_goodWord.contains(guess, false) > 0) { - QPoint abspos = popup->pos(); + TQPoint abspos = popup->pos(); if (Prefs::mode() == 0) { // sea @@ -525,10 +525,10 @@ void KHangManView::slotTry() x = abspos.x() + width()*200/700; y = abspos.y() + height()*485/535; } - point = QPoint(x, y); + point = TQPoint(x, y); - QTimer::singleShot( Prefs::missedTimer() * 1000, - this, SLOT(enableUserInput()) ); + TQTimer::singleShot( Prefs::missedTimer() * 1000, + this, TQT_SLOT(enableUserInput()) ); // Disable any possible entry m_letterInput->setEnabled(false); @@ -552,7 +552,7 @@ void KHangManView::enableUserInput() void KHangManView::slotNewGame() { if (Prefs::sound()) { - QString soundFile = locate("data", "khangman/sounds/new_game.ogg"); + TQString soundFile = locate("data", "khangman/sounds/new_game.ogg"); if (soundFile != 0) KAudioPlayer::play(soundFile); } @@ -585,13 +585,13 @@ void KHangManView::game() kdDebug() << "level " << Prefs::levelFile() << endl; // Check if the data files are installed in the correct dir. - QString myString = QString("khangman/data/%1/%2") + TQString myString = TQString("khangman/data/%1/%2") .arg(Prefs::selectedLanguage()) .arg(Prefs::levelFile()); - QFile myFile; + TQFile myFile; myFile.setName(locate("data", myString)); if (!myFile.exists()) { - QString mString = i18n("File $KDEDIR/share/apps/khangman/data/%1/%2 not found!\n" + TQString mString = i18n("File $KDEDIR/share/apps/khangman/data/%1/%2 not found!\n" "Check your installation, please!") .arg(Prefs::selectedLanguage()) .arg(Prefs::levelFile()); @@ -600,13 +600,13 @@ void KHangManView::game() } // We open the file and store info into the stream... - QFile openFileStream(myFile.name()); + TQFile openFileStream(myFile.name()); openFileStream.open(IO_ReadOnly); - QTextStream readFileStr(&openFileStream); - readFileStr.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream readFileStr(&openFileStream); + readFileStr.setEncoding(TQTextStream::UnicodeUTF8); // Alldata contains all the words from the file - QStringList allData = QStringList::split("\n", readFileStr.read(), true); + TQStringList allData = TQStringList::split("\n", readFileStr.read(), true); openFileStream.close(); // Detects if file is a kvtml file so that it's a hint enable file @@ -652,9 +652,9 @@ void KHangManView::game() } // 3. Find · - int e = m_word.find( QString::fromUtf8("·") ); + int e = m_word.find( TQString::fromUtf8("·") ); if (e>0) - m_goodWord.replace(2*e, 1, QString::fromUtf8("·") ); + m_goodWord.replace(2*e, 1, TQString::fromUtf8("·") ); // 4. Find ' int h = m_word.find( "'" ); @@ -666,7 +666,7 @@ void KHangManView::game() void KHangManView::readFile() { kdDebug() << "in read kvtml file " << endl; - QString myString=QString("khangman/data/%1/%2").arg(Prefs::selectedLanguage()).arg(Prefs::levelFile()); + TQString myString=TQString("khangman/data/%1/%2").arg(Prefs::selectedLanguage()).arg(Prefs::levelFile()); myString= locate("data", myString); KEduVocDataItemList verbs = KEduVocData::parse(myString); @@ -706,20 +706,20 @@ void KHangManView::loadAnimation() { switch (Prefs::mode()) { case Prefs::EnumMode::sea: - m_originalBackground = QPixmap(locate("data", "khangman/pics/sea/sea_theme.png") ); + m_originalBackground = TQPixmap(locate("data", "khangman/pics/sea/sea_theme.png") ); m_themeName = "sea"; - m_letterInput->setPaletteForegroundColor( QColor( 83, 40, 14) ); - m_guessButton->setPaletteBackgroundColor( QColor( 115, 64, 49) ); - m_guessButton->setPaletteForegroundColor( QColor( 148, 156, 167) ); + m_letterInput->setPaletteForegroundColor( TQColor( 83, 40, 14) ); + m_guessButton->setPaletteBackgroundColor( TQColor( 115, 64, 49) ); + m_guessButton->setPaletteForegroundColor( TQColor( 148, 156, 167) ); m_guessButton->setBackgroundOrigin( KPushButton::ParentOrigin ); break; case Prefs::EnumMode::desert: - m_originalBackground = QPixmap(locate("data","khangman/pics/desert/desert_theme.png") ); + m_originalBackground = TQPixmap(locate("data","khangman/pics/desert/desert_theme.png") ); m_themeName = "desert"; - m_letterInput->setPaletteForegroundColor( QColor( 87, 0, 0) ); - m_guessButton->setPaletteBackgroundColor( QColor( 205, 214, 90) ); - m_guessButton->setPaletteForegroundColor( QColor( 87, 0, 0) ); + m_letterInput->setPaletteForegroundColor( TQColor( 87, 0, 0) ); + m_guessButton->setPaletteBackgroundColor( TQColor( 205, 214, 90) ); + m_guessButton->setPaletteForegroundColor( TQColor( 87, 0, 0) ); m_guessButton->setBackgroundOrigin( KPushButton::ParentOrigin ); break; } @@ -727,7 +727,7 @@ void KHangManView::loadAnimation() // Now we load the pixmaps... for (uint i = 0; i < 11; i++) { m_animationPics[i].load(locate( "data", - QString("khangman/pics/%1/animation%2.png") + TQString("khangman/pics/%1/animation%2.png") .arg(m_themeName).arg(i) )); } } diff --git a/khangman/khangman/khangmanview.h b/khangman/khangman/khangmanview.h index 593c94a0..7ffffcf2 100644 --- a/khangman/khangman/khangmanview.h +++ b/khangman/khangman/khangmanview.h @@ -59,7 +59,7 @@ public: { m_accentedLetters = _accentedLetters; } /// Enter a letter into the input widget. - void enterLetter(QString letter) { m_letterInput->setText(letter); } + void enterLetter(TQString letter) { m_letterInput->setText(letter); } signals: @@ -86,11 +86,11 @@ private: protected: // Events - void paintEvent( QPaintEvent * ); - void resizeEvent( QResizeEvent * ); + void paintEvent( TQPaintEvent * ); + void resizeEvent( TQResizeEvent * ); /// Enable hints on mouse right click if Hints exist. - virtual void mousePressEvent( QMouseEvent *mouse ); + virtual void mousePressEvent( TQMouseEvent *mouse ); private: @@ -98,9 +98,9 @@ private: // Painting /// Paint the animated hanged K sequence. - void paintHangman(QPainter &p); - void paintWord(QPainter &p); - void paintMisses(QPainter &p); + void paintHangman(TQPainter &p); + void paintWord(TQPainter &p); + void paintMisses(TQPainter &p); /// Reset everything to start a new game, missed letters is empty. void reset(); @@ -112,13 +112,13 @@ private: /// Load the K animated sequence depending of the theme. void loadAnimation(); - /// Set the background pixmap to the QPixmap argument. - void setBackground(QPixmap& ); + /// Set the background pixmap to the TQPixmap argument. + void setBackground(TQPixmap& ); - /// Return true if the word contains the char in the QString. - bool containsChar(const QString &); + /// Return true if the word contains the char in the TQString. + bool containsChar(const TQString &); - void replaceLetters(const QString &); + void replaceLetters(const TQString &); public slots: /// If you want to play with a new word @@ -144,17 +144,17 @@ private: // These spaces will then be added at draw time. /// The word to be guessed. - QString m_word; + TQString m_word; /// goodWord is the hidden word that is filled in during the game. /// Initialized to "_ " * (number of letters in the word). - QString m_goodWord; + TQString m_goodWord; /// Contains all letters already guessed. - QStringList m_guessedLetters; + TQStringList m_guessedLetters; // Stores the missed letters that are shown on the screen. // Initialiazed to "_ " * MAXWRONGGUESSES. - QString m_missedLetters; + TQString m_missedLetters; /// How many times you missed. /// When this reaches MAXWRONGGUESSES, you are hanged. int m_numMissedLetters; @@ -166,12 +166,12 @@ private: // the same word is not given twice in a row. int m_lastWordNumber; - QString m_themeName; + TQString m_themeName; KRandomSequence m_random; /// true if a hint exists bool m_hintExists; - QString m_hint; + TQString m_hint; /// true if the language contains accented letters. /// This is true for, among others, es, ca, pt or pt_BR @@ -181,11 +181,11 @@ private: // Graphics ---------------- // Background picture (sea or desert) - QPixmap m_originalBackground; // Original image - QPixmap m_resizedBackground; // Resized to fit the window. + TQPixmap m_originalBackground; // Original image + TQPixmap m_resizedBackground; // Resized to fit the window. /// The hanged K animation sequence. - QPixmap m_animationPics[MAXWRONGGUESSES + 1]; + TQPixmap m_animationPics[MAXWRONGGUESSES + 1]; // Widgets ---------------- diff --git a/khangman/khangman/khnewstuff.cpp b/khangman/khangman/khnewstuff.cpp index 829a5f24..f15fca87 100644 --- a/khangman/khangman/khnewstuff.cpp +++ b/khangman/khangman/khnewstuff.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "prefs.h" @@ -38,7 +38,7 @@ KHNewStuff::KHNewStuff( KHangManView *view ) : { } -bool KHNewStuff::install( const QString &fileName ) +bool KHNewStuff::install( const TQString &fileName ) { kdDebug(5850) << "KHNewStuff::install(): " << fileName << endl; @@ -47,7 +47,7 @@ bool KHNewStuff::install( const QString &fileName ) return false; const KArchiveDirectory *archiveDir = archive.directory(); KStandardDirs myStdDir; - const QString destDir =myStdDir.saveLocation("data", kapp->instanceName() + "/data/", true); + const TQString destDir =myStdDir.saveLocation("data", kapp->instanceName() + "/data/", true); KStandardDirs::makeDir( destDir ); archiveDir->copyTo(destDir); archive.close(); @@ -60,7 +60,7 @@ bool KHNewStuff::install( const QString &fileName ) return true; } -bool KHNewStuff::createUploadFile( const QString &/*fileName*/ ) +bool KHNewStuff::createUploadFile( const TQString &/*fileName*/ ) { //return mView->saveCalendar( fileName ); return true; diff --git a/khangman/khangman/khnewstuff.h b/khangman/khangman/khnewstuff.h index 75fa7c12..826300f2 100644 --- a/khangman/khangman/khnewstuff.h +++ b/khangman/khangman/khnewstuff.h @@ -34,8 +34,8 @@ class KHNewStuff : public KNewStuff public: KHNewStuff( KHangManView * ); - bool install( const QString &fileName ); - bool createUploadFile( const QString &fileName ); + bool install( const TQString &fileName ); + bool createUploadFile( const TQString &fileName ); private: KHangManView *m_view; diff --git a/khangman/khangman/main.cpp b/khangman/khangman/main.cpp index 9cbf84e7..303d15c4 100644 --- a/khangman/khangman/main.cpp +++ b/khangman/khangman/main.cpp @@ -115,8 +115,8 @@ int main(int argc, char **argv) KApplication app; KHangMan *mainWin = 0; - QFont f("Domestic Manners", 12, QFont::Normal, true); - QFont fd("Dustismo Roman", 12, QFont::Normal, true); + TQFont f("Domestic Manners", 12, TQFont::Normal, true); + TQFont fd("Dustismo Roman", 12, TQFont::Normal, true); if (!fontChecker::checkInstalled(f, locate("appdata", "fonts/Domestic_Manners.ttf"))) { KProcess *proc = new KProcess; diff --git a/khangman/khangman/timer.cpp b/khangman/khangman/timer.cpp index 7d1f7304..69bcf6f7 100644 --- a/khangman/khangman/timer.cpp +++ b/khangman/khangman/timer.cpp @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include "timer.h" #include "prefs.h" @@ -30,17 +30,17 @@ Timer::Timer() :timerdlg() { - timeHintLabel->setText(QString::number(Prefs::hintTimer()) + " " + i18n("seconds")); - timeMissedLabel->setText(QString::number(Prefs::missedTimer()) + " " + i18n("seconds")); - connect(kcfg_HintTimer, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged())); - connect(kcfg_MissedTimer, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged())); + timeHintLabel->setText(TQString::number(Prefs::hintTimer()) + " " + i18n("seconds")); + timeMissedLabel->setText(TQString::number(Prefs::missedTimer()) + " " + i18n("seconds")); + connect(kcfg_HintTimer, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(sliderValueChanged())); + connect(kcfg_MissedTimer, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(sliderValueChanged())); } void Timer::sliderValueChanged() { - timeMissedLabel->setText(QString::number(kcfg_MissedTimer->value()) + " " + i18n("seconds")); - timeHintLabel->setText(QString::number(kcfg_HintTimer->value()) + " " + i18n("seconds")); + timeMissedLabel->setText(TQString::number(kcfg_MissedTimer->value()) + " " + i18n("seconds")); + timeHintLabel->setText(TQString::number(kcfg_HintTimer->value()) + " " + i18n("seconds")); } diff --git a/khangman/khangman/timer.h b/khangman/khangman/timer.h index cb3373c1..ad6b50bb 100644 --- a/khangman/khangman/timer.h +++ b/khangman/khangman/timer.h @@ -39,7 +39,7 @@ public: Timer(); protected slots: - ///When the QSlider value changes + ///When the TQSlider value changes void sliderValueChanged(); }; diff --git a/kig/filters/cabri-filter.cc b/kig/filters/cabri-filter.cc index 6d19027b..3cadf522 100644 --- a/kig/filters/cabri-filter.cc +++ b/kig/filters/cabri-filter.cc @@ -41,9 +41,9 @@ #include "../objects/transform_types.h" #include "../objects/vector_type.h" -#include -#include -#include +#include +#include +#include #include #include @@ -108,10 +108,10 @@ struct CabriObject { uint id; - QCString type; + TQCString type; uint numberOfParents; - QColor color; - QColor fillColor; + TQColor color; + TQColor fillColor; int thick; int lineSegLength; int lineSegSplit; @@ -130,7 +130,7 @@ KigFilterCabri::~KigFilterCabri() { } -bool KigFilterCabri::supportMime( const QString& mime ) +bool KigFilterCabri::supportMime( const TQString& mime ) { // ugly hack to avoid duplicate extension ( XFig and Cabri files // have the same .fig extension ). @@ -138,9 +138,9 @@ bool KigFilterCabri::supportMime( const QString& mime ) ( mime == "application/x-cabri" ); } -static QString readLine( QFile& file ) +static TQString readLine( TQFile& file ) { - QString ret; + TQString ret; file.readLine( ret, 10000L ); if ( ret[ret.length() - 1] == '\n' ) ret.truncate( ret.length() - 1 ); @@ -149,7 +149,7 @@ static QString readLine( QFile& file ) return ret; } -static QColor translatecolor( const QString& s ) +static TQColor translatecolor( const TQString& s ) { if ( s == "R" ) return Qt::red; if ( s == "O" ) return Qt::magenta; @@ -160,8 +160,8 @@ static QColor translatecolor( const QString& s ) if ( s == "lBl" ) return Qt::cyan; // TODO: bright blue if ( s == "G" ) return Qt::green; if ( s == "dG" ) return Qt::darkGreen; - if ( s == "Br" ) return QColor( 165, 42, 42 ); - if ( s == "dBr" ) return QColor( 128, 128, 0 ); + if ( s == "Br" ) return TQColor( 165, 42, 42 ); + if ( s == "dBr" ) return TQColor( 128, 128, 0 ); if ( s == "lGr" ) return Qt::lightGray; if ( s == "Gr" ) return Qt::gray; if ( s == "dGr" ) return Qt::darkGray; @@ -172,24 +172,24 @@ static QColor translatecolor( const QString& s ) return Qt::black; } -bool KigFilterCabri::readObject( QFile& f, CabriObject& myobj ) +bool KigFilterCabri::readObject( TQFile& f, CabriObject& myobj ) { // there are 4 lines per object in the file, so we read them all // four now. - QString line1, line2, line3, s; - QString file = f.name(); + TQString line1, line2, line3, s; + TQString file = f.name(); line1 = readLine( f ); line2 = readLine( f ); line3 = readLine( f ); // ignore line 4, it is empty.. s = readLine( f ); - QRegExp firstlinere( "^([^:]+): ([^,]+), ([^,]+), CN:([^,]*), VN:(.*)$" ); + TQRegExp firstlinere( "^([^:]+): ([^,]+), ([^,]+), CN:([^,]*), VN:(.*)$" ); if ( ! firstlinere.exactMatch( line1 ) ) KIG_FILTER_PARSE_ERROR; bool ok; - QString tmp; + TQString tmp; tmp = firstlinere.cap( 1 ); myobj.id = tmp.toInt( &ok ); @@ -208,7 +208,7 @@ bool KigFilterCabri::readObject( QFile& f, CabriObject& myobj ) tmp = firstlinere.cap( 5 ); // i have no idea what this number means.. - QRegExp secondlinere( "^([^,]+), ([^,]+), ([^,]+), DS:([^ ]+) ([^,]+), GT:([^,]+), ([^,]+), (.*)$" ); + TQRegExp secondlinere( "^([^,]+), ([^,]+), ([^,]+), DS:([^ ]+) ([^,]+), GT:([^,]+), ([^,]+), (.*)$" ); if ( ! secondlinere.exactMatch( line2 ) ) KIG_FILTER_PARSE_ERROR; @@ -241,13 +241,13 @@ bool KigFilterCabri::readObject( QFile& f, CabriObject& myobj ) tmp = secondlinere.cap( 8 ); myobj.fixed = tmp == "St"; - QRegExp thirdlinere( "^(Const: ([^,]*),? ?)?(Val: (.*))?$" ); + TQRegExp thirdlinere( "^(Const: ([^,]*),? ?)?(Val: (.*))?$" ); if ( ! thirdlinere.exactMatch( line3 ) ) KIG_FILTER_PARSE_ERROR; tmp = thirdlinere.cap( 2 ); - QStringList parentsids = QStringList::split( ' ', tmp ); - for ( QStringList::iterator i = parentsids.begin(); + TQStringList parentsids = TQStringList::split( ' ', tmp ); + for ( TQStringList::iterator i = parentsids.begin(); i != parentsids.end(); ++i ) { myobj.parents.push_back( ( *i ).toInt( &ok ) ); @@ -257,8 +257,8 @@ bool KigFilterCabri::readObject( QFile& f, CabriObject& myobj ) KIG_FILTER_PARSE_ERROR; tmp = thirdlinere.cap( 4 ); - QStringList valIds = QStringList::split( ' ', tmp ); - for ( QStringList::iterator i = valIds.begin(); + TQStringList valIds = TQStringList::split( ' ', tmp ); + for ( TQStringList::iterator i = valIds.begin(); i != valIds.end(); ++i ) { myobj.data.push_back( ( *i ).toDouble( &ok ) ); @@ -287,9 +287,9 @@ bool KigFilterCabri::readObject( QFile& f, CabriObject& myobj ) return true; } -KigDocument* KigFilterCabri::load( const QString& file ) +KigDocument* KigFilterCabri::load( const TQString& file ) { - QFile f( file ); + TQFile f( file ); if ( ! f.open( IO_ReadOnly ) ) { fileNotFound( file ); @@ -298,9 +298,9 @@ KigDocument* KigFilterCabri::load( const QString& file ) KigDocument* ret = new KigDocument(); - QString s = readLine( f ); - QString a = s.left( 21 ); - QString b = s.mid( 21 ); + TQString s = readLine( f ); + TQString a = s.left( 21 ); + TQString b = s.mid( 21 ); if( a != "FIGURE CabriII vers. " || ( b != "DOS 1.0" && b != "MS-Windows 1.0" ) ) { diff --git a/kig/filters/cabri-filter.h b/kig/filters/cabri-filter.h index 5760040f..c1f3febb 100644 --- a/kig/filters/cabri-filter.h +++ b/kig/filters/cabri-filter.h @@ -45,10 +45,10 @@ class KigFilterCabri public: static KigFilterCabri* instance(); - bool supportMime ( const QString& mime ); - KigDocument* load ( const QString& fromfile ); + bool supportMime ( const TQString& mime ); + KigDocument* load ( const TQString& fromfile ); private: - bool readObject( QFile& f, CabriObject& myobj ); + bool readObject( TQFile& f, CabriObject& myobj ); }; diff --git a/kig/filters/drgeo-filter-chooser.cc b/kig/filters/drgeo-filter-chooser.cc index 424a3462..3369af92 100644 --- a/kig/filters/drgeo-filter-chooser.cc +++ b/kig/filters/drgeo-filter-chooser.cc @@ -25,7 +25,7 @@ #include #include -KigFilterDrgeoChooser::KigFilterDrgeoChooser( const QStringList& l ) +KigFilterDrgeoChooser::KigFilterDrgeoChooser( const TQStringList& l ) : KigFilterDrgeoChooserBase( 0, "drgeo_filter", true ) { OKButton->setGuiItem( KStdGuiItem::ok() ); @@ -33,9 +33,9 @@ KigFilterDrgeoChooser::KigFilterDrgeoChooser( const QStringList& l ) FigureListBox->insertStringList( l ); - connect( OKButton, SIGNAL( clicked() ), SLOT( slotOKPressed() ) ); - connect( CancelButton, SIGNAL( clicked() ), SLOT( slotCancelPressed() ) ); - connect( FigureListBox, SIGNAL( executed( QListBoxItem* ) ), SLOT( slotExecuted( QListBoxItem* ) ) ); + connect( OKButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotOKPressed() ) ); + connect( CancelButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotCancelPressed() ) ); + connect( FigureListBox, TQT_SIGNAL( executed( TQListBoxItem* ) ), TQT_SLOT( slotExecuted( TQListBoxItem* ) ) ); } void KigFilterDrgeoChooser::slotOKPressed() @@ -59,7 +59,7 @@ KigFilterDrgeoChooser::~KigFilterDrgeoChooser() } -void KigFilterDrgeoChooser::slotExecuted( QListBoxItem* i ) +void KigFilterDrgeoChooser::slotExecuted( TQListBoxItem* i ) { done( FigureListBox->index( i ) ); } diff --git a/kig/filters/drgeo-filter-chooser.h b/kig/filters/drgeo-filter-chooser.h index fd4ce606..7cc3c76a 100644 --- a/kig/filters/drgeo-filter-chooser.h +++ b/kig/filters/drgeo-filter-chooser.h @@ -30,12 +30,12 @@ class KigFilterDrgeoChooser Q_OBJECT public: - KigFilterDrgeoChooser( const QStringList& l ); + KigFilterDrgeoChooser( const TQStringList& l ); ~KigFilterDrgeoChooser(); public slots: void slotOKPressed(); void slotCancelPressed(); - void slotExecuted( QListBoxItem* ); + void slotExecuted( TQListBoxItem* ); }; #endif diff --git a/kig/filters/drgeo-filter.cc b/kig/filters/drgeo-filter.cc index 8fa306cc..82438a57 100644 --- a/kig/filters/drgeo-filter.cc +++ b/kig/filters/drgeo-filter.cc @@ -51,8 +51,8 @@ #include -#include -#include +#include +#include #include @@ -61,8 +61,8 @@ struct DrGeoHierarchyElement { - QString id; - std::vector parents; + TQString id; + std::vector parents; }; KigFilterDrgeo::KigFilterDrgeo() @@ -73,30 +73,30 @@ KigFilterDrgeo::~KigFilterDrgeo() { } -bool KigFilterDrgeo::supportMime( const QString& mime ) +bool KigFilterDrgeo::supportMime( const TQString& mime ) { return mime == "application/x-drgeo"; } -KigDocument* KigFilterDrgeo::load( const QString& file ) +KigDocument* KigFilterDrgeo::load( const TQString& file ) { - QFile f( file ); + TQFile f( file ); if ( ! f.open( IO_ReadOnly ) ) { fileNotFound( file ); return 0; } - QStringList figures; - QDomDocument doc( "drgenius" ); + TQStringList figures; + TQDomDocument doc( "drgenius" ); if ( !doc.setContent( &f ) ) KIG_FILTER_PARSE_ERROR; - QDomElement main = doc.documentElement(); + TQDomElement main = doc.documentElement(); int nmacros = 0; // reading figures... - for ( QDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; else if ( e.tagName() == "drgeo" ) figures.append( e.attribute( "name" ) ); @@ -132,9 +132,9 @@ KigDocument* KigFilterDrgeo::load( const QString& file ) #endif int curfig = -1; - for ( QDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; else if ( e.tagName() == "drgeo" ) { @@ -154,7 +154,7 @@ KigDocument* KigFilterDrgeo::load( const QString& file ) return 0; } -int convertDrgeoIndex( const std::vector es, const QString myid ) +int convertDrgeoIndex( const std::vector es, const TQString myid ) { for ( uint i = 0; i < es.size(); ++i ) if ( es[i].id == myid ) @@ -178,7 +178,7 @@ const Coordinate convertDrgeoHalflineParam( const double param, const LineData& return p; } -KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, const bool grid ) +KigDocument* KigFilterDrgeo::importFigure( TQDomNode f, const TQString& file, const bool grid ) { KigDocument* ret = new KigDocument(); @@ -187,9 +187,9 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons int withoutid = 0; // 1st: fetch relationships and build an appropriate structure - for (QDomNode a = f; ! a.isNull(); a = a.nextSibling() ) + for (TQDomNode a = f; ! a.isNull(); a = a.nextSibling() ) { - QDomElement domelem = a.toElement(); + TQDomElement domelem = a.toElement(); if ( domelem.isNull() ) continue; else { @@ -197,21 +197,21 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons #ifdef DRGEO_DEBUG kdDebug() << " * " << domelem.tagName() << "(" << domelem.attribute("type") << ")" << endl; #endif - for ( QDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) + for ( TQDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) { - QDomElement ce = c.toElement(); + TQDomElement ce = c.toElement(); if ( ce.isNull() ) continue; else if ( ce.tagName() == "parent" ) elem.parents.push_back( ce.attribute( "ref" ) ); } - QString curid = domelem.attribute( "id" ); - elem.id = !curid.isNull() ? curid : QString::number( withoutid++ ) ; + TQString curid = domelem.attribute( "id" ); + elem.id = !curid.isNull() ? curid : TQString::number( withoutid++ ) ; elems.push_back( elem ); } } #ifdef DRGEO_DEBUG - QString x; + TQString x; kdDebug() << "+++ elems" << endl; for ( uint i = 0; i < elems.size(); ++i ) { @@ -235,7 +235,7 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons // there's no need to sort the objects because it seems that DrGeo objects // appear in the right order... so let's go! - for (QDomNode a = f; ! a.isNull(); a = a.nextSibling() ) + for (TQDomNode a = f; ! a.isNull(); a = a.nextSibling() ) { #ifdef DRGEO_DEBUG kdDebug() << "+++ id: " << curid << endl; @@ -249,7 +249,7 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons KIG_FILTER_PARSE_ERROR; parents.push_back( holders[parentid-nignored]->calcer() ); }; - QDomElement domelem = a.toElement(); + TQDomElement domelem = a.toElement(); #ifdef DRGEO_DEBUG if ( parents.size() > 0 ) @@ -266,12 +266,12 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons if ( domelem.isNull() ) continue; else if ( domelem.tagName() == "point" ) { - QString xs; - QString ys; - QString values; - for ( QDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) + TQString xs; + TQString ys; + TQString values; + for ( TQDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) { - QDomElement ce = c.toElement(); + TQDomElement ce = c.toElement(); if ( ce.isNull() ) continue; else if ( ce.tagName() == "x" ) xs = ce.text(); @@ -501,12 +501,12 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons else if( ( domelem.tagName() == "numeric" ) || ( domelem.tagName() == "equation" ) ) { - QString xs; - QString ys; - QString value; - for ( QDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) + TQString xs; + TQString ys; + TQString value; + for ( TQDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) { - QDomElement ce = c.toElement(); + TQDomElement ce = c.toElement(); if ( ce.isNull() ) continue; else if ( ce.tagName() == "x" ) xs = ce.text(); @@ -529,7 +529,7 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons bool ok3; double dvalue = value.toDouble( &ok3 ); if ( ok3 ) - value = QString( "%1" ).arg( dvalue, 0, 'g', 3 ); + value = TQString( "%1" ).arg( dvalue, 0, 'g', 3 ); oc = fact->labelCalcer( value, m, false, std::vector(), *ret ); } else if ( domelem.attribute( "type" ) == "pt_abscissa" ) @@ -646,12 +646,12 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons } else if ( domelem.tagName() == "script" ) { - QString xs; - QString ys; - QString text; - for ( QDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) + TQString xs; + TQString ys; + TQString text; + for ( TQDomNode c = domelem.firstChild(); ! c.isNull(); c = c.nextSibling() ) { - QDomElement ce = c.toElement(); + TQDomElement ce = c.toElement(); if ( ce.isNull() ) continue; else if ( ce.tagName() == "x" ) xs = ce.text(); @@ -718,7 +718,7 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons continue; // reading color - QColor co( domelem.attribute( "color" ) ); + TQColor co( domelem.attribute( "color" ) ); if ( ! co.isValid() ) if ( domelem.attribute( "color" ) == "Bordeaux" ) co.setRgb( 145, 0, 0 ); @@ -744,7 +744,7 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons if ( domelem.attribute( "thickness" ) == "Thick" ) w = 2; } - QString ps = domelem.attribute( "style" ); + TQString ps = domelem.attribute( "style" ); int pointstyle = ObjectDrawer::pointStyleFromString( ps ); // show this object? bool show = ( ( domelem.attribute( "masked" ) != "True" ) && @@ -752,7 +752,7 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons // costructing the ObjectDrawer* ObjectDrawer* d = new ObjectDrawer( co, w, show, s, pointstyle ); // reading object name - QString strname = domelem.attribute( "name" ); + TQString strname = domelem.attribute( "name" ); ObjectConstCalcer* name = new ObjectConstCalcer( new StringImp( strname ) ); // creating the ObjectHolder* @@ -770,7 +770,7 @@ KigDocument* KigFilterDrgeo::importFigure( QDomNode f, const QString& file, cons { std::vector args2; args2.push_back( o->nameCalcer() ); - oc2 = fact->attachedLabelCalcer( QString::fromLatin1( "%1" ), oc, + oc2 = fact->attachedLabelCalcer( TQString::fromLatin1( "%1" ), oc, static_cast( oc->imp() )->coordinate(), false, args2, *ret ); co = Qt::black; diff --git a/kig/filters/drgeo-filter.h b/kig/filters/drgeo-filter.h index 7485fd5b..d684c5e5 100644 --- a/kig/filters/drgeo-filter.h +++ b/kig/filters/drgeo-filter.h @@ -37,10 +37,10 @@ protected: public: static KigFilterDrgeo* instance(); - bool supportMime( const QString& mime ); - KigDocument* load( const QString& file ); + bool supportMime( const TQString& mime ); + KigDocument* load( const TQString& file ); private: - KigDocument* importFigure( QDomNode f, const QString& file, const bool grid ); + KigDocument* importFigure( TQDomNode f, const TQString& file, const bool grid ); }; #endif diff --git a/kig/filters/exporter.cc b/kig/filters/exporter.cc index c2ece44e..b44888f0 100644 --- a/kig/filters/exporter.cc +++ b/kig/filters/exporter.cc @@ -36,11 +36,11 @@ #include "../objects/point_imp.h" #include "../objects/text_imp.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -52,7 +52,7 @@ #include // we need this for storing colors in a std::map.. -static bool operator<( const QColor& a, const QColor& b ) +static bool operator<( const TQColor& a, const TQColor& b ) { return a.rgb() < b.rgb(); } @@ -74,13 +74,13 @@ ExporterAction::ExporterAction( const KigPart* doc, KigWidget* w, : KAction( exp->menuEntryName(), KShortcut(), 0, 0, parent ), mexp( exp ), mdoc( doc ), mw( w ) { - QString iconstr = exp->menuIcon(); + TQString iconstr = exp->menuIcon(); if ( iconstr.isEmpty() ) return; KIconLoader* l = doc->instance()->iconLoader(); - QPixmap icon = l->loadIcon( iconstr, KIcon::Small, 16, KIcon::DefaultState, 0L, true ); + TQPixmap icon = l->loadIcon( iconstr, KIcon::Small, 16, KIcon::DefaultState, 0L, true ); if ( !icon.isNull() ) - setIconSet( QIconSet( icon ) ); + setIconSet( TQIconSet( icon ) ); } void ExporterAction::slotActivated() @@ -96,17 +96,17 @@ ImageExporter::~ImageExporter() { } -QString ImageExporter::exportToStatement() const +TQString ImageExporter::exportToStatement() const { return i18n( "&Export to image" ); } -QString ImageExporter::menuEntryName() const +TQString ImageExporter::menuEntryName() const { return i18n( "&Image..." ); } -QString ImageExporter::menuIcon() const +TQString ImageExporter::menuIcon() const { return "image"; } @@ -121,7 +121,7 @@ void ImageExporter::run( const KigPart& doc, KigWidget& w ) } KigFileDialog* kfd = new KigFileDialog( - QString::null, KImageIO::pattern( KImageIO::Writing ), + TQString::null, KImageIO::pattern( KImageIO::Writing ), i18n( "Export as Image" ), &w ); kfd->setOptionCaption( i18n( "Image Options" ) ); ImageExporterOptions* opts = new ImageExporterOptions( 0L, w.size() ); @@ -133,7 +133,7 @@ void ImageExporter::run( const KigPart& doc, KigWidget& w ) if ( !kfd->exec() ) return; - QString filename = kfd->selectedFile(); + TQString filename = kfd->selectedFile(); bool showgrid = opts->showGridCheckBox->isOn(); bool showaxes = opts->showAxesCheckBox->isOn(); int width = opts->WidthInput->value(); @@ -142,7 +142,7 @@ void ImageExporter::run( const KigPart& doc, KigWidget& w ) delete opts; delete kfd; - QString type = KImageIO::type( filename ); + TQString type = KImageIO::type( filename ); if ( type.isNull() ) { KMessageBox::sorry( &w, i18n( "Sorry, this file format is not supported." ) ); @@ -151,7 +151,7 @@ void ImageExporter::run( const KigPart& doc, KigWidget& w ) kdDebug() << k_funcinfo << type << endl; - QFile file( filename ); + TQFile file( filename ); if ( ! file.open( IO_WriteOnly ) ) { KMessageBox::sorry( &w, @@ -160,7 +160,7 @@ void ImageExporter::run( const KigPart& doc, KigWidget& w ) return; }; - QPixmap img( QSize( width, height ) ); + TQPixmap img( TQSize( width, height ) ); img.fill( Qt::white ); KigPainter p( ScreenInfo( w.screenInfo().shownRect(), img.rect() ), &img, doc.document() ); p.setWholeWinOverlay(); @@ -208,18 +208,18 @@ XFigExporter::~XFigExporter() { } -QString XFigExporter::exportToStatement() const +TQString XFigExporter::exportToStatement() const { return i18n( "Export to &XFig file" ); } -QString XFigExporter::menuEntryName() const +TQString XFigExporter::menuEntryName() const { return i18n( "&XFig File..." ); } -QString XFigExporter::menuIcon() const +TQString XFigExporter::menuIcon() const { return "kig_xfig"; } @@ -227,15 +227,15 @@ QString XFigExporter::menuIcon() const class XFigExportImpVisitor : public ObjectImpVisitor { - QTextStream& mstream; + TQTextStream& mstream; ObjectHolder* mcurobj; const KigWidget& mw; Rect msr; - std::map mcolormap; + std::map mcolormap; int mnextcolorid; int mcurcolorid; - QPoint convertCoord( const Coordinate& c ) + TQPoint convertCoord( const Coordinate& c ) { Coordinate ret = ( c - msr.bottomLeft() ); ret.y = msr.height() - ret.y; @@ -252,7 +252,7 @@ public: void visit( ObjectHolder* obj ); void mapColor( const ObjectDrawer* obj ); - XFigExportImpVisitor( QTextStream& s, const KigWidget& w ) + XFigExportImpVisitor( TQTextStream& s, const KigWidget& w ) : mstream( s ), mw( w ), msr( mw.showingRect() ), mnextcolorid( 32 ) { @@ -283,7 +283,7 @@ public: void XFigExportImpVisitor::mapColor( const ObjectDrawer* obj ) { if ( ! obj->shown() ) return; - QColor color = obj->color(); + TQColor color = obj->color(); if ( mcolormap.find( color ) == mcolormap.end() ) { int newcolorid = mnextcolorid++; @@ -351,15 +351,15 @@ void XFigExportImpVisitor::emitLine( const Coordinate& a, const Coordinate& b, i << "165.00 " // arrow_height << "\n\t"; } - QPoint ca = convertCoord( a ); - QPoint cb = convertCoord( b ); + TQPoint ca = convertCoord( a ); + TQPoint cb = convertCoord( b ); mstream << ca.x() << " " << ca.y() << " " << cb.x() << " " << cb.y() << "\n"; } void XFigExportImpVisitor::visit( const PointImp* imp ) { - const QPoint center = convertCoord( imp->coordinate() ); + const TQPoint center = convertCoord( imp->coordinate() ); int width = mcurobj->drawer()->width(); if ( width == -1 ) width = 5; width *= 10; @@ -387,8 +387,8 @@ void XFigExportImpVisitor::visit( const PointImp* imp ) void XFigExportImpVisitor::visit( const TextImp* imp ) { - QString text = imp->text(); - QPoint coord = convertCoord( imp->surroundingRect().bottomLeft() ); + TQString text = imp->text(); + TQPoint coord = convertCoord( imp->surroundingRect().bottomLeft() ); mstream << "4 " // text type << "0 " // subtype: left justfied @@ -424,7 +424,7 @@ void XFigExportImpVisitor::visit( const LocusImp* ) void XFigExportImpVisitor::visit( const CircleImp* imp ) { - const QPoint center = convertCoord( imp->center() ); + const TQPoint center = convertCoord( imp->center() ); const int radius = ( convertCoord( imp->center() + Coordinate( imp->radius(), 0 ) ) - center ).x(); @@ -477,12 +477,12 @@ void XFigExportImpVisitor::visit( const ConicImp* imp ) double radiusy = sqrt( r*r - d*d ); Coordinate center = data.focus1 - Coordinate( cos( anglex ), sin( anglex ) ).normalize( d ); - const QPoint qcenter = convertCoord( center ); + const TQPoint qcenter = convertCoord( center ); const int radius_x = ( convertCoord( center + Coordinate( radiusx, 0 ) ) - convertCoord( center ) ).x(); const int radius_y = ( convertCoord( center + Coordinate( radiusy, 0 ) ) - convertCoord( center ) ).x(); - const QPoint qpoint2 = convertCoord( center + Coordinate( -sin( anglex ), cos( anglex ) ) * radiusy ); + const TQPoint qpoint2 = convertCoord( center + Coordinate( -sin( anglex ), cos( anglex ) ) * radiusy ); mstream << "1 " // ellipse type << "1 " // subtype: ellipse defined by readii @@ -544,10 +544,10 @@ void XFigExportImpVisitor::visit( const ArcImp* imp ) const Coordinate ad = Coordinate( cos( startangle ), sin( startangle ) ).normalize( radius ); const Coordinate bd = Coordinate( cos( middleangle ), sin( middleangle ) ).normalize( radius ); const Coordinate cd = Coordinate( cos( endangle ), sin( endangle ) ).normalize( radius ); - const QPoint a = convertCoord( center + ad ); - const QPoint b = convertCoord( center + bd ); - const QPoint c = convertCoord( center + cd ); - const QPoint cent = convertCoord( center ); + const TQPoint a = convertCoord( center + ad ); + const TQPoint b = convertCoord( center + bd ); + const TQPoint c = convertCoord( center + cd ); + const TQPoint cent = convertCoord( center ); mstream << "5 " // Ellipse type << "1 " // subtype: open ended arc @@ -584,11 +584,11 @@ void XFigExporter::run( const KigPart& doc, KigWidget& w ) if ( !kfd->exec() ) return; - QString file_name = kfd->selectedFile(); + TQString file_name = kfd->selectedFile(); delete kfd; - QFile file( file_name ); + TQFile file( file_name ); if ( ! file.open( IO_WriteOnly ) ) { KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please " @@ -596,7 +596,7 @@ void XFigExporter::run( const KigPart& doc, KigWidget& w ) .arg( file_name ) ); return; }; - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << "#FIG 3.2\n"; stream << "Landscape\n"; stream << "Center\n"; diff --git a/kig/filters/exporter.h b/kig/filters/exporter.h index 4fc74453..42670abf 100644 --- a/kig/filters/exporter.h +++ b/kig/filters/exporter.h @@ -52,15 +52,15 @@ public: /** * Returns a statement like i18n( "Export to image" ) */ - virtual QString exportToStatement() const = 0; + virtual TQString exportToStatement() const = 0; /** * Returns a string like i18n( "Image..." ) */ - virtual QString menuEntryName() const = 0; + virtual TQString menuEntryName() const = 0; /** * Returns a string with the name of the icon */ - virtual QString menuIcon() const = 0; + virtual TQString menuIcon() const = 0; /** * Do what you need to do. It's up to the individual exporters to @@ -78,9 +78,9 @@ class ImageExporter { public: ~ImageExporter(); - QString exportToStatement() const; - QString menuEntryName() const; - QString menuIcon() const; + TQString exportToStatement() const; + TQString menuEntryName() const; + TQString menuIcon() const; void run( const KigPart& doc, KigWidget& w ); }; @@ -94,9 +94,9 @@ class XFigExporter { public: ~XFigExporter(); - QString exportToStatement() const; - QString menuEntryName() const; - QString menuIcon() const; + TQString exportToStatement() const; + TQString menuEntryName() const; + TQString menuIcon() const; void run( const KigPart& doc, KigWidget& w ); }; #endif diff --git a/kig/filters/filter.cc b/kig/filters/filter.cc index 70290e8a..81cd1ef4 100644 --- a/kig/filters/filter.cc +++ b/kig/filters/filter.cc @@ -31,7 +31,7 @@ KigFilters* KigFilters::sThis; -KigFilter* KigFilters::find(const QString& mime) +KigFilter* KigFilters::find(const TQString& mime) { for (vect::iterator i = mFilters.begin(); i != mFilters.end(); ++i) { @@ -62,12 +62,12 @@ KigFilter::~KigFilter() { } -bool KigFilter::supportMime( const QString& ) +bool KigFilter::supportMime( const TQString& ) { return false; } -void KigFilter::fileNotFound( const QString& file ) const +void KigFilter::fileNotFound( const TQString& file ) const { KMessageBox::sorry( 0, i18n( "The file \"%1\" could not be opened. " @@ -76,12 +76,12 @@ void KigFilter::fileNotFound( const QString& file ) const "its permissions" ).arg( file ) ); } -void KigFilter::parseError( const QString& file, const QString& explanation ) const +void KigFilter::parseError( const TQString& file, const TQString& explanation ) const { - const QString text = + const TQString text = i18n( "An error was encountered while parsing the file \"%1\". It " "cannot be opened." ).arg( file ); - const QString title = i18n( "Parse Error" ); + const TQString title = i18n( "Parse Error" ); if ( explanation.isNull() ) KMessageBox::sorry( 0, text, title ); @@ -89,25 +89,25 @@ void KigFilter::parseError( const QString& file, const QString& explanation ) co KMessageBox::detailedSorry( 0, text, explanation, title ); } -void KigFilter::notSupported( const QString& file, const QString& explanation ) const +void KigFilter::notSupported( const TQString& file, const TQString& explanation ) const { KMessageBox::detailedSorry( 0, i18n( "Kig cannot open the file \"%1\"." ).arg( file ), explanation, i18n( "Not Supported" ) ); } -void KigFilter::warning( const QString& explanation ) const +void KigFilter::warning( const TQString& explanation ) const { KMessageBox::information( 0, explanation ); } -bool KigFilters::save( const KigDocument& data, const QString& tofile ) +bool KigFilters::save( const KigDocument& data, const TQString& tofile ) { return KigFilterNative::instance()->save( data, tofile ); } /* -bool KigFilters::save( const KigDocument& data, QTextStream& stream ) +bool KigFilters::save( const KigDocument& data, TQTextStream& stream ) { return KigFilterNative::instance()->save( data, stream ); } diff --git a/kig/filters/filter.h b/kig/filters/filter.h index f5d8b0f9..c887b05c 100644 --- a/kig/filters/filter.h +++ b/kig/filters/filter.h @@ -19,7 +19,7 @@ #ifndef FILTER_H #define FILTER_H -#include +#include #include @@ -34,14 +34,14 @@ class KigFilters { public: static KigFilters* instance(); - KigFilter* find (const QString& mime); + KigFilter* find (const TQString& mime); -// bool save ( const KigDocument& data, QTextStream& stream ); +// bool save ( const KigDocument& data, TQTextStream& stream ); /** * saving is always done with the native filter. We don't support * output filters.. */ - bool save ( const KigDocument& data, const QString& outfile ); + bool save ( const KigDocument& data, const TQString& outfile ); protected: KigFilters(); static KigFilters* sThis; @@ -53,7 +53,7 @@ protected: // return a very useful parse error in a filter's load function.. #define KIG_FILTER_PARSE_ERROR \ { \ - QString locs = i18n( "An error was encountered at " \ + TQString locs = i18n( "An error was encountered at " \ "line %1 in file %2." ) \ .arg( __LINE__ ).arg( __FILE__ ); \ parseError( file, locs ); \ @@ -70,10 +70,10 @@ class KigFilter { protected: // shows errors to the user.. - void fileNotFound( const QString& file ) const; - void parseError( const QString& file, const QString& explanation = QString::null ) const; - void notSupported( const QString& file, const QString& explanation ) const; - void warning( const QString& explanation ) const; + void fileNotFound( const TQString& file ) const; + void parseError( const TQString& file, const TQString& explanation = TQString::null ) const; + void notSupported( const TQString& file, const TQString& explanation ) const; + void warning( const TQString& explanation ) const; public: KigFilter(); virtual ~KigFilter(); @@ -81,7 +81,7 @@ public: /** * can the filter handle the mimetype \p mime ? */ - virtual bool supportMime ( const QString& mime ); + virtual bool supportMime ( const TQString& mime ); /** * load file \p fromfile and build a KigDocument from it.. If this @@ -91,6 +91,6 @@ public: * functions ). If this functions returns non-0, the caller owns * the returned KigDocument ( that was allocated with "new" ). */ - virtual KigDocument* load ( const QString& fromfile ) = 0; + virtual KigDocument* load ( const TQString& fromfile ) = 0; }; #endif diff --git a/kig/filters/filters-common.cc b/kig/filters/filters-common.cc index d25c2e14..4ba24e9f 100644 --- a/kig/filters/filters-common.cc +++ b/kig/filters/filters-common.cc @@ -19,21 +19,21 @@ #include -#include -#include +#include +#include #include "../objects/object_calcer.h" #include "../objects/object_factory.h" ObjectTypeCalcer* filtersConstructTextObject( const Coordinate& c, ObjectCalcer* o, - const QCString& arg, const KigDocument& doc, bool needframe ) + const TQCString& arg, const KigDocument& doc, bool needframe ) { const ObjectFactory* fact = ObjectFactory::instance(); ObjectCalcer* propo = fact->propertyObjectCalcer( o, arg ); propo->calc( doc ); std::vector args; args.push_back( propo ); - return fact->labelCalcer( QString::fromLatin1( "%1" ), c, needframe, + return fact->labelCalcer( TQString::fromLatin1( "%1" ), c, needframe, args, doc ); } diff --git a/kig/filters/filters-common.h b/kig/filters/filters-common.h index c46facc4..6bc8a57a 100644 --- a/kig/filters/filters-common.h +++ b/kig/filters/filters-common.h @@ -27,4 +27,4 @@ class KigDocument; */ ObjectTypeCalcer* filtersConstructTextObject( const Coordinate& c, ObjectCalcer* o, - const QCString& arg, const KigDocument& doc, bool needframe ); + const TQCString& arg, const KigDocument& doc, bool needframe ); diff --git a/kig/filters/imageexporteroptions.cc b/kig/filters/imageexporteroptions.cc index cb996926..cd68a0af 100644 --- a/kig/filters/imageexporteroptions.cc +++ b/kig/filters/imageexporteroptions.cc @@ -18,18 +18,18 @@ #include "imageexporteroptions.h" #include "imageexporteroptions.moc" -#include -#include +#include +#include #include -ImageExporterOptions::ImageExporterOptions( QWidget* parent, const QSize& s ) +ImageExporterOptions::ImageExporterOptions( TQWidget* parent, const TQSize& s ) : ImageExporterOptionsBase( parent, "imageexporteroptions" ), msize( s ), minternallysettingstuff( false ) { keepAspectRatio->setChecked( true ); - connect( WidthInput, SIGNAL( valueChanged( int ) ), this, SLOT( slotWidthChanged( int ) ) ); - connect( HeightInput, SIGNAL( valueChanged( int ) ), this, SLOT( slotHeightChanged( int ) ) ); + connect( WidthInput, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotWidthChanged( int ) ) ); + connect( HeightInput, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotHeightChanged( int ) ) ); } ImageExporterOptions::~ImageExporterOptions() diff --git a/kig/filters/imageexporteroptions.h b/kig/filters/imageexporteroptions.h index 1ef6a855..69922803 100644 --- a/kig/filters/imageexporteroptions.h +++ b/kig/filters/imageexporteroptions.h @@ -27,14 +27,14 @@ class ImageExporterOptions { Q_OBJECT - QSize msize; + TQSize msize; // this is set by slotWidthChanged() when they set the other input // widget's value, to avoid reacting to internal changes to the // value like to user changes... bool minternallysettingstuff; public: - ImageExporterOptions( QWidget* parent, const QSize& s ); + ImageExporterOptions( TQWidget* parent, const TQSize& s ); ~ImageExporterOptions(); protected slots: diff --git a/kig/filters/kgeo-filter.cc b/kig/filters/kgeo-filter.cc index da26457d..02c1efde 100644 --- a/kig/filters/kgeo-filter.cc +++ b/kig/filters/kgeo-filter.cc @@ -47,12 +47,12 @@ #include #include -bool KigFilterKGeo::supportMime( const QString& mime ) +bool KigFilterKGeo::supportMime( const TQString& mime ) { return mime == "application/x-kgeo"; } -KigDocument* KigFilterKGeo::load( const QString& sFrom ) +KigDocument* KigFilterKGeo::load( const TQString& sFrom ) { // kgeo uses a KSimpleConfig to save its contents... KSimpleConfig config ( sFrom ); @@ -100,13 +100,13 @@ static std::vector sortElems( const std::vectorsetGroup("Main"); int number = c->readNumEntry ("Number"); @@ -125,12 +125,12 @@ KigDocument* KigFilterKGeo::loadObjects( const QString& file, KSimpleConfig* c ) group.setNum( i + 1 ); group.prepend( "Object " ); c->setGroup( group ); - QStrList parents; + TQStrList parents; c->readListEntry( "Parents", parents ); elems.push_back( elem ); for ( const char* parent = parents.first(); parent; parent = parents.next() ) { - int parentIndex = QString::fromLatin1( parent ).toInt( &ok ); + int parentIndex = TQString::fromLatin1( parent ).toInt( &ok ); if ( ! ok ) KIG_FILTER_PARSE_ERROR; if ( parentIndex != 0 ) elems[i].parents.push_back( parentIndex - 1 ); @@ -166,8 +166,8 @@ KigDocument* KigFilterKGeo::loadObjects( const QString& file, KSimpleConfig* c ) case ID_point: { // fetch the coordinates... - QString strX = c->readEntry("QPointX"); - QString strY = c->readEntry("QPointY"); + TQString strX = c->readEntry("QPointX"); + TQString strY = c->readEntry("QPointY"); double x = strX.toDouble(&ok); if (!ok) KIG_FILTER_PARSE_ERROR; double y = strY.toDouble(&ok); @@ -251,7 +251,7 @@ KigDocument* KigFilterKGeo::loadObjects( const QString& file, KSimpleConfig* c ) bool frame = c->readBoolEntry( "Frame" ); double x = c->readDoubleNumEntry( "TextRectCenterX" ); double y = c->readDoubleNumEntry( "TextRectCenterY" ); - QString text = c->readEntry( "TextRectEntry" ); + TQString text = c->readEntry( "TextRectEntry" ); double height = c->readNumEntry( "TextRectHeight" ); double width = c->readNumEntry( "TextRectWidth" ); // we don't want the center, but the top left.. @@ -344,7 +344,7 @@ KigDocument* KigFilterKGeo::loadObjects( const QString& file, KSimpleConfig* c ) }; // set the color... - QColor co = c->readColorEntry( "Color" ); + TQColor co = c->readColorEntry( "Color" ); if( !co.isValid() ) co = Qt::blue; ObjectDrawer* d = new ObjectDrawer( co ); diff --git a/kig/filters/kgeo-filter.h b/kig/filters/kgeo-filter.h index 1a2ff83d..f8accd91 100644 --- a/kig/filters/kgeo-filter.h +++ b/kig/filters/kgeo-filter.h @@ -37,14 +37,14 @@ class KigFilterKGeo { public: static KigFilterKGeo* instance(); - bool supportMime ( const QString& mime ); - KigDocument* load ( const QString& from ); + bool supportMime ( const TQString& mime ); + KigDocument* load ( const TQString& from ); protected: KigFilterKGeo(); ~KigFilterKGeo(); void loadMetrics ( KSimpleConfig* ); - KigDocument* loadObjects ( const QString& file, KSimpleConfig* ); + KigDocument* loadObjects ( const TQString& file, KSimpleConfig* ); int xMax; int yMax; diff --git a/kig/filters/kgeo-resource.h b/kig/filters/kgeo-resource.h index 2a272ed0..f7af0f64 100644 --- a/kig/filters/kgeo-resource.h +++ b/kig/filters/kgeo-resource.h @@ -47,7 +47,7 @@ #endif #include -#include +#include #include /////////////////////////////////////////////////////////////////// diff --git a/kig/filters/kseg-defs.h b/kig/filters/kseg-defs.h index ad90fa1a..59dd3e4c 100644 --- a/kig/filters/kseg-defs.h +++ b/kig/filters/kseg-defs.h @@ -47,7 +47,7 @@ #include #include -#include +#include using namespace std; diff --git a/kig/filters/kseg-filter.cc b/kig/filters/kseg-filter.cc index f2ba901b..fb96c25c 100644 --- a/kig/filters/kseg-filter.cc +++ b/kig/filters/kseg-filter.cc @@ -43,12 +43,12 @@ #include "../objects/transform_types.h" #include "../objects/vector_type.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -60,7 +60,7 @@ KigFilterKSeg::~KigFilterKSeg() { } -bool KigFilterKSeg::supportMime( const QString& mime ) +bool KigFilterKSeg::supportMime( const TQString& mime ) { return mime == "application/x-kseg"; } @@ -68,12 +68,12 @@ bool KigFilterKSeg::supportMime( const QString& mime ) struct drawstyle { Q_INT8 pointstyle; - QFont font; - QPen pen; - QBrush brush; + TQFont font; + TQPen pen; + TQBrush brush; }; -static Coordinate readKSegCoordinate( QDataStream& stream ) +static Coordinate readKSegCoordinate( TQDataStream& stream ) { // read the coord.. float inx, iny; @@ -135,7 +135,7 @@ static ObjectTypeCalcer* intersectionPoint( const std::vector& pa else return 0; } -ObjectCalcer* KigFilterKSeg::transformObject( const QString& file, KigDocument& kigdoc, +ObjectCalcer* KigFilterKSeg::transformObject( const TQString& file, KigDocument& kigdoc, std::vector& parents, int subtype, bool& ok ) { @@ -196,9 +196,9 @@ ObjectCalcer* KigFilterKSeg::transformObject( const QString& file, KigDocument& return retobj; } -KigDocument* KigFilterKSeg::load( const QString& file ) +KigDocument* KigFilterKSeg::load( const TQString& file ) { - QFile ffile( file ); + TQFile ffile( file ); if ( ! ffile.open( IO_ReadOnly ) ) { fileNotFound( file ); @@ -207,18 +207,18 @@ KigDocument* KigFilterKSeg::load( const QString& file ) KigDocument* retdoc = new KigDocument(); - QDataStream fstream( &ffile ); + TQDataStream fstream( &ffile ); - QString versionstring; + TQString versionstring; fstream >> versionstring; if ( !versionstring.startsWith( "KSeg Document Version " ) ) KIG_FILTER_PARSE_ERROR; - QByteArray array; + TQByteArray array; fstream >> array; - QBuffer buf( array ); + TQBuffer buf( array ); buf.open( IO_ReadOnly ); - QDataStream stream( &buf ); + TQDataStream stream( &buf ); stream.setVersion( 3 ); @@ -281,7 +281,7 @@ KigDocument* KigFilterKSeg::load( const QString& file ) if ( type == G_LOOP ) continue; // read the label.. - QString labeltext; + TQString labeltext; stream >> labeltext; Coordinate relcoord = readKSegCoordinate( stream ); // shut up gcc @@ -298,7 +298,7 @@ KigDocument* KigFilterKSeg::load( const QString& file ) ObjectCalcer* o = 0; bool ok = true; - QColor color = style.pen.color(); + TQColor color = style.pen.color(); int width = style.pen.width(); /* @@ -636,7 +636,7 @@ KigDocument* KigFilterKSeg::load( const QString& file ) std::vector args2; args2.push_back( object->nameCalcer() ); ObjectCalcer* oc2 = fact->attachedLabelCalcer( - QString::fromLatin1( "%1" ), object->calcer(), + TQString::fromLatin1( "%1" ), object->calcer(), static_cast( object->imp() )->coordinate(), false, args2, *retdoc ); oc2->calc( *retdoc ); @@ -652,7 +652,7 @@ KigDocument* KigFilterKSeg::load( const QString& file ) stream >> selgroupcount; for ( int i = 0; i < selgroupcount; ++i ) { - QString name; + TQString name; stream >> name; int size; stream >> size; diff --git a/kig/filters/kseg-filter.h b/kig/filters/kseg-filter.h index af475a7a..03d03958 100644 --- a/kig/filters/kseg-filter.h +++ b/kig/filters/kseg-filter.h @@ -28,15 +28,15 @@ class KigFilterKSeg KigFilterKSeg(); ~KigFilterKSeg(); - ObjectCalcer* transformObject( const QString& file, KigDocument& kigdoc, + ObjectCalcer* transformObject( const TQString& file, KigDocument& kigdoc, std::vector& parents, int subtype, bool& ok ); public: static KigFilterKSeg* instance(); - bool supportMime ( const QString& mime ); - KigDocument* load ( const QString& fromfile ); + bool supportMime ( const TQString& mime ); + KigDocument* load ( const TQString& fromfile ); }; #endif diff --git a/kig/filters/latexexporter.cc b/kig/filters/latexexporter.cc index 955ac148..98d3fc2e 100644 --- a/kig/filters/latexexporter.cc +++ b/kig/filters/latexexporter.cc @@ -44,10 +44,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -59,25 +59,25 @@ #endif struct ColorMap { - QColor color; - QString name; + TQColor color; + TQString name; }; LatexExporter::~LatexExporter() { } -QString LatexExporter::exportToStatement() const +TQString LatexExporter::exportToStatement() const { return i18n( "Export to &Latex..." ); } -QString LatexExporter::menuEntryName() const +TQString LatexExporter::menuEntryName() const { return i18n( "&Latex..." ); } -QString LatexExporter::menuIcon() const +TQString LatexExporter::menuIcon() const { // TODO return "tex"; @@ -86,17 +86,17 @@ QString LatexExporter::menuIcon() const class LatexExportImpVisitor : public ObjectImpVisitor { - QTextStream& mstream; + TQTextStream& mstream; ObjectHolder* mcurobj; const KigWidget& mw; Rect msr; std::vector mcolors; - QString mcurcolorid; + TQString mcurcolorid; public: void visit( ObjectHolder* obj ); - void mapColor( QColor color ); + void mapColor( TQColor color ); - LatexExportImpVisitor( QTextStream& s, const KigWidget& w ) + LatexExportImpVisitor( TQTextStream& s, const KigWidget& w ) : mstream( s ), mw( w ), msr( mw.showingRect() ) { } @@ -135,7 +135,7 @@ private: * Searches if a color is already mapped into mcolors, and returns its * index or -1 if not found. */ - int findColor( QColor c ); + int findColor( TQColor c ); /** * Use to convert a dimension "on the screen" to a dimension wrt. * Kig coordinate system. @@ -144,7 +144,7 @@ private: /** * Converts a pen style into latex style string. */ - QString writeStyle( Qt::PenStyle style ); + TQString writeStyle( Qt::PenStyle style ); /** * Plots a generic curve though its points calc'ed with getPoint. */ @@ -177,7 +177,7 @@ void LatexExportImpVisitor::newLine() mstream << "\n"; } -int LatexExportImpVisitor::findColor( QColor c ) +int LatexExportImpVisitor::findColor( TQColor c ) { for ( uint i = 0; i < mcolors.size(); ++i ) { @@ -187,13 +187,13 @@ int LatexExportImpVisitor::findColor( QColor c ) return -1; } -void LatexExportImpVisitor::mapColor( QColor color ) +void LatexExportImpVisitor::mapColor( TQColor color ) { if ( findColor( color ) == -1 ) { ColorMap newcolor; newcolor.color = color; - QString tmpname = color.name(); + TQString tmpname = color.name(); tmpname.replace( "#", "" ); newcolor.name = tmpname; mcolors.push_back( newcolor ); @@ -205,14 +205,14 @@ void LatexExportImpVisitor::mapColor( QColor color ) double LatexExportImpVisitor::dimRealToCoord( int dim ) { - QRect qr( 0, 0, dim, dim ); + TQRect qr( 0, 0, dim, dim ); Rect r = mw.screenInfo().fromScreen( qr ); return fabs( r.width() ); } -QString LatexExportImpVisitor::writeStyle( Qt::PenStyle style ) +TQString LatexExportImpVisitor::writeStyle( Qt::PenStyle style ) { - QString ret( "linestyle=" ); + TQString ret( "linestyle=" ); if ( style == Qt::DashLine ) ret += "dashed"; else if ( style == Qt::DotLine ) @@ -227,7 +227,7 @@ void LatexExportImpVisitor::plotGenericCurve( const CurveImp* imp ) int width = mcurobj->drawer()->width(); if ( width == -1 ) width = 1; - QString prefix = QString( "\\pscurve[linecolor=%1,linewidth=%2,%3]" ) + TQString prefix = TQString( "\\pscurve[linecolor=%1,linewidth=%2,%3]" ) .arg( mcurcolorid ) .arg( width / 100.0 ) .arg( writeStyle( mcurobj->drawer()->style() ) ); @@ -319,7 +319,7 @@ void LatexExportImpVisitor::visit( const PointImp* imp ) mstream << "\\psdots[linecolor=" << mcurcolorid << ",dotscale=" << width << ",dotstyle="; const int ps = mcurobj->drawer()->pointStyle(); - QString pss( "*,fillstyle=solid,fillcolor=" + mcurcolorid ); + TQString pss( "*,fillstyle=solid,fillcolor=" + mcurcolorid ); if ( ps == 1 ) pss = "o,fillstyle=none"; else if ( ps == 2 ) @@ -483,7 +483,7 @@ void LatexExportImpVisitor::visit( const PolygonImp* imp ) void LatexExporter::run( const KigPart& doc, KigWidget& w ) { KigFileDialog* kfd = new KigFileDialog( - QString::null, i18n( "*.tex|Latex Documents (*.tex)" ), + TQString::null, i18n( "*.tex|Latex Documents (*.tex)" ), i18n( "Export as Latex" ), &w ); kfd->setOptionCaption( i18n( "Latex Options" ) ); LatexExporterOptions* opts = new LatexExporterOptions( 0L ); @@ -494,7 +494,7 @@ void LatexExporter::run( const KigPart& doc, KigWidget& w ) if ( !kfd->exec() ) return; - QString file_name = kfd->selectedFile(); + TQString file_name = kfd->selectedFile(); bool showgrid = opts->showGridCheckBox->isOn(); bool showaxes = opts->showAxesCheckBox->isOn(); bool showframe = opts->showExtraFrameCheckBox->isOn(); @@ -502,7 +502,7 @@ void LatexExporter::run( const KigPart& doc, KigWidget& w ) delete opts; delete kfd; - QFile file( file_name ); + TQFile file( file_name ); if ( ! file.open( IO_WriteOnly ) ) { KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please " @@ -511,7 +511,7 @@ void LatexExporter::run( const KigPart& doc, KigWidget& w ) return; }; - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << "\\documentclass[a4paper]{minimal}\n"; // stream << "\\usepackage[latin1]{inputenc}\n"; stream << "\\usepackage{pstricks}\n"; @@ -549,10 +549,10 @@ void LatexExporter::run( const KigPart& doc, KigWidget& w ) if ( ! ( *i )->shown() ) continue; visitor.mapColor( ( *i )->drawer()->color() ); }; - visitor.mapColor( QColor( 255, 255, 222 ) ); // ffffde - text label background - visitor.mapColor( QColor( 197, 194, 197 ) ); // c5c2c5 - text label border line - visitor.mapColor( QColor( 160, 160, 164 ) ); // a0a0a4 - axes color - visitor.mapColor( QColor( 192, 192, 192 ) ); // c0c0c0 - grid color + visitor.mapColor( TQColor( 255, 255, 222 ) ); // ffffde - text label background + visitor.mapColor( TQColor( 197, 194, 197 ) ); // c5c2c5 - text label border line + visitor.mapColor( TQColor( 160, 160, 164 ) ); // a0a0a4 - axes color + visitor.mapColor( TQColor( 192, 192, 192 ) ); // c0c0c0 - grid color // extra frame if ( showframe ) diff --git a/kig/filters/latexexporter.h b/kig/filters/latexexporter.h index 32638de1..23d9d7aa 100644 --- a/kig/filters/latexexporter.h +++ b/kig/filters/latexexporter.h @@ -32,9 +32,9 @@ class LatexExporter { public: ~LatexExporter(); - QString exportToStatement() const; - QString menuEntryName() const; - QString menuIcon() const; + TQString exportToStatement() const; + TQString menuEntryName() const; + TQString menuIcon() const; void run( const KigPart& doc, KigWidget& w ); }; diff --git a/kig/filters/native-filter.cc b/kig/filters/native-filter.cc index 6cecf09b..a5378263 100644 --- a/kig/filters/native-filter.cc +++ b/kig/filters/native-filter.cc @@ -32,9 +32,9 @@ #include "config.h" -#include -#include -#include +#include +#include +#include #include #include @@ -52,7 +52,7 @@ struct HierElem { int id; std::vector parents; - QDomElement el; + TQDomElement el; }; static void extendVect( std::vector& vect, uint size ) @@ -97,21 +97,21 @@ KigFilterNative::~KigFilterNative() { } -bool KigFilterNative::supportMime( const QString& mime ) +bool KigFilterNative::supportMime( const TQString& mime ) { return mime == "application/x-kig"; } -KigDocument* KigFilterNative::load( const QString& file ) +KigDocument* KigFilterNative::load( const TQString& file ) { - QFile ffile( file ); + TQFile ffile( file ); if ( ! ffile.open( IO_ReadOnly ) ) { fileNotFound( file ); return 0; }; - QFile kigdoc( file ); + TQFile kigdoc( file ); #ifndef KIG_NO_COMPRESSED_FILES bool iscompressed = false; if ( !file.endsWith( ".kig", false ) ) @@ -120,14 +120,14 @@ KigDocument* KigFilterNative::load( const QString& file ) // kig file inside it... iscompressed = true; - QString tempdir = KGlobal::dirs()->saveLocation( "tmp" ); + TQString tempdir = KGlobal::dirs()->saveLocation( "tmp" ); if ( tempdir.isEmpty() ) KIG_FILTER_PARSE_ERROR; - QString tempname = file.section( '/', -1 ); + TQString tempname = file.section( '/', -1 ); if ( file.endsWith( ".kigz", false ) ) { - tempname.remove( QRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); + tempname.remove( TQRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); } else KIG_FILTER_PARSE_ERROR; @@ -136,8 +136,8 @@ KigDocument* KigFilterNative::load( const QString& file ) ark->open( IO_ReadOnly ); const KArchiveDirectory* dir = ark->directory(); // assert( dir ); - QStringList entries = dir->entries(); - QStringList kigfiles = entries.grep( QRegExp( "\\.kig$" ) ); + TQStringList entries = dir->entries(); + TQStringList kigfiles = entries.grep( TQRegExp( "\\.kig$" ) ); if ( kigfiles.count() != 1 ) // I throw a generic parse error here, but I should warn the user that // this kig archive file doesn't contain one kig file (it contains no @@ -148,7 +148,7 @@ KigDocument* KigFilterNative::load( const QString& file ) KIG_FILTER_PARSE_ERROR; dynamic_cast( kigz )->copyTo( tempdir ); kdDebug() << "extracted file: " << tempdir + kigz->name() << endl - << "exists: " << QFile::exists( tempdir + kigz->name() ) << endl; + << "exists: " << TQFile::exists( tempdir + kigz->name() ) << endl; kigdoc.setName( tempdir + kigz->name() ); } @@ -157,7 +157,7 @@ KigDocument* KigFilterNative::load( const QString& file ) if ( !kigdoc.open( IO_ReadOnly ) ) KIG_FILTER_PARSE_ERROR; - QDomDocument doc( "KigDocument" ); + TQDomDocument doc( "KigDocument" ); if ( !doc.setContent( &kigdoc ) ) KIG_FILTER_PARSE_ERROR; kigdoc.close(); @@ -168,16 +168,16 @@ KigDocument* KigFilterNative::load( const QString& file ) kigdoc.remove(); #endif - QDomElement main = doc.documentElement(); + TQDomElement main = doc.documentElement(); - QString version = main.attribute( "CompatibilityVersion" ); + TQString version = main.attribute( "CompatibilityVersion" ); if ( version.isEmpty() ) version = main.attribute( "Version" ); if ( version.isEmpty() ) version = main.attribute( "version" ); if ( version.isEmpty() ) KIG_FILTER_PARSE_ERROR; // matches 0.1, 0.2.0, 153.128.99 etc. - QRegExp versionre( "(\\d+)\\.(\\d+)(\\.(\\d+))?" ); + TQRegExp versionre( "(\\d+)\\.(\\d+)(\\.(\\d+))?" ); if ( ! versionre.exactMatch( version ) ) KIG_FILTER_PARSE_ERROR; bool ok = true; @@ -213,19 +213,19 @@ KigDocument* KigFilterNative::load( const QString& file ) return load07( file, main ); } -KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& docelem ) +KigDocument* KigFilterNative::load04( const TQString& file, const TQDomElement& docelem ) { bool ok = true; KigDocument* ret = new KigDocument(); - for ( QDomNode n = docelem.firstChild(); ! n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = docelem.firstChild(); ! n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "CoordinateSystem" ) { - const QCString type = e.text().latin1(); + const TQCString type = e.text().latin1(); CoordinateSystem* s = CoordinateSystemFactory::build( type ); if ( ! s ) { @@ -244,8 +244,8 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do // first pass: do a topological sort of the objects, to support // randomly ordered files... std::vector elems; - QDomElement objectselem = e; - for ( QDomNode o = objectselem.firstChild(); ! o.isNull(); o = o.nextSibling() ) + TQDomElement objectselem = e; + for ( TQDomNode o = objectselem.firstChild(); ! o.isNull(); o = o.nextSibling() ) { e = o.toElement(); if ( e.isNull() ) continue; @@ -253,7 +253,7 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do if ( e.tagName() == "Data" || e.tagName() == "Property" || e.tagName() == "Object" ) { // fetch the id - QString tmp = e.attribute("id"); + TQString tmp = e.attribute("id"); id = tmp.toInt(&ok); if ( !ok ) KIG_FILTER_PARSE_ERROR; @@ -262,13 +262,13 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do } else continue; - for ( QDomNode p = e.firstChild(); !p.isNull(); p = p.nextSibling() ) + for ( TQDomNode p = e.firstChild(); !p.isNull(); p = p.nextSibling() ) { - QDomElement f = p.toElement(); + TQDomElement f = p.toElement(); if ( f.isNull() ) continue; if ( f.tagName() == "Parent" ) { - QString tmp = f.attribute( "id" ); + TQString tmp = f.attribute( "id" ); uint pid = tmp.toInt( &ok ); if ( ! ok ) KIG_FILTER_PARSE_ERROR; @@ -288,15 +288,15 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do for ( std::vector::iterator i = elems.begin(); i != elems.end(); ++i ) { - QDomElement e = i->el; + TQDomElement e = i->el; bool internal = e.attribute( "internal" ) == "true" ? true : false; ObjectCalcer* o = 0; if ( e.tagName() == "Data" ) { - QString tmp = e.attribute( "type" ); + TQString tmp = e.attribute( "type" ); if ( tmp.isNull() ) KIG_FILTER_PARSE_ERROR; - QString error; + TQString error; ObjectImp* imp = ObjectImpFactory::instance()->deserialize( tmp, e, error ); if ( ( !imp ) && !error.isEmpty() ) { @@ -307,8 +307,8 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do } else if ( e.tagName() == "Property" ) { - QCString propname; - for ( QDomElement ec = e.firstChild().toElement(); !ec.isNull(); + TQCString propname; + for ( TQDomElement ec = e.firstChild().toElement(); !ec.isNull(); ec = ec.nextSibling().toElement() ) { if ( ec.tagName() == "Property" ) @@ -326,7 +326,7 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do } else if ( e.tagName() == "Object" ) { - QString tmp = e.attribute( "type" ); + TQString tmp = e.attribute( "type" ); if ( tmp.isNull() ) KIG_FILTER_PARSE_ERROR; @@ -356,8 +356,8 @@ KigDocument* KigFilterNative::load04( const QString& file, const QDomElement& do if ( ! internal ) { - QString tmp = e.attribute( "color" ); - QColor color( tmp ); + TQString tmp = e.attribute( "color" ); + TQColor color( tmp ); if ( !color.isValid() ) KIG_FILTER_PARSE_ERROR; @@ -386,7 +386,7 @@ KigFilterNative* KigFilterNative::instance() return &f; } -KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& docelem ) +KigDocument* KigFilterNative::load07( const TQString& file, const TQDomElement& docelem ) { KigDocument* ret = new KigDocument(); @@ -394,19 +394,19 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do std::vector calcers; std::vector holders; - QString t = docelem.attribute( "grid" ); + TQString t = docelem.attribute( "grid" ); bool tmphide = ( t == "false" ) || ( t == "no" ) || ( t == "0" ); ret->setGrid( !tmphide ); t = docelem.attribute( "axes" ); tmphide = ( t == "false" ) || ( t == "no" ) || ( t == "0" ); ret->setAxes( !tmphide ); - for ( QDomElement subsectionelement = docelem.firstChild().toElement(); ! subsectionelement.isNull(); + for ( TQDomElement subsectionelement = docelem.firstChild().toElement(); ! subsectionelement.isNull(); subsectionelement = subsectionelement.nextSibling().toElement() ) { if ( subsectionelement.tagName() == "CoordinateSystem" ) { - QString tmptype = subsectionelement.text(); + TQString tmptype = subsectionelement.text(); // compatibility code - to support Invisible coord system... if ( tmptype == "Invisible" ) { @@ -414,7 +414,7 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do ret->setGrid( false ); ret->setAxes( false ); } - const QCString type = tmptype.latin1(); + const TQCString type = tmptype.latin1(); CoordinateSystem* s = CoordinateSystemFactory::build( type ); if ( ! s ) { @@ -427,19 +427,19 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do } else if ( subsectionelement.tagName() == "Hierarchy" ) { - for ( QDomElement e = subsectionelement.firstChild().toElement(); ! e.isNull(); + for ( TQDomElement e = subsectionelement.firstChild().toElement(); ! e.isNull(); e = e.nextSibling().toElement() ) { - QString tmp = e.attribute( "id" ); + TQString tmp = e.attribute( "id" ); uint id = tmp.toInt( &ok ); if ( id <= 0 ) KIG_FILTER_PARSE_ERROR; std::vector parents; - for ( QDomElement parentel = e.firstChild().toElement(); ! parentel.isNull(); + for ( TQDomElement parentel = e.firstChild().toElement(); ! parentel.isNull(); parentel = parentel.nextSibling().toElement() ) { if ( parentel.tagName() != "Parent" ) continue; - QString tmp = parentel.attribute( "id" ); + TQString tmp = parentel.attribute( "id" ); uint parentid = tmp.toInt( &ok ); if ( ! ok ) KIG_FILTER_PARSE_ERROR; if ( parentid == 0 || parentid > calcers.size() ) KIG_FILTER_PARSE_ERROR; @@ -453,8 +453,8 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do if ( e.tagName() == "Data" ) { if ( !parents.empty() ) KIG_FILTER_PARSE_ERROR; - QString tmp = e.attribute( "type" ); - QString error; + TQString tmp = e.attribute( "type" ); + TQString error; ObjectImp* imp = ObjectImpFactory::instance()->deserialize( tmp, e, error ); if ( ( !imp ) && !error.isEmpty() ) { @@ -466,7 +466,7 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do else if ( e.tagName() == "Property" ) { if ( parents.size() != 1 ) KIG_FILTER_PARSE_ERROR; - QCString propname = e.attribute( "which" ).latin1(); + TQCString propname = e.attribute( "which" ).latin1(); ObjectCalcer* parent = parents[0]; int propid = parent->imp()->propertiesInternalNames().findIndex( propname ); @@ -476,7 +476,7 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do } else if ( e.tagName() == "Object" ) { - QString tmp = e.attribute( "type" ); + TQString tmp = e.attribute( "type" ); const ObjectType* type = ObjectTypeFactory::instance()->find( tmp.latin1() ); if ( ! type ) @@ -511,12 +511,12 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do } else if ( subsectionelement.tagName() == "View" ) { - for ( QDomElement e = subsectionelement.firstChild().toElement(); ! e.isNull(); + for ( TQDomElement e = subsectionelement.firstChild().toElement(); ! e.isNull(); e = e.nextSibling().toElement() ) { if ( e.tagName() != "Draw" ) KIG_FILTER_PARSE_ERROR; - QString tmp = e.attribute( "object" ); + TQString tmp = e.attribute( "object" ); uint id = tmp.toInt( &ok ); if ( !ok ) KIG_FILTER_PARSE_ERROR; if ( id <= 0 || id > calcers.size() ) @@ -524,7 +524,7 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do ObjectCalcer* calcer = calcers[id-1].get(); tmp = e.attribute( "color" ); - QColor color( tmp ); + TQColor color( tmp ); if ( !color.isValid() ) KIG_FILTER_PARSE_ERROR; @@ -564,17 +564,17 @@ KigDocument* KigFilterNative::load07( const QString& file, const QDomElement& do return ret; } -bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) +bool KigFilterNative::save07( const KigDocument& kdoc, TQTextStream& stream ) { - QDomDocument doc( "KigDocument" ); + TQDomDocument doc( "KigDocument" ); - QDomElement docelem = doc.createElement( "KigDocument" ); + TQDomElement docelem = doc.createElement( "KigDocument" ); docelem.setAttribute( "Version", KIGVERSION ); docelem.setAttribute( "CompatibilityVersion", "0.7.0" ); docelem.setAttribute( "grid", kdoc.grid() ); docelem.setAttribute( "axes", kdoc.axes() ); - QDomElement cselem = doc.createElement( "CoordinateSystem" ); + TQDomElement cselem = doc.createElement( "CoordinateSystem" ); cselem.appendChild( doc.createTextNode( kdoc.coordinateSystem().type() ) ); docelem.appendChild( cselem ); @@ -582,7 +582,7 @@ bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) std::vector calcers = getAllParents( getAllCalcers( holders ) ); calcers = calcPath( calcers ); - QDomElement hierelem = doc.createElement( "Hierarchy" ); + TQDomElement hierelem = doc.createElement( "Hierarchy" ); std::map idmap; for ( std::vector::const_iterator i = calcers.begin(); i != calcers.end(); ++i ) @@ -591,11 +591,11 @@ bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) for ( std::vector::const_iterator i = calcers.begin(); i != calcers.end(); ++i ) { - QDomElement objectelem; + TQDomElement objectelem; if ( dynamic_cast( *i ) ) { objectelem = doc.createElement( "Data" ); - QString ser = + TQString ser = ObjectImpFactory::instance()->serialize( *(*i)->imp(), objectelem, doc ); objectelem.setAttribute( "type", ser ); } @@ -604,7 +604,7 @@ bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) const ObjectPropertyCalcer* o = static_cast( *i ); objectelem = doc.createElement( "Property" ); - QCString propname = o->parent()->imp()->propertiesInternalNames()[o->propId()]; + TQCString propname = o->parent()->imp()->propertiesInternalNames()[o->propId()]; objectelem.setAttribute( "which", propname ); } else if ( dynamic_cast( *i ) ) @@ -621,7 +621,7 @@ bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) std::map::const_iterator idp = idmap.find( *i ); assert( idp != idmap.end() ); int pid = idp->second; - QDomElement pel = doc.createElement( "Parent" ); + TQDomElement pel = doc.createElement( "Parent" ); pel.setAttribute( "id", pid ); objectelem.appendChild( pel ); } @@ -631,7 +631,7 @@ bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) } docelem.appendChild( hierelem ); - QDomElement windowelem = doc.createElement( "View" ); + TQDomElement windowelem = doc.createElement( "View" ); for ( std::vector::iterator i = holders.begin(); i != holders.end(); ++i ) { std::map::const_iterator idp = idmap.find( ( *i )->calcer() ); @@ -639,11 +639,11 @@ bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) int id = idp->second; const ObjectDrawer* d = ( *i )->drawer(); - QDomElement drawelem = doc.createElement( "Draw" ); + TQDomElement drawelem = doc.createElement( "Draw" ); drawelem.setAttribute( "object", id ); drawelem.setAttribute( "color", d->color().name() ); - drawelem.setAttribute( "shown", QString::fromLatin1( d->shown() ? "true" : "false" ) ); - drawelem.setAttribute( "width", QString::number( d->width() ) ); + drawelem.setAttribute( "shown", TQString::fromLatin1( d->shown() ? "true" : "false" ) ); + drawelem.setAttribute( "width", TQString::number( d->width() ) ); drawelem.setAttribute( "style", d->styleToString() ); drawelem.setAttribute( "point-style", d->pointStyleToString() ); @@ -669,17 +669,17 @@ bool KigFilterNative::save07( const KigDocument& kdoc, QTextStream& stream ) return true; } -bool KigFilterNative::save( const KigDocument& data, const QString& file ) +bool KigFilterNative::save( const KigDocument& data, const TQString& file ) { return save07( data, file ); } -bool KigFilterNative::save07( const KigDocument& data, const QString& outfile ) +bool KigFilterNative::save07( const KigDocument& data, const TQString& outfile ) { // we have an empty outfile, so we have to print all to stdout if ( outfile.isEmpty() ) { - QTextStream stdoutstream( stdout, IO_WriteOnly ); + TQTextStream stdoutstream( stdout, IO_WriteOnly ); return save07( data, stdoutstream ); } #ifndef KIG_NO_COMPRESSED_FILES @@ -688,21 +688,21 @@ bool KigFilterNative::save07( const KigDocument& data, const QString& outfile ) // the user wants to save a compressed file, so we have to save our kig // file to a temp file and then compress it... - QString tempdir = KGlobal::dirs()->saveLocation( "tmp" ); + TQString tempdir = KGlobal::dirs()->saveLocation( "tmp" ); if ( tempdir.isEmpty() ) return false; - QString tempname = outfile.section( '/', -1 ); + TQString tempname = outfile.section( '/', -1 ); if ( outfile.endsWith( ".kigz", false ) ) - tempname.remove( QRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); + tempname.remove( TQRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); else return false; - QString tmpfile = tempdir + tempname + ".kig"; - QFile ftmpfile( tmpfile ); + TQString tmpfile = tempdir + tempname + ".kig"; + TQFile ftmpfile( tmpfile ); if ( !ftmpfile.open( IO_WriteOnly ) ) return false; - QTextStream stream( &ftmpfile ); + TQTextStream stream( &ftmpfile ); if ( !save07( data, stream ) ) return false; ftmpfile.close(); @@ -716,20 +716,20 @@ bool KigFilterNative::save07( const KigDocument& data, const QString& outfile ) ark->close(); // finally, removing temp file - QFile::remove( tmpfile ); + TQFile::remove( tmpfile ); return true; } else { #endif - QFile file( outfile ); + TQFile file( outfile ); if ( ! file.open( IO_WriteOnly ) ) { fileNotFound( outfile ); return false; } - QTextStream stream( &file ); + TQTextStream stream( &file ); return save07( data, stream ); #ifndef KIG_NO_COMPRESSED_FILES } @@ -740,7 +740,7 @@ bool KigFilterNative::save07( const KigDocument& data, const QString& outfile ) } /* -bool KigFilterNative::save( const KigDocument& data, QTextStream& stream ) +bool KigFilterNative::save( const KigDocument& data, TQTextStream& stream ) { return save07( data, stream ); } diff --git a/kig/filters/native-filter.h b/kig/filters/native-filter.h index 12778f35..22b8b1e2 100644 --- a/kig/filters/native-filter.h +++ b/kig/filters/native-filter.h @@ -38,29 +38,29 @@ private: * this is the load function for the Kig format that is used, * starting at Kig 0.4 */ - KigDocument* load04( const QString& file, const QDomElement& doc ); + KigDocument* load04( const TQString& file, const TQDomElement& doc ); /** * this is the load function for the Kig format that is used * starting at Kig 0.7 */ - KigDocument* load07( const QString& file, const QDomElement& doc ); + KigDocument* load07( const TQString& file, const TQDomElement& doc ); /** * save in the Kig format that is used starting at Kig 0.7 */ - bool save07( const KigDocument& data, const QString& outfile ); - bool save07( const KigDocument& data, QTextStream& file ); + bool save07( const KigDocument& data, const TQString& outfile ); + bool save07( const KigDocument& data, TQTextStream& file ); KigFilterNative(); ~KigFilterNative(); public: static KigFilterNative* instance(); - bool supportMime( const QString& mime ); - KigDocument* load( const QString& file ); + bool supportMime( const TQString& mime ); + KigDocument* load( const TQString& file ); - bool save( const KigDocument& data, const QString& file ); -// bool save( const KigDocument& data, QTextStream& stream ); + bool save( const KigDocument& data, const TQString& file ); +// bool save( const KigDocument& data, TQTextStream& stream ); }; #endif diff --git a/kig/filters/svgexporter.cc b/kig/filters/svgexporter.cc index 6e945de2..57413004 100644 --- a/kig/filters/svgexporter.cc +++ b/kig/filters/svgexporter.cc @@ -26,10 +26,10 @@ #include "../misc/kigfiledialog.h" #include "../misc/kigpainter.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -40,17 +40,17 @@ SVGExporter::~SVGExporter() { } -QString SVGExporter::exportToStatement() const +TQString SVGExporter::exportToStatement() const { return i18n( "&Export to SVG..." ); } -QString SVGExporter::menuEntryName() const +TQString SVGExporter::menuEntryName() const { return i18n( "&SVG..." ); } -QString SVGExporter::menuIcon() const +TQString SVGExporter::menuIcon() const { // TODO return "vectorgfx"; @@ -59,7 +59,7 @@ QString SVGExporter::menuIcon() const void SVGExporter::run( const KigPart& part, KigWidget& w ) { KigFileDialog* kfd = new KigFileDialog( - QString::null, i18n( "*.svg|Scalable Vector Graphics (*.svg)" ), + TQString::null, i18n( "*.svg|Scalable Vector Graphics (*.svg)" ), i18n( "Export as SVG" ), &w ); kfd->setOptionCaption( i18n( "SVG Options" ) ); SVGExporterOptions* opts = new SVGExporterOptions( 0L ); @@ -69,14 +69,14 @@ void SVGExporter::run( const KigPart& part, KigWidget& w ) if ( !kfd->exec() ) return; - QString file_name = kfd->selectedFile(); + TQString file_name = kfd->selectedFile(); bool showgrid = opts->showGridCheckBox->isOn(); bool showaxes = opts->showAxesCheckBox->isOn(); delete opts; delete kfd; - QFile file( file_name ); + TQFile file( file_name ); if ( ! file.open( IO_WriteOnly ) ) { KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please " @@ -85,10 +85,10 @@ void SVGExporter::run( const KigPart& part, KigWidget& w ) return; }; - QRect viewrect( w.screenInfo().viewRect() ); - QRect r( 0, 0, viewrect.width(), viewrect.height() ); + TQRect viewrect( w.screenInfo().viewRect() ); + TQRect r( 0, 0, viewrect.width(), viewrect.height() ); - QPicture pic; + TQPicture pic; pic.setBoundingRect( r ); KigPainter* p = new KigPainter( ScreenInfo( w.screenInfo().shownRect(), viewrect ), &pic, part.document() ); diff --git a/kig/filters/svgexporter.h b/kig/filters/svgexporter.h index 17193673..86cfaac4 100644 --- a/kig/filters/svgexporter.h +++ b/kig/filters/svgexporter.h @@ -32,9 +32,9 @@ class SVGExporter { public: ~SVGExporter(); - QString exportToStatement() const; - QString menuEntryName() const; - QString menuIcon() const; + TQString exportToStatement() const; + TQString menuEntryName() const; + TQString menuIcon() const; void run( const KigPart& part, KigWidget& w ); }; diff --git a/kig/kfile/kfile_drgeo.cpp b/kig/kfile/kfile_drgeo.cpp index 26ed7923..b921131b 100644 --- a/kig/kfile/kfile_drgeo.cpp +++ b/kig/kfile/kfile_drgeo.cpp @@ -20,8 +20,8 @@ #include "kfile_drgeo.h" -#include -#include +#include +#include #include @@ -29,16 +29,16 @@ typedef KGenericFactory drgeoFactory; K_EXPORT_COMPONENT_FACTORY( kfile_drgeo, drgeoFactory( "kfile_drgeo" ) ) -DrgeoPlugin::DrgeoPlugin( QObject *parent, const char *name, const QStringList &args ) +DrgeoPlugin::DrgeoPlugin( TQObject *parent, const char *name, const TQStringList &args ) : KFilePlugin( parent, name, args ) { info = addMimeTypeInfo( "application/x-drgeo" ); KFileMimeTypeInfo::GroupInfo* group = addGroupInfo( info, "DrgeoInfo", i18n( "Summary" ) ); KFileMimeTypeInfo::ItemInfo* item; - item = addItemInfo( group, "NumOfFigures", i18n( "Figures" ), QVariant::Int ); - item = addItemInfo( group, "NumOfTexts", i18n( "Texts" ), QVariant::Int ); - item = addItemInfo( group, "NumOfMacros", i18n( "Macros" ), QVariant::Int ); + item = addItemInfo( group, "NumOfFigures", i18n( "Figures" ), TQVariant::Int ); + item = addItemInfo( group, "NumOfTexts", i18n( "Texts" ), TQVariant::Int ); + item = addItemInfo( group, "NumOfMacros", i18n( "Macros" ), TQVariant::Int ); group_contents = addGroupInfo( info, "DrgeoContents", i18n( "Translators: what this drgeo " "file contains", "Contents" ) ); @@ -50,39 +50,39 @@ bool DrgeoPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) KFileMimeTypeInfo::ItemInfo* item; - QFile f( metainfo.path() ); - QDomDocument doc( "drgenius" ); + TQFile f( metainfo.path() ); + TQDomDocument doc( "drgenius" ); if ( !doc.setContent( &f ) ) return false; - QDomElement main = doc.documentElement(); + TQDomElement main = doc.documentElement(); int numfig = 0; int numtext = 0; int nummacro = 0; - QString sectname; + TQString sectname; // reading figures... - for ( QDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; else if ( e.tagName() == "drgeo" ) { numfig++; - sectname = QString( "Figure" ) + QString::number( numfig ); - item = addItemInfo( group_contents, sectname, i18n( "Figure" ), QVariant::String ); + sectname = TQString( "Figure" ) + TQString::number( numfig ); + item = addItemInfo( group_contents, sectname, i18n( "Figure" ), TQVariant::String ); appendItem( metagroup, sectname, e.attribute( "name" ) ); } else if ( e.tagName() == "text" ) { numtext++; - sectname = QString( "Text" ) + QString::number( numtext ); - item = addItemInfo( group_contents, sectname, i18n( "Text" ), QVariant::String ); + sectname = TQString( "Text" ) + TQString::number( numtext ); + item = addItemInfo( group_contents, sectname, i18n( "Text" ), TQVariant::String ); appendItem( metagroup, sectname, e.attribute( "name" ) ); } else if ( e.tagName() == "macro" ) { nummacro++; - sectname = QString( "Macro" ) + QString::number( nummacro ); - item = addItemInfo( group_contents, sectname, i18n( "Macro" ), QVariant::String ); + sectname = TQString( "Macro" ) + TQString::number( nummacro ); + item = addItemInfo( group_contents, sectname, i18n( "Macro" ), TQVariant::String ); appendItem( metagroup, sectname, e.attribute( "name" ) ); } } diff --git a/kig/kfile/kfile_drgeo.h b/kig/kfile/kfile_drgeo.h index b6e388da..e2c5d156 100644 --- a/kig/kfile/kfile_drgeo.h +++ b/kig/kfile/kfile_drgeo.h @@ -30,7 +30,7 @@ class DrgeoPlugin: public KFilePlugin Q_OBJECT public: - DrgeoPlugin( QObject *parent, const char *name, const QStringList& args ); + DrgeoPlugin( TQObject *parent, const char *name, const TQStringList& args ); virtual bool readInfo( KFileMetaInfo& metainfo, uint what); protected: diff --git a/kig/kfile/kfile_kig.cpp b/kig/kfile/kfile_kig.cpp index eca2f79d..bd54a036 100644 --- a/kig/kfile/kfile_kig.cpp +++ b/kig/kfile/kfile_kig.cpp @@ -20,9 +20,9 @@ #include "kfile_kig.h" -#include -#include -#include +#include +#include +#include #include #include @@ -35,7 +35,7 @@ typedef KGenericFactory kigFactory; K_EXPORT_COMPONENT_FACTORY( kfile_kig, kigFactory( "kfile_kig" ) ) -KigPlugin::KigPlugin( QObject *parent, const char *name, const QStringList &args ) +KigPlugin::KigPlugin( TQObject *parent, const char *name, const TQStringList &args ) : KFilePlugin( parent, name, args ) { KFileMimeTypeInfo::ItemInfo* item; @@ -43,33 +43,33 @@ KigPlugin::KigPlugin( QObject *parent, const char *name, const QStringList &args info = addMimeTypeInfo( "application/x-kig" ); group = addGroupInfo( info, "KigInfo", i18n( "Summary" ) ); - item = addItemInfo( group, "Version", i18n( "Version" ), QVariant::String ); - item = addItemInfo( group, "CompatVersion", i18n( "Compatibility Version" ), QVariant::String ); - item = addItemInfo( group, "CoordSystem", i18n( "Coordinate System" ), QVariant::String ); - item = addItemInfo( group, "Grid", i18n( "Grid" ), QVariant::String ); - item = addItemInfo( group, "Axes", i18n( "Axes" ), QVariant::String ); - item = addItemInfo( group, "Compressed", i18n( "Compressed" ), QVariant::String ); + item = addItemInfo( group, "Version", i18n( "Version" ), TQVariant::String ); + item = addItemInfo( group, "CompatVersion", i18n( "Compatibility Version" ), TQVariant::String ); + item = addItemInfo( group, "CoordSystem", i18n( "Coordinate System" ), TQVariant::String ); + item = addItemInfo( group, "Grid", i18n( "Grid" ), TQVariant::String ); + item = addItemInfo( group, "Axes", i18n( "Axes" ), TQVariant::String ); + item = addItemInfo( group, "Compressed", i18n( "Compressed" ), TQVariant::String ); } bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) { KFileMetaInfoGroup metagroup = appendGroup( metainfo, "KigInfo"); - QString sfile = metainfo.path(); + TQString sfile = metainfo.path(); bool iscompressed = false; - QFile f( sfile ); + TQFile f( sfile ); if ( !sfile.endsWith( ".kig", false ) ) { iscompressed = true; - QString tempdir = KGlobal::dirs()->saveLocation( "tmp" ); + TQString tempdir = KGlobal::dirs()->saveLocation( "tmp" ); if ( tempdir.isEmpty() ) return false; - QString tempname = sfile.section( '/', -1 ); + TQString tempname = sfile.section( '/', -1 ); if ( sfile.endsWith( ".kigz", false ) ) { - tempname.remove( QRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); + tempname.remove( TQRegExp( "\\.[Kk][Ii][Gg][Zz]$" ) ); } else return false; @@ -77,8 +77,8 @@ bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) KTar* ark = new KTar( sfile, "application/x-gzip" ); ark->open( IO_ReadOnly ); const KArchiveDirectory* dir = ark->directory(); - QStringList entries = dir->entries(); - QStringList kigfiles = entries.grep( QRegExp( "\\.kig$" ) ); + TQStringList entries = dir->entries(); + TQStringList kigfiles = entries.grep( TQRegExp( "\\.kig$" ) ); if ( kigfiles.count() != 1 ) return false; const KArchiveEntry* kigz = dir->entry( kigfiles[0] ); @@ -92,7 +92,7 @@ bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) if ( !f.open( IO_ReadOnly ) ) return false; - QDomDocument doc( "KigDocument" ); + TQDomDocument doc( "KigDocument" ); if ( !doc.setContent( &f ) ) return false; @@ -102,26 +102,26 @@ bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) if ( iscompressed ) f.remove(); - QDomElement main = doc.documentElement(); + TQDomElement main = doc.documentElement(); // reading the version... - QString version = main.attribute( "Version" ); + TQString version = main.attribute( "Version" ); if ( version.isEmpty() ) version = main.attribute( "version" ); if ( version.isEmpty() ) version = i18n( "Translators: Not Available", "n/a" ); appendItem( metagroup, "Version", version ); // reading the compatibility version... - QString compatversion = main.attribute( "CompatibilityVersion" ); + TQString compatversion = main.attribute( "CompatibilityVersion" ); if ( compatversion.isEmpty() ) compatversion = i18n( "%1 represents Kig version", "%1 (as the version)" ).arg( version ); appendItem( metagroup, "CompatVersion", compatversion ); // reading the Coordinate System... - QCString coordsystem; - for ( QDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) + TQCString coordsystem; + for ( TQDomNode n = main.firstChild(); ! n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "CoordinateSystem" ) coordsystem = e.text().latin1(); @@ -130,10 +130,10 @@ bool KigPlugin::readInfo( KFileMetaInfo& metainfo, uint /*what*/ ) // has Kig document the grid? bool btmp = true; - QString stmp = main.attribute( "grid" ); + TQString stmp = main.attribute( "grid" ); if ( !( stmp.isEmpty() || ( stmp != "0" ) ) ) btmp = ( stmp != "0" ); - QString stmp2 = btmp ? i18n( "Yes" ) : i18n( "No" ); + TQString stmp2 = btmp ? i18n( "Yes" ) : i18n( "No" ); appendItem( metagroup, "Grid", stmp2 ); // has Kig document the axes? diff --git a/kig/kfile/kfile_kig.h b/kig/kfile/kfile_kig.h index 8580ec48..8abacaaf 100644 --- a/kig/kfile/kfile_kig.h +++ b/kig/kfile/kfile_kig.h @@ -30,7 +30,7 @@ class KigPlugin: public KFilePlugin Q_OBJECT public: - KigPlugin( QObject *parent, const char *name, const QStringList& args ); + KigPlugin( TQObject *parent, const char *name, const TQStringList& args ); virtual bool readInfo( KFileMetaInfo& metainfo, uint what); protected: diff --git a/kig/kig/kig.cpp b/kig/kig/kig.cpp index 2429c843..ed954d26 100644 --- a/kig/kig/kig.cpp +++ b/kig/kig/kig.cpp @@ -21,8 +21,8 @@ #include "kig.h" #include "kig.moc" -#include -#include +#include +#include #include #include @@ -78,7 +78,7 @@ Kig::Kig() // and integrate the part's GUI with the shell's createGUI(m_part); // finally show tip-of-day ( if the user wants it :) ) - QTimer::singleShot( 0, this, SLOT( startupTipOfDay() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( startupTipOfDay() ) ); } } else @@ -105,30 +105,30 @@ Kig::~Kig() void Kig::setupActions() { - KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); - KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - KStdAction::quit(this, SLOT(close()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection()); + KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); #ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES - m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); - m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); + m_toolbarAction = KStdAction::showToolbar(this, TQT_SLOT(optionsShowToolbar()), actionCollection()); + m_statusbarAction = KStdAction::showStatusbar(this, TQT_SLOT(optionsShowStatusbar()), actionCollection()); #else createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); #endif // FIXME: this (recent files) should be app-wide, not specific to each window... - m_recentFilesAction = KStdAction::openRecent(this, SLOT(openURL(const KURL&)), actionCollection()); + m_recentFilesAction = KStdAction::openRecent(this, TQT_SLOT(openURL(const KURL&)), actionCollection()); m_recentFilesAction->loadEntries(config); #if KDE_IS_VERSION( 3, 2, 90 ) - KStdAction::keyBindings( guiFactory(), SLOT( configureShortcuts() ), actionCollection() ); + KStdAction::keyBindings( guiFactory(), TQT_SLOT( configureShortcuts() ), actionCollection() ); #else - KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()), actionCollection()); #endif - KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection()); - KStdAction::tipOfDay( this, SLOT( tipOfDay() ), actionCollection(), "help_tipofday" ); + KStdAction::tipOfDay( this, TQT_SLOT( tipOfDay() ), actionCollection(), "help_tipofday" ); } void Kig::saveProperties(KConfig* config) @@ -203,8 +203,8 @@ void Kig::optionsConfigureToolbars() // use the standard toolbar editor KEditToolbar dlg(factory()); - connect(&dlg, SIGNAL(newToolbarConfig()), - this, SLOT(applyNewToolbarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), + this, TQT_SLOT(applyNewToolbarConfig())); dlg.exec(); } @@ -236,12 +236,12 @@ bool Kig::queryClose() }; } -void Kig::dragEnterEvent(QDragEnterEvent* e) +void Kig::dragEnterEvent(TQDragEnterEvent* e) { e->accept(KURLDrag::canDecode(e)); } -void Kig::dropEvent(QDropEvent* e) +void Kig::dropEvent(TQDropEvent* e) { KURL::List urls; if ( KURLDrag::decode (e, urls) ) @@ -257,7 +257,7 @@ void Kig::dropEvent(QDropEvent* e) void Kig::fileOpen() { - QString formats = + TQString formats = i18n( "*.kig *.kigz *.kgeo *.seg|All Supported Files (*.kig *.kigz *.kgeo *.seg)\n" "*.kig|Kig Documents (*.kig)\n" "*.kigz|Compressed Kig Documents (*.kigz)\n" @@ -267,7 +267,7 @@ void Kig::fileOpen() "*.fig *.FIG|Cabri Documents (*.fig *.FIG)" ); // this slot is connected to the KStdAction::open action... - QString file_name = KFileDialog::getOpenFileName(":document", formats ); + TQString file_name = KFileDialog::getOpenFileName(":document", formats ); if (!file_name.isEmpty()) openURL(file_name); } diff --git a/kig/kig/kig.h b/kig/kig/kig.h index d6ad9fea..51c236f2 100644 --- a/kig/kig/kig.h +++ b/kig/kig/kig.h @@ -72,7 +72,7 @@ class Kig : public KParts::MainWindow * * \param s the url of the file to open */ - void openURL (const QString& s) { openURL(KURL(s)); } + void openURL (const TQString& s) { openURL(KURL(s)); } void openURL (const KURL& s); protected: @@ -82,14 +82,14 @@ class Kig : public KParts::MainWindow * * \param e */ - void dragEnterEvent(QDragEnterEvent* e); + void dragEnterEvent(TQDragEnterEvent* e); /** * The user dropped something onto us... * * \param e */ - void dropEvent (QDropEvent* e); + void dropEvent (TQDropEvent* e); /** * this is called by the framework before closing the window, to diff --git a/kig/kig/kig_commands.cpp b/kig/kig/kig_commands.cpp index b9846fa6..d4668f55 100644 --- a/kig/kig/kig_commands.cpp +++ b/kig/kig/kig_commands.cpp @@ -45,7 +45,7 @@ public: vector tasks; }; -KigCommand::KigCommand( KigPart& doc, const QString& name ) +KigCommand::KigCommand( KigPart& doc, const TQString& name ) : KNamedCommand(name), d( new Private( doc ) ) { } @@ -93,7 +93,7 @@ KigCommand* KigCommand::addCommand( KigPart& doc, ObjectHolder* o ) KigCommand* KigCommand::removeCommand( KigPart& doc, const std::vector& os ) { assert( os.size() > 0 ); - QString text; + TQString text; if ( os.size() == 1 ) text = os.back()->imp()->type()->removeAStatement(); else @@ -105,7 +105,7 @@ KigCommand* KigCommand::removeCommand( KigPart& doc, const std::vector& os ) { - QString text; + TQString text; if ( os.size() == 1 ) text = os.back()->imp()->type()->addAStatement(); else @@ -117,7 +117,7 @@ KigCommand* KigCommand::addCommand( KigPart& doc, const std::vectorid() ); + TQString text = CoordinateSystemFactory::setCoordinateSystemStatement( s->id() ); KigCommand* ret = new KigCommand( doc, text ); ret->addTask( new ChangeCoordSystemTask( s ) ); return ret; diff --git a/kig/kig/kig_commands.h b/kig/kig/kig_commands.h index 8e4fd044..0dd7c93a 100644 --- a/kig/kig/kig_commands.h +++ b/kig/kig/kig_commands.h @@ -41,13 +41,13 @@ class Rect; * Used mainly in the Undo/Redo stuff... */ class KigCommand - : public QObject, public KNamedCommand + : public TQObject, public KNamedCommand { Q_OBJECT class Private; Private* d; public: - KigCommand( KigPart& inDoc, const QString& name ); + KigCommand( KigPart& inDoc, const TQString& name ); ~KigCommand(); /** diff --git a/kig/kig/kig_iface.h b/kig/kig/kig_iface.h index d3f74e19..d727600a 100644 --- a/kig/kig/kig_iface.h +++ b/kig/kig/kig_iface.h @@ -31,7 +31,7 @@ public: KigIface(); ~KigIface(); k_dcop: - virtual void openURL(const QString& s) = 0; + virtual void openURL(const TQString& s) = 0; }; #endif diff --git a/kig/kig/kig_part.cpp b/kig/kig/kig_part.cpp index 163f5429..1f891bb9 100644 --- a/kig/kig/kig_part.cpp +++ b/kig/kig/kig_part.cpp @@ -61,19 +61,19 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #if QT_VERSION >= 0x030100 -#include +#include #endif using namespace std; -static const QString typesFile = "macros.kigt"; +static const TQString typesFile = "macros.kigt"; // export this library... typedef KParts::GenericFactory KigPartFactory; @@ -114,47 +114,47 @@ class KigPrintDialogPage : public KPrintDialogPage { public: - KigPrintDialogPage( QWidget* parent = 0, const char* name = 0 ); + KigPrintDialogPage( TQWidget* parent = 0, const char* name = 0 ); ~KigPrintDialogPage(); - void getOptions( QMap& opts, bool ); - void setOptions( const QMap& opts ); - bool isValid( QString& ); + void getOptions( TQMap& opts, bool ); + void setOptions( const TQMap& opts ); + bool isValid( TQString& ); private: - QCheckBox *showgrid; - QCheckBox *showaxes; + TQCheckBox *showgrid; + TQCheckBox *showaxes; }; -KigPrintDialogPage::KigPrintDialogPage( QWidget* parent, const char* name ) +KigPrintDialogPage::KigPrintDialogPage( TQWidget* parent, const char* name ) : KPrintDialogPage( parent, name ) { setTitle( i18n( "Kig Options" ) ); - QVBoxLayout* vl = new QVBoxLayout( this, 0 , 11 ); + TQVBoxLayout* vl = new TQVBoxLayout( this, 0 , 11 ); - showgrid = new QCheckBox( i18n( "Show grid" ), this ); + showgrid = new TQCheckBox( i18n( "Show grid" ), this ); vl->addWidget( showgrid ); - showaxes = new QCheckBox( i18n( "Show axes" ), this ); + showaxes = new TQCheckBox( i18n( "Show axes" ), this ); vl->addWidget( showaxes ); - vl->addItem( new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::Expanding ) ); + vl->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Fixed, TQSizePolicy::Expanding ) ); } KigPrintDialogPage::~KigPrintDialogPage() { } -void KigPrintDialogPage::getOptions( QMap< QString, QString >& opts, bool ) +void KigPrintDialogPage::getOptions( TQMap< TQString, TQString >& opts, bool ) { - opts[ "kde-kig-showgrid" ] = QString::number( showgrid->isChecked() ); - opts[ "kde-kig-showaxes" ] = QString::number( showaxes->isChecked() ); + opts[ "kde-kig-showgrid" ] = TQString::number( showgrid->isChecked() ); + opts[ "kde-kig-showaxes" ] = TQString::number( showaxes->isChecked() ); } -void KigPrintDialogPage::setOptions( const QMap< QString, QString >& opts ) +void KigPrintDialogPage::setOptions( const TQMap< TQString, TQString >& opts ) { - QString tmp = opts[ "kde-kig-showgrid" ]; + TQString tmp = opts[ "kde-kig-showgrid" ]; bool bt = ( tmp != "0" ); showgrid->setChecked( bt ); tmp = opts[ "kde-kig-showaxes" ]; @@ -162,14 +162,14 @@ void KigPrintDialogPage::setOptions( const QMap< QString, QString >& opts ) showaxes->setChecked( bt ); } -bool KigPrintDialogPage::isValid( QString& ) +bool KigPrintDialogPage::isValid( TQString& ) { return true; } -KigPart::KigPart( QWidget *parentWidget, const char *, - QObject *parent, const char *name, - const QStringList& ) +KigPart::KigPart( TQWidget *parentWidget, const char *, + TQObject *parent, const char *name, + const TQStringList& ) : KParts::ReadWritePart( parent, name ), mMode( 0 ), mdocument( new KigDocument() ) { @@ -195,7 +195,7 @@ KigPart::KigPart( QWidget *parentWidget, const char *, // construct our command history mhistory = new KCommandHistory(actionCollection()); mhistory->documentSaved(); - connect( mhistory, SIGNAL( documentRestored() ), this, SLOT( setUnmodified() ) ); + connect( mhistory, TQT_SIGNAL( documentRestored() ), this, TQT_SLOT( setUnmodified() ) ); // we are read-write by default setReadWrite(true); @@ -208,72 +208,72 @@ KigPart::KigPart( QWidget *parentWidget, const char *, void KigPart::setupActions() { // save actions.. - (void) KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); - (void) KStdAction::save(this, SLOT(fileSave()), actionCollection()); + (void) KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection()); + (void) KStdAction::save(this, TQT_SLOT(fileSave()), actionCollection()); // print actions - (void) KStdAction::print( this, SLOT( filePrint() ), actionCollection() ); - (void) KStdAction::printPreview( this, SLOT( filePrintPreview() ), actionCollection() ); + (void) KStdAction::print( this, TQT_SLOT( filePrint() ), actionCollection() ); + (void) KStdAction::printPreview( this, TQT_SLOT( filePrintPreview() ), actionCollection() ); // selection actions aSelectAll = KStdAction::selectAll( - this, SLOT( slotSelectAll() ), actionCollection() ); + this, TQT_SLOT( slotSelectAll() ), actionCollection() ); aDeselectAll = KStdAction::deselect( - this, SLOT( slotDeselectAll() ), actionCollection() ); + this, TQT_SLOT( slotDeselectAll() ), actionCollection() ); aInvertSelection = new KAction( i18n( "Invert Selection" ), "", 0, this, - SLOT( slotInvertSelection() ), actionCollection(), + TQT_SLOT( slotInvertSelection() ), actionCollection(), "edit_invert_selection" ); // we need icons... KIconLoader* l = instance()->iconLoader(); - QPixmap tmp; + TQPixmap tmp; aDeleteObjects = new KAction( i18n("&Delete Objects"), "editdelete", Key_Delete, this, - SLOT(deleteObjects()), actionCollection(), "delete_objects"); + TQT_SLOT(deleteObjects()), actionCollection(), "delete_objects"); aDeleteObjects->setToolTip(i18n("Delete the selected objects")); aCancelConstruction = new KAction( i18n("Cancel Construction"), "stop", Key_Escape, this, - SLOT(cancelConstruction()), actionCollection(), "cancel_construction"); + TQT_SLOT(cancelConstruction()), actionCollection(), "cancel_construction"); aCancelConstruction->setToolTip( i18n("Cancel the construction of the object being constructed")); aCancelConstruction->setEnabled(false); aShowHidden = new KAction( - i18n("U&nhide All"), 0, this, SLOT( showHidden() ), + i18n("U&nhide All"), 0, this, TQT_SLOT( showHidden() ), actionCollection(), "edit_unhide_all"); aShowHidden->setToolTip(i18n("Show all hidden objects")); aShowHidden->setEnabled( true ); aNewMacro = new KAction( - i18n("&New Macro..."), "gear", 0, this, SLOT(newMacro()), + i18n("&New Macro..."), "gear", 0, this, TQT_SLOT(newMacro()), actionCollection(), "macro_action"); aNewMacro->setToolTip(i18n("Define a new macro")); aConfigureTypes = new KAction( - i18n("Manage &Types..."), 0, this, SLOT(editTypes()), + i18n("Manage &Types..."), 0, this, TQT_SLOT(editTypes()), actionCollection(), "types_edit"); aConfigureTypes->setToolTip(i18n("Manage macro types.")); KigExportManager::instance()->addMenuAction( this, m_widget->realWidget(), actionCollection() ); - KAction* a = KStdAction::zoomIn( m_widget, SLOT( slotZoomIn() ), + KAction* a = KStdAction::zoomIn( m_widget, TQT_SLOT( slotZoomIn() ), actionCollection() ); a->setToolTip( i18n( "Zoom in on the document" ) ); a->setWhatsThis( i18n( "Zoom in on the document" ) ); - a = KStdAction::zoomOut( m_widget, SLOT( slotZoomOut() ), + a = KStdAction::zoomOut( m_widget, TQT_SLOT( slotZoomOut() ), actionCollection() ); a->setToolTip( i18n( "Zoom out of the document" ) ); a->setWhatsThis( i18n( "Zoom out of the document" ) ); - a = KStdAction::fitToPage( m_widget, SLOT( slotRecenterScreen() ), + a = KStdAction::fitToPage( m_widget, TQT_SLOT( slotRecenterScreen() ), actionCollection() ); // grr.. why isn't there an icon for this.. - a->setIconSet( QIconSet( l->loadIcon( "view_fit_to_page", KIcon::Toolbar ) ) ); + a->setIconSet( TQIconSet( l->loadIcon( "view_fit_to_page", KIcon::Toolbar ) ) ); a->setToolTip( i18n( "Recenter the screen on the document" ) ); a->setWhatsThis( i18n( "Recenter the screen on the document" ) ); @@ -283,12 +283,12 @@ void KigPart::setupActions() #endif #endif #ifdef KIG_PART_CPP_STD_FULLSCREEN_ACTION - a = KStdAction::fullScreen( m_widget, SLOT( toggleFullScreen() ), actionCollection(), (QWidget*)(widget()->parent()),"fullscreen" ); + a = KStdAction::fullScreen( m_widget, TQT_SLOT( toggleFullScreen() ), actionCollection(), (TQWidget*)(widget()->parent()),"fullscreen" ); #else tmp = l->loadIcon( "window_fullscreen", KIcon::Toolbar ); a = new KAction( i18n( "Full Screen" ), tmp, CTRL+SHIFT+Key_F, - m_widget, SLOT( toggleFullScreen() ), + m_widget, TQT_SLOT( toggleFullScreen() ), actionCollection(), "fullscreen" ); #endif a->setToolTip( i18n( "View this document full-screen." ) ); @@ -296,31 +296,31 @@ void KigPart::setupActions() // TODO: an icon for this.. a = new KAction( - i18n( "&Select Shown Area" ), "viewmagfit", 0, m_widget, SLOT( zoomRect() ), + i18n( "&Select Shown Area" ), "viewmagfit", 0, m_widget, TQT_SLOT( zoomRect() ), actionCollection(), "view_select_shown_rect" ); a->setToolTip( i18n( "Select the area that you want to be shown in the window." ) ); a->setWhatsThis( i18n( "Select the area that you want to be shown in the window." ) ); a = new KAction( - i18n( "S&elect Zoom Area" ), "viewmag", 0, m_widget, SLOT( zoomArea() ), + i18n( "S&elect Zoom Area" ), "viewmag", 0, m_widget, TQT_SLOT( zoomArea() ), actionCollection(), "view_zoom_area" ); // a->setToolTip( i18n( "Select the area that you want to be shown in the window." ) ); // a->setWhatsThis( i18n( "Select the area that you want to be shown in the window." ) ); aToggleGrid = new KToggleAction( - i18n( "Show &Grid" ), 0, this, SLOT( toggleGrid() ), + i18n( "Show &Grid" ), 0, this, TQT_SLOT( toggleGrid() ), actionCollection(), "settings_show_grid" ); aToggleGrid->setToolTip( i18n( "Show or hide the grid." ) ); aToggleGrid->setChecked( true ); aToggleAxes = new KToggleAction( - i18n( "Show &Axes" ), 0, this, SLOT( toggleAxes() ), + i18n( "Show &Axes" ), 0, this, TQT_SLOT( toggleAxes() ), actionCollection(), "settings_show_axes" ); aToggleAxes->setToolTip( i18n( "Show or hide the axes." ) ); aToggleAxes->setChecked( true ); aToggleNightVision = new KToggleAction( - i18n( "Wear Infrared Glasses" ), 0, this, SLOT( toggleNightVision() ), + i18n( "Wear Infrared Glasses" ), 0, this, TQT_SLOT( toggleNightVision() ), actionCollection(), "settings_toggle_nightvision" ); aToggleNightVision->setToolTip( i18n( "Enable/Disable hidden objects visibility." ) ); aToggleNightVision->setChecked( false ); @@ -366,7 +366,7 @@ KigPart::~KigPart() bool KigPart::openFile() { - QFileInfo fileinfo( m_file ); + TQFileInfo fileinfo( m_file ); if ( ! fileinfo.exists() ) { KMessageBox::sorry( widget(), @@ -591,7 +591,7 @@ void KigPart::plugActionLists() plugActionList( "user_types", aMNewAll ); } -void KigPart::emitStatusBarText( const QString& text ) +void KigPart::emitStatusBarText( const TQString& text ) { emit setStatusBarText( text ); } @@ -609,15 +609,15 @@ void KigPart::fileSave() bool KigPart::internalSaveAs() { // this slot is connected to the KStdAction::saveAs action... - QString formats = i18n( "*.kig|Kig Documents (*.kig)\n" + TQString formats = i18n( "*.kig|Kig Documents (*.kig)\n" "*.kigz|Compressed Kig Documents (*.kigz)" ); // formats += "\n"; // formats += KImageIO::pattern( KImageIO::Writing ); - QString file_name = KFileDialog::getSaveFileName(":document", formats ); + TQString file_name = KFileDialog::getSaveFileName(":document", formats ); if (file_name.isEmpty()) return false; - else if ( QFileInfo( file_name ).exists() ) + else if ( TQFileInfo( file_name ).exists() ) { int ret = KMessageBox::warningContinueCancel( m_widget, i18n( "The file \"%1\" already exists. Do you wish to overwrite it?" ) @@ -710,11 +710,11 @@ void KigPart::setupMacroTypes() alreadysetup = true; // the user's saved macro types: - QStringList dataFiles = + TQStringList dataFiles = KGlobal::dirs()->findAllResources("appdata", "kig-types/*.kigt", true, false ); std::vector macros; - for ( QStringList::iterator file = dataFiles.begin(); + for ( TQStringList::iterator file = dataFiles.begin(); file != dataFiles.end(); ++file ) { std::vector nmacros; @@ -726,7 +726,7 @@ void KigPart::setupMacroTypes() }; // hack: we need to plug the action lists _after_ the gui is // built.. i can't find a better solution than this... - QTimer::singleShot( 0, this, SLOT( plugActionLists() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( plugActionLists() ) ); } void KigPart::setupBuiltinMacros() @@ -737,9 +737,9 @@ void KigPart::setupBuiltinMacros() alreadysetup = true; // builtin macro types ( we try to make the user think these are // normal types ).. - QStringList builtinfiles = + TQStringList builtinfiles = KGlobal::dirs()->findAllResources( "appdata", "builtin-macros/*.kigt", true, false ); - for ( QStringList::iterator file = builtinfiles.begin(); + for ( TQStringList::iterator file = builtinfiles.begin(); file != builtinfiles.end(); ++file ) { std::vector macros; @@ -784,8 +784,8 @@ void KigPart::filePrint() KigPrintDialogPage* kp = new KigPrintDialogPage(); printer.addDialogPage( kp ); printer.setFullPage( true ); - printer.setOption( "kde-kig-showgrid", QString::number( document().grid() ) ); - printer.setOption( "kde-kig-showaxes", QString::number( document().axes() ) ); + printer.setOption( "kde-kig-showgrid", TQString::number( document().grid() ) ); + printer.setOption( "kde-kig-showaxes", TQString::number( document().axes() ) ); printer.setPageSelection( KPrinter::ApplicationSide ); if ( printer.setup( m_widget, i18n("Print Geometry") ) ) { @@ -795,9 +795,9 @@ void KigPart::filePrint() void KigPart::doPrint( KPrinter& printer ) { - QPaintDeviceMetrics metrics( &printer ); + TQPaintDeviceMetrics metrics( &printer ); Rect rect = document().suggestedRect(); - QRect qrect( 0, 0, metrics.width(), metrics.height() ); + TQRect qrect( 0, 0, metrics.width(), metrics.height() ); if ( rect.width() * qrect.height() > rect.height() * qrect.width() ) { // qrect is too high.. @@ -910,7 +910,7 @@ KigDocument& KigPart::document() return *mdocument; } -extern "C" int convertToNative( const KURL& url, const QCString& outfile ) +extern "C" int convertToNative( const KURL& url, const TQCString& outfile ) { kdDebug() << "converting " << url.prettyURL() << " to " << outfile << endl; @@ -921,9 +921,9 @@ extern "C" int convertToNative( const KURL& url, const QCString& outfile ) return -1; } - QString file = url.path(); + TQString file = url.path(); - QFileInfo fileinfo( file ); + TQFileInfo fileinfo( file ); if ( ! fileinfo.exists() ) { kdError() << "The file \"" << file << "\" does not exist" << endl; @@ -952,7 +952,7 @@ extern "C" int convertToNative( const KURL& url, const QCString& outfile ) for ( std::vector::iterator i = tmp.begin(); i != tmp.end(); ++i ) ( *i )->calc( *doc ); - QString out = ( outfile == "-" ) ? QString::null : outfile; + TQString out = ( outfile == "-" ) ? TQString::null : outfile; bool success = KigFilters::instance()->save( *doc, out ); if ( !success ) { @@ -999,14 +999,14 @@ void KigPart::coordSystemChanged( int id ) void KigPart::saveTypes() { - QString typesDir = KGlobal::dirs()->saveLocation( "appdata", "kig-types" ); + TQString typesDir = KGlobal::dirs()->saveLocation( "appdata", "kig-types" ); if ( typesDir[ typesDir.length() - 1 ] != '/' ) typesDir += '/'; - QString typesFileWithPath = typesDir + typesFile; + TQString typesFileWithPath = typesDir + typesFile; // removing existant types file - if ( QFile::exists( typesFileWithPath ) ) - QFile::remove( typesFileWithPath ); + if ( TQFile::exists( typesFileWithPath ) ) + TQFile::remove( typesFileWithPath ); MacroList* macrolist = MacroList::instance(); macrolist->save( macrolist->macros(), typesFileWithPath ); @@ -1014,12 +1014,12 @@ void KigPart::saveTypes() void KigPart::loadTypes() { - QString typesDir = KGlobal::dirs()->saveLocation( "appdata", "kig-types" ); + TQString typesDir = KGlobal::dirs()->saveLocation( "appdata", "kig-types" ); if ( typesDir[ typesDir.length() - 1 ] != '/' ) typesDir += '/'; - QString typesFileWithPath = typesDir + typesFile; + TQString typesFileWithPath = typesDir + typesFile; - if ( QFile::exists( typesFileWithPath ) ) + if ( TQFile::exists( typesFileWithPath ) ) { std::vector macros; MacroList::instance()->load( typesFileWithPath, macros, *this ); diff --git a/kig/kig/kig_part.h b/kig/kig/kig_part.h index 2084d0a9..49204346 100644 --- a/kig/kig/kig_part.h +++ b/kig/kig/kig_part.h @@ -22,7 +22,7 @@ #ifndef KIGPART_H #define KIGPART_H -#include +#include #include @@ -65,9 +65,9 @@ public: /** * Default constructor */ - KigPart( QWidget* parentWidget, const char* widgetName, - QObject* parent = 0, const char* name = 0, - const QStringList& = QStringList() + KigPart( TQWidget* parentWidget, const char* widgetName, + TQObject* parent = 0, const char* name = 0, + const TQStringList& = TQStringList() ); /** @@ -89,7 +89,7 @@ protected: virtual bool saveFile(); public: - void emitStatusBarText( const QString& text ); + void emitStatusBarText( const TQString& text ); void redrawScreen(); void redrawScreen( KigWidget* w ); @@ -191,13 +191,13 @@ public: // the previous mode. Enabling/disabling is done at the same time, // of course.. // some MenuActions.. - QPtrList aMNewSegment; - QPtrList aMNewPoint; - QPtrList aMNewCircle; - QPtrList aMNewLine; - QPtrList aMNewOther; - QPtrList aMNewAll; - QPtrList aMNewConic; + TQPtrList aMNewSegment; + TQPtrList aMNewPoint; + TQPtrList aMNewCircle; + TQPtrList aMNewLine; + TQPtrList aMNewOther; + TQPtrList aMNewAll; + TQPtrList aMNewConic; KAction* aCancelConstruction; diff --git a/kig/kig/kig_view.cpp b/kig/kig/kig_view.cpp index 7d36bc14..fbf16517 100644 --- a/kig/kig/kig_view.cpp +++ b/kig/kig/kig_view.cpp @@ -30,11 +30,11 @@ #include "../modes/mode.h" #include "../modes/dragrectmode.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -47,7 +47,7 @@ #include #include -kdbgstream& operator<< ( kdbgstream& s, const QPoint& t ) +kdbgstream& operator<< ( kdbgstream& s, const TQPoint& t ) { s << "x: " << t.x() << " y: " << t.y(); return s; @@ -55,10 +55,10 @@ kdbgstream& operator<< ( kdbgstream& s, const QPoint& t ) KigWidget::KigWidget( KigPart* part, KigView* view, - QWidget* parent, + TQWidget* parent, const char* name, bool fullscreen ) - : QWidget( parent, name, + : TQWidget( parent, name, fullscreen ? WStyle_Customize | WStyle_NoBorder : 0 ), mpart( part ), mview( view ), @@ -82,12 +82,12 @@ KigWidget::~KigWidget() mpart->delWidget( this ); } -void KigWidget::paintEvent(QPaintEvent*) +void KigWidget::paintEvent(TQPaintEvent*) { updateEntireWidget(); } -void KigWidget::mousePressEvent (QMouseEvent* e) +void KigWidget::mousePressEvent (TQMouseEvent* e) { if( e->button() & Qt::LeftButton ) return mpart->mode()->leftClicked( e, this ); @@ -97,7 +97,7 @@ void KigWidget::mousePressEvent (QMouseEvent* e) return mpart->mode()->rightClicked( e, this ); } -void KigWidget::mouseMoveEvent (QMouseEvent* e) +void KigWidget::mouseMoveEvent (TQMouseEvent* e) { if( e->state() & Qt::LeftButton ) return mpart->mode()->leftMouseMoved( e, this ); @@ -108,7 +108,7 @@ void KigWidget::mouseMoveEvent (QMouseEvent* e) return mpart->mode()->mouseMoved( e, this ); } -void KigWidget::mouseReleaseEvent (QMouseEvent* e) +void KigWidget::mouseReleaseEvent (TQMouseEvent* e) { if( e->state() & Qt::LeftButton ) return mpart->mode()->leftReleased( e, this ); @@ -118,18 +118,18 @@ void KigWidget::mouseReleaseEvent (QMouseEvent* e) return mpart->mode()->rightReleased( e, this ); } -void KigWidget::updateWidget( const std::vector& overlay ) +void KigWidget::updateWidget( const std::vector& overlay ) { #undef SHOW_OVERLAY_RECTS #ifdef SHOW_OVERLAY_RECTS - QPainter debug (this, this); + TQPainter debug (this, this); debug.setPen(Qt::yellow); #endif // SHOW_OVERLAY_RECTS // we undo our old changes... - for ( std::vector::const_iterator i = oldOverlay.begin(); i != oldOverlay.end(); ++i ) + for ( std::vector::const_iterator i = oldOverlay.begin(); i != oldOverlay.end(); ++i ) bitBlt( this, i->topLeft(), &curPix, *i ); // we add our new changes... - for ( std::vector::const_iterator i = overlay.begin(); i != overlay.end(); ++i ) + for ( std::vector::const_iterator i = overlay.begin(); i != overlay.end(); ++i ) { bitBlt( this, i->topLeft(), &curPix, *i ); #ifdef SHOW_OVERLAY_RECTS @@ -141,15 +141,15 @@ void KigWidget::updateWidget( const std::vector& overlay ) void KigWidget::updateEntireWidget() { - std::vector overlay; - overlay.push_back( QRect( QPoint( 0, 0 ), size() ) ); + std::vector overlay; + overlay.push_back( TQRect( TQPoint( 0, 0 ), size() ) ); updateWidget( overlay ); } -void KigWidget::resizeEvent( QResizeEvent* e ) +void KigWidget::resizeEvent( TQResizeEvent* e ) { - QSize osize = e->oldSize(); - QSize nsize = e->size(); + TQSize osize = e->oldSize(); + TQSize nsize = e->size(); Rect orect = msi.shownRect(); curPix.resize( nsize ); @@ -173,12 +173,12 @@ void KigWidget::resizeEvent( QResizeEvent* e ) updateScrollBars(); } -void KigWidget::updateCurPix( const std::vector& ol ) +void KigWidget::updateCurPix( const std::vector& ol ) { // we make curPix look like stillPix again... - for ( std::vector::const_iterator i = oldOverlay.begin(); i != oldOverlay.end(); ++i ) + for ( std::vector::const_iterator i = oldOverlay.begin(); i != oldOverlay.end(); ++i ) bitBlt( &curPix, i->topLeft(), &stillPix, *i ); - for ( std::vector::const_iterator i = ol.begin(); i != ol.end(); ++i ) + for ( std::vector::const_iterator i = ol.begin(); i != ol.end(); ++i ) bitBlt( &curPix, i->topLeft(), &stillPix, *i ); // we add ol to oldOverlay, so that part of the widget will be @@ -233,7 +233,7 @@ void KigWidget::clearStillPix() { stillPix.fill(Qt::white); oldOverlay.clear(); - oldOverlay.push_back ( QRect( QPoint(0,0), size() ) ); + oldOverlay.push_back ( TQRect( TQPoint(0,0), size() ) ); } void KigWidget::redrawScreen( const std::vector& selection, bool dos ) @@ -264,7 +264,7 @@ const Rect KigWidget::showingRect() const return msi.shownRect(); } -const Coordinate KigWidget::fromScreen( const QPoint& p ) +const Coordinate KigWidget::fromScreen( const TQPoint& p ) { return msi.fromScreen( p ); } @@ -274,7 +274,7 @@ double KigWidget::pixelWidth() const return msi.pixelWidth(); } -const Rect KigWidget::fromScreen( const QRect& r ) +const Rect KigWidget::fromScreen( const TQRect& r ) { return msi.fromScreen( r ); } @@ -287,28 +287,28 @@ void KigWidget::updateScrollBars() KigView::KigView( KigPart* part, bool fullscreen, - QWidget* parent, + TQWidget* parent, const char* name ) - : QWidget( parent, name ), + : TQWidget( parent, name ), mlayout( 0 ), mrightscroll( 0 ), mbottomscroll( 0 ), mupdatingscrollbars( false ), mrealwidget( 0 ), mpart( part ) { - connect( part, SIGNAL( recenterScreen() ), this, SLOT( slotInternalRecenterScreen() ) ); + connect( part, TQT_SIGNAL( recenterScreen() ), this, TQT_SLOT( slotInternalRecenterScreen() ) ); - mlayout = new QGridLayout( this, 2, 2 ); - mrightscroll = new QScrollBar( Vertical, this, "Right Scrollbar" ); + mlayout = new TQGridLayout( this, 2, 2 ); + mrightscroll = new TQScrollBar( Vertical, this, "Right Scrollbar" ); // TODO: make this configurable... mrightscroll->setTracking( true ); - connect( mrightscroll, SIGNAL( valueChanged( int ) ), - this, SLOT( slotRightScrollValueChanged( int ) ) ); - connect( mrightscroll, SIGNAL( sliderReleased() ), - this, SLOT( updateScrollBars() ) ); - mbottomscroll = new QScrollBar( Horizontal, this, "Bottom Scrollbar" ); - connect( mbottomscroll, SIGNAL( valueChanged( int ) ), - this, SLOT( slotBottomScrollValueChanged( int ) ) ); - connect( mbottomscroll, SIGNAL( sliderReleased() ), - this, SLOT( updateScrollBars() ) ); + connect( mrightscroll, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( slotRightScrollValueChanged( int ) ) ); + connect( mrightscroll, TQT_SIGNAL( sliderReleased() ), + this, TQT_SLOT( updateScrollBars() ) ); + mbottomscroll = new TQScrollBar( Horizontal, this, "Bottom Scrollbar" ); + connect( mbottomscroll, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( slotBottomScrollValueChanged( int ) ) ); + connect( mbottomscroll, TQT_SIGNAL( sliderReleased() ), + this, TQT_SLOT( updateScrollBars() ) ); mrealwidget = new KigWidget( part, this, this, "Kig Widget", fullscreen ); mlayout->addWidget( mbottomscroll, 1, 0 ); mlayout->addWidget( mrealwidget, 0, 0 ); @@ -443,12 +443,12 @@ const KigDocument& KigWidget::document() const return mpart->document(); } -QSize KigWidget::sizeHint() const +TQSize KigWidget::sizeHint() const { - return QSize( 630, 450 ); + return TQSize( 630, 450 ); } -void KigWidget::wheelEvent( QWheelEvent* e ) +void KigWidget::wheelEvent( TQWheelEvent* e ) { int delta = e->delta(); Qt::Orientation orient = e->orientation(); @@ -568,7 +568,7 @@ void KigWidget::zoomArea() KigInputDialog::getTwoCoordinates( i18n( "Select Zoom Area" ), i18n( "Select the zoom area by entering the coordinates of " "the upper left corner and the lower right corner." ) + - QString::fromLatin1("
") + + TQString::fromLatin1("
") + mpart->document().coordinateSystem().coordinateFormatNoticeMarkup(), this, &ok, mpart->document(), &tl, &br ); if ( ok ) diff --git a/kig/kig/kig_view.h b/kig/kig/kig_view.h index 7970e088..ef8c6860 100644 --- a/kig/kig/kig_view.h +++ b/kig/kig/kig_view.h @@ -22,8 +22,8 @@ #ifndef KIG_VIEW_H #define KIG_VIEW_H -#include -#include +#include +#include #include @@ -54,14 +54,14 @@ class KigWidget : public QWidget KigPart* mpart; KigView* mview; - // we reimplement these from QWidget to suit our needs - void mousePressEvent( QMouseEvent* e ); - void mouseMoveEvent( QMouseEvent* e ); - void mouseReleaseEvent( QMouseEvent* e ); - void paintEvent( QPaintEvent* e ); - void wheelEvent( QWheelEvent* e ); - void resizeEvent( QResizeEvent* ); - QSize sizeHint() const; + // we reimplement these from TQWidget to suit our needs + void mousePressEvent( TQMouseEvent* e ); + void mouseMoveEvent( TQMouseEvent* e ); + void mouseReleaseEvent( TQMouseEvent* e ); + void paintEvent( TQPaintEvent* e ); + void wheelEvent( TQWheelEvent* e ); + void resizeEvent( TQResizeEvent* ); + TQSize sizeHint() const; /** * this is called to match a rect's dimensions to the dimensions of @@ -76,15 +76,15 @@ public: * wondering if this is appropriate, maybe it should be part of * MovingMode ? */ - QPixmap stillPix; + TQPixmap stillPix; /** * temporary, gets bitBlt'd (copied) onto the widget * (to avoid flickering) */ - QPixmap curPix; + TQPixmap curPix; protected: - std::vector oldOverlay; + std::vector oldOverlay; /** * this is a class that maps from our widget coordinates to the @@ -104,7 +104,7 @@ public: */ KigWidget( KigPart* doc, KigView* view, - QWidget* parent = 0, + TQWidget* parent = 0, const char* name = 0, bool fullscreen = false ); @@ -127,7 +127,7 @@ public: * i tried to optimise the drawing as much as possible, using * much ideas from kgeo * DOUBLE BUFFERING: - * we don't draw on the widget directly, we draw on a QPixmap ( + * we don't draw on the widget directly, we draw on a TQPixmap ( * curPix ), and bitBlt that onto the widget to avoid flickering. * TRIPLE BUFFERING: * we also currently keep an extra pixmap of what the widget looks @@ -153,12 +153,12 @@ public: /** * update curPix (bitBlt stillPix onto curPix..) */ - void updateCurPix( const std::vector& = std::vector()); + void updateCurPix( const std::vector& = std::vector()); /** * this means bitBlting curPix on the actual widget... */ - void updateWidget( const std::vector& = std::vector() ); + void updateWidget( const std::vector& = std::vector() ); void updateEntireWidget(); /** @@ -174,8 +174,8 @@ public: const Rect showingRect() const; void setShowingRect( const Rect& r ); - const Coordinate fromScreen( const QPoint& p ); - const Rect fromScreen( const QRect& r ); + const Coordinate fromScreen( const TQPoint& p ); + const Rect fromScreen( const TQRect& r ); double pixelWidth() const; /** @@ -228,12 +228,12 @@ class KigView { Q_OBJECT - QGridLayout* mlayout; - QScrollBar* mrightscroll; - QScrollBar* mbottomscroll; + TQGridLayout* mlayout; + TQScrollBar* mrightscroll; + TQScrollBar* mbottomscroll; /** - * apparently, QScrollBar also emits its signals when you update it + * apparently, TQScrollBar also emits its signals when you update it * manually, so we ignore them while we're in \ref updateScrollBars()... */ bool mupdatingscrollbars; @@ -244,7 +244,7 @@ class KigView public: KigView( KigPart* part, bool fullscreen = false, - QWidget* parent = 0, + TQWidget* parent = 0, const char* name = 0 ); ~KigView(); diff --git a/kig/kig/main.cpp b/kig/kig/main.cpp index d0a70404..577ebda1 100644 --- a/kig/kig/main.cpp +++ b/kig/kig/main.cpp @@ -87,12 +87,12 @@ void KigApplication::handleArgs( KCmdLineArgs* args ) } } -static int convertToNative( const KURL& file, const QCString& outfile ) +static int convertToNative( const KURL& file, const TQCString& outfile ) { KigApplication app( false ); KLibrary* library = KLibLoader::self()->globalLibrary( "libkigpart" ); - int ( *converterfunction )( const KURL&, const QCString& ); - converterfunction = ( int ( * )( const KURL&, const QCString& ) ) library->symbol( "convertToNative" ); + int ( *converterfunction )( const KURL&, const TQCString& ); + converterfunction = ( int ( * )( const KURL&, const TQCString& ) ) library->symbol( "convertToNative" ); if ( !converterfunction ) { kdError() << "Error: broken Kig installation: different library and application version !" << endl; @@ -112,7 +112,7 @@ int main(int argc, char **argv) KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); if ( args->isSet( "convert-to-native" ) ) { - QCString outfile = args->getOption( "outfile" ); + TQCString outfile = args->getOption( "outfile" ); if ( outfile.isNull() ) outfile = "-"; diff --git a/kig/misc/common.cpp b/kig/misc/common.cpp index fccd384f..b41b9284 100644 --- a/kig/misc/common.cpp +++ b/kig/misc/common.cpp @@ -346,20 +346,20 @@ Coordinate calcCircleRadicalStartPoint( const Coordinate& ca, const Coordinate& return m + direc; } -double getDoubleFromUser( const QString& caption, const QString& label, double value, - QWidget* parent, bool* ok, double min, double max, int decimals ) +double getDoubleFromUser( const TQString& caption, const TQString& label, double value, + TQWidget* parent, bool* ok, double min, double max, int decimals ) { #ifdef KIG_USE_KDOUBLEVALIDATOR KDoubleValidator vtor( min, max, decimals, 0, 0 ); #else - KFloatValidator vtor( min, max, (QWidget*) 0, 0 ); + KFloatValidator vtor( min, max, (TQWidget*) 0, 0 ); #endif #if KDE_IS_VERSION( 3, 1, 90 ) - QString input = KInputDialog::getText( + TQString input = KInputDialog::getText( caption, label, KGlobal::locale()->formatNumber( value, decimals ), ok, parent, "getDoubleFromUserDialog", &vtor ); #else - QString input = + TQString input = KLineEditDlg::getText( caption, label, KGlobal::locale()->formatNumber( value, decimals ), ok, parent, &vtor ); diff --git a/kig/misc/common.h b/kig/misc/common.h index 77a1faa2..d1969df3 100644 --- a/kig/misc/common.h +++ b/kig/misc/common.h @@ -25,7 +25,7 @@ #include "coordinate.h" #include "rect.h" -#include +#include #include #include @@ -51,8 +51,8 @@ extern const double double_inf; * various places... */ -double getDoubleFromUser( const QString& caption, const QString& label, double value, - QWidget* parent, bool* ok, double min, double max, int decimals ); +double getDoubleFromUser( const TQString& caption, const TQString& label, double value, + TQWidget* parent, bool* ok, double min, double max, int decimals ); /** * Simple class representing a line. Used by various functions in Kig. diff --git a/kig/misc/coordinate.cpp b/kig/misc/coordinate.cpp index 13501bc9..f2c272f2 100644 --- a/kig/misc/coordinate.cpp +++ b/kig/misc/coordinate.cpp @@ -17,7 +17,7 @@ #include "coordinate.h" -#include +#include #include #include @@ -25,7 +25,7 @@ using namespace std; -Coordinate Coordinate::fromQPoint( const QPoint& p ) +Coordinate Coordinate::fromQPoint( const TQPoint& p ) { return Coordinate( p.x(), p.y() ); } @@ -162,10 +162,10 @@ const Coordinate Coordinate::round() const return Coordinate( qRound( x ), qRound( y ) ); } -QPoint Coordinate::toQPoint() const +TQPoint Coordinate::toQPoint() const { Coordinate t = round(); - return QPoint( (int) t.x, (int) t.y ); + return TQPoint( (int) t.x, (int) t.y ); } Coordinate Coordinate::invalidCoord() diff --git a/kig/misc/coordinate.h b/kig/misc/coordinate.h index a56edb76..96576a48 100644 --- a/kig/misc/coordinate.h +++ b/kig/misc/coordinate.h @@ -33,7 +33,7 @@ class kdbgstream; class Coordinate { public: - static Coordinate fromQPoint( const QPoint& p ); + static Coordinate fromQPoint( const TQPoint& p ); /** Constructor. Construct a new Coordinate, with a given x and y * value. @@ -102,7 +102,7 @@ public: * x/y ratio untouched... */ const Coordinate normalize( double length = 1 ) const; - QPoint toQPoint() const; + TQPoint toQPoint() const; Coordinate& operator= ( const Coordinate& c ); /** Add. Add c to this Coordinate diff --git a/kig/misc/coordinate_system.cpp b/kig/misc/coordinate_system.cpp index dd5181c2..859ed81d 100644 --- a/kig/misc/coordinate_system.cpp +++ b/kig/misc/coordinate_system.cpp @@ -28,8 +28,8 @@ #include "goniometry.h" #include "kigpainter.h" -#include -#include +#include +#include #include #include @@ -48,17 +48,17 @@ class CoordinateValidator #else KFloatValidator mdv; #endif - mutable QRegExp mre; + mutable TQRegExp mre; public: CoordinateValidator( bool polar ); ~CoordinateValidator(); - State validate ( QString & input, int & pos ) const; - void fixup ( QString & input ) const; + State validate ( TQString & input, int & pos ) const; + void fixup ( TQString & input ) const; }; CoordinateValidator::CoordinateValidator( bool polar ) - : QValidator( 0, 0 ), mpolar( polar ), mdv( 0, 0 ), + : TQValidator( 0, 0 ), mpolar( polar ), mdv( 0, 0 ), mre( polar ? "\\(? ?([0-9.,+-]+); ?([0-9.,+-]+) ?°? ?\\)?" : "\\(? ?([0-9.,+-]+); ?([0-9.,+-]+) ?\\)?" ) { @@ -68,9 +68,9 @@ CoordinateValidator::~CoordinateValidator() { } -QValidator::State CoordinateValidator::validate( QString & input, int & pos ) const +TQValidator::State CoordinateValidator::validate( TQString & input, int & pos ) const { - QString tinput = input; + TQString tinput = input; if ( tinput[tinput.length() - 1 ] == ')' ) tinput.truncate( tinput.length() - 1 ); if ( mpolar ) { @@ -84,8 +84,8 @@ QValidator::State CoordinateValidator::validate( QString & input, int & pos ) co if ( scp == -1 ) return mdv.validate( tinput, pos ) == Invalid ? Invalid : Valid; else { - QString p1 = tinput.left( scp ); - QString p2 = tinput.mid( scp + 1 ); + TQString p1 = tinput.left( scp ); + TQString p2 = tinput.mid( scp + 1 ); State ret = Acceptable; @@ -99,7 +99,7 @@ QValidator::State CoordinateValidator::validate( QString & input, int & pos ) co }; } -void CoordinateValidator::fixup( QString & input ) const +void CoordinateValidator::fixup( TQString & input ) const { int nsc = input.contains( ';' ); if ( nsc > 1 ) @@ -116,26 +116,26 @@ void CoordinateValidator::fixup( QString & input ) const sc = input.length(); KLocale* l = KGlobal::locale(); if ( mpolar ) - input.append( QString::fromLatin1( ";" ) + l->positiveSign() + - QString::fromLatin1( "0°" ) ); + input.append( TQString::fromLatin1( ";" ) + l->positiveSign() + + TQString::fromLatin1( "0°" ) ); else - input.append( QString::fromLatin1( ";" ) + l->positiveSign() + - QString::fromLatin1( "0" ) + l->decimalSymbol() + - QString::fromLatin1( "0" ) ); + input.append( TQString::fromLatin1( ";" ) + l->positiveSign() + + TQString::fromLatin1( "0" ) + l->decimalSymbol() + + TQString::fromLatin1( "0" ) ); }; mre.exactMatch( input ); - QString ds1 = mre.cap( 1 ); + TQString ds1 = mre.cap( 1 ); mdv.fixup( ds1 ); - QString ds2 = mre.cap( 2 ); + TQString ds2 = mre.cap( 2 ); mdv.fixup( ds2 ); - input = ds1 + QString::fromLatin1( "; " ) + ds2; + input = ds1 + TQString::fromLatin1( "; " ) + ds2; } EuclideanCoords::EuclideanCoords() { } -QString EuclideanCoords::fromScreen( const Coordinate& p, const KigDocument& d ) const +TQString EuclideanCoords::fromScreen( const Coordinate& p, const KigDocument& d ) const { // i used to use the widget size here, but that's no good idea, // since an object isn't asked to recalc every time the widget size @@ -144,19 +144,19 @@ QString EuclideanCoords::fromScreen( const Coordinate& p, const KigDocument& d ) Rect sr = d.suggestedRect(); double m = kigMax( sr.width(), sr.height() ); int l = kigMax( 0, (int) ( 3 - log10( m ) ) ); - QString xs = KGlobal::locale()->formatNumber( p.x, l ); - QString ys = KGlobal::locale()->formatNumber( p.y, l ); - return QString::fromLatin1( "( %1; %2 )" ).arg( xs ).arg( ys ); + TQString xs = KGlobal::locale()->formatNumber( p.x, l ); + TQString ys = KGlobal::locale()->formatNumber( p.y, l ); + return TQString::fromLatin1( "( %1; %2 )" ).arg( xs ).arg( ys ); } -Coordinate EuclideanCoords::toScreen(const QString& s, bool& ok) const +Coordinate EuclideanCoords::toScreen(const TQString& s, bool& ok) const { - QRegExp r( "\\(? ?([0-9.,+-]+); ?([0-9.,+-]+) ?\\)?" ); + TQRegExp r( "\\(? ?([0-9.,+-]+); ?([0-9.,+-]+) ?\\)?" ); ok = ( r.search(s) == 0 ); if (ok) { - QString xs = r.cap(1); - QString ys = r.cap(2); + TQString xs = r.cap(1); + TQString ys = r.cap(2); KLocale* l = KGlobal::locale(); double x = l->readNumber( xs, &ok ); if ( ! ok ) x = xs.toDouble( &ok ); @@ -241,7 +241,7 @@ void EuclideanCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) co /****** the grid lines ******/ if ( showgrid ) { - p.setPen( QPen( lightGray, 0, DotLine ) ); + p.setPen( TQPen( lightGray, 0, DotLine ) ); // vertical lines... for ( double i = hgraphmin; i <= hgraphmax + hd/2; i += hd ) p.drawSegment( Coordinate( i, vgraphmin ), @@ -255,7 +255,7 @@ void EuclideanCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) co /****** the axes ******/ if ( showaxes ) { - p.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) ); + p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); // x axis p.drawSegment( Coordinate( hmin, 0 ), Coordinate( hmax, 0 ) ); // y axis @@ -286,8 +286,8 @@ void EuclideanCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) co ); }; // arrows on the ends of the axes... - p.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) ); - p.setBrush( QBrush( Qt::gray ) ); + p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); + p.setBrush( TQBrush( Qt::gray ) ); std::vector a; // the arrow on the right end of the X axis... @@ -310,13 +310,13 @@ void EuclideanCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) co }; // if( showaxes ) } -QString EuclideanCoords::coordinateFormatNotice() const +TQString EuclideanCoords::coordinateFormatNotice() const { return i18n( "Enter coordinates in the following format: \"x;y\",\n" "where x is the x coordinate, and y is the y coordinate." ); } -QString EuclideanCoords::coordinateFormatNoticeMarkup() const +TQString EuclideanCoords::coordinateFormatNoticeMarkup() const { return i18n( "Enter coordinates in the following format: \"x;y\", " "where x is the x coordinate, and y is the y coordinate." ); @@ -342,7 +342,7 @@ PolarCoords::~PolarCoords() { } -QString PolarCoords::fromScreen( const Coordinate& pt, const KigDocument& d ) const +TQString PolarCoords::fromScreen( const Coordinate& pt, const KigDocument& d ) const { Rect sr = d.suggestedRect(); double m = kigMax( sr.width(), sr.height() ); @@ -351,37 +351,37 @@ QString PolarCoords::fromScreen( const Coordinate& pt, const KigDocument& d ) co double r = pt.length(); double theta = Goniometry::convert( atan2( pt.y, pt.x ), Goniometry::Rad, Goniometry::Deg ); - QString rs = KGlobal::locale()->formatNumber( r, l ); - QString ts = KGlobal::locale()->formatNumber( theta, 0 ); + TQString rs = KGlobal::locale()->formatNumber( r, l ); + TQString ts = KGlobal::locale()->formatNumber( theta, 0 ); - return QString::fromLatin1("( %1; %2° )").arg( rs ).arg( ts ); + return TQString::fromLatin1("( %1; %2° )").arg( rs ).arg( ts ); } -QString PolarCoords::coordinateFormatNotice() const +TQString PolarCoords::coordinateFormatNotice() const { // \xCE\xB8 is utf8 for the greek theta sign.. return i18n( "Enter coordinates in the following format: \"r; \xCE\xB8°\",\n" "where r and \xCE\xB8 are the polar coordinates." ); } -QString PolarCoords::coordinateFormatNoticeMarkup() const +TQString PolarCoords::coordinateFormatNoticeMarkup() const { // \xCE\xB8 is utf8 for the greek theta sign.. return i18n( "Enter coordinates in the following format: \"r; \xCE\xB8°\", " "where r and \xCE\xB8 are the polar coordinates." ); } -Coordinate PolarCoords::toScreen(const QString& s, bool& ok) const +Coordinate PolarCoords::toScreen(const TQString& s, bool& ok) const { - QRegExp regexp("\\(? ?([0-9.,+-]+); ?([0-9.,+-]+) ?°? ?\\)?" ); + TQRegExp regexp("\\(? ?([0-9.,+-]+); ?([0-9.,+-]+) ?°? ?\\)?" ); ok = ( regexp.search( s ) == 0 ); if (ok) { - QString rs = regexp.cap( 1 ); + TQString rs = regexp.cap( 1 ); double r = KGlobal::locale()->readNumber( rs, &ok ); if ( ! ok ) r = rs.toDouble( &ok ); if ( ! ok ) return Coordinate(); - QString ts = regexp.cap( 2 ); + TQString ts = regexp.cap( 2 ); double theta = KGlobal::locale()->readNumber( ts, &ok ); if ( ! ok ) theta = ts.toDouble( &ok ); if ( ! ok ) return Coordinate(); @@ -442,7 +442,7 @@ void PolarCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) const // we also want the circles that don't fit entirely in the // screen.. Coordinate c( 0, 0 ); - p.setPen( QPen( lightGray, 0, DotLine ) ); + p.setPen( TQPen( lightGray, 0, DotLine ) ); for ( double i = begin; i <= end + d / 2; i += d ) drawGridLine( p, c, fabs( i ) ); } @@ -450,7 +450,7 @@ void PolarCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) const /****** the axes ******/ if ( showaxes ) { - p.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) ); + p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); // x axis p.drawSegment( Coordinate( hmin, 0 ), Coordinate( hmax, 0 ) ); // y axis @@ -465,7 +465,7 @@ void PolarCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) const // through the 0 etc. ) if( fabs( i ) < 1e-8 ) continue; - QString is = KGlobal::locale()->formatNumber( fabs( i ), nfrac ); + TQString is = KGlobal::locale()->formatNumber( fabs( i ), nfrac ); p.drawText( Rect( Coordinate( i, 0 ), hd, -2*vd ).normalized(), is, AlignLeft | AlignTop ); @@ -475,15 +475,15 @@ void PolarCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) const { if( fabs( i ) < 1e-8 ) continue; - QString is = KGlobal::locale()->formatNumber( fabs( i ), nfrac ); + TQString is = KGlobal::locale()->formatNumber( fabs( i ), nfrac ); p.drawText ( Rect( Coordinate( 0, i ), hd, vd ).normalized(), is, AlignBottom | AlignLeft ); }; // arrows on the ends of the axes... - p.setPen( QPen( Qt::gray, 1, Qt::SolidLine ) ); - p.setBrush( QBrush( Qt::gray ) ); + p.setPen( TQPen( Qt::gray, 1, Qt::SolidLine ) ); + p.setBrush( TQBrush( Qt::gray ) ); std::vector a; // the arrow on the right end of the X axis... @@ -506,19 +506,19 @@ void PolarCoords::drawGrid( KigPainter& p, bool showgrid, bool showaxes ) const }; // if( showaxes ) } -QValidator* EuclideanCoords::coordinateValidator() const +TQValidator* EuclideanCoords::coordinateValidator() const { return new CoordinateValidator( false ); } -QValidator* PolarCoords::coordinateValidator() const +TQValidator* PolarCoords::coordinateValidator() const { return new CoordinateValidator( true ); } -QStringList CoordinateSystemFactory::names() +TQStringList CoordinateSystemFactory::names() { - QStringList ret; + TQStringList ret; ret << i18n( "&Euclidean" ) << i18n( "&Polar" ); return ret; @@ -565,7 +565,7 @@ int PolarCoords::id() const return CoordinateSystemFactory::Polar; } -QString CoordinateSystemFactory::setCoordinateSystemStatement( int id ) +TQString CoordinateSystemFactory::setCoordinateSystemStatement( int id ) { switch( id ) { @@ -575,7 +575,7 @@ QString CoordinateSystemFactory::setCoordinateSystemStatement( int id ) return i18n( "Set Polar Coordinate System" ); default: assert( false ); - return QString::null; + return TQString::null; } } diff --git a/kig/misc/coordinate_system.h b/kig/misc/coordinate_system.h index af426909..000b52d1 100644 --- a/kig/misc/coordinate_system.h +++ b/kig/misc/coordinate_system.h @@ -21,7 +21,7 @@ #ifndef KIG_MISC_COORDINATE_SYSTEM_H #define KIG_MISC_COORDINATE_SYSTEM_H -#include +#include class KigPainter; class KigDocument; @@ -42,8 +42,8 @@ class CoordinateSystemFactory public: enum { Euclidean = 0, Polar = 1 }; - static QStringList names(); - static QString setCoordinateSystemStatement( int id ); + static TQStringList names(); + static TQString setCoordinateSystemStatement( int id ); static CoordinateSystem* build( int which ); static CoordinateSystem* build( const char* type ); }; @@ -65,23 +65,23 @@ public: CoordinateSystem(); virtual ~CoordinateSystem(); - virtual QString fromScreen ( const Coordinate& pt, const KigDocument& w ) const = 0; + virtual TQString fromScreen ( const Coordinate& pt, const KigDocument& w ) const = 0; /** * This returns a notice to say in which format coordinates should * be entered. This should be something like: * i18n( "Enter coordinates in the following form: \"(x,y)\", where * x is the x coordinate, and y is the y coordinate." ); */ - virtual QString coordinateFormatNotice() const = 0; + virtual TQString coordinateFormatNotice() const = 0; /** * Like \ref coordinateFormatNotice(), but with HTML tags useful to * have a rich text... */ - virtual QString coordinateFormatNoticeMarkup() const = 0; - virtual Coordinate toScreen (const QString& pt, bool& ok) const = 0; + virtual TQString coordinateFormatNoticeMarkup() const = 0; + virtual Coordinate toScreen (const TQString& pt, bool& ok) const = 0; virtual void drawGrid ( KigPainter& p, bool showgrid = true, bool showaxes = true ) const = 0; - virtual QValidator* coordinateValidator() const = 0; + virtual TQValidator* coordinateValidator() const = 0; virtual Coordinate snapToGrid( const Coordinate& c, const KigWidget& w ) const = 0; @@ -95,13 +95,13 @@ class EuclideanCoords public: EuclideanCoords(); ~EuclideanCoords(); - QString fromScreen( const Coordinate& pt, const KigDocument& w ) const; - QString coordinateFormatNotice() const; - QString coordinateFormatNoticeMarkup() const; - Coordinate toScreen (const QString& pt, bool& ok) const; + TQString fromScreen( const Coordinate& pt, const KigDocument& w ) const; + TQString coordinateFormatNotice() const; + TQString coordinateFormatNoticeMarkup() const; + Coordinate toScreen (const TQString& pt, bool& ok) const; void drawGrid ( KigPainter& p, bool showgrid = true, bool showaxes = true ) const; - QValidator* coordinateValidator() const; + TQValidator* coordinateValidator() const; Coordinate snapToGrid( const Coordinate& c, const KigWidget& w ) const; @@ -117,13 +117,13 @@ class PolarCoords public: PolarCoords(); ~PolarCoords(); - QString fromScreen( const Coordinate& pt, const KigDocument& w ) const; - QString coordinateFormatNotice() const; - QString coordinateFormatNoticeMarkup() const; - Coordinate toScreen (const QString& pt, bool& ok) const; + TQString fromScreen( const Coordinate& pt, const KigDocument& w ) const; + TQString coordinateFormatNotice() const; + TQString coordinateFormatNoticeMarkup() const; + Coordinate toScreen (const TQString& pt, bool& ok) const; void drawGrid ( KigPainter& p, bool showgrid = true, bool showaxes = true ) const; - QValidator* coordinateValidator() const; + TQValidator* coordinateValidator() const; Coordinate snapToGrid( const Coordinate& c, const KigWidget& w ) const; diff --git a/kig/misc/goniometry.cc b/kig/misc/goniometry.cc index 13d72fdb..61e13358 100644 --- a/kig/misc/goniometry.cc +++ b/kig/misc/goniometry.cc @@ -22,7 +22,7 @@ #include "goniometry.h" -#include +#include #include #include @@ -115,9 +115,9 @@ double Goniometry::convert( const double angle, const Goniometry::System from, c return angle; } -QStringList Goniometry::systemList() +TQStringList Goniometry::systemList() { - QStringList sl; + TQStringList sl; sl << i18n( "Translators: Degrees", "Deg" ); sl << i18n( "Translators: Radians", "Rad" ); sl << i18n( "Translators: Gradians", "Grad" ); diff --git a/kig/misc/goniometry.h b/kig/misc/goniometry.h index eae84ced..8c5bb51d 100644 --- a/kig/misc/goniometry.h +++ b/kig/misc/goniometry.h @@ -20,7 +20,7 @@ #ifndef KIG_MISC_GONIOMETRY_H #define KIG_MISC_GONIOMETRY_H -#include +#include /** * Manage an angle and convert it from/to other goniometric systems. @@ -58,7 +58,7 @@ public: /** * Get a list of the supported goniometric systems. */ - static QStringList systemList(); + static TQStringList systemList(); static Goniometry::System intToSystem( const int index ); Goniometry& operator= ( const Goniometry& g ); diff --git a/kig/misc/guiaction.cc b/kig/misc/guiaction.cc index d4be4ded..c9435d2b 100644 --- a/kig/misc/guiaction.cc +++ b/kig/misc/guiaction.cc @@ -34,7 +34,7 @@ #include #include -#include +#include int GUIAction::shortcut() const { @@ -51,23 +51,23 @@ ConstructibleAction::~ConstructibleAction() ConstructibleAction::ConstructibleAction( ObjectConstructor* ctor, - const QCString& actionname, + const TQCString& actionname, int shortcut ) : GUIAction(), mctor( ctor ), mactionname( actionname ), mshortcut( shortcut ) { } -QString ConstructibleAction::description() const +TQString ConstructibleAction::description() const { return mctor->description(); } -QCString ConstructibleAction::iconFileName() const +TQCString ConstructibleAction::iconFileName() const { return mctor->iconFileName(); } -QString ConstructibleAction::descriptiveName() const +TQString ConstructibleAction::descriptiveName() const { return mctor->descriptiveName(); } @@ -81,7 +81,7 @@ void ConstructibleAction::act( KigPart& d ) KigGUIAction::KigGUIAction( GUIAction* act, KigPart& doc, - QObject* parent ) + TQObject* parent ) : KAction( act->descriptiveName(), doc.instance()->iconLoader()->loadIcon( act->iconFileName(), KIcon::Toolbar, 0, KIcon::DefaultState, 0L, true ), @@ -92,8 +92,8 @@ KigGUIAction::KigGUIAction( GUIAction* act, mdoc( doc ) { setWhatsThis( act->description() ); - QString tooltip = act->descriptiveName(); - tooltip.replace( QRegExp( "&&" ), "&" ); + TQString tooltip = act->descriptiveName(); + tooltip.replace( TQRegExp( "&&" ), "&" ); setToolTip( tooltip ); } @@ -111,7 +111,7 @@ ConstructPointAction::~ConstructPointAction() { } -QString ConstructPointAction::description() const +TQString ConstructPointAction::description() const { return i18n( "A normal point, i.e. one that is either independent or attached " @@ -119,12 +119,12 @@ QString ConstructPointAction::description() const ); } -QCString ConstructPointAction::iconFileName() const +TQCString ConstructPointAction::iconFileName() const { return "point"; } -QString ConstructPointAction::descriptiveName() const +TQString ConstructPointAction::descriptiveName() const { return i18n("Point"); } @@ -165,17 +165,17 @@ void ConstructibleAction::plug( KigPart* doc, KigGUIAction* kact ) mctor->plug( doc, kact ); } -QString ConstructTextLabelAction::description() const +TQString ConstructTextLabelAction::description() const { return i18n( "Construct a text label." ); } -QCString ConstructTextLabelAction::iconFileName() const +TQCString ConstructTextLabelAction::iconFileName() const { return "kig_text"; } -QString ConstructTextLabelAction::descriptiveName() const +TQString ConstructTextLabelAction::descriptiveName() const { return i18n( "Text Label" ); } @@ -196,17 +196,17 @@ ConstructTextLabelAction::ConstructTextLabelAction( const char* actionname ) { } -QString AddFixedPointAction::description() const +TQString AddFixedPointAction::description() const { return i18n( "Construct a Point by its Coordinates" ); } -QCString AddFixedPointAction::iconFileName() const +TQCString AddFixedPointAction::iconFileName() const { return "pointxy"; } -QString AddFixedPointAction::descriptiveName() const +TQString AddFixedPointAction::descriptiveName() const { return i18n( "Point by Coordinates" ); } @@ -223,7 +223,7 @@ void AddFixedPointAction::act( KigPart& doc ) KigInputDialog::getCoordinate( i18n( "Fixed Point" ), i18n( "Enter the coordinates for the new point." ) + - QString::fromLatin1( "
" ) + + TQString::fromLatin1( "
" ) + doc.document().coordinateSystem().coordinateFormatNoticeMarkup(), doc.widget(), &ok, doc.document(), &c ); if ( ! ok ) return; @@ -270,19 +270,19 @@ TestAction::~TestAction() { } -QString TestAction::description() const +TQString TestAction::description() const { - return QString::fromLatin1( "Test stuff !!!" ); + return TQString::fromLatin1( "Test stuff !!!" ); } -QCString TestAction::iconFileName() const +TQCString TestAction::iconFileName() const { return "new"; } -QString TestAction::descriptiveName() const +TQString TestAction::descriptiveName() const { - return QString::fromLatin1( "Test stuff !!!" ); + return TQString::fromLatin1( "Test stuff !!!" ); } const char* TestAction::actionName() const @@ -297,7 +297,7 @@ void TestAction::act( KigPart& doc ) Object* constantpoint = ObjectFactory::instance()->fixedPoint( Coordinate( -1, -1 ) ); constantpoint->calc( doc ); - Object* codeobject = new DataObject( new StringImp( QString::fromLatin1( script ) ) ); + Object* codeobject = new DataObject( new StringImp( TQString::fromLatin1( script ) ) ); Object* compiledcode = new RealObject( PythonCompileType::instance(), Objects( codeobject ) ); compiledcode->calc( doc ); @@ -322,7 +322,7 @@ NewScriptAction::NewScriptAction( const char* descname, const char* description, : GUIAction(), mactionname( actionname ), mdescname( descname ), mdescription( description ), micon( icon ), mtype( type ) { - if ( QString( micon ).isEmpty() ) + if ( TQString( micon ).isEmpty() ) { micon = ScriptType::icon( type ); } @@ -332,17 +332,17 @@ NewScriptAction::~NewScriptAction() { } -QString NewScriptAction::description() const +TQString NewScriptAction::description() const { return i18n( mdescription ); } -QCString NewScriptAction::iconFileName() const +TQCString NewScriptAction::iconFileName() const { return micon; } -QString NewScriptAction::descriptiveName() const +TQString NewScriptAction::descriptiveName() const { return i18n( mdescname ); } diff --git a/kig/misc/guiaction.h b/kig/misc/guiaction.h index c188a492..e2e3de54 100644 --- a/kig/misc/guiaction.h +++ b/kig/misc/guiaction.h @@ -24,8 +24,8 @@ #include "../scripting/script-common.h" #endif -#include -#include +#include +#include #include class GUIAction; @@ -40,7 +40,7 @@ class KigGUIAction public: KigGUIAction( GUIAction* act, KigPart& doc, - QObject* parent ); + TQObject* parent ); void slotActivated(); GUIAction* guiAction(); @@ -53,9 +53,9 @@ class GUIAction public: virtual ~GUIAction(); - virtual QString description() const = 0; - virtual QCString iconFileName() const = 0; - virtual QString descriptiveName() const = 0; + virtual TQString description() const = 0; + virtual TQCString iconFileName() const = 0; + virtual TQString descriptiveName() const = 0; virtual const char* actionName() const = 0; virtual int shortcut() const = 0; virtual void act( KigPart& ) = 0; @@ -69,15 +69,15 @@ class ConstructibleAction : public GUIAction { ObjectConstructor* mctor; - QCString mactionname; + TQCString mactionname; int mshortcut; public: - ConstructibleAction( ObjectConstructor* ctor, const QCString& actionname, + ConstructibleAction( ObjectConstructor* ctor, const TQCString& actionname, int shortcut = 0 ); ~ConstructibleAction(); - QString description() const; - QCString iconFileName() const; - QString descriptiveName() const; + TQString description() const; + TQCString iconFileName() const; + TQString descriptiveName() const; const char* actionName() const; int shortcut() const; void act( KigPart& ); @@ -92,9 +92,9 @@ public: ConstructPointAction( const char* actionname ); ~ConstructPointAction(); - QString description() const; - QCString iconFileName() const; - QString descriptiveName() const; + TQString description() const; + TQCString iconFileName() const; + TQString descriptiveName() const; const char* actionName() const; int shortcut() const; void act( KigPart& ); @@ -107,9 +107,9 @@ class ConstructTextLabelAction public: ConstructTextLabelAction( const char* actionname ); - QString description() const; - QCString iconFileName() const; - QString descriptiveName() const; + TQString description() const; + TQCString iconFileName() const; + TQString descriptiveName() const; const char* actionName() const; int shortcut() const; void act( KigPart& ); @@ -122,9 +122,9 @@ class AddFixedPointAction public: AddFixedPointAction( const char* actionname ); ~AddFixedPointAction(); - QString description() const; - QCString iconFileName() const; - QString descriptiveName() const; + TQString description() const; + TQCString iconFileName() const; + TQString descriptiveName() const; const char* actionName() const; int shortcut() const; void act( KigPart& ); @@ -138,9 +138,9 @@ class TestAction public: TestAction( const char* actionname ); ~TestAction(); - QString description() const; - QCString iconFileName() const; - QString descriptiveName() const; + TQString description() const; + TQCString iconFileName() const; + TQString descriptiveName() const; const char* actionName() const; void act( KigPart& ); }; @@ -161,9 +161,9 @@ public: const char* actionname, const ScriptType::Type type, const char* icon = "" ); ~NewScriptAction(); - QString description() const; - QCString iconFileName() const; - QString descriptiveName() const; + TQString description() const; + TQCString iconFileName() const; + TQString descriptiveName() const; const char* actionName() const; void act( KigPart& ); int shortcut() const; diff --git a/kig/misc/kigfiledialog.cc b/kig/misc/kigfiledialog.cc index 6b8d8cb4..2d7ea08f 100644 --- a/kig/misc/kigfiledialog.cc +++ b/kig/misc/kigfiledialog.cc @@ -18,14 +18,14 @@ #include "kigfiledialog.h" #include "kigfiledialog.moc" -#include -#include +#include +#include #include #include -KigFileDialog::KigFileDialog( const QString& startDir, const QString& filter, - const QString& caption, QWidget* parent ) +KigFileDialog::KigFileDialog( const TQString& startDir, const TQString& filter, + const TQString& caption, TQWidget* parent ) : KFileDialog( startDir, filter, parent, "kigfiledialog", true ), mow( 0L ) { @@ -35,7 +35,7 @@ KigFileDialog::KigFileDialog( const QString& startDir, const QString& filter, moptcaption = i18n( "Options" ); } -void KigFileDialog::setOptionsWidget( QWidget* w ) +void KigFileDialog::setOptionsWidget( TQWidget* w ) { mow = w; } @@ -46,10 +46,10 @@ void KigFileDialog::accept() // the selected file name _before_ the dialog is accept()'ed or // reject()'ed... in every case, below we make sure to accept() or // reject()... - setResult( QDialog::Accepted ); + setResult( TQDialog::Accepted ); - QString sFile = selectedFile(); - if ( QFile::exists( sFile ) ) + TQString sFile = selectedFile(); + if ( TQFile::exists( sFile ) ) { int ret = KMessageBox::warningContinueCancel( this, i18n( "The file \"%1\" already exists. Do you wish to overwrite it?" ) @@ -64,15 +64,15 @@ void KigFileDialog::accept() { KDialogBase* optdlg = new KDialogBase( this, "optdlg", true, moptcaption, Cancel|Ok, Cancel, true ); - mow->reparent( optdlg, QPoint() ); + mow->reparent( optdlg, TQPoint() ); optdlg->setMainWidget( mow ); - optdlg->exec() == QDialog::Accepted ? KFileDialog::accept() : KFileDialog::reject(); + optdlg->exec() == TQDialog::Accepted ? KFileDialog::accept() : KFileDialog::reject(); } else KFileDialog::accept(); } -void KigFileDialog::setOptionCaption( const QString& caption ) +void KigFileDialog::setOptionCaption( const TQString& caption ) { if ( caption.isEmpty() ) return; diff --git a/kig/misc/kigfiledialog.h b/kig/misc/kigfiledialog.h index 0337236d..8c243131 100644 --- a/kig/misc/kigfiledialog.h +++ b/kig/misc/kigfiledialog.h @@ -33,9 +33,9 @@ private: /** * Options widget */ - QWidget* mow; + TQWidget* mow; - QString moptcaption; + TQString moptcaption; public: /** @@ -47,8 +47,8 @@ public: * \param caption the caption of this file dialog * \param parent the parent for this file dialog */ - KigFileDialog( const QString& startDir, const QString& filter, - const QString& caption, QWidget *parent ); + KigFileDialog( const TQString& startDir, const TQString& filter, + const TQString& caption, TQWidget *parent ); /** * Use this to set the widget containing the options of eg an export filter. @@ -60,14 +60,14 @@ public: * * \param w the option widget */ - void setOptionsWidget( QWidget* w ); + void setOptionsWidget( TQWidget* w ); /** * Set the caption of the option dialog * * \param caption the caption of the option dialog */ - void setOptionCaption( const QString& caption ); + void setOptionCaption( const TQString& caption ); protected slots: virtual void accept(); diff --git a/kig/misc/kiginputdialog.cc b/kig/misc/kiginputdialog.cc index 8a2c38e5..ea0aeb66 100644 --- a/kig/misc/kiginputdialog.cc +++ b/kig/misc/kiginputdialog.cc @@ -27,11 +27,11 @@ #include "../kig/kig_document.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -44,7 +44,7 @@ class KigInputDialogPrivate public: KigInputDialogPrivate(); - QLabel* m_label; + TQLabel* m_label; KLineEdit* m_lineEditFirst; KLineEdit* m_lineEditSecond; KComboBox* m_comboBox; @@ -53,7 +53,7 @@ public: Coordinate m_coord1; Coordinate m_coord2; KigDocument m_doc; - QValidator* m_vtor; + TQValidator* m_vtor; Goniometry m_gonio; bool m_gonioIsNum; }; @@ -64,8 +64,8 @@ KigInputDialogPrivate::KigInputDialogPrivate() { } -KigInputDialog::KigInputDialog( const QString& caption, const QString& label, - QWidget* parent, const KigDocument& doc, Coordinate* c1, Coordinate* c2 ) +KigInputDialog::KigInputDialog( const TQString& caption, const TQString& label, + TQWidget* parent, const KigDocument& doc, Coordinate* c1, Coordinate* c2 ) : KDialogBase( parent, "kigdialog", true, caption, Ok|Cancel, Cancel, true ), d( new KigInputDialogPrivate() ) { @@ -77,8 +77,8 @@ KigInputDialog::KigInputDialog( const QString& caption, const QString& label, int deltay = 0; bool ok = false; - QFrame* frame = makeMainWidget(); - QVBoxLayout* mainlay = new QVBoxLayout( frame, 0, spacingHint() ); + TQFrame* frame = makeMainWidget(); + TQVBoxLayout* mainlay = new TQVBoxLayout( frame, 0, spacingHint() ); mainlay->activate(); d->m_textEdit = new KTextEdit( frame ); @@ -86,7 +86,7 @@ KigInputDialog::KigInputDialog( const QString& caption, const QString& label, d->m_textEdit->setReadOnly( true ); d->m_textEdit->setFocusPolicy( NoFocus ); // d->m_textEdit->setAlignment( d->m_textEdit->alignment() | Qt::WordBreak ); - d->m_textEdit->setFrameStyle( QFrame::NoFrame ); + d->m_textEdit->setFrameStyle( TQFrame::NoFrame ); mainlay->addWidget( d->m_textEdit ); d->m_lineEditFirst = new KLineEdit( frame ); @@ -98,8 +98,8 @@ KigInputDialog::KigInputDialog( const QString& caption, const QString& label, } mainlay->addWidget( d->m_lineEditFirst ); - connect( d->m_lineEditFirst, SIGNAL(textChanged(const QString&)), - this, SLOT(slotCoordsChanged(const QString&)) ); + connect( d->m_lineEditFirst, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotCoordsChanged(const TQString&)) ); if ( d->m_coord2.valid() ) { @@ -108,8 +108,8 @@ KigInputDialog::KigInputDialog( const QString& caption, const QString& label, d->m_lineEditSecond->setText( d->m_doc.coordinateSystem().fromScreen( d->m_coord2, d->m_doc ) ); mainlay->addWidget( d->m_lineEditSecond ); - connect( d->m_lineEditSecond, SIGNAL(textChanged(const QString&)), - this, SLOT(slotCoordsChanged(const QString&)) ); + connect( d->m_lineEditSecond, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotCoordsChanged(const TQString&)) ); deltay += d->m_lineEditSecond->height() + spacingHint(); } @@ -121,27 +121,27 @@ KigInputDialog::KigInputDialog( const QString& caption, const QString& label, enableButtonOK( ok ); } -KigInputDialog::KigInputDialog( QWidget* parent, const Goniometry& g ) +KigInputDialog::KigInputDialog( TQWidget* parent, const Goniometry& g ) : KDialogBase( parent, "kigdialog", true, i18n( "Set Angle Size" ), Ok|Cancel, Cancel, true ), d( new KigInputDialogPrivate() ) { d->m_gonio = g; d->m_gonioIsNum = true; - QFrame* frame = makeMainWidget(); - QVBoxLayout* mainlay = new QVBoxLayout( frame, 0, spacingHint() ); + TQFrame* frame = makeMainWidget(); + TQVBoxLayout* mainlay = new TQVBoxLayout( frame, 0, spacingHint() ); mainlay->activate(); - d->m_label = new QLabel( frame ); + d->m_label = new TQLabel( frame ); d->m_label->setText( i18n( "Insert the new size of this angle:" ) ); mainlay->addWidget( d->m_label ); - QHBoxLayout* horlay = new QHBoxLayout( 0, 0, spacingHint() ); + TQHBoxLayout* horlay = new TQHBoxLayout( 0, 0, spacingHint() ); horlay->activate(); d->m_lineEditFirst = new KLineEdit( frame ); - d->m_lineEditFirst->setText( QString::number( d->m_gonio.value() ) ); - QWhatsThis::add( + d->m_lineEditFirst->setText( TQString::number( d->m_gonio.value() ) ); + TQWhatsThis::add( d->m_lineEditFirst, i18n( "Use this edit field to modify the size of this angle." ) ); horlay->addWidget( d->m_lineEditFirst ); @@ -149,7 +149,7 @@ KigInputDialog::KigInputDialog( QWidget* parent, const Goniometry& g ) d->m_comboBox = new KComboBox( frame ); d->m_comboBox->insertStringList( Goniometry::systemList() ); d->m_comboBox->setCurrentItem( d->m_gonio.system() ); - QWhatsThis::add( + TQWhatsThis::add( d->m_comboBox, i18n( "Choose from this list the goniometric unit you want to use to " "modify the size of this angle.
\n" @@ -159,17 +159,17 @@ KigInputDialog::KigInputDialog( QWidget* parent, const Goniometry& g ) mainlay->addLayout( horlay ); - connect( d->m_lineEditFirst, SIGNAL(textChanged(const QString&)), - this, SLOT(slotGonioTextChanged(const QString&)) ); - connect( d->m_comboBox, SIGNAL(activated(int)), - this, SLOT(slotGonioSystemChanged(int)) ); + connect( d->m_lineEditFirst, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotGonioTextChanged(const TQString&)) ); + connect( d->m_comboBox, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotGonioSystemChanged(int)) ); resize( 350, 100 ); d->m_lineEditFirst->setFocus(); } -void KigInputDialog::keyPressEvent( QKeyEvent* e ) +void KigInputDialog::keyPressEvent( TQKeyEvent* e ) { if ( ( e->key() == Qt::Key_Return ) && ( e->state() == 0 ) ) { @@ -189,18 +189,18 @@ void KigInputDialog::keyPressEvent( QKeyEvent* e ) } -void KigInputDialog::slotCoordsChanged( const QString& ) +void KigInputDialog::slotCoordsChanged( const TQString& ) { int p = 0; - QString t = d->m_lineEditFirst->text(); - bool ok = d->m_vtor->validate( t, p ) == QValidator::Acceptable; + TQString t = d->m_lineEditFirst->text(); + bool ok = d->m_vtor->validate( t, p ) == TQValidator::Acceptable; if ( ok ) d->m_coord1 = d->m_doc.coordinateSystem().toScreen( t, ok ); if ( d->m_lineEditSecond ) { p = 0; t = d->m_lineEditSecond->text(); - ok &= d->m_vtor->validate( t, p ) == QValidator::Acceptable; + ok &= d->m_vtor->validate( t, p ) == TQValidator::Acceptable; if ( ok ) d->m_coord2 = d->m_doc.coordinateSystem().toScreen( t, ok ); } @@ -214,11 +214,11 @@ void KigInputDialog::slotGonioSystemChanged( int index ) { Goniometry::System newsys = Goniometry::intToSystem( index ); d->m_gonio.convertTo( newsys ); - d->m_lineEditFirst->setText( QString::number( d->m_gonio.value() ) ); + d->m_lineEditFirst->setText( TQString::number( d->m_gonio.value() ) ); } } -void KigInputDialog::slotGonioTextChanged( const QString& txt ) +void KigInputDialog::slotGonioTextChanged( const TQString& txt ) { if ( txt.isNull() ) d->m_gonioIsNum = false; @@ -246,14 +246,14 @@ Goniometry KigInputDialog::goniometry() const return d->m_gonio; } -void KigInputDialog::getCoordinate( const QString& caption, const QString& label, - QWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue ) +void KigInputDialog::getCoordinate( const TQString& caption, const TQString& label, + TQWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue ) { getTwoCoordinates( caption, label, parent, ok, doc, cvalue, 0 ); } -void KigInputDialog::getTwoCoordinates( const QString& caption, const QString& label, - QWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue, +void KigInputDialog::getTwoCoordinates( const TQString& caption, const TQString& label, + TQWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue, Coordinate* cvalue2 ) { KigInputDialog dlg( caption, label, parent, doc, cvalue, cvalue2 ); @@ -273,7 +273,7 @@ void KigInputDialog::getTwoCoordinates( const QString& caption, const QString& l } -Goniometry KigInputDialog::getAngle( QWidget* parent, bool* ok, const Goniometry& g ) +Goniometry KigInputDialog::getAngle( TQWidget* parent, bool* ok, const Goniometry& g ) { KigInputDialog dlg( parent, g ); diff --git a/kig/misc/kiginputdialog.h b/kig/misc/kiginputdialog.h index afdd303d..28d5ae83 100644 --- a/kig/misc/kiginputdialog.h +++ b/kig/misc/kiginputdialog.h @@ -45,11 +45,11 @@ Q_OBJECT public: private: - KigInputDialog( const QString& caption, const QString& label, QWidget* parent, + KigInputDialog( const TQString& caption, const TQString& label, TQWidget* parent, const KigDocument& doc, Coordinate* c1, Coordinate* c2 ); - KigInputDialog( QWidget* parent, const Goniometry& g ); + KigInputDialog( TQWidget* parent, const Goniometry& g ); - virtual void keyPressEvent( QKeyEvent* e ); + virtual void keyPressEvent( TQKeyEvent* e ); KigInputDialogPrivate* const d; friend class KInputDialogPrivate; @@ -59,9 +59,9 @@ private: Goniometry goniometry() const; private slots: - void slotCoordsChanged( const QString& ); + void slotCoordsChanged( const TQString& ); void slotGonioSystemChanged( int index ); - void slotGonioTextChanged( const QString& txt ); + void slotGonioTextChanged( const TQString& txt ); public: /** @@ -78,8 +78,8 @@ public: * here. If this points to a valid Coordinate, then it will be * displayed as initial value of the correspondenting text edit */ - static void getCoordinate( const QString& caption, const QString& label, - QWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue ); + static void getCoordinate( const TQString& caption, const TQString& label, + TQWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue ); /** * Static convenience function to get two Coordinates at once from the user. @@ -101,8 +101,8 @@ public: * Coordinate, then it will be displayed as initial value of * the text edit representing the second Coordinate. */ - static void getTwoCoordinates( const QString& caption, const QString& label, - QWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue, + static void getTwoCoordinates( const TQString& caption, const TQString& label, + TQWidget* parent, bool* ok, const KigDocument& doc, Coordinate* cvalue, Coordinate* cvalue2 ); /** @@ -117,7 +117,7 @@ public: * * \return a Goniometry class containing the new angle */ - static Goniometry getAngle( QWidget* parent, bool* ok, const Goniometry& g ); + static Goniometry getAngle( TQWidget* parent, bool* ok, const Goniometry& g ); }; #endif diff --git a/kig/misc/kigpainter.cpp b/kig/misc/kigpainter.cpp index e2b2f440..98594ecb 100644 --- a/kig/misc/kigpainter.cpp +++ b/kig/misc/kigpainter.cpp @@ -32,14 +32,14 @@ #include "cubic-common.h" #include "coordinate_system.h" -#include +#include #include #include #include #include -KigPainter::KigPainter( const ScreenInfo& si, QPaintDevice* device, +KigPainter::KigPainter( const ScreenInfo& si, TQPaintDevice* device, const KigDocument& doc, bool no ) : mP ( device ), color( Qt::blue ), @@ -63,13 +63,13 @@ KigPainter::~KigPainter() void KigPainter::drawRect( const Rect& r ) { Rect rt = r.normalized(); - QRect qr = toScreen(rt); + TQRect qr = toScreen(rt); qr.normalize(); mP.drawRect(qr); if( mNeedOverlay ) mOverlay.push_back( qr ); } -void KigPainter::drawRect( const QRect& r ) +void KigPainter::drawRect( const TQRect& r ) { mP.drawRect(r); if( mNeedOverlay ) mOverlay.push_back( r ); @@ -80,14 +80,14 @@ void KigPainter::drawCircle( const Coordinate& center, const double radius ) Coordinate bottomLeft = center - Coordinate(radius, radius); Coordinate topRight = center + Coordinate(radius, radius); Rect r( bottomLeft, topRight ); - QRect qr = toScreen( r ); + TQRect qr = toScreen( r ); mP.drawEllipse ( qr ); if( mNeedOverlay ) circleOverlay( center, radius ); } void KigPainter::drawSegment( const Coordinate& from, const Coordinate& to ) { - QPoint tF = toScreen(from), tT = toScreen(to); + TQPoint tF = toScreen(from), tT = toScreen(to); mP.drawLine( tF, tT ); if( mNeedOverlay ) segmentOverlay( from, to ); } @@ -95,7 +95,7 @@ void KigPainter::drawSegment( const Coordinate& from, const Coordinate& to ) void KigPainter::drawFatPoint( const Coordinate& p ) { int twidth = width == -1 ? 5 : width; - mP.setPen( QPen( color, 1, style ) ); + mP.setPen( TQPen( color, 1, style ) ); switch ( pointstyle ) { case 0: @@ -107,7 +107,7 @@ void KigPainter::drawFatPoint( const Coordinate& p ) Coordinate tl = p - rad; Coordinate br = p + rad; Rect r( tl, br ); - QRect qr = toScreen( r ); + TQRect qr = toScreen( r ); mP.drawEllipse( qr ); if( mNeedOverlay ) mOverlay.push_back( qr ); break; @@ -121,7 +121,7 @@ void KigPainter::drawFatPoint( const Coordinate& p ) Coordinate tl = p - rad; Coordinate br = p + rad; Rect r( tl, br ); - QRect qr = toScreen( r ); + TQRect qr = toScreen( r ); mP.drawEllipse( qr ); if( mNeedOverlay ) mOverlay.push_back( qr ); break; @@ -134,9 +134,9 @@ void KigPainter::drawFatPoint( const Coordinate& p ) Coordinate tl = p - rad; Coordinate br = p + rad; Rect r( tl, br ); - QRect qr = toScreen( r ); + TQRect qr = toScreen( r ); mP.drawRect( qr ); - mP.fillRect( qr, QBrush( color, Qt::SolidPattern ) ); + mP.fillRect( qr, TQBrush( color, Qt::SolidPattern ) ); if( mNeedOverlay ) mOverlay.push_back( qr ); break; } @@ -148,7 +148,7 @@ void KigPainter::drawFatPoint( const Coordinate& p ) Coordinate tl = p - rad; Coordinate br = p + rad; Rect r( tl, br ); - QRect qr = toScreen( r ); + TQRect qr = toScreen( r ); mP.drawRect( qr ); if( mNeedOverlay ) mOverlay.push_back( qr ); break; @@ -161,15 +161,15 @@ void KigPainter::drawFatPoint( const Coordinate& p ) Coordinate tl = p - rad; Coordinate br = p + rad; Rect r( tl, br ); - QRect qr = toScreen( r ); - mP.setPen( QPen( color, 2 ) ); + TQRect qr = toScreen( r ); + mP.setPen( TQPen( color, 2 ) ); mP.drawLine( qr.topLeft(), qr.bottomRight() ); mP.drawLine( qr.topRight(), qr.bottomLeft() ); if( mNeedOverlay ) mOverlay.push_back( qr ); break; } } - mP.setPen( QPen( color, twidth, style ) ); + mP.setPen( TQPen( color, twidth, style ) ); } void KigPainter::drawPoint( const Coordinate& p ) @@ -183,9 +183,9 @@ void KigPainter::drawLine( const Coordinate& p1, const Coordinate& p2 ) drawLine( LineData( p1, p2 ) ); } -void KigPainter::drawText( const Rect p, const QString s, int textFlags, int len ) +void KigPainter::drawText( const Rect p, const TQString s, int textFlags, int len ) { - QRect t = toScreen(p); + TQRect t = toScreen(p); int tf = textFlags; t.moveBy( 2, 2 ); t.setWidth( t.width() - 4 ); @@ -194,41 +194,41 @@ void KigPainter::drawText( const Rect p, const QString s, int textFlags, int len if( mNeedOverlay ) textOverlay( t, s, tf, len ); } -void KigPainter::textOverlay( const QRect& r, const QString s, int textFlags, int len ) +void KigPainter::textOverlay( const TQRect& r, const TQString s, int textFlags, int len ) { // kdDebug() << Rect::fromQRect( mP.boundingRect( r, textFlags, s, len ) ) << endl; - QRect newr( mP.boundingRect( r, textFlags, s, len ) ); + TQRect newr( mP.boundingRect( r, textFlags, s, len ) ); newr.setWidth( newr.width() + 4 ); newr.setHeight( newr.height() + 4 ); mOverlay.push_back( newr ); } -const Rect KigPainter::boundingRect( const Rect& r, const QString s, +const Rect KigPainter::boundingRect( const Rect& r, const TQString s, int f, int l ) const { - QRect qr = mP.boundingRect( toScreen( r ), f, s, l ); + TQRect qr = mP.boundingRect( toScreen( r ), f, s, l ); qr.setWidth( qr.width() + 4 ); qr.setHeight( qr.height() + 4 ); return fromScreen( qr ); } -void KigPainter::setColor( const QColor& c ) +void KigPainter::setColor( const TQColor& c ) { color = c; - mP.setPen( QPen( color, width == -1 ? 1 : width, style ) ); + mP.setPen( TQPen( color, width == -1 ? 1 : width, style ) ); } void KigPainter::setStyle( const PenStyle c ) { style = c; - mP.setPen( QPen( color, width == -1 ? 1 : width, style ) ); + mP.setPen( TQPen( color, width == -1 ? 1 : width, style ) ); } void KigPainter::setWidth( const int c ) { width = c; if (c > 0) overlayenlarge = c - 1; - mP.setPen( QPen( color, width == -1 ? 1 : width, style ) ); + mP.setPen( TQPen( color, width == -1 ? 1 : width, style ) ); } void KigPainter::setPointStyle( const int p ) @@ -236,7 +236,7 @@ void KigPainter::setPointStyle( const int p ) pointstyle = p; } -void KigPainter::setPen( const QPen& p ) +void KigPainter::setPen( const TQPen& p ) { color = p.color(); width = p.width(); @@ -244,7 +244,7 @@ void KigPainter::setPen( const QPen& p ) mP.setPen(p); } -void KigPainter::setBrush( const QBrush& b ) +void KigPainter::setBrush( const TQBrush& b ) { brushStyle = b.style(); brushColor = b.color(); @@ -254,13 +254,13 @@ void KigPainter::setBrush( const QBrush& b ) void KigPainter::setBrushStyle( const BrushStyle c ) { brushStyle = c; - mP.setBrush( QBrush( brushColor, brushStyle ) ); + mP.setBrush( TQBrush( brushColor, brushStyle ) ); } -void KigPainter::setBrushColor( const QColor& c ) +void KigPainter::setBrushColor( const TQColor& c ) { brushColor = c; - mP.setBrush( QBrush( brushColor, brushStyle ) ); + mP.setBrush( TQBrush( brushColor, brushStyle ) ); } bool KigPainter::getNightVision( ) const @@ -268,13 +268,13 @@ bool KigPainter::getNightVision( ) const return mdoc.getNightVision(); } -QColor KigPainter::getColor() const +TQColor KigPainter::getColor() const { return color; } /* -static void setContains( QRect& r, const QPoint& p ) +static void setContains( TQRect& r, const TQPoint& p ) { if ( r.left() > p.x() ) r.setLeft( p.x() ); if ( r.right() < p.x() ) r.setRight( p.x() ); @@ -285,18 +285,18 @@ static void setContains( QRect& r, const QPoint& p ) } */ -void KigPainter::drawPolygon( const std::vector& pts, +void KigPainter::drawPolygon( const std::vector& pts, bool winding, int index, int npoints ) { - QPen oldpen = mP.pen(); - QBrush oldbrush = mP.brush(); - setBrush( QBrush( color, Dense4Pattern ) ); + TQPen oldpen = mP.pen(); + TQBrush oldbrush = mP.brush(); + setBrush( TQBrush( color, Dense4Pattern ) ); setPen( Qt::NoPen ); // i know this isn't really fast, but i blame it all on Qt with its // stupid container classes... what's wrong with the STL ? - QPointArray t( pts.size() ); + TQPointArray t( pts.size() ); int c = 0; - for( std::vector::const_iterator i = pts.begin(); i != pts.end(); ++i ) + for( std::vector::const_iterator i = pts.begin(); i != pts.end(); ++i ) { t.putPoints( c++, 1, i->x(), i->y() ); }; @@ -308,18 +308,18 @@ void KigPainter::drawPolygon( const std::vector& pts, void KigPainter::drawArea( const std::vector& pts, bool border ) { - QPen oldpen = mP.pen(); - QBrush oldbrush = mP.brush(); - setBrush( QBrush( color, SolidPattern ) ); + TQPen oldpen = mP.pen(); + TQBrush oldbrush = mP.brush(); + setBrush( TQBrush( color, SolidPattern ) ); if ( border ) - setPen( QPen( color, width == -1 ? 1 : width ) ); + setPen( TQPen( color, width == -1 ? 1 : width ) ); else setPen( Qt::NoPen ); - QPointArray t( pts.size() ); + TQPointArray t( pts.size() ); int c = 0; for( std::vector::const_iterator i = pts.begin(); i != pts.end(); ++i ) { - QPoint p = toScreen( *i ); + TQPoint p = toScreen( *i ); t.putPoints( c++, 1, p.x(), p.y() ); } mP.drawPolygon( t ); @@ -476,7 +476,7 @@ void KigPainter::setWholeWinOverlay() mNeedOverlay = false; } -QPoint KigPainter::toScreen( const Coordinate p ) const +TQPoint KigPainter::toScreen( const Coordinate p ) const { return msi.toScreen( p ); } @@ -497,21 +497,21 @@ void KigPainter::drawObjects( const std::vector& os, bool sel ) drawObjects( os.begin(), os.end(), sel ); } -void KigPainter::drawFilledRect( const QRect& r ) +void KigPainter::drawFilledRect( const TQRect& r ) { - QPen pen( Qt::black, 1, Qt::DotLine ); + TQPen pen( Qt::black, 1, Qt::DotLine ); setPen( pen ); - setBrush( QBrush( Qt::cyan, Dense6Pattern ) ); + setBrush( TQBrush( Qt::cyan, Dense6Pattern ) ); drawRect( r.normalize() ); } -void KigPainter::drawTextStd( const QPoint& p, const QString& s ) +void KigPainter::drawTextStd( const TQPoint& p, const TQString& s ) { if ( s.isNull() ) return; // tf = text formatting flags int tf = AlignLeft | AlignTop | DontClip | WordBreak; // we need the rect where we're going to paint text - setPen(QPen(Qt::blue, 1, SolidLine)); + setPen(TQPen(Qt::blue, 1, SolidLine)); setBrush(Qt::NoBrush); drawText( Rect( msi.fromScreen(p), window().bottomRight() @@ -519,16 +519,16 @@ void KigPainter::drawTextStd( const QPoint& p, const QString& s ) } -QRect KigPainter::toScreen( const Rect r ) const +TQRect KigPainter::toScreen( const Rect r ) const { return msi.toScreen( r ); } -QRect KigPainter::toScreenEnlarge( const Rect r ) const +TQRect KigPainter::toScreenEnlarge( const Rect r ) const { if ( overlayenlarge == 0 ) return msi.toScreen( r ); - QRect qr = msi.toScreen( r ); + TQRect qr = msi.toScreen( r ); qr.moveBy ( -overlayenlarge, -overlayenlarge ); int w = qr.width(); int h = qr.height(); @@ -537,37 +537,37 @@ QRect KigPainter::toScreenEnlarge( const Rect r ) const return qr; } -void KigPainter::drawSimpleText( const Coordinate& c, const QString s ) +void KigPainter::drawSimpleText( const Coordinate& c, const TQString s ) { int tf = AlignLeft | AlignTop | DontClip | WordBreak; drawText( c, s, tf); } -void KigPainter::drawText( const Coordinate p, const QString s, +void KigPainter::drawText( const Coordinate p, const TQString s, int textFlags, int len ) { drawText( Rect( p, mP.window().right(), mP.window().top() ), s, textFlags, len ); } -const Rect KigPainter::simpleBoundingRect( const Coordinate& c, const QString s ) +const Rect KigPainter::simpleBoundingRect( const Coordinate& c, const TQString s ) { int tf = AlignLeft | AlignTop | DontClip | WordBreak; return boundingRect( c, s, tf ); } -const Rect KigPainter::boundingRect( const Coordinate& c, const QString s, +const Rect KigPainter::boundingRect( const Coordinate& c, const TQString s, int f, int l ) const { return boundingRect( Rect( c, mP.window().right(), mP.window().top() ), s, f, l ); } -Coordinate KigPainter::fromScreen( const QPoint& p ) const +Coordinate KigPainter::fromScreen( const TQPoint& p ) const { return msi.fromScreen( p ); } -Rect KigPainter::fromScreen( const QRect& r ) const +Rect KigPainter::fromScreen( const TQRect& r ) const { return msi.fromScreen( r ); } @@ -616,29 +616,29 @@ void KigPainter::drawAngle( const Coordinate& cpoint, const double dstartangle, const int startangle = static_cast( Goniometry::convert( 16 * dstartangle, Goniometry::Rad, Goniometry::Deg ) ); const int angle = static_cast( Goniometry::convert( 16 * dangle, Goniometry::Rad, Goniometry::Deg ) ); - QPoint point = toScreen( cpoint ); + TQPoint point = toScreen( cpoint ); // int radius = mP.window().width() / 5; int radius = 50; - QRect surroundingRect( 0, 0, radius*2, radius*2 ); + TQRect surroundingRect( 0, 0, radius*2, radius*2 ); surroundingRect.moveCenter( point ); mP.drawArc( surroundingRect, startangle, angle ); // now for the arrow... - QPoint end( static_cast( point.x() + radius * cos( dstartangle + dangle ) ), + TQPoint end( static_cast( point.x() + radius * cos( dstartangle + dangle ) ), static_cast( point.y() - radius * sin( dstartangle + dangle ) ) ); - QPoint vect = (end - point); + TQPoint vect = (end - point); double vectlen = sqrt( float( vect.x() * vect.x() + vect.y() * vect.y() ) ); - QPoint orthvect( -vect.y(), vect.x() ); + TQPoint orthvect( -vect.y(), vect.x() ); vect = vect * 6 / vectlen; orthvect = orthvect * 6 / vectlen; - QPointArray arrow( 3 ); + TQPointArray arrow( 3 ); arrow.setPoint( 0, end ); arrow.setPoint( 1, end + orthvect + vect ); arrow.setPoint( 2, end + orthvect - vect ); -// std::vector arrow; +// std::vector arrow; // arrow.push_back( end ); // arrow.push_back( end + orthvect + vect ); // arrow.push_back( end + orthvect - vect ); @@ -656,7 +656,7 @@ void KigPainter::drawPolygon( const std::vector& pts, bool winding, int index, int npoints ) { using namespace std; - vector points; + vector points; for ( uint i = 0; i < pts.size(); ++i ) points.push_back( toScreen( pts[i] ) ); drawPolygon( points, winding, index, npoints ); @@ -679,11 +679,11 @@ void KigPainter::drawVector( const Coordinate& a, const Coordinate& b ) Coordinate c = b - dir + perp; Coordinate d = b - dir - perp; // draw the arrow lines with a normal style - mP.setPen( QPen( color, width == -1 ? 1 : width, Qt::SolidLine ) ); + mP.setPen( TQPen( color, width == -1 ? 1 : width, Qt::SolidLine ) ); drawSegment( b, c ); drawSegment( b, d ); // setting again the original style - mP.setPen( QPen( color, width == -1 ? 1 : width, style ) ); + mP.setPen( TQPen( color, width == -1 ? 1 : width, style ) ); } /* *** this function is commented out *** @@ -733,7 +733,7 @@ void KigPainter::drawCurve( const CurveImp* curve ) bool tNeedOverlay = mNeedOverlay; mNeedOverlay = false; - QPen pen = mP.pen(); + TQPen pen = mP.pen(); // this stack contains pairs of Coordinates ( parameter intervals ) // that we still need to process: @@ -790,11 +790,11 @@ void KigPainter::drawCurve( const CurveImp* curve ) // what this algorithm does is approximating the curve with a set of // segments. we don't draw the individual segments, but use - // QPainter::drawPolyline() so that the line styles work properly. + // TQPainter::drawPolyline() so that the line styles work properly. // Possibly there are performance advantages as well ? this array // is a buffer of the polyline approximation of the part of the // curve that we are currently processing. - QPointArray curpolyline( 1000 ); + TQPointArray curpolyline( 1000 ); int curpolylinenextfree = 0; // we don't use recursion, but a stack based approach for efficiency @@ -853,9 +853,9 @@ void KigPainter::drawCurve( const CurveImp* curve ) if ( dodraw ) { // draw the two segments - QPoint tp0 = toScreen(p0); - QPoint tp1 = toScreen(p1); - QPoint tp2 = toScreen(p2); + TQPoint tp0 = toScreen(p0); + TQPoint tp1 = toScreen(p1); + TQPoint tp2 = toScreen(p2); if ( curpolylinenextfree > 0 && curpolyline[curpolylinenextfree - 1] != tp1 ) { // flush the current part of the curve @@ -904,20 +904,20 @@ void KigPainter::drawCurve( const CurveImp* curve ) } void KigPainter::drawTextFrame( const Rect& frame, - const QString& s, bool needframe ) + const TQString& s, bool needframe ) { - QPen oldpen = mP.pen(); - QBrush oldbrush = mP.brush(); + TQPen oldpen = mP.pen(); + TQBrush oldbrush = mP.brush(); if ( needframe ) { // inspired upon kgeo, thanks to Marc Bartsch, i've taken some of // his code too.. - setPen( QPen( Qt::black, 1 ) ); - setBrush( QBrush( QColor( 255, 255, 222 ) ) ); + setPen( TQPen( Qt::black, 1 ) ); + setBrush( TQBrush( TQColor( 255, 255, 222 ) ) ); drawRect( frame ); - setPen( QPen( QColor( 197, 194, 197 ), 1, Qt::SolidLine ) ); + setPen( TQPen( TQColor( 197, 194, 197 ), 1, Qt::SolidLine ) ); - QRect qr = toScreen( frame ); + TQRect qr = toScreen( frame ); mP.drawLine( qr.topLeft(), qr.topRight() ); mP.drawLine( qr.topLeft(), qr.bottomLeft() ); @@ -944,7 +944,7 @@ void KigPainter::drawArc( const Coordinate& center, const double radius, { Rect krect( 0, 0, 2*radius, 2*radius ); krect.setCenter( center ); - QRect rect = toScreen( krect ); + TQRect rect = toScreen( krect ); mP.drawArc( rect, startangle, angle ); setWholeWinOverlay(); diff --git a/kig/misc/kigpainter.h b/kig/misc/kigpainter.h index e7f884f4..226b2c46 100644 --- a/kig/misc/kigpainter.h +++ b/kig/misc/kigpainter.h @@ -26,8 +26,8 @@ #include "rect.h" #include "screeninfo.h" -#include -#include +#include +#include #include @@ -43,7 +43,7 @@ class KigDocument; class ObjectHolder; /** - * KigPainter is an extended QPainter. + * KigPainter is an extended TQPainter. * * Currently the only difference is that it translates coordinates * from and to the internal coordinates/ the widget coordinates... @@ -56,14 +56,14 @@ class KigPainter protected: // don't blaim me for this mutable hack. It's TT that hasn't got // its consts correctly... - mutable QPainter mP; + mutable TQPainter mP; - QColor color; + TQColor color; PenStyle style; int pointstyle; int width; BrushStyle brushStyle; - QColor brushColor; + TQColor brushColor; const KigDocument& mdoc; ScreenInfo msi; @@ -78,7 +78,7 @@ public: * needOverlay sets whether we try to remember the places we're * drawing on using the various overlay methods. @see overlay() */ - KigPainter( const ScreenInfo& r, QPaintDevice* device, const KigDocument& doc, + KigPainter( const ScreenInfo& r, TQPaintDevice* device, const KigDocument& doc, bool needOverlay = true ); ~KigPainter(); @@ -87,27 +87,27 @@ public: */ Rect window(); - QPoint toScreen( const Coordinate p ) const; - QRect toScreen( const Rect r ) const; - QRect toScreenEnlarge( const Rect r ) const; - Coordinate fromScreen( const QPoint& p ) const; - Rect fromScreen( const QRect& r ) const; + TQPoint toScreen( const Coordinate p ) const; + TQRect toScreen( const Rect r ) const; + TQRect toScreenEnlarge( const Rect r ) const; + Coordinate fromScreen( const TQPoint& p ) const; + Rect fromScreen( const TQRect& r ) const; // colors and stuff... void setStyle( const PenStyle c ); - void setColor( const QColor& c ); + void setColor( const TQColor& c ); /** * setting this to -1 means to use the default width for the object * being drawn.. a point -> 5, other objects -> 1 */ void setWidth( const int c ); void setPointStyle( const int p ); - void setPen( const QPen& p ); + void setPen( const TQPen& p ); void setBrushStyle( const BrushStyle c ); - void setBrush( const QBrush& b ); - void setBrushColor( const QColor& c ); + void setBrush( const TQBrush& b ); + void setBrushColor( const TQColor& c ); - QColor getColor() const; + TQColor getColor() const; bool getNightVision( ) const; double pixelWidth(); @@ -141,12 +141,12 @@ public: /** * draws text in a standard manner, convenience function... */ - void drawTextStd( const QPoint& p, const QString& s ); + void drawTextStd( const TQPoint& p, const TQString& s ); /** * draws a rect filled up with a pattern of cyan lines... */ - void drawFilledRect( const QRect& ); + void drawFilledRect( const TQRect& ); /** * draw a rect.. @@ -157,7 +157,7 @@ public: * overload, mainly for drawing the selection rectangle by * KigWidget... */ - void drawRect( const QRect& r ); + void drawRect( const TQRect& r ); /** * draw a circle... @@ -184,7 +184,7 @@ public: /** * draw a point... This means a single point, as in - * QPainter::drawPoint(), unlike drawFatPoint()... + * TQPainter::drawPoint(), unlike drawFatPoint()... */ void drawPoint( const Coordinate& p ); @@ -198,7 +198,7 @@ public: /** * draw a polygon defined by the points in pts... */ - void drawPolygon( const std::vector& pts, bool winding = false, int index = 0, int npoints = -1 ); + void drawPolygon( const std::vector& pts, bool winding = false, int index = 0, int npoints = -1 ); void drawPolygon( const std::vector& pts, bool winding = false, int index = 0, int npoints = -1 ); /** @@ -230,27 +230,27 @@ public: /** * draw text... - * \see QPainter::drawText() + * \see TQPainter::drawText() */ - void drawText( const Rect r, const QString s, int textFlags = 0, + void drawText( const Rect r, const TQString s, int textFlags = 0, int len = -1); - void drawText( const Coordinate p, const QString s, + void drawText( const Coordinate p, const TQString s, int textFlags = 0, int len = -1); - void drawSimpleText( const Coordinate& c, const QString s ); - void drawTextFrame( const Rect& frame, const QString& s, bool needframe ); + void drawSimpleText( const Coordinate& c, const TQString s ); + void drawTextFrame( const Rect& frame, const TQString& s, bool needframe ); - const Rect boundingRect( const Rect& r, const QString s, + const Rect boundingRect( const Rect& r, const TQString s, int f = 0, int l = -1 ) const; - const Rect boundingRect( const Coordinate& c, const QString s, + const Rect boundingRect( const Coordinate& c, const TQString s, int f = 0, int l = -1 ) const; - const Rect simpleBoundingRect( const Coordinate& c, const QString s ); + const Rect simpleBoundingRect( const Coordinate& c, const TQString s ); void drawGrid( const CoordinateSystem& c, bool showGrid = true, bool showAxes = true ); - const std::vector& overlay() { return mOverlay; } + const std::vector& overlay() { return mOverlay; } protected: /** @@ -276,16 +276,16 @@ protected: /** * ... - * \see drawText(), QPainter::boundingRect() + * \see drawText(), TQPainter::boundingRect() */ - void textOverlay( const QRect& r, const QString s, int textFlags, int len ); + void textOverlay( const TQRect& r, const TQString s, int textFlags, int len ); /** * the size we want the overlay rects to be... */ double overlayRectSize(); - std::vector mOverlay; + std::vector mOverlay; }; #endif diff --git a/kig/misc/kigtransform.cpp b/kig/misc/kigtransform.cpp index a297ed6e..bc446403 100644 --- a/kig/misc/kigtransform.cpp +++ b/kig/misc/kigtransform.cpp @@ -173,7 +173,7 @@ // return tNotGood; // } -// QString getTransformMessage ( const Objects& os, const Object *o ) +// TQString getTransformMessage ( const Objects& os, const Object *o ) // { // int size = os.size(); // switch (size) diff --git a/kig/misc/kigtransform.h b/kig/misc/kigtransform.h index 252a0f72..52d5942a 100644 --- a/kig/misc/kigtransform.h +++ b/kig/misc/kigtransform.h @@ -183,7 +183,7 @@ bool operator==( const Transformation& lhs, const Transformation& rhs ); // tWantArgsResult WantTransformation ( Objects::const_iterator& i, // const Objects& os ); -// QString getTransformMessage ( const Objects& os, const Object *o ); +// TQString getTransformMessage ( const Objects& os, const Object *o ); // bool isHomoteticTransformation ( double transformation[3][3] ); diff --git a/kig/misc/lists.cc b/kig/misc/lists.cc index e93700a1..d3a4fb4d 100644 --- a/kig/misc/lists.cc +++ b/kig/misc/lists.cc @@ -26,10 +26,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include using namespace std; @@ -238,18 +238,18 @@ Macro::~Macro() { } -bool MacroList::save( Macro* m, const QString& f ) +bool MacroList::save( Macro* m, const TQString& f ) { std::vector ms; ms.push_back( m ); return save( ms, f ); } -bool MacroList::save( const std::vector& ms, const QString& f ) +bool MacroList::save( const std::vector& ms, const TQString& f ) { - QDomDocument doc( "KigMacroFile" ); + TQDomDocument doc( "KigMacroFile" ); - QDomElement docelem = doc.createElement( "KigMacroFile" ); + TQDomElement docelem = doc.createElement( "KigMacroFile" ); docelem.setAttribute( "Version", KIGVERSION ); docelem.setAttribute( "Number", ms.size() ); @@ -257,29 +257,29 @@ bool MacroList::save( const std::vector& ms, const QString& f ) { MacroConstructor* ctor = ms[i]->ctor; - QDomElement macroelem = doc.createElement( "Macro" ); + TQDomElement macroelem = doc.createElement( "Macro" ); // name - QDomElement nameelem = doc.createElement( "Name" ); + TQDomElement nameelem = doc.createElement( "Name" ); nameelem.appendChild( doc.createTextNode( ctor->descriptiveName() ) ); macroelem.appendChild( nameelem ); // desc - QDomElement descelem = doc.createElement( "Description" ); + TQDomElement descelem = doc.createElement( "Description" ); descelem.appendChild( doc.createTextNode( ctor->description() ) ); macroelem.appendChild( descelem ); // icon - QCString icon = ctor->iconFileName( true ); + TQCString icon = ctor->iconFileName( true ); if ( !icon.isNull() ) { - QDomElement descelem = doc.createElement( "IconFileName" ); + TQDomElement descelem = doc.createElement( "IconFileName" ); descelem.appendChild( doc.createTextNode( icon ) ); macroelem.appendChild( descelem ); } // data - QDomElement hierelem = doc.createElement( "Construction" ); + TQDomElement hierelem = doc.createElement( "Construction" ); ctor->hierarchy().serialize( hierelem, doc ); macroelem.appendChild( hierelem ); @@ -288,30 +288,30 @@ bool MacroList::save( const std::vector& ms, const QString& f ) doc.appendChild( docelem ); - QFile file( f ); + TQFile file( f ); if ( ! file.open( IO_WriteOnly ) ) return false; - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << doc.toCString(); return true; } -bool MacroList::load( const QString& f, std::vector& ret, const KigPart& kdoc ) +bool MacroList::load( const TQString& f, std::vector& ret, const KigPart& kdoc ) { - QFile file( f ); + TQFile file( f ); if ( ! file.open( IO_ReadOnly ) ) { KMessageBox::sorry( 0, i18n( "Could not open macro file '%1'" ).arg( f ) ); return false; } - QDomDocument doc( "KigMacroFile" ); + TQDomDocument doc( "KigMacroFile" ); if ( !doc.setContent( &file ) ) { KMessageBox::sorry( 0, i18n( "Could not open macro file '%1'" ).arg( f ) ); return false; } file.close(); - QDomElement main = doc.documentElement(); + TQDomElement main = doc.documentElement(); if ( main.tagName() == "KigMacroFile" ) return loadNew( main, ret, kdoc ); @@ -328,15 +328,15 @@ bool MacroList::load( const QString& f, std::vector& ret, const KigPart& } } -bool MacroList::loadNew( const QDomElement& docelem, std::vector& ret, const KigPart& ) +bool MacroList::loadNew( const TQDomElement& docelem, std::vector& ret, const KigPart& ) { bool sok = true; // unused.. // int number = docelem.attribute( "Number" ).toInt( &sok ); if ( ! sok ) return false; - QString version = docelem.attribute( "Version" ); -// QRegExp re( "(\\d+)\\.(\\d+)\\.(\\d+)" ); + TQString version = docelem.attribute( "Version" ); +// TQRegExp re( "(\\d+)\\.(\\d+)\\.(\\d+)" ); // re.match( version ); // unused.. // int major = re.cap( 1 ).toInt( &sok ); @@ -345,16 +345,16 @@ bool MacroList::loadNew( const QDomElement& docelem, std::vector& ret, c // if ( ! sok ) return false; int unnamedindex = 1; - QString tmp; + TQString tmp; - for ( QDomElement macroelem = docelem.firstChild().toElement(); + for ( TQDomElement macroelem = docelem.firstChild().toElement(); ! macroelem.isNull(); macroelem = macroelem.nextSibling().toElement() ) { - QString name, description; + TQString name, description; ObjectHierarchy* hierarchy = 0; - QCString actionname, iconfile; + TQCString actionname, iconfile; if ( macroelem.tagName() != "Macro" ) continue; // forward compat ? - for ( QDomElement dataelem = macroelem.firstChild().toElement(); + for ( TQDomElement dataelem = macroelem.firstChild().toElement(); ! dataelem.isNull(); dataelem = dataelem.nextSibling().toElement() ) { if ( dataelem.tagName() == "Name" ) diff --git a/kig/misc/lists.h b/kig/misc/lists.h index a3f97f1d..40276bb2 100644 --- a/kig/misc/lists.h +++ b/kig/misc/lists.h @@ -141,11 +141,11 @@ public: /** * Save macro \p m to file \p f .. */ - bool save( Macro* m, const QString& f ); + bool save( Macro* m, const TQString& f ); /** * Save macros \p ms to file \p f .. */ - bool save( const vectype& ms, const QString& f ); + bool save( const vectype& ms, const TQString& f ); /** * load macro's from file \p f .. @@ -156,7 +156,7 @@ public: * semantically incorrect, but i haven't been able to work around * it.. */ - bool load( const QString& f, vectype& ret, const KigPart& ); + bool load( const TQString& f, vectype& ret, const KigPart& ); /** * get access to the list of macro's.. @@ -164,7 +164,7 @@ public: const vectype& macros() const; private: - bool loadNew( const QDomElement& docelem, std::vector& ret, const KigPart& ); + bool loadNew( const TQDomElement& docelem, std::vector& ret, const KigPart& ); }; #endif diff --git a/kig/misc/object_constructor.cc b/kig/misc/object_constructor.cc index 5634d0d2..ce48a636 100644 --- a/kig/misc/object_constructor.cc +++ b/kig/misc/object_constructor.cc @@ -36,24 +36,24 @@ #include "../modes/construct_mode.h" -#include +#include #include #include #include -const QString StandardConstructorBase::descriptiveName() const +const TQString StandardConstructorBase::descriptiveName() const { return i18n( mdescname ); } -const QString StandardConstructorBase::description() const +const TQString StandardConstructorBase::description() const { return i18n( mdesc ); } -const QCString StandardConstructorBase::iconFileName( const bool ) const +const TQCString StandardConstructorBase::iconFileName( const bool ) const { return miconfile; } @@ -103,7 +103,7 @@ void StandardConstructorBase::handlePrelim( std::vector args = margsparser.parse( os ); p.setBrushStyle( Qt::NoBrush ); p.setBrushColor( Qt::red ); - p.setPen( QPen ( Qt::red, 1) ); + p.setPen( TQPen ( Qt::red, 1) ); p.setWidth( -1 ); // -1 means the default width for the object being // drawn.. @@ -236,17 +236,17 @@ void MergeObjectConstructor::merge( ObjectConstructor* e ) mctors.push_back( e ); } -const QString MergeObjectConstructor::descriptiveName() const +const TQString MergeObjectConstructor::descriptiveName() const { return i18n( mdescname ); } -const QString MergeObjectConstructor::description() const +const TQString MergeObjectConstructor::description() const { return i18n( mdesc ); } -const QCString MergeObjectConstructor::iconFileName( const bool ) const +const TQCString MergeObjectConstructor::iconFileName( const bool ) const { return miconfilename; } @@ -297,7 +297,7 @@ void MergeObjectConstructor::handlePrelim( }; } -QString StandardConstructorBase::useText( const ObjectCalcer& o, const std::vector& sel, +TQString StandardConstructorBase::useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument&, const KigWidget& ) const { using namespace std; @@ -305,11 +305,11 @@ QString StandardConstructorBase::useText( const ObjectCalcer& o, const std::vect transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); std::string ret = margsparser.usetext( o.imp(), args ); - if ( ret.empty() ) return QString::null; + if ( ret.empty() ) return TQString::null; return i18n( ret.c_str() ); } -QString StandardConstructorBase::selectStatement( +TQString StandardConstructorBase::selectStatement( const std::vector& sel, const KigDocument&, const KigWidget& ) const { @@ -318,11 +318,11 @@ QString StandardConstructorBase::selectStatement( transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); std::string ret = margsparser.selectStatement( args ); - if ( ret.empty() ) return QString::null; + if ( ret.empty() ) return TQString::null; return i18n( ret.c_str() ); } -QString MergeObjectConstructor::useText( const ObjectCalcer& o, const std::vector& sel, +TQString MergeObjectConstructor::useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const { for ( vectype::const_iterator i = mctors.begin(); i != mctors.end(); ++i ) @@ -331,10 +331,10 @@ QString MergeObjectConstructor::useText( const ObjectCalcer& o, const std::vecto int w = (*i)->wantArgs( args, d, v ); if ( w != ArgsParser::Invalid ) return (*i)->useText( o, sel, d, v ); }; - return QString::null; + return TQString::null; } -QString MergeObjectConstructor::selectStatement( +TQString MergeObjectConstructor::selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const { @@ -344,11 +344,11 @@ QString MergeObjectConstructor::selectStatement( int wa = (*i)->wantArgs( args, d, w ); if ( wa != ArgsParser::Invalid ) return (*i)->selectStatement( sel, d, w ); }; - return QString::null; + return TQString::null; } -MacroConstructor::MacroConstructor( const ObjectHierarchy& hier, const QString& name, - const QString& desc, const QCString& iconfile ) +MacroConstructor::MacroConstructor( const ObjectHierarchy& hier, const TQString& name, + const TQString& desc, const TQCString& iconfile ) : ObjectConstructor(), mhier( hier ), mname( name ), mdesc( desc ), mbuiltin( false ), miconfile( iconfile ), mparser( mhier.argParser() ) @@ -357,8 +357,8 @@ MacroConstructor::MacroConstructor( const ObjectHierarchy& hier, const QString& MacroConstructor::MacroConstructor( const std::vector& input, const std::vector& output, - const QString& name, const QString& description, - const QCString& iconfile ) + const TQString& name, const TQString& description, + const TQCString& iconfile ) : ObjectConstructor(), mhier( input, output ), mname( name ), mdesc( description ), mbuiltin( false ), miconfile( iconfile ), @@ -370,19 +370,19 @@ MacroConstructor::~MacroConstructor() { } -const QString MacroConstructor::descriptiveName() const +const TQString MacroConstructor::descriptiveName() const { return mname; } -const QString MacroConstructor::description() const +const TQString MacroConstructor::description() const { return mdesc; } -const QCString MacroConstructor::iconFileName( const bool canBeNull ) const +const TQCString MacroConstructor::iconFileName( const bool canBeNull ) const { - return ( miconfile.isNull() && !canBeNull ) ? QCString( "gear" ) : miconfile; + return ( miconfile.isNull() && !canBeNull ) ? TQCString( "gear" ) : miconfile; } const bool MacroConstructor::isAlreadySelectedOK( const std::vector&, const int& ) const @@ -412,7 +412,7 @@ void MacroConstructor::handleArgs( const std::vector& os, KigPart d.addObjects( hos ); } -QString MacroConstructor::selectStatement( +TQString MacroConstructor::selectStatement( const std::vector& sel, const KigDocument&, const KigWidget& ) const { @@ -421,11 +421,11 @@ QString MacroConstructor::selectStatement( transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); std::string ret = mparser.selectStatement( args ); - if ( ret.empty() ) return QString::null; + if ( ret.empty() ) return TQString::null; else return i18n( ret.c_str() ); } -QString MacroConstructor::useText( const ObjectCalcer& o, const std::vector& sel, +TQString MacroConstructor::useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument&, const KigWidget& ) const { @@ -434,7 +434,7 @@ QString MacroConstructor::useText( const ObjectCalcer& o, const std::vector& sel, + virtual TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const = 0; @@ -89,7 +89,7 @@ public: * return a string describing what argument you want next, if the * given selection of objects were selected. */ - virtual QString selectStatement( + virtual TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const = 0; @@ -145,9 +145,9 @@ public: virtual ~StandardConstructorBase(); - const QString descriptiveName() const; - const QString description() const; - const QCString iconFileName( const bool canBeNull = false ) const; + const TQString descriptiveName() const; + const TQString description() const; + const TQCString iconFileName( const bool canBeNull = false ) const; const bool isAlreadySelectedOK( const std::vector& os, const int& ) const; @@ -168,10 +168,10 @@ public: virtual void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const = 0; - QString useText( const ObjectCalcer& o, const std::vector& sel, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - QString selectStatement( + TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const; @@ -297,9 +297,9 @@ public: void merge( ObjectConstructor* e ); - const QString descriptiveName() const; - const QString description() const; - const QCString iconFileName( const bool canBeNull = false ) const; + const TQString descriptiveName() const; + const TQString description() const; + const TQCString iconFileName( const bool canBeNull = false ) const; const bool isAlreadySelectedOK( const std::vector& os, const int& ) const; @@ -308,10 +308,10 @@ public: const KigWidget& v ) const; - QString useText( const ObjectCalcer& o, const std::vector& sel, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - QString selectStatement( + TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const; @@ -337,25 +337,25 @@ class MacroConstructor : public ObjectConstructor { ObjectHierarchy mhier; - QString mname; - QString mdesc; + TQString mname; + TQString mdesc; bool mbuiltin; - QCString miconfile; + TQCString miconfile; ArgsParser mparser; public: MacroConstructor( const std::vector& input, const std::vector& output, - const QString& name, const QString& description, - const QCString& iconfile = 0 ); - MacroConstructor( const ObjectHierarchy& hier, const QString& name, - const QString& desc, - const QCString& iconfile = 0 ); + const TQString& name, const TQString& description, + const TQCString& iconfile = 0 ); + MacroConstructor( const ObjectHierarchy& hier, const TQString& name, + const TQString& desc, + const TQCString& iconfile = 0 ); ~MacroConstructor(); const ObjectHierarchy& hierarchy() const; - const QString descriptiveName() const; - const QString description() const; - const QCString iconFileName( const bool canBeNull = false ) const; + const TQString descriptiveName() const; + const TQString description() const; + const TQCString iconFileName( const bool canBeNull = false ) const; const bool isAlreadySelectedOK( const std::vector& os, const int& ) const; @@ -365,11 +365,11 @@ public: void handleArgs( const std::vector& os, KigPart& d, KigWidget& v ) const; - QString useText( const ObjectCalcer& o, const std::vector& sel, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - QString selectStatement( + TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const; @@ -388,9 +388,9 @@ public: */ bool isTransform() const; - void setName( const QString& name ); - void setDescription( const QString& desc ); - void setIcon( QCString& icon ); + void setName( const TQString& name ); + void setDescription( const TQString& desc ); + void setIcon( TQCString& icon ); }; #endif diff --git a/kig/misc/object_hierarchy.cc b/kig/misc/object_hierarchy.cc index 9102051a..c2365aaa 100644 --- a/kig/misc/object_hierarchy.cc +++ b/kig/misc/object_hierarchy.cc @@ -27,7 +27,7 @@ #include "../objects/object_type.h" #include -#include +#include class ObjectHierarchy::Node { @@ -187,13 +187,13 @@ class FetchPropertyNode { mutable int mpropid; int mparent; - const QCString mname; + const TQCString mname; public: // propid is a cache of the location of name in the parent's // propertiesInternalNames(), just as it is in PropertyObject. We // don't want to ever save this value, since we cannot guarantee it // remains consistent if we add properties some place.. - FetchPropertyNode( const int parent, const QCString& name, const int propid = -1 ) + FetchPropertyNode( const int parent, const TQCString& name, const int propid = -1 ) : mpropid( propid ), mparent( parent ), mname( name ) {} ~FetchPropertyNode(); Node* copy() const; @@ -201,7 +201,7 @@ public: void checkDependsOnGiven( std::vector& dependsstack, int loc ) const; void checkArgumentsUsed( std::vector& usedstack ) const; int parent() const { return mparent; } - const QCString& propinternalname() const { return mname; } + const TQCString& propinternalname() const { return mname; } int id() const; void apply( std::vector& stack, @@ -408,21 +408,21 @@ ObjectHierarchy::ObjectHierarchy( const std::vector& from, const init( from, to ); } -void ObjectHierarchy::serialize( QDomElement& parent, QDomDocument& doc ) const +void ObjectHierarchy::serialize( TQDomElement& parent, TQDomDocument& doc ) const { int id = 1; for ( uint i = 0; i < mnumberofargs; ++i ) { - QDomElement e = doc.createElement( "input" ); + TQDomElement e = doc.createElement( "input" ); e.setAttribute( "id", id++ ); e.setAttribute( "requirement", margrequirements[i]->internalName() ); // we don't save these atm, since the user can't define them. // we only load them from builtin macro's. -// QDomElement ut = doc.createElement( "UseText" ); -// ut.appendChild( doc.createTextNode( QString::fromLatin1(musetexts[i].c_str() ) ) ); +// TQDomElement ut = doc.createElement( "UseText" ); +// ut.appendChild( doc.createTextNode( TQString::fromLatin1(musetexts[i].c_str() ) ) ); // e.appendChild( ut ); -// QDomElement ss = doc.createElement( "SelectStatement" ); -// ss.appendChild( doc.createTextNode( QString::fromLatin1(mselectstatements[i].c_str() ) ) ); +// TQDomElement ss = doc.createElement( "SelectStatement" ); +// ss.appendChild( doc.createTextNode( TQString::fromLatin1(mselectstatements[i].c_str() ) ) ); // e.appendChild( ss ); parent.appendChild( e ); } @@ -430,19 +430,19 @@ void ObjectHierarchy::serialize( QDomElement& parent, QDomDocument& doc ) const for ( uint i = 0; i < mnodes.size(); ++i ) { bool result = mnodes.size() - ( id - mnumberofargs - 1 ) <= mnumberofresults; - QDomElement e = doc.createElement( result ? "result" : "intermediate" ); + TQDomElement e = doc.createElement( result ? "result" : "intermediate" ); e.setAttribute( "id", id++ ); if ( mnodes[i]->id() == Node::ID_ApplyType ) { const ApplyTypeNode* node = static_cast( mnodes[i] ); e.setAttribute( "action", "calc" ); - e.setAttribute( "type", QString::fromLatin1( node->type()->fullName() ) ); + e.setAttribute( "type", TQString::fromLatin1( node->type()->fullName() ) ); for ( uint i = 0; i < node->parents().size(); ++i ) { int parent = node->parents()[i] + 1; - QDomElement arge = doc.createElement( "arg" ); - arge.appendChild( doc.createTextNode( QString::number( parent ) ) ); + TQDomElement arge = doc.createElement( "arg" ); + arge.appendChild( doc.createTextNode( TQString::number( parent ) ) ); e.appendChild( arge ); }; } @@ -451,8 +451,8 @@ void ObjectHierarchy::serialize( QDomElement& parent, QDomDocument& doc ) const const FetchPropertyNode* node = static_cast( mnodes[i] ); e.setAttribute( "action", "fetch-property" ); e.setAttribute( "property", node->propinternalname() ); - QDomElement arge = doc.createElement( "arg" ); - arge.appendChild( doc.createTextNode( QString::number( node->parent() + 1 ) ) ); + TQDomElement arge = doc.createElement( "arg" ); + arge.appendChild( doc.createTextNode( TQString::number( node->parent() + 1 ) ) ); e.appendChild( arge ); } else @@ -460,7 +460,7 @@ void ObjectHierarchy::serialize( QDomElement& parent, QDomDocument& doc ) const assert( mnodes[i]->id() == ObjectHierarchy::Node::ID_PushStack ); const PushStackNode* node = static_cast( mnodes[i] ); e.setAttribute( "action", "push" ); - QString type = ObjectImpFactory::instance()->serialize( *node->imp(), e, doc ); + TQString type = ObjectImpFactory::instance()->serialize( *node->imp(), e, doc ); e.setAttribute( "type", type ); }; @@ -473,7 +473,7 @@ ObjectHierarchy::ObjectHierarchy() { } -ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const QDomElement& parent, QString& error ) +ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const TQDomElement& parent, TQString& error ) { #define KIG_GENERIC_PARSE_ERROR \ { \ @@ -485,8 +485,8 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const QDomElement& p ObjectHierarchy* obhi = new ObjectHierarchy(); bool ok = true; - QString tmp; - QDomElement e = parent.firstChild().toElement(); + TQString tmp; + TQDomElement e = parent.firstChild().toElement(); for (; !e.isNull(); e = e.nextSibling().toElement() ) { if ( e.tagName() != "input" ) break; @@ -505,7 +505,7 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const QDomElement& p obhi->mselectstatements.resize( obhi->mnumberofargs, "" ); obhi->margrequirements[id - 1] = req; obhi->musetexts[id - 1] = req->selectStatement(); - QDomElement esub = e.firstChild().toElement(); + TQDomElement esub = e.firstChild().toElement(); for ( ; !esub.isNull(); esub = esub.nextSibling().toElement() ) { if ( esub.tagName() == "UseText" ) @@ -536,7 +536,7 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const QDomElement& p if ( tmp == "calc" ) { // ApplyTypeNode - QCString typen = e.attribute( "type" ).latin1(); + TQCString typen = e.attribute( "type" ).latin1(); const ObjectType* type = ObjectTypeFactory::instance()->find( typen ); if ( ! type ) { @@ -549,9 +549,9 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const QDomElement& p } std::vector parents; - for ( QDomNode p = e.firstChild(); !p.isNull(); p = p.nextSibling() ) + for ( TQDomNode p = e.firstChild(); !p.isNull(); p = p.nextSibling() ) { - QDomElement q = p.toElement(); + TQDomElement q = p.toElement(); if ( q.isNull() ) KIG_GENERIC_PARSE_ERROR; // see above if ( q.tagName() != "arg" ) KIG_GENERIC_PARSE_ERROR; int pid = q.text().toInt(&ok ); @@ -563,8 +563,8 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const QDomElement& p else if ( tmp == "fetch-property" ) { // FetchPropertyNode - QCString propname = e.attribute( "property" ).latin1(); - QDomElement arge = e.firstChild().toElement(); + TQCString propname = e.attribute( "property" ).latin1(); + TQDomElement arge = e.firstChild().toElement(); int parent = arge.text().toInt( &ok ); if ( !ok ) KIG_GENERIC_PARSE_ERROR; newnode = new FetchPropertyNode( parent - 1, propname ); @@ -573,7 +573,7 @@ ObjectHierarchy* ObjectHierarchy::buildSafeObjectHierarchy( const QDomElement& p { // PushStackNode if ( e.attribute( "action" ) != "push" ) KIG_GENERIC_PARSE_ERROR; - QString typen = e.attribute( "type" ); + TQString typen = e.attribute( "type" ); if ( typen.isNull() ) KIG_GENERIC_PARSE_ERROR; ObjectImp* imp = ObjectImpFactory::instance()->deserialize( typen, e, error ); if ( ( ! imp ) && !error.isEmpty() ) return 0; diff --git a/kig/misc/object_hierarchy.h b/kig/misc/object_hierarchy.h index 3133dc7c..60df8a59 100644 --- a/kig/misc/object_hierarchy.h +++ b/kig/misc/object_hierarchy.h @@ -75,14 +75,14 @@ public: /** * saves the ObjectHierarchy data in children xml tags of \p parent .. */ - void serialize( QDomElement& parent, QDomDocument& doc ) const; + void serialize( TQDomElement& parent, TQDomDocument& doc ) const; /** * Deserialize the ObjectHierarchy data from the xml element \p parent .. * Since this operation can fail for some reasons, we provide it as a * static to return 0 in case of error. */ - static ObjectHierarchy* buildSafeObjectHierarchy( const QDomElement& parent, QString& error ); -// ObjectHierarchy( const QDomElement& parent ); + static ObjectHierarchy* buildSafeObjectHierarchy( const TQDomElement& parent, TQString& error ); +// ObjectHierarchy( const TQDomElement& parent ); /** * build a set of objects that interdepend according to this diff --git a/kig/misc/rect.cc b/kig/misc/rect.cc index dc28de82..183f50f8 100644 --- a/kig/misc/rect.cc +++ b/kig/misc/rect.cc @@ -153,9 +153,9 @@ void Rect::scale( const double r ) } -QRect Rect::toQRect() const +TQRect Rect::toQRect() const { - return QRect(mBottomLeft.toQPoint(), topRight().toQPoint()); + return TQRect(mBottomLeft.toQPoint(), topRight().toQPoint()); } Coordinate Rect::bottomLeft() const @@ -253,7 +253,7 @@ Rect Rect::normalized() const return t; } -Rect Rect::fromQRect( const QRect& r ) +Rect Rect::fromQRect( const TQRect& r ) { return Rect( r.left(), r.top(), r.right(), r.bottom() ); } diff --git a/kig/misc/rect.h b/kig/misc/rect.h index a222d1ab..1fe0b071 100644 --- a/kig/misc/rect.h +++ b/kig/misc/rect.h @@ -24,12 +24,12 @@ #include "coordinate.h" -#include +#include #include /** - * like Coordinate is a QPoint replacement with doubles, this is a - * QRect replacement with doubles... + * like Coordinate is a TQPoint replacement with doubles, this is a + * TQRect replacement with doubles... */ class Rect { @@ -103,7 +103,7 @@ public: */ Rect matchShape( const Rect& rhs, bool shrink = false ) const; - QRect toQRect() const; + TQRect toQRect() const; Coordinate bottomLeft() const; Coordinate bottomRight() const; Coordinate topLeft() const; @@ -121,7 +121,7 @@ public: Rect normalized() const; friend kdbgstream& operator<<( kdbgstream& s, const Rect& t ); - static Rect fromQRect( const QRect& ); + static Rect fromQRect( const TQRect& ); protected: Coordinate mBottomLeft; double mwidth; diff --git a/kig/misc/screeninfo.cc b/kig/misc/screeninfo.cc index c1418876..91a6cb74 100644 --- a/kig/misc/screeninfo.cc +++ b/kig/misc/screeninfo.cc @@ -19,12 +19,12 @@ #include -ScreenInfo::ScreenInfo( const Rect& docRect, const QRect& viewRect ) +ScreenInfo::ScreenInfo( const Rect& docRect, const TQRect& viewRect ) : mkrect( docRect.normalized() ), mqrect( viewRect.normalize() ) { } -Rect ScreenInfo::fromScreen( const QRect& r ) const +Rect ScreenInfo::fromScreen( const TQRect& r ) const { return Rect( fromScreen( r.topLeft() ), @@ -32,7 +32,7 @@ Rect ScreenInfo::fromScreen( const QRect& r ) const ).normalized(); } -Coordinate ScreenInfo::fromScreen( const QPoint& p ) const +Coordinate ScreenInfo::fromScreen( const TQPoint& p ) const { // invert the y-axis: 0 is at the bottom ! Coordinate t( p.x(), mqrect.height() - p.y() ); @@ -41,18 +41,18 @@ Coordinate ScreenInfo::fromScreen( const QPoint& p ) const return t + mkrect.bottomLeft(); } -QPoint ScreenInfo::toScreen( const Coordinate& p ) const +TQPoint ScreenInfo::toScreen( const Coordinate& p ) const { Coordinate t = p - mkrect.bottomLeft(); t *= mqrect.width(); t /= mkrect.width(); // invert the y-axis: 0 is at the bottom ! - return QPoint( (int) t.x, mqrect.height() - (int) t.y ); + return TQPoint( (int) t.x, mqrect.height() - (int) t.y ); } -QRect ScreenInfo::toScreen( const Rect& r ) const +TQRect ScreenInfo::toScreen( const Rect& r ) const { - return QRect( + return TQRect( toScreen( r.bottomLeft() ), toScreen( r.topRight() ) ).normalize(); @@ -60,8 +60,8 @@ QRect ScreenInfo::toScreen( const Rect& r ) const double ScreenInfo::pixelWidth() const { - Coordinate a = fromScreen( QPoint( 0, 0 ) ); - Coordinate b = fromScreen( QPoint( 0, 1000 ) ); + Coordinate a = fromScreen( TQPoint( 0, 0 ) ); + Coordinate b = fromScreen( TQPoint( 0, 1000 ) ); return std::fabs( b.y - a.y ) / 1000; } @@ -75,12 +75,12 @@ void ScreenInfo::setShownRect( const Rect& r ) mkrect = r; } -const QRect ScreenInfo::viewRect() const +const TQRect ScreenInfo::viewRect() const { return mqrect; } -void ScreenInfo::setViewRect( const QRect& r ) +void ScreenInfo::setViewRect( const TQRect& r ) { mqrect = r; } diff --git a/kig/misc/screeninfo.h b/kig/misc/screeninfo.h index b7f94c49..570e1a8f 100644 --- a/kig/misc/screeninfo.h +++ b/kig/misc/screeninfo.h @@ -18,7 +18,7 @@ #ifndef SCREENINFO_H #define SCREENINFO_H -#include +#include #include "rect.h" @@ -31,15 +31,15 @@ class ScreenInfo { Rect mkrect; - QRect mqrect; + TQRect mqrect; public: - ScreenInfo( const Rect& docRect, const QRect& viewRect ); + ScreenInfo( const Rect& docRect, const TQRect& viewRect ); - Coordinate fromScreen( const QPoint& p ) const; - Rect fromScreen( const QRect& r ) const; + Coordinate fromScreen( const TQPoint& p ) const; + Rect fromScreen( const TQRect& r ) const; - QPoint toScreen( const Coordinate& p ) const; - QRect toScreen( const Rect& r ) const; + TQPoint toScreen( const Coordinate& p ) const; + TQRect toScreen( const Rect& r ) const; double pixelWidth() const; @@ -49,9 +49,9 @@ public: void setShownRect( const Rect& r ); - const QRect viewRect() const; + const TQRect viewRect() const; - void setViewRect( const QRect& r ); + void setViewRect( const TQRect& r ); }; #endif diff --git a/kig/misc/special_constructors.cc b/kig/misc/special_constructors.cc index 04c8a097..d419a546 100644 --- a/kig/misc/special_constructors.cc +++ b/kig/misc/special_constructors.cc @@ -52,7 +52,7 @@ #include "../objects/text_imp.h" #include "../objects/transform_types.h" -#include +#include #include @@ -242,7 +242,7 @@ std::vector LocusConstructor::build( const std::vector& os, +TQString LocusConstructor::useText( const ObjectCalcer& o, const std::vector& os, const KigDocument&, const KigWidget& ) const { if ( dynamic_cast( &o ) && @@ -284,17 +284,17 @@ PolygonBNPTypeConstructor::~PolygonBNPTypeConstructor() { } -const QString PolygonBNPTypeConstructor::descriptiveName() const +const TQString PolygonBNPTypeConstructor::descriptiveName() const { return i18n("Polygon by Its Vertices"); } -const QString PolygonBNPTypeConstructor::description() const +const TQString PolygonBNPTypeConstructor::description() const { return i18n("Construct a polygon by giving its vertices"); } -const QCString PolygonBNPTypeConstructor::iconFileName( const bool ) const +const TQCString PolygonBNPTypeConstructor::iconFileName( const bool ) const { return "kig_polygon"; } @@ -351,7 +351,7 @@ void PolygonBNPTypeConstructor::handlePrelim( std::vector args = os; p.setBrushStyle( Qt::NoBrush ); p.setBrushColor( Qt::red ); - p.setPen( QPen ( Qt::red, 1) ); + p.setPen( TQPen ( Qt::red, 1) ); p.setWidth( -1 ); // -1 means the default width for the object being // drawn.. @@ -359,7 +359,7 @@ void PolygonBNPTypeConstructor::handlePrelim( drawprelim( drawer, p, args, d ); } -QString PolygonBNPTypeConstructor::useText( const ObjectCalcer&, const std::vector& os, +TQString PolygonBNPTypeConstructor::useText( const ObjectCalcer&, const std::vector& os, const KigDocument&, const KigWidget& ) const { if ( os.size() > 3 ) @@ -367,7 +367,7 @@ QString PolygonBNPTypeConstructor::useText( const ObjectCalcer&, const std::vect else return i18n("Construct a polygon with this vertex"); } -QString PolygonBNPTypeConstructor::selectStatement( +TQString PolygonBNPTypeConstructor::selectStatement( const std::vector&, const KigDocument&, const KigWidget& ) const { @@ -568,17 +568,17 @@ PolygonBCVConstructor::~PolygonBCVConstructor() { } -const QString PolygonBCVConstructor::descriptiveName() const +const TQString PolygonBCVConstructor::descriptiveName() const { return i18n("Regular Polygon with Given Center"); } -const QString PolygonBCVConstructor::description() const +const TQString PolygonBCVConstructor::description() const { return i18n("Construct a regular polygon with a given center and vertex"); } -const QCString PolygonBCVConstructor::iconFileName( const bool ) const +const TQCString PolygonBCVConstructor::iconFileName( const bool ) const { return "hexagonbcv"; } @@ -660,7 +660,7 @@ void PolygonBCVConstructor::handlePrelim( p.setBrushStyle( Qt::NoBrush ); p.setBrushColor( Qt::red ); - p.setPen( QPen ( Qt::red, 1) ); + p.setPen( TQPen ( Qt::red, 1) ); p.setWidth( -1 ); // -1 means the default width for the object being // drawn.. @@ -682,7 +682,7 @@ void PolygonBCVConstructor::handlePrelim( ptn = PointImp( where ); ptn.draw( p ); if ( i > 5 ) continue; - text = TextImp( QString( "(%1)" ).arg(i), where, false ); + text = TextImp( TQString( "(%1)" ).arg(i), where, false ); text.draw( p ); } p.setStyle( Qt::DotLine ); @@ -728,7 +728,7 @@ std::vector PolygonBCVConstructor::build( const std::vector& os, +TQString PolygonBCVConstructor::useText( const ObjectCalcer&, const std::vector& os, const KigDocument&, const KigWidget& ) const { switch ( os.size() ) @@ -750,13 +750,13 @@ QString PolygonBCVConstructor::useText( const ObjectCalcer&, const std::vector 1 ) { - QString result = QString( + TQString result = TQString( i18n( "Adjust the number of sides (%1/%2)" ) ).arg( nsides ).arg( winding ); return result; } else { - QString result = QString( + TQString result = TQString( i18n( "Adjust the number of sides (%1)" ) ).arg( nsides ); return result; @@ -767,7 +767,7 @@ QString PolygonBCVConstructor::useText( const ObjectCalcer&, const std::vector& os, const KigDocument&, const KigWidget& ) const { @@ -970,7 +970,7 @@ ArcLineIntersectionConstructor::~ArcLineIntersectionConstructor() { } -QString ConicRadicalConstructor::useText( const ObjectCalcer& o, const std::vector&, +TQString ConicRadicalConstructor::useText( const ObjectCalcer& o, const std::vector&, const KigDocument&, const KigWidget& ) const { if ( o.imp()->inherits( CircleImp::stype() ) ) @@ -1099,17 +1099,17 @@ MeasureTransportConstructor::~MeasureTransportConstructor() { } -const QString MeasureTransportConstructor::descriptiveName() const +const TQString MeasureTransportConstructor::descriptiveName() const { return i18n("Measure Transport"); } -const QString MeasureTransportConstructor::description() const +const TQString MeasureTransportConstructor::description() const { return i18n("Transport the measure of a segment or arc over a line or circle."); } -const QCString MeasureTransportConstructor::iconFileName( const bool ) const +const TQCString MeasureTransportConstructor::iconFileName( const bool ) const { return "measuretransport"; } @@ -1180,7 +1180,7 @@ void MeasureTransportConstructor::handlePrelim( { p.setBrushStyle( Qt::NoBrush ); p.setBrushColor( Qt::red ); - p.setPen( QPen ( Qt::red, 1) ); + p.setPen( TQPen ( Qt::red, 1) ); p.setWidth( -1 ); // -1 means the default width for the object being // drawn.. @@ -1202,7 +1202,7 @@ void MeasureTransportConstructor::drawprelim( const ObjectDrawer& drawer, delete data; } -QString MeasureTransportConstructor::useText( const ObjectCalcer& o, +TQString MeasureTransportConstructor::useText( const ObjectCalcer& o, const std::vector& os, const KigDocument&, const KigWidget& ) const { @@ -1227,7 +1227,7 @@ QString MeasureTransportConstructor::useText( const ObjectCalcer& o, return ""; } -QString MeasureTransportConstructor::selectStatement( +TQString MeasureTransportConstructor::selectStatement( const std::vector&, const KigDocument&, const KigWidget& ) const { @@ -1323,11 +1323,11 @@ bool GenericIntersectionConstructor::isIntersection() const return true; } -QString GenericIntersectionConstructor::useText( +TQString GenericIntersectionConstructor::useText( const ObjectCalcer& o, const std::vector& os, const KigDocument&, const KigWidget& ) const { - QString preamble; + TQString preamble; switch (os.size()) { case 1: @@ -1362,7 +1362,7 @@ QString GenericIntersectionConstructor::useText( break; } - return QString::null; + return TQString::null; } static const ArgsParser::spec argsspecMidPointOfTwoPoints[] = @@ -1475,7 +1475,7 @@ const int TestConstructor::wantArgs( const std::vector& os, return ret; } -QString GenericIntersectionConstructor::selectStatement( +TQString GenericIntersectionConstructor::selectStatement( const std::vector& sel, const KigDocument&, const KigWidget& ) const { @@ -1525,7 +1525,7 @@ TangentConstructor::~TangentConstructor() { } -QString TangentConstructor::useText( +TQString TangentConstructor::useText( const ObjectCalcer& o, const std::vector&, const KigDocument&, const KigWidget& ) const { @@ -1542,10 +1542,10 @@ QString TangentConstructor::useText( else if ( o.imp()->inherits( PointImp::stype() ) ) return i18n( "Tangent at This Point" ); // else assert( false ); - return QString::null; + return TQString::null; } -//QString TangentConstructor::selectStatement( +//TQString TangentConstructor::selectStatement( // const std::vector& sel, const KigDocument&, // const KigWidget& ) const //{ @@ -1592,7 +1592,7 @@ CocConstructor::~CocConstructor() { } -QString CocConstructor::useText( +TQString CocConstructor::useText( const ObjectCalcer& o, const std::vector&, const KigDocument&, const KigWidget& ) const { @@ -1604,7 +1604,7 @@ QString CocConstructor::useText( return i18n( "Center of Curvature of This Curve" ); else if ( o.imp()->inherits( PointImp::stype() ) ) return i18n( "Center of Curvature at This Point" ); - return QString::null; + return TQString::null; } bool relativePrimes( int n, int p ) @@ -1617,7 +1617,7 @@ bool relativePrimes( int n, int p ) return relativePrimes( p, n-d*p ); } -//QString CocConstructor::selectStatement( +//TQString CocConstructor::selectStatement( // const std::vector& sel, const KigDocument&, // const KigWidget& ) const //{ diff --git a/kig/misc/special_constructors.h b/kig/misc/special_constructors.h index 99760be3..5b80693c 100644 --- a/kig/misc/special_constructors.h +++ b/kig/misc/special_constructors.h @@ -58,9 +58,9 @@ public: PolygonBNPTypeConstructor(); ~PolygonBNPTypeConstructor(); - const QString descriptiveName() const; - const QString description() const; - const QCString iconFileName( const bool canBeNull = false ) const; + const TQString descriptiveName() const; + const TQString description() const; + const TQCString iconFileName( const bool canBeNull = false ) const; const bool isAlreadySelectedOK( const std::vector& os, const int& ) const; const int wantArgs( const std::vector& os, @@ -71,10 +71,10 @@ public: KigPart& d, KigWidget& v ) const; - QString useText( const ObjectCalcer& o, const std::vector& sel, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - QString selectStatement( + TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const; void handlePrelim( KigPainter& p, @@ -97,9 +97,9 @@ public: PolygonBCVConstructor(); ~PolygonBCVConstructor(); - const QString descriptiveName() const; - const QString description() const; - const QCString iconFileName( const bool canBeNull = false ) const; + const TQString descriptiveName() const; + const TQString description() const; + const TQCString iconFileName( const bool canBeNull = false ) const; const bool isAlreadySelectedOK( const std::vector& os, const int& ) const; const int wantArgs( const std::vector& os, @@ -110,10 +110,10 @@ public: KigPart& d, KigWidget& v ) const; - QString useText( const ObjectCalcer& o, const std::vector& sel, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - QString selectStatement( + TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const; void handlePrelim( KigPainter& p, @@ -138,9 +138,9 @@ public: MeasureTransportConstructor(); ~MeasureTransportConstructor(); - const QString descriptiveName() const; - const QString description() const; - const QCString iconFileName( const bool canBeNull = false ) const; + const TQString descriptiveName() const; + const TQString description() const; + const TQCString iconFileName( const bool canBeNull = false ) const; const bool isAlreadySelectedOK( const std::vector& os, const int& ) const; const int wantArgs( const std::vector& os, @@ -151,10 +151,10 @@ public: KigPart& d, KigWidget& v ) const; - QString useText( const ObjectCalcer& o, const std::vector& sel, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - QString selectStatement( + TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const; void handlePrelim( KigPainter& p, @@ -177,7 +177,7 @@ class ConicRadicalConstructor public: ConicRadicalConstructor(); ~ConicRadicalConstructor(); - QString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; std::vector build( const std::vector& os, KigDocument& d, KigWidget& w ) const; @@ -202,7 +202,7 @@ public: const std::vector& os, const KigDocument& d, const KigWidget& v ) const; - QString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; void drawprelim( const ObjectDrawer& drawer, KigPainter& p, const std::vector& parents, const KigDocument& ) const; @@ -245,9 +245,9 @@ public: bool isIntersection() const; - QString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; - QString selectStatement( + TQString selectStatement( const std::vector& sel, const KigDocument& d, const KigWidget& w ) const; }; @@ -295,9 +295,9 @@ public: TangentConstructor(); ~TangentConstructor(); - QString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; -// QString selectStatement( +// TQString selectStatement( // const std::vector& sel, const KigDocument& d, // const KigWidget& w ) const; }; @@ -309,9 +309,9 @@ public: CocConstructor(); ~CocConstructor(); - QString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, + TQString useText( const ObjectCalcer& o, const std::vector& sel, const KigDocument& d, const KigWidget& v ) const; -// QString selectStatement( +// TQString selectStatement( // const std::vector& sel, const KigDocument& d, // const KigWidget& w ) const; }; diff --git a/kig/modes/base_mode.cc b/kig/modes/base_mode.cc index 9e92274a..d968566b 100644 --- a/kig/modes/base_mode.cc +++ b/kig/modes/base_mode.cc @@ -23,7 +23,7 @@ #include "../kig/kig_part.h" #include "../kig/kig_document.h" -#include +#include #include BaseMode::BaseMode( KigPart& d ) @@ -35,7 +35,7 @@ BaseMode::~BaseMode() { } -void BaseMode::leftClicked( QMouseEvent* e, KigWidget* v ) +void BaseMode::leftClicked( TQMouseEvent* e, KigWidget* v ) { // touch screens don't send a mouseMoved event before a click event, // apparently, so we simulate it. @@ -64,7 +64,7 @@ void BaseMode::leftClicked( QMouseEvent* e, KigWidget* v ) }; } -void BaseMode::leftMouseMoved( QMouseEvent* e, KigWidget* w ) +void BaseMode::leftMouseMoved( TQMouseEvent* e, KigWidget* w ) { if( !moco.empty() && ( mplc - e->pos() ).manhattanLength() > 3 ) dragObject( moco, mplc, *w, @@ -72,7 +72,7 @@ void BaseMode::leftMouseMoved( QMouseEvent* e, KigWidget* w ) ); } -void BaseMode::leftReleased( QMouseEvent* e, KigWidget* v ) +void BaseMode::leftReleased( TQMouseEvent* e, KigWidget* v ) { if( (mplc - e->pos()).manhattanLength() > 4 ) return; @@ -93,7 +93,7 @@ void BaseMode::leftReleased( QMouseEvent* e, KigWidget* v ) leftClickedObject( o, e->pos(), *v, keyCtrl ); } -void BaseMode::midClicked( QMouseEvent* e, KigWidget* v ) +void BaseMode::midClicked( TQMouseEvent* e, KigWidget* v ) { // get rid of text still showing... v->updateCurPix(); @@ -103,14 +103,14 @@ void BaseMode::midClicked( QMouseEvent* e, KigWidget* v ) moco = mdoc.document().whatAmIOn( v->fromScreen( e->pos() ), *v ); } -void BaseMode::midReleased( QMouseEvent* e, KigWidget* v ) +void BaseMode::midReleased( TQMouseEvent* e, KigWidget* v ) { if( (e->pos() - mplc).manhattanLength() > 4 ) return; midClicked( mplc, *v ); } -void BaseMode::rightClicked( QMouseEvent* e, KigWidget* w ) +void BaseMode::rightClicked( TQMouseEvent* e, KigWidget* w ) { // get rid of text still showing... w->updateCurPix(); @@ -124,22 +124,22 @@ void BaseMode::rightClicked( QMouseEvent* e, KigWidget* w ) rightClicked( moco, mplc, *w ); } -void BaseMode::mouseMoved( QMouseEvent* e, KigWidget* w ) +void BaseMode::mouseMoved( TQMouseEvent* e, KigWidget* w ) { std::vector os = mdoc.document().whatAmIOn( w->fromScreen( e->pos() ), *w ); mouseMoved( os, e->pos(), *w, e->state() & Qt::ShiftButton ); } -void BaseMode::dragRect( const QPoint&, KigWidget& ) +void BaseMode::dragRect( const TQPoint&, KigWidget& ) { } -void BaseMode::leftClickedObject( ObjectHolder*, const QPoint&, +void BaseMode::leftClickedObject( ObjectHolder*, const TQPoint&, KigWidget&, bool ) { } -void BaseMode::dragObject( const std::vector&, const QPoint&, +void BaseMode::dragObject( const std::vector&, const TQPoint&, KigWidget&, bool ) { } @@ -154,7 +154,7 @@ std::vector BaseMode::oco() return moco; } -QPoint BaseMode::pointLocation() +TQPoint BaseMode::pointLocation() { return mplc; } diff --git a/kig/modes/base_mode.h b/kig/modes/base_mode.h index 2f89996f..cb029abf 100644 --- a/kig/modes/base_mode.h +++ b/kig/modes/base_mode.h @@ -20,7 +20,7 @@ #include "mode.h" -#include +#include #include class KigWidget; @@ -30,31 +30,31 @@ class ObjectHolder; class BaseMode : public KigMode { - QPoint mplc; + TQPoint mplc; std::vector moco; - void leftClicked( QMouseEvent* e, KigWidget* v ); - void leftMouseMoved( QMouseEvent*, KigWidget* ); - void leftReleased( QMouseEvent* e, KigWidget* v ); - void midClicked( QMouseEvent* e, KigWidget* v ); - void midReleased( QMouseEvent* e, KigWidget* v ); - void rightClicked( QMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent* e, KigWidget* v ); + void leftClicked( TQMouseEvent* e, KigWidget* v ); + void leftMouseMoved( TQMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent* e, KigWidget* v ); + void midClicked( TQMouseEvent* e, KigWidget* v ); + void midReleased( TQMouseEvent* e, KigWidget* v ); + void rightClicked( TQMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent* e, KigWidget* v ); protected: void enableActions(); std::vector oco(); - QPoint pointLocation(); + TQPoint pointLocation(); protected: - virtual void dragRect( const QPoint& p, KigWidget& w ); - virtual void dragObject( const std::vector& os, const QPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); - virtual void leftClickedObject( ObjectHolder* o, const QPoint& p, + virtual void dragRect( const TQPoint& p, KigWidget& w ); + virtual void dragObject( const std::vector& os, const TQPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); + virtual void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ) = 0; - virtual void midClicked( const QPoint& p, KigWidget& w ) = 0; - virtual void rightClicked( const std::vector& oco, const QPoint& p, KigWidget& w ) = 0; - virtual void mouseMoved( const std::vector& os, const QPoint& p, KigWidget& w, bool shiftpressed ) = 0; + virtual void midClicked( const TQPoint& p, KigWidget& w ) = 0; + virtual void rightClicked( const std::vector& oco, const TQPoint& p, KigWidget& w ) = 0; + virtual void mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ) = 0; protected: BaseMode( KigPart& ); diff --git a/kig/modes/construct_mode.cc b/kig/modes/construct_mode.cc index 9618aded..b535ee5c 100644 --- a/kig/modes/construct_mode.cc +++ b/kig/modes/construct_mode.cc @@ -63,7 +63,7 @@ BaseConstructMode::~BaseConstructMode() // delete mcursorholder; } -void BaseConstructMode::leftReleased( QMouseEvent* e, KigWidget* v ) +void BaseConstructMode::leftReleased( TQMouseEvent* e, KigWidget* v ) { if( (pointLocation() - e->pos()).manhattanLength() > 4 ) return; @@ -101,7 +101,7 @@ void BaseConstructMode::leftReleased( QMouseEvent* e, KigWidget* v ) } void BaseConstructMode::leftClickedObject( - ObjectHolder* o, const QPoint& p, KigWidget& w, bool ) + ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ) { std::vector::iterator it = std::find( mparents.begin(), mparents.end(), o ); std::vector nargs = getCalcers( mparents ); @@ -155,7 +155,7 @@ void BaseConstructMode::leftClickedObject( } } -void BaseConstructMode::midClicked( const QPoint& p, KigWidget& w ) +void BaseConstructMode::midClicked( const TQPoint& p, KigWidget& w ) { std::vector args = getCalcers( mparents ); args.push_back( mpt.get() ); @@ -171,12 +171,12 @@ void BaseConstructMode::midClicked( const QPoint& p, KigWidget& w ) } } -void BaseConstructMode::rightClicked( const std::vector&, const QPoint&, KigWidget& ) +void BaseConstructMode::rightClicked( const std::vector&, const TQPoint&, KigWidget& ) { // TODO ? } -void BaseConstructMode::mouseMoved( const std::vector& os, const QPoint& p, +void BaseConstructMode::mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ) { mdoc.emitStatusBarText( selectStatement( getCalcers( mparents ), w ) ); @@ -259,10 +259,10 @@ void BaseConstructMode::mouseMoved( const std::vector& os, const } if ( !text && ( goodargs.size() > 1 ) ) { - QString strwhich = i18n( "Which object?" ); + TQString strwhich = i18n( "Which object?" ); mdoc.emitStatusBarText( strwhich ); - QPoint textloc = p; + TQPoint textloc = p; textloc.setX( textloc.x() + 15 ); pter.drawTextStd( textloc, strwhich ); @@ -303,21 +303,21 @@ PointConstructMode::~PointConstructMode() } void PointConstructMode::leftClickedObject( - ObjectHolder*, const QPoint&, KigWidget& w, bool ) + ObjectHolder*, const TQPoint&, KigWidget& w, bool ) { mdoc.addObject( new ObjectHolder( mpt.get() ) ); w.redrawScreen( std::vector() ); - mdoc.emitStatusBarText( QString::null ); + mdoc.emitStatusBarText( TQString::null ); mdoc.doneMode( this ); } -void PointConstructMode::midClicked( const QPoint& p, KigWidget& w ) +void PointConstructMode::midClicked( const TQPoint& p, KigWidget& w ) { leftClickedObject( 0, p, w, true ); } -void PointConstructMode::rightClicked( const std::vector&, const QPoint&, +void PointConstructMode::rightClicked( const std::vector&, const TQPoint&, KigWidget& ) { // TODO ? @@ -325,7 +325,7 @@ void PointConstructMode::rightClicked( const std::vector&, const void PointConstructMode::mouseMoved( const std::vector&, - const QPoint& p, + const TQPoint& p, KigWidget& w, bool shiftpressed ) { @@ -379,15 +379,15 @@ void BaseConstructMode::selectObjects( const std::vector& os, Kig }; } -void ConstructMode::handlePrelim( const std::vector& args, const QPoint& p, KigPainter& pter, KigWidget& w ) +void ConstructMode::handlePrelim( const std::vector& args, const TQPoint& p, KigPainter& pter, KigWidget& w ) { // set the text next to the arrow cursor like in modes/normal.cc - QPoint textloc = p; + TQPoint textloc = p; textloc.setX( textloc.x() + 15 ); mctor->handlePrelim( pter, args, mdoc.document(), w ); - QString o = mctor->useText( *args.back(), args, mdoc.document(), w ); + TQString o = mctor->useText( *args.back(), args, mdoc.document(), w ); pter.drawTextStd( textloc, o ); } @@ -419,15 +419,15 @@ ConstructMode::~ConstructMode() // does a test result have a frame by default ? static const bool test_has_frame_dflt = true; -void TestConstructMode::handlePrelim( const std::vector& os, const QPoint& p, KigPainter& pter, KigWidget& w ) +void TestConstructMode::handlePrelim( const std::vector& os, const TQPoint& p, KigPainter& pter, KigWidget& w ) { Args args; std::transform( os.begin(), os.end(), std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); // usetext - QString usetext = i18n( mtype->argsParser().usetext( args.back(), args ).c_str() ); - QPoint textloc = p; + TQString usetext = i18n( mtype->argsParser().usetext( args.back(), args ).c_str() ); + TQPoint textloc = p; textloc.setX( textloc.x() + 15 ); pter.drawTextStd( textloc, usetext ); @@ -435,8 +435,8 @@ void TestConstructMode::handlePrelim( const std::vector& os, cons ObjectImp* data = mtype->calc( args, mdoc.document() ); if ( ! data->valid() ) return; assert( data->inherits( TestResultImp::stype() ) ); - QString outputtext = static_cast( data )->data(); - TextImp ti( outputtext, w.fromScreen( p + QPoint( - 40, 30 ) ), test_has_frame_dflt ); + TQString outputtext = static_cast( data )->data(); + TextImp ti( outputtext, w.fromScreen( p + TQPoint( - 40, 30 ) ), test_has_frame_dflt ); ti.draw( pter ); delete data; @@ -475,17 +475,17 @@ void TestConstructMode::handleArgs( const std::vector& args, KigW mdoc.emitStatusBarText( i18n( "Now select the location for the result label." ) ); } -void TestConstructMode::leftClickedObject( ObjectHolder* o, const QPoint& p, +void TestConstructMode::leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ) { if ( mresult ) { - QPoint qloc = p + QPoint( -40, 0 ); + TQPoint qloc = p + TQPoint( -40, 0 ); Coordinate loc = w.fromScreen( qloc ); std::vector parents; parents.push_back( new ObjectConstCalcer( new IntImp( test_has_frame_dflt ) ) ); parents.push_back( new ObjectConstCalcer( new PointImp( loc ) ) ); - parents.push_back( new ObjectConstCalcer( new StringImp( QString::fromLatin1( "%1" ) ) ) ); + parents.push_back( new ObjectConstCalcer( new StringImp( TQString::fromLatin1( "%1" ) ) ) ); assert( mresult->imp()->inherits( TestResultImp::stype() ) ); parents.push_back( new ObjectPropertyCalcer( @@ -497,7 +497,7 @@ void TestConstructMode::leftClickedObject( ObjectHolder* o, const QPoint& p, mdoc.addObject( new ObjectHolder( ret ) ); w.unsetCursor(); - mdoc.emitStatusBarText( QString::null ); + mdoc.emitStatusBarText( TQString::null ); finish(); } @@ -505,7 +505,7 @@ void TestConstructMode::leftClickedObject( ObjectHolder* o, const QPoint& p, BaseConstructMode::leftClickedObject( o, p, w, ctrlOrShiftDown ); } -void TestConstructMode::midClicked( const QPoint& p, KigWidget& w ) +void TestConstructMode::midClicked( const TQPoint& p, KigWidget& w ) { if ( mresult ) { // nothing to be done here, really @@ -514,7 +514,7 @@ void TestConstructMode::midClicked( const QPoint& p, KigWidget& w ) BaseConstructMode::midClicked( p, w ); } -void TestConstructMode::rightClicked( const std::vector& oco, const QPoint& p, KigWidget& w ) +void TestConstructMode::rightClicked( const std::vector& oco, const TQPoint& p, KigWidget& w ) { if ( mresult ) { // nothing to be done here, really @@ -523,7 +523,7 @@ void TestConstructMode::rightClicked( const std::vector& oco, con BaseConstructMode::rightClicked( oco, p, w ); } -void TestConstructMode::mouseMoved( const std::vector& os, const QPoint& p, KigWidget& w, bool shiftPressed ) +void TestConstructMode::mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftPressed ) { if ( mresult ) { w.setCursor( KCursor::blankCursor() ); @@ -531,7 +531,7 @@ void TestConstructMode::mouseMoved( const std::vector& os, const w.updateCurPix(); KigPainter pter( w.screenInfo(), &w.curPix, mdoc.document() ); - QPoint qloc = p + QPoint( -40, 0 ); + TQPoint qloc = p + TQPoint( -40, 0 ); Coordinate loc = w.fromScreen( qloc ); assert( dynamic_cast( mresult->imp() ) ); TextImp ti( static_cast( mresult->imp() )->data(), loc, test_has_frame_dflt ); @@ -545,19 +545,19 @@ void TestConstructMode::mouseMoved( const std::vector& os, const BaseConstructMode::mouseMoved( os, p, w, shiftPressed ); } -QString ConstructMode::selectStatement( const std::vector& args, const KigWidget& w ) +TQString ConstructMode::selectStatement( const std::vector& args, const KigWidget& w ) { return mctor->selectStatement( args, mdoc.document(), w ); } -QString TestConstructMode::selectStatement( const std::vector& sel, const KigWidget& ) +TQString TestConstructMode::selectStatement( const std::vector& sel, const KigWidget& ) { using namespace std; Args args; transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); std::string ret = mtype->argsParser().selectStatement( args ); - if ( ret.empty() ) return QString::null; + if ( ret.empty() ) return TQString::null; return i18n( ret.c_str() ); } diff --git a/kig/modes/construct_mode.h b/kig/modes/construct_mode.h index fa1be86e..be937723 100644 --- a/kig/modes/construct_mode.h +++ b/kig/modes/construct_mode.h @@ -38,11 +38,11 @@ public: PointConstructMode( KigPart& d ); ~PointConstructMode(); protected: - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector& oco, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector& oco, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); void enableActions(); void cancelConstruction(); @@ -73,7 +73,7 @@ class BaseConstructMode // ObjectHolder* mcursorholder; std::vector mparents; - void leftReleased( QMouseEvent* e, KigWidget* v ); + void leftReleased( TQMouseEvent* e, KigWidget* v ); public: void selectObject( ObjectHolder* o, KigWidget& w ); @@ -82,19 +82,19 @@ public: protected: BaseConstructMode( KigPart& d ); protected: - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector& oco, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector& oco, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); void enableActions(); void cancelConstruction(); void finish(); protected: - virtual void handlePrelim( const std::vector& os, const QPoint& p, KigPainter&, KigWidget& w ) = 0; - virtual QString selectStatement( const std::vector& args, const KigWidget& w ) = 0; + virtual void handlePrelim( const std::vector& os, const TQPoint& p, KigPainter&, KigWidget& w ) = 0; + virtual TQString selectStatement( const std::vector& args, const KigWidget& w ) = 0; virtual int isAlreadySelectedOK( const std::vector&, const int& ) = 0; virtual int wantArgs( const std::vector&, KigDocument& d, KigWidget& w ) = 0; virtual void handleArgs( const std::vector& args, KigWidget& w ) = 0; @@ -110,8 +110,8 @@ public: ConstructMode( KigPart& d, const ObjectConstructor* ctor ); ~ConstructMode(); - void handlePrelim( const std::vector& os, const QPoint& p, KigPainter&, KigWidget& w ); - QString selectStatement( const std::vector& args, const KigWidget& w ); + void handlePrelim( const std::vector& os, const TQPoint& p, KigPainter&, KigWidget& w ); + TQString selectStatement( const std::vector& args, const KigWidget& w ); int isAlreadySelectedOK( const std::vector&, const int& ); int wantArgs( const std::vector&, KigDocument& d, KigWidget& w ); void handleArgs( const std::vector& args, KigWidget& w ); @@ -138,17 +138,17 @@ public: TestConstructMode( KigPart& d, const ArgsParserObjectType* type ); ~TestConstructMode(); - void handlePrelim( const std::vector& os, const QPoint& p, KigPainter&, KigWidget& w ); - QString selectStatement( const std::vector& args, const KigWidget& w ); + void handlePrelim( const std::vector& os, const TQPoint& p, KigPainter&, KigWidget& w ); + TQString selectStatement( const std::vector& args, const KigWidget& w ); int isAlreadySelectedOK( const std::vector&, const int& ); int wantArgs( const std::vector&, KigDocument& d, KigWidget& w ); void handleArgs( const std::vector& args, KigWidget& w ); - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector& oco, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector& oco, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); }; #endif diff --git a/kig/modes/dragrectmode.cc b/kig/modes/dragrectmode.cc index a3c8c033..3a827009 100644 --- a/kig/modes/dragrectmode.cc +++ b/kig/modes/dragrectmode.cc @@ -22,11 +22,11 @@ #include "../kig/kig_view.h" #include "../misc/kigpainter.h" -#include -#include +#include +#include #include -DragRectMode::DragRectMode( const QPoint& start, KigPart& d, KigWidget& w ) +DragRectMode::DragRectMode( const TQPoint& start, KigPart& d, KigWidget& w ) : KigMode( d ), mstart( start ), mnc( true ), mstartselected( true ), mcancelled( false ) { @@ -41,25 +41,25 @@ DragRectMode::DragRectMode( KigPart& d, KigWidget& w ) w.updateWidget(); } -void DragRectMode::moved( const QPoint& p, KigWidget& w ) +void DragRectMode::moved( const TQPoint& p, KigWidget& w ) { // update the rect... w.updateCurPix(); - std::vector overlay; + std::vector overlay; if ( mstartselected ) { KigPainter pt( w.screenInfo(), &w.curPix, mdoc.document() ); - pt.drawFilledRect( QRect( p, mstart ) ); + pt.drawFilledRect( TQRect( p, mstart ) ); overlay = pt.overlay(); }; w.updateWidget( overlay ); } -void DragRectMode::released( const QPoint& p, KigWidget& w, bool nc ) +void DragRectMode::released( const TQPoint& p, KigWidget& w, bool nc ) { if ( mstartselected ) { - mrect = w.fromScreen( QRect( mstart, p ) ); + mrect = w.fromScreen( TQRect( mstart, p ) ); mret = mdoc.document().whatIsInHere( mrect, w ); mnc = nc; @@ -84,12 +84,12 @@ bool DragRectMode::needClear() const return mnc; } -void DragRectMode::moved( QMouseEvent* e, KigWidget& w ) +void DragRectMode::moved( TQMouseEvent* e, KigWidget& w ) { moved( e->pos(), w ); } -void DragRectMode::released( QMouseEvent* e, KigWidget& w ) +void DragRectMode::released( TQMouseEvent* e, KigWidget& w ) { released( e->pos(), w, ! ( e->state() & ( ControlButton | ShiftButton ) ) ); } @@ -98,37 +98,37 @@ DragRectMode::~DragRectMode() { } -void DragRectMode::mouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::mouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::leftMouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::leftMouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::midMouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::midMouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::rightMouseMoved( QMouseEvent* e, KigWidget* w ) +void DragRectMode::rightMouseMoved( TQMouseEvent* e, KigWidget* w ) { moved( e, *w ); } -void DragRectMode::leftReleased( QMouseEvent* e, KigWidget* w ) +void DragRectMode::leftReleased( TQMouseEvent* e, KigWidget* w ) { released( e, *w ); } -void DragRectMode::midReleased( QMouseEvent* e, KigWidget* w ) +void DragRectMode::midReleased( TQMouseEvent* e, KigWidget* w ) { released( e, *w ); } -void DragRectMode::rightReleased( QMouseEvent* e, KigWidget* w ) +void DragRectMode::rightReleased( TQMouseEvent* e, KigWidget* w ) { released( e, *w ); } @@ -138,27 +138,27 @@ Rect DragRectMode::rect() const return mrect; } -void DragRectMode::clicked( const QMouseEvent* e, KigWidget& w ) +void DragRectMode::clicked( const TQMouseEvent* e, KigWidget& w ) { clicked( e->pos(), w ); } -void DragRectMode::leftClicked( QMouseEvent* e, KigWidget* w ) +void DragRectMode::leftClicked( TQMouseEvent* e, KigWidget* w ) { clicked( e, *w ); } -void DragRectMode::midClicked( QMouseEvent* e, KigWidget* w ) +void DragRectMode::midClicked( TQMouseEvent* e, KigWidget* w ) { clicked( e, *w ); } -void DragRectMode::rightClicked( QMouseEvent* e, KigWidget* w ) +void DragRectMode::rightClicked( TQMouseEvent* e, KigWidget* w ) { clicked( e, *w ); } -void DragRectMode::clicked( const QPoint& p, KigWidget& ) +void DragRectMode::clicked( const TQPoint& p, KigWidget& ) { if ( !mstartselected ) { diff --git a/kig/modes/dragrectmode.h b/kig/modes/dragrectmode.h index 29f92139..d0348f31 100644 --- a/kig/modes/dragrectmode.h +++ b/kig/modes/dragrectmode.h @@ -23,7 +23,7 @@ #include "../misc/rect.h" -#include +#include #include class ObjectHolder; @@ -40,37 +40,37 @@ class ObjectHolder; class DragRectMode : public KigMode { - QPoint mstart; + TQPoint mstart; std::vector mret; Rect mrect; bool mnc; bool mstartselected; bool mcancelled; private: - void clicked( const QPoint& p, KigWidget& w ); - void clicked( const QMouseEvent* e, KigWidget& w ); - void released( const QPoint& p, KigWidget& w, bool nc ); - void released( QMouseEvent* e, KigWidget& w ); - void moved( const QPoint& p, KigWidget& w ); - void moved( QMouseEvent*, KigWidget& w ); - - void leftClicked( QMouseEvent*, KigWidget* ); - void leftMouseMoved( QMouseEvent*, KigWidget* ); - void leftReleased( QMouseEvent*, KigWidget* ); - void midClicked( QMouseEvent*, KigWidget* ); - void midMouseMoved( QMouseEvent*, KigWidget* ); - void midReleased( QMouseEvent*, KigWidget* ); - void rightClicked( QMouseEvent*, KigWidget* ); - void rightMouseMoved( QMouseEvent*, KigWidget* ); - void rightReleased( QMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent*, KigWidget* ); + void clicked( const TQPoint& p, KigWidget& w ); + void clicked( const TQMouseEvent* e, KigWidget& w ); + void released( const TQPoint& p, KigWidget& w, bool nc ); + void released( TQMouseEvent* e, KigWidget& w ); + void moved( const TQPoint& p, KigWidget& w ); + void moved( TQMouseEvent*, KigWidget& w ); + + void leftClicked( TQMouseEvent*, KigWidget* ); + void leftMouseMoved( TQMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent*, KigWidget* ); + void midClicked( TQMouseEvent*, KigWidget* ); + void midMouseMoved( TQMouseEvent*, KigWidget* ); + void midReleased( TQMouseEvent*, KigWidget* ); + void rightClicked( TQMouseEvent*, KigWidget* ); + void rightMouseMoved( TQMouseEvent*, KigWidget* ); + void rightReleased( TQMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent*, KigWidget* ); void cancelConstruction(); void enableActions(); public: - DragRectMode( const QPoint& start, KigPart& d, KigWidget& w ); + DragRectMode( const TQPoint& start, KigPart& d, KigWidget& w ); DragRectMode( KigPart& d, KigWidget& w ); ~DragRectMode(); diff --git a/kig/modes/edittype.cc b/kig/modes/edittype.cc index 8c6b538f..f4ed323e 100644 --- a/kig/modes/edittype.cc +++ b/kig/modes/edittype.cc @@ -31,7 +31,7 @@ #include #include -EditType::EditType( QWidget* parent, QString name, QString desc, QString icon ) +EditType::EditType( TQWidget* parent, TQString name, TQString desc, TQString icon ) : EditTypeBase( parent, "edittype", true ), mname( name ), mdesc( desc ), micon( icon ) { // improving GUI look'n'feel... @@ -50,13 +50,13 @@ EditType::~EditType() void EditType::helpSlot() { - kapp->invokeHelp( QString::fromLatin1( "working-with-types" ), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "working-with-types" ), + TQString::fromLatin1( "kig" ) ); } void EditType::okSlot() { - QString tmp = editName->text(); + TQString tmp = editName->text(); if ( tmp.isEmpty() ) { KMessageBox::information( this, i18n( "The name of the macro can not be empty." ) ); @@ -91,17 +91,17 @@ void EditType::cancelSlot() done( 0 ); } -const QString EditType::name() const +const TQString EditType::name() const { return mname; } -const QString EditType::description() const +const TQString EditType::description() const { return mdesc; } -const QString EditType::icon() const +const TQString EditType::icon() const { return micon; } diff --git a/kig/modes/edittype.h b/kig/modes/edittype.h index c6530df5..c6f40783 100644 --- a/kig/modes/edittype.h +++ b/kig/modes/edittype.h @@ -29,15 +29,15 @@ class EditType : public EditTypeBase { Q_OBJECT - QString mname; - QString mdesc; - QString micon; + TQString mname; + TQString mdesc; + TQString micon; public: - EditType( QWidget* parent, QString name = QString::null, QString desc = QString::null, QString icon = QString::null ); + EditType( TQWidget* parent, TQString name = TQString::null, TQString desc = TQString::null, TQString icon = TQString::null ); ~EditType(); - const QString name() const; - const QString description() const; - const QString icon() const; + const TQString name() const; + const TQString description() const; + const TQString icon() const; public slots: void helpSlot(); diff --git a/kig/modes/label.cc b/kig/modes/label.cc index cd726918..578e15dd 100644 --- a/kig/modes/label.cc +++ b/kig/modes/label.cc @@ -38,12 +38,12 @@ #include #include #include -#include +#include #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -52,14 +52,14 @@ class TextLabelModeBase::Private { public: // point last clicked.. - QPoint plc; + TQPoint plc; // the currently selected coordinate Coordinate mcoord; // the possible parent object that defines the location of the label.. ObjectCalcer* locationparent; // the text is only kept in the text input widget, not here - // QString mtext; + // TQString mtext; // the property objects we'll be using as args, we keep a reference // to them in the args object, and keep a pointer to them ( or 0 ) @@ -96,7 +96,7 @@ TextLabelModeBase::TextLabelModeBase( KigPart& doc ) d->wiz = new TextLabelWizard( doc.widget(), this ); } -void TextLabelModeBase::leftClicked( QMouseEvent* e, KigWidget* ) +void TextLabelModeBase::leftClicked( TQMouseEvent* e, KigWidget* ) { d->plc = e->pos(); switch( d->mwawd ) @@ -111,7 +111,7 @@ void TextLabelModeBase::leftClicked( QMouseEvent* e, KigWidget* ) }; } -void TextLabelModeBase::leftReleased( QMouseEvent* e, KigWidget* v ) +void TextLabelModeBase::leftReleased( TQMouseEvent* e, KigWidget* v ) { switch( d->mwawd ) { @@ -132,19 +132,19 @@ void TextLabelModeBase::leftReleased( QMouseEvent* e, KigWidget* v ) std::vector os = mdoc.document().whatAmIOn( v->fromScreen( d->plc ), *v ); if ( os.empty() ) break; ObjectHolder* o = os[0]; - QPopupMenu* p = new QPopupMenu( v, "text_label_select_arg_popup" ); + TQPopupMenu* p = new TQPopupMenu( v, "text_label_select_arg_popup" ); p->insertItem( i18n( "Name" ), 0 ); QCStringList l = o->imp()->properties(); assert( l.size() == o->imp()->numberOfProperties() ); for ( int i = 0; static_cast( i ) < l.size(); ++i ) { - QString s = i18n( l[i] ); + TQString s = i18n( l[i] ); const char* iconfile = o->imp()->iconForProperty( i ); int t; if ( iconfile && *iconfile ) { - QPixmap pix = mdoc.instance()->iconLoader()->loadIcon( iconfile, KIcon::User ); - t = p->insertItem( QIconSet( pix ), s, i + 1 ); + TQPixmap pix = mdoc.instance()->iconLoader()->loadIcon( iconfile, KIcon::User ); + t = p->insertItem( TQIconSet( pix ), s, i + 1 ); } else { @@ -200,7 +200,7 @@ void TextLabelModeBase::enableActions() mdoc.aCancelConstruction->setEnabled( true ); } -void TextLabelModeBase::mouseMoved( QMouseEvent* e, KigWidget* w ) +void TextLabelModeBase::mouseMoved( TQMouseEvent* e, KigWidget* w ) { if ( d->mwawd == ReallySelectingArgs ) { @@ -228,13 +228,13 @@ void TextLabelModeBase::mouseMoved( QMouseEvent* e, KigWidget* w ) if ( attachable ) { w->setCursor( KCursor::handCursor() ); - QString s = d->locationparent->imp()->type()->attachToThisStatement(); + TQString s = d->locationparent->imp()->type()->attachToThisStatement(); mdoc.emitStatusBarText( s ); KigPainter p( w->screenInfo(), &w->curPix, mdoc.document() ); // set the text next to the arrow cursor - QPoint point = e->pos(); + TQPoint point = e->pos(); point.setX(point.x()+15); p.drawTextStd( point, s ); @@ -263,10 +263,10 @@ void TextLabelModeBase::cancelPressed() cancelConstruction(); } -static uint percentCount( const QString& s ) +static uint percentCount( const TQString& s ) { -// QRegExp re( QString::fromUtf8( "%[0-9]" ) ); - QRegExp re( QString::fromUtf8( "%[\\d]+" ) ); +// TQRegExp re( TQString::fromUtf8( "%[0-9]" ) ); + TQRegExp re( TQString::fromUtf8( "%[\\d]+" ) ); int offset = 0; uint percentcount = 0; while ( ( offset = re.search( s, offset ) ) != -1 ) @@ -280,7 +280,7 @@ static uint percentCount( const QString& s ) void TextLabelModeBase::finishPressed() { bool needframe = d->wiz->needFrameCheckBox->isChecked(); - QString s = d->wiz->labelTextInput->text(); + TQString s = d->wiz->labelTextInput->text(); assert( percentCount( s ) == d->args.size() ); if ( d->wiz->currentPage() == d->wiz->enter_text_page ) @@ -303,7 +303,7 @@ void TextLabelModeBase::finishPressed() void TextLabelModeBase::updateWiz() { - QString s = d->wiz->labelTextInput->text(); + TQString s = d->wiz->labelTextInput->text(); uint percentcount = percentCount( s ); if ( d->lpc > percentcount ) { @@ -344,9 +344,9 @@ void TextLabelModeBase::labelTextChanged() void TextLabelModeBase::updateLinksLabel() { LinksLabel::LinksLabelEditBuf buf = d->wiz->myCustomWidget1->startEdit(); - QString s = d->wiz->labelTextInput->text(); -// QRegExp re( "%[0-9]" ); - QRegExp re( "%[\\d]+" ); + TQString s = d->wiz->labelTextInput->text(); +// TQRegExp re( "%[0-9]" ); + TQRegExp re( "%[\\d]+" ); int prevpos = 0; int pos = 0; uint count = 0; @@ -361,12 +361,12 @@ void TextLabelModeBase::updateLinksLabel() // "link"... assert( prevpos < pos ); // fetch the text part... - QString subs = s.mid( prevpos, pos - prevpos ); + TQString subs = s.mid( prevpos, pos - prevpos ); // and add it... d->wiz->myCustomWidget1->addText( subs, buf ); }; // we always need a link part... - QString linktext( "%1" ); + TQString linktext( "%1" ); assert( count < d->args.size() ); if ( d->args[count] ) { @@ -428,7 +428,7 @@ void TextLabelModeBase::setCoordinate( const Coordinate& coord ) }; } -void TextLabelModeBase::setText( const QString& s ) +void TextLabelModeBase::setText( const TQString& s ) { d->wiz->labelTextInput->setText( s ); } @@ -450,7 +450,7 @@ TextLabelConstructionMode::~TextLabelConstructionMode() } void TextLabelConstructionMode::finish( - const Coordinate& coord, const QString& s, + const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ) { @@ -483,7 +483,7 @@ TextLabelRedefineMode::TextLabelRedefineMode( KigPart& d, ObjectTypeCalcer* labe bool frame = static_cast( firstthree[0]->imp() )->data() != 0; Coordinate coord = static_cast( firstthree[1]->imp() )->coordinate(); - QString text = static_cast( firstthree[2]->imp() )->data(); + TQString text = static_cast( firstthree[2]->imp() )->data(); // don't set it, let the user redefine it.. // setCoordinate( coord ); @@ -505,7 +505,7 @@ TextLabelRedefineMode::~TextLabelRedefineMode() } void TextLabelRedefineMode::finish( - const Coordinate& coord, const QString& s, + const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ) { diff --git a/kig/modes/label.h b/kig/modes/label.h index 4a3d09f7..1bb82f9a 100644 --- a/kig/modes/label.h +++ b/kig/modes/label.h @@ -61,7 +61,7 @@ protected: ~TextLabelModeBase(); void setCoordinate( const Coordinate& coord ); - void setText( const QString& s ); + void setText( const TQString& s ); void setLocationParent( ObjectCalcer* o ); /** * objects you pass here, should be newly created property objects, @@ -70,16 +70,16 @@ protected: void setPropertyObjects( const argvect& props ); void setFrame( bool f ); - virtual void finish( const Coordinate& c, const QString& s, + virtual void finish( const Coordinate& c, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ) = 0; private: // the KigMode interface.. - void leftClicked( QMouseEvent*, KigWidget* ); - void leftReleased( QMouseEvent*, KigWidget* ); + void leftClicked( TQMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent*, KigWidget* ); void enableActions(); @@ -109,7 +109,7 @@ public: TextLabelConstructionMode( KigPart& d ); ~TextLabelConstructionMode(); - void finish( const Coordinate& coord, const QString& s, + void finish( const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ); }; @@ -118,7 +118,7 @@ class TextLabelRedefineMode : public TextLabelModeBase { ObjectTypeCalcer* mlabel; - void finish( const Coordinate& coord, const QString& s, + void finish( const Coordinate& coord, const TQString& s, const argvect& props, bool needframe, ObjectCalcer* locationparent ); public: diff --git a/kig/modes/linkslabel.cpp b/kig/modes/linkslabel.cpp index 572c0bf8..96a73a8f 100644 --- a/kig/modes/linkslabel.cpp +++ b/kig/modes/linkslabel.cpp @@ -19,9 +19,9 @@ #include "linkslabel.h" #include "linkslabel.moc" -#include +#include #include -#include +#include #include #include @@ -33,27 +33,27 @@ using namespace std; class LinksLabel::Private { public: - QHBoxLayout* layout; - std::vector labels; + TQHBoxLayout* layout; + std::vector labels; std::vector urllabels; }; -LinksLabel::LinksLabel( QWidget* parent, const char* name ) - : QWidget( parent, name ) +LinksLabel::LinksLabel( TQWidget* parent, const char* name ) + : TQWidget( parent, name ) { p = new Private; - p->layout = new QHBoxLayout( this ); + p->layout = new TQHBoxLayout( this ); - QLabel* l = new QLabel( QString::fromUtf8( "Dit is een " ), this ); + TQLabel* l = new TQLabel( TQString::fromUtf8( "Dit is een " ), this ); p->labels.push_back( l ); p->layout->addWidget( l ); - KURLLabel* u = new KURLLabel( QString::fromUtf8( "http://www.kde.org/" ), - QString::fromUtf8( "url"), this ); + KURLLabel* u = new KURLLabel( TQString::fromUtf8( "http://www.kde.org/" ), + TQString::fromUtf8( "url"), this ); p->urllabels.push_back( u ); p->layout->addWidget( u ); - l = new QLabel( QString::fromUtf8( " !" ), this ); + l = new TQLabel( TQString::fromUtf8( " !" ), this ); p->labels.push_back( l ); p->layout->addWidget(l ); @@ -67,7 +67,7 @@ LinksLabel::~LinksLabel() void LinksLabel::urlClicked() { - const QObject* o = sender(); + const TQObject* o = sender(); std::vector::iterator i = std::find( p->urllabels.begin(), p->urllabels.end(), static_cast( o ) ); assert( i != p->urllabels.end() ); emit linkClicked( i - p->urllabels.begin() ); @@ -78,18 +78,18 @@ LinksLabel::LinksLabelEditBuf LinksLabel::startEdit() return LinksLabelEditBuf(); } -void LinksLabel::addText( const QString& s, LinksLabelEditBuf& buf ) +void LinksLabel::addText( const TQString& s, LinksLabelEditBuf& buf ) { - buf.data.push_back( std::pair( false, s ) ); + buf.data.push_back( std::pair( false, s ) ); } -void LinksLabel::addLink( const QString& s, LinksLabelEditBuf& buf ) +void LinksLabel::addLink( const TQString& s, LinksLabelEditBuf& buf ) { - buf.data.push_back( std::pair( true, s ) ); + buf.data.push_back( std::pair( true, s ) ); } namespace { - void deleteObj( QObject* o ) { delete o; } + void deleteObj( TQObject* o ) { delete o; } } void LinksLabel::applyEdit( LinksLabelEditBuf& buf ) @@ -100,7 +100,7 @@ void LinksLabel::applyEdit( LinksLabelEditBuf& buf ) p->labels.clear(); delete p->layout; - p->layout = new QHBoxLayout( this ); + p->layout = new TQHBoxLayout( this ); for ( LinksLabelEditBuf::vec::iterator i = buf.data.begin(); i != buf.data.end(); ++i ) { @@ -108,27 +108,27 @@ void LinksLabel::applyEdit( LinksLabelEditBuf& buf ) { // we need a KURLLabel... // the url is an unused stub... - KURLLabel* l = new KURLLabel( QString::fromUtf8( "http://edu.kde.org/kig" ), + KURLLabel* l = new KURLLabel( TQString::fromUtf8( "http://edu.kde.org/kig" ), i->second, this ); p->urllabels.push_back( l ); p->layout->addWidget( l ); - connect( l, SIGNAL( leftClickedURL() ), SLOT( urlClicked() ) ); + connect( l, TQT_SIGNAL( leftClickedURL() ), TQT_SLOT( urlClicked() ) ); } else { // we need a normal label... - QLabel* l = new QLabel( i->second, this ); + TQLabel* l = new TQLabel( i->second, this ); p->labels.push_back( l ); p->layout->addWidget( l ); }; }; - QSpacerItem* spacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); p->layout->addItem( spacer ); p->layout->activate(); - std::for_each( p->urllabels.begin(), p->urllabels.end(), mem_fun( &QWidget::show ) ); - std::for_each( p->labels.begin(), p->labels.end(), mem_fun( &QWidget::show ) ); + std::for_each( p->urllabels.begin(), p->urllabels.end(), mem_fun( &TQWidget::show ) ); + std::for_each( p->labels.begin(), p->labels.end(), mem_fun( &TQWidget::show ) ); } diff --git a/kig/modes/linkslabel.h b/kig/modes/linkslabel.h index ba64dbc2..89d1c76e 100644 --- a/kig/modes/linkslabel.h +++ b/kig/modes/linkslabel.h @@ -18,7 +18,7 @@ #ifndef KIG_lINKS_LABEL_H #define KIG_lINKS_LABEL_H -#include +#include #include #include @@ -32,7 +32,7 @@ class LinksLabel : public QWidget Q_OBJECT public: - LinksLabel( QWidget* parent = 0, const char* name = 0 ); + LinksLabel( TQWidget* parent = 0, const char* name = 0 ); ~LinksLabel(); class LinksLabelEditBuf @@ -43,7 +43,7 @@ public: private: // declare these private so only LinksLabel can use them... LinksLabelEditBuf() {} - typedef std::vector > vec; + typedef std::vector > vec; vec data; }; @@ -55,11 +55,11 @@ public: /** * add a piece of normal text.. */ - void addText( const QString& s, LinksLabelEditBuf& buf ); + void addText( const TQString& s, LinksLabelEditBuf& buf ); /** * add a link... */ - void addLink( const QString& s, LinksLabelEditBuf& buf ); + void addLink( const TQString& s, LinksLabelEditBuf& buf ); /** * apply the changes... This clears the current contents and adds * the new data... diff --git a/kig/modes/macro.cc b/kig/modes/macro.cc index 879466dc..bc6f5dc5 100644 --- a/kig/modes/macro.cc +++ b/kig/modes/macro.cc @@ -161,7 +161,7 @@ void DefineMacroMode::macroNameChanged() ); } -void DefineMacroMode::dragRect( const QPoint& p, KigWidget& w ) +void DefineMacroMode::dragRect( const TQPoint& p, KigWidget& w ) { if ( mwizard->currentPage() == mwizard->mpname ) return; std::vector* objs = mwizard->currentPage() == mwizard->mpgiven ? &mgiven : &mfinal; @@ -186,7 +186,7 @@ void DefineMacroMode::dragRect( const QPoint& p, KigWidget& w ) updateNexts(); } -void DefineMacroMode::leftClickedObject( ObjectHolder* o, const QPoint&, +void DefineMacroMode::leftClickedObject( ObjectHolder* o, const TQPoint&, KigWidget& w, bool ) { if ( mwizard->currentPage() == mwizard->mpname ) return; @@ -204,7 +204,7 @@ void DefineMacroMode::leftClickedObject( ObjectHolder* o, const QPoint&, updateNexts(); } -void DefineMacroMode::mouseMoved( const std::vector& os, const QPoint& pt, KigWidget& w, bool ) +void DefineMacroMode::mouseMoved( const std::vector& os, const TQPoint& pt, KigWidget& w, bool ) { w.updateCurPix(); @@ -220,14 +220,14 @@ void DefineMacroMode::mouseMoved( const std::vector& os, const QP // and set statusbar text w.setCursor( KCursor::handCursor() ); - QString selectstat = os.front()->selectStatement(); + TQString selectstat = os.front()->selectStatement(); // statusbar text mdoc.emitStatusBarText( selectstat ); KigPainter p( w.screenInfo(), &w.curPix, mdoc.document() ); // set the text next to the arrow cursor - QPoint point = pt; + TQPoint point = pt; point.setX(point.x()+15); p.drawTextStd( point, selectstat ); @@ -235,11 +235,11 @@ void DefineMacroMode::mouseMoved( const std::vector& os, const QP } } -void DefineMacroMode::rightClicked( const std::vector&, const QPoint&, KigWidget& ) +void DefineMacroMode::rightClicked( const std::vector&, const TQPoint&, KigWidget& ) { } -void DefineMacroMode::midClicked( const QPoint&, KigWidget& ) +void DefineMacroMode::midClicked( const TQPoint&, KigWidget& ) { } diff --git a/kig/modes/macro.h b/kig/modes/macro.h index 4bf8c43e..8725f0c8 100644 --- a/kig/modes/macro.h +++ b/kig/modes/macro.h @@ -20,7 +20,7 @@ #include "base_mode.h" -#include +#include class MacroWizard; @@ -31,12 +31,12 @@ public: DefineMacroMode( KigPart& ); ~DefineMacroMode(); - void dragRect( const QPoint& p, KigWidget& w ); - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void dragRect( const TQPoint& p, KigWidget& w ); + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void rightClicked( const std::vector& oco, const QPoint& p, KigWidget& w ); - void midClicked( const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector& os, const QPoint& p, KigWidget& w, bool shiftpressed ); + void rightClicked( const std::vector& oco, const TQPoint& p, KigWidget& w ); + void midClicked( const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); // called by MacroWizard class void givenPageEntered(); @@ -57,7 +57,7 @@ protected: */ void abandonMacro(); - QPoint plc; + TQPoint plc; MacroWizard* mwizard; // we can't use a set for this because the order is important diff --git a/kig/modes/macrowizard.cc b/kig/modes/macrowizard.cc index e6315caf..662e3a0d 100644 --- a/kig/modes/macrowizard.cc +++ b/kig/modes/macrowizard.cc @@ -24,13 +24,13 @@ #include #include -MacroWizard::MacroWizard( QWidget* parent, DefineMacroMode* m ) +MacroWizard::MacroWizard( TQWidget* parent, DefineMacroMode* m ) : MacroWizardBase( parent, "Define Macro Wizard", false ), mmode( m ) { - connect( KLineEdit2, SIGNAL( textChanged( const QString& ) ), - this, SLOT( nameTextChanged( const QString& ) ) ); - connect( this, SIGNAL( helpClicked() ), this, - SLOT( slotHelpClicked() ) ); + connect( KLineEdit2, TQT_SIGNAL( textChanged( const TQString& ) ), + this, TQT_SLOT( nameTextChanged( const TQString& ) ) ); + connect( this, TQT_SIGNAL( helpClicked() ), this, + TQT_SLOT( slotHelpClicked() ) ); } MacroWizard::~MacroWizard() @@ -73,7 +73,7 @@ void MacroWizard::reject() mmode->cancelPressed(); } -void MacroWizard::nameTextChanged( const QString& ) +void MacroWizard::nameTextChanged( const TQString& ) { mmode->macroNameChanged(); } @@ -85,6 +85,6 @@ void MacroWizard::accept() void MacroWizard::slotHelpClicked() { - kapp->invokeHelp( QString::fromLatin1( "defining-macros"), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "defining-macros"), + TQString::fromLatin1( "kig" ) ); } diff --git a/kig/modes/macrowizard.h b/kig/modes/macrowizard.h index dfce8b06..96318ec9 100644 --- a/kig/modes/macrowizard.h +++ b/kig/modes/macrowizard.h @@ -26,7 +26,7 @@ class MacroWizard : public MacroWizardBase { Q_OBJECT public: - MacroWizard( QWidget* parent, DefineMacroMode* m ); + MacroWizard( TQWidget* parent, DefineMacroMode* m ); ~MacroWizard(); void back(); @@ -34,7 +34,7 @@ public: void reject(); void accept(); private slots: - void nameTextChanged( const QString& ); + void nameTextChanged( const TQString& ); void slotHelpClicked(); private: DefineMacroMode* mmode; diff --git a/kig/modes/mode.cc b/kig/modes/mode.cc index 9d95b64d..76edc4f1 100644 --- a/kig/modes/mode.cc +++ b/kig/modes/mode.cc @@ -48,46 +48,46 @@ KigMode::KigMode( KigPart& d ) { } -void KigMode::leftClicked( QMouseEvent*, KigWidget* ) +void KigMode::leftClicked( TQMouseEvent*, KigWidget* ) { } -void KigMode::leftMouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::leftMouseMoved( TQMouseEvent*, KigWidget* ) { } -void KigMode::leftReleased( QMouseEvent*, KigWidget* ) +void KigMode::leftReleased( TQMouseEvent*, KigWidget* ) { /* insist disabling the undo button to avoid crashes */ mdoc.action( "edit_undo" )->setEnabled( false ); mdoc.action( "edit_redo" )->setEnabled( false ); } -void KigMode::midClicked( QMouseEvent*, KigWidget* ) +void KigMode::midClicked( TQMouseEvent*, KigWidget* ) { } -void KigMode::midMouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::midMouseMoved( TQMouseEvent*, KigWidget* ) { } -void KigMode::midReleased( QMouseEvent*, KigWidget* ) +void KigMode::midReleased( TQMouseEvent*, KigWidget* ) { } -void KigMode::rightClicked( QMouseEvent*, KigWidget* ) +void KigMode::rightClicked( TQMouseEvent*, KigWidget* ) { } -void KigMode::rightMouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::rightMouseMoved( TQMouseEvent*, KigWidget* ) { } -void KigMode::rightReleased( QMouseEvent*, KigWidget* ) +void KigMode::rightReleased( TQMouseEvent*, KigWidget* ) { } -void KigMode::mouseMoved( QMouseEvent*, KigWidget* ) +void KigMode::mouseMoved( TQMouseEvent*, KigWidget* ) { } diff --git a/kig/modes/mode.h b/kig/modes/mode.h index 6f476072..9dede83b 100644 --- a/kig/modes/mode.h +++ b/kig/modes/mode.h @@ -21,7 +21,7 @@ #ifndef KIG_PART_MODE_H #define KIG_PART_MODE_H -#include +#include class KigDocument; class KigPart; @@ -41,23 +41,23 @@ public: virtual StdConstructionMode* toStdConstructionMode(); - virtual void leftClicked( QMouseEvent*, KigWidget* ); + virtual void leftClicked( TQMouseEvent*, KigWidget* ); /** * this means: mouse moved with left mouse button down (in case that * wasn't clear...) */ - virtual void leftMouseMoved( QMouseEvent*, KigWidget* ); - virtual void leftReleased( QMouseEvent*, KigWidget* ); - virtual void midClicked( QMouseEvent*, KigWidget* ); - virtual void midMouseMoved( QMouseEvent*, KigWidget* ); - virtual void midReleased( QMouseEvent*, KigWidget* ); - virtual void rightClicked( QMouseEvent*, KigWidget* ); - virtual void rightMouseMoved( QMouseEvent*, KigWidget* ); - virtual void rightReleased( QMouseEvent*, KigWidget* ); + virtual void leftMouseMoved( TQMouseEvent*, KigWidget* ); + virtual void leftReleased( TQMouseEvent*, KigWidget* ); + virtual void midClicked( TQMouseEvent*, KigWidget* ); + virtual void midMouseMoved( TQMouseEvent*, KigWidget* ); + virtual void midReleased( TQMouseEvent*, KigWidget* ); + virtual void rightClicked( TQMouseEvent*, KigWidget* ); + virtual void rightMouseMoved( TQMouseEvent*, KigWidget* ); + virtual void rightReleased( TQMouseEvent*, KigWidget* ); /** * mouse moved without any buttons down... */ - virtual void mouseMoved( QMouseEvent*, KigWidget* ); + virtual void mouseMoved( TQMouseEvent*, KigWidget* ); /** * actions: we enable the actions we want when our mode is made diff --git a/kig/modes/moving.cc b/kig/modes/moving.cc index e628a7ce..533b15d4 100644 --- a/kig/modes/moving.cc +++ b/kig/modes/moving.cc @@ -29,7 +29,7 @@ #include "../misc/calcpaths.h" #include "../misc/coordinate_system.h" -#include +#include #include #include @@ -65,7 +65,7 @@ void MovingModeBase::initScreen( const std::vector& in ) p2.drawObjects( drawableset.begin(), drawableset.end(), true ); } -void MovingModeBase::leftReleased( QMouseEvent*, KigWidget* v ) +void MovingModeBase::leftReleased( TQMouseEvent*, KigWidget* v ) { // clean up after ourselves: for ( std::vector::iterator i = mcalcable.begin(); @@ -81,7 +81,7 @@ void MovingModeBase::leftReleased( QMouseEvent*, KigWidget* v ) mdoc.doneMode( this ); } -void MovingModeBase::mouseMoved( QMouseEvent* e, KigWidget* v ) +void MovingModeBase::mouseMoved( TQMouseEvent* e, KigWidget* v ) { v->updateCurPix(); Coordinate c = v->fromScreen( e->pos() ); @@ -152,7 +152,7 @@ MovingMode::MovingMode( const std::vector& os, const Coordinate& void MovingMode::stopMove() { - QString text = d->emo.size() == 1 ? + TQString text = d->emo.size() == 1 ? d->emo[0]->imp()->type()->moveAStatement() : i18n( "Move %1 Objects" ).arg( d->emo.size() ); KigCommand* mc = new KigCommand( mdoc, text ); @@ -208,7 +208,7 @@ MovingModeBase::~MovingModeBase() { } -void MovingModeBase::leftMouseMoved( QMouseEvent* e, KigWidget* v ) +void MovingModeBase::leftMouseMoved( TQMouseEvent* e, KigWidget* v ) { mouseMoved( e, v ); } diff --git a/kig/modes/moving.h b/kig/modes/moving.h index 32828db3..7c27aa4e 100644 --- a/kig/modes/moving.h +++ b/kig/modes/moving.h @@ -66,9 +66,9 @@ protected: virtual void moveTo( const Coordinate& o, bool snaptogrid ) = 0; public: - void leftReleased( QMouseEvent*, KigWidget* ); - void leftMouseMoved( QMouseEvent*, KigWidget* ); - void mouseMoved( QMouseEvent*, KigWidget* ); + void leftReleased( TQMouseEvent*, KigWidget* ); + void leftMouseMoved( TQMouseEvent*, KigWidget* ); + void mouseMoved( TQMouseEvent*, KigWidget* ); }; class MovingMode diff --git a/kig/modes/normal.cc b/kig/modes/normal.cc index ecf5f5c1..1fa45d00 100644 --- a/kig/modes/normal.cc +++ b/kig/modes/normal.cc @@ -128,7 +128,7 @@ NormalMode::~NormalMode() { } -void NormalMode::dragRect( const QPoint& p, KigWidget& w ) +void NormalMode::dragRect( const TQPoint& p, KigWidget& w ) { DragRectMode d( p, mdoc, w ); mdoc.runMode( &d ); @@ -153,7 +153,7 @@ void NormalMode::dragRect( const QPoint& p, KigWidget& w ) w.updateWidget(); } -void NormalMode::dragObject( const std::vector& oco, const QPoint& pco, +void NormalMode::dragObject( const std::vector& oco, const TQPoint& pco, KigWidget& w, bool ctrlOrShiftDown ) { // first determine what to move... @@ -171,7 +171,7 @@ void NormalMode::dragObject( const std::vector& oco, const QPoint mdoc.runMode( &m ); } -void NormalMode::leftClickedObject( ObjectHolder* o, const QPoint&, +void NormalMode::leftClickedObject( ObjectHolder* o, const TQPoint&, KigWidget& w, bool ctrlOrShiftDown ) { KigPainter pter( w.screenInfo(), &w.stillPix, mdoc.document() ); @@ -202,7 +202,7 @@ void NormalMode::leftClickedObject( ObjectHolder* o, const QPoint&, w.updateWidget(); } -void NormalMode::midClicked( const QPoint& p, KigWidget& w ) +void NormalMode::midClicked( const TQPoint& p, KigWidget& w ) { ObjectHolder* pto = ObjectFactory::instance()->sensiblePoint( w.fromScreen( p ), mdoc.document(), w ); pto->calc( mdoc.document() ); @@ -215,11 +215,11 @@ void NormalMode::midClicked( const QPoint& p, KigWidget& w ) } void NormalMode::rightClicked( const std::vector& os, - const QPoint& plc, + const TQPoint& plc, KigWidget& w ) { // saving the current cursor position - QPoint pt = QCursor::pos(); + TQPoint pt = TQCursor::pos(); if( !os.empty() ) { ObjectHolder* o = 0; @@ -246,7 +246,7 @@ void NormalMode::rightClicked( const std::vector& os, } void NormalMode::mouseMoved( const std::vector& os, - const QPoint& plc, + const TQPoint& plc, KigWidget& w, bool ) { @@ -265,14 +265,14 @@ void NormalMode::mouseMoved( const std::vector& os, w.setCursor( KCursor::handCursor() ); int id = ObjectChooserPopup::getObjectFromList( plc, &w, os, false ); - QString stat = id == 0 ? os.front()->selectStatement() : i18n( "Which object?" ); + TQString stat = id == 0 ? os.front()->selectStatement() : i18n( "Which object?" ); // statusbar text mdoc.emitStatusBarText( stat ); KigPainter p( w.screenInfo(), &w.curPix, mdoc.document() ); // set the text next to the arrow cursor - QPoint point = plc; + TQPoint point = plc; point.setX(point.x()+15); p.drawTextStd( point, stat ); diff --git a/kig/modes/normal.h b/kig/modes/normal.h index dd51c854..314b7e20 100644 --- a/kig/modes/normal.h +++ b/kig/modes/normal.h @@ -20,7 +20,7 @@ #include "base_mode.h" -#include +#include #include class NormalMode @@ -30,14 +30,14 @@ public: NormalMode( KigPart& ); ~NormalMode(); protected: - void dragRect( const QPoint& p, KigWidget& w ); - void dragObject( const std::vector& os, const QPoint& pointClickedOn, + void dragRect( const TQPoint& p, KigWidget& w ); + void dragObject( const std::vector& os, const TQPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool ctrlOrShiftDown ); - void midClicked( const QPoint& p, KigWidget& w ); - void rightClicked( const std::vector& os, const QPoint& p, KigWidget& w ); - void mouseMoved( const std::vector& os, const QPoint& p, KigWidget& w, + void midClicked( const TQPoint& p, KigWidget& w ); + void rightClicked( const std::vector& os, const TQPoint& p, KigWidget& w ); + void mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); void selectAll(); void deselectAll(); diff --git a/kig/modes/popup.cc b/kig/modes/popup.cc index b71d9896..489b4985 100644 --- a/kig/modes/popup.cc +++ b/kig/modes/popup.cc @@ -46,11 +46,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -184,21 +184,21 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, KigWidget& view, NormalMode& mode, const std::vector& objs, - const QPoint& plc ) + const TQPoint& plc ) : KPopupMenu( &view ), mplc( plc ), mpart( part ), mview( view ), mobjs( objs ), mmode( mode ), monlylabels( false ) { bool empty = objs.empty(); bool single = objs.size() == 1; - connect( this, SIGNAL( activated( int ) ), this, SLOT( toplevelMenuSlot( int ) ) ); + connect( this, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( toplevelMenuSlot( int ) ) ); - QString title; + TQString title; if ( empty ) title = i18n( "Kig Document" ); else if ( single ) { if ( !objs[0]->name().isNull() ) - title = QString::fromLatin1( "%1 %2" ).arg( objs[0]->imp()->type()->translatedName() ).arg( objs[0]->name() ); + title = TQString::fromLatin1( "%1 %2" ).arg( objs[0]->imp()->type()->translatedName() ).arg( objs[0]->name() ); else title = objs[0]->imp()->type()->translatedName(); } @@ -244,26 +244,26 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, #endif for ( uint i = 0; i < NumberOfMenus; ++i ) - mmenus[i] = new QPopupMenu( this ); - - connect( mmenus[TransformMenu], SIGNAL( activated( int ) ), - this, SLOT( transformMenuSlot( int ) ) ); - connect( mmenus[TestMenu], SIGNAL( activated( int ) ), - this, SLOT( testMenuSlot( int ) ) ); - connect( mmenus[ConstructMenu], SIGNAL( activated( int ) ), - this, SLOT( constructMenuSlot( int ) ) ); - connect( mmenus[StartMenu], SIGNAL( activated( int ) ), - this, SLOT( startMenuSlot( int ) ) ); - connect( mmenus[ShowMenu], SIGNAL( activated( int ) ), - this, SLOT( showMenuSlot( int ) ) ); - connect( mmenus[SetColorMenu], SIGNAL( activated( int ) ), - this, SLOT( setColorMenuSlot( int ) ) ); - connect( mmenus[SetSizeMenu], SIGNAL( activated( int ) ), - this, SLOT( setSizeMenuSlot( int ) ) ); - connect( mmenus[SetStyleMenu], SIGNAL( activated( int ) ), - this, SLOT( setStyleMenuSlot( int ) ) ); - connect( mmenus[SetCoordinateSystemMenu], SIGNAL( activated( int ) ), - this, SLOT( setCoordinateSystemMenuSlot( int ) ) ); + mmenus[i] = new TQPopupMenu( this ); + + connect( mmenus[TransformMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( transformMenuSlot( int ) ) ); + connect( mmenus[TestMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( testMenuSlot( int ) ) ); + connect( mmenus[ConstructMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( constructMenuSlot( int ) ) ); + connect( mmenus[StartMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( startMenuSlot( int ) ) ); + connect( mmenus[ShowMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( showMenuSlot( int ) ) ); + connect( mmenus[SetColorMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setColorMenuSlot( int ) ) ); + connect( mmenus[SetSizeMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setSizeMenuSlot( int ) ) ); + connect( mmenus[SetStyleMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setStyleMenuSlot( int ) ) ); + connect( mmenus[SetCoordinateSystemMenu], TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( setCoordinateSystemMenuSlot( int ) ) ); for ( int i = 0; i <= NumberOfMenus; ++i ) { @@ -271,7 +271,7 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, for ( uint j = 0; j < mproviders.size(); ++j ) mproviders[j]->fillUpMenu( *this, i, nextfree ); }; - static const QString menunames[NumberOfMenus] = + static const TQString menunames[NumberOfMenus] = { i18n( "&Transform" ), i18n( "T&est" ), @@ -281,22 +281,22 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, i18n( "Set Co&lor" ), i18n( "Set &Pen Width" ), i18n( "Set St&yle" ), - QString::null, + TQString::null, i18n( "Set Coordinate S&ystem" ) }; - static const QString menuicons[NumberOfMenus] = + static const TQString menuicons[NumberOfMenus] = { "centralsymmetry", "test", - QString::null, + TQString::null, "launch", "kig_text", "color_fill", // "colorize", "sizer", "paintbrush", - QString::null, - QString::null + TQString::null, + TQString::null }; int index = 1; for ( int i = 0; i < NumberOfMenus; ++i ) @@ -307,8 +307,8 @@ NormalModePopupObjects::NormalModePopupObjects( KigPart& part, else { KIconLoader* l = part.instance()->iconLoader(); - QPixmap icon = l->loadIcon( menuicons[i], KIcon::Small, 22, KIcon::DefaultState, 0L, true ); - insertItem( QIconSet( icon ), menunames[i], mmenus[i], i, index++ ); + TQPixmap icon = l->loadIcon( menuicons[i], KIcon::Small, 22, KIcon::DefaultState, 0L, true ); + insertItem( TQIconSet( icon ), menunames[i], mmenus[i], i, index++ ); } }; } @@ -358,7 +358,7 @@ NormalModePopupObjects::~NormalModePopupObjects() delete_all ( mproviders.begin(), mproviders.end() ); } -static const QColor* colors[] = +static const TQColor* colors[] = { &Qt::blue, &Qt::black, @@ -369,7 +369,7 @@ static const QColor* colors[] = &Qt::yellow, &Qt::darkRed }; -static const int numberofcolors = sizeof( colors ) / sizeof( QColor* ); +static const int numberofcolors = sizeof( colors ) / sizeof( TQColor* ); void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, int menu, int& nextfree ) { @@ -397,15 +397,15 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in popup.addAction( menu, i18n( "&Show" ), nextfree+1 ); } nextfree += 2; - QPixmap p = l->loadIcon( "move", KIcon::Toolbar ); + TQPixmap p = l->loadIcon( "move", KIcon::Toolbar ); popup.addAction( menu, p, i18n( "&Move" ), nextfree++ ); p = l->loadIcon( "editdelete", KIcon::Toolbar ); popup.addAction( menu, p, i18n( "&Delete" ), nextfree++ ); } else if ( menu == NormalModePopupObjects::SetColorMenu ) { - QPixmap p( 50, 20 ); - for( const QColor** c = colors; c < colors + numberofcolors; ++c ) + TQPixmap p( 50, 20 ); + for( const TQColor** c = colors; c < colors + numberofcolors; ++c ) { p.fill( **c ); popup.addAction( menu, p, nextfree++ ); @@ -417,7 +417,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in bool point = true; bool samecolor = true; std::vector os = popup.objects(); - QColor color = os.front()->drawer()->color(); + TQColor color = os.front()->drawer()->color(); for ( std::vector::const_iterator i = os.begin(); i != os.end(); ++i ) { if ( ! (*i)->imp()->inherits( PointImp::stype() ) ) @@ -425,23 +425,23 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in if ( (*i)->drawer()->color() != color ) samecolor = false; }; if ( ! samecolor ) color = Qt::blue; - QPixmap p( point ? 20 : 50, 20 ); + TQPixmap p( point ? 20 : 50, 20 ); for ( int i = 1; i < 8; ++i ) { p.fill( popup.eraseColor() ); - QPainter ptr( &p ); - ptr.setPen( QPen( color, 1 ) ); - ptr.setBrush( QBrush( color, Qt::SolidPattern ) ); + TQPainter ptr( &p ); + ptr.setPen( TQPen( color, 1 ) ); + ptr.setBrush( TQBrush( color, Qt::SolidPattern ) ); if ( point ) { int size = 2*i; - QRect r( ( 20 - size ) / 2, ( 20 - size ) / 2, size, size ); + TQRect r( ( 20 - size ) / 2, ( 20 - size ) / 2, size, size ); ptr.drawEllipse( r ); } else { - ptr.setPen( QPen( color, -1 + 2*i ) ); - ptr.drawLine( QPoint( 0, 10 ), QPoint( 50, 10 ) ); + ptr.setPen( TQPen( color, -1 + 2*i ) ); + ptr.drawLine( TQPoint( 0, 10 ), TQPoint( 50, 10 ) ); }; ptr.end(); popup.addAction( menu, p, nextfree++ ); @@ -453,7 +453,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in int npoints = 0; int nothers = 0; std::vector os = popup.objects(); - QColor color = os.front()->drawer()->color(); + TQColor color = os.front()->drawer()->color(); for ( std::vector::const_iterator i = os.begin(); i != os.end(); ++i ) { if ( (*i)->imp()->inherits( PointImp::stype() ) ) @@ -467,7 +467,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in if ( point ) for ( int i = 0; i < 5; ++i ) { - QPixmap p( 20, 20 ); + TQPixmap p( 20, 20 ); p.fill( popup.eraseColor() ); ScreenInfo si( Rect( -1, -1, 2, 2 ), p.rect() ); KigPainter ptr( si, &p, popup.part().document(), false ); @@ -481,7 +481,7 @@ void BuiltinObjectActionsProvider::fillUpMenu( NormalModePopupObjects& popup, in Qt::PenStyle penstyles[] = {Qt::SolidLine, Qt::DashLine, Qt::DashDotLine, Qt::DashDotDotLine, Qt::DotLine}; for ( int i = 0; i < (int) ( sizeof( penstyles ) / sizeof( Qt::PenStyle ) ); ++i ) { - QPixmap p( 50, 20 ); + TQPixmap p( 50, 20 ); p.fill( popup.eraseColor() ); ScreenInfo si( Rect( -2.5, -1, 5, 2 ), p.rect() ); KigPainter ptr( si, &p, popup.part().document(), false ); @@ -518,7 +518,7 @@ static void addNameLabel( ObjectCalcer* object, ObjectCalcer* namecalcer, const object->imp()->inherits( CurveImp::stype() ) ) attachto = object; ObjectHolder* label = ObjectFactory::instance()->attachedLabel( - QString::fromLatin1( "%1" ), attachto, loc, namelabelneedsframe, args, doc.document() ); + TQString::fromLatin1( "%1" ), attachto, loc, namelabelneedsframe, args, doc.document() ); doc.addObject( label ); } @@ -534,12 +534,12 @@ bool NameObjectActionsProvider::executeAction( return false; } assert( os.size() == 1 ); - QString name = os[0]->name(); + TQString name = os[0]->name(); bool ok; - QRegExp re( ".*" ); - QRegExpValidator* rev = new QRegExpValidator( re, &doc ); - QString caption = i18n( "Set Object Name" ); - QString label = i18n( "Set Name of this Object:" ); + TQRegExp re( ".*" ); + TQRegExpValidator* rev = new TQRegExpValidator( re, &doc ); + TQString caption = i18n( "Set Object Name" ); + TQString label = i18n( "Set Name of this Object:" ); #if KDE_IS_VERSION( 3, 1, 90 ) name = KInputDialog::getText( caption, label, name, &ok, &w, 0, rev ); #else @@ -567,7 +567,7 @@ bool NameObjectActionsProvider::executeAction( // if we just added the name, we add a label to show it to the user. if ( justadded ) addNameLabel( os[0]->calcer(), namecalcer, -// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( QPoint( 5, 0 ) ) ) ), +// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( TQPoint( 5, 0 ) ) ) ), w.fromScreen( popup.plc() ), doc ); } @@ -589,7 +589,7 @@ bool NameObjectActionsProvider::executeAction( namecalcer = c; } addNameLabel( os[0]->calcer(), namecalcer, -// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( QPoint( 5, 0 ) ) ) ), doc ); +// w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( TQPoint( 5, 0 ) ) ) ), doc ); w.fromScreen( popup.plc() ), doc ); return true; } @@ -623,8 +623,8 @@ bool BuiltinObjectActionsProvider::executeAction( case 2: { // move - QCursor::setPos( popup.mapToGlobal( QPoint( 0, 0 ) ) ); - QPoint p = w.mapFromGlobal( QCursor::pos() ); + TQCursor::setPos( popup.mapToGlobal( TQPoint( 0, 0 ) ) ); + TQPoint p = w.mapFromGlobal( TQCursor::pos() ); Coordinate c = w.fromScreen( p ); MovingMode m( os, c, w, doc ); doc.runMode( &m ); @@ -648,7 +648,7 @@ bool BuiltinObjectActionsProvider::executeAction( id -= numberofcolors + 1; return false; }; - QColor color; + TQColor color; if ( id < numberofcolors ) color = *colors[id]; else @@ -753,10 +753,10 @@ void ObjectConstructorActionsProvider::fillUpMenu( NormalModePopupObjects& popup }; if ( add ) { - QCString iconfile = (*i)->iconFileName(); + TQCString iconfile = (*i)->iconFileName(); if ( !iconfile.isEmpty() && !iconfile.isNull() ) { - QPixmap icon = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); + TQPixmap icon = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); popup.addAction( menu, icon, (*i)->descriptiveName(), nextfree++ ); } else @@ -794,9 +794,9 @@ bool ObjectConstructorActionsProvider::executeAction( return true; } -void NormalModePopupObjects::addAction( int menu, const QPixmap& pix, int id ) +void NormalModePopupObjects::addAction( int menu, const TQPixmap& pix, int id ) { - QPopupMenu* m = 0; + TQPopupMenu* m = 0; if ( menu == ToplevelMenu ) m = this; else m = mmenus[menu]; int ret = m->insertItem( pix, id ); @@ -825,20 +825,20 @@ void NormalModePopupObjects::setCoordinateSystemMenuSlot( int i ) activateAction( SetCoordinateSystemMenu, i ); } -void NormalModePopupObjects::addAction( int menu, const QPixmap& icon, const QString& name, int id ) +void NormalModePopupObjects::addAction( int menu, const TQPixmap& icon, const TQString& name, int id ) { - QPopupMenu* m = 0; + TQPopupMenu* m = 0; if ( menu == ToplevelMenu ) m = this; else m = mmenus[menu]; - int ret = m->insertItem( QIconSet( icon ), name, id ); + int ret = m->insertItem( TQIconSet( icon ), name, id ); assert( ret == id ); // pretend to use this var.. (void)ret; } -void NormalModePopupObjects::addAction( int menu, const QString& name, int id ) +void NormalModePopupObjects::addAction( int menu, const TQString& name, int id ) { - QPopupMenu* m = 0; + TQPopupMenu* m = 0; if ( menu == ToplevelMenu ) m = this; else m = mmenus[menu]; int ret = m->insertItem( name, id ); @@ -881,7 +881,7 @@ void PropertiesActionsProvider::fillUpMenu( NormalModePopupObjects& popup, { if ( iconfile && *iconfile ) { - QPixmap pix = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); + TQPixmap pix = popup.part().instance()->iconLoader()->loadIcon( iconfile, KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); popup.addAction( menu, pix, i18n( o->imp()->properties()[i] ), nextfree++ ); } else @@ -917,14 +917,14 @@ bool PropertiesActionsProvider::executeAction( args.back()->calc( doc.document() ); // TODO: recover the cursor position somehow... the following does not work // in general... -// Coordinate c = w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( QPoint( 5, 0 ) ) ) ); +// Coordinate c = w.fromScreen( w.mapFromGlobal( popup.mapToGlobal( TQPoint( 5, 0 ) ) ) ); // mp: it seems that we have no idea where to position the label, // btw what's the meaning of (5,0)? let the // attach method decide what to do... (passing an invalidCoord) // /////// Coordinate c = Coordinate::invalidCoord(); Coordinate c = w.fromScreen( popup.plc() ); ObjectHolder* label = ObjectFactory::instance()->attachedLabel( - QString::fromLatin1( "%1" ), parent->calcer(), c, + TQString::fromLatin1( "%1" ), parent->calcer(), c, false, args, doc.document() ); doc.addObject( label ); } @@ -948,7 +948,7 @@ void ObjectTypeActionsProvider::fillUpMenu( if ( ! c ) return; const ObjectType* t = c->type(); - QStringList l = t->specialActions(); + TQStringList l = t->specialActions(); mnoa = l.count(); for ( int i = 0; i < mnoa; ++i ) popup.addAction( menu, l[i], nextfree++ ); @@ -986,7 +986,7 @@ void BuiltinDocumentActionsProvider::fillUpMenu( NormalModePopupObjects& popup, else if ( menu == NormalModePopupObjects::SetCoordinateSystemMenu ) { int idoffset = nextfree; - QStringList l = CoordinateSystemFactory::names(); + TQStringList l = CoordinateSystemFactory::names(); mnumberofcoordsystems = l.count(); for ( uint i = 0; i < l.count(); ++i ) popup.addAction( menu, l[i], nextfree++ ); @@ -1053,7 +1053,7 @@ void ScriptActionsProvider::fillUpMenu( NormalModePopupObjects& popup, int menu, if ( menu == NormalModePopupObjects::StartMenu ) { KIconLoader* l = popup.part().instance()->iconLoader(); - QPixmap p = l->loadIcon( ScriptType::icon( ScriptType::Python ), KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); + TQPixmap p = l->loadIcon( ScriptType::icon( ScriptType::Python ), KIcon::Toolbar, 22, KIcon::DefaultState, 0L, true ); popup.addAction( menu, p, i18n( "Python Script" ), nextfree++ ); mns++; } @@ -1115,7 +1115,7 @@ bool ScriptActionsProvider::executeAction( } #endif -int ObjectChooserPopup::getObjectFromList( const QPoint& p, KigWidget* w, +int ObjectChooserPopup::getObjectFromList( const TQPoint& p, KigWidget* w, const std::vector& objs, bool givepopup ) { @@ -1153,7 +1153,7 @@ int ObjectChooserPopup::getObjectFromList( const QPoint& p, KigWidget* w, if ( givepopup ) { ObjectChooserPopup* ppp = new ObjectChooserPopup( p, *w, objs ); - ppp->exec( QCursor::pos() ); + ppp->exec( TQCursor::pos() ); id = ppp->mselected; @@ -1175,19 +1175,19 @@ int ObjectChooserPopup::getObjectFromList( const QPoint& p, KigWidget* w, return id; } -ObjectChooserPopup::ObjectChooserPopup( const QPoint& p, KigWidget& view, +ObjectChooserPopup::ObjectChooserPopup( const TQPoint& p, KigWidget& view, const std::vector& objs ) : KPopupMenu(), mplc( p ), mview( view ), mobjs( objs ), mselected( -1 ) { for ( uint i = 0; i < mobjs.size(); i++ ) { insertItem( !mobjs[i]->name().isEmpty() - ? QString::fromLatin1( "%1 %2" ).arg( mobjs[i]->imp()->type()->translatedName() ).arg( mobjs[i]->name() ) + ? TQString::fromLatin1( "%1 %2" ).arg( mobjs[i]->imp()->type()->translatedName() ).arg( mobjs[i]->name() ) : mobjs[i]->imp()->type()->translatedName(), i ); } - connect( this, SIGNAL( activated( int ) ), this, SLOT( actionActivatedSlot( int ) ) ); + connect( this, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( actionActivatedSlot( int ) ) ); } ObjectChooserPopup::~ObjectChooserPopup() diff --git a/kig/modes/popup.h b/kig/modes/popup.h index 405bcee6..76574b74 100644 --- a/kig/modes/popup.h +++ b/kig/modes/popup.h @@ -51,7 +51,7 @@ class NormalModePopupObjects public: NormalModePopupObjects( KigPart& part, KigWidget& view, NormalMode& mode, - const std::vector& objs, const QPoint& p ); + const std::vector& objs, const TQPoint& p ); ~NormalModePopupObjects(); // the different "menu's", the toplevel is considered as just @@ -61,9 +61,9 @@ public: SetCoordinateSystemMenu, NumberOfMenus }; // used by the PopupActionProvider's to add actions to us.. - void addAction( int menu, const QString& name, int id ); - void addAction( int menu, const QPixmap& icon, const QString& name, int id ); - void addAction( int menu, const QPixmap& pix, int id ); + void addAction( int menu, const TQString& name, int id ); + void addAction( int menu, const TQPixmap& icon, const TQString& name, int id ); + void addAction( int menu, const TQPixmap& pix, int id ); /** * set the checked state of the \p n 'th item in \p menu to \p checked .. @@ -73,7 +73,7 @@ public: std::vector objects() const { return mobjs; } KigPart& part() { return mpart; } KigWidget& widget() { return mview; } - QPoint plc() { return mplc; } + TQPoint plc() { return mplc; } bool onlyLabels() const { return monlylabels; } @@ -93,7 +93,7 @@ private slots: void setCoordinateSystemMenuSlot( int ); protected: - QPoint mplc; + TQPoint mplc; KigPart& mpart; KigWidget& mview; std::vector mobjs; @@ -101,7 +101,7 @@ protected: std::vector mproviders; - QPopupMenu* mmenus[NumberOfMenus]; + TQPopupMenu* mmenus[NumberOfMenus]; private: bool monlylabels; @@ -130,12 +130,12 @@ public: * \return the index of the chosen element ( starting from 0 ), or -1 * if none was selected. */ - static int getObjectFromList( const QPoint& p, KigWidget* w, + static int getObjectFromList( const TQPoint& p, KigWidget* w, const std::vector& objs, bool givepopup = true ); protected: - ObjectChooserPopup( const QPoint& p, KigWidget& view, + ObjectChooserPopup( const TQPoint& p, KigWidget& view, const std::vector& objs ); ~ObjectChooserPopup(); @@ -143,7 +143,7 @@ protected slots: void actionActivatedSlot( int ); protected: - QPoint mplc; + TQPoint mplc; KigWidget& mview; std::vector mobjs; diff --git a/kig/modes/textlabelwizard.cc b/kig/modes/textlabelwizard.cc index 803ca819..d562bbf3 100644 --- a/kig/modes/textlabelwizard.cc +++ b/kig/modes/textlabelwizard.cc @@ -21,20 +21,20 @@ #include "label.h" #include "linkslabel.h" -#include +#include #include -#include +#include -TextLabelWizard::TextLabelWizard( QWidget* parent, TextLabelModeBase* mode ) +TextLabelWizard::TextLabelWizard( TQWidget* parent, TextLabelModeBase* mode ) : TextLabelWizardBase( parent, "TextLabelWizard", false ), mmode( mode ) { - connect( labelTextInput, SIGNAL( textChanged() ), - SLOT( textChanged() ) ); - connect( myCustomWidget1, SIGNAL( linkClicked( int ) ), - SLOT( linkClicked( int ) ) ); - connect( this, SIGNAL( helpClicked() ), - this, SLOT( slotHelpClicked() ) ); + connect( labelTextInput, TQT_SIGNAL( textChanged() ), + TQT_SLOT( textChanged() ) ); + connect( myCustomWidget1, TQT_SIGNAL( linkClicked( int ) ), + TQT_SLOT( linkClicked( int ) ) ); + connect( this, TQT_SIGNAL( helpClicked() ), + this, TQT_SLOT( slotHelpClicked() ) ); labelTextInput->setFocus(); } @@ -89,7 +89,7 @@ void TextLabelWizard::relayoutArgsPage() void TextLabelWizard::slotHelpClicked() { - kapp->invokeHelp( QString::fromLatin1( "text-labels" ), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "text-labels" ), + TQString::fromLatin1( "kig" ) ); } diff --git a/kig/modes/textlabelwizard.h b/kig/modes/textlabelwizard.h index 787e0803..bd51c1e0 100644 --- a/kig/modes/textlabelwizard.h +++ b/kig/modes/textlabelwizard.h @@ -26,7 +26,7 @@ class TextLabelWizard : public TextLabelWizardBase { Q_OBJECT public: - TextLabelWizard( QWidget* parent, TextLabelModeBase* mode ); + TextLabelWizard( TQWidget* parent, TextLabelModeBase* mode ); ~TextLabelWizard(); void back(); diff --git a/kig/modes/typesdialog.cpp b/kig/modes/typesdialog.cpp index 67621c20..e14ceee8 100644 --- a/kig/modes/typesdialog.cpp +++ b/kig/modes/typesdialog.cpp @@ -35,10 +35,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -53,12 +53,12 @@ public: }; MacroListElement::MacroListElement( KListView* lv, Macro* m ) - : QListViewItem( lv, QString::null, m->action->descriptiveName(), m->action->description() ), + : TQListViewItem( lv, TQString::null, m->action->descriptiveName(), m->action->description() ), macro( m ) { } -TypesDialog::TypesDialog( QWidget* parent, KigPart& part ) +TypesDialog::TypesDialog( TQWidget* parent, KigPart& part ) : TypesDialogBase( parent, "types_dialog", true ), mpart( part ) { // improving GUI look'n'feel... @@ -66,10 +66,10 @@ TypesDialog::TypesDialog( QWidget* parent, KigPart& part ) buttonOk->setGuiItem( KStdGuiItem::ok() ); buttonCancel->setGuiItem( KStdGuiItem::cancel() ); il = part.instance()->iconLoader(); - buttonEdit->setIconSet( QIconSet( il->loadIcon( "edit", KIcon::Small ) ) ); - buttonRemove->setIconSet( QIconSet( il->loadIcon( "editdelete", KIcon::Small ) ) ); - buttonExport->setIconSet( QIconSet( il->loadIcon( "fileexport", KIcon::Small ) ) ); - buttonImport->setIconSet( QIconSet( il->loadIcon( "fileimport", KIcon::Small ) ) ); + buttonEdit->setIconSet( TQIconSet( il->loadIcon( "edit", KIcon::Small ) ) ); + buttonRemove->setIconSet( TQIconSet( il->loadIcon( "editdelete", KIcon::Small ) ) ); + buttonExport->setIconSet( TQIconSet( il->loadIcon( "fileexport", KIcon::Small ) ) ); + buttonImport->setIconSet( TQIconSet( il->loadIcon( "fileimport", KIcon::Small ) ) ); typeList->setColumnWidth( 0, 22 ); typeList->setColumnWidth( 1, 140 ); @@ -78,23 +78,23 @@ TypesDialog::TypesDialog( QWidget* parent, KigPart& part ) // loading macros... loadAllMacros(); - popup = new QPopupMenu( this ); - popup->insertItem( SmallIcon( "edit" ), i18n( "&Edit..." ), this, SLOT( editType() ) ); - popup->insertItem( SmallIcon( "editdelete" ), i18n( "&Delete" ), this, SLOT( deleteType() ) ); + popup = new TQPopupMenu( this ); + popup->insertItem( SmallIcon( "edit" ), i18n( "&Edit..." ), this, TQT_SLOT( editType() ) ); + popup->insertItem( SmallIcon( "editdelete" ), i18n( "&Delete" ), this, TQT_SLOT( deleteType() ) ); popup->insertSeparator(); - popup->insertItem( SmallIcon( "fileexport" ), i18n( "E&xport..." ), this, SLOT( exportType() ) ); + popup->insertItem( SmallIcon( "fileexport" ), i18n( "E&xport..." ), this, TQT_SLOT( exportType() ) ); // saving types part.saveTypes(); } -QListViewItem* TypesDialog::newListItem( Macro* m ) +TQListViewItem* TypesDialog::newListItem( Macro* m ) { MacroListElement* e = new MacroListElement( typeList, m ); - QCString ifn = m->action->iconFileName(); + TQCString ifn = m->action->iconFileName(); if ( !ifn.isNull() ) { - QPixmap p = il->loadIcon( ifn, KIcon::Small ); + TQPixmap p = il->loadIcon( ifn, KIcon::Small ); e->setPixmap( 0, p ); } return e; @@ -106,8 +106,8 @@ TypesDialog::~TypesDialog() void TypesDialog::helpSlot() { - kapp->invokeHelp( QString::fromLatin1( "working-with-types" ), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "working-with-types" ), + TQString::fromLatin1( "kig" ) ); } void TypesDialog::okSlot() @@ -120,9 +120,9 @@ void TypesDialog::okSlot() void TypesDialog::deleteType() { - std::vector items; + std::vector items; std::vector selectedTypes; - QListViewItemIterator it( typeList ); + TQListViewItemIterator it( typeList ); while ( it.current() ) { if ( ( it.current() )->isSelected() ) { @@ -132,7 +132,7 @@ void TypesDialog::deleteType() ++it; } if (selectedTypes.empty()) return; - QStringList types; + TQStringList types; for ( std::vector::iterator j = selectedTypes.begin(); j != selectedTypes.end(); ++j ) types << ( *j )->action->descriptiveName(); @@ -142,7 +142,7 @@ void TypesDialog::deleteType() types, i18n("Are You Sure?"), KStdGuiItem::cont(), "deleteTypeWarning") == KMessageBox::Cancel ) return; - for ( std::vector::iterator i = items.begin(); i != items.end(); ++i) + for ( std::vector::iterator i = items.begin(); i != items.end(); ++i) { int appel = typeList->itemIndex(*i); assert (appel != -1); @@ -156,7 +156,7 @@ void TypesDialog::deleteType() void TypesDialog::exportType() { std::vector types; - QListViewItemIterator it( typeList ); + TQListViewItemIterator it( typeList ); while ( it.current() ) { if ( ( it.current() )->isSelected() ) { @@ -165,10 +165,10 @@ void TypesDialog::exportType() ++it; } if (types.empty()) return; - QString file_name = KFileDialog::getSaveFileName(":macro", i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Export Types" ) ); + TQString file_name = KFileDialog::getSaveFileName(":macro", i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Export Types" ) ); if ( file_name.isNull() ) return; - QFile fi( file_name ); + TQFile fi( file_name ); if ( fi.exists() ) if ( KMessageBox::warningContinueCancel( this, i18n( "The file \"%1\" already exists. " "Do you wish to overwrite it?" ).arg( fi.name() ), @@ -179,12 +179,12 @@ void TypesDialog::exportType() void TypesDialog::importTypes() { - QStringList file_names = + TQStringList file_names = KFileDialog::getOpenFileNames(":importTypes", i18n("*.kigt|Kig Types Files\n*|All Files"), this, i18n( "Import Types" )); std::vector macros; - for ( QStringList::Iterator i = file_names.begin(); + for ( TQStringList::Iterator i = file_names.begin(); i != file_names.end(); ++i) { std::vector nmacros; @@ -199,9 +199,9 @@ void TypesDialog::importTypes() typeList->insertItem( newListItem( macros[i] ) ); } -QString TypesDialog::fetchIconFromListItem( QListViewItem* i ) +TQString TypesDialog::fetchIconFromListItem( TQListViewItem* i ) { - QListViewItemIterator it( typeList ); + TQListViewItemIterator it( typeList ); Macro* ai = static_cast( i )->getMacro(); while ( it.current() ) { if ( ( it.current() )->isSelected() ) @@ -219,8 +219,8 @@ QString TypesDialog::fetchIconFromListItem( QListViewItem* i ) void TypesDialog::editType() { - std::vector items; - QListViewItemIterator it( typeList ); + std::vector items; + TQListViewItemIterator it( typeList ); while ( it.current() ) { if ( ( it.current() )->isSelected() ) items.push_back( it.current() ); @@ -237,19 +237,19 @@ void TypesDialog::editType() i18n( "More Than One Type Selected" ) ); return; } - QListViewItem* i = items[0]; + TQListViewItem* i = items[0]; EditType* d = new EditType( this, i->text( 1 ), i->text( 2 ), fetchIconFromListItem( i ) ); if ( d->exec() ) { - QString newname = d->name(); - QString newdesc = d->description(); - QString newicon = d->icon(); + TQString newname = d->name(); + TQString newdesc = d->description(); + TQString newicon = d->icon(); Macro* oldmacro = static_cast( i )->getMacro(); // mpart.unplugActionLists(); oldmacro->ctor->setName( newname ); oldmacro->ctor->setDescription( newdesc ); - QCString ncicon( newicon.utf8() ); + TQCString ncicon( newicon.utf8() ); oldmacro->ctor->setIcon( ncicon ); // mpart.plugActionLists(); @@ -260,7 +260,7 @@ void TypesDialog::editType() delete d; } -void TypesDialog::contextMenuRequested( QListViewItem*, const QPoint& p, int ) +void TypesDialog::contextMenuRequested( TQListViewItem*, const TQPoint& p, int ) { popup->exec( p ); } diff --git a/kig/modes/typesdialog.h b/kig/modes/typesdialog.h index 6f0e4702..2e914bcd 100644 --- a/kig/modes/typesdialog.h +++ b/kig/modes/typesdialog.h @@ -25,7 +25,7 @@ #include "../misc/lists.h" -#include +#include #include #include @@ -43,9 +43,9 @@ class TypesDialog : public TypesDialogBase // necessary because some MacroList functions need it.. KigPart& mpart; const KIconLoader* il; - QPopupMenu* popup; + TQPopupMenu* popup; public: - TypesDialog( QWidget* parent, KigPart& ); + TypesDialog( TQWidget* parent, KigPart& ); ~TypesDialog(); public slots: @@ -58,11 +58,11 @@ protected slots: void exportType(); void importTypes(); void editType(); - void contextMenuRequested( QListViewItem* i, const QPoint& p, int c ); + void contextMenuRequested( TQListViewItem* i, const TQPoint& p, int c ); private: - QListViewItem* newListItem( Macro* m ); - QString fetchIconFromListItem( QListViewItem* i ); + TQListViewItem* newListItem( Macro* m ); + TQString fetchIconFromListItem( TQListViewItem* i ); void loadAllMacros(); typedef MacroList::vectype vec; }; diff --git a/kig/objects/angle_type.cc b/kig/objects/angle_type.cc index 89a17131..7b86411b 100644 --- a/kig/objects/angle_type.cc +++ b/kig/objects/angle_type.cc @@ -33,7 +33,7 @@ #include #include -#include +#include static const char* constructanglethroughpoint = I18N_NOOP( "Construct an angle through this point" ); @@ -97,9 +97,9 @@ const ObjectImpType* AngleType::resultId() const return AngleImp::stype(); } -QStringList AngleType::specialActions() const +TQStringList AngleType::specialActions() const { - QStringList ret; + TQStringList ret; ret << i18n( "Set Si&ze" ); return ret; } diff --git a/kig/objects/angle_type.h b/kig/objects/angle_type.h index 796143b4..e885bdbe 100644 --- a/kig/objects/angle_type.h +++ b/kig/objects/angle_type.h @@ -31,7 +31,7 @@ public: ObjectImp* calc( const Args& args, const KigDocument& ) const; const ObjectImpType* resultId() const; - QStringList specialActions() const; + TQStringList specialActions() const; void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& c, KigPart& d, KigWidget& w, NormalMode& m ) const; }; diff --git a/kig/objects/arc_type.cc b/kig/objects/arc_type.cc index f6c660f2..59d38054 100644 --- a/kig/objects/arc_type.cc +++ b/kig/objects/arc_type.cc @@ -36,7 +36,7 @@ using std::find; -#include +#include static const char constructarcstartingstat[] = I18N_NOOP( "Construct an arc starting at this point" ); diff --git a/kig/objects/bogus_imp.cc b/kig/objects/bogus_imp.cc index c1ed6526..b7b8f41e 100644 --- a/kig/objects/bogus_imp.cc +++ b/kig/objects/bogus_imp.cc @@ -17,8 +17,8 @@ #include "bogus_imp.h" -#include -#include +#include +#include #include #include "../misc/rect.h" @@ -52,7 +52,7 @@ IntImp::IntImp( const int d ) { } -StringImp::StringImp( const QString& d ) +StringImp::StringImp( const TQString& d ) : mdata( d ) { } @@ -86,22 +86,22 @@ InvalidImp::InvalidImp() { } -void InvalidImp::fillInNextEscape( QString& s, const KigDocument& ) const +void InvalidImp::fillInNextEscape( TQString& s, const KigDocument& ) const { s = s.arg( "[invalid]" ); } -void DoubleImp::fillInNextEscape( QString& s, const KigDocument& ) const +void DoubleImp::fillInNextEscape( TQString& s, const KigDocument& ) const { s = s.arg( mdata ); } -void IntImp::fillInNextEscape( QString& s, const KigDocument& ) const +void IntImp::fillInNextEscape( TQString& s, const KigDocument& ) const { s = s.arg( mdata ); } -void StringImp::fillInNextEscape( QString& s, const KigDocument& ) const +void StringImp::fillInNextEscape( TQString& s, const KigDocument& ) const { s = s.arg( mdata ); } @@ -300,7 +300,7 @@ const ObjectImpType* TestResultImp::stype() } -TestResultImp::TestResultImp( const QString& s ) +TestResultImp::TestResultImp( const TQString& s ) : mdata( s ) { } diff --git a/kig/objects/bogus_imp.h b/kig/objects/bogus_imp.h index 8e9386a8..c8f3ee2b 100644 --- a/kig/objects/bogus_imp.h +++ b/kig/objects/bogus_imp.h @@ -22,7 +22,7 @@ #include "../misc/object_hierarchy.h" #include "../misc/kigtransform.h" -#include +#include /** * This is the base class for the so-called BogusImp's. These @@ -78,7 +78,7 @@ public: void visit( ObjectImpVisitor* vtor ) const; bool canFillInNextEscape() const; - void fillInNextEscape( QString& s, const KigDocument& ) const; + void fillInNextEscape( TQString& s, const KigDocument& ) const; bool equals( const ObjectImp& rhs ) const; }; @@ -117,7 +117,7 @@ public: void visit( ObjectImpVisitor* vtor ) const; bool canFillInNextEscape() const; - void fillInNextEscape( QString& s, const KigDocument& ) const; + void fillInNextEscape( TQString& s, const KigDocument& ) const; bool equals( const ObjectImp& rhs ) const; }; @@ -156,7 +156,7 @@ public: void visit( ObjectImpVisitor* vtor ) const; bool canFillInNextEscape() const; - void fillInNextEscape( QString& s, const KigDocument& ) const; + void fillInNextEscape( TQString& s, const KigDocument& ) const; bool equals( const ObjectImp& rhs ) const; }; @@ -167,7 +167,7 @@ public: class StringImp : public BogusImp { - QString mdata; + TQString mdata; public: /** * Returns the ObjectImpType representing the StringImp type.. @@ -178,16 +178,16 @@ public: /** * Construct a new StringImp containing the string d. */ - StringImp( const QString& d ); + StringImp( const TQString& d ); /** * Get hold of the contained data. */ - const QString& data() const { return mdata; } + const TQString& data() const { return mdata; } /** * Set the contained data. */ - void setData( const QString& s ) { mdata = s; } + void setData( const TQString& s ) { mdata = s; } StringImp* copy() const; @@ -195,7 +195,7 @@ public: void visit( ObjectImpVisitor* vtor ) const; bool canFillInNextEscape() const; - void fillInNextEscape( QString& s, const KigDocument& ) const; + void fillInNextEscape( TQString& s, const KigDocument& ) const; bool equals( const ObjectImp& rhs ) const; }; @@ -253,16 +253,16 @@ public: class TestResultImp : public BogusImp { - const QString mdata; + const TQString mdata; public: static const ObjectImpType* stype(); typedef BogusImp Parent; - TestResultImp( const QString& s ); + TestResultImp( const TQString& s ); TestResultImp* copy() const; - const QString& data() const { return mdata; } + const TQString& data() const { return mdata; } const ObjectImpType* type() const; void visit( ObjectImpVisitor* vtor ) const; diff --git a/kig/objects/circle_imp.cc b/kig/objects/circle_imp.cc index 13ceef93..38522c22 100644 --- a/kig/objects/circle_imp.cc +++ b/kig/objects/circle_imp.cc @@ -231,18 +231,18 @@ double CircleImp::circumference() const return 2 * M_PI * radius(); } -QString CircleImp::polarEquationString( const KigDocument& w ) const +TQString CircleImp::polarEquationString( const KigDocument& w ) const { - QString ret = i18n( "rho = %1 [centered at %2]" ); + TQString ret = i18n( "rho = %1 [centered at %2]" ); ConicPolarData data = polarData(); ret = ret.arg( data.pdimen, 0, 'g', 3 ); ret = ret.arg( w.coordinateSystem().fromScreen( data.focus1, w ) ); return ret; } -QString CircleImp::cartesianEquationString( const KigDocument& ) const +TQString CircleImp::cartesianEquationString( const KigDocument& ) const { - QString ret = i18n( "x² + y² + %1 x + %2 y + %3 = 0" ); + TQString ret = i18n( "x² + y² + %1 x + %2 y + %3 = 0" ); ConicCartesianData data = cartesianData(); ret = ret.arg( data.coeffs[3], 0, 'g', 3 ); ret = ret.arg( data.coeffs[4], 0, 'g', 3 ); @@ -250,9 +250,9 @@ QString CircleImp::cartesianEquationString( const KigDocument& ) const return ret; } -QString CircleImp::simplyCartesianEquationString( const KigDocument& ) const +TQString CircleImp::simplyCartesianEquationString( const KigDocument& ) const { - QString ret = i18n( "( x - %1 )² + ( y - %2 )² = %3" ); + TQString ret = i18n( "( x - %1 )² + ( y - %2 )² = %3" ); ret = ret.arg( mcenter.x, 0, 'g', 3 ); ret = ret.arg( mcenter.y, 0, 'g', 3 ); ret = ret.arg( mradius * mradius, 0, 'g', 3 ); diff --git a/kig/objects/circle_imp.h b/kig/objects/circle_imp.h index d38716a6..1ccede6a 100644 --- a/kig/objects/circle_imp.h +++ b/kig/objects/circle_imp.h @@ -107,17 +107,17 @@ public: * Return a string containing the cartesian equation of this circle. * This will be of the form "x^2 + y^2 + a x + b y + c = 0" */ - QString cartesianEquationString( const KigDocument& w ) const; + TQString cartesianEquationString( const KigDocument& w ) const; /** * Return a string containing the cartesian equation of this circle. * This will be of the form "( x - x0 )^2 + ( y - y0 )^2 = r^2" */ - QString simplyCartesianEquationString( const KigDocument& w ) const; + TQString simplyCartesianEquationString( const KigDocument& w ) const; /** * Return a string containing the polar equation of this circle. * This will be of the form "rho = r [centered at p]" */ - QString polarEquationString( const KigDocument& w ) const; + TQString polarEquationString( const KigDocument& w ) const; bool equals( const ObjectImp& rhs ) const; }; diff --git a/kig/objects/common.h b/kig/objects/common.h index a26a92cd..f876315f 100644 --- a/kig/objects/common.h +++ b/kig/objects/common.h @@ -20,9 +20,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -47,7 +47,7 @@ class ScreenInfo; class Transformation; typedef std::vector Args; -typedef QValueList QCStringList; +typedef TQValueList QCStringList; template void delete_all( T begin, T end ) diff --git a/kig/objects/conic_imp.cc b/kig/objects/conic_imp.cc index a65d8511..81331522 100644 --- a/kig/objects/conic_imp.cc +++ b/kig/objects/conic_imp.cc @@ -184,7 +184,7 @@ int ConicImp::conicType() const return 0; } -QString ConicImp::conicTypeString() const +TQString ConicImp::conicTypeString() const { switch (conicType()) { @@ -200,9 +200,9 @@ QString ConicImp::conicTypeString() const } } -QString ConicImp::cartesianEquationString( const KigDocument& ) const +TQString ConicImp::cartesianEquationString( const KigDocument& ) const { - QString ret = i18n( "%1 x² + %2 y² + %3 xy + %4 x + %5 y + %6 = 0" ); + TQString ret = i18n( "%1 x² + %2 y² + %3 xy + %4 x + %5 y + %6 = 0" ); ConicCartesianData data = cartesianData(); ret = ret.arg( data.coeffs[0], 0, 'g', 3 ); ret = ret.arg( data.coeffs[1], 0, 'g', 3 ); @@ -213,9 +213,9 @@ QString ConicImp::cartesianEquationString( const KigDocument& ) const return ret; } -QString ConicImp::polarEquationString( const KigDocument& w ) const +TQString ConicImp::polarEquationString( const KigDocument& w ) const { - QString ret = i18n( "rho = %1/(1 + %2 cos theta + %3 sin theta)\n [centered at %4]" ); + TQString ret = i18n( "rho = %1/(1 + %2 cos theta + %3 sin theta)\n [centered at %4]" ); const ConicPolarData data = polarData(); ret = ret.arg( data.pdimen, 0, 'g', 3 ); diff --git a/kig/objects/conic_imp.h b/kig/objects/conic_imp.h index 55ba65ca..29068a7b 100644 --- a/kig/objects/conic_imp.h +++ b/kig/objects/conic_imp.h @@ -82,18 +82,18 @@ public: /** * A string containing "Hyperbola", "Parabola" or "Ellipse". */ - virtual QString conicTypeString() const; + virtual TQString conicTypeString() const; /** * A string containing the cartesian equation of the conic. This * will be of the form "a x^2 + b y^2 + c xy + d x + e y + f = 0". */ - virtual QString cartesianEquationString( const KigDocument& w ) const; + virtual TQString cartesianEquationString( const KigDocument& w ) const; /** * A string containing the polar equation of the conic. This will * be of the form "rho = pdimen/(1 + ect cos( theta ) + est sin( * theta ) )\n [centered at p]" */ - virtual QString polarEquationString( const KigDocument& w ) const; + virtual TQString polarEquationString( const KigDocument& w ) const; /** * Return the cartesian representation of this conic. */ diff --git a/kig/objects/conic_types.cc b/kig/objects/conic_types.cc index 6e32f844..34396369 100644 --- a/kig/objects/conic_types.cc +++ b/kig/objects/conic_types.cc @@ -663,9 +663,9 @@ const ObjectImpType* ConicRadicalType::resultId() const return LineImp::stype(); } -QStringList ConicRadicalType::specialActions() const +TQStringList ConicRadicalType::specialActions() const { - QStringList ret; + TQStringList ret; ret << i18n( "Switch Radical Lines" ); return ret; } diff --git a/kig/objects/conic_types.h b/kig/objects/conic_types.h index e2a1881d..858ca057 100644 --- a/kig/objects/conic_types.h +++ b/kig/objects/conic_types.h @@ -175,7 +175,7 @@ public: static const ConicRadicalType* instance(); ObjectImp* calc( const Args& parents, const KigDocument& ) const; const ObjectImpType* resultId() const; - QStringList specialActions() const; + TQStringList specialActions() const; void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& t, KigPart& d, KigWidget& w, NormalMode& m ) const; }; diff --git a/kig/objects/cubic_imp.cc b/kig/objects/cubic_imp.cc index 51bb5d9f..3879c5d9 100644 --- a/kig/objects/cubic_imp.cc +++ b/kig/objects/cubic_imp.cc @@ -406,7 +406,7 @@ Rect CubicImp::surroundingRect() const return Rect::invalidRect(); } -QString CubicImp::cartesianEquationString( const KigDocument& ) const +TQString CubicImp::cartesianEquationString( const KigDocument& ) const { /* * unfortunately QStrings.arg method is limited to %1, %9, so we cannot @@ -416,7 +416,7 @@ QString CubicImp::cartesianEquationString( const KigDocument& ) const * the equation (removal of zeros, avoid " ... + -1234 x ", etc.) */ - QString ret = i18n( "%6 x³ + %9 y³ + %7 x²y + %8 xy² + %5 y² + %3 x² + %4 xy + %1 x + %2 y" ); + TQString ret = i18n( "%6 x³ + %9 y³ + %7 x²y + %8 xy² + %5 y² + %3 x² + %4 xy + %1 x + %2 y" ); ret = ret.arg( mdata.coeffs[1], 0, 'g', 3 ); ret = ret.arg( mdata.coeffs[2], 0, 'g', 3 ); ret = ret.arg( mdata.coeffs[3], 0, 'g', 3 ); diff --git a/kig/objects/cubic_imp.h b/kig/objects/cubic_imp.h index bb7d89c7..5e9e6a2c 100644 --- a/kig/objects/cubic_imp.h +++ b/kig/objects/cubic_imp.h @@ -43,7 +43,7 @@ public: bool contains( const Coordinate& p, int width, const KigWidget& ) const; bool inRect( const Rect& r, int width, const KigWidget& ) const; Rect surroundingRect() const; - QString cartesianEquationString( const KigDocument& ) const; + TQString cartesianEquationString( const KigDocument& ) const; const uint numberOfProperties() const; const QCStringList properties() const; diff --git a/kig/objects/line_imp.cc b/kig/objects/line_imp.cc index 6f3c6002..a49078a1 100644 --- a/kig/objects/line_imp.cc +++ b/kig/objects/line_imp.cc @@ -174,7 +174,7 @@ double AbstractLineImp::slope() const return diff.y / diff.x; } -const QString AbstractLineImp::equationString() const +const TQString AbstractLineImp::equationString() const { Coordinate p = mdata.a; Coordinate q = mdata.b; @@ -182,9 +182,9 @@ const QString AbstractLineImp::equationString() const double m = ( q.y - p.y ) / ( q.x - p.x ); double r = - ( q.y - p.y ) * p.x / ( q.x - p.x ) + p.y; - QString ret = QString::fromUtf8( "y = %1x " ) + - QString::fromUtf8( r > 0 ? "+" : "-" ) + - QString::fromUtf8( " %2" ); + TQString ret = TQString::fromUtf8( "y = %1x " ) + + TQString::fromUtf8( r > 0 ? "+" : "-" ) + + TQString::fromUtf8( " %2" ); ret = ret.arg( m, 0, 'g', 3 ); ret = ret.arg( abs( r ), 0, 'g', 3 ); diff --git a/kig/objects/line_imp.h b/kig/objects/line_imp.h index c9014613..b12c045d 100644 --- a/kig/objects/line_imp.h +++ b/kig/objects/line_imp.h @@ -66,7 +66,7 @@ public: * Get a string containing the equation of this line in the form "y * = a * x + b ". */ - const QString equationString() const; + const TQString equationString() const; /** * Get the LineData for this AbstractLineImp. */ diff --git a/kig/objects/line_type.cc b/kig/objects/line_type.cc index a2c0734b..a02cc80b 100644 --- a/kig/objects/line_type.cc +++ b/kig/objects/line_type.cc @@ -29,7 +29,7 @@ #include "../misc/common.h" #include "../misc/calcpaths.h" -#include +#include #include @@ -218,9 +218,9 @@ const ObjectImpType* LineParallelLPType::resultId() const return LineImp::stype(); } -QStringList SegmentABType::specialActions() const +TQStringList SegmentABType::specialActions() const { - QStringList ret; + TQStringList ret; ret << i18n( "Set &Length..." ); return ret; } diff --git a/kig/objects/line_type.h b/kig/objects/line_type.h index a3ded322..69a7b3a8 100644 --- a/kig/objects/line_type.h +++ b/kig/objects/line_type.h @@ -33,7 +33,7 @@ public: ObjectImp* calc( const Coordinate& a, const Coordinate& b ) const; const ObjectImpType* resultId() const; - QStringList specialActions() const; + TQStringList specialActions() const; /** * execute the \p i 'th action from the specialActions above.. */ diff --git a/kig/objects/object_drawer.cc b/kig/objects/object_drawer.cc index 0989d4f2..f92fabe7 100644 --- a/kig/objects/object_drawer.cc +++ b/kig/objects/object_drawer.cc @@ -20,8 +20,8 @@ #include "object_imp.h" #include "../misc/kigpainter.h" -#include -#include +#include +#include #include #include @@ -33,7 +33,7 @@ void ObjectDrawer::draw( const ObjectImp& imp, KigPainter& p, bool sel ) const { p.setBrushStyle( Qt::NoBrush ); p.setBrushColor( sel ? Qt::red : ( mshown?mcolor:Qt::gray ) ); - p.setPen( QPen ( sel ? Qt::red : ( mshown?mcolor:Qt::gray ), 1) ); + p.setPen( TQPen ( sel ? Qt::red : ( mshown?mcolor:Qt::gray ), 1) ); p.setWidth( mwidth ); p.setStyle( mstyle ); p.setPointStyle( mpointstyle ); @@ -52,7 +52,7 @@ bool ObjectDrawer::shown( ) const return mshown; } -QColor ObjectDrawer::color() const +TQColor ObjectDrawer::color() const { return mcolor; } @@ -68,7 +68,7 @@ ObjectDrawer* ObjectDrawer::getCopyShown( bool s ) const return ret; } -ObjectDrawer* ObjectDrawer::getCopyColor( const QColor& c ) const +ObjectDrawer* ObjectDrawer::getCopyColor( const TQColor& c ) const { ObjectDrawer* ret = new ObjectDrawer; ret->mcolor = c; @@ -127,7 +127,7 @@ int ObjectDrawer::pointStyle() const return mpointstyle; } -ObjectDrawer::ObjectDrawer( const QColor& color, int width, bool shown, Qt::PenStyle style, int pointStyle ) +ObjectDrawer::ObjectDrawer( const TQColor& color, int width, bool shown, Qt::PenStyle style, int pointStyle ) : mcolor( color ), mshown( shown ), mwidth( width ), mstyle( style ), mpointstyle( pointStyle ) { } @@ -142,7 +142,7 @@ bool ObjectDrawer::inRect( const ObjectImp& imp, const Rect& r, const KigWidget& return mshown && imp.inRect( r, mwidth, w ); } -int ObjectDrawer::pointStyleFromString( const QString& style ) +int ObjectDrawer::pointStyleFromString( const TQString& style ) { if ( style == "Round" ) return 0; @@ -157,7 +157,7 @@ int ObjectDrawer::pointStyleFromString( const QString& style ) return 0; } -QString ObjectDrawer::pointStyleToString() const +TQString ObjectDrawer::pointStyleToString() const { if ( mpointstyle == 0 ) return "Round"; @@ -170,10 +170,10 @@ QString ObjectDrawer::pointStyleToString() const else if ( mpointstyle == 4 ) return "Cross"; assert( false ); - return QString::null; + return TQString::null; } -Qt::PenStyle ObjectDrawer::styleFromString( const QString& style ) +Qt::PenStyle ObjectDrawer::styleFromString( const TQString& style ) { if ( style == "SolidLine" ) return Qt::SolidLine; @@ -188,7 +188,7 @@ Qt::PenStyle ObjectDrawer::styleFromString( const QString& style ) else return Qt::SolidLine; } -QString ObjectDrawer::styleToString() const +TQString ObjectDrawer::styleToString() const { if ( mstyle == Qt::SolidLine ) return "SolidLine"; diff --git a/kig/objects/object_drawer.h b/kig/objects/object_drawer.h index 2781acdc..6206522e 100644 --- a/kig/objects/object_drawer.h +++ b/kig/objects/object_drawer.h @@ -18,8 +18,8 @@ #ifndef KIG_OBJECTS_OBJECT_DRAWER_H #define KIG_OBJECTS_OBJECT_DRAWER_H -#include -#include +#include +#include class ObjectImp; class KigPainter; @@ -45,7 +45,7 @@ class Rect; */ class ObjectDrawer { - QColor mcolor; + TQColor mcolor; bool mshown; int mwidth; Qt::PenStyle mstyle; @@ -57,7 +57,7 @@ public: * and pointstyle ( 0 ) */ ObjectDrawer(); - ObjectDrawer( const QColor& color, int width = -1, bool shown = true, Qt::PenStyle = Qt::SolidLine, int pointStyle = 0 ); + ObjectDrawer( const TQColor& color, int width = -1, bool shown = true, Qt::PenStyle = Qt::SolidLine, int pointStyle = 0 ); /** * Draw the object \p imp on kigpainter \p p . If \p selected is true, it is * drawn in red, otherwise in its normal color. @@ -83,7 +83,7 @@ public: /** * returns the color that the object will be drawn in */ - QColor color() const; + TQColor color() const; /** * return the width of the object */ @@ -99,11 +99,11 @@ public: /** * return pointStyle trasnformed in a string */ - QString pointStyleToString() const; + TQString pointStyleToString() const; /** * return style trasnformed in a string */ - QString styleToString() const; + TQString styleToString() const; /** * returns a new ObjectDrawer that is identical to this one.. except * that the shown state is set to \p s .. @@ -113,7 +113,7 @@ public: * returns a new ObjectDrawer that is identical to this one.. except * that the color is set to \p c .. */ - ObjectDrawer* getCopyColor( const QColor& c ) const; + ObjectDrawer* getCopyColor( const TQColor& c ) const; /** * returns a new ObjectDrawer that is identical to this one.. except * that the width is set to \p w .. @@ -134,13 +134,13 @@ public: * the given \p style string is unknown. In that case it returns a * default value. */ - static int pointStyleFromString( const QString& style ); + static int pointStyleFromString( const TQString& style ); /** * Note that this returns a valid style in every case, even if the * given \p style string is unknown. In that case it returns a default * value. */ - static Qt::PenStyle styleFromString( const QString& style ); + static Qt::PenStyle styleFromString( const TQString& style ); }; #endif diff --git a/kig/objects/object_factory.cc b/kig/objects/object_factory.cc index a54e01f0..f2957a7e 100644 --- a/kig/objects/object_factory.cc +++ b/kig/objects/object_factory.cc @@ -178,7 +178,7 @@ ObjectHolder* ObjectFactory::locus( ObjectCalcer* a, ObjectCalcer* b ) const } ObjectHolder* ObjectFactory::label( - const QString& s, const Coordinate& loc, + const TQString& s, const Coordinate& loc, bool needframe, const std::vector& parents, const KigDocument& doc ) const { @@ -186,7 +186,7 @@ ObjectHolder* ObjectFactory::label( } ObjectTypeCalcer* ObjectFactory::labelCalcer( - const QString& s, const Coordinate& loc, + const TQString& s, const Coordinate& loc, bool needframe, const std::vector& parents, const KigDocument& doc ) const { @@ -194,7 +194,7 @@ ObjectTypeCalcer* ObjectFactory::labelCalcer( } ObjectTypeCalcer* ObjectFactory::attachedLabelCalcer( - const QString& s, ObjectCalcer* p, + const TQString& s, ObjectCalcer* p, const Coordinate& loc, bool needframe, const std::vector& nparents, const KigDocument& doc ) const @@ -266,7 +266,7 @@ ObjectCalcer* ObjectFactory::getAttachPoint( } ObjectHolder* ObjectFactory::attachedLabel( - const QString& s, ObjectCalcer* locationparent, + const TQString& s, ObjectCalcer* locationparent, const Coordinate& loc, bool needframe, const std::vector& parents, const KigDocument& doc ) const diff --git a/kig/objects/object_factory.h b/kig/objects/object_factory.h index 0ce6ce62..30f080d9 100644 --- a/kig/objects/object_factory.h +++ b/kig/objects/object_factory.h @@ -98,11 +98,11 @@ public: * is calced already... */ ObjectHolder* label( - const QString& s, const Coordinate& loc, + const TQString& s, const Coordinate& loc, bool needframe, const std::vector& parents, const KigDocument& doc ) const; ObjectTypeCalcer* labelCalcer( - const QString& s, const Coordinate& loc, + const TQString& s, const Coordinate& loc, bool needframe, const std::vector& parents, const KigDocument& doc ) const; @@ -111,7 +111,7 @@ public: * attached to locationparent if it is non-null.. */ ObjectTypeCalcer* attachedLabelCalcer( - const QString& s, ObjectCalcer* locationparent, + const TQString& s, ObjectCalcer* locationparent, const Coordinate& loc, bool needframe, const std::vector& parents, const KigDocument& doc ) const; @@ -125,7 +125,7 @@ public: const Coordinate& loc, const KigDocument& doc ) const; ObjectHolder* attachedLabel( - const QString& s, ObjectCalcer* locationparent, + const TQString& s, ObjectCalcer* locationparent, const Coordinate& loc, bool needframe, const std::vector& parents, const KigDocument& doc ) const; diff --git a/kig/objects/object_holder.cc b/kig/objects/object_holder.cc index 5a2c0765..70e1100b 100644 --- a/kig/objects/object_holder.cc +++ b/kig/objects/object_holder.cc @@ -137,7 +137,7 @@ bool ObjectHolder::shown( ) const return mdrawer->shown( ); } -const QString ObjectHolder::name() const +const TQString ObjectHolder::name() const { if ( mnamecalcer ) { @@ -145,7 +145,7 @@ const QString ObjectHolder::name() const return static_cast( mnamecalcer->imp() )->data(); } else - return QString::null; + return TQString::null; } void ObjectHolder::setNameCalcer( ObjectConstCalcer* namecalcer ) @@ -154,9 +154,9 @@ void ObjectHolder::setNameCalcer( ObjectConstCalcer* namecalcer ) mnamecalcer = namecalcer; } -QString ObjectHolder::selectStatement() const +TQString ObjectHolder::selectStatement() const { - const QString n = name(); + const TQString n = name(); if ( n.isEmpty() ) return i18n( imp()->type()->selectStatement() ); else diff --git a/kig/objects/object_holder.h b/kig/objects/object_holder.h index 9b30453d..0afd3892 100644 --- a/kig/objects/object_holder.h +++ b/kig/objects/object_holder.h @@ -20,7 +20,7 @@ #include "object_calcer.h" -#include +#include /** * An ObjectHolder represents an object as it is known to the @@ -77,9 +77,9 @@ public: void setNameCalcer( ObjectConstCalcer* namecalcer ); /** - * returns QString::null if no name is set. + * returns TQString::null if no name is set. */ - const QString name() const; + const TQString name() const; /** * Set the ObjectDrawer of this ObjectHolder to \p d , the old * ObjectDrawer is deleted. @@ -139,7 +139,7 @@ public: * "select segment ab" depending on whether this ObjectHolder has a * name. */ - QString selectStatement() const; + TQString selectStatement() const; }; #endif diff --git a/kig/objects/object_imp.cc b/kig/objects/object_imp.cc index 6cb6650f..9a3ee679 100644 --- a/kig/objects/object_imp.cc +++ b/kig/objects/object_imp.cc @@ -27,7 +27,7 @@ class ObjectImpType::StaticPrivate { public: - std::map namemap; + std::map namemap; }; ObjectImp::ObjectImp() @@ -43,7 +43,7 @@ bool ObjectImp::valid() const return ! type()->inherits( InvalidImp::stype() ); } -void ObjectImp::fillInNextEscape( QString&, const KigDocument& ) const +void ObjectImp::fillInNextEscape( TQString&, const KigDocument& ) const { assert( false ); } @@ -215,7 +215,7 @@ const char* ObjectImpType::internalName() const return minternalname; } -QString ObjectImpType::translatedName() const +TQString ObjectImpType::translatedName() const { return i18n( mtranslatedname ); } @@ -230,25 +230,25 @@ const char* ObjectImpType::selectNameStatement() const return mselectnamestatement; } -QString ObjectImpType::removeAStatement() const +TQString ObjectImpType::removeAStatement() const { return i18n( mremoveastatement ); } -QString ObjectImpType::addAStatement() const +TQString ObjectImpType::addAStatement() const { return i18n( maddastatement ); } -QString ObjectImpType::moveAStatement() const +TQString ObjectImpType::moveAStatement() const { return i18n( mmoveastatement ); } const ObjectImpType* ObjectImpType::typeFromInternalName( const char* string ) { - QCString s( string ); - std::map::iterator i = sd()->namemap.find( s ); + TQCString s( string ); + std::map::iterator i = sd()->namemap.find( s ); if ( i == sd()->namemap.end() ) return 0; else return i->second; @@ -286,17 +286,17 @@ bool ObjectImp::isCache() const return false; } -QString ObjectImpType::attachToThisStatement() const +TQString ObjectImpType::attachToThisStatement() const { return i18n( mattachtothisstatement ); } -QString ObjectImpType::showAStatement() const +TQString ObjectImpType::showAStatement() const { return i18n( mshowastatement ); } -QString ObjectImpType::hideAStatement() const +TQString ObjectImpType::hideAStatement() const { return i18n( mhideastatement ); } diff --git a/kig/objects/object_imp.h b/kig/objects/object_imp.h index 2c032f99..eaf29328 100644 --- a/kig/objects/object_imp.h +++ b/kig/objects/object_imp.h @@ -158,7 +158,7 @@ public: /** * The name of this type, translated to the currently used language. */ - QString translatedName() const; + TQString translatedName() const; /** * Returns a translatable string of the form "Select this %1". * E.g. "Select this segment". Note that users of this function @@ -178,35 +178,35 @@ public: * Returns a translated string of the form "Remove a xxx". * E.g. "Remove a Segment". */ - QString removeAStatement() const; + TQString removeAStatement() const; /** * Returns a translated string of the form "Add a xxx". * E.g. "Add a Segment". */ - QString addAStatement() const; + TQString addAStatement() const; /** * Returns a translated string of the form "Move a xxx". * E.g. "Move a Segment". */ - QString moveAStatement() const; + TQString moveAStatement() const; /** * Returns a translated string of the form "Attach to this xxx". * E.g. "Attach to this segment". * \internal This is used by the text label construction mode */ - QString attachToThisStatement() const; + TQString attachToThisStatement() const; /** * Returns a translated string of the form "Show a xxx". * E.g. "Show a Segment". */ - QString showAStatement() const; + TQString showAStatement() const; /** * Returns a translated string of the form "Hide a xxx". * E.g. "Hide a Segment". */ - QString hideAStatement() const; + TQString hideAStatement() const; }; /** @@ -328,7 +328,7 @@ public: // s is a string with at least one escape ( "%N" where N is a // number ) somewhere. This function replaces the first escape it - // sees with the "value" of this imp ( using the QString::arg + // sees with the "value" of this imp ( using the TQString::arg // functions ). This is e.g. used by TextType to turn its variable // args into strings.. // if you implement this, then you should return true in @@ -336,7 +336,7 @@ public: // override fillInNextEscape() ( standard implementation does an // assert( false ) ).. virtual bool canFillInNextEscape() const; - virtual void fillInNextEscape( QString& s, const KigDocument& ) const; + virtual void fillInNextEscape( TQString& s, const KigDocument& ) const; /** * Returns true if this ObjectImp is equal to rhs. diff --git a/kig/objects/object_imp_factory.cc b/kig/objects/object_imp_factory.cc index bfeb1358..65cd9c94 100644 --- a/kig/objects/object_imp_factory.cc +++ b/kig/objects/object_imp_factory.cc @@ -30,7 +30,7 @@ #include "../misc/coordinate.h" -#include +#include #include @@ -48,94 +48,94 @@ ObjectImpFactory::~ObjectImpFactory() { } -static void addXYElements( const Coordinate& c, QDomElement& parent, QDomDocument& doc ) +static void addXYElements( const Coordinate& c, TQDomElement& parent, TQDomDocument& doc ) { - QDomElement xe = doc.createElement( "x" ); + TQDomElement xe = doc.createElement( "x" ); xe.appendChild( doc.createTextNode( - QString::number( c.x ) ) ); + TQString::number( c.x ) ) ); parent.appendChild( xe ); - QDomElement ye = doc.createElement( "y" ); + TQDomElement ye = doc.createElement( "y" ); ye.appendChild( doc.createTextNode( - QString::number( c.y ) ) ); + TQString::number( c.y ) ) ); parent.appendChild( ye ); } -static void addDoubleElement( const char* name, double d, QDomElement& parent, QDomDocument& doc ) +static void addDoubleElement( const char* name, double d, TQDomElement& parent, TQDomDocument& doc ) { - QDomElement e = doc.createElement( name ); - e.appendChild( doc.createTextNode( QString::number( d ) ) ); + TQDomElement e = doc.createElement( name ); + e.appendChild( doc.createTextNode( TQString::number( d ) ) ); parent.appendChild( e ); } -static void addCoordinateElement( const char* name, const Coordinate& d, QDomElement& p, QDomDocument& doc ) +static void addCoordinateElement( const char* name, const Coordinate& d, TQDomElement& p, TQDomDocument& doc ) { - QDomElement e = doc.createElement( name ); + TQDomElement e = doc.createElement( name ); addXYElements( d, e, doc ); p.appendChild( e ); } -QString ObjectImpFactory::serialize( const ObjectImp& d, QDomElement& parent, - QDomDocument& doc ) const +TQString ObjectImpFactory::serialize( const ObjectImp& d, TQDomElement& parent, + TQDomDocument& doc ) const { if( d.inherits( IntImp::stype() ) ) { parent.appendChild( doc.createTextNode( - QString::number( static_cast( d ).data() ) ) ); - return QString::fromLatin1( "int" ); + TQString::number( static_cast( d ).data() ) ) ); + return TQString::fromLatin1( "int" ); } else if ( d.inherits( DoubleImp::stype() ) ) { parent.appendChild( doc.createTextNode( - QString::number( static_cast( d ).data() ) ) ); - return QString::fromLatin1( "double" ); + TQString::number( static_cast( d ).data() ) ) ); + return TQString::fromLatin1( "double" ); } else if( d.inherits( StringImp::stype() ) ) { parent.appendChild( doc.createTextNode( static_cast( d ).data() ) ); - return QString::fromLatin1( "string" ); + return TQString::fromLatin1( "string" ); } else if ( d.inherits( TestResultImp::stype() ) ) { parent.appendChild( doc.createTextNode( static_cast( d ).data() ) ); - return QString::fromLatin1( "testresult" ); + return TQString::fromLatin1( "testresult" ); } else if( d.inherits( HierarchyImp::stype() ) ) { static_cast( d ).data().serialize( parent, doc ); - return QString::fromLatin1( "hierarchy" ); + return TQString::fromLatin1( "hierarchy" ); } else if ( d.inherits( TransformationImp::stype() ) ) { const Transformation& trans = static_cast( d ).data(); - QDomElement matrixe = doc.createElement( "matrix" ); + TQDomElement matrixe = doc.createElement( "matrix" ); for ( int i = 0; i < 3; ++i ) { for ( int j = 0; j < 3; ++j ) { - QDomElement elel = doc.createElement( "element" ); - elel.setAttribute( "row", QString::number( i ) ); - elel.setAttribute( "column", QString::number( j ) ); - elel.appendChild( doc.createTextNode( QString::number( trans.data( i, j ) ) ) ); + TQDomElement elel = doc.createElement( "element" ); + elel.setAttribute( "row", TQString::number( i ) ); + elel.setAttribute( "column", TQString::number( j ) ); + elel.appendChild( doc.createTextNode( TQString::number( trans.data( i, j ) ) ) ); matrixe.appendChild( elel ); }; } parent.appendChild( matrixe ); - QDomElement homothetye = doc.createElement( "homothetic" ); + TQDomElement homothetye = doc.createElement( "homothetic" ); const char* ishomothety = trans.isHomothetic() ? "true" : "false"; homothetye.appendChild( doc.createTextNode( ishomothety ) ); parent.appendChild( homothetye ); - return QString::fromLatin1( "transformation" ); + return TQString::fromLatin1( "transformation" ); } else if( d.inherits( AbstractLineImp::stype() ) ) { @@ -143,28 +143,28 @@ QString ObjectImpFactory::serialize( const ObjectImp& d, QDomElement& parent, addCoordinateElement( "a", l.a, parent, doc ); addCoordinateElement( "b", l.b, parent, doc ); if( d.inherits( SegmentImp::stype() ) ) - return QString::fromLatin1( "segment" ); + return TQString::fromLatin1( "segment" ); else if( d.inherits( RayImp::stype() ) ) - return QString::fromLatin1( "ray" ); - else return QString::fromLatin1( "line" ); + return TQString::fromLatin1( "ray" ); + else return TQString::fromLatin1( "line" ); } else if( d.inherits( PointImp::stype() ) ) { addXYElements( static_cast( d ).coordinate(), parent, doc ); - return QString::fromLatin1( "point" ); + return TQString::fromLatin1( "point" ); } else if( d.inherits( TextImp::stype() ) ) { - QString text = static_cast( d ).text(); + TQString text = static_cast( d ).text(); parent.appendChild( doc.createTextNode( text ) ); - return QString::fromLatin1( "text" ); + return TQString::fromLatin1( "text" ); } else if( d.inherits( AngleImp::stype() ) ) { addDoubleElement( "size", static_cast( d ).size(), parent, doc ); - return QString::fromLatin1( "angle" ); + return TQString::fromLatin1( "angle" ); } else if ( d.inherits( ArcImp::stype() ) ) { @@ -173,38 +173,38 @@ QString ObjectImpFactory::serialize( const ObjectImp& d, QDomElement& parent, addDoubleElement( "radius", a.radius(), parent, doc ); addDoubleElement( "startangle", a.startAngle(), parent, doc ); addDoubleElement( "angle", a.angle(), parent, doc ); - return QString::fromLatin1( "arc" ); + return TQString::fromLatin1( "arc" ); } else if( d.inherits( VectorImp::stype() ) ) { Coordinate dir = static_cast( d ).dir(); addXYElements( dir, parent, doc ); - return QString::fromLatin1( "vector" ); + return TQString::fromLatin1( "vector" ); } else if( d.inherits( LocusImp::stype() ) ) { const LocusImp& locus = static_cast( d ); // serialize the curve.. - QDomElement curve = doc.createElement( "curve" ); + TQDomElement curve = doc.createElement( "curve" ); const CurveImp& curveimp = *locus.curve(); - QString type = serialize( curveimp, curve, doc ); + TQString type = serialize( curveimp, curve, doc ); curve.setAttribute( "type", type ); parent.appendChild( curve ); // serialize the hierarchy.. - QDomElement hier = doc.createElement( "calculation" ); + TQDomElement hier = doc.createElement( "calculation" ); locus.hierarchy().serialize( hier, doc ); parent.appendChild( hier ); - return QString::fromLatin1( "locus" ); + return TQString::fromLatin1( "locus" ); } else if( d.inherits( CircleImp::stype() ) ) { const CircleImp& c = static_cast( d ); addCoordinateElement( "center", c.center(), parent, doc ); addDoubleElement( "radius", c.radius(), parent, doc ); - return QString::fromLatin1( "circle" ); + return TQString::fromLatin1( "circle" ); } else if( d.inherits( ConicImp::stype() ) ) { @@ -213,12 +213,12 @@ QString ObjectImpFactory::serialize( const ObjectImp& d, QDomElement& parent, addDoubleElement( "pdimen", data.pdimen, parent, doc ); addDoubleElement( "ecostheta0", data.ecostheta0, parent, doc ); addDoubleElement( "esintheta0", data.esintheta0, parent, doc ); - return QString::fromLatin1( "conic" ); + return TQString::fromLatin1( "conic" ); } else if( d.inherits( CubicImp::stype() ) ) { const CubicCartesianData data = static_cast( d ).data(); - QDomElement coeffs = doc.createElement( "coefficients" ); + TQDomElement coeffs = doc.createElement( "coefficients" ); addDoubleElement( "a000", data.coeffs[0], coeffs, doc ); addDoubleElement( "a001", data.coeffs[1], coeffs, doc ); addDoubleElement( "a002", data.coeffs[2], coeffs, doc ); @@ -230,17 +230,17 @@ QString ObjectImpFactory::serialize( const ObjectImp& d, QDomElement& parent, addDoubleElement( "a122", data.coeffs[8], coeffs, doc ); addDoubleElement( "a222", data.coeffs[9], coeffs, doc ); parent.appendChild( coeffs ); - return QString::fromLatin1( "cubic" ); + return TQString::fromLatin1( "cubic" ); } assert( false ); - return QString::null; + return TQString::null; } -static Coordinate readXYElements( const QDomElement& e, bool& ok ) +static Coordinate readXYElements( const TQDomElement& e, bool& ok ) { double x, y; ok = true; - QDomElement xe = e.firstChild().toElement(); + TQDomElement xe = e.firstChild().toElement(); if ( xe.isNull() || xe.tagName() != "x" ) { ok = false; @@ -248,7 +248,7 @@ static Coordinate readXYElements( const QDomElement& e, bool& ok ) } else x = xe.text().toDouble( &ok ); - QDomElement ye = xe.nextSibling().toElement(); + TQDomElement ye = xe.nextSibling().toElement(); if ( ye.isNull() || ye.tagName() != "y" ) { ok = false; @@ -259,10 +259,10 @@ static Coordinate readXYElements( const QDomElement& e, bool& ok ) return Coordinate( x, y ); } -static Coordinate readCoordinateElement( QDomNode n, bool& ok, +static Coordinate readCoordinateElement( TQDomNode n, bool& ok, const char* tagname ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() || e.tagName() != tagname ) { ok = false; @@ -272,10 +272,10 @@ static Coordinate readCoordinateElement( QDomNode n, bool& ok, return readXYElements( e, ok ); } -static double readDoubleElement( QDomNode n, bool& ok, +static double readDoubleElement( TQDomNode n, bool& ok, const char* tagname ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( e.isNull() || e.tagName() != tagname ) { ok = false; @@ -284,9 +284,9 @@ static double readDoubleElement( QDomNode n, bool& ok, return e.text().toDouble( &ok ); } -ObjectImp* ObjectImpFactory::deserialize( const QString& type, - const QDomElement& parent, - QString& error ) const +ObjectImp* ObjectImpFactory::deserialize( const TQString& type, + const TQDomElement& parent, + TQString& error ) const { #define KIG_GENERIC_PARSE_ERROR \ { \ @@ -328,12 +328,12 @@ ObjectImp* ObjectImpFactory::deserialize( const QString& type, { double data[3][3]; bool homothetic = false; - for ( QDomElement childe = parent.firstChild().toElement(); + for ( TQDomElement childe = parent.firstChild().toElement(); ! childe.isNull(); childe = childe.nextSibling().toElement() ) { if ( childe.tagName() == "matrix" ) { - for ( QDomElement elel = childe.firstChild().toElement(); + for ( TQDomElement elel = childe.firstChild().toElement(); ! elel.isNull(); elel = elel.nextSibling().toElement() ) { if ( elel.tagName() != "element" ) KIG_GENERIC_PARSE_ERROR; @@ -363,7 +363,7 @@ ObjectImp* ObjectImpFactory::deserialize( const QString& type, } else if ( type == "line" || type == "segment" || type == "ray" ) { - QDomNode n = parent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate a = readCoordinateElement( n, ok, "a" ); if ( !ok ) KIG_GENERIC_PARSE_ERROR; n = n.nextSibling(); @@ -381,7 +381,7 @@ ObjectImp* ObjectImpFactory::deserialize( const QString& type, } else if ( type == "arc" ) { - QDomNode n = parent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate center = readCoordinateElement( n, ok, "center" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; n = n.nextSibling(); @@ -403,21 +403,21 @@ ObjectImp* ObjectImpFactory::deserialize( const QString& type, } else if( type == "locus" ) { - QDomElement curvee = parent.firstChild().toElement(); + TQDomElement curvee = parent.firstChild().toElement(); if ( curvee.isNull() || curvee.tagName() != "curve" ) KIG_GENERIC_PARSE_ERROR; - QString type = curvee.attribute( "type" ); + TQString type = curvee.attribute( "type" ); ObjectImp* oi = deserialize( type, curvee, error ); if ( ! oi || ! oi->inherits( CurveImp::stype() ) ) KIG_GENERIC_PARSE_ERROR; //CurveImp* curvei = static_cast( oi ); - QDomElement hiere = curvee.nextSibling().toElement(); + TQDomElement hiere = curvee.nextSibling().toElement(); if ( hiere.isNull() || hiere.tagName() != "calculation" ) KIG_GENERIC_PARSE_ERROR; assert( false ); // TODO // return new LocusImp( curvei, hier ); } else if( type == "circle" ) { - QDomNode n = parent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate center = readCoordinateElement( n, ok, "center" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; @@ -429,7 +429,7 @@ ObjectImp* ObjectImpFactory::deserialize( const QString& type, } else if( type == "conic" ) { - QDomNode n = parent.firstChild(); + TQDomNode n = parent.firstChild(); Coordinate focus1 = readCoordinateElement( n, ok, "focus1" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; @@ -450,11 +450,11 @@ ObjectImp* ObjectImpFactory::deserialize( const QString& type, } else if( type == "cubic" ) { - QDomElement coeffse = parent.firstChild().toElement(); + TQDomElement coeffse = parent.firstChild().toElement(); if ( coeffse.isNull() || coeffse.tagName() != "coefficients" ) KIG_GENERIC_PARSE_ERROR; - QDomNode n = coeffse.firstChild(); + TQDomNode n = coeffse.firstChild(); double a000 = readDoubleElement( n, ok, "a000" ); if ( ! ok ) KIG_GENERIC_PARSE_ERROR; diff --git a/kig/objects/object_imp_factory.h b/kig/objects/object_imp_factory.h index 1ab82bb4..1ac08dde 100644 --- a/kig/objects/object_imp_factory.h +++ b/kig/objects/object_imp_factory.h @@ -30,11 +30,11 @@ public: * loads data from \p parent , and returns a new ObjectImp from the type * string \p type . */ - ObjectImp* deserialize( const QString& type, const QDomElement& parent, QString& error ) const; + ObjectImp* deserialize( const TQString& type, const TQDomElement& parent, TQString& error ) const; /** * adds data to \p parent , and returns a type string.. */ - QString serialize( const ObjectImp& d, QDomElement& parent, QDomDocument& doc ) const; + TQString serialize( const ObjectImp& d, TQDomElement& parent, TQDomDocument& doc ) const; }; #endif diff --git a/kig/objects/object_type.cc b/kig/objects/object_type.cc index 9ac2845b..ea85e4f8 100644 --- a/kig/objects/object_type.cc +++ b/kig/objects/object_type.cc @@ -22,7 +22,7 @@ #include "../misc/coordinate.h" -#include +#include #include @@ -86,9 +86,9 @@ bool ObjectType::isTransform() const return false; } -QStringList ObjectType::specialActions() const +TQStringList ObjectType::specialActions() const { - return QStringList(); + return TQStringList(); } void ObjectType::executeAction( int, ObjectHolder&, ObjectTypeCalcer&, KigPart&, KigWidget&, diff --git a/kig/objects/object_type.h b/kig/objects/object_type.h index f0ac49af..54471e46 100644 --- a/kig/objects/object_type.h +++ b/kig/objects/object_type.h @@ -98,7 +98,7 @@ public: /** * return i18n'd names for the special actions.. */ - virtual QStringList specialActions() const; + virtual TQStringList specialActions() const; /** * execute the \p i 'th action from the specialActions above.. */ diff --git a/kig/objects/object_type_factory.cc b/kig/objects/object_type_factory.cc index ee3024fd..a6d527ce 100644 --- a/kig/objects/object_type_factory.cc +++ b/kig/objects/object_type_factory.cc @@ -35,7 +35,7 @@ #include "../scripting/python_type.h" #endif -#include +#include #include ObjectTypeFactory::ObjectTypeFactory() diff --git a/kig/objects/point_imp.cc b/kig/objects/point_imp.cc index 02d4d360..539f98b3 100644 --- a/kig/objects/point_imp.cc +++ b/kig/objects/point_imp.cc @@ -135,7 +135,7 @@ void PointImp::setCoordinate( const Coordinate& c ) mc = c; } -void PointImp::fillInNextEscape( QString& s, const KigDocument& doc ) const +void PointImp::fillInNextEscape( TQString& s, const KigDocument& doc ) const { s = s.arg( doc.coordinateSystem().fromScreen( mc, doc ) ); } diff --git a/kig/objects/point_imp.h b/kig/objects/point_imp.h index a5e8eb98..dac0576c 100644 --- a/kig/objects/point_imp.h +++ b/kig/objects/point_imp.h @@ -72,7 +72,7 @@ public: const ObjectImpType* type() const; void visit( ObjectImpVisitor* vtor ) const; - void fillInNextEscape( QString& s, const KigDocument& ) const; + void fillInNextEscape( TQString& s, const KigDocument& ) const; bool canFillInNextEscape() const; bool equals( const ObjectImp& rhs ) const; diff --git a/kig/objects/point_type.cc b/kig/objects/point_type.cc index 04f8272c..2acd8479 100644 --- a/kig/objects/point_type.cc +++ b/kig/objects/point_type.cc @@ -360,17 +360,17 @@ const ObjectImpType* MidPointType::resultId() const return PointImp::stype(); } -QStringList FixedPointType::specialActions() const +TQStringList FixedPointType::specialActions() const { - QStringList ret; + TQStringList ret; ret << i18n( "Set &Coordinate..." ); ret << i18n( "Redefine" ); return ret; } -QStringList ConstrainedPointType::specialActions() const +TQStringList ConstrainedPointType::specialActions() const { - QStringList ret; + TQStringList ret; ret << i18n( "Set &Parameter..." ); ret << i18n( "Redefine" ); return ret; @@ -395,7 +395,7 @@ void FixedPointType::executeAction( Coordinate oldc = static_cast( o.imp() )->coordinate(); KigInputDialog::getCoordinate( i18n( "Set Coordinate" ), - i18n( "Enter the new coordinate." ) + QString::fromLatin1( "
" ) + + i18n( "Enter the new coordinate." ) + TQString::fromLatin1( "
" ) + d.document().coordinateSystem().coordinateFormatNoticeMarkup(), &w, &ok, d.document(), &oldc ); if ( ! ok ) break; diff --git a/kig/objects/point_type.h b/kig/objects/point_type.h index 231ad6c5..69a7e2e8 100644 --- a/kig/objects/point_type.h +++ b/kig/objects/point_type.h @@ -43,7 +43,7 @@ public: const KigDocument& ) const; const ObjectImpType* resultId() const; - QStringList specialActions() const; + TQStringList specialActions() const; void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& t, KigPart& d, KigWidget& w, NormalMode& m ) const; }; @@ -67,7 +67,7 @@ public: const KigDocument& ) const; const ObjectImpType* resultId() const; -// QStringList specialActions() const; +// TQStringList specialActions() const; // void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& t, // KigPart& d, KigWidget& w, NormalMode& m ) const; }; @@ -112,7 +112,7 @@ public: const KigDocument& ) const; const ObjectImpType* resultId() const; - QStringList specialActions() const; + TQStringList specialActions() const; void executeAction( int i, ObjectHolder&, ObjectTypeCalcer& o, KigPart& d, KigWidget& w, NormalMode& m ) const; }; diff --git a/kig/objects/text_imp.cc b/kig/objects/text_imp.cc index f7b2f1be..32591c16 100644 --- a/kig/objects/text_imp.cc +++ b/kig/objects/text_imp.cc @@ -20,7 +20,7 @@ #include "bogus_imp.h" #include "../misc/kigpainter.h" -TextImp::TextImp( const QString& text, const Coordinate& loc, bool frame ) +TextImp::TextImp( const TQString& text, const Coordinate& loc, bool frame ) : mtext( text), mloc( loc ), mframe( frame ), mboundrect( Rect::invalidRect() ) { } @@ -112,7 +112,7 @@ ObjectImp* TextImp::property( uint which, const KigDocument& w ) const return new InvalidImp; } -QString TextImp::text() const +TQString TextImp::text() const { return mtext; } diff --git a/kig/objects/text_imp.h b/kig/objects/text_imp.h index 8ad92b84..54e33f79 100644 --- a/kig/objects/text_imp.h +++ b/kig/objects/text_imp.h @@ -26,7 +26,7 @@ class TextImp : public ObjectImp { - QString mtext; + TQString mtext; Coordinate mloc; bool mframe; // with this var, we keep track of the place we drew in, for use in @@ -37,7 +37,7 @@ public: static const ObjectImpType* stype(); Coordinate attachPoint() const; - TextImp( const QString& text, const Coordinate& loc, bool frame = false ); + TextImp( const TQString& text, const Coordinate& loc, bool frame = false ); TextImp* copy() const; ~TextImp(); @@ -60,7 +60,7 @@ public: const ObjectImpType* type() const; void visit( ObjectImpVisitor* vtor ) const; - QString text() const; + TQString text() const; const Coordinate coordinate() const; bool hasFrame() const; diff --git a/kig/objects/text_type.cc b/kig/objects/text_type.cc index 6594c05a..214b35c2 100644 --- a/kig/objects/text_type.cc +++ b/kig/objects/text_type.cc @@ -30,8 +30,8 @@ #include -#include -#include +#include +#include #include @@ -87,7 +87,7 @@ ObjectImp* TextType::calc( const Args& parents, const KigDocument& doc ) const int frame = static_cast( firstthree[0] )->data(); bool needframe = frame != 0; const Coordinate t = static_cast( firstthree[1] )->coordinate(); - QString s = static_cast( firstthree[2] )->data(); + TQString s = static_cast( firstthree[2] )->data(); for ( Args::iterator i = varargs.begin(); i != varargs.end(); ++i ) (*i)->fillInNextEscape( s, doc ); @@ -120,9 +120,9 @@ void TextType::move( ObjectTypeCalcer& ourobj, const Coordinate& to, firstthree[1]->move( to, d ); } -QStringList TextType::specialActions() const +TQStringList TextType::specialActions() const { - QStringList ret; + TQStringList ret; ret << i18n( "&Copy Text" ); ret << i18n( "&Toggle Frame" ); ret << i18n( "&Redefine..." ); diff --git a/kig/objects/text_type.h b/kig/objects/text_type.h index 6368cafa..8f97d4ea 100644 --- a/kig/objects/text_type.h +++ b/kig/objects/text_type.h @@ -45,7 +45,7 @@ public: void move( ObjectTypeCalcer& ourobj, const Coordinate& to, const KigDocument& ) const; - QStringList specialActions() const; + TQStringList specialActions() const; void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& c, KigPart& d, KigWidget& w, NormalMode& m ) const; diff --git a/kig/scripting/newscriptwizard.cc b/kig/scripting/newscriptwizard.cc index 165f8e98..de959ce2 100644 --- a/kig/scripting/newscriptwizard.cc +++ b/kig/scripting/newscriptwizard.cc @@ -20,8 +20,8 @@ #include "script_mode.h" -#include -#include +#include +#include //#include //#include @@ -56,7 +56,7 @@ NewScriptWizard::~NewScriptWizard() } } -NewScriptWizard::NewScriptWizard( QWidget* parent, ScriptModeBase* mode ) +NewScriptWizard::NewScriptWizard( TQWidget* parent, ScriptModeBase* mode ) : NewScriptWizardBase( parent, "New Script Wizard" ), mmode( mode ) { @@ -97,11 +97,11 @@ NewScriptWizard::NewScriptWizard( QWidget* parent, ScriptModeBase* mode ) KPopupMenu* pm = new KPopupMenu( editor ); // creating the actions for the code editor... KActionCollection* ac = new KActionCollection( editor ); - KAction* undoAction = KStdAction::undo( this, SLOT( slotUndo() ), ac ); - KAction* redoAction = KStdAction::redo( this, SLOT( slotRedo() ), ac ); - KAction* cutAction = KStdAction::cut( this, SLOT( slotCut() ), ac ); - KAction* copyAction = KStdAction::copy( this, SLOT( slotCopy() ), ac ); - KAction* pasteAction = KStdAction::paste( this, SLOT( slotPaste() ), ac ); + KAction* undoAction = KStdAction::undo( this, TQT_SLOT( slotUndo() ), ac ); + KAction* redoAction = KStdAction::redo( this, TQT_SLOT( slotRedo() ), ac ); + KAction* cutAction = KStdAction::cut( this, TQT_SLOT( slotCut() ), ac ); + KAction* copyAction = KStdAction::copy( this, TQT_SLOT( slotCopy() ), ac ); + KAction* pasteAction = KStdAction::paste( this, TQT_SLOT( slotPaste() ), ac ); // ... and plugging them into the popup menu (to build it, of course :) ) undoAction->plug( pm ); redoAction->plug( pm ); @@ -114,7 +114,7 @@ NewScriptWizard::NewScriptWizard( QWidget* parent, ScriptModeBase* mode ) dynamic_cast( editor )->installPopup( pm ); } - connect( this, SIGNAL( helpClicked() ), this, SLOT( slotHelpClicked() ) ); + connect( this, TQT_SIGNAL( helpClicked() ), this, TQT_SLOT( slotHelpClicked() ) ); } void NewScriptWizard::back() @@ -159,11 +159,11 @@ void NewScriptWizard::accept() void NewScriptWizard::slotHelpClicked() { - kapp->invokeHelp( QString::fromLatin1( "scripting" ), - QString::fromLatin1( "kig" ) ); + kapp->invokeHelp( TQString::fromLatin1( "scripting" ), + TQString::fromLatin1( "kig" ) ); } -void NewScriptWizard::setText( const QString& text ) +void NewScriptWizard::setText( const TQString& text ) { if ( !document ) { @@ -175,7 +175,7 @@ void NewScriptWizard::setText( const QString& text ) } } -QString NewScriptWizard::text() +TQString NewScriptWizard::text() { if ( !document ) { diff --git a/kig/scripting/newscriptwizard.h b/kig/scripting/newscriptwizard.h index 67b51d94..d1831b96 100644 --- a/kig/scripting/newscriptwizard.h +++ b/kig/scripting/newscriptwizard.h @@ -37,15 +37,15 @@ class NewScriptWizard Q_OBJECT ScriptModeBase* mmode; public: - NewScriptWizard( QWidget* parent, ScriptModeBase* mode ); + NewScriptWizard( TQWidget* parent, ScriptModeBase* mode ); ~NewScriptWizard(); void back(); void next(); void reject(); - void setText( const QString& text ); - QString text(); + void setText( const TQString& text ); + TQString text(); void setType( ScriptType::Type type ); diff --git a/kig/scripting/python_type.cc b/kig/scripting/python_type.cc index 0180e828..cc5a00ea 100644 --- a/kig/scripting/python_type.cc +++ b/kig/scripting/python_type.cc @@ -114,7 +114,7 @@ ObjectImp* PythonCompileType::calc( const Args& parents, const KigDocument& ) co if ( !parents[0]->inherits( StringImp::stype() ) ) return new InvalidImp; const StringImp* si = static_cast( parents[0] ); - QString s = si->data(); + TQString s = si->data(); CompiledPythonScript cs = PythonScripter::instance()->compile( s.latin1() ); diff --git a/kig/scripting/python_type.h b/kig/scripting/python_type.h index 1e76b0b8..db623ab6 100644 --- a/kig/scripting/python_type.h +++ b/kig/scripting/python_type.h @@ -55,7 +55,7 @@ public: std::vector sortArgs( const std::vector& args ) const; Args sortArgs( const Args& args ) const; -// virtual QStringList specialActions() const; +// virtual TQStringList specialActions() const; // virtual void executeAction( int i, RealObject* o, KigDocument& d, KigWidget& w, // NormalMode& m ) const; }; diff --git a/kig/scripting/script-common.cc b/kig/scripting/script-common.cc index 4bd2cbd8..2eb2da81 100644 --- a/kig/scripting/script-common.cc +++ b/kig/scripting/script-common.cc @@ -17,7 +17,7 @@ #include "script-common.h" -#include +#include #include #include @@ -35,18 +35,18 @@ static const script_prop scripts_properties[] = { I18N_NOOP( "Now fill in the Python code:" ), "source_py", "Python-Kig" } }; -QString ScriptType::fillCodeStatement( ScriptType::Type type ) +TQString ScriptType::fillCodeStatement( ScriptType::Type type ) { return i18n( scripts_properties[type].fillCodeStatement ); } -QString ScriptType::templateCode( ScriptType::Type type, std::list args ) +TQString ScriptType::templateCode( ScriptType::Type type, std::list args ) { if ( type == Python ) { - QString tempcode = QString::fromLatin1( "def calc( " ); + TQString tempcode = TQString::fromLatin1( "def calc( " ); bool firstarg = true; - QString temparg = i18n( "Note to translators: this should be a default " + TQString temparg = i18n( "Note to translators: this should be a default " "name for an argument in a Python function. The " "default is \"arg%1\" which would become arg1, " "arg2, etc. Give something which seems " @@ -57,7 +57,7 @@ QString ScriptType::templateCode( ScriptType::Type type, std::listname(); + TQString n = ( *i )->name(); tempcode += n.isEmpty() ? temparg.arg( id ) : n; id++; }; @@ -81,9 +81,9 @@ const char* ScriptType::icon( ScriptType::Type type ) return scripts_properties[type].icon; } -QString ScriptType::highlightStyle( ScriptType::Type type ) +TQString ScriptType::highlightStyle( ScriptType::Type type ) { - return QString( scripts_properties[type].highlightStyle ); + return TQString( scripts_properties[type].highlightStyle ); } ScriptType::Type ScriptType::intToType( int type ) diff --git a/kig/scripting/script-common.h b/kig/scripting/script-common.h index 1c384453..360df862 100644 --- a/kig/scripting/script-common.h +++ b/kig/scripting/script-common.h @@ -38,11 +38,11 @@ public: * Returns an i18n'ed statement like 'Now fill in the code:' with * the name of the script language. */ - static QString fillCodeStatement( ScriptType::Type type ); + static TQString fillCodeStatement( ScriptType::Type type ); /** * Returns a template code for a script language. */ - static QString templateCode( ScriptType::Type type, std::list args ); + static TQString templateCode( ScriptType::Type type, std::list args ); /** * Returns the icon's name for a script language. */ @@ -50,7 +50,7 @@ public: /** * Returns the Kate highlight stytle name for a script language. */ - static QString highlightStyle( ScriptType::Type type ); + static TQString highlightStyle( ScriptType::Type type ); /** * Converts an int to a ScriptType::Type. Useful when reading script * types from files. diff --git a/kig/scripting/script_mode.cc b/kig/scripting/script_mode.cc index 000b99f8..adbcc857 100644 --- a/kig/scripting/script_mode.cc +++ b/kig/scripting/script_mode.cc @@ -30,14 +30,14 @@ #include "../objects/bogus_imp.h" #include "../objects/object_imp.h" -#include -#include +#include +#include #include #include #include -void ScriptModeBase::dragRect( const QPoint& p, KigWidget& w ) +void ScriptModeBase::dragRect( const TQPoint& p, KigWidget& w ) { if ( mwawd != SelectingArgs ) return; @@ -60,7 +60,7 @@ void ScriptModeBase::dragRect( const QPoint& p, KigWidget& w ) w.updateWidget(); } -void ScriptModeBase::leftClickedObject( ObjectHolder* o, const QPoint&, +void ScriptModeBase::leftClickedObject( ObjectHolder* o, const TQPoint&, KigWidget& w, bool ) { std::list::iterator dup_o; @@ -84,7 +84,7 @@ void ScriptModeBase::leftClickedObject( ObjectHolder* o, const QPoint&, } void ScriptModeBase::mouseMoved( const std::vector& os, - const QPoint& pt, KigWidget& w, bool ) + const TQPoint& pt, KigWidget& w, bool ) { if ( mwawd != SelectingArgs ) return; @@ -101,14 +101,14 @@ void ScriptModeBase::mouseMoved( const std::vector& os, // and set statusbar text w.setCursor( KCursor::handCursor() ); - QString selectstat = os.front()->selectStatement(); + TQString selectstat = os.front()->selectStatement(); // statusbar text mdoc.emitStatusBarText( selectstat ); KigPainter p( w.screenInfo(), &w.curPix, mdoc.document() ); // set the text next to the arrow cursor - QPoint point = pt; + TQPoint point = pt; point.setX(point.x()+15); p.drawTextStd( point, selectstat ); @@ -157,7 +157,7 @@ void ScriptModeBase::codePageEntered() if ( mwizard->text().isEmpty() ) { // insert template code.. - QString tempcode = ScriptType::templateCode( mtype, margs ); + TQString tempcode = ScriptType::templateCode( mtype, margs ); mwizard->setText( tempcode ); }; mwizard->setFinishEnabled( mwizard->mpcode, true ); @@ -178,7 +178,7 @@ bool ScriptCreationMode::queryFinish() { std::vector args; - QString script = mwizard->text(); + TQString script = mwizard->text(); args.push_back( new ObjectConstCalcer( new StringImp( script ) ) ); ObjectTypeCalcer* compiledscript = @@ -198,7 +198,7 @@ bool ScriptCreationMode::queryFinish() if ( reto->imp()->inherits( InvalidImp::stype() ) ) { PythonScripter* inst = PythonScripter::instance(); - QCString errtrace = inst->lastErrorExceptionTraceback().c_str(); + TQCString errtrace = inst->lastErrorExceptionTraceback().c_str(); if ( inst->errorOccurred() ) { KMessageBox::detailedSorry( @@ -224,12 +224,12 @@ bool ScriptCreationMode::queryFinish() } } -void ScriptModeBase::midClicked( const QPoint&, KigWidget& ) +void ScriptModeBase::midClicked( const TQPoint&, KigWidget& ) { } void ScriptModeBase::rightClicked( const std::vector&, - const QPoint&, KigWidget& ) + const TQPoint&, KigWidget& ) { } @@ -316,7 +316,7 @@ bool ScriptEditMode::queryFinish() if ( mexecuted->imp()->inherits( InvalidImp::stype() ) ) { PythonScripter* inst = PythonScripter::instance(); - QCString errtrace = inst->lastErrorExceptionTraceback().c_str(); + TQCString errtrace = inst->lastErrorExceptionTraceback().c_str(); if ( inst->errorOccurred() ) { KMessageBox::detailedSorry( diff --git a/kig/scripting/script_mode.h b/kig/scripting/script_mode.h index 4cbfd737..7f6ff171 100644 --- a/kig/scripting/script_mode.h +++ b/kig/scripting/script_mode.h @@ -52,14 +52,14 @@ private: public: virtual ~ScriptModeBase(); - void dragRect( const QPoint& p, KigWidget& w ); -// void dragObject( const Objects& os, const QPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); - void leftClickedObject( ObjectHolder* o, const QPoint& p, + void dragRect( const TQPoint& p, KigWidget& w ); +// void dragObject( const Objects& os, const TQPoint& pointClickedOn, KigWidget& w, bool ctrlOrShiftDown ); + void leftClickedObject( ObjectHolder* o, const TQPoint& p, KigWidget& w, bool actrlOrShiftDown ); - void mouseMoved( const std::vector& os, const QPoint& p, + void mouseMoved( const std::vector& os, const TQPoint& p, KigWidget& w, bool shiftpressed ); - void midClicked( const QPoint&, KigWidget& ); - void rightClicked( const std::vector&, const QPoint&, KigWidget& ); + void midClicked( const TQPoint&, KigWidget& ); + void rightClicked( const std::vector&, const TQPoint&, KigWidget& ); void argsPageEntered(); void codePageEntered(); @@ -106,7 +106,7 @@ private: std::vector mexecargs; std::vector mcompiledargs; - QString morigscript; + TQString morigscript; public: ScriptEditMode( ObjectTypeCalcer* exec_calc, KigPart& doc ); diff --git a/kiten/asyndeta.cpp b/kiten/asyndeta.cpp index 387a84ce..4a377eb0 100644 --- a/kiten/asyndeta.cpp +++ b/kiten/asyndeta.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include "asyndeta.h" #include "dict.h" @@ -62,23 +62,23 @@ void Asyndeta::readKitenConfiguration() KStandardDirs *dirs = KGlobal::dirs(); KConfig config(dirs->findResource("config", "kitenrc")); - QString globaledict = dirs->findResource("data", "kiten/edict"); - QString globalkanjidic = dirs->findResource("data", "kiten/kanjidic"); + TQString globaledict = dirs->findResource("data", "kiten/edict"); + TQString globalkanjidic = dirs->findResource("data", "kiten/kanjidic"); config.setGroup("edict"); bool edictUseGlobal = config.readBoolEntry("__useGlobal", true); - QStringList DictNameList = config.readListEntry("__NAMES"); - QStringList DictList; + TQStringList DictNameList = config.readListEntry("__NAMES"); + TQStringList DictList; - QStringList::Iterator it; + TQStringList::Iterator it; for (it = DictNameList.begin(); it != DictNameList.end(); ++it) DictList.append(config.readEntry(*it)); - QString personalDict(personalDictionaryLocation()); - if (QFile::exists(personalDict)) + TQString personalDict(personalDictionaryLocation()); + if (TQFile::exists(personalDict)) { DictList.prepend(personalDict); DictNameList.prepend(i18n("Personal")); @@ -111,7 +111,7 @@ void Asyndeta::readKitenConfiguration() index->setKanjiDictList(DictList, DictNameList); } -QString Asyndeta::personalDictionaryLocation() +TQString Asyndeta::personalDictionaryLocation() { return KGlobal::dirs()->saveLocation("data", "kiten/dictionaries/", true).append("personal"); } diff --git a/kiten/asyndeta.h b/kiten/asyndeta.h index 450e5524..aa02cff1 100644 --- a/kiten/asyndeta.h +++ b/kiten/asyndeta.h @@ -42,7 +42,7 @@ public: // and set the index to use them void readKitenConfiguration(); - static QString personalDictionaryLocation(); + static TQString personalDictionaryLocation(); protected: static int refCount; diff --git a/kiten/configdictionaries.cpp b/kiten/configdictionaries.cpp index 80020e23..7829e44c 100644 --- a/kiten/configdictionaries.cpp +++ b/kiten/configdictionaries.cpp @@ -21,20 +21,20 @@ #include #include #include -#include -#include +#include +#include #include "configdictionaries.moc" -ConfigDictionaries::ConfigDictionaries(QWidget *parent, const char* name, WFlags f) : +ConfigDictionaries::ConfigDictionaries(TQWidget *parent, const char* name, WFlags f) : ConfigDictionariesBase(parent, name, f) { changed = false; config = Config::self(); - connect(delSelEdictButton, SIGNAL(clicked()), SLOT(slotDelSelEdict())); - connect(addEdictButton, SIGNAL(clicked()), SLOT(slotAddEdict())); - connect(delSelKanjidicButton, SIGNAL(clicked()), SLOT(slotDelSelKanjidic())); - connect(addKanjidicButton, SIGNAL(clicked()), SLOT(slotAddKanjidic())); + connect(delSelEdictButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotDelSelEdict())); + connect(addEdictButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddEdict())); + connect(delSelKanjidicButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotDelSelKanjidic())); + connect(addKanjidicButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddKanjidic())); } void ConfigDictionaries::updateWidgets() @@ -74,10 +74,10 @@ void ConfigDictionaries::writeDictionaries() changed = false; } -void ConfigDictionaries::readDictionaryList(const QString& group) +void ConfigDictionaries::readDictionaryList(const TQString& group) { KListView* list; - QStringList names; + TQStringList names; if (group == "edict") { list = edictList; @@ -89,20 +89,20 @@ void ConfigDictionaries::readDictionaryList(const QString& group) names = config->kanjidic__NAMES(); } - QStringList::Iterator it; + TQStringList::Iterator it; for (it = names.begin(); it != names.end(); ++it) { - QString name = group + "_" + *it; + TQString name = group + "_" + *it; if (!config->findItem(name)) - config->addItem(new KConfigSkeleton::ItemString(group, *it, *new QString()), name); + config->addItem(new KConfigSkeleton::ItemString(group, *it, *new TQString()), name); } config->readConfig(); list->clear(); for (it = names.begin(); it != names.end(); ++it) - (void) new QListViewItem(list, *it, config->findItem(group + "_" + *it)->property().asString()); + (void) new TQListViewItem(list, *it, config->findItem(group + "_" + *it)->property().asString()); } -void ConfigDictionaries::writeDictionaryList(const QString& group) +void ConfigDictionaries::writeDictionaryList(const TQString& group) { KListView* list; if (group == "edict") @@ -110,17 +110,17 @@ void ConfigDictionaries::writeDictionaryList(const QString& group) else //if (group == "kanjidic") list = kanjidicList; - QStringList names; + TQStringList names; - QListViewItemIterator it(list); + TQListViewItemIterator it(list); for (; it.current(); ++it ) { names.append(it.current()->text(0)); - QString name = group + "_" + it.current()->text(0); + TQString name = group + "_" + it.current()->text(0); KConfigSkeletonItem* item = config->findItem(name); if (!item) { - item = new KConfigSkeleton::ItemString(group, it.current()->text(0), *new QString()); + item = new KConfigSkeleton::ItemString(group, it.current()->text(0), *new TQString()); config->addItem(item, name); } item->setProperty(it.current()->text(1)); @@ -140,18 +140,18 @@ void ConfigDictionaries::slotDelSelKanjidic() { delSel(kanjidicList); } void ConfigDictionaries::add(KListView* list) { - QListViewItem *item = list->firstChild(); - QString filename = KFileDialog::getOpenFileName(item? QFileInfo(item->text(1)).dirPath(true).append("/") : QString::null); - QString name = QFileInfo(filename).fileName(); + TQListViewItem *item = list->firstChild(); + TQString filename = KFileDialog::getOpenFileName(item? TQFileInfo(item->text(1)).dirPath(true).append("/") : TQString::null); + TQString name = TQFileInfo(filename).fileName(); - (void) new QListViewItem(list, name, filename); + (void) new TQListViewItem(list, name, filename); changed = true; emit widgetChanged(); } void ConfigDictionaries::delSel(KListView* list) { - QListViewItem *file = list->selectedItem(); + TQListViewItem *file = list->selectedItem(); if (!file) return; diff --git a/kiten/configdictionaries.h b/kiten/configdictionaries.h index ca301ee5..48089fe9 100644 --- a/kiten/configdictionaries.h +++ b/kiten/configdictionaries.h @@ -28,7 +28,7 @@ class ConfigDictionaries : public ConfigDictionariesBase { Q_OBJECT public: - ConfigDictionaries(QWidget *parent = 0, const char* name = 0, WFlags f = 0); + ConfigDictionaries(TQWidget *parent = 0, const char* name = 0, WFlags f = 0); void readDictionaries(); // KConfig stuff @@ -51,8 +51,8 @@ private slots: private: bool changed; Config* config; - void readDictionaryList(const QString& group); - void writeDictionaryList(const QString& group); + void readDictionaryList(const TQString& group); + void writeDictionaryList(const TQString& group); void add(KListView* list); void delSel(KListView* list); }; diff --git a/kiten/deinf.cpp b/kiten/deinf.cpp index 226f815b..52d1f8f2 100644 --- a/kiten/deinf.cpp +++ b/kiten/deinf.cpp @@ -22,9 +22,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "deinf.h" Deinf::Index::Index() @@ -38,14 +38,14 @@ void Deinf::Index::load() return; KStandardDirs *dirs = KGlobal::dirs(); - QString vconj = dirs->findResource("data", "kiten/vconj"); + TQString vconj = dirs->findResource("data", "kiten/vconj"); if (vconj.isNull()) { KMessageBox::error(0, i18n("Verb deinflection information not found, so verb deinflection cannot be used.")); return; } - QFile f(vconj); + TQFile f(vconj); if (!f.open(IO_ReadOnly)) { @@ -53,24 +53,24 @@ void Deinf::Index::load() return; } - QTextStream t(&f); - t.setCodec(QTextCodec::codecForName("eucJP")); + TQTextStream t(&f); + t.setCodec(TQTextCodec::codecForName("eucJP")); - for(QString text = t.readLine(); !t.eof() && text.at(0) != '$'; text = t.readLine()) + for(TQString text = t.readLine(); !t.eof() && text.at(0) != '$'; text = t.readLine()) { if(text.at(0) != '#') { unsigned int number = text.left(2).stripWhiteSpace().toUInt(); - QString name = text.right(text.length() - 2).stripWhiteSpace(); + TQString name = text.right(text.length() - 2).stripWhiteSpace(); names[number] = name; } } - for(QString text = t.readLine(); !text.isEmpty(); text = t.readLine()) + for(TQString text = t.readLine(); !text.isEmpty(); text = t.readLine()) { if(text.at(0) != '#') { - QStringList things(QStringList::split(QChar('\t'), text)); + TQStringList things(TQStringList::split(TQChar('\t'), text)); Conjugation conj; conj.ending = things.first(); @@ -87,24 +87,24 @@ void Deinf::Index::load() namespace { -QStringList possibleConjugations(const QString &text) +TQStringList possibleConjugations(const TQString &text) { - QStringList endings; + TQStringList endings; for (unsigned i = 0; i < text.length(); ++i) endings.append(text.right(i)); return endings; } } -QStringList Deinf::Index::deinflect(const QString &text, QStringList &name) +TQStringList Deinf::Index::deinflect(const TQString &text, TQStringList &name) { load(); - QStringList endings = possibleConjugations(text); - QStringList ret; + TQStringList endings = possibleConjugations(text); + TQStringList ret; - for (QValueListIterator it = list.begin(); it != list.end(); ++it) + for (TQValueListIterator it = list.begin(); it != list.end(); ++it) { - QStringList matches(endings.grep(QRegExp(QString("^") + (*it).ending))); + TQStringList matches(endings.grep(TQRegExp(TQString("^") + (*it).ending))); if (matches.size() > 0) // a match { @@ -112,8 +112,8 @@ QStringList Deinf::Index::deinflect(const QString &text, QStringList &name) //kdDebug() << "match ending: " << (*it).ending << "; replace: " << (*it).replace << "; name: " << names[(*it).num] << endl; - QString tmp(text); - tmp.replace(QRegExp((*it).ending + "*", false, true), (*it).replace); + TQString tmp(text); + tmp.replace(TQRegExp((*it).ending + "*", false, true), (*it).replace); ret.append(tmp); } } diff --git a/kiten/deinf.h b/kiten/deinf.h index 8db2e811..ca776289 100644 --- a/kiten/deinf.h +++ b/kiten/deinf.h @@ -21,16 +21,16 @@ #ifndef DEFINF_H #define DEFINF_H -#include -#include +#include +#include namespace Deinf { struct Conjugation { - QString ending; - QString replace; + TQString ending; + TQString replace; unsigned int num; }; @@ -39,12 +39,12 @@ class KDE_EXPORT Index public: Index(); - QStringList deinflect(const QString &, QStringList &); + TQStringList deinflect(const TQString &, TQStringList &); private: void load(); - QMap names; - QValueList list; + TQMap names; + TQValueList list; bool loaded; }; diff --git a/kiten/dict.cpp b/kiten/dict.cpp index ad282807..23da1a9e 100644 --- a/kiten/dict.cpp +++ b/kiten/dict.cpp @@ -24,9 +24,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "dict.h" @@ -37,9 +37,9 @@ namespace { -void msgerr(const QString &msg, const QString &dict = QString::null) +void msgerr(const TQString &msg, const TQString &dict = TQString::null) { - QString output = msg; + TQString output = msg; if (!dict.isNull()) output = msg.arg(dict); KMessageBox::error(0, output); @@ -48,7 +48,7 @@ void msgerr(const QString &msg, const QString &dict = QString::null) using namespace Dict; -TextType Dict::textType(const QString &text) +TextType Dict::textType(const TQString &text) { ushort first = text.at(0).unicode(); @@ -65,11 +65,11 @@ TextType Dict::textType(const QString &text) return Text_Kanji; } -File::File(QString path, QString n) +File::File(TQString path, TQString n) : myName(n) , dictFile(path) , dictPtr((const unsigned char *)MAP_FAILED) - , indexFile(KGlobal::dirs()->saveLocation("data", "kiten/xjdx/", true) + QFileInfo(path).baseName() + ".xjdx") + , indexFile(KGlobal::dirs()->saveLocation("data", "kiten/xjdx/", true) + TQFileInfo(path).baseName() + ".xjdx") , indexPtr((const uint32_t *)MAP_FAILED) , valid(false) { @@ -86,7 +86,7 @@ File::File(QString path, QString n) // remade int dictionaryLength; - QFile dictionary(path); + TQFile dictionary(path); dictionaryLength = dictionary.size(); dictionaryLength++; //kdDebug() << "dictionaryLength = " << dictionaryLength << endl; @@ -150,7 +150,7 @@ File::~File(void) indexFile.close(); } -QString File::name(void) +TQString File::name(void) { return myName; } @@ -190,7 +190,7 @@ unsigned char File::lookup(unsigned i, int offset) return dictPtr[pos]; } -QCString File::lookup(unsigned i) +TQCString File::lookup(unsigned i) { uint32_t start = indexPtr[i] - 1; uint32_t pos = start; @@ -199,7 +199,7 @@ QCString File::lookup(unsigned i) while(pos <= size && dictPtr[pos] != 0 && dictPtr[pos] != 0x0a) ++pos; // put the word in the QCString - QCString retval((const char *)(dictPtr + start), pos - start); + TQCString retval((const char *)(dictPtr + start), pos - start); // tack on a null char null = 0; retval.append(&null); @@ -209,7 +209,7 @@ QCString File::lookup(unsigned i) // And last, Index itself is the API presented to the rest of Kiten Index::Index() - : QObject() + : TQObject() { dictFiles.setAutoDelete(true); kanjiDictFiles.setAutoDelete(true); @@ -219,17 +219,17 @@ Index::~Index() { } -void Index::setDictList(const QStringList &list, const QStringList &names) +void Index::setDictList(const TQStringList &list, const TQStringList &names) { loadDictList(dictFiles, list, names); } -void Index::setKanjiDictList(const QStringList &list, const QStringList &names) +void Index::setKanjiDictList(const TQStringList &list, const TQStringList &names) { loadDictList(kanjiDictFiles, list, names); } -void Index::loadDictList(QPtrList &fileList, const QStringList &dictList, const QStringList &dictNameList) +void Index::loadDictList(TQPtrList &fileList, const TQStringList &dictList, const TQStringList &dictNameList) { fileList.clear(); @@ -240,8 +240,8 @@ void Index::loadDictList(QPtrList &fileList, const QStringList &dictList, return; } - QStringList::ConstIterator it; - QStringList::ConstIterator dictIt; + TQStringList::ConstIterator it; + TQStringList::ConstIterator dictIt; for (it = dictList.begin(), dictIt = dictNameList.begin(); it != dictList.end(); ++it, ++dictIt) { File *f = new File(*it, *dictIt); @@ -253,13 +253,13 @@ void Index::loadDictList(QPtrList &fileList, const QStringList &dictList, } } -QStringList Index::doSearch(File &file, const QString &text) +TQStringList Index::doSearch(File &file, const TQString &text) { // Do a binary search to find an entry that matches text - QTextCodec &codec = *QTextCodec::codecForName("eucJP"); - QCString eucString = codec.fromUnicode(text); + TQTextCodec &codec = *TQTextCodec::codecForName("eucJP"); + TQCString eucString = codec.fromUnicode(text); - QString prevResult; + TQString prevResult; Array index = file.index(); Array dict = file.dict(); @@ -279,7 +279,7 @@ QStringList Index::doSearch(File &file, const QString &text) lo = cur + 1; } while(hi >= lo && comp != 0 && !(hi == 0 && lo == 0)); - QStringList results; + TQStringList results; // A match? if (comp == 0) { @@ -296,7 +296,7 @@ QStringList Index::doSearch(File &file, const QString &text) int i = 0; while(file.lookup(cur, i - 1) != 0x0a) --i; - QByteArray bytes(0); + TQByteArray bytes(0); while(file.lookup(cur, i) != 0x0a) // get to end of our line { const char eucchar = file.lookup(cur, i); @@ -305,7 +305,7 @@ QStringList Index::doSearch(File &file, const QString &text) ++i; } - QString result = codec.toUnicode(bytes) + QString("\n"); + TQString result = codec.toUnicode(bytes) + TQString("\n"); if (prevResult != result) { results.append(result); @@ -320,7 +320,7 @@ QStringList Index::doSearch(File &file, const QString &text) return results; } -SearchResult Index::scanResults(QRegExp regexp, QStringList results, bool common) +SearchResult Index::scanResults(TQRegExp regexp, TQStringList results, bool common) { unsigned int num = 0; unsigned int fullNum = 0; @@ -329,7 +329,7 @@ SearchResult Index::scanResults(QRegExp regexp, QStringList results, bool common //ret.results = results; //not here.. - for (QStringList::Iterator itr = results.begin(); itr != results.end(); ++itr) + for (TQStringList::Iterator itr = results.begin(); itr != results.end(); ++itr) { if ((*itr).left(5) == "DICT " || (*itr).left(8) == "HEADING ") { @@ -342,7 +342,7 @@ SearchResult Index::scanResults(QRegExp regexp, QStringList results, bool common if (found >= 0) { ++fullNum; - if ((*itr).find(QString("(P)")) >= 0 || !common) + if ((*itr).find(TQString("(P)")) >= 0 || !common) { // we append HERE, so we get the exact // results we have in ret.list @@ -360,12 +360,12 @@ SearchResult Index::scanResults(QRegExp regexp, QStringList results, bool common return ret; } -SearchResult Index::search(QRegExp regexp, const QString &text, bool common) +SearchResult Index::search(TQRegExp regexp, const TQString &text, bool common) { - QStringList results; - for (QPtrListIterator file(dictFiles); *file; ++file) + TQStringList results; + for (TQPtrListIterator file(dictFiles); *file; ++file) { - results.append(QString("DICT ") + (*file)->name()); + results.append(TQString("DICT ") + (*file)->name()); results += doSearch(**file, text); } @@ -375,7 +375,7 @@ SearchResult Index::search(QRegExp regexp, const QString &text, bool common) return res; } -SearchResult Index::scanKanjiResults(QRegExp regexp, QStringList results, bool common) +SearchResult Index::scanKanjiResults(TQRegExp regexp, TQStringList results, bool common) { unsigned int num = 0; unsigned int fullNum = 0; @@ -383,7 +383,7 @@ SearchResult Index::scanKanjiResults(QRegExp regexp, QStringList results, bool c SearchResult ret; ret.results = results; - for (QStringList::Iterator itr = results.begin(); itr != results.end(); ++itr) + for (TQStringList::Iterator itr = results.begin(); itr != results.end(); ++itr) { if ((*itr).left(5) == "DICT " || (*itr).left(8) == "HEADING ") { @@ -397,7 +397,7 @@ SearchResult Index::scanKanjiResults(QRegExp regexp, QStringList results, bool c { ++fullNum; // common entries have G[1-8] (jouyou) - QRegExp comregexp(jmyCount ? "G[1-9]" : "G[1-8]"); + TQRegExp comregexp(jmyCount ? "G[1-9]" : "G[1-8]"); if ((*itr).find(comregexp) >= 0 || !common) { ret.list.append(kanjiParse(*itr)); @@ -412,12 +412,12 @@ SearchResult Index::scanKanjiResults(QRegExp regexp, QStringList results, bool c return ret; } -SearchResult Index::searchKanji(QRegExp regexp, const QString &text, bool common) +SearchResult Index::searchKanji(TQRegExp regexp, const TQString &text, bool common) { - QStringList results; - for (QPtrListIterator file(kanjiDictFiles); *file; ++file) + TQStringList results; + for (TQPtrListIterator file(kanjiDictFiles); *file; ++file) { - results.append(QString("DICT ") + (*file)->name()); + results.append(TQString("DICT ") + (*file)->name()); results += doSearch(**file, text); } @@ -427,7 +427,7 @@ SearchResult Index::searchKanji(QRegExp regexp, const QString &text, bool commo return res; } -SearchResult Index::searchPrevious(QRegExp regexp, const QString &text, SearchResult list, bool common) +SearchResult Index::searchPrevious(TQRegExp regexp, const TQString &text, SearchResult list, bool common) { SearchResult res; @@ -440,9 +440,9 @@ SearchResult Index::searchPrevious(QRegExp regexp, const QString &text, SearchRe return res; } -QRegExp Dict::Index::createRegExp(SearchType type, const QString &text, DictionaryType dictionaryType, bool caseSensitive) +TQRegExp Dict::Index::createRegExp(SearchType type, const TQString &text, DictionaryType dictionaryType, bool caseSensitive) { - QString regExp; + TQString regExp; switch (type) { case Search_Beginning: @@ -487,10 +487,10 @@ QRegExp Dict::Index::createRegExp(SearchType type, const QString &text, Dictiona regExp = "%1"; } - return QRegExp(regExp.arg(text), caseSensitive); + return TQRegExp(regExp.arg(text), caseSensitive); } -int Index::stringCompare(File &file, int index, QCString str) +int Index::stringCompare(File &file, int index, TQCString str) { return eucStringCompare(file.lookup(index), str); } @@ -530,7 +530,7 @@ bool Dict::isEUC(unsigned char c) return (c & 0x80); } -Entry Dict::parse(const QString &raw) +Entry Dict::parse(const TQString &raw) { unsigned int length = raw.length(); if (raw.left(5) == "DICT ") @@ -538,17 +538,17 @@ Entry Dict::parse(const QString &raw) if (raw.left(8) == "HEADING ") return Entry(raw.right(length - 8), true); - QString reading; - QString kanji; - QStringList meanings; - QString curmeaning; + TQString reading; + TQString kanji; + TQStringList meanings; + TQString curmeaning; bool firstmeaning = true; - QCString parsemode("kanji"); + TQCString parsemode("kanji"); unsigned int i; for (i = 0; i < length; i++) { - QChar ichar(raw.at(i)); + TQChar ichar(raw.at(i)); if (ichar == '[') { @@ -593,7 +593,7 @@ Entry Dict::parse(const QString &raw) return (Entry(kanji, reading, meanings)); } -Entry Dict::kanjiParse(const QString &raw) +Entry Dict::kanjiParse(const TQString &raw) { unsigned int length = raw.length(); if (raw.left(5) == "DICT ") @@ -601,26 +601,26 @@ Entry Dict::kanjiParse(const QString &raw) if (raw.left(8) == "HEADING ") return Entry(raw.right(length - 8), true); - QStringList readings; - QString kanji; - QStringList meanings; - QString curmeaning; - QString curreading; + TQStringList readings; + TQString kanji; + TQStringList meanings; + TQString curmeaning; + TQString curreading; - QString strfreq; - QString strgrade; - QString strstrokes; - QString strmiscount = ""; + TQString strfreq; + TQString strgrade; + TQString strstrokes; + TQString strmiscount = ""; bool prevwasspace = true; - QChar detailname; - QCString parsemode("kanji"); + TQChar detailname; + TQCString parsemode("kanji"); // if there are two S entries, second is common miscount bool strokesset = false; unsigned int i; - QChar ichar; + TQChar ichar; for (i = 0; i < length; i++) { ichar = raw.at(i); @@ -691,7 +691,7 @@ Entry Dict::kanjiParse(const QString &raw) } else if (parsemode == "misc" && prevwasspace) { - if (QRegExp("[A-Za-z0-9]").search(QString(ichar)) >= 0) + if (TQRegExp("[A-Za-z0-9]").search(TQString(ichar)) >= 0) // is non-japanese? { detailname = ichar; @@ -699,7 +699,7 @@ Entry Dict::kanjiParse(const QString &raw) } else { - curreading = QString(ichar); + curreading = TQString(ichar); parsemode = "reading"; } } @@ -708,10 +708,10 @@ Entry Dict::kanjiParse(const QString &raw) return (Entry(kanji, readings, meanings, strgrade.toUInt(), strfreq.toUInt(), strstrokes.toUInt(), strmiscount.toUInt())); } -QString Dict::prettyMeaning(QStringList Meanings) +TQString Dict::prettyMeaning(TQStringList Meanings) { - QString meanings; - QStringList::Iterator it; + TQString meanings; + TQStringList::Iterator it; for (it = Meanings.begin(); it != Meanings.end(); ++it) meanings.append((*it).stripWhiteSpace()).append("; "); @@ -719,10 +719,10 @@ QString Dict::prettyMeaning(QStringList Meanings) return meanings; } -QString Dict::prettyKanjiReading(QStringList Readings) +TQString Dict::prettyKanjiReading(TQStringList Readings) { - QStringList::Iterator it; - QString html; + TQStringList::Iterator it; + TQString html; for (it = Readings.begin(); it != Readings.end(); ++it) { @@ -746,7 +746,7 @@ QString Dict::prettyKanjiReading(QStringList Readings) Dict::Entry Dict::firstEntry(Dict::SearchResult result) { - for (QValueListIterator it = result.list.begin(); it != result.list.end(); ++it) + for (TQValueListIterator it = result.list.begin(); it != result.list.end(); ++it) { if ((*it).dictName() == "__NOTSET" && (*it).header() == "__NOTSET") return (*it); @@ -755,22 +755,22 @@ Dict::Entry Dict::firstEntry(Dict::SearchResult result) return Dict::Entry("__NOTHING"); } -QString Dict::firstEntryText(Dict::SearchResult result) +TQString Dict::firstEntryText(Dict::SearchResult result) { - for (QStringList::Iterator it = result.results.begin(); it != result.results.end(); ++it) + for (TQStringList::Iterator it = result.results.begin(); it != result.results.end(); ++it) { if ((*it).left(5) != "DICT " && (*it).left(7) != "HEADER ") return (*it); } - return QString("NONE "); + return TQString("NONE "); } /////////////////////////////////////////////////////////////// -Entry::Entry(const QString & kanji, const QString & reading, const QStringList &meanings) - : DictName(QString::fromLatin1("__NOTSET")) - , Header(QString::fromLatin1("__NOTSET")) +Entry::Entry(const TQString & kanji, const TQString & reading, const TQStringList &meanings) + : DictName(TQString::fromLatin1("__NOTSET")) + , Header(TQString::fromLatin1("__NOTSET")) , Meanings(meanings) , Kanji(kanji) , KanaOnly(reading.isEmpty()) @@ -783,9 +783,9 @@ Entry::Entry(const QString & kanji, const QString & reading, const QStringList & { } -Entry::Entry(const QString &kanji, QStringList &readings, QStringList &meanings, unsigned int grade, unsigned int freq, unsigned int strokes, unsigned int miscount) - : DictName(QString::fromLatin1("__NOTSET")) - , Header(QString::fromLatin1("__NOTSET")) +Entry::Entry(const TQString &kanji, TQStringList &readings, TQStringList &meanings, unsigned int grade, unsigned int freq, unsigned int strokes, unsigned int miscount) + : DictName(TQString::fromLatin1("__NOTSET")) + , Header(TQString::fromLatin1("__NOTSET")) , Meanings(meanings) , Kanji(kanji) , KanaOnly(false) @@ -798,27 +798,27 @@ Entry::Entry(const QString &kanji, QStringList &readings, QStringList &meanings, { } -Entry::Entry(const QString &dictname) +Entry::Entry(const TQString &dictname) : KanaOnly(true) , ExtendedKanjiInfo(false) { DictName = dictname; } -Entry::Entry(const QString &headername, bool) - : DictName(QString::fromLatin1("__NOTSET")) +Entry::Entry(const TQString &headername, bool) + : DictName(TQString::fromLatin1("__NOTSET")) , Header(headername) , KanaOnly(true) , ExtendedKanjiInfo(false) { } -QString Entry::dictName() +TQString Entry::dictName() { return DictName; } -QString Entry::header() +TQString Entry::header() { return Header; } @@ -828,22 +828,22 @@ bool Entry::kanaOnly() return KanaOnly; } -QString Entry::kanji() +TQString Entry::kanji() { return Kanji; } -QStringList Entry::readings() +TQStringList Entry::readings() { return Readings; } -QString Entry::firstReading() +TQString Entry::firstReading() { return *Readings.at(0); } -QStringList Entry::meanings() +TQStringList Entry::meanings() { return Meanings; } diff --git a/kiten/dict.h b/kiten/dict.h index 80fa8113..f510d0c1 100644 --- a/kiten/dict.h +++ b/kiten/dict.h @@ -22,11 +22,11 @@ #ifndef DICT_H #define DICT_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #ifdef __osf__ @@ -42,14 +42,14 @@ namespace Dict enum TextType { Text_Kanji, Text_Kana, Text_Latin }; // returns the TextType of the first part of the text -KDE_EXPORT TextType textType(const QString &text); +KDE_EXPORT TextType textType(const TQString &text); // File needs to be able to give out Arrays based on its mmap'd data. // But, we don't want the users of the arrays to have to remember to // resetRawData() after using them, since that's bound to fail sooner or later. // // This class handles it for us. -template class Array : public QMemArray +template class Array : public TQMemArray { public: Array(T *, int); @@ -61,7 +61,7 @@ private: }; template Array::Array(T *d, int s) - : QMemArray() + : TQMemArray() , data(d) , dataSize(s) { @@ -78,10 +78,10 @@ template Array::~Array() class File { public: - File(QString path, QString name); + File(TQString path, TQString name); ~File(); - QString name(void); + TQString name(void); Array dict(void); Array index(void); @@ -93,14 +93,14 @@ public: bool isValid(void); unsigned char lookup(unsigned i, int offset); - QCString lookup(unsigned i); + TQCString lookup(unsigned i); private: - QString myName; + TQString myName; - QFile dictFile; + TQFile dictFile; const unsigned char * dictPtr; - QFile indexFile; + TQFile indexFile; const uint32_t * indexPtr; bool valid; @@ -110,22 +110,22 @@ class KDE_EXPORT Entry { public: // EDict ctor - Entry(const QString &, const QString &, const QStringList &); + Entry(const TQString &, const TQString &, const TQStringList &); // Kanjidict ctor - Entry(const QString &, QStringList &, QStringList &, unsigned int grade, unsigned int freq, unsigned int strokes, unsigned int miscount); + Entry(const TQString &, TQStringList &, TQStringList &, unsigned int grade, unsigned int freq, unsigned int strokes, unsigned int miscount); // default (for containers) - Entry(const QString & = QString::null); + Entry(const TQString & = TQString::null); // for a heading - Entry(const QString &, bool header); + Entry(const TQString &, bool header); - QString dictName(); - QString header(); - QStringList meanings(); - QStringList readings(); - QString firstReading(); + TQString dictName(); + TQString header(); + TQStringList meanings(); + TQStringList readings(); + TQString firstReading(); bool kanaOnly(); - QString kanji(); + TQString kanji(); bool extendedKanjiInfo(); unsigned int grade(); @@ -134,13 +134,13 @@ public: unsigned int freq(); protected: - QString DictName; - QString Header; - QStringList Meanings; + TQString DictName; + TQString Header; + TQStringList Meanings; - QString Kanji; + TQString Kanji; bool KanaOnly; - QStringList Readings; + TQStringList Readings; bool ExtendedKanjiInfo; unsigned int Grade; @@ -151,11 +151,11 @@ protected: struct SearchResult { - QValueList list; - QStringList results; + TQValueList list; + TQStringList results; int count, outOf; bool common; - QString text; + TQString text; }; enum SearchType { Search_Beginning, Search_FullWord, Search_Anywhere }; @@ -169,35 +169,35 @@ public: Index(); virtual ~Index(); - void setDictList(const QStringList &files, const QStringList &names); - void setKanjiDictList(const QStringList &files, const QStringList &names); + void setDictList(const TQStringList &files, const TQStringList &names); + void setKanjiDictList(const TQStringList &files, const TQStringList &names); - SearchResult search(QRegExp, const QString &, bool common); - SearchResult searchKanji(QRegExp, const QString &, bool common); - SearchResult searchPrevious(QRegExp, const QString &, SearchResult, bool common); + SearchResult search(TQRegExp, const TQString &, bool common); + SearchResult searchKanji(TQRegExp, const TQString &, bool common); + SearchResult searchPrevious(TQRegExp, const TQString &, SearchResult, bool common); // convenience function to create suitable regexps - static QRegExp createRegExp(SearchType type, const QString &text, DictionaryType dictionaryType, bool caseSensitive = false); + static TQRegExp createRegExp(SearchType type, const TQString &text, DictionaryType dictionaryType, bool caseSensitive = false); private: - QPtrList dictFiles; - QPtrList kanjiDictFiles; + TQPtrList dictFiles; + TQPtrList kanjiDictFiles; - void loadDictList(QPtrList &fileList, const QStringList &dictList, const QStringList &dictNameList); + void loadDictList(TQPtrList &fileList, const TQStringList &dictList, const TQStringList &dictNameList); - QStringList doSearch(File &, const QString &); - SearchResult scanResults(QRegExp regexp, QStringList results, bool common); - SearchResult scanKanjiResults(QRegExp regexp, QStringList results, bool common); - int stringCompare(File &, int index, QCString); + TQStringList doSearch(File &, const TQString &); + SearchResult scanResults(TQRegExp regexp, TQStringList results, bool common); + SearchResult scanKanjiResults(TQRegExp regexp, TQStringList results, bool common); + int stringCompare(File &, int index, TQCString); }; // lotsa helper functions -KDE_EXPORT QString prettyKanjiReading(QStringList); -KDE_EXPORT QString prettyMeaning(QStringList); -KDE_EXPORT Entry parse(const QString &); -KDE_EXPORT Entry kanjiParse(const QString &); +KDE_EXPORT TQString prettyKanjiReading(TQStringList); +KDE_EXPORT TQString prettyMeaning(TQStringList); +KDE_EXPORT Entry parse(const TQString &); +KDE_EXPORT Entry kanjiParse(const TQString &); KDE_EXPORT Dict::Entry firstEntry(Dict::SearchResult); -KDE_EXPORT QString firstEntryText(Dict::SearchResult); +KDE_EXPORT TQString firstEntryText(Dict::SearchResult); int eucStringCompare(const char *str1, const char *str2); bool isEUC(unsigned char c); diff --git a/kiten/kiten.cpp b/kiten/kiten.cpp index 434f02e1..5e54a9af 100644 --- a/kiten/kiten.cpp +++ b/kiten/kiten.cpp @@ -34,10 +34,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "kiten.h" #include "learn.h" @@ -46,7 +46,7 @@ #include -TopLevel::TopLevel(QWidget *parent, const char *name) : KMainWindow(parent, name) +TopLevel::TopLevel(TQWidget *parent, const char *name) : KMainWindow(parent, name) { #if KDE_VERSION > 305 setStandardToolBarMenuEnabled(true); @@ -55,42 +55,42 @@ TopLevel::TopLevel(QWidget *parent, const char *name) : KMainWindow(parent, name config = Config::self(); config->readConfig(); Accel = new KGlobalAccel(this); - (void) Accel->insert("Lookup Kanji (Kanjidic)", i18n("Lookup Kanji (Kanjidic)"), i18n("Gives detailed information about Kanji currently on clipboard."), CTRL + ALT + Key_K, CTRL + ALT + Key_K, this, SLOT(kanjiSearchAccel())); - (void) Accel->insert("Lookup English/Japanese word", i18n("Lookup English/Japanese Word"), i18n("Looks up current text on clipboard in the same way as if you used Kiten's regular search."), CTRL + ALT + Key_S, CTRL + ALT + Key_S, this, SLOT(searchAccel())); + (void) Accel->insert("Lookup Kanji (Kanjidic)", i18n("Lookup Kanji (Kanjidic)"), i18n("Gives detailed information about Kanji currently on clipboard."), CTRL + ALT + Key_K, CTRL + ALT + Key_K, this, TQT_SLOT(kanjiSearchAccel())); + (void) Accel->insert("Lookup English/Japanese word", i18n("Lookup English/Japanese Word"), i18n("Looks up current text on clipboard in the same way as if you used Kiten's regular search."), CTRL + ALT + Key_S, CTRL + ALT + Key_S, this, TQT_SLOT(searchAccel())); Accel->readSettings(KGlobal::config()); Accel->updateConnections(); _ResultView = new ResultView(true, this, "_ResultView"); setCentralWidget(_ResultView); - (void) KStdAction::quit(this, SLOT(close()), actionCollection()); - (void) KStdAction::print(this, SLOT(print()), actionCollection()); - (void) KStdAction::preferences(this, SLOT(slotConfigure()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); - (void) new KAction(i18n("&Learn"), "pencil", CTRL+Key_L, this, SLOT(createLearn()), actionCollection(), "file_learn"); - (void) new KAction(i18n("&Dictionary Editor..."), "edit", 0, this, SLOT(createEEdit()), actionCollection(), "dict_editor"); - (void) new KAction(i18n("Ra&dical Search..."), "gear", CTRL+Key_R, this, SLOT(radicalSearch()), actionCollection(), "search_radical"); - Edit = new EditAction(i18n("Search Edit"), 0, this, SLOT(search()), actionCollection(), "search_edit"); - (void) new KAction(i18n("&Clear Search Bar"), BarIcon("locationbar_erase", 16), CTRL+Key_N, Edit, SLOT(clear()), actionCollection(), "clear_search"); - (void) new KAction(i18n("S&earch"), "key_enter", 0, this, SLOT(search()), actionCollection(), "search"); - (void) new KAction(i18n("Search with &Beginning of Word"), 0, this, SLOT(searchBeginning()), actionCollection(), "search_beginning"); - (void) new KAction(i18n("Search &Anywhere"), 0, this, SLOT(searchAnywhere()), actionCollection(), "search_anywhere"); - (void) new KAction(i18n("Stro&kes"), "paintbrush", CTRL+Key_S, this, SLOT(strokeSearch()), actionCollection(), "search_stroke"); - (void) new KAction(i18n("&Grade"), "leftjust", CTRL+Key_G, this, SLOT(gradeSearch()), actionCollection(), "search_grade"); - kanjiCB = new KToggleAction(i18n("&Kanjidic"), "kanjidic", CTRL+Key_K, this, SLOT(kanjiDictChange()), actionCollection(), "kanji_toggle"); - deinfCB = new KToggleAction(i18n("&Deinflect Verbs in Regular Search"), 0, this, SLOT(kanjiDictChange()), actionCollection(), "deinf_toggle"); - comCB = new KToggleAction(i18n("&Filter Rare"), "filter", CTRL+Key_F, this, SLOT(toggleCom()), actionCollection(), "common"); - autoSearchToggle = new KToggleAction(i18n("&Automatically Search Clipboard Selections"), "find", 0, this, SLOT(kanjiDictChange()), actionCollection(), "autosearch_toggle"); - irAction = new KAction(i18n("Search &in Results"), "find", CTRL+Key_I, this, SLOT(resultSearch()), actionCollection(), "search_in_results"); - (void) KStdAction::configureToolbars(this, SLOT(configureToolBars()), actionCollection()); - addAction = new KAction(i18n("Add &Kanji to Learning List"), 0, this, SLOT(addToList()), actionCollection(), "add"); + (void) KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); + (void) KStdAction::print(this, TQT_SLOT(print()), actionCollection()); + (void) KStdAction::preferences(this, TQT_SLOT(slotConfigure()), actionCollection()); + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); + (void) new KAction(i18n("&Learn"), "pencil", CTRL+Key_L, this, TQT_SLOT(createLearn()), actionCollection(), "file_learn"); + (void) new KAction(i18n("&Dictionary Editor..."), "edit", 0, this, TQT_SLOT(createEEdit()), actionCollection(), "dict_editor"); + (void) new KAction(i18n("Ra&dical Search..."), "gear", CTRL+Key_R, this, TQT_SLOT(radicalSearch()), actionCollection(), "search_radical"); + Edit = new EditAction(i18n("Search Edit"), 0, this, TQT_SLOT(search()), actionCollection(), "search_edit"); + (void) new KAction(i18n("&Clear Search Bar"), BarIcon("locationbar_erase", 16), CTRL+Key_N, Edit, TQT_SLOT(clear()), actionCollection(), "clear_search"); + (void) new KAction(i18n("S&earch"), "key_enter", 0, this, TQT_SLOT(search()), actionCollection(), "search"); + (void) new KAction(i18n("Search with &Beginning of Word"), 0, this, TQT_SLOT(searchBeginning()), actionCollection(), "search_beginning"); + (void) new KAction(i18n("Search &Anywhere"), 0, this, TQT_SLOT(searchAnywhere()), actionCollection(), "search_anywhere"); + (void) new KAction(i18n("Stro&kes"), "paintbrush", CTRL+Key_S, this, TQT_SLOT(strokeSearch()), actionCollection(), "search_stroke"); + (void) new KAction(i18n("&Grade"), "leftjust", CTRL+Key_G, this, TQT_SLOT(gradeSearch()), actionCollection(), "search_grade"); + kanjiCB = new KToggleAction(i18n("&Kanjidic"), "kanjidic", CTRL+Key_K, this, TQT_SLOT(kanjiDictChange()), actionCollection(), "kanji_toggle"); + deinfCB = new KToggleAction(i18n("&Deinflect Verbs in Regular Search"), 0, this, TQT_SLOT(kanjiDictChange()), actionCollection(), "deinf_toggle"); + comCB = new KToggleAction(i18n("&Filter Rare"), "filter", CTRL+Key_F, this, TQT_SLOT(toggleCom()), actionCollection(), "common"); + autoSearchToggle = new KToggleAction(i18n("&Automatically Search Clipboard Selections"), "find", 0, this, TQT_SLOT(kanjiDictChange()), actionCollection(), "autosearch_toggle"); + irAction = new KAction(i18n("Search &in Results"), "find", CTRL+Key_I, this, TQT_SLOT(resultSearch()), actionCollection(), "search_in_results"); + (void) KStdAction::configureToolbars(this, TQT_SLOT(configureToolBars()), actionCollection()); + addAction = new KAction(i18n("Add &Kanji to Learning List"), 0, this, TQT_SLOT(addToList()), actionCollection(), "add"); addAction->setEnabled(false); - (void) new KAction(i18n("Configure &Global Shortcuts..."), "configure_shortcuts", 0, this, SLOT(configureGlobalKeys()), actionCollection(), "options_configure_keybinding"); + (void) new KAction(i18n("Configure &Global Shortcuts..."), "configure_shortcuts", 0, this, TQT_SLOT(configureGlobalKeys()), actionCollection(), "options_configure_keybinding"); historyAction = new KListAction(i18n("&History"), 0, 0, 0, actionCollection(), "history"); - connect(historyAction, SIGNAL(activated(int)), this, SLOT(goInHistory(int))); - backAction = KStdAction::back(this, SLOT(back()), actionCollection()); - forwardAction = KStdAction::forward(this, SLOT(forward()), actionCollection()); + connect(historyAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(goInHistory(int))); + backAction = KStdAction::back(this, TQT_SLOT(back()), actionCollection()); + forwardAction = KStdAction::forward(this, TQT_SLOT(forward()), actionCollection()); backAction->setEnabled(false); forwardAction->setEnabled(false); currentResult = resultHistory.end(); @@ -114,10 +114,10 @@ TopLevel::TopLevel(QWidget *parent, const char *name) : KMainWindow(parent, name resize(600, 400); applyMainWindowSettings(KGlobal::config(), "TopLevelWindow"); - connect(_ResultView, SIGNAL(linkClicked(const QString &)), SLOT(ressearch(const QString &))); - connect(kapp->clipboard(), SIGNAL(selectionChanged()), this, SLOT(autoSearch())); + connect(_ResultView, TQT_SIGNAL(linkClicked(const TQString &)), TQT_SLOT(ressearch(const TQString &))); + connect(kapp->clipboard(), TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(autoSearch())); - QTimer::singleShot(10, this, SLOT(finishInit())); + TQTimer::singleShot(10, this, TQT_SLOT(finishInit())); } TopLevel::~TopLevel() @@ -133,21 +133,21 @@ void TopLevel::finishInit() if (!kapp->config()->hasGroup("app")) { if (kanjiCB->isChecked()) - Edit->setText(QString::fromUtf8("辞")); + Edit->setText(TQString::fromUtf8("辞")); else - Edit->setText(QString::fromUtf8("辞書")); + Edit->setText(TQString::fromUtf8("辞書")); search(); } Edit->clear(); // make sure the edit is focused initially StatusBar->message(i18n("Welcome to Kiten")); - setCaption(QString::null); + setCaption(TQString::null); } bool TopLevel::queryClose() { - for (QPtrListIterator i(learnList); *i;) + for (TQPtrListIterator i(learnList); *i;) { (*i)->show(); if (!(*i)->closeWindow()) @@ -177,7 +177,7 @@ void TopLevel::addToList() emit add(toAddKanji); } -void TopLevel::doSearch(const QString &text, QRegExp regexp) +void TopLevel::doSearch(const TQString &text, TQRegExp regexp) { if (text.isEmpty()) { @@ -215,7 +215,7 @@ void TopLevel::doSearch(const QString &text, QRegExp regexp) readingSearch = false; } -void TopLevel::doSearchInResults(const QString &text, QRegExp regexp) +void TopLevel::doSearchInResults(const TQString &text, TQRegExp regexp) { if (text.isEmpty()) { @@ -257,23 +257,23 @@ void TopLevel::handleSearchResult(Dict::SearchResult results) addAction->setEnabled(true); - _ResultView->append(QString("

%1

").arg(i18n("HTML Entity: %1").arg(QString("&#x%1;").arg(QString::number(toAddKanji.kanji().at(0).unicode(), 16))))); // show html entity + _ResultView->append(TQString("

%1

").arg(i18n("HTML Entity: %1").arg(TQString("&#x%1;").arg(TQString::number(toAddKanji.kanji().at(0).unicode(), 16))))); // show html entity // now show some compounds in which this kanji appears - QString kanji = toAddKanji.kanji(); + TQString kanji = toAddKanji.kanji(); _ResultView->addHeader(i18n("%1 in compounds").arg(kanji)); - Dict::SearchResult compounds = _Asyndeta.retrieveIndex()->search(QRegExp(kanji), kanji, true); + Dict::SearchResult compounds = _Asyndeta.retrieveIndex()->search(TQRegExp(kanji), kanji, true); bool common = true; if (compounds.count <= 0) { - compounds = _Asyndeta.retrieveIndex()->search(QRegExp(kanji), kanji, false); + compounds = _Asyndeta.retrieveIndex()->search(TQRegExp(kanji), kanji, false); _ResultView->addHeader(i18n("(No common compounds)"), 4); common = false; } - for (QValueListIterator it = compounds.list.begin(); it != compounds.list.end(); ++it) + for (TQValueListIterator it = compounds.list.begin(); it != compounds.list.end(); ++it) { //kdDebug() << "adding " << (*it).kanji() << endl; _ResultView->addResult(*it, common); @@ -282,7 +282,7 @@ void TopLevel::handleSearchResult(Dict::SearchResult results) } else { - for (QValueListIterator it = results.list.begin(); it != results.list.end(); ++it) + for (TQValueListIterator it = results.list.begin(); it != results.list.end(); ++it) { kapp->processEvents(); _ResultView->addKanjiResult(*it, results.common); @@ -291,7 +291,7 @@ void TopLevel::handleSearchResult(Dict::SearchResult results) } else { - for (QValueListIterator it = results.list.begin(); it != results.list.end(); ++it) + for (TQValueListIterator it = results.list.begin(); it != results.list.end(); ++it) { kapp->processEvents(); _ResultView->addResult(*it, comCB->isChecked()); @@ -303,29 +303,29 @@ void TopLevel::handleSearchResult(Dict::SearchResult results) void TopLevel::searchBeginning() { - QString text = Edit->text(); - QRegExp regexp; + TQString text = Edit->text(); + TQRegExp regexp; switch (Dict::textType(text)) { case Dict::Text_Latin: - regexp = QRegExp(QString("\\W").append(text)); + regexp = TQRegExp(TQString("\\W").append(text)); break; case Dict::Text_Kana: if (kanjiCB->isChecked()) { - regexp = QRegExp(QString("\\W").append(text)); + regexp = TQRegExp(TQString("\\W").append(text)); } else { beginningReadingSearch = true; - regexp = QRegExp(QString("\\[").append(text)); + regexp = TQRegExp(TQString("\\[").append(text)); } break; case Dict::Text_Kanji: - regexp = QRegExp(QString("^").append(text)); + regexp = TQRegExp(TQString("^").append(text)); } doSearch(text, regexp); @@ -333,7 +333,7 @@ void TopLevel::searchBeginning() void TopLevel::searchAnywhere() { - doSearch(Edit->text(), QRegExp(Edit->text())); + doSearch(Edit->text(), TQRegExp(Edit->text())); } void TopLevel::resultSearch() @@ -342,12 +342,12 @@ void TopLevel::resultSearch() } // called when a kanji is clicked on in result view -void TopLevel::ressearch(const QString &text) +void TopLevel::ressearch(const TQString &text) { //kdDebug() << "ressearch(" << text << endl; if (text.startsWith("__radical:")) { - QString radical = text.section(":", 1, 1).right(1); + TQString radical = text.section(":", 1, 1).right(1); //kdDebug() << "radical is " << radical << endl; radicalSearch()->addRadical(radical); return; @@ -359,8 +359,8 @@ void TopLevel::ressearch(const QString &text) void TopLevel::search(bool inResults) { - QString text = Edit->text(); - QRegExp regexp; + TQString text = Edit->text(); + TQRegExp regexp; switch (Dict::textType(text)) { @@ -377,8 +377,8 @@ void TopLevel::search(bool inResults) if (deinfCB->isChecked()) // deinflect { bool common = comCB->isChecked(); - QStringList names; - QStringList res(_DeinfIndex.deinflect(text, names)); + TQStringList names; + TQStringList res(_DeinfIndex.deinflect(text, names)); if (res.size() > 0) { @@ -388,19 +388,19 @@ void TopLevel::search(bool inResults) hist.common = common; hist.text = text; - QStringList done; + TQStringList done; res.prepend(text); names.prepend(i18n("No deinflection")); - QStringList::Iterator nit = names.begin(); - for (QStringList::Iterator it = res.begin(); it != res.end(); ++it, ++nit) + TQStringList::Iterator nit = names.begin(); + for (TQStringList::Iterator it = res.begin(); it != res.end(); ++it, ++nit) { if (done.contains(*it) > 0) continue; //kdDebug() << "currently on deinflection " << *it << endl; - Dict::SearchResult results = _Asyndeta.retrieveIndex()->search(QRegExp(QString("^") + (*it) + "\\W"), *it, common); + Dict::SearchResult results = _Asyndeta.retrieveIndex()->search(TQRegExp(TQString("^") + (*it) + "\\W"), *it, common); if (results.count < 1) // stop if it isn't in the dictionary continue; @@ -433,10 +433,10 @@ void TopLevel::search(bool inResults) void TopLevel::strokeSearch() { - QString strokesString; + TQString strokesString; bool ok = false; - QString text = Edit->text().stripWhiteSpace(); + TQString text = Edit->text().stripWhiteSpace(); unsigned int strokes = text.toUInt(&ok); if (!ok) @@ -470,7 +470,7 @@ void TopLevel::strokeSearch() already = true; - strokesString.append(QString::number(i)); + strokesString.append(TQString::number(i)); } strokesString.append(')'); @@ -489,21 +489,21 @@ void TopLevel::strokeSearch() } else { - strokesString = QString::number(strokes); + strokesString = TQString::number(strokes); } - QRegExp regexp = QRegExp(text); + TQRegExp regexp = TQRegExp(text); // must be in kanjidic mode kanjiCB->setChecked(true); - doSearch(QString("S%1 ").arg(strokesString), regexp); + doSearch(TQString("S%1 ").arg(strokesString), regexp); } void TopLevel::gradeSearch() { - QString editText = Edit->text().stripWhiteSpace(); + TQString editText = Edit->text().stripWhiteSpace(); unsigned int grade; if (editText.lower() == "jouyou") @@ -519,31 +519,31 @@ void TopLevel::gradeSearch() return; } - QString text = QString("G%1 ").arg(grade); - QRegExp regexp = QRegExp(text); + TQString text = TQString("G%1 ").arg(grade); + TQRegExp regexp = TQRegExp(text); kanjiCB->setChecked(true); doSearch(text, regexp); } -QString TopLevel::clipBoardText() // gets text from clipboard for globalaccels +TQString TopLevel::clipBoardText() // gets text from clipboard for globalaccels { kapp->clipboard()->setSelectionMode(true); - QString text = kapp->clipboard()->text().stripWhiteSpace(); + TQString text = kapp->clipboard()->text().stripWhiteSpace(); kapp->clipboard()->setSelectionMode(false); return text; } -QString TopLevel::filteredClipboardText() +TQString TopLevel::filteredClipboardText() { - QString newText = clipBoardText(); - QString currentText = Edit->text(); + TQString newText = clipBoardText(); + TQString currentText = Edit->text(); if (newText.length() < 80 && newText.find(':') < 0 && newText.find('#') < 0 && newText.find("-") != 0 && newText.find("+") < 0 && currentText.find(newText) < 0) return newText; else - return QString::null; + return TQString::null; } void TopLevel::autoSearch() @@ -554,7 +554,7 @@ void TopLevel::autoSearch() void TopLevel::searchAccel() { - QString newText = filteredClipboardText(); + TQString newText = filteredClipboardText(); if (!newText.isNull()) { kanjiCB->setChecked(false); @@ -568,7 +568,7 @@ void TopLevel::searchAccel() void TopLevel::kanjiSearchAccel() { - QString newText = filteredClipboardText(); + TQString newText = filteredClipboardText(); if (!newText.isNull()) { kanjiCB->setChecked(true); @@ -582,7 +582,7 @@ void TopLevel::kanjiSearchAccel() void TopLevel::setResults(unsigned int results, unsigned int fullNum) { - QString str = i18n("%n result","%n results",results); + TQString str = i18n("%n result","%n results",results); if (results < fullNum) str += i18n(" out of %1").arg(fullNum); @@ -609,9 +609,9 @@ void TopLevel::slotConfigure() //ConfigureDialog didn't find an instance of this dialog, so lets create it : optionDialog = new ConfigureDialog(this, "settings"); - connect(optionDialog, SIGNAL(hidden()),this,SLOT(slotConfigureHide())); - connect(optionDialog, SIGNAL(settingsChanged()), this, SLOT(slotConfigurationChanged())); - connect(optionDialog, SIGNAL(valueChanged()), this, SIGNAL(quizConfChanged())); + connect(optionDialog, TQT_SIGNAL(hidden()),this,TQT_SLOT(slotConfigureHide())); + connect(optionDialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotConfigurationChanged())); + connect(optionDialog, TQT_SIGNAL(valueChanged()), this, TQT_SIGNAL(quizConfChanged())); optionDialog->show(); return; @@ -625,7 +625,7 @@ void TopLevel::slotLearnConfigure() void TopLevel::slotConfigureHide() { - QTimer::singleShot(0, this, SLOT(slotConfigureDestroy())); + TQTimer::singleShot(0, this, TQT_SLOT(slotConfigureDestroy())); } void TopLevel::slotConfigureDestroy() @@ -641,11 +641,11 @@ void TopLevel::createLearn() { Learn *_Learn = new Learn(_Asyndeta.retrieveIndex(), 0); - connect(_Learn, SIGNAL(destroyed(Learn *)), this, SLOT(learnDestroyed(Learn *))); - connect(_Learn, SIGNAL(linkClicked(const QString &)), this, SLOT(ressearch(const QString &))); - connect(_Learn, SIGNAL(configureLearn()), this, SLOT(slotLearnConfigure())); - connect(this, SIGNAL(quizConfChanged()), _Learn, SLOT(updateQuizConfiguration())); - connect(this, SIGNAL(add(Dict::Entry)), _Learn, SLOT(add(Dict::Entry))); + connect(_Learn, TQT_SIGNAL(destroyed(Learn *)), this, TQT_SLOT(learnDestroyed(Learn *))); + connect(_Learn, TQT_SIGNAL(linkClicked(const TQString &)), this, TQT_SLOT(ressearch(const TQString &))); + connect(_Learn, TQT_SIGNAL(configureLearn()), this, TQT_SLOT(slotLearnConfigure())); + connect(this, TQT_SIGNAL(quizConfChanged()), _Learn, TQT_SLOT(updateQuizConfiguration())); + connect(this, TQT_SIGNAL(add(Dict::Entry)), _Learn, TQT_SLOT(add(Dict::Entry))); learnList.append(_Learn); @@ -668,14 +668,14 @@ void TopLevel::kanjiDictChange() // Do we even *need* something here? } -QRegExp TopLevel::readingSearchItems(bool kanji) +TQRegExp TopLevel::readingSearchItems(bool kanji) { - QString text = Edit->text(); + TQString text = Edit->text(); if (text.isEmpty()) // abandon search - return QRegExp(); //empty + return TQRegExp(); //empty //CompletionObj->addItem(text); - QString regexp; + TQString regexp; if (kanji) regexp = " %1 "; else @@ -683,17 +683,17 @@ QRegExp TopLevel::readingSearchItems(bool kanji) regexp = regexp.arg(text); - return QRegExp(regexp, Config::caseSensitive()); + return TQRegExp(regexp, Config::caseSensitive()); } -QRegExp TopLevel::kanjiSearchItems(bool beginning) +TQRegExp TopLevel::kanjiSearchItems(bool beginning) { - QString text = Edit->text(); + TQString text = Edit->text(); if (text.isEmpty()) - return QRegExp(); //empty + return TQRegExp(); //empty - QString regexp; + TQString regexp; if (beginning) regexp = "^%1"; else @@ -701,17 +701,17 @@ QRegExp TopLevel::kanjiSearchItems(bool beginning) regexp = regexp.arg(text); - return QRegExp(regexp, Config::caseSensitive()); + return TQRegExp(regexp, Config::caseSensitive()); } -QRegExp TopLevel::searchItems() +TQRegExp TopLevel::searchItems() { - QString regexp; - QString text = Edit->text(); + TQString regexp; + TQString text = Edit->text(); if (text.isEmpty()) - return QRegExp(); //empty + return TQRegExp(); //empty - unsigned int contains = text.contains(QRegExp("[A-Za-z0-9_:]")); + unsigned int contains = text.contains(TQRegExp("[A-Za-z0-9_:]")); if (Config::wholeWord() && contains == text.length()) regexp = "\\W%1\\W"; else @@ -719,7 +719,7 @@ QRegExp TopLevel::searchItems() regexp = regexp.arg(text); - return QRegExp(regexp, Config::caseSensitive()); + return TQRegExp(regexp, Config::caseSensitive()); } void TopLevel::toggleCom() @@ -730,7 +730,7 @@ void TopLevel::configureToolBars() { saveMainWindowSettings(KGlobal::config(), "TopLevelWindow"); KEditToolbar dlg(actionCollection(), "kitenui.rc"); - connect(&dlg, SIGNAL(newToolbarConfig()), SLOT(newToolBarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_SLOT(newToolBarConfig())); dlg.exec(); } @@ -743,27 +743,27 @@ void TopLevel::newToolBarConfig() RadWidget *TopLevel::radicalSearch() { RadWidget *rw = new RadWidget(&_Rad, 0, "rw"); - connect(rw, SIGNAL(set(const QStringList &, unsigned int, unsigned int)), this, SLOT(radSearch(const QStringList &, unsigned int, unsigned int))); + connect(rw, TQT_SIGNAL(set(const TQStringList &, unsigned int, unsigned int)), this, TQT_SLOT(radSearch(const TQStringList &, unsigned int, unsigned int))); rw->show(); return rw; } -void TopLevel::radSearch(const QStringList &_list, unsigned int strokes, unsigned int errorMargin) +void TopLevel::radSearch(const TQStringList &_list, unsigned int strokes, unsigned int errorMargin) { //kdDebug() << "TopLevel::radSearch\n"; - QStringList list(_Rad.kanjiByRad(_list)); + TQStringList list(_Rad.kanjiByRad(_list)); - QStringList::iterator it; + TQStringList::iterator it; Dict::SearchResult hist; hist.count = 0; hist.outOf = 0; hist.common = comCB->isChecked(); - QString prettyRadicalString; + TQString prettyRadicalString; bool already = false; - for (QStringList::ConstIterator it = _list.begin(); it != _list.end(); ++it) + for (TQStringList::ConstIterator it = _list.begin(); it != _list.end(); ++it) { if (already) prettyRadicalString.append(", "); @@ -779,16 +779,16 @@ void TopLevel::radSearch(const QStringList &_list, unsigned int strokes, unsigne else hist.list.append(Dict::Entry(i18n("Kanji with radical(s) %1").arg(prettyRadicalString), true)); - QString strokesString; + TQString strokesString; if (strokes) { - strokesString = QString::number(strokes); + strokesString = TQString::number(strokes); for (unsigned i = 1; i <= errorMargin; ++i) { strokesString.append('|'); strokesString.prepend('|'); - strokesString.append(QString::number(strokes + i)); - strokesString.prepend(QString::number(strokes - i)); + strokesString.append(TQString::number(strokes + i)); + strokesString.prepend(TQString::number(strokes - i)); } strokesString.append(')'); @@ -800,7 +800,7 @@ void TopLevel::radSearch(const QStringList &_list, unsigned int strokes, unsigne for (it = list.begin(); it != list.end(); ++it) { - Dict::SearchResult results = _Asyndeta.retrieveIndex()->searchKanji(QRegExp(strokes? (QString("S%1 ").arg(strokesString)) : (QString("^") + (*it)) ), (*it), comCB->isChecked()); + Dict::SearchResult results = _Asyndeta.retrieveIndex()->searchKanji(TQRegExp(strokes? (TQString("S%1 ").arg(strokesString)) : (TQString("^") + (*it)) ), (*it), comCB->isChecked()); hist.outOf += results.outOf; if (results.count < 1) @@ -851,7 +851,7 @@ void TopLevel::historySpotChanged() void TopLevel::addHistory(Dict::SearchResult result) { - QStringList newHistoryList = historyAction->items(); + TQStringList newHistoryList = historyAction->items(); // remove from back till we hit currentResult while (resultHistory.fromLast() != currentResult) diff --git a/kiten/kiten.h b/kiten/kiten.h index b991b0a5..13500898 100644 --- a/kiten/kiten.h +++ b/kiten/kiten.h @@ -43,7 +43,7 @@ class KDE_EXPORT TopLevel : public KMainWindow Q_OBJECT public: - TopLevel(QWidget *parent = 0, const char *name = 0); + TopLevel(TQWidget *parent = 0, const char *name = 0); ~TopLevel(); signals: @@ -56,7 +56,7 @@ protected: private slots: void search(bool inResults = false); - void ressearch(const QString&); + void ressearch(const TQString&); void searchBeginning(); void searchAnywhere(); void resultSearch(); @@ -79,7 +79,7 @@ private slots: void toggleCom(); void addToList(); RadWidget *radicalSearch(); - void radSearch(const QStringList &, unsigned int, unsigned int); + void radSearch(const TQStringList &, unsigned int, unsigned int); void print(); @@ -111,21 +111,21 @@ private: KGlobalAccel *Accel; - void doSearch(const QString &text, QRegExp regexp); - void doSearchInResults(const QString &text, QRegExp regexp); + void doSearch(const TQString &text, TQRegExp regexp); + void doSearchInResults(const TQString &text, TQRegExp regexp); void handleSearchResult(Dict::SearchResult); - QString filteredClipboardText(); - QString clipBoardText(); + TQString filteredClipboardText(); + TQString clipBoardText(); ConfigureDialog *optionDialog; Config* config; void setResults(unsigned int, unsigned int); - QPtrList learnList; + TQPtrList learnList; - QRegExp searchItems(); - QRegExp readingSearchItems(bool); - QRegExp kanjiSearchItems(bool = false); + TQRegExp searchItems(); + TQRegExp readingSearchItems(bool); + TQRegExp kanjiSearchItems(bool = false); EditAction *Edit; @@ -134,13 +134,13 @@ private: Dict::Entry toAddKanji; - QValueList resultHistory; - QValueListIterator currentResult; + TQValueList resultHistory; + TQValueListIterator currentResult; int currentResultIndex; void addHistory(Dict::SearchResult); void enableHistoryButtons(); - QString personalDict; + TQString personalDict; }; #endif diff --git a/kiten/kloader.cpp b/kiten/kloader.cpp index c13aaa4b..6ae2da6c 100644 --- a/kiten/kloader.cpp +++ b/kiten/kloader.cpp @@ -43,12 +43,12 @@ public: delete dataStream; } bool isLocal; - QString tempFile; - QFile *file; + TQString tempFile; + TQFile *file; KURL url; - QString error; - QTextStream *textStream; - QDataStream *dataStream; + TQString error; + TQTextStream *textStream; + TQDataStream *dataStream; }; KLoader::KLoader(const KURL &target) @@ -59,7 +59,7 @@ KLoader::KLoader(const KURL &target) if(d->url.protocol() == "file") { d->isLocal = true; - d->file = new QFile(d->url.path()); + d->file = new TQFile(d->url.path()); } else { @@ -91,7 +91,7 @@ bool KLoader::open(void) return false; } - d->file = new QFile(d->tempFile); + d->file = new TQFile(d->tempFile); if(!d->file->open(IO_ReadOnly)) { d->error = i18n("Could not read from %1.").arg(d->tempFile); @@ -113,20 +113,20 @@ void KLoader::close(void) KIO::NetAccess::removeTempFile(d->tempFile); } -QString KLoader::error(void) +TQString KLoader::error(void) { return d->error; } -QFile &KLoader::file(void) +TQFile &KLoader::file(void) { if(d->file) return *d->file; else - return *static_cast(0); + return *static_cast(0); } -QTextStream &KLoader::textStream() +TQTextStream &KLoader::textStream() { if(d->textStream) { @@ -134,16 +134,16 @@ QTextStream &KLoader::textStream() } else if(d->file) { - d->textStream = new QTextStream(d->file); + d->textStream = new TQTextStream(d->file); return *d->textStream; } else { - return *static_cast(0); + return *static_cast(0); } } -QDataStream &KLoader::dataStream() +TQDataStream &KLoader::dataStream() { if(d->dataStream) { @@ -151,11 +151,11 @@ QDataStream &KLoader::dataStream() } else if(d->file) { - d->dataStream = new QDataStream(d->file); + d->dataStream = new TQDataStream(d->file); return *d->dataStream; } else { - return *static_cast(0); + return *static_cast(0); } } diff --git a/kiten/kloader.h b/kiten/kloader.h index 5682b21f..816d29c3 100644 --- a/kiten/kloader.h +++ b/kiten/kloader.h @@ -24,7 +24,7 @@ #ifndef KLOADER_H #define KLOADER_H -#include +#include /** * KLoader provides a way to load files in the most efficient way for @@ -35,7 +35,7 @@ class KLoader public: /** * The constructor takes the url and decides the best way to save, - * which will mean using something like KIO::NetAccess or QFile. + * which will mean using something like KIO::NetAccess or TQFile. */ KLoader(const KURL &_target); @@ -60,29 +60,29 @@ public: * If open or close returns false, there was an error, and error * returns what the error was, when available. */ - QString error(void); + TQString error(void); /** - * file returns a QFile open for reading, which may be for a temporary + * file returns a TQFile open for reading, which may be for a temporary * file on the local filesystem. * * If this is called before the file is opened, you will crash. */ - QFile &file(void); + TQFile &file(void); /** * You can use this to read in your data. * * If this is called before the file is opened, you will crash. */ - QTextStream &textStream(void); + TQTextStream &textStream(void); /** * You can use this to read in your data. * * If this is called before the file is opened, you will crash. */ - QDataStream &dataStream(void); + TQDataStream &dataStream(void); private: class KLoaderPrivate; KLoaderPrivate *d; diff --git a/kiten/kromajiedit.cpp b/kiten/kromajiedit.cpp index 758a1267..d58ff2e0 100644 --- a/kiten/kromajiedit.cpp +++ b/kiten/kromajiedit.cpp @@ -22,39 +22,39 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "kromajiedit.h" -KRomajiEdit::KRomajiEdit(QWidget *parent, const char *name) +KRomajiEdit::KRomajiEdit(TQWidget *parent, const char *name) : KLineEdit(parent, name) { kana = "unset"; KStandardDirs *dirs = KGlobal::dirs(); - QString romkana = dirs->findResource("data", "kiten/romkana.cnv"); + TQString romkana = dirs->findResource("data", "kiten/romkana.cnv"); if (romkana.isNull()) { KMessageBox::error(0, i18n("Romaji information file not installed, so Romaji conversion cannot be used.")); return; } - QFile f(romkana); + TQFile f(romkana); if (!f.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("Romaji information could not be loaded, so Romaji conversion cannot be used.")); } - QTextStream t(&f); - t.setCodec(QTextCodec::codecForName("eucJP")); + TQTextStream t(&f); + t.setCodec(TQTextCodec::codecForName("eucJP")); while (!t.eof()) { - QString s = t.readLine(); + TQString s = t.readLine(); - QChar first = s.at(0); + TQChar first = s.at(0); if (first == '#') // comment! { // nothing @@ -68,9 +68,9 @@ KRomajiEdit::KRomajiEdit(QWidget *parent, const char *name) } else // body { - QStringList things(QStringList::split(QChar(' '), s)); - QString thekana(things.first()); - QString romaji(*things.at(1)); + TQStringList things(TQStringList::split(TQChar(' '), s)); + TQString thekana(things.first()); + TQString romaji(*things.at(1)); if (kana == "hiragana") hiragana[romaji] = thekana; @@ -104,10 +104,10 @@ void KRomajiEdit::setKana(int _kana) } // TODO allow editing not only at end -void KRomajiEdit::keyPressEvent(QKeyEvent *e) +void KRomajiEdit::keyPressEvent(TQKeyEvent *e) { bool shift = e->state() & ShiftButton; - QString ji = e->text(); + TQString ji = e->text(); if (shift && e->key() == Key_Space) // switch hiragana/english { @@ -133,22 +133,22 @@ void KRomajiEdit::keyPressEvent(QKeyEvent *e) //kdDebug() << "--------------------\n"; - QString curEng; - QString curKana; - QString _text = text(); + TQString curEng; + TQString curKana; + TQString _text = text(); int i; unsigned int len = _text.length(); //kdDebug() << "length = " << len << endl; for (i = len - 1; i >= 0; i--) { - QChar at = _text.at(i); + TQChar at = _text.at(i); - //kdDebug() << "at = " << QString(at) << endl; + //kdDebug() << "at = " << TQString(at) << endl; if (at.row() == 0 && at != '.') { - //kdDebug() << "prepending " << QString(at) << endl; + //kdDebug() << "prepending " << TQString(at) << endl; curEng.prepend(at); } else @@ -163,7 +163,7 @@ void KRomajiEdit::keyPressEvent(QKeyEvent *e) ji = ji.lower(); //kdDebug() << "ji = " << ji << endl; - QString replace; + TQString replace; //kdDebug () << "kana is " << kana << endl; if (kana == "hiragana") @@ -186,7 +186,7 @@ void KRomajiEdit::keyPressEvent(QKeyEvent *e) else { //kdDebug() << "replace is empty\n"; - QString farRight(ji.right(ji.length() - 1)); + TQString farRight(ji.right(ji.length() - 1)); //kdDebug() << "ji = " << ji << endl; //kdDebug() << "farRight = " << farRight << endl; @@ -204,7 +204,7 @@ void KRomajiEdit::keyPressEvent(QKeyEvent *e) } // test for hanging n - QString newkana; + TQString newkana; if (kana == "hiragana") { newkana = hiragana[farRight]; @@ -253,9 +253,9 @@ void KRomajiEdit::keyPressEvent(QKeyEvent *e) KLineEdit::keyPressEvent(e); // don't think we'll get here :) } -QPopupMenu *KRomajiEdit::createPopupMenu() +TQPopupMenu *KRomajiEdit::createPopupMenu() { - QPopupMenu *popup = KLineEdit::createPopupMenu(); + TQPopupMenu *popup = KLineEdit::createPopupMenu(); popup->insertSeparator(); popup->insertItem(i18n("English"), 0); popup->insertItem(i18n("Kana"), 1); @@ -265,7 +265,7 @@ QPopupMenu *KRomajiEdit::createPopupMenu() else if (kana == "hiragana") popup->setItemChecked(1, true); - connect(popup, SIGNAL(activated(int)), SLOT(setKana(int))); + connect(popup, TQT_SIGNAL(activated(int)), TQT_SLOT(setKana(int))); emit aboutToShowContextMenu(popup); return popup; diff --git a/kiten/kromajiedit.h b/kiten/kromajiedit.h index fa060cd8..b8cef88c 100644 --- a/kiten/kromajiedit.h +++ b/kiten/kromajiedit.h @@ -21,8 +21,8 @@ #ifndef KROMAJIEDIT_H #define KROMAJIEDIT_H -#include -#include +#include +#include #include @@ -35,21 +35,21 @@ class KRomajiEdit : public KLineEdit Q_OBJECT public: - KRomajiEdit(QWidget *parent, const char *name); + KRomajiEdit(TQWidget *parent, const char *name); ~KRomajiEdit(); public slots: void setKana(int); protected: - void keyPressEvent(QKeyEvent *e); - QPopupMenu *createPopupMenu(); + void keyPressEvent(TQKeyEvent *e); + TQPopupMenu *createPopupMenu(); private: - QMap hiragana; - QMap katakana; + TQMap hiragana; + TQMap katakana; - QCString kana; + TQCString kana; }; #endif diff --git a/kiten/ksaver.cpp b/kiten/ksaver.cpp index 6c09ffa9..8e36f6d1 100644 --- a/kiten/ksaver.cpp +++ b/kiten/ksaver.cpp @@ -46,11 +46,11 @@ public: } bool isLocal; KTempFile *tempFile; - QFile *file; + TQFile *file; KURL url; - QString error; - QTextStream *textStream; - QDataStream *dataStream; + TQString error; + TQTextStream *textStream; + TQDataStream *dataStream; }; KSaver::KSaver(const KURL &_target) @@ -61,7 +61,7 @@ KSaver::KSaver(const KURL &_target) if(d->url.protocol() == "file") { d->isLocal = true; - d->file = new QFile(d->url.path()); + d->file = new TQFile(d->url.path()); } else { @@ -127,22 +127,22 @@ bool KSaver::close(void) } } -QString KSaver::error(void) +TQString KSaver::error(void) { return d->error; } -QFile &KSaver::file(void) +TQFile &KSaver::file(void) { if(d->isLocal && d->file) return *d->file; else if(!d->isLocal && d->tempFile) return *d->tempFile->file(); else - return *static_cast(0); + return *static_cast(0); } -QTextStream &KSaver::textStream() +TQTextStream &KSaver::textStream() { if(d->textStream) { @@ -150,7 +150,7 @@ QTextStream &KSaver::textStream() } else if(d->isLocal && d->file) { - d->textStream = new QTextStream(d->file); + d->textStream = new TQTextStream(d->file); return *d->textStream; } else if(!d->isLocal && d->tempFile) @@ -160,11 +160,11 @@ QTextStream &KSaver::textStream() } else { - return *static_cast(0); + return *static_cast(0); } } -QDataStream &KSaver::dataStream() +TQDataStream &KSaver::dataStream() { if(d->dataStream) { @@ -172,7 +172,7 @@ QDataStream &KSaver::dataStream() } else if(d->isLocal && d->file) { - d->dataStream = new QDataStream(d->file); + d->dataStream = new TQDataStream(d->file); return *d->dataStream; } else if(!d->isLocal && d->tempFile) @@ -182,6 +182,6 @@ QDataStream &KSaver::dataStream() } else { - return *static_cast(0); + return *static_cast(0); } } diff --git a/kiten/ksaver.h b/kiten/ksaver.h index b4ebb890..8c73f7c1 100644 --- a/kiten/ksaver.h +++ b/kiten/ksaver.h @@ -24,7 +24,7 @@ #ifndef KSAVER_H #define KSAVER_H -#include +#include /** * KSaver provides a way to save files in the most efficient way for @@ -35,7 +35,7 @@ class KSaver public: /** * The constructor takes the url and decides the best way to save, - * which will mean using something like KIO::NetAccess or QFile. + * which will mean using something like KIO::NetAccess or TQFile. */ KSaver(const KURL &_target); @@ -62,29 +62,29 @@ public: * If open or close returns false, there was an error, and error * returns what the error was, when available. */ - QString error(void); + TQString error(void); /** - * file returns a QFile open for writing, which may be for a temporary + * file returns a TQFile open for writing, which may be for a temporary * file on the local filesystem. * * If this is called before the file is opened, you will crash. */ - QFile &file(void); + TQFile &file(void); /** * You can use this to write out your data. * * If this is called before the file is opened, you will crash. */ - QTextStream &textStream(void); + TQTextStream &textStream(void); /** * You can use this to write out your data. * * If this is called before the file is opened, you will crash. */ - QDataStream &dataStream(void); + TQDataStream &dataStream(void); private: class KSaverPrivate; KSaverPrivate *d; diff --git a/kiten/learn.cpp b/kiten/learn.cpp index 30744142..02b21618 100644 --- a/kiten/learn.cpp +++ b/kiten/learn.cpp @@ -29,12 +29,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include // RAND_MAX #include @@ -46,12 +46,12 @@ #include "ksaver.h" #include "learn.h" -LearnItem::LearnItem(QListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5, QString label6, QString label7, QString label8) - : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) +LearnItem::LearnItem(TQListView *parent, TQString label1, TQString label2, TQString label3, TQString label4, TQString label5, TQString label6, TQString label7, TQString label8) + : TQListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { } -int LearnItem::compare(QListViewItem *item, int col, bool ascending) const +int LearnItem::compare(TQListViewItem *item, int col, bool ascending) const { // "Returns < 0 if this item is less than i [item] , 0 if they // are equal and > 0 if this item is greater than i [item]." @@ -60,28 +60,28 @@ int LearnItem::compare(QListViewItem *item, int col, bool ascending) const const int Learn::numberOfAnswers = 5; -Learn::Learn(Dict::Index *parentDict, QWidget *parent, const char *name) +Learn::Learn(Dict::Index *parentDict, TQWidget *parent, const char *name) : KMainWindow(parent, name), initialized(false), isMod(false), prevItem(0), curItem(0) { index = parentDict; - QWidget *dummy = new QWidget(this); + TQWidget *dummy = new TQWidget(this); setCentralWidget(dummy); - QVBoxLayout *veryTop = new QVBoxLayout(dummy, 0, KDialog::spacingHint()); - Tabs = new QTabWidget(dummy); - connect(Tabs, SIGNAL(currentChanged(QWidget *)), SLOT(tabChanged(QWidget *))); + TQVBoxLayout *veryTop = new TQVBoxLayout(dummy, 0, KDialog::spacingHint()); + Tabs = new TQTabWidget(dummy); + connect(Tabs, TQT_SIGNAL(currentChanged(TQWidget *)), TQT_SLOT(tabChanged(TQWidget *))); veryTop->addWidget(Tabs); - listTop = new QSplitter(Tabs); + listTop = new TQSplitter(Tabs); listTop->setOrientation(Qt::Vertical); - quizTop = new QWidget(Tabs); + quizTop = new TQWidget(Tabs); Tabs->addTab(listTop, i18n("&List")); Tabs->addTab(quizTop, i18n("&Quiz")); View = new ResultView(true, listTop, "View"); View->setBasicMode(true); - connect(View, SIGNAL(linkClicked(const QString &)), this, SIGNAL(linkClicked(const QString &))); + connect(View, TQT_SIGNAL(linkClicked(const TQString &)), this, TQT_SIGNAL(linkClicked(const TQString &))); List = new KListView(listTop); @@ -92,19 +92,19 @@ Learn::Learn(Dict::Index *parentDict, QWidget *parent, const char *name) List->addColumn(i18n("Your Score")); List->setAllColumnsShowFocus(true); - List->setColumnWidthMode(0, QListView::Maximum); - List->setColumnWidthMode(1, QListView::Maximum); - List->setColumnWidthMode(2, QListView::Maximum); - List->setColumnWidthMode(3, QListView::Maximum); + List->setColumnWidthMode(0, TQListView::Maximum); + List->setColumnWidthMode(1, TQListView::Maximum); + List->setColumnWidthMode(2, TQListView::Maximum); + List->setColumnWidthMode(3, TQListView::Maximum); List->setMultiSelection(true); List->setDragEnabled(true); List->setSorting(4); List->setSelectionModeExt(KListView::Extended); - connect(List, SIGNAL(executed(QListViewItem *)), SLOT(showKanji(QListViewItem *))); - connect(List, SIGNAL(selectionChanged()), this, SLOT(itemSelectionChanged())); + connect(List, TQT_SIGNAL(executed(TQListViewItem *)), TQT_SLOT(showKanji(TQListViewItem *))); + connect(List, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(itemSelectionChanged())); - QStringList grades(i18n("Grade 1")); + TQStringList grades(i18n("Grade 1")); grades.append(i18n("Grade 2")); grades.append(i18n("Grade 3")); grades.append(i18n("Grade 4")); @@ -113,45 +113,45 @@ Learn::Learn(Dict::Index *parentDict, QWidget *parent, const char *name) grades.append(i18n("Others in Jouyou")); grades.append(i18n("Jinmeiyou")); - /*KAction *closeAction = */(void) KStdAction::close(this, SLOT(close()), actionCollection()); - printAct = KStdAction::print(this, SLOT(print()), actionCollection()); - forwardAct = KStdAction::forward(this, SLOT(next()), actionCollection()); + /*KAction *closeAction = */(void) KStdAction::close(this, TQT_SLOT(close()), actionCollection()); + printAct = KStdAction::print(this, TQT_SLOT(print()), actionCollection()); + forwardAct = KStdAction::forward(this, TQT_SLOT(next()), actionCollection()); forwardAct->plug(toolBar()); - backAct = KStdAction::back(this, SLOT(prev()), actionCollection()); + backAct = KStdAction::back(this, TQT_SLOT(prev()), actionCollection()); backAct->plug(toolBar()); - cheatAct = new KAction(i18n("&Cheat"), CTRL + Key_C, this, SLOT(cheat()), actionCollection(), "cheat"); - randomAct = new KAction(i18n("&Random"), "goto", CTRL + Key_R, this, SLOT(random()), actionCollection(), "random"); + cheatAct = new KAction(i18n("&Cheat"), CTRL + Key_C, this, TQT_SLOT(cheat()), actionCollection(), "cheat"); + randomAct = new KAction(i18n("&Random"), "goto", CTRL + Key_R, this, TQT_SLOT(random()), actionCollection(), "random"); gradeAct = new KListAction(i18n("Grade"), 0, 0, 0, actionCollection(), "grade"); gradeAct->setItems(grades); - connect(gradeAct, SIGNAL(activated(const QString&)), SLOT(updateGrade())); - removeAct = new KAction(i18n("&Delete"), "edit_remove", CTRL + Key_X, this, SLOT(del()), actionCollection(), "del"); - addAct = new KAction(i18n("&Add"), "edit_add", CTRL + Key_A, this, SLOT(add()), actionCollection(), "add"); - addAllAct = new KAction(i18n("Add A&ll"), 0, this, SLOT(addAll()), actionCollection(), "addall"); - newAct = KStdAction::openNew(this, SLOT(openNew()), actionCollection()); - openAct = KStdAction::open(this, SLOT(open()), actionCollection()); - saveAct = KStdAction::save(this, SLOT(save()), actionCollection()); - saveAsAct = KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); - (void) KStdAction::preferences(this, SIGNAL(configureLearn()), actionCollection()); + connect(gradeAct, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(updateGrade())); + removeAct = new KAction(i18n("&Delete"), "edit_remove", CTRL + Key_X, this, TQT_SLOT(del()), actionCollection(), "del"); + addAct = new KAction(i18n("&Add"), "edit_add", CTRL + Key_A, this, TQT_SLOT(add()), actionCollection(), "add"); + addAllAct = new KAction(i18n("Add A&ll"), 0, this, TQT_SLOT(addAll()), actionCollection(), "addall"); + newAct = KStdAction::openNew(this, TQT_SLOT(openNew()), actionCollection()); + openAct = KStdAction::open(this, TQT_SLOT(open()), actionCollection()); + saveAct = KStdAction::save(this, TQT_SLOT(save()), actionCollection()); + saveAsAct = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + (void) KStdAction::preferences(this, TQT_SIGNAL(configureLearn()), actionCollection()); removeAct->setEnabled(false); - QVBoxLayout *quizLayout = new QVBoxLayout(quizTop, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *quizLayout = new TQVBoxLayout(quizTop, KDialog::marginHint(), KDialog::spacingHint()); quizLayout->addStretch(); - QHBoxLayout *hlayout = new QHBoxLayout(quizLayout); - qKanji = new QPushButton(quizTop); - connect(qKanji, SIGNAL(clicked()), this, SLOT(qKanjiClicked())); + TQHBoxLayout *hlayout = new TQHBoxLayout(quizLayout); + qKanji = new TQPushButton(quizTop); + connect(qKanji, TQT_SIGNAL(clicked()), this, TQT_SLOT(qKanjiClicked())); hlayout->addStretch(); hlayout->addWidget(qKanji); hlayout->addStretch(); quizLayout->addStretch(); - answers = new QButtonGroup(1, Horizontal, quizTop); + answers = new TQButtonGroup(1, Horizontal, quizTop); for (int i = 0; i < numberOfAnswers; ++i) answers->insert(new KPushButton(answers), i); quizLayout->addWidget(answers); quizLayout->addStretch(); - connect(answers, SIGNAL(clicked(int)), this, SLOT(answerClicked(int))); + connect(answers, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(answerClicked(int))); createGUI("learnui.rc"); //closeAction->plug(toolBar()); @@ -164,7 +164,7 @@ Learn::Learn(Dict::Index *parentDict, QWidget *parent, const char *name) nogood = false; // this is so learn doesn't take so long to show itself - QTimer::singleShot(200, this, SLOT(finishCtor())); + TQTimer::singleShot(200, this, TQT_SLOT(finishCtor())); } void Learn::finishCtor() @@ -181,7 +181,7 @@ void Learn::finishCtor() updateGrade(); updateQuizConfiguration(); // first - QString entry = config->lastFile(); + TQString entry = config->lastFile(); //kdDebug() << "lastFile: " << entry << endl; if (!entry.isEmpty()) { @@ -296,12 +296,12 @@ void Learn::update() // now show some compounds in which this kanji appears - QString kanji = curKanji.kanji(); + TQString kanji = curKanji.kanji(); - Dict::SearchResult compounds = index->search(QRegExp(kanji), kanji, true); + Dict::SearchResult compounds = index->search(TQRegExp(kanji), kanji, true); View->addHeader(i18n("%1 in compounds").arg(kanji)); - for (QValueListIterator it = compounds.list.begin(); it != compounds.list.end(); ++it) + for (TQValueListIterator it = compounds.list.begin(); it != compounds.list.end(); ++it) { kapp->processEvents(); View->addResult(*it, true); @@ -314,10 +314,10 @@ void Learn::updateGrade() { int grade = getCurrentGrade(); - QString regexp("G%1 "); + TQString regexp("G%1 "); regexp = regexp.arg(grade); - Dict::SearchResult result = index->searchKanji(QRegExp(regexp), regexp, false); + Dict::SearchResult result = index->searchKanji(TQRegExp(regexp), regexp, false); list = result.list; statusBar()->message(i18n("%1 entries in grade %2").arg(list.count()).arg(grade)); @@ -340,18 +340,18 @@ void Learn::read(const KURL &url) return; } - QTextCodec &codec = *QTextCodec::codecForName("eucJP"); - QTextStream &stream = loader.textStream(); + TQTextCodec &codec = *TQTextCodec::codecForName("eucJP"); + TQTextStream &stream = loader.textStream(); stream.setCodec(&codec); while (!stream.atEnd()) { - QChar kanji; + TQChar kanji; stream >> kanji; // ignore whitespace if (!kanji.isSpace()) { - QRegExp regexp ( QString("^%1\\W").arg(kanji) ); + TQRegExp regexp ( TQString("^%1\\W").arg(kanji) ); Dict::SearchResult res = index->searchKanji(regexp, kanji, false); Dict::Entry first = Dict::firstEntry(res); if (first.extendedKanjiInfo()) @@ -368,7 +368,7 @@ void Learn::open() return; KURL prevname = filename; - filename = KFileDialog::getOpenURL(QString::null, "*.kiten"); + filename = KFileDialog::getOpenURL(TQString::null, "*.kiten"); if (filename.isEmpty()) { filename = prevname; @@ -407,7 +407,7 @@ void Learn::openNew() void Learn::saveAs() { KURL prevname = filename; - filename = KFileDialog::getSaveURL(QString::null, "*.kiten"); + filename = KFileDialog::getSaveURL(TQString::null, "*.kiten"); if (filename.isEmpty()) { filename = prevname; @@ -439,11 +439,11 @@ void Learn::write(const KURL &url) return; } - QTextCodec &codec = *QTextCodec::codecForName("eucJP"); - QTextStream &stream = saver.textStream(); + TQTextCodec &codec = *TQTextCodec::codecForName("eucJP"); + TQTextStream &stream = saver.textStream(); stream.setCodec(&codec); - for (QListViewItemIterator it(List); it.current(); ++it) + for (TQListViewItemIterator it(List); it.current(); ++it) stream << it.current()->text(0).at(0); if (!saver.close()) @@ -463,7 +463,7 @@ void Learn::saveScores() { KConfig &config = *Config::self()->config(); config.setGroup("Learn Scores"); - for (QListViewItemIterator it(List); it.current(); ++it) + for (TQListViewItemIterator it(List); it.current(); ++it) config.writeEntry(it.current()->text(0), it.current()->text(4).toInt()); config.sync(); Config::self()->writeConfig(); @@ -472,16 +472,16 @@ void Learn::saveScores() void Learn::add(Dict::Entry toAdd, bool noEmit) { // Remove peripheral readings: This is a study mode, not a reference mode - QRegExp inNames (",\\s*[A-Za-z ]+:.*"); - QString readings = Dict::prettyKanjiReading(toAdd.readings()).replace(inNames, ""); - QString meanings = shortenString(Dict::prettyMeaning(toAdd.meanings()).replace(inNames, "")); - QString kanji = toAdd.kanji(); + TQRegExp inNames (",\\s*[A-Za-z ]+:.*"); + TQString readings = Dict::prettyKanjiReading(toAdd.readings()).replace(inNames, ""); + TQString meanings = shortenString(Dict::prettyMeaning(toAdd.meanings()).replace(inNames, "")); + TQString kanji = toAdd.kanji(); // here's a dirty rotten cheat (well, not really) // noEmit always means it's not added by the user, so this check isn't needed if (!noEmit) { - for (QListViewItemIterator it(List); it.current(); ++it) + for (TQListViewItemIterator it(List); it.current(); ++it) { if (it.current()->text(0) == kanji) { @@ -499,7 +499,7 @@ void Learn::add(Dict::Entry toAdd, bool noEmit) score = config.readNumEntry(kanji, score); unsigned int grade = toAdd.grade(); - addItem(new LearnItem(List, kanji, meanings, readings, QString::number(grade), QString::number(score)), noEmit); + addItem(new LearnItem(List, kanji, meanings, readings, TQString::number(grade), TQString::number(score)), noEmit); numChanged(); } @@ -514,11 +514,11 @@ void Learn::addAll() { int grade = getCurrentGrade(); - QString regexp("G%1 "); + TQString regexp("G%1 "); regexp = regexp.arg(grade); - Dict::SearchResult result = index->searchKanji(QRegExp(regexp), regexp, false); - for (QValueListIterator i = result.list.begin(); i != result.list.end(); ++i) + Dict::SearchResult result = index->searchKanji(TQRegExp(regexp), regexp, false); + for (TQValueListIterator i = result.list.begin(); i != result.list.end(); ++i) { // don't add headers if ((*i).dictName() == "__NOTSET" && (*i).header() == "__NOTSET") @@ -526,7 +526,7 @@ void Learn::addAll() } } -void Learn::addItem(QListViewItem *item, bool noEmit) +void Learn::addItem(TQListViewItem *item, bool noEmit) { // 2 is the magic jump if (List->childCount() == 2) @@ -545,11 +545,11 @@ void Learn::addItem(QListViewItem *item, bool noEmit) } } -void Learn::showKanji(QListViewItem *item) +void Learn::showKanji(TQListViewItem *item) { assert(item); - QString kanji(item->text(0)); + TQString kanji(item->text(0)); int grade = item->text(3).toUInt(); if (getCurrentGrade() != grade) @@ -575,12 +575,12 @@ void Learn::del() } else // setup page { - QPtrList selected = List->selectedItems(); + TQPtrList selected = List->selectedItems(); assert(selected.count()); bool makenewq = false; // must make new quiz if we // delete the current item - for (QPtrListIterator i(selected); *i; ++i) + for (TQPtrListIterator i(selected); *i; ++i) { if (curItem == i) makenewq = true; @@ -607,14 +607,14 @@ void Learn::del() void Learn::print() { View->clear(); - View->addHeader(QString("

%1

").arg(i18n("Learning List")), 1); + View->addHeader(TQString("

%1

").arg(i18n("Learning List")), 1); - QListViewItemIterator it(List); + TQListViewItemIterator it(List); for (; it.current(); ++it) { - QString kanji = it.current()->text(0); - Dict::SearchResult result = index->searchKanji(QRegExp(kanji), kanji, false); - for (QValueListIterator i = result.list.begin(); i != result.list.end(); ++i) + TQString kanji = it.current()->text(0); + Dict::SearchResult result = index->searchKanji(TQRegExp(kanji), kanji, false); + for (TQValueListIterator i = result.list.begin(); i != result.list.end(); ++i) { if ((*i).dictName() == "__NOTSET" && (*i).header() == "__NOTSET") { @@ -665,7 +665,7 @@ void Learn::answerClicked(int i) //config.writeEntry(curItem->text(0) + "_4", newscore); - QListViewItem *newItem = new LearnItem(List, curItem->text(0), curItem->text(1), curItem->text(2), curItem->text(3), QString::number(newscore)); + TQListViewItem *newItem = new LearnItem(List, curItem->text(0), curItem->text(1), curItem->text(2), curItem->text(3), TQString::number(newscore)); // readd, so it sorts // 20 November 2004: why?? why not List->sort() ?? @@ -677,9 +677,9 @@ void Learn::answerClicked(int i) qnew(); } -QString Learn::randomMeaning(QStringList &oldMeanings) +TQString Learn::randomMeaning(TQStringList &oldMeanings) { - QString meaning; + TQString meaning; do { @@ -717,14 +717,14 @@ QString Learn::randomMeaning(QStringList &oldMeanings) int max = (int) rand; - QListViewItemIterator it(List); + TQListViewItemIterator it(List); it += max; meaning = it.current()->text(guessOn); } //kdDebug() << "meaning: " << meaning << endl; - for (QStringList::Iterator it = oldMeanings.begin(); it != oldMeanings.end(); ++it) + for (TQStringList::Iterator it = oldMeanings.begin(); it != oldMeanings.end(); ++it) { //kdDebug() << "oldMeaning: " << *it << endl; } @@ -744,7 +744,7 @@ void Learn::qupdate() return; qKanji->setText(curItem->text(quizOn)); - QFont newFont = font(); + TQFont newFont = font(); if (quizOn == 0) newFont.setPixelSize(24); qKanji->setFont(newFont); @@ -753,7 +753,7 @@ void Learn::qupdate() float rand2 = RAND_MAX / rand; seikai = static_cast(numberOfAnswers / rand2); - QStringList oldMeanings; + TQStringList oldMeanings; for (int i = 0; i < numberOfAnswers; ++i) answers->find(i)->setText(randomMeaning(oldMeanings)); @@ -762,7 +762,7 @@ void Learn::qupdate() struct Learn::scoreCompare { - bool operator()(const QListViewItem* v1, const QListViewItem* v2) + bool operator()(const TQListViewItem* v1, const TQListViewItem* v2) { return v1->text(4).toInt() < v2->text(4).toInt(); } @@ -774,7 +774,7 @@ void Learn::qnew() // new quiz kanji nogood = false; statusBar()->clear(); - statusBar()->message(QString("%1 %2 %3").arg(curItem->text(0)).arg(curItem->text(1)).arg(curItem->text(2))); + statusBar()->message(TQString("%1 %2 %3").arg(curItem->text(0)).arg(curItem->text(1)).arg(curItem->text(2))); backAct->setEnabled(true); @@ -797,14 +797,14 @@ void Learn::qnew() // new quiz kanji if (max > count) max = count; - std::multiset scores; - QListViewItemIterator sIt(List); + std::multiset scores; + TQListViewItemIterator sIt(List); for (; sIt.current(); ++sIt) scores.insert(sIt.current()); - std::multiset::iterator it = scores.begin(); - std::multiset::iterator tmp = scores.begin(); + std::multiset::iterator it = scores.begin(); + std::multiset::iterator tmp = scores.begin(); int i; for (i = 2; i <= max; ++it) @@ -826,7 +826,7 @@ void Learn::qnew() // new quiz kanji } prevItem = curItem; - curItem = const_cast(*it); + curItem = const_cast(*it); qKanji->setFocus(); qupdate(); @@ -839,12 +839,12 @@ void Learn::cheat() nogood = true; } -QString Learn::shortenString(const QString &thestring) +TQString Learn::shortenString(const TQString &thestring) { return KStringHandler::rsqueeze(thestring, 60).stripWhiteSpace(); } -void Learn::tabChanged(QWidget *widget) +void Learn::tabChanged(TQWidget *widget) { bool isQuiz = (widget == quizTop); diff --git a/kiten/learn.h b/kiten/learn.h index bd7a103a..340ece01 100644 --- a/kiten/learn.h +++ b/kiten/learn.h @@ -22,7 +22,7 @@ #ifndef LEARN_H #define LEARN_H -#include +#include #include @@ -39,8 +39,8 @@ class QTabWidget; class LearnItem : public QListViewItem { public: - LearnItem(QListView *parent, QString label1, QString label2 = QString::null, QString label3 = QString::null, QString label4 = QString::null, QString label5 = QString::null, QString label6 = QString::null, QString label7 = QString::null, QString label8 = QString::null); - int compare(QListViewItem *item, int col, bool ascending) const; + LearnItem(TQListView *parent, TQString label1, TQString label2 = TQString::null, TQString label3 = TQString::null, TQString label4 = TQString::null, TQString label5 = TQString::null, TQString label6 = TQString::null, TQString label7 = TQString::null, TQString label8 = TQString::null); + int compare(TQListViewItem *item, int col, bool ascending) const; }; class Learn : public KMainWindow @@ -48,7 +48,7 @@ class Learn : public KMainWindow Q_OBJECT public: - Learn(Dict::Index *, QWidget *parent = 0, const char *name = 0); + Learn(Dict::Index *, TQWidget *parent = 0, const char *name = 0); ~Learn(); bool closeWindow(); @@ -57,11 +57,11 @@ class Learn : public KMainWindow signals: void destroyed(Learn *); - void linkClicked(const QString &); + void linkClicked(const TQString &); void configureLearn(); public slots: - void showKanji(QListViewItem *); + void showKanji(TQListViewItem *); void updateQuizConfiguration(); protected: @@ -81,7 +81,7 @@ class Learn : public KMainWindow void add(Dict::Entry, bool noEmit = false); void del(); void cheat(); - void tabChanged(QWidget *); + void tabChanged(TQWidget *); void itemSelectionChanged(); void save(); void saveAs(); @@ -107,13 +107,13 @@ class Learn : public KMainWindow KURL filename; bool warnClose(); - QTabWidget *Tabs; - QSplitter *listTop; - QWidget *quizTop; + TQTabWidget *Tabs; + TQSplitter *listTop; + TQWidget *quizTop; ResultView *View; - QValueList list; - QValueListIterator current; + TQValueList list; + TQValueListIterator current; Dict::Index *index; @@ -127,23 +127,23 @@ class Learn : public KMainWindow // Quiz, an app to itself in a tabwidget :) static const int numberOfAnswers; - QButtonGroup *answers; - QPushButton *qKanji; + TQButtonGroup *answers; + TQPushButton *qKanji; - QListViewItem *prevItem; - QListViewItem *curItem; + TQListViewItem *prevItem; + TQListViewItem *curItem; // if noEmit == true, don't emit dirty - void addItem(QListViewItem *, bool noEmit = false); + void addItem(TQListViewItem *, bool noEmit = false); void qupdate(); int seikai; bool nogood; - QString shortenString(const QString &); + TQString shortenString(const TQString &); // Creates a random meaning not on the lists and adds the meaning // to the list. - QString randomMeaning(QStringList &oldMeanings); + TQString randomMeaning(TQStringList &oldMeanings); KAction *forwardAct; KAction *printAct; diff --git a/kiten/main.cpp b/kiten/main.cpp index 91e8a23d..8d013d15 100644 --- a/kiten/main.cpp +++ b/kiten/main.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "kiten.h" @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) KApplication a; // a.installKDEPropertyMap(); -// QSqlPropertyMap *map = QSqlPropertyMap::defaultMap(); +// TQSqlPropertyMap *map = TQSqlPropertyMap::defaultMap(); // map->insert("MyStringList", "value"); TopLevel *t = new TopLevel(); diff --git a/kiten/optiondialog.cpp b/kiten/optiondialog.cpp index 5ada2793..35c48b6e 100644 --- a/kiten/optiondialog.cpp +++ b/kiten/optiondialog.cpp @@ -21,34 +21,34 @@ #include #include -#include +#include #include -#include +#include #include -#include +#include #include #include #include #include -#include -#include -#include +#include +#include +#include #include "optiondialog.h" #include "configfont.h" #include "configlearn.h" #include "configsearching.h" -ConfigureDialog::ConfigureDialog(QWidget *parent, const char *name) : KConfigDialog(parent, name, Config::self()) +ConfigureDialog::ConfigureDialog(TQWidget *parent, const char *name) : KConfigDialog(parent, name, Config::self()) { configDic = new ConfigDictionaries(0, "dictionaries_page"); - connect(configDic, SIGNAL(widgetChanged()), this, SLOT(updateButtons())); + connect(configDic, TQT_SIGNAL(widgetChanged()), this, TQT_SLOT(updateButtons())); addPage(configDic, i18n("Dictionaries"), "contents"); addPage(new ConfigSearching(0, "searching_page"), i18n("Searching"), "find"); addPage(new ConfigLearn(0, "learn_page"), i18n("Learn"), "pencil"); ConfigFont* configFont = new ConfigFont(0, "font_page"); - configFont->kcfg_font->setSampleText(i18n("Result View Font")+QString::fromUtf8(" - ã„ã‚ã¯ã«ã»ã¸ã¨ 漢字")); + configFont->kcfg_font->setSampleText(i18n("Result View Font")+TQString::fromUtf8(" - ã„ã‚ã¯ã«ã»ã¸ã¨ 漢字")); addPage(configFont, i18n("Font"), "fonts"); } diff --git a/kiten/optiondialog.h b/kiten/optiondialog.h index d3618081..fef3948a 100644 --- a/kiten/optiondialog.h +++ b/kiten/optiondialog.h @@ -42,7 +42,7 @@ class ConfigureDialog : public KConfigDialog { Q_OBJECT public: - ConfigureDialog(QWidget *parent=0, const char *name=0); + ConfigureDialog(TQWidget *parent=0, const char *name=0); ~ConfigureDialog(); signals: void settingsUpdated(); diff --git a/kiten/rad.cpp b/kiten/rad.cpp index 79986301..f3c31132 100644 --- a/kiten/rad.cpp +++ b/kiten/rad.cpp @@ -29,19 +29,19 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "kitenconfig.h" #include "rad.h" -Rad::Rad() : QObject() +Rad::Rad() : TQObject() { loaded = false; } @@ -52,28 +52,28 @@ void Rad::load() return; KStandardDirs *dirs = KGlobal::dirs(); - QString radkfile = dirs->findResource("data", "kiten/radkfile"); + TQString radkfile = dirs->findResource("data", "kiten/radkfile"); if (radkfile.isNull()) { KMessageBox::error(0, i18n("Kanji radical information file not installed, so radical searching cannot be used.")); return; } - QFile f(radkfile); + TQFile f(radkfile); if (!f.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("Kanji radical information could not be loaded, so radical searching cannot be used.")); } - QTextStream t(&f); - t.setCodec(QTextCodec::codecForName("eucJP")); + TQTextStream t(&f); + t.setCodec(TQTextCodec::codecForName("eucJP")); Radical cur; while (!t.eof()) { - QString s = t.readLine(); + TQString s = t.readLine(); - QChar first = s.at(0); + TQChar first = s.at(0); if (first == '#') // comment! { // nothing @@ -86,7 +86,7 @@ void Rad::load() //first entry is trim(last 4 chars).. unsigned int strokes = s.right(2).toUInt(); - QString radical = QString(s.at(2)); + TQString radical = TQString(s.at(2)); cur = Radical(radical, strokes); } else // continuation @@ -104,13 +104,13 @@ void Rad::load() loaded = true; } -QStringList Rad::radByStrokes(unsigned int strokes) +TQStringList Rad::radByStrokes(unsigned int strokes) { load(); - QStringList ret; + TQStringList ret; bool hadOne = false; - QValueListIterator it = list.begin(); + TQValueListIterator it = list.begin(); do { @@ -129,49 +129,49 @@ QStringList Rad::radByStrokes(unsigned int strokes) return ret; } -QStringList Rad::kanjiByRad(const QString &text) +TQStringList Rad::kanjiByRad(const TQString &text) { //kdDebug() << "kanjiByRad, text is " << text << endl; load(); - QStringList ret; + TQStringList ret; - QValueListIterator it; + TQValueListIterator it; for (it = list.begin(); it != list.end() && (*it).radical() != text; ++it) { //kdDebug() << "kanjiByRad, looping, radical is " << (*it).radical() << endl; } - QString kanji = (*it).kanji(); + TQString kanji = (*it).kanji(); for (unsigned i = 0; i < kanji.length(); ++i) { //kdDebug() << "kanjiByRad, i is " << i << endl; - ret.append(QString(kanji.at(i))); + ret.append(TQString(kanji.at(i))); } return ret; } -QStringList Rad::kanjiByRad(const QStringList &list) +TQStringList Rad::kanjiByRad(const TQStringList &list) { //kdDebug() << "kanjiByRad (list version)\n"; - QStringList ret; - QValueList lists; + TQStringList ret; + TQValueList lists; - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { //kdDebug() << "loading radical " << *it << endl; lists.append(kanjiByRad(*it)); } - QStringList first = lists.first(); + TQStringList first = lists.first(); lists.pop_front(); - for (QStringList::Iterator kit = first.begin(); kit != first.end(); ++kit) + for (TQStringList::Iterator kit = first.begin(); kit != first.end(); ++kit) { //kdDebug() << "kit is " << *kit << endl; - QValueList outcomes; - for (QValueList::Iterator it = lists.begin(); it != lists.end(); ++it) + TQValueList outcomes; + for (TQValueList::Iterator it = lists.begin(); it != lists.end(); ++it) { //kdDebug() << "looping through lists\n"; outcomes.append((*it).contains(*kit) > 0); @@ -192,21 +192,21 @@ QStringList Rad::kanjiByRad(const QStringList &list) return ret; } -Radical Rad::radByKanji(const QString &text) +Radical Rad::radByKanji(const TQString &text) { load(); - QString ret; + TQString ret; - QValueListIterator it; + TQValueListIterator it; for (it = list.end(); it != list.begin() && (*it).kanji().find(text) == -1; --it); return (*it); } -unsigned int Rad::strokesByRad(const QString &text) +unsigned int Rad::strokesByRad(const TQString &text) { load(); - QValueListIterator it; + TQValueListIterator it; for(it = list.begin(); it != list.end() && (*it).radical() != text; ++it); return (*it).strokes(); @@ -218,15 +218,15 @@ Rad::~Rad() /////////////////////////////////////////////// -RadWidget::RadWidget(Rad *_rad, QWidget *parent, const char *name) : QWidget(parent, name) +RadWidget::RadWidget(Rad *_rad, TQWidget *parent, const char *name) : TQWidget(parent, name) { hotlistNum = 3; rad = _rad; - QHBoxLayout *hlayout = new QHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QVBoxLayout *vlayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); + TQHBoxLayout *hlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *vlayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); - hotlistGroup = new QButtonGroup(1, Horizontal, i18n("Hotlist"), this); + hotlistGroup = new TQButtonGroup(1, Horizontal, i18n("Hotlist"), this); //hotlistGroup->setRadioButtonExclusive(true); vlayout->addWidget(hotlistGroup); @@ -244,56 +244,56 @@ RadWidget::RadWidget(Rad *_rad, QWidget *parent, const char *name) : QWidget(par hotlistGroup->insert(new KPushButton(*hotlist.at(i), hotlistGroup), i); } - connect(hotlistGroup, SIGNAL(clicked(int)), SLOT(hotlistClicked(int))); + connect(hotlistGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(hotlistClicked(int))); - QVBoxLayout *layout = new QVBoxLayout(vlayout, KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(vlayout, KDialog::spacingHint()); - totalStrokes = new QCheckBox(i18n("Search by total strokes"), this); - connect(totalStrokes, SIGNAL(clicked()), this, SLOT(totalClicked())); + totalStrokes = new TQCheckBox(i18n("Search by total strokes"), this); + connect(totalStrokes, TQT_SIGNAL(clicked()), this, TQT_SLOT(totalClicked())); layout->addWidget(totalStrokes); - QHBoxLayout *strokesLayout = new QHBoxLayout(layout, KDialog::spacingHint()); - totalSpin = new QSpinBox(1, 30, 1, this); + TQHBoxLayout *strokesLayout = new TQHBoxLayout(layout, KDialog::spacingHint()); + totalSpin = new TQSpinBox(1, 30, 1, this); strokesLayout->addWidget(totalSpin); strokesLayout->addStretch(); - totalErrLabel = new QLabel(i18n("+/-"), this); + totalErrLabel = new TQLabel(i18n("+/-"), this); strokesLayout->addWidget(totalErrLabel); - totalErrSpin = new QSpinBox(0, 15, 1, this); + totalErrSpin = new TQSpinBox(0, 15, 1, this); strokesLayout->addWidget(totalErrSpin); ok = new KPushButton(i18n("&Look Up"), this); ok->setEnabled(false); - connect(ok, SIGNAL(clicked()), SLOT(apply())); + connect(ok, TQT_SIGNAL(clicked()), TQT_SLOT(apply())); layout->addWidget(ok); cancel = new KPushButton( KStdGuiItem::cancel(), this ); - connect(cancel, SIGNAL(clicked()), SLOT(close())); + connect(cancel, TQT_SIGNAL(clicked()), TQT_SLOT(close())); layout->addWidget(cancel); - QVBoxLayout *middlevLayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); + TQVBoxLayout *middlevLayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); - strokesSpin = new QSpinBox(1, 17, 1, this); - QToolTip::add(strokesSpin, i18n("Show radicals having this number of strokes")); + strokesSpin = new TQSpinBox(1, 17, 1, this); + TQToolTip::add(strokesSpin, i18n("Show radicals having this number of strokes")); middlevLayout->addWidget(strokesSpin); List = new KListBox(this); middlevLayout->addWidget(List); - connect(List, SIGNAL(executed(QListBoxItem *)), this, SLOT(executed(QListBoxItem *))); - connect(strokesSpin, SIGNAL(valueChanged(int)), this, SLOT(updateList(int))); + connect(List, TQT_SIGNAL(executed(TQListBoxItem *)), this, TQT_SLOT(executed(TQListBoxItem *))); + connect(strokesSpin, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateList(int))); - QVBoxLayout *rightvlayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); + TQVBoxLayout *rightvlayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); selectedList = new KListBox(this); rightvlayout->addWidget(selectedList); - connect(selectedList, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); + connect(selectedList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); remove = new KPushButton(i18n("&Remove"), this); rightvlayout->addWidget(remove); - connect(remove, SIGNAL(clicked()), this, SLOT(removeSelected())); + connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelected())); remove->setEnabled(false); clear = new KPushButton(KStdGuiItem::clear(), this); rightvlayout->addWidget(clear); - connect(clear, SIGNAL(clicked()), this, SLOT(clearSelected())); + connect(clear, TQT_SIGNAL(clicked()), this, TQT_SLOT(clearSelected())); clear->setEnabled(false); setCaption(kapp->makeStdCaption(i18n("Radical Selector"))); @@ -322,7 +322,7 @@ void RadWidget::hotlistClicked(int num) addToSelected(*hotlist.at(num)); } -void RadWidget::executed(QListBoxItem *item) +void RadWidget::executed(TQListBoxItem *item) { addToSelected(item->text()); } @@ -353,12 +353,12 @@ void RadWidget::numChanged() clear->setEnabled(selectedList->count() > 0); } -void RadWidget::addRadical(const QString &radical) +void RadWidget::addRadical(const TQString &radical) { addToSelected(radical); } -void RadWidget::addToSelected(const QString &text) +void RadWidget::addToSelected(const TQString &text) { if (!text.isNull() && !selected.contains(text)) { @@ -396,7 +396,7 @@ void RadWidget::apply() config->setTotalStrokesErrorMargin(totalErrSpin->value()); config->setSearchByTotal(totalStrokes->isChecked()); - for (QStringList::Iterator it = selected.begin(); it != selected.end(); ++it) + for (TQStringList::Iterator it = selected.begin(); it != selected.end(); ++it) { if (hotlist.find(*it) == hotlist.end()) { @@ -421,13 +421,13 @@ void RadWidget::totalClicked() ////////////////////////////////////////////// -Radical::Radical(QString text, unsigned int strokes) +Radical::Radical(TQString text, unsigned int strokes) { _Radical = text; Strokes = strokes; } -void Radical::addKanji(const QString &text) +void Radical::addKanji(const TQString &text) { Kanji.append(text); } diff --git a/kiten/rad.h b/kiten/rad.h index bae2f8dc..2337d7c2 100644 --- a/kiten/rad.h +++ b/kiten/rad.h @@ -22,7 +22,7 @@ #ifndef RAD_H #define RAD_H -#include +#include class Config; class QCheckBox; @@ -36,18 +36,18 @@ class QButtonGroup; class KDE_EXPORT Radical { public: - Radical(QString = QString::null, unsigned int = 0); + Radical(TQString = TQString::null, unsigned int = 0); - QString radical() { return _Radical; } + TQString radical() { return _Radical; } unsigned int strokes() { return Strokes; } - QString kanji() { return Kanji; } + TQString kanji() { return Kanji; } - void addKanji(const QString &); + void addKanji(const TQString &); private: - QString _Radical; + TQString _Radical; unsigned int Strokes; - QString Kanji; + TQString Kanji; }; class KDE_EXPORT Rad : public QObject @@ -58,16 +58,16 @@ class KDE_EXPORT Rad : public QObject Rad(); ~Rad(); - QStringList radByStrokes(unsigned int); - QStringList kanjiByRad(const QString &); - QStringList kanjiByRad(const QStringList &); - Radical radByKanji(const QString &); - unsigned int strokesByRad(const QString &); + TQStringList radByStrokes(unsigned int); + TQStringList kanjiByRad(const TQString &); + TQStringList kanjiByRad(const TQStringList &); + Radical radByKanji(const TQString &); + unsigned int strokesByRad(const TQString &); private: void load(); - QValueList list; + TQValueList list; bool loaded; }; @@ -76,15 +76,15 @@ class KDE_EXPORT RadWidget : public QWidget Q_OBJECT public: - RadWidget(Rad *, QWidget *parent = 0, const char *name = 0); + RadWidget(Rad *, TQWidget *parent = 0, const char *name = 0); ~RadWidget(); signals: // if totalStrokes == 0, then don't search by total strokes - void set(const QStringList &radical, unsigned int totalStrokes, unsigned int totalStrokesErr); + void set(const TQStringList &radical, unsigned int totalStrokes, unsigned int totalStrokesErr); public slots: - void addRadical(const QString &); + void addRadical(const TQString &); private slots: void updateList(int); @@ -92,30 +92,30 @@ class KDE_EXPORT RadWidget : public QWidget void totalClicked(void); void selectionChanged(); void hotlistClicked(int); - void addToSelected(const QString &); - void executed(QListBoxItem *); + void addToSelected(const TQString &); + void executed(TQListBoxItem *); void removeSelected(); void clearSelected(); private: - QSpinBox *strokesSpin; - QSpinBox *totalSpin; - QSpinBox *totalErrSpin; - QLabel *totalErrLabel; + TQSpinBox *strokesSpin; + TQSpinBox *totalSpin; + TQSpinBox *totalErrSpin; + TQLabel *totalErrLabel; KPushButton *ok; KPushButton *cancel; KPushButton *remove; KPushButton *clear; - QButtonGroup *hotlistGroup; - QCheckBox *totalStrokes; + TQButtonGroup *hotlistGroup; + TQCheckBox *totalStrokes; KListBox *List; KListBox *selectedList; - QStringList selected; + TQStringList selected; Rad *rad; unsigned int hotlistNum; - QStringList hotlist; + TQStringList hotlist; void numChanged(); }; diff --git a/kiten/widgets.cpp b/kiten/widgets.cpp index 989c777d..cfe4c18a 100644 --- a/kiten/widgets.cpp +++ b/kiten/widgets.cpp @@ -29,12 +29,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -43,7 +43,7 @@ #include "kromajiedit.h" #include "widgets.h" -ResultView::ResultView(bool showLinks, QWidget *parent, const char *name) +ResultView::ResultView(bool showLinks, TQWidget *parent, const char *name) : KTextBrowser(parent, name) { setReadOnly(true); @@ -68,14 +68,14 @@ void ResultView::addResult(Dict::Entry result, bool common) return; } - QString html; + TQString html; if (result.kanaOnly()) - html = QString("

%1 ").arg(result.firstReading()); + html = TQString("

%1 ").arg(result.firstReading()); else - html = QString("

%1: %2 ").arg(putchars(result.kanji())).arg(result.firstReading()); + html = TQString("

%1: %2 ").arg(putchars(result.kanji())).arg(result.firstReading()); - QStringList::Iterator it; - QStringList Meanings = result.meanings(); + TQStringList::Iterator it; + TQStringList Meanings = result.meanings(); for (it = Meanings.begin(); it != Meanings.end(); ++it) { if ((*it).find("(P)") >= 0) @@ -84,7 +84,7 @@ void ResultView::addResult(Dict::Entry result, bool common) continue; else { - html += QString("") + i18n("Common") + QString(" "); + html += TQString("") + i18n("Common") + TQString(" "); } } else @@ -112,8 +112,8 @@ void ResultView::addKanjiResult(Dict::Entry result, bool common, Radical rad) return; } - QString html; - html = QString("

%1: %2 ").arg(putchars(result.kanji())); + TQString html; + html = TQString("

%1: %2 ").arg(putchars(result.kanji())); unsigned int freq = result.freq(); if (freq == 0) // does it have a frequency? @@ -125,8 +125,8 @@ void ResultView::addKanjiResult(Dict::Entry result, bool common, Radical rad) html += "
"; - QStringList::Iterator it; - QStringList Readings = result.readings(); + TQStringList::Iterator it; + TQStringList Readings = result.readings(); for (it = Readings.begin(); it != Readings.end(); ++it) { if ((*it) == "T1") @@ -158,7 +158,7 @@ void ResultView::addKanjiResult(Dict::Entry result, bool common, Radical rad) html += "
"; - QStringList Meanings = result.meanings(); + TQStringList Meanings = result.meanings(); for (it = Meanings.begin(); it != Meanings.end(); ++it) { html += (*it); @@ -189,30 +189,30 @@ void ResultView::addKanjiResult(Dict::Entry result, bool common, Radical rad) html.append(i18n(" Common Miscount: %1.").arg(result.miscount())); if (!!rad.radical()) - html.append(i18n(" Largest radical: %1, with %2 strokes.").arg(QString("%2").arg(rad.radical()).arg(rad.radical())).arg(rad.strokes())); + html.append(i18n(" Largest radical: %1, with %2 strokes.").arg(TQString("%2").arg(rad.radical()).arg(rad.radical())).arg(rad.strokes())); html += "

"; append(html); } -void ResultView::addHeader(const QString &header, unsigned int degree) +void ResultView::addHeader(const TQString &header, unsigned int degree) { - append(QString("%2").arg(degree).arg(header).arg(degree)); + append(TQString("%2").arg(degree).arg(header).arg(degree)); } -QString ResultView::putchars(const QString &text) +TQString ResultView::putchars(const TQString &text) { if (!links) return text; unsigned int len = text.length(); - QString ret; + TQString ret; for (unsigned i = 0; i < len; i++) { - if (Dict::textType(QString(text.at(i))) == Dict::Text_Kanji) - ret.append(QString("%1").arg(text.at(i)).arg(text.at(i))); + if (Dict::textType(TQString(text.at(i))) == Dict::Text_Kanji) + ret.append(TQString("%1").arg(text.at(i)).arg(text.at(i))); else ret.append(text.at(i)); } @@ -220,7 +220,7 @@ QString ResultView::putchars(const QString &text) return ret; } -void ResultView::append(const QString &text) +void ResultView::append(const TQString &text) { printText.append(text); } @@ -237,27 +237,27 @@ void ResultView::flush() ensureCursorVisible(); } -void ResultView::print(QString title) +void ResultView::print(TQString title) { KPrinter printer; printer.setFullPage(true); if (printer.setup(this, i18n("Print Japanese Reference"))) { - QPainter p(&printer); - QPaintDeviceMetrics metrics(p.device()); + TQPainter p(&printer); + TQPaintDeviceMetrics metrics(p.device()); int dpix = metrics.logicalDpiX(); int dpiy = metrics.logicalDpiY(); const int margin = 72; // pt - QRect body(dpix, dpiy, metrics.width() - margin * dpix / margin * 2, metrics.height() - margin * dpiy / margin * 2); + TQRect body(dpix, dpiy, metrics.width() - margin * dpix / margin * 2, metrics.height() - margin * dpiy / margin * 2); - QSimpleRichText richText(title.isNull()? printText : i18n("

Search for \"%1\"

").arg(title) + printText, font(), context(), styleSheet(), mimeSourceFactory(), body.height(), Qt::black, false); + TQSimpleRichText richText(title.isNull()? printText : i18n("

Search for \"%1\"

").arg(title) + printText, font(), context(), styleSheet(), mimeSourceFactory(), body.height(), Qt::black, false); richText.setWidth(&p, body.width()); - QRect view(body); + TQRect view(body); int page = 1; - QColorGroup goodColorGroup = QColorGroup(colorGroup()); - goodColorGroup.setColor(QColorGroup::Link, Qt::black); + TQColorGroup goodColorGroup = TQColorGroup(colorGroup()); + goodColorGroup.setColor(TQColorGroup::Link, Qt::black); do { @@ -265,10 +265,10 @@ void ResultView::print(QString title) view.moveBy(0, body.height()); p.translate(0, -body.height()); - QFont myFont(font()); + TQFont myFont(font()); myFont.setPointSize(9); p.setFont(myFont); - QString footer(QString("%1 - Kiten").arg(QString::number(page))); + TQString footer(TQString("%1 - Kiten").arg(TQString::number(page))); p.drawText(view.right() - p.fontMetrics().width(footer), view.bottom() + p.fontMetrics().ascent() + 5, footer); @@ -292,7 +292,7 @@ void ResultView::updateFont() ///////////////////////////////////////////////////// // nice EDICT dictionary editor -eEdit::eEdit(const QString &_filename, QWidget *parent, const char *name) +eEdit::eEdit(const TQString &_filename, TQWidget *parent, const char *name) : KMainWindow(parent, name) , filename(_filename) { @@ -310,18 +310,18 @@ eEdit::eEdit(const QString &_filename, QWidget *parent, const char *name) List->setRenameable(3); List->setAllColumnsShowFocus(true); - List->setColumnWidthMode(0, QListView::Maximum); - List->setColumnWidthMode(1, QListView::Maximum); - List->setColumnWidthMode(2, QListView::Maximum); - List->setColumnWidthMode(3, QListView::Maximum); + List->setColumnWidthMode(0, TQListView::Maximum); + List->setColumnWidthMode(1, TQListView::Maximum); + List->setColumnWidthMode(2, TQListView::Maximum); + List->setColumnWidthMode(3, TQListView::Maximum); List->setMultiSelection(true); List->setDragEnabled(true); - saveAct = KStdAction::save(this, SLOT(save()), actionCollection()); - removeAct = new KAction(i18n("&Delete"), "edit_remove", CTRL + Key_X, this, SLOT(del()), actionCollection(), "del"); - (void) new KAction(i18n("&Disable Dictionary"), 0, this, SLOT(disable()), actionCollection(), "disable"); - addAct = new KAction(i18n("&Add"), "edit_add", CTRL + Key_A, this, SLOT(add()), actionCollection(), "add"); - (void) KStdAction::close(this, SLOT(close()), actionCollection()); + saveAct = KStdAction::save(this, TQT_SLOT(save()), actionCollection()); + removeAct = new KAction(i18n("&Delete"), "edit_remove", CTRL + Key_X, this, TQT_SLOT(del()), actionCollection(), "del"); + (void) new KAction(i18n("&Disable Dictionary"), 0, this, TQT_SLOT(disable()), actionCollection(), "disable"); + addAct = new KAction(i18n("&Add"), "edit_add", CTRL + Key_A, this, TQT_SLOT(add()), actionCollection(), "add"); + (void) KStdAction::close(this, TQT_SLOT(close()), actionCollection()); createGUI("eeditui.rc"); //closeAction->plug(toolBar()); @@ -341,14 +341,14 @@ void eEdit::add() new KListViewItem(List); } -void eEdit::openFile(const QString &file) +void eEdit::openFile(const TQString &file) { - QFile f(file); + TQFile f(file); if (!f.open(IO_ReadOnly)) return; - QTextStream t(&f); - QString s; + TQTextStream t(&f); + TQString s; while (!t.eof()) { @@ -356,42 +356,42 @@ void eEdit::openFile(const QString &file) if (s.left(1) == "#" || s.isEmpty()) continue; Dict::Entry entry = Dict::parse(s); - QString meanings = Dict::prettyMeaning(entry.meanings()); - bool common = meanings.find(QString("(P)")) >= 0; - meanings.replace(QRegExp("; "), "/"); - meanings.replace(QRegExp("/\\(P\\)"), ""); - new QListViewItem(List, entry.kanji(), Dict::prettyKanjiReading(entry.readings()), meanings, common? i18n("yes") : i18n("no")); + TQString meanings = Dict::prettyMeaning(entry.meanings()); + bool common = meanings.find(TQString("(P)")) >= 0; + meanings.replace(TQRegExp("; "), "/"); + meanings.replace(TQRegExp("/\\(P\\)"), ""); + new TQListViewItem(List, entry.kanji(), Dict::prettyKanjiReading(entry.readings()), meanings, common? i18n("yes") : i18n("no")); } } void eEdit::save() { - QFile f(filename); + TQFile f(filename); if (!f.open(IO_WriteOnly)) return; - QTextStream t(&f); + TQTextStream t(&f); t << "# Generated by Kiten's EDICT editor" << endl << "# http://katzbrown.com/kiten" << endl << endl; - QListViewItemIterator it(List); + TQListViewItemIterator it(List); for (; it.current(); ++it) { - QString kanji = it.current()->text(0); - QString reading = it.current()->text(1); - QString text = kanji.isEmpty()? reading : kanji; + TQString kanji = it.current()->text(0); + TQString reading = it.current()->text(1); + TQString text = kanji.isEmpty()? reading : kanji; - QString meanings = it.current()->text(2); + TQString meanings = it.current()->text(2); if (meanings.right(1) != "/") meanings.append("/"); if (meanings.left(1) != "/") meanings.prepend("/"); - QString commonString = it.current()->text(3).lower(); + TQString commonString = it.current()->text(3).lower(); bool common = (commonString == "true" || commonString == "yes" || commonString == "1" || commonString == "common"); text.append(" "); if (!kanji.isEmpty()) - text.append(QString("[%1] ").arg(reading)); + text.append(TQString("[%1] ").arg(reading)); text.append(meanings); if (common) @@ -404,7 +404,7 @@ void eEdit::save() // find the index generator executable KProcess proc; - proc << KStandardDirs::findExe("kitengen") << filename << KGlobal::dirs()->saveLocation("data", "kiten/xjdx/", true) + QFileInfo(filename).baseName() + ".xjdx"; + proc << KStandardDirs::findExe("kitengen") << filename << KGlobal::dirs()->saveLocation("data", "kiten/xjdx/", true) + TQFileInfo(filename).baseName() + ".xjdx"; // TODO: put up a status dialog and event loop instead of blocking proc.start(KProcess::Block, KProcess::NoCommunication); @@ -414,20 +414,20 @@ void eEdit::save() void eEdit::disable() { - int result = KMessageBox::warningYesNo(this, i18n("Disabling your personal dictionary will delete its contents.\n\n(You can however always create your dictionary again.)"), QString::null, i18n("Disable"), KStdGuiItem::cancel(), "DisableAsk", true); + int result = KMessageBox::warningYesNo(this, i18n("Disabling your personal dictionary will delete its contents.\n\n(You can however always create your dictionary again.)"), TQString::null, i18n("Disable"), KStdGuiItem::cancel(), "DisableAsk", true); if (result == KMessageBox::No) return; - QFile::remove(filename); + TQFile::remove(filename); delete this; } void eEdit::del() { - QPtrList selected = List->selectedItems(); + TQPtrList selected = List->selectedItems(); assert(selected.count()); - for(QPtrListIterator i(selected); *i; ++i) + for(TQPtrListIterator i(selected); *i; ++i) delete *i; isMod = true; @@ -436,7 +436,7 @@ void eEdit::del() ///////////////////////////////////////////////////// // sorta taken from konqy -EditAction::EditAction(const QString& text, int accel, const QObject *receiver, const char *member, QObject* parent, const char* name) +EditAction::EditAction(const TQString& text, int accel, const TQObject *receiver, const char *member, TQObject* parent, const char* name) : KAction(text, accel, parent, name) { m_receiver = receiver; @@ -447,7 +447,7 @@ EditAction::~EditAction() { } -int EditAction::plug( QWidget *w, int index ) +int EditAction::plug( TQWidget *w, int index ) { // if ( !w->inherits( "KToolBar" ) ) // return -1; @@ -458,11 +458,11 @@ int EditAction::plug( QWidget *w, int index ) KRomajiEdit *comboBox = new KRomajiEdit(toolBar, "search edit"); toolBar->insertWidget( id, 70, comboBox, index ); - connect( comboBox, SIGNAL( returnPressed()), m_receiver, m_member ); + connect( comboBox, TQT_SIGNAL( returnPressed()), m_receiver, m_member ); addContainer(toolBar, id); - connect( toolBar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) ); + connect( toolBar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) ); toolBar->setItemAutoSized( id, true ); @@ -470,12 +470,12 @@ int EditAction::plug( QWidget *w, int index ) emit plugged(); - //QWhatsThis::add( comboBox, whatsThis() ); + //TQWhatsThis::add( comboBox, whatsThis() ); return containerCount() - 1; } -void EditAction::unplug( QWidget *w ) +void EditAction::unplug( TQWidget *w ) { // if ( !w->inherits( "KToolBar" ) ) // return; @@ -496,17 +496,17 @@ void EditAction::clear() m_combo->setFocus(); } -void EditAction::insert(const QString &text) +void EditAction::insert(const TQString &text) { m_combo->insert(text); } -void EditAction::setText(const QString &text) +void EditAction::setText(const TQString &text) { m_combo->setText(text); } -QGuardedPtr EditAction::editor() +TQGuardedPtr EditAction::editor() { return m_combo; } diff --git a/kiten/widgets.h b/kiten/widgets.h index ab9b7725..82592bae 100644 --- a/kiten/widgets.h +++ b/kiten/widgets.h @@ -21,7 +21,7 @@ #ifndef KITEN_WIDGETS_H #define KITEN_WIDGETS_H -#include +#include #include #include @@ -39,16 +39,16 @@ class KDE_EXPORT ResultView : public KTextBrowser Q_OBJECT public: - ResultView(bool showLinks, QWidget *parent = 0, const char *name = 0); + ResultView(bool showLinks, TQWidget *parent = 0, const char *name = 0); void addResult(Dict::Entry result, bool common = false); void addKanjiResult(Dict::Entry, bool common = false, Radical = Radical()); - void addHeader(const QString &, unsigned int degree = 3); + void addHeader(const TQString &, unsigned int degree = 3); public slots: - void print(QString = QString::null); - void append(const QString &); + void print(TQString = TQString::null); + void append(const TQString &); void flush(); void clear(); void setBasicMode(bool yes) { basicMode = yes; } @@ -56,8 +56,8 @@ class KDE_EXPORT ResultView : public KTextBrowser void updateFont(); private: - QString putchars(const QString &); - QString printText; + TQString putchars(const TQString &); + TQString printText; bool links; bool basicMode; @@ -68,7 +68,7 @@ class KDE_EXPORT eEdit : public KMainWindow Q_OBJECT public: - eEdit(const QString &, QWidget *parent = 0, const char *name = 0); + eEdit(const TQString &, TQWidget *parent = 0, const char *name = 0); ~eEdit(); private slots: @@ -76,11 +76,11 @@ class KDE_EXPORT eEdit : public KMainWindow void save(); void del(); void disable(); - void openFile(const QString &); + void openFile(const TQString &); private: KListView *List; - QString filename; + TQString filename; KStatusBar *StatusBar; KAction *addAct; KAction *removeAct; @@ -92,20 +92,20 @@ class KDE_EXPORT EditAction : public KAction { Q_OBJECT public: - EditAction( const QString& text, int accel, const QObject *receiver, const char *member, QObject* parent, const char* name ); + EditAction( const TQString& text, int accel, const TQObject *receiver, const char *member, TQObject* parent, const char* name ); virtual ~EditAction(); - virtual int plug( QWidget *w, int index = -1 ); + virtual int plug( TQWidget *w, int index = -1 ); - virtual void unplug( QWidget *w ); + virtual void unplug( TQWidget *w ); - QString text() { return m_combo->text(); } - void setText(const QString &text); + TQString text() { return m_combo->text(); } + void setText(const TQString &text); - QGuardedPtr editor(); + TQGuardedPtr editor(); public slots: - void insert(const QString &); + void insert(const TQString &); // also sets focus to the lineedit widget void clear(); @@ -114,8 +114,8 @@ class KDE_EXPORT EditAction : public KAction void plugged(); private: - QGuardedPtr m_combo; - const QObject *m_receiver; + TQGuardedPtr m_combo; + const TQObject *m_receiver; const char *m_member; }; diff --git a/klatin/klatin/keduvocdata.h b/klatin/klatin/keduvocdata.h index eede664a..22ce39e1 100644 --- a/klatin/klatin/keduvocdata.h +++ b/klatin/klatin/keduvocdata.h @@ -19,31 +19,31 @@ #ifndef KEDUVOCDATA_H #define KEDUVOCDATA_H -#include +#include class KEduVocDataItem { public: KEduVocDataItem(); - KEduVocDataItem(QDomElement &entry); + KEduVocDataItem(TQDomElement &entry); virtual ~KEduVocDataItem(); - QString originalText() const; - QString translatedText() const; + TQString originalText() const; + TQString translatedText() const; protected: - QString getText(const QString &tagName) const; + TQString getText(const TQString &tagName) const; private: - QDomElement domElement; + TQDomElement domElement; }; -typedef QValueList KEduVocDataItemList; +typedef TQValueList KEduVocDataItemList; class KEduVocData { public: - static KEduVocDataItemList parse(const QString &fileName); + static KEduVocDataItemList parse(const TQString &fileName); }; #endif // KEDUVOCDATA_H diff --git a/klatin/klatin/klatin.cpp b/klatin/klatin/klatin.cpp index 118c89a1..09a8a426 100644 --- a/klatin/klatin/klatin.cpp +++ b/klatin/klatin/klatin.cpp @@ -13,7 +13,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -32,7 +32,7 @@ #include "klatin.h" #include "settings.h" -KLatin::KLatin(QWidget* parent, const char *name) +KLatin::KLatin(TQWidget* parent, const char *name) : KMainWindow(parent, name) { m_section = 0; @@ -53,12 +53,12 @@ KLatin::~KLatin() void KLatin::setupActions() { // Setup various menu actions - KStdAction::preferences(this, SLOT(loadSettings()), actionCollection()); - m_loadVocab = new KAction(i18n("Load &Vocabulary"), 0, this, SLOT(loadVocab()), actionCollection(), "go_vocab"); - m_loadGrammar = new KAction(i18n("Load &Grammar"), 0, this, SLOT(loadGrammar()), actionCollection(), "go_grammar"); - m_loadVerbs = new KAction(i18n("Load V&erbs"), 0, this, SLOT(loadVerbs()), actionCollection(), "go_verbs"); - m_loadRevision = new KAction(i18n("Load &Revision"), 0, this, SLOT(loadRevision()), actionCollection(), "go_revision"); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(loadSettings()), actionCollection()); + m_loadVocab = new KAction(i18n("Load &Vocabulary"), 0, this, TQT_SLOT(loadVocab()), actionCollection(), "go_vocab"); + m_loadGrammar = new KAction(i18n("Load &Grammar"), 0, this, TQT_SLOT(loadGrammar()), actionCollection(), "go_grammar"); + m_loadVerbs = new KAction(i18n("Load V&erbs"), 0, this, TQT_SLOT(loadVerbs()), actionCollection(), "go_verbs"); + m_loadRevision = new KAction(i18n("Load &Revision"), 0, this, TQT_SLOT(loadRevision()), actionCollection(), "go_revision"); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); } void KLatin::startClicked() @@ -91,7 +91,7 @@ void KLatin::loadVocab() // When the child emits the signal exitted(), // then reset the GUI to go back to the menu - connect(klatinvocabsection, SIGNAL(exited()), this, SLOT(resetGUI())); + connect(klatinvocabsection, TQT_SIGNAL(exited()), this, TQT_SLOT(resetGUI())); // Set the section variable m_section = 1; @@ -114,13 +114,13 @@ void KLatin::loadGrammar() // When the child emits the signal exited(), // then reset the GUI to go back to the menu - connect(klatingrammarsection, SIGNAL(exited()), this, SLOT(resetGUI())); - connect(klatingrammarsection, SIGNAL(statusMsg(const QString&)), this, SLOT(slotWriteMsg(const QString&))); + connect(klatingrammarsection, TQT_SIGNAL(exited()), this, TQT_SLOT(resetGUI())); + connect(klatingrammarsection, TQT_SIGNAL(statusMsg(const TQString&)), this, TQT_SLOT(slotWriteMsg(const TQString&))); // Set the section variable m_section = 2; } -void KLatin::slotWriteMsg(const QString& message) +void KLatin::slotWriteMsg(const TQString& message) { statusBar()->message(message); } @@ -142,8 +142,8 @@ void KLatin::loadVerbs() // When the child emits the signal exited(), // then reset the GUI to go back to the menu - connect(klatinverbssection, SIGNAL(exited()), this, SLOT(resetGUI())); - connect(klatinverbssection, SIGNAL(statusMsg(const QString&)), this, SLOT(slotWriteMsg(const QString&))); + connect(klatinverbssection, TQT_SIGNAL(exited()), this, TQT_SLOT(resetGUI())); + connect(klatinverbssection, TQT_SIGNAL(statusMsg(const TQString&)), this, TQT_SLOT(slotWriteMsg(const TQString&))); // Set the section variable m_section = 3; @@ -166,7 +166,7 @@ void KLatin::loadSettings() vocabPage->kcfg_DefaultFile->setFilter("*.kvtml"); vocabPage->kcfg_DefaultFile->setCaption(i18n("Load Vocabulary File")); dialog->addPage(vocabPage, i18n("Vocabulary"), "kdict"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(settingsChanged())); dialog->show(); } @@ -189,9 +189,9 @@ void KLatin::resetGUI() setCentralWidget(klatinchoose); // Connect the "Start" button to slot StartPressed() - connect(klatinchoose->StartButton, SIGNAL(clicked()), this, SLOT(startClicked())); + connect(klatinchoose->StartButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(startClicked())); // Make the quit button quit the application :) - connect(klatinchoose->QuitButton, SIGNAL(clicked()), kapp, SLOT(quit())); + connect(klatinchoose->QuitButton, TQT_SIGNAL(clicked()), kapp, TQT_SLOT(quit())); // Enable all the menu entries under Section/ updateSection(TRUE); diff --git a/klatin/klatin/klatin.h b/klatin/klatin/klatin.h index 8adb2cbe..91db4488 100644 --- a/klatin/klatin/klatin.h +++ b/klatin/klatin/klatin.h @@ -37,7 +37,7 @@ class KLatin : public KMainWindow { Q_OBJECT public: - KLatin(QWidget* parent=0, const char *name=0); + KLatin(TQWidget* parent=0, const char *name=0); ~KLatin(); void setupActions(); @@ -63,7 +63,7 @@ private slots: /// Slot for when settings are changed in the KConfig XT dialog void settingsChanged(); - void slotWriteMsg(const QString&); + void slotWriteMsg(const TQString&); private: diff --git a/klatin/klatin/klatingrammar.cpp b/klatin/klatin/klatingrammar.cpp index f320fd5b..0598547f 100644 --- a/klatin/klatin/klatingrammar.cpp +++ b/klatin/klatin/klatingrammar.cpp @@ -13,8 +13,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include "klatingrammar.h" -KLatinGrammar::KLatinGrammar(QWidget* parent, const char *name) +KLatinGrammar::KLatinGrammar(TQWidget* parent, const char *name) : KLatinGrammarWidget(parent, name) { // Set defaults @@ -42,10 +42,10 @@ KLatinGrammar::KLatinGrammar(QWidget* parent, const char *name) BackButton->setIconSet(KGlobal::iconLoader()->loadIconSet("back", KIcon::Small)); // Set connections - connect(BackButton, SIGNAL(clicked()), this, SLOT(goBack())); - connect(OKButton, SIGNAL(clicked()), this, SLOT(checkAnswer())); - connect(AnswerBox, SIGNAL(returnPressed()), this, SLOT(checkAnswer())); - connect(ChooseSection, SIGNAL(activated(int)), this, SLOT(loadDatabase())); + connect(BackButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(goBack())); + connect(OKButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswer())); + connect(AnswerBox, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(checkAnswer())); + connect(ChooseSection, TQT_SIGNAL(activated(int)), this, TQT_SLOT(loadDatabase())); // Insert the various declensions ChooseSection->insertItem(i18n("All Declensions")); @@ -83,7 +83,7 @@ void KLatinGrammar::loadDatabase() } // Various files that are used for each declension - QString file = "klatin/data/grammar/"; + TQString file = "klatin/data/grammar/"; switch (curitem) { case 0: file += "puella.klat"; @@ -115,7 +115,7 @@ void KLatinGrammar::loadDatabase() // Check whether the file actually exists // If not - warn user. - if (QFile::exists(locate("data", file)) == FALSE) { + if (TQFile::exists(locate("data", file)) == FALSE) { KMessageBox::error(this, i18n("Could not load grammar-definition file, check KLatin installation."), i18n("Error with KLatin")); QuestionLabel->setText(i18n("Error.")); return; @@ -148,7 +148,7 @@ void KLatinGrammar::nextQuestion() m_grammarNumber = (random() % 12) + 1; - QString questionString; + TQString questionString; // Question string... switch (m_grammarNumber) { @@ -237,7 +237,7 @@ void KLatinGrammar::updateScores() Score2Label->setNum(m_total); // Set percentage - PercentageLabel->setText(QString::number(int(double(m_totalCorrect) / m_total * 100))+QString("%")); + PercentageLabel->setText(TQString::number(int(double(m_totalCorrect) / m_total * 100))+TQString("%")); } #include "klatingrammar.moc" diff --git a/klatin/klatin/klatingrammar.h b/klatin/klatin/klatingrammar.h index 5c00d6b7..c36a3612 100644 --- a/klatin/klatin/klatingrammar.h +++ b/klatin/klatin/klatingrammar.h @@ -28,7 +28,7 @@ class KLatinGrammar : public KLatinGrammarWidget { Q_OBJECT public: - KLatinGrammar(QWidget* parent=0, const char *name=0); + KLatinGrammar(TQWidget* parent=0, const char *name=0); ~KLatinGrammar(); /// Load next question @@ -45,10 +45,10 @@ public slots: signals: /// Signal that is emitted when the widget is closed void exited(); - void statusMsg(const QString&); + void statusMsg(const TQString&); private: /// Array that holds the 12 cases of a noun - QString m_noun[12]; + TQString m_noun[12]; /// The case of the noun being tested int m_grammarNumber; /// Total number of questions attempted that are wrong diff --git a/klatin/klatin/klatinverbs.cpp b/klatin/klatin/klatinverbs.cpp index 8b6f956c..70d42ed8 100644 --- a/klatin/klatin/klatinverbs.cpp +++ b/klatin/klatin/klatinverbs.cpp @@ -13,8 +13,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include "klatinverbs.h" -KLatinVerbs::KLatinVerbs(QWidget* parent, const char *name) +KLatinVerbs::KLatinVerbs(TQWidget* parent, const char *name) : KLatinVerbsWidget(parent, name) { OKButton->setIconSet(KGlobal::iconLoader()->loadIconSet("button_ok", KIcon::Small)); @@ -81,11 +81,11 @@ KLatinVerbs::KLatinVerbs(QWidget* parent, const char *name) question.tense.push_back(I18N_NOOP("pluperfect")); question.tense.push_back(I18N_NOOP("future perfect")); - connect(ChooseConjugation, SIGNAL(activated(int)), this, SLOT(conjugationActivated(int))); - connect(BackButton, SIGNAL(clicked()), this, SLOT(goBack())); - connect(ChangeButton, SIGNAL(clicked()), this, SLOT(loadDatabase())); - connect(AnswerBox, SIGNAL(returnPressed()), this, SLOT(checkAnswer())); - connect(OKButton, SIGNAL(clicked()), this, SLOT(checkAnswer())); + connect(ChooseConjugation, TQT_SIGNAL(activated(int)), this, TQT_SLOT(conjugationActivated(int))); + connect(BackButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(goBack())); + connect(ChangeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(loadDatabase())); + connect(AnswerBox, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(checkAnswer())); + connect(OKButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswer())); loadDatabase(); @@ -98,14 +98,14 @@ KLatinVerbs::~KLatinVerbs() void KLatinVerbs::loadDatabase() { - QString databaseFile = verbparts.declension[ChooseConjugation->currentItem()]; + TQString databaseFile = verbparts.declension[ChooseConjugation->currentItem()]; m_currentVerb = databaseFile; - databaseFile += "-" + QString(verbparts.mood[ChooseMood->currentItem()]); - databaseFile += "-" + QString(verbparts.voice[ChooseVoice->currentItem()]) + ".klat"; + databaseFile += "-" + TQString(verbparts.mood[ChooseMood->currentItem()]); + databaseFile += "-" + TQString(verbparts.voice[ChooseVoice->currentItem()]) + ".klat"; - QString fileName = "klatin/data/verbs/" + databaseFile; + TQString fileName = "klatin/data/verbs/" + databaseFile; - if (QFile::exists(locate("data", fileName)) == FALSE) { + if (TQFile::exists(locate("data", fileName)) == FALSE) { KMessageBox::error(this, i18n("Could not load verb-definition file, check KLatin installation."), i18n("Error with KLatin")); goBack(); } @@ -134,7 +134,7 @@ void KLatinVerbs::nextQuestion() if (ChooseMood->currentText() == i18n("Subjunctive")) m_verbNumber = (random() % 23) + 1; - QString QuestionString; + TQString QuestionString; int person = 0, number = 0, tense = 0; @@ -260,7 +260,7 @@ void KLatinVerbs::updateScores() Score2Label->setNum(m_total); // Set percentage - PercentageLabel->setText(QString::number(int(double(m_totalCorrect) / m_total * 100))+QString("%")); + PercentageLabel->setText(TQString::number(int(double(m_totalCorrect) / m_total * 100))+TQString("%")); } void KLatinVerbs::goBack() diff --git a/klatin/klatin/klatinverbs.h b/klatin/klatin/klatinverbs.h index b389102e..03b5b649 100644 --- a/klatin/klatin/klatinverbs.h +++ b/klatin/klatin/klatinverbs.h @@ -26,7 +26,7 @@ #include "klatinverbswidget.h" struct fileparts { - std::vector declension; + std::vector declension; std::vector mood; std::vector voice; }; @@ -42,7 +42,7 @@ class KLatinVerbs : public KLatinVerbsWidget { Q_OBJECT public: - KLatinVerbs(QWidget* parent=0, const char *name=0); + KLatinVerbs(TQWidget* parent=0, const char *name=0); ~KLatinVerbs(); /// Load next question @@ -62,14 +62,14 @@ public slots: signals: /// Signal that is emitted when the widget wishes to terminate void exited(); - void statusMsg(const QString&); + void statusMsg(const TQString&); private: /// These are structs containing information required to generate a question struct fileparts verbparts; struct questionparts question; /// String array for the various verbs - QString m_verb[36]; - QString m_currentVerb; + TQString m_verb[36]; + TQString m_currentVerb; /// Number to reference the verb form given int m_verbNumber; /// Total number of wrong answers given diff --git a/klatin/klatin/klatinvocab.cpp b/klatin/klatin/klatinvocab.cpp index 27c2481c..b1b10ccf 100644 --- a/klatin/klatin/klatinvocab.cpp +++ b/klatin/klatin/klatinvocab.cpp @@ -13,9 +13,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -32,15 +32,15 @@ #include "klatinvocab.h" #include "settings.h" -KLatinVocab::KLatinVocab(QWidget* parent, const char *name) +KLatinVocab::KLatinVocab(TQWidget* parent, const char *name) : KLatinVocabWidget(parent, name) { BackButton->setIconSet(KGlobal::iconLoader()->loadIconSet("back", KIcon::Small)); - m_vocabFile = QString::null; + m_vocabFile = TQString::null; // Goes back to the last dialog - connect(BackButton, SIGNAL(clicked()), this, SLOT(goBack())); + connect(BackButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(goBack())); // Set default settings m_numberOfQuestions = Settings::numOfQuestions(); @@ -53,23 +53,23 @@ KLatinVocab::KLatinVocab(QWidget* parent, const char *name) parseVocab(); // Connect the multiple choice buttons to the various slots - connect(Answer1, SIGNAL(clicked()), this, SLOT(checkAnswerOne())); - connect(Answer2, SIGNAL(clicked()), this, SLOT(checkAnswerTwo())); - connect(Answer3, SIGNAL(clicked()), this, SLOT(checkAnswerThree())); - connect(Answer4, SIGNAL(clicked()), this, SLOT(checkAnswerFour())); + connect(Answer1, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswerOne())); + connect(Answer2, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswerTwo())); + connect(Answer3, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswerThree())); + connect(Answer4, TQT_SIGNAL(clicked()), this, TQT_SLOT(checkAnswerFour())); } KLatinVocab::~KLatinVocab() { } -void KLatinVocab::parseVocab(QString customFile) +void KLatinVocab::parseVocab(TQString customFile) { m_vocabFile = customFile; m_texts.clear(); - QString fileName; + TQString fileName; // Load all the config variables if (Settings::numOfQuestions() != 0) { @@ -86,27 +86,27 @@ void KLatinVocab::parseVocab(QString customFile) // Check whether file exists or not // If not then regenerate working default - if (QFile::exists(fileName) == FALSE) { + if (TQFile::exists(fileName) == FALSE) { KConfigBase *globalConf = KGlobal::config(); globalConf->setGroup("Locale"); - QString language = globalConf->readEntry("Language", "en"); + TQString language = globalConf->readEntry("Language", "en"); language = language.left(2); - QString fileNameLang = locate("data", "klatin/data/vocabs/"); + TQString fileNameLang = locate("data", "klatin/data/vocabs/"); fileNameLang += language; - QDir checkLang(fileNameLang); + TQDir checkLang(fileNameLang); if (checkLang.exists() == FALSE) { language = "en"; } - QDir vocabDirectory(fileNameLang, "*.kvtml"); + TQDir vocabDirectory(fileNameLang, "*.kvtml"); - QString defaultFile = (fileNameLang + "/" + vocabDirectory[0]); + TQString defaultFile = (fileNameLang + "/" + vocabDirectory[0]); - if (QFile::exists(defaultFile) == FALSE) { + if (TQFile::exists(defaultFile) == FALSE) { KMessageBox::error(this, i18n("Could not load vocabulary file; there is a problem with your KLatin installation."), i18n("Error with KLatin")); kapp->quit(); } else { @@ -120,7 +120,7 @@ void KLatinVocab::parseVocab(QString customFile) int it = 0; - // Start parsing file and allocating words to the QValueList + // Start parsing file and allocating words to the TQValueList for(KEduVocDataItemList::Iterator dataIt = vocabulary.begin(); dataIt != vocabulary.end(); ++dataIt) { if (Settings::langToLatin()) { m_texts.append(qMakePair(vocabulary[it].originalText(), vocabulary[it].translatedText())); @@ -341,7 +341,7 @@ void KLatinVocab::updateScores() Score2Label->setNum(m_total); // Set percentage - PercentageLabel->setText(QString::number(int(double(m_totalCorrect) / m_total * 100))+QString("%")); + PercentageLabel->setText(TQString::number(int(double(m_totalCorrect) / m_total * 100))+TQString("%")); } void KLatinVocab::resultsDialog() @@ -356,7 +356,7 @@ void KLatinVocab::resultsDialog() // Set the lists for (int i = 0 ; i < temp; i++) { if (m_previousAnswer[i] != 0) - new QListViewItem(results->ResultsView, m_previousQuestion[i], m_previousAnswer[i], m_correctAnswer[i]); + new TQListViewItem(results->ResultsView, m_previousQuestion[i], m_previousAnswer[i], m_correctAnswer[i]); } // Set the scores @@ -364,7 +364,7 @@ void KLatinVocab::resultsDialog() results->AttemptedValue->setText(Score2Label->text()); results->show(); - results->resize(QSize(420, 280)); + results->resize(TQSize(420, 280)); // Set some variables. m_dialogShown = true; @@ -372,7 +372,7 @@ void KLatinVocab::resultsDialog() changeVocab(Settings::defaultFile()); } -void KLatinVocab::changeVocab(const QString &filename) +void KLatinVocab::changeVocab(const TQString &filename) { // Reset to defaults m_total = 0; diff --git a/klatin/klatin/klatinvocab.h b/klatin/klatin/klatinvocab.h index c33081df..6980fe24 100644 --- a/klatin/klatin/klatinvocab.h +++ b/klatin/klatin/klatinvocab.h @@ -21,8 +21,8 @@ #include #endif -#include -#include +#include +#include #include "keduvocdata.h" #include "klatinresultsdialog.h" @@ -32,11 +32,11 @@ class KLatinVocab : public KLatinVocabWidget { Q_OBJECT public: - KLatinVocab(QWidget* parent=0, const char *name=0); + KLatinVocab(TQWidget* parent=0, const char *name=0); ~KLatinVocab(); /// Load vocabulary from file @p customFile - void parseVocab(QString customFile = QString::null); + void parseVocab(TQString customFile = TQString::null); /// Generate a new question void newQuestion(); /// Update the scores of the test so far @@ -60,28 +60,28 @@ private slots: void checkAnswerFour(); public slots: /// Load a different vocabulary file in the standard install - void changeVocab(const QString &filename); + void changeVocab(const TQString &filename); signals: /// Emitted when goBack() is called void exited(); private: /// The list in which the native language and Latin words are assigned - typedef QPair QStringPair; - QValueList m_texts; + typedef QPair QStringPair; + TQValueList m_texts; - QString m_fileDir; + TQString m_fileDir; /// The filename of the vocabulary file being tested on - QString m_vocabFile; + TQString m_vocabFile; /// A list of the 4 words used for assigning to the 4 multiple choice buttons - QStringList m_choiceWords; + TQStringList m_choiceWords; /// The previous question's answer - QStringList m_correctAnswer; + TQStringList m_correctAnswer; /// The user's answer to the previous question - QStringList m_previousAnswer; + TQStringList m_previousAnswer; /// The previous question asked - QStringList m_previousQuestion; + TQStringList m_previousQuestion; - QDir m_vocabDirectory; + TQDir m_vocabDirectory; /// The question number in this session int m_questionNumber; diff --git a/klettres/klettres/klettres.cpp b/klettres/klettres/klettres.cpp index 031f2f3c..4d378ee6 100644 --- a/klettres/klettres/klettres.cpp +++ b/klettres/klettres/klettres.cpp @@ -19,14 +19,14 @@ ***************************************************************************/ //Qt includes -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include //KDE includes #include @@ -72,8 +72,8 @@ KLettres::KLettres() loadSettings(); //Setup current language sounds soundFactory = new SoundFactory(this, "sounds"); - setMinimumSize( QSize( 640, 550 ) ); - setMaximumSize( QSize( 640, 550 ) ); + setMinimumSize( TQSize( 640, 550 ) ); + setMaximumSize( TQSize( 640, 550 ) ); //Start game m_view->game(); } @@ -88,11 +88,11 @@ void KLettres::findLanguages() m_languageNames.clear(); //m_sortedNames.clear(); //the program scans in khangman/data/ to see what languages data is found - QStringList mdirs = KGlobal::dirs()->findDirs("data", "klettres/"); + TQStringList mdirs = KGlobal::dirs()->findDirs("data", "klettres/"); if (mdirs.isEmpty()) return; - for (QStringList::Iterator it =mdirs.begin(); it !=mdirs.end(); ++it ) { - QDir dir(*it); - m_languages += dir.entryList(QDir::Dirs, QDir::Name); + for (TQStringList::Iterator it =mdirs.begin(); it !=mdirs.end(); ++it ) { + TQDir dir(*it); + m_languages += dir.entryList(TQDir::Dirs, TQDir::Name); m_languages.remove(m_languages.find(".")); m_languages.remove(m_languages.find("..")); } @@ -104,7 +104,7 @@ void KLettres::findLanguages() Prefs::setLanguages(m_languages); Prefs::writeConfig(); //find duplicated entries in KDEDIR and KDEHOME - QStringList temp_languages; + TQStringList temp_languages; for (uint i=0; i1) { @@ -125,16 +125,16 @@ void KLettres::findLanguages() config->setGroup("KNewStuffStatus"); for (uint i=0; ireadEntry(tmp)) - config->writeEntry(tmp, QDate::currentDate().toString()); + config->writeEntry(tmp, TQDate::currentDate().toString()); } //we look in $KDEDIR/share/locale/all_languages from /kdelibs/kdecore/all_languages //to find the name of the country //corresponding to the code and the language the user set KConfig entry(locate("locale", "all_languages")); - const QStringList::ConstIterator itEnd = m_languages.end(); - for (QStringList::Iterator it = m_languages.begin(); it != m_languages.end(); ++it) { + const TQStringList::ConstIterator itEnd = m_languages.end(); + for (TQStringList::Iterator it = m_languages.begin(); it != m_languages.end(); ++it) { if (*it == "hi-ro") m_languageNames.append(i18n("Romanized Hindi")); else if (*it =="lug_UG") @@ -149,10 +149,10 @@ void KLettres::findLanguages() //m_sortedNames = m_languageNames; } -QString Prefs::defaultLanguage() +TQString Prefs::defaultLanguage() { //see what is the user language for KDE - QStringList defaultLanguages = KGlobal::locale()->languagesTwoAlpha(); + TQStringList defaultLanguages = KGlobal::locale()->languagesTwoAlpha(); if (!defaultLanguages.isEmpty()) { //scan to see if defaultLanguages[0] belongs to m_languages. If not, en is default. int i = Prefs::self()->m_languages.findIndex(defaultLanguages[0]); @@ -163,18 +163,18 @@ QString Prefs::defaultLanguage() else return Prefs::self()->m_languages[i]; //KDE default if exists } - return QString::null; + return TQString::null; } -bool KLettres::loadLayout(QDomDocument &layoutDocument) +bool KLettres::loadLayout(TQDomDocument &layoutDocument) { - QFile layoutFile(locate("data", "klettres/"+Prefs::language()+"/sounds.xml")); + TQFile layoutFile(locate("data", "klettres/"+Prefs::language()+"/sounds.xml")); //if xml file is not found, program exits if (!layoutFile.exists()) { kdWarning() << "sounds.xml file not found in $KDEDIR/share/apps/klettres/"+Prefs::language() << endl; - QString mString=i18n("The file sounds.xml was not found in\n" + TQString mString=i18n("The file sounds.xml was not found in\n" "$KDEDIR/share/apps/klettres/\n\n" "Please install this file and start KLettres again.\n\n"); KMessageBox::information( this, mString,"KLettres - Error" ); @@ -195,16 +195,16 @@ bool KLettres::loadLayout(QDomDocument &layoutDocument) void KLettres::setupActions() { - KAction *m_newAction = new KAction(i18n("New Sound"), "file_new", CTRL+Key_N, m_view, SLOT(game()), actionCollection(), "play_new"); + KAction *m_newAction = new KAction(i18n("New Sound"), "file_new", CTRL+Key_N, m_view, TQT_SLOT(game()), actionCollection(), "play_new"); m_newAction->setToolTip(i18n("Play a new sound")); m_newAction->setWhatsThis(i18n("You can play a new sound by clicking this button or using the File menu, New Sound.")); - new KAction( i18n("Get Alphabet in New Language..."), "knewstuff", 0, this, SLOT( slotDownloadNewStuff() ), actionCollection(), "downloadnewstuff" ); - KAction *m_playAgainAction = new KAction(i18n("Replay Sound"),"player_play", CTRL+Key_P, m_view, SLOT(slotPlayAgain()), actionCollection(), "play_again"); + new KAction( i18n("Get Alphabet in New Language..."), "knewstuff", 0, this, TQT_SLOT( slotDownloadNewStuff() ), actionCollection(), "downloadnewstuff" ); + KAction *m_playAgainAction = new KAction(i18n("Replay Sound"),"player_play", CTRL+Key_P, m_view, TQT_SLOT(slotPlayAgain()), actionCollection(), "play_again"); m_playAgainAction->setToolTip(i18n("Play the same sound again")); m_playAgainAction->setWhatsThis(i18n("You can replay the same sound again by clicking this button or using the File menu, Replay Sound.")); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); - m_menubarAction = new KToggleAction(i18n("Show &Menubar"),"editclear", CTRL+Key_M, this, SLOT(slotMenubar()), actionCollection(), "menubar"); + m_menubarAction = new KToggleAction(i18n("Show &Menubar"),"editclear", CTRL+Key_M, this, TQT_SLOT(slotMenubar()), actionCollection(), "menubar"); m_menubarAction->setCheckedState(i18n("Hide &Menubar")); m_menubarAction->setChecked(true); m_menubarAction->setWhatsThis(i18n("You can show or hide the menubar as you wish by clicking this button.")); @@ -230,16 +230,16 @@ void KLettres::setupActions() m_themeAction->setToolTip(i18n("Select the theme")); m_themeAction->setWhatsThis(i18n("Here you can change the theme for KLettres. A theme consists in the background picture and the font color for the letter displayed.")); - m_kidAction = new KToggleAction(i18n("Mode Kid"), "klettres_kids", CTRL+Key_K, this, SLOT(slotModeKid()), actionCollection(), "mode_kid"); + m_kidAction = new KToggleAction(i18n("Mode Kid"), "klettres_kids", CTRL+Key_K, this, TQT_SLOT(slotModeKid()), actionCollection(), "mode_kid"); m_kidAction->setWhatsThis(i18n("If you are in the Grown-up mode, clicking on this button will set up the Kid mode. The Kid mode has no menubar and the font is bigger in the statusbar.")); - m_grownupAction = new KToggleAction(i18n("Mode Grown-up"), "klettres_grownup", CTRL+Key_G, this, SLOT(slotModeGrownup()), actionCollection(), "mode_grownup"); + m_grownupAction = new KToggleAction(i18n("Mode Grown-up"), "klettres_grownup", CTRL+Key_G, this, TQT_SLOT(slotModeGrownup()), actionCollection(), "mode_grownup"); m_grownupAction->setWhatsThis(i18n("The Grown-up mode is the normal mode where you can see the menubar.")); - connect(m_levelAction, SIGNAL(activated(int)), this, SLOT(slotChangeLevel(int))); - connect(m_languageAction, SIGNAL(activated(int)), this, SLOT(slotChangeLanguage(int))); - connect(m_themeAction, SIGNAL(activated(int)), this, SLOT(slotChangeTheme(int))); + connect(m_levelAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeLevel(int))); + connect(m_languageAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeLanguage(int))); + connect(m_themeAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeTheme(int))); - KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(optionsPreferences()), actionCollection()); setupGUI(); } @@ -247,8 +247,8 @@ void KLettres::setupActions() void KLettres::setupStatusbar() { KStatusBar *st=statusBar(); - m_langLabel = new QLabel(st); - m_levLabel = new QLabel(st); + m_langLabel = new TQLabel(st); + m_levLabel = new TQLabel(st); st->addWidget(m_levLabel); st->insertFixedItem("", 1);//add a space st->addWidget(m_langLabel); @@ -273,7 +273,7 @@ void KLettres::optionsPreferences() //fonts is the icon Timer *m_timer = new Timer(); dialog->addPage(m_timer, i18n("Timer"), "clock"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(slotUpdateSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotUpdateSettings())); dialog->show(); } @@ -283,8 +283,8 @@ void KLettres::loadSettings() //selectedLanguage = Prefs::languageNumber(); //m_view->selectedLanguage = selectedLanguage; m_languageAction->setCurrentItem(Prefs::languageNumber()); - QString langString = m_languageNames[Prefs::languageNumber()]; - langString.replace("&", QString::null); + TQString langString = m_languageNames[Prefs::languageNumber()]; + langString.replace("&", TQString::null); m_langLabel->setText(i18n("Current language is %1").arg(langString)); loadLangToolBar(); // load default level @@ -367,8 +367,8 @@ void KLettres::slotChangeLanguage(int newLanguage) Prefs::setLanguage(m_languages[newLanguage]); Prefs::writeConfig(); // Update the StatusBar - QString langString = m_languageNames[newLanguage]; - langString.replace("&", QString::null); + TQString langString = m_languageNames[newLanguage]; + langString.replace("&", TQString::null); m_langLabel->setText(i18n("Current language is %1").arg(langString)); loadLangToolBar(); // Change language effectively @@ -397,12 +397,12 @@ void KLettres::slotChangeTheme(int index) void KLettres::slotModeGrownup() { - QPalette pal; - QColorGroup cg; - cg.setColor( QColorGroup::Background, white); + TQPalette pal; + TQColorGroup cg; + cg.setColor( TQColorGroup::Background, white); pal.setActive( cg ); statusBar()->setPalette( pal ); - QFont f_lab( "Serif" , 10); //font for statusBar + TQFont f_lab( "Serif" , 10); //font for statusBar m_levLabel->setFont(f_lab); m_langLabel->setFont(f_lab); m_menubarAction->setChecked(true); @@ -413,8 +413,8 @@ void KLettres::slotModeGrownup() m_menubarAction->setToolTip(i18n("Hide Menubar")); slotMenubar(); //m_secondToolbar->setIconSize(22); //causes a crash when adding/removing actions in toolbar - setMinimumSize( QSize( 640, 538 ) ); - setMaximumSize( QSize( 640, 538 ) ); + setMinimumSize( TQSize( 640, 538 ) ); + setMaximumSize( TQSize( 640, 538 ) ); m_view->m_timer = Prefs::grownTimer(); Prefs::setMode(Prefs::EnumMode::grownup); Prefs::writeConfig(); @@ -422,12 +422,12 @@ void KLettres::slotModeGrownup() void KLettres::slotModeKid() { - QPalette pal; - QColorGroup cg; - cg.setColor( QColorGroup::Background, white); + TQPalette pal; + TQColorGroup cg; + cg.setColor( TQColorGroup::Background, white); pal.setActive( cg ); statusBar()->setPalette( pal ); - QFont f_lab( "Serif" , 12); //font for statusBar + TQFont f_lab( "Serif" , 12); //font for statusBar f_lab.setBold(true); m_levLabel->setFont(f_lab); m_langLabel->setFont(f_lab); @@ -439,8 +439,8 @@ void KLettres::slotModeKid() m_menubarAction->setToolTip(i18n("Show Menubar")); m_grownupAction->setChecked(false); //m_secondToolbar->setIconSize(32); - setMinimumSize( QSize( 640, 480 ) ); - setMaximumSize( QSize( 640, 480 ) ); + setMinimumSize( TQSize( 640, 480 ) ); + setMaximumSize( TQSize( 640, 480 ) ); m_view->m_timer = Prefs::kidTimer(); Prefs::setMode(Prefs::EnumMode::kid); Prefs::writeConfig(); @@ -452,13 +452,13 @@ void KLettres::loadLangToolBar() if (m_languages[Prefs::languageNumber()]== "cs" || m_languages[Prefs::languageNumber()]== "da" || m_languages[Prefs::languageNumber()]== "sk" || m_languages[Prefs::languageNumber()]== "es" || m_languages[Prefs::languageNumber()]== "de" || m_languages[Prefs::languageNumber()]== "nds")//Dutch, English, French and Italian have no special characters { allData.clear(); - QString myString=QString("klettres/%1.txt").arg(m_languages[Prefs::languageNumber()]); - QFile myFile; + TQString myString=TQString("klettres/%1.txt").arg(m_languages[Prefs::languageNumber()]); + TQFile myFile; myFile.setName(locate("data",myString)); if (!myFile.exists()) { - QString mString=i18n("File $KDEDIR/share/apps/klettres/%1.txt not found;\n" + TQString mString=i18n("File $KDEDIR/share/apps/klettres/%1.txt not found;\n" "please check your installation.").arg(m_languages[Prefs::languageNumber()]); KMessageBox::sorry( this, mString, i18n("Error") ); @@ -466,16 +466,16 @@ void KLettres::loadLangToolBar() } update(); //we open the file and store info into the stream... - QFile openFileStream(myFile.name()); + TQFile openFileStream(myFile.name()); openFileStream.open(IO_ReadOnly); - QTextStream readFileStr(&openFileStream); - readFileStr.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream readFileStr(&openFileStream); + readFileStr.setEncoding(TQTextStream::UnicodeUTF8); //allData contains all the words from the file - allData = QStringList::split("\n", readFileStr.read(), true); + allData = TQStringList::split("\n", readFileStr.read(), true); openFileStream.close(); for (int i=0; i<(int) allData.count(); i++) { if (!allData[i].isEmpty()) - m_secondToolbar->insertButton (charIcon(allData[i].at(0)), i, SIGNAL( clicked() ), this, SLOT( slotPasteChar()), true, i18n("Inserts the character %1").arg(allData[i]), i+1 ); + m_secondToolbar->insertButton (charIcon(allData[i].at(0)), i, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotPasteChar()), true, i18n("Inserts the character %1").arg(allData[i]), i+1 ); } } } @@ -486,34 +486,34 @@ void KLettres::slotPasteChar() m_view->m_letterEdit->insert(allData[charBut->id()]); } -QString KLettres::charIcon(const QChar & c) +TQString KLettres::charIcon(const TQChar & c) { ///Create a name and path for the icon - QString s = locateLocal("icon", "char" + QString::number(c.unicode()) + ".png"); + TQString s = locateLocal("icon", "char" + TQString::number(c.unicode()) + ".png"); - QRect r(4, 4, 120, 120); + TQRect r(4, 4, 120, 120); ///A font to draw the character with - QFont font; + TQFont font; font.setFamily( "Arial" ); font.setPixelSize(120); - font.setWeight(QFont::Normal); + font.setWeight(TQFont::Normal); ///Create the pixmap - QPixmap pm(128, 128); + TQPixmap pm(128, 128); pm.fill(Qt::white); - QPainter p(&pm); + TQPainter p(&pm); p.setFont(font); p.setPen(Qt::black); - p.drawText(r, Qt::AlignCenter, (QString) c); + p.drawText(r, Qt::AlignCenter, (TQString) c); ///Create transparency mask - QBitmap bm(128, 128); + TQBitmap bm(128, 128); bm.fill(Qt::color0); - QPainter b(&bm); + TQPainter b(&bm); b.setFont(font); b.setPen(Qt::color1); - b.drawText(r, Qt::AlignCenter, (QString) c); + b.drawText(r, Qt::AlignCenter, (TQString) c); ///Mask the pixmap pm.setMask(bm); diff --git a/klettres/klettres/klettres.h b/klettres/klettres/klettres.h index 82ce62ed..574b583a 100644 --- a/klettres/klettres/klettres.h +++ b/klettres/klettres/klettres.h @@ -56,15 +56,15 @@ public: ///Sound class SoundFactory *soundFactory; ///All available language codes - QStringList m_languages; + TQStringList m_languages; ///All available language names - QStringList m_languageNames; + TQStringList m_languageNames; /** *Load the xml file *@param layoutDocument the xml file *@return bool true if the xml document is found and well formed, false otherwise */ - bool loadLayout(QDomDocument &layoutDocument); + bool loadLayout(TQDomDocument &layoutDocument); ///Number corresponding to the selected language: 0 is Czech, 1 is Danish, 2 is English (default), 3 is French, 4 is Dutch, 5 is Slovak //uint selectedLanguage; ///Action that sets up the Language menu @@ -90,13 +90,13 @@ protected: ///Action allow the Grownup mode KToggleAction *m_grownupAction; ///Label stating the language in the statusbar - QLabel *m_langLabel; + TQLabel *m_langLabel; ///Label stating the level in the statusbar - QLabel *m_levLabel; + TQLabel *m_levLabel; ///Holds the levels - QStringList m_levelsNames; + TQStringList m_levelsNames; ///Holds the looks - QStringList m_themesNames; + TQStringList m_themesNames; ///Create an instance of a KToolBar KToolBar *m_mainToolbar; ///Second toolbar with buttons of special characters per language @@ -112,7 +112,7 @@ protected: /**generates icons for the special characters toolbar * @param c the character that will be painted on the icon */ - QString charIcon(const QChar &c); + TQString charIcon(const TQChar &c); /** *Update the level menu and level combobox * @param id The id of the new level @@ -123,7 +123,7 @@ protected: ///Set the correct buttons on the second toolbar according to the language void loadLangToolBar(); ///All the special characters from a language file, these characters will be as buttons on the Special Characters Toolbar - QStringList allData; + TQStringList allData; protected slots: ///Call the Get New Stuff dialog diff --git a/klettres/klettres/klettresview.cpp b/klettres/klettres/klettresview.cpp index f015c18d..c9891bf1 100644 --- a/klettres/klettres/klettresview.cpp +++ b/klettres/klettres/klettresview.cpp @@ -18,11 +18,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -34,17 +34,17 @@ #include "prefs.h" KLettresView::KLettresView(KLettres *parent) - : QWidget(parent) + : TQWidget(parent) { m_klettres = parent; - setMinimumSize( QSize( 640, 480 ) ); - setMaximumSize( QSize( 640, 480 ) ); + setMinimumSize( TQSize( 640, 480 ) ); + setMaximumSize( TQSize( 640, 480 ) ); //lineEdit for user input m_letterEdit = new KLineEdit( this, "line1" ); - m_letterEdit->setGeometry( QRect( 40, 310, 161, 160 ) ); - QToolTip::add( m_letterEdit, i18n( "Type the letter or syllable that you just heard" ) ); + m_letterEdit->setGeometry( TQRect( 40, 310, 161, 160 ) ); + TQToolTip::add( m_letterEdit, i18n( "Type the letter or syllable that you just heard" ) ); setFont(Prefs::font()); //load background pics @@ -90,25 +90,25 @@ void KLettresView::chooseSound() else width = 200+(20*(m_length-2)); update(); - m_letterEdit->setMinimumSize( QSize( width, 160 ) ); - m_letterEdit->setMaximumSize( QSize( width, 160 ) ); + m_letterEdit->setMinimumSize( TQSize( width, 160 ) ); + m_letterEdit->setMaximumSize( TQSize( width, 160 ) ); } -void KLettresView::paintEvent( QPaintEvent * ) +void KLettresView::paintEvent( TQPaintEvent * ) { if (Prefs::level()%2==1) { - QPainter paint(this); + TQPainter paint(this); paint.setFont(Prefs::font()); - QString start = i18n("Start"); + TQString start = i18n("Start"); paint.setFont(Prefs::font()); if (Prefs::theme() == Prefs::EnumTheme::desert) { - paint.setPen( QColor(115, 50, 95)); //brown - //m_letterEdit->setPaletteForegroundColor(QColor(115, 50, 95)); + paint.setPen( TQColor(115, 50, 95)); //brown + //m_letterEdit->setPaletteForegroundColor(TQColor(115, 50, 95)); } else if (Prefs::theme() == Prefs::EnumTheme::arctic) { paint.setPen( Qt::white ); - //m_letterEdit->setPaletteForegroundColor(QColor(48, 75, 137)); + //m_letterEdit->setPaletteForegroundColor(TQColor(48, 75, 137)); } else { paint.setPen( Qt::white ); @@ -124,28 +124,28 @@ void KLettresView::game() m_cursorPos = 1; //reset everything so when you change language or levels //it all restarts nicely - QObject::disconnect(m_letterEdit, SIGNAL(textChanged(const QString&)),this,SLOT(slotProcess(const QString&)) ); + TQObject::disconnect(m_letterEdit, TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(slotProcess(const TQString&)) ); m_letterEdit->clear(); m_letterEdit->setCursorPosition(0); m_letterEdit->setMaxLength(1); //fix that's in trunk m_letterEdit->setFocus(); chooseSound(); - QObject::connect(m_letterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotProcess(const QString&)) ); + TQObject::connect(m_letterEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotProcess(const TQString&)) ); } -void KLettresView::slotProcess(const QString &inputLetter) +void KLettresView::slotProcess(const TQString &inputLetter) { - QObject::disconnect(m_letterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotProcess(const QString&)) ); + TQObject::disconnect(m_letterEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotProcess(const TQString&)) ); //check if backspace if(inputLetter.length() != m_cursorPos) { m_cursorPos--; m_letterEdit->setMaxLength( m_cursorPos ); - QObject::connect(m_letterEdit, SIGNAL(textChanged(const QString&)),this,SLOT(slotProcess(const QString&)) ); + TQObject::connect(m_letterEdit, TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(slotProcess(const TQString&)) ); return; } - QChar input_character = inputLetter.at(inputLetter.length()-1); + TQChar input_character = inputLetter.at(inputLetter.length()-1); if (input_character.isLetter()) //(a1.at(inputLetter.length()).lower().isLetter()) { @@ -153,21 +153,21 @@ void KLettresView::slotProcess(const QString &inputLetter) m_letterEdit->selectAll(); m_letterEdit->cut(); m_letterEdit->setText(m_upperLetter); - QTimer::singleShot(m_timer*100, this, SLOT(slotTimerDone())); + TQTimer::singleShot(m_timer*100, this, TQT_SLOT(slotTimerDone())); } else { kdDebug() << "in no char loop" << endl; kdDebug() << "cursor " << m_cursorPos << endl; m_letterEdit->backspace(); - QObject::connect(m_letterEdit, SIGNAL(textChanged(const QString&)),this,SLOT(slotProcess(const QString&)) ); + TQObject::connect(m_letterEdit, TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(slotProcess(const TQString&)) ); } } void KLettresView::slotTimerDone() { kdDebug() << "in timer done" << endl; - QString match = m_currentLetter.left(m_cursorPos ); + TQString match = m_currentLetter.left(m_cursorPos ); if (match == m_upperLetter) { @@ -177,7 +177,7 @@ void KLettresView::slotTimerDone() m_letterEdit->setCursorPosition( m_cursorPos ); m_letterEdit->setFocus(); m_cursorPos ++; - QObject::connect(m_letterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotProcess(const QString&)) ); + TQObject::connect(m_letterEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotProcess(const TQString&)) ); } else { @@ -191,7 +191,7 @@ void KLettresView::slotTimerDone() //play sound again m_klettres->soundFactory->playSound(m_random); - QObject::connect(m_letterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotProcess(const QString&)) ); + TQObject::connect(m_letterEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotProcess(const TQString&)) ); } } diff --git a/klettres/klettres/klettresview.h b/klettres/klettres/klettresview.h index 80c8a95b..63e274f1 100644 --- a/klettres/klettres/klettresview.h +++ b/klettres/klettres/klettresview.h @@ -21,8 +21,8 @@ #ifndef KLETTRESVIEW_H #define KLETTRESVIEW_H -#include -#include +#include +#include #include class QLabel; @@ -68,12 +68,12 @@ public: protected: ///The pixmaps for the themes backgrounds - QPixmap m_grownupPicture, + TQPixmap m_grownupPicture, m_kidPicture, m_desertPicture; ///Palette changes wether it's kid or grown-up - QPalette pal; - QColorGroup cg; + TQPalette pal; + TQColorGroup cg; ///cursor position in the line edit int m_cursorPos; ///Random number that decides on the letter/syllable and sound @@ -83,13 +83,13 @@ protected: ///Choose a sound in random and ensure that it's not the same than the previous one void chooseSound(); ///Current letter or syllable stored - QString m_currentLetter; + TQString m_currentLetter; ///Current letter entered uppercase i.e. m_inputLetter.upper() - QString m_upperLetter; + TQString m_upperLetter; ///Current letter entered - //QString m_inputLetter; NOTE: not used + //TQString m_inputLetter; NOTE: not used ///Paint the letter/syllable in levels 1 and 3 - void paintEvent( QPaintEvent * ); + void paintEvent( TQPaintEvent * ); public slots: ///Start playing displaying a new letter/syllable, playing the associated sound @@ -99,7 +99,7 @@ protected: ///Play the same sound again void slotPlayAgain(); - void slotProcess(const QString &inputLetter); + void slotProcess(const TQString &inputLetter); void slotTimerDone(); }; diff --git a/klettres/klettres/klnewstuff.cpp b/klettres/klettres/klnewstuff.cpp index c6d601ba..ed6061ba 100644 --- a/klettres/klettres/klnewstuff.cpp +++ b/klettres/klettres/klnewstuff.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -31,7 +31,7 @@ KLNewStuff::KLNewStuff( KLettresView *view ) : { } -bool KLNewStuff::install( const QString &fileName ) +bool KLNewStuff::install( const TQString &fileName ) { kdDebug(5850) << "KLNewStuff::install(): " << fileName << endl; @@ -40,7 +40,7 @@ bool KLNewStuff::install( const QString &fileName ) return false; const KArchiveDirectory *archiveDir = archive.directory(); KStandardDirs myStdDir; - const QString destDir =myStdDir.saveLocation("data", kapp->instanceName() + "/", true); + const TQString destDir =myStdDir.saveLocation("data", kapp->instanceName() + "/", true); KStandardDirs::makeDir( destDir ); archiveDir->copyTo(destDir); archive.close(); @@ -54,7 +54,7 @@ bool KLNewStuff::install( const QString &fileName ) return true; } -bool KLNewStuff::createUploadFile( const QString &fileName ) +bool KLNewStuff::createUploadFile( const TQString &fileName ) { //return mView->saveCalendar( fileName ); return true; diff --git a/klettres/klettres/klnewstuff.h b/klettres/klettres/klnewstuff.h index f7cd9803..e3c6acbe 100644 --- a/klettres/klettres/klnewstuff.h +++ b/klettres/klettres/klnewstuff.h @@ -29,8 +29,8 @@ class KLNewStuff : public KNewStuff public: KLNewStuff( KLettresView * ); - bool install( const QString &fileName ); - bool createUploadFile( const QString &fileName ); + bool install( const TQString &fileName ); + bool createUploadFile( const TQString &fileName ); //private: KLettresView *m_view; diff --git a/klettres/klettres/prefs_addons.h b/klettres/klettres/prefs_addons.h index 42744ffa..ec28026a 100644 --- a/klettres/klettres/prefs_addons.h +++ b/klettres/klettres/prefs_addons.h @@ -20,8 +20,8 @@ ***************************************************************************/ public: -static QString defaultLanguage(); -static void setLanguages(const QStringList &languages) +static TQString defaultLanguage(); +static void setLanguages(const TQStringList &languages) { Prefs::self()->m_languages = languages; } @@ -45,4 +45,4 @@ static int languageNumber() return 0; } -QStringList m_languages; +TQStringList m_languages; diff --git a/klettres/klettres/soundfactory.cpp b/klettres/klettres/soundfactory.cpp index 31f243fa..e23bc501 100644 --- a/klettres/klettres/soundfactory.cpp +++ b/klettres/klettres/soundfactory.cpp @@ -34,7 +34,7 @@ SoundFactory::SoundFactory(KLettres *parent, const char *name) - : QObject(parent, name) + : TQObject(parent, name) { klettres = parent; @@ -50,7 +50,7 @@ SoundFactory::~SoundFactory() { } -void SoundFactory::change(QString currentLanguage) +void SoundFactory::change(TQString currentLanguage) { //go load the sounds for the current language bool ok = loadLanguage(m_layoutsDocument, currentLanguage); @@ -61,7 +61,7 @@ void SoundFactory::change(QString currentLanguage) void SoundFactory::playSound(int mySound) { - QString soundFile; + TQString soundFile; if ((uint) mySound >= sounds) return; @@ -78,22 +78,22 @@ void SoundFactory::loadFailure() KMessageBox::error(klettres, i18n("Error while loading the sound names.")); } -bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, QString currentLanguage) +bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, TQString currentLanguage) { - QDomNodeList languagesList, + TQDomNodeList languagesList, alphabetList, syllablesList, soundNamesList; - QDomElement languageElement, + TQDomElement languageElement, alphabetElement, syllableElement, soundNameElement; - QDomAttr nameAttribute, fileAttribute; + TQDomAttr nameAttribute, fileAttribute; languagesList = layoutDocument.elementsByTagName("language"); - QDomAttr codeAttribute; + TQDomAttr codeAttribute; //check if the sound files match current language - languageElement = (const QDomElement &) languagesList.item(0).toElement(); + languageElement = (const TQDomElement &) languagesList.item(0).toElement(); codeAttribute = languageElement.attributeNode("code"); if (currentLanguage != codeAttribute.value()) { kdDebug() << "Fail reading language !!! " << endl; @@ -107,7 +107,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, QString currentLan if (alphabetList.count() != 1) return false; - alphabetElement = (const QDomElement &) alphabetList.item(0).toElement(); + alphabetElement = (const TQDomElement &) alphabetList.item(0).toElement(); soundNamesList = alphabetElement.elementsByTagName("sound"); } @@ -119,7 +119,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, QString currentLan if (syllablesList.count() != 1) return false; - syllableElement = (const QDomElement &) syllablesList.item(0).toElement(); + syllableElement = (const TQDomElement &) syllablesList.item(0).toElement(); soundNamesList = syllableElement.elementsByTagName("sound"); } @@ -133,7 +133,7 @@ bool SoundFactory::loadLanguage(QDomDocument &layoutDocument, QString currentLan for (uint sound = 0; sound < sounds; sound++) { - soundNameElement = (const QDomElement &) soundNamesList.item(sound).toElement(); + soundNameElement = (const TQDomElement &) soundNamesList.item(sound).toElement(); nameAttribute = soundNameElement.attributeNode("name"); //namesList helds the names of the letter or syllable to display namesList.append(nameAttribute.value()); diff --git a/klettres/klettres/soundfactory.h b/klettres/klettres/soundfactory.h index c02b26c4..2cc8a5de 100644 --- a/klettres/klettres/soundfactory.h +++ b/klettres/klettres/soundfactory.h @@ -25,7 +25,7 @@ #ifndef _SOUNDFACTORY_H_ #define _SOUNDFACTORY_H_ -#include +#include class KLettres; @@ -50,23 +50,23 @@ public: ///Call the main instance of the program KLettres *klettres; ///Change the language when the user changes the language in the Languages menu - void change(QString currentLanguage); + void change(TQString currentLanguage); ///Play the sound associated to int soundRef void playSound(int ) ; ///Number of sounds corresponding to the current language and level (alphabet or syllables) uint sounds; ///List of sound names - QStringList namesList; + TQStringList namesList; ///List of sound files associated with each sound name - QStringList filesList; + TQStringList filesList; /** * Load the sounds of one given language * Call that when you read the language from Config and when the language changes * or when the level changes */ - bool loadLanguage(QDomDocument &layoutDocument, QString currentLanguage); + bool loadLanguage(TQDomDocument &layoutDocument, TQString currentLanguage); ///The language document - QDomDocument m_layoutsDocument; + TQDomDocument m_layoutsDocument; private: ///Report a load failure diff --git a/klettres/klettres/timer.cpp b/klettres/klettres/timer.cpp index 7ddcc20c..f102d82e 100644 --- a/klettres/klettres/timer.cpp +++ b/klettres/klettres/timer.cpp @@ -22,8 +22,8 @@ #include -#include -#include +#include +#include #include "timer.h" #include "prefs.h" @@ -32,17 +32,17 @@ Timer::Timer() :timerdlg() { - timeGrownLabel->setText(QString::number(Prefs::grownTimer()) + " " + i18n("tenths of second")); - timeKidLabel->setText(QString::number(Prefs::kidTimer()) + " " + i18n("tenths of second")); - connect(kcfg_GrownTimer, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged())); - connect(kcfg_KidTimer, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged())); + timeGrownLabel->setText(TQString::number(Prefs::grownTimer()) + " " + i18n("tenths of second")); + timeKidLabel->setText(TQString::number(Prefs::kidTimer()) + " " + i18n("tenths of second")); + connect(kcfg_GrownTimer, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(sliderValueChanged())); + connect(kcfg_KidTimer, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(sliderValueChanged())); } void Timer::sliderValueChanged() { - timeKidLabel->setText(QString::number(kcfg_KidTimer->value()) + " " + i18n("tenths of second")); - timeGrownLabel->setText(QString::number(kcfg_GrownTimer->value()) + " " + i18n("tenths of second")); + timeKidLabel->setText(TQString::number(kcfg_KidTimer->value()) + " " + i18n("tenths of second")); + timeGrownLabel->setText(TQString::number(kcfg_GrownTimer->value()) + " " + i18n("tenths of second")); } diff --git a/klettres/klettres/timer.h b/klettres/klettres/timer.h index 91785a32..28634cf3 100644 --- a/klettres/klettres/timer.h +++ b/klettres/klettres/timer.h @@ -41,7 +41,7 @@ public: Timer(); protected slots: - ///When the QSlider value changes + ///When the TQSlider value changes void sliderValueChanged(); }; diff --git a/kmplot/kmplot/FktDlg.cpp b/kmplot/kmplot/FktDlg.cpp index aef0b3f4..ac3d84f1 100644 --- a/kmplot/kmplot/FktDlg.cpp +++ b/kmplot/kmplot/FktDlg.cpp @@ -24,8 +24,8 @@ */ // Qt includes -// #include -// #include +// #include +// #include // KDE includes #include @@ -33,9 +33,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include // locale includes #include "FktDlg.h" @@ -49,17 +49,17 @@ #include -FktDlg::FktDlg( QWidget* parent, View *view ) : FktDlgData( parent, "editPlots" ), m_view(view) +FktDlg::FktDlg( TQWidget* parent, View *view ) : FktDlgData( parent, "editPlots" ), m_view(view) { - connect( cmdCopyFunction, SIGNAL( clicked() ), this, SLOT( slotCopyFunction()) ); - connect( cmdMoveFunction, SIGNAL( clicked() ), this, SLOT( slotMoveFunction()) ); - connect( lb_fktliste, SIGNAL( doubleClicked(QListViewItem *, const QPoint &, int)), this, SLOT(lb_fktliste_doubleClicked(QListViewItem *, const QPoint &, int)) ); - connect( lb_fktliste, SIGNAL( clicked(QListViewItem *)), this, SLOT(lb_fktliste_clicked(QListViewItem *))); - connect( lb_fktliste, SIGNAL( spacePressed(QListViewItem *)), this, SLOT(lb_fktliste_spacePressed(QListViewItem *))); + connect( cmdCopyFunction, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCopyFunction()) ); + connect( cmdMoveFunction, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveFunction()) ); + connect( lb_fktliste, TQT_SIGNAL( doubleClicked(TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(lb_fktliste_doubleClicked(TQListViewItem *, const TQPoint &, int)) ); + connect( lb_fktliste, TQT_SIGNAL( clicked(TQListViewItem *)), this, TQT_SLOT(lb_fktliste_clicked(TQListViewItem *))); + connect( lb_fktliste, TQT_SIGNAL( spacePressed(TQListViewItem *)), this, TQT_SLOT(lb_fktliste_spacePressed(TQListViewItem *))); lb_fktliste->addColumn( "" ); lb_fktliste->header()->hide(); - lb_fktliste->setResizeMode( QListView::LastColumn ); + lb_fktliste->setResizeMode( TQListView::LastColumn ); } FktDlg::~FktDlg() @@ -70,7 +70,7 @@ void FktDlg::slotDelete() { if ( lb_fktliste->currentItem() == 0) return; - QCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); + TQCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); if( currentItem->text()[0] == 'x' ) { // Delete pair of parametric function @@ -93,18 +93,18 @@ void FktDlg::slotDelete() PushButtonDel->setEnabled(false); } -void FktDlg::lb_fktliste_doubleClicked( QListViewItem *, const QPoint &, int ) +void FktDlg::lb_fktliste_doubleClicked( TQListViewItem *, const TQPoint &, int ) { - if ( mapFromGlobal(QCursor::pos()).x() <= 40 ) + if ( mapFromGlobal(TQCursor::pos()).x() <= 40 ) return; slotEdit(); } -void FktDlg::lb_fktliste_spacePressed( QListViewItem *item) +void FktDlg::lb_fktliste_spacePressed( TQListViewItem *item) { if ( !item ) return; - QCheckListItem *currentItem = dynamic_cast(item); + TQCheckListItem *currentItem = dynamic_cast(item); int id; if ( currentItem->text()[0] == 'x' ) id = getParamId(currentItem->text()); @@ -118,9 +118,9 @@ void FktDlg::lb_fktliste_spacePressed( QListViewItem *item) updateView(); } -void FktDlg::lb_fktliste_clicked( QListViewItem * item ) +void FktDlg::lb_fktliste_clicked( TQListViewItem * item ) { - if ( mapFromGlobal(QCursor::pos()).x() > 40 ) + if ( mapFromGlobal(TQCursor::pos()).x() > 40 ) return; lb_fktliste_spacePressed(item); } @@ -128,7 +128,7 @@ void FktDlg::lb_fktliste_clicked( QListViewItem * item ) void FktDlg::slotEdit() { - QCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); + TQCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); if ( currentItem == 0 ) { PushButtonEdit->setEnabled(false); @@ -147,9 +147,9 @@ void FktDlg::slotEdit() slotEditFunction( id ); } -int FktDlg::getId( const QString &f_str ) +int FktDlg::getId( const TQString &f_str ) { - for( QValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) { if ( it->fstr == f_str ) return it->id; @@ -157,10 +157,10 @@ int FktDlg::getId( const QString &f_str ) return -1; } -int FktDlg::getParamId( const QString &f_str) +int FktDlg::getParamId( const TQString &f_str) { - QString const fname = f_str.section( "(", 0, 0 ); - for( QValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) + TQString const fname = f_str.section( "(", 0, 0 ); + for( TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) { if ( it->fname == fname ) return it->id; @@ -188,15 +188,15 @@ void FktDlg::slotEditFunction( int id ) if ( id==-1 ) editFunction->setCaption(i18n( "New Function Plot" )); else editFunction->setCaption(i18n( "Edit Function Plot" )); editFunction->initDialog( id ); - if( editFunction->exec() == QDialog::Accepted ) + if( editFunction->exec() == TQDialog::Accepted ) { Ufkt *function = editFunction->functionItem(); - QCheckListItem *item; + TQCheckListItem *item; if( id == -1 ) //a new function - item = new QCheckListItem(lb_fktliste, function->fstr, QCheckListItem::CheckBox); //a new function + item = new TQCheckListItem(lb_fktliste, function->fstr, TQCheckListItem::CheckBox); //a new function else //change a function { - item = dynamic_cast(lb_fktliste->currentItem()); + item = dynamic_cast(lb_fktliste->currentItem()); item->setText(0, function->fstr ); } item->setOn(function->f_mode); @@ -212,18 +212,18 @@ void FktDlg::slotEditParametric( int x_id, int y_id) if ( x_id==-1 && y_id==-1) editParametric->setCaption(i18n( "New Parametric Plot" )); editParametric->initDialog( x_id, y_id ); - if( editParametric->exec() == QDialog::Accepted ) + if( editParametric->exec() == TQDialog::Accepted ) { Ufkt *function_y = editParametric->functionItem(); Ufkt *function_x = &m_view->parser()->ufkt[m_view->parser()->ixValue(function_y->id - 1)]; //get the x-function - QCheckListItem *item; + TQCheckListItem *item; if( x_id == -1 ) //a new function { - item = new QCheckListItem(lb_fktliste, function_x->fstr+";"+function_y->fstr, QCheckListItem::CheckBox); + item = new TQCheckListItem(lb_fktliste, function_x->fstr+";"+function_y->fstr, TQCheckListItem::CheckBox); } else //change a function { - item = dynamic_cast(lb_fktliste->currentItem()); + item = dynamic_cast(lb_fktliste->currentItem()); item->setText(0, function_x->fstr+";"+function_y->fstr ); } item->setOn(function_y->f_mode); @@ -238,17 +238,17 @@ void FktDlg::slotEditPolar( int id ) KEditPolar* editPolar = new KEditPolar( m_view->parser(), this ); if ( id==-1) editPolar->setCaption(i18n( "New Polar Plot" )); editPolar->initDialog( id ); - if( editPolar->exec() == QDialog::Accepted ) + if( editPolar->exec() == TQDialog::Accepted ) { Ufkt *function = editPolar->functionItem(); - QCheckListItem *item; + TQCheckListItem *item; if( id == -1 ) // a new function { - item = new QCheckListItem(lb_fktliste, function->fstr, QCheckListItem::CheckBox); + item = new TQCheckListItem(lb_fktliste, function->fstr, TQCheckListItem::CheckBox); } else //change a function { - item = dynamic_cast(lb_fktliste->currentItem()); + item = dynamic_cast(lb_fktliste->currentItem()); item->setText(0, function->fstr ); } item->setOn(function->f_mode); @@ -278,18 +278,18 @@ void FktDlg::getPlots() lb_fktliste->clear(); // adding all yet added functions - for( QValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) { if( it->fname.isEmpty() || it->fstr[0] == 'y' ) continue; - QCheckListItem *item; + TQCheckListItem *item; if( it->fstr[0] == 'x' ) { - QString y = it->fstr; + TQString y = it->fstr; ++it; - item = new QCheckListItem( lb_fktliste, y + ";" + it->fstr, QCheckListItem::CheckBox ); + item = new TQCheckListItem( lb_fktliste, y + ";" + it->fstr, TQCheckListItem::CheckBox ); } else - item = new QCheckListItem(lb_fktliste, it->fstr, QCheckListItem::CheckBox); + item = new TQCheckListItem(lb_fktliste, it->fstr, TQCheckListItem::CheckBox); item->setOn(it->f_mode); } lb_fktliste->sort(); @@ -305,7 +305,7 @@ bool FktDlg::isChanged() return changed; } -void FktDlg::showEvent ( QShowEvent * ) +void FktDlg::showEvent ( TQShowEvent * ) { changed = false; } @@ -317,8 +317,8 @@ void FktDlg::slotCopyFunction() cmdCopyFunction->setEnabled(false); return; } - QCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); - QString const fstr = currentItem->text(); + TQCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); + TQString const fstr = currentItem->text(); m_view->parser()->sendFunction(getId(fstr)); } @@ -329,8 +329,8 @@ void FktDlg::slotMoveFunction() cmdCopyFunction->setEnabled(false); return; } - QCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); - QString const fstr = currentItem->text(); + TQCheckListItem *currentItem = dynamic_cast(lb_fktliste->currentItem()); + TQString const fstr = currentItem->text(); if ( !m_view->parser()->sendFunction(getId( currentItem->text()) ) ) return; slotDelete(); diff --git a/kmplot/kmplot/FktDlg.h b/kmplot/kmplot/FktDlg.h index 84908316..8275b03f 100644 --- a/kmplot/kmplot/FktDlg.h +++ b/kmplot/kmplot/FktDlg.h @@ -52,7 +52,7 @@ public: * @param parent Parent widget. * @param view points to the current view instance. */ - FktDlg( QWidget* parent, View* view ); + FktDlg( TQWidget* parent, View* view ); /// Empty destructor. virtual ~FktDlg(); /// Fill the widgets with plots contained in the parser instance. @@ -72,9 +72,9 @@ protected slots: void slotEdit(); /// Enables/disables actions if the list has a/no selection. void slotHasSelection(); - void lb_fktliste_doubleClicked(QListViewItem *, const QPoint &, int); - void lb_fktliste_clicked(QListViewItem * item); - void lb_fktliste_spacePressed(QListViewItem * item); + void lb_fktliste_doubleClicked(TQListViewItem *, const TQPoint &, int); + void lb_fktliste_clicked(TQListViewItem * item); + void lb_fktliste_spacePressed(TQListViewItem * item); /// Edit a function plot. /// @param id Id of the function plot to edit @@ -100,13 +100,13 @@ protected slots: private: /// Looks up the id of \a f_str in the parser instance. - int getId( const QString &f_str ); + int getId( const TQString &f_str ); /// Looks up the indices of the parametric pair of function. - int getParamId( const QString &f_str ); + int getParamId( const TQString &f_str ); /// Update the view of the main window. void updateView(); /// Called when the dialog is showed - void showEvent ( QShowEvent * ); + void showEvent ( TQShowEvent * ); // /// Send a function to an other instance of Kmplot. Returns true if it success, otherwise false // bool sendFunction(); diff --git a/kmplot/kmplot/MainDlg.cpp b/kmplot/kmplot/MainDlg.cpp index c148d3a2..e8916f93 100644 --- a/kmplot/kmplot/MainDlg.cpp +++ b/kmplot/kmplot/MainDlg.cpp @@ -24,8 +24,8 @@ */ // Qt includes -#include -#include +#include +#include // KDE includes #include @@ -63,13 +63,13 @@ class KmPlotIO; bool MainDlg::oldfileversion; -MainDlg::MainDlg(QWidget *parentWidget, const char *, QObject *parent, const char *name) : DCOPObject( "MainDlg" ), KParts::ReadOnlyPart( parent, name ), m_recentFiles( 0 ), m_modified(false), m_parent(parentWidget) +MainDlg::MainDlg(TQWidget *parentWidget, const char *, TQObject *parent, const char *name) : DCOPObject( "MainDlg" ), KParts::ReadOnlyPart( parent, name ), m_recentFiles( 0 ), m_modified(false), m_parent(parentWidget) { // we need an instance setInstance( KmPlotPartFactory::instance() ); kdDebug() << "parentWidget->name():" << parentWidget->name() << endl; - if ( QString(parentWidget->name()).startsWith("KmPlot") ) + if ( TQString(parentWidget->name()).startsWith("KmPlot") ) { setXMLFile("kmplot_part.rc"); m_readonly = false; @@ -84,14 +84,14 @@ MainDlg::MainDlg(QWidget *parentWidget, const char *, QObject *parent, const cha coordsDialog = 0; m_popupmenu = new KPopupMenu(parentWidget); view = new View( m_readonly, m_modified, m_popupmenu, parentWidget ); - connect( view, SIGNAL( setStatusBarText(const QString &)), this, SLOT( setReadOnlyStatusBarText(const QString &) ) ); + connect( view, TQT_SIGNAL( setStatusBarText(const TQString &)), this, TQT_SLOT( setReadOnlyStatusBarText(const TQString &) ) ); setWidget( view ); - view->setFocusPolicy(QWidget::ClickFocus); + view->setFocusPolicy(TQWidget::ClickFocus); minmaxdlg = new KMinMax(view, m_parent); view->setMinMaxDlg(minmaxdlg); m_quickEdit = new KLineEdit( parentWidget ); m_quickEdit->setFocus(); - QToolTip::add( m_quickEdit, i18n( "Enter a function equation, for example: f(x)=x^2" ) ); + TQToolTip::add( m_quickEdit, i18n( "Enter a function equation, for example: f(x)=x^2" ) ); setupActions(); loadConstants(); kmplotio = new KmPlotIO(view->parser()); @@ -109,8 +109,8 @@ MainDlg::MainDlg(QWidget *parentWidget, const char *, QObject *parent, const cha m_settingsDialog->addPage( m_constantsSettings, i18n("Constants"), "editconstants", i18n("Constants") ); // User edited the configuration - update your local copies of the // configuration data - connect( m_settingsDialog, SIGNAL( settingsChanged() ), this, SLOT(updateSettings() ) ); - connect( view, SIGNAL( resetZoom() ), this, SLOT(resetZoom() ) ); + connect( m_settingsDialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT(updateSettings() ) ); + connect( view, TQT_SIGNAL( resetZoom() ), this, TQT_SLOT(resetZoom() ) ); } MainDlg::~MainDlg() @@ -123,29 +123,29 @@ MainDlg::~MainDlg() void MainDlg::setupActions() { // standard actions - m_recentFiles = KStdAction::openRecent( this, SLOT( slotOpenRecent( const KURL& ) ), actionCollection(),"file_openrecent"); - KStdAction::print( this, SLOT( slotPrint() ), actionCollection(),"file_print" ); - KStdAction::save( this, SLOT( slotSave() ), actionCollection() ); - KStdAction::saveAs( this, SLOT( slotSaveas() ), actionCollection() ); - connect( kapp, SIGNAL( lastWindowClosed() ), kapp, SLOT( quit() ) ); + m_recentFiles = KStdAction::openRecent( this, TQT_SLOT( slotOpenRecent( const KURL& ) ), actionCollection(),"file_openrecent"); + KStdAction::print( this, TQT_SLOT( slotPrint() ), actionCollection(),"file_print" ); + KStdAction::save( this, TQT_SLOT( slotSave() ), actionCollection() ); + KStdAction::saveAs( this, TQT_SLOT( slotSaveas() ), actionCollection() ); + connect( kapp, TQT_SIGNAL( lastWindowClosed() ), kapp, TQT_SLOT( quit() ) ); - KAction *prefs = KStdAction::preferences( this, SLOT( slotSettings() ), actionCollection()); + KAction *prefs = KStdAction::preferences( this, TQT_SLOT( slotSettings() ), actionCollection()); prefs->setText( i18n( "Configure KmPlot..." ) ); - KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection()); // KmPlot specific actions // file menu - ( void ) new KAction( i18n( "E&xport..." ), 0, this, SLOT( slotExport() ), actionCollection(), "export"); + ( void ) new KAction( i18n( "E&xport..." ), 0, this, TQT_SLOT( slotExport() ), actionCollection(), "export"); //zoom menu - m_mnuNoZoom = new KRadioAction(i18n("&No Zoom") ,"CTRL+0",view, SLOT( mnuNoZoom_clicked() ),actionCollection(),"no_zoom" ); - KRadioAction * mnuRectangular = new KRadioAction(i18n("Zoom &Rectangular"), "viewmagfit", "CTRL+1",view, SLOT( mnuRectangular_clicked() ),actionCollection(),"zoom_rectangular" ); - KRadioAction * mnuZoomIn = new KRadioAction(i18n("Zoom &In"), "viewmag+", "CTRL+2",view, SLOT( mnuZoomIn_clicked() ),actionCollection(),"zoom_in" ); - KRadioAction * mnuZoomOut = new KRadioAction(i18n("Zoom &Out"), "viewmag-", "CTRL+3",view, SLOT( mnuZoomOut_clicked() ),actionCollection(),"zoom_out" ); - KRadioAction * mnuZoomCenter = new KRadioAction(i18n("&Center Point") ,"CTRL+4",view, SLOT( mnuCenter_clicked() ),actionCollection(),"zoom_center" ); - (void ) new KAction(i18n("&Fit Widget to Trigonometric Functions") ,0,view, SLOT( mnuTrig_clicked() ),actionCollection(),"zoom_trig" ); + m_mnuNoZoom = new KRadioAction(i18n("&No Zoom") ,"CTRL+0",view, TQT_SLOT( mnuNoZoom_clicked() ),actionCollection(),"no_zoom" ); + KRadioAction * mnuRectangular = new KRadioAction(i18n("Zoom &Rectangular"), "viewmagfit", "CTRL+1",view, TQT_SLOT( mnuRectangular_clicked() ),actionCollection(),"zoom_rectangular" ); + KRadioAction * mnuZoomIn = new KRadioAction(i18n("Zoom &In"), "viewmag+", "CTRL+2",view, TQT_SLOT( mnuZoomIn_clicked() ),actionCollection(),"zoom_in" ); + KRadioAction * mnuZoomOut = new KRadioAction(i18n("Zoom &Out"), "viewmag-", "CTRL+3",view, TQT_SLOT( mnuZoomOut_clicked() ),actionCollection(),"zoom_out" ); + KRadioAction * mnuZoomCenter = new KRadioAction(i18n("&Center Point") ,"CTRL+4",view, TQT_SLOT( mnuCenter_clicked() ),actionCollection(),"zoom_center" ); + (void ) new KAction(i18n("&Fit Widget to Trigonometric Functions") ,0,view, TQT_SLOT( mnuTrig_clicked() ),actionCollection(),"zoom_trig" ); m_mnuNoZoom->setExclusiveGroup("zoom_modes"); m_mnuNoZoom->setChecked(true); mnuRectangular->setExclusiveGroup("zoom_modes"); @@ -154,52 +154,52 @@ void MainDlg::setupActions() mnuZoomCenter->setExclusiveGroup("zoom_modes"); // help menu - ( void ) new KAction( i18n( "Predefined &Math Functions" ), "functionhelp", 0, this, SLOT( slotNames() ), actionCollection(), "names" ); + ( void ) new KAction( i18n( "Predefined &Math Functions" ), "functionhelp", 0, this, TQT_SLOT( slotNames() ), actionCollection(), "names" ); // edit menu - ( void ) new KAction( i18n( "&Colors..." ), "colorize.png", 0, this, SLOT( editColors() ), actionCollection(), "editcolors" ); - ( void ) new KAction( i18n( "&Coordinate System..." ), "coords.png", 0, this, SLOT( editAxes() ), actionCollection(), "editaxes" ); - // ( void ) new KAction( i18n( "&Grid..." ), "coords.png", 0, this, SLOT( editGrid() ), actionCollection(), "editgrid" ); - ( void ) new KAction( i18n( "&Scaling..." ), "scaling", 0, this, SLOT( editScaling() ), actionCollection(), "editscaling" ); - ( void ) new KAction( i18n( "&Fonts..." ), "fonts", 0, this, SLOT( editFonts() ), actionCollection(), "editfonts" ); + ( void ) new KAction( i18n( "&Colors..." ), "colorize.png", 0, this, TQT_SLOT( editColors() ), actionCollection(), "editcolors" ); + ( void ) new KAction( i18n( "&Coordinate System..." ), "coords.png", 0, this, TQT_SLOT( editAxes() ), actionCollection(), "editaxes" ); + // ( void ) new KAction( i18n( "&Grid..." ), "coords.png", 0, this, TQT_SLOT( editGrid() ), actionCollection(), "editgrid" ); + ( void ) new KAction( i18n( "&Scaling..." ), "scaling", 0, this, TQT_SLOT( editScaling() ), actionCollection(), "editscaling" ); + ( void ) new KAction( i18n( "&Fonts..." ), "fonts", 0, this, TQT_SLOT( editFonts() ), actionCollection(), "editfonts" ); - ( void ) new KAction( i18n( "Coordinate System I" ), "ksys1.png", 0, this, SLOT( slotCoord1() ), actionCollection(), "coord_i" ); - ( void ) new KAction( i18n( "Coordinate System II" ), "ksys2.png", 0, this, SLOT( slotCoord2() ), actionCollection(), "coord_ii" ); - ( void ) new KAction( i18n( "Coordinate System III" ), "ksys3.png", 0, this, SLOT( slotCoord3() ), actionCollection(), "coord_iii" ); + ( void ) new KAction( i18n( "Coordinate System I" ), "ksys1.png", 0, this, TQT_SLOT( slotCoord1() ), actionCollection(), "coord_i" ); + ( void ) new KAction( i18n( "Coordinate System II" ), "ksys2.png", 0, this, TQT_SLOT( slotCoord2() ), actionCollection(), "coord_ii" ); + ( void ) new KAction( i18n( "Coordinate System III" ), "ksys3.png", 0, this, TQT_SLOT( slotCoord3() ), actionCollection(), "coord_iii" ); // plot menu - ( void ) new KAction( i18n( "&New Function Plot..." ), "newfunction", 0, this, SLOT( newFunction() ), actionCollection(), "newfunction" ); - ( void ) new KAction( i18n( "New Parametric Plot..." ), "newparametric", 0, this, SLOT( newParametric() ), actionCollection(), "newparametric" ); - ( void ) new KAction( i18n( "New Polar Plot..." ), "newpolar", 0, this, SLOT( newPolar() ), actionCollection(), "newpolar" ); - ( void ) new KAction( i18n( "Edit Plots..." ), "editplots", 0, this, SLOT( slotEditPlots() ), actionCollection(), "editplots" ); + ( void ) new KAction( i18n( "&New Function Plot..." ), "newfunction", 0, this, TQT_SLOT( newFunction() ), actionCollection(), "newfunction" ); + ( void ) new KAction( i18n( "New Parametric Plot..." ), "newparametric", 0, this, TQT_SLOT( newParametric() ), actionCollection(), "newparametric" ); + ( void ) new KAction( i18n( "New Polar Plot..." ), "newpolar", 0, this, TQT_SLOT( newPolar() ), actionCollection(), "newpolar" ); + ( void ) new KAction( i18n( "Edit Plots..." ), "editplots", 0, this, TQT_SLOT( slotEditPlots() ), actionCollection(), "editplots" ); // tools menu - KAction *mnuYValue = new KAction( i18n( "&Get y-Value..." ), 0, this, SLOT( getYValue() ), actionCollection(), "yvalue" ); - KAction *mnuMinValue = new KAction( i18n( "&Search for Minimum Value..." ), "minimum", 0, this, SLOT( findMinimumValue() ), actionCollection(), "minimumvalue" ); - KAction *mnuMaxValue = new KAction( i18n( "&Search for Maximum Value..." ), "maximum", 0, this, SLOT( findMaximumValue() ), actionCollection(), "maximumvalue" ); - KAction *mnuArea = new KAction( i18n( "&Calculate Integral" ), 0, this, SLOT( graphArea() ), actionCollection(), "grapharea" ); + KAction *mnuYValue = new KAction( i18n( "&Get y-Value..." ), 0, this, TQT_SLOT( getYValue() ), actionCollection(), "yvalue" ); + KAction *mnuMinValue = new KAction( i18n( "&Search for Minimum Value..." ), "minimum", 0, this, TQT_SLOT( findMinimumValue() ), actionCollection(), "minimumvalue" ); + KAction *mnuMaxValue = new KAction( i18n( "&Search for Maximum Value..." ), "maximum", 0, this, TQT_SLOT( findMaximumValue() ), actionCollection(), "maximumvalue" ); + KAction *mnuArea = new KAction( i18n( "&Calculate Integral" ), 0, this, TQT_SLOT( graphArea() ), actionCollection(), "grapharea" ); - connect( m_quickEdit, SIGNAL( returnPressed( const QString& ) ), this, SLOT( slotQuickEdit( const QString& ) ) ); + connect( m_quickEdit, TQT_SIGNAL( returnPressed( const TQString& ) ), this, TQT_SLOT( slotQuickEdit( const TQString& ) ) ); KWidgetAction* quickEditAction = new KWidgetAction( m_quickEdit, i18n( "Quick Edit" ), 0, this, 0, actionCollection(), "quickedit" ); quickEditAction->setWhatsThis( i18n( "Enter a simple function equation here.\n" "For instance: f(x)=x^2\nFor more options use Functions->Edit Plots... menu." ) ); - view->mnuSliders[0] = new KToggleAction( i18n( "Show Slider 1" ), 0, this, SLOT( toggleShowSlider0() ), actionCollection(), QString( "options_configure_show_slider_0" ).latin1() ); - view->mnuSliders[1] = new KToggleAction( i18n( "Show Slider 2" ), 0, this, SLOT( toggleShowSlider1() ), actionCollection(), QString( "options_configure_show_slider_1" ).latin1() ); - view->mnuSliders[2] = new KToggleAction( i18n( "Show Slider 3" ), 0, this, SLOT( toggleShowSlider2() ), actionCollection(), QString( "options_configure_show_slider_2" ).latin1() ); - view->mnuSliders[3] = new KToggleAction( i18n( "Show Slider 4" ), 0, this, SLOT( toggleShowSlider3() ), actionCollection(), QString( "options_configure_show_slider_3" ).latin1() ); + view->mnuSliders[0] = new KToggleAction( i18n( "Show Slider 1" ), 0, this, TQT_SLOT( toggleShowSlider0() ), actionCollection(), TQString( "options_configure_show_slider_0" ).latin1() ); + view->mnuSliders[1] = new KToggleAction( i18n( "Show Slider 2" ), 0, this, TQT_SLOT( toggleShowSlider1() ), actionCollection(), TQString( "options_configure_show_slider_1" ).latin1() ); + view->mnuSliders[2] = new KToggleAction( i18n( "Show Slider 3" ), 0, this, TQT_SLOT( toggleShowSlider2() ), actionCollection(), TQString( "options_configure_show_slider_2" ).latin1() ); + view->mnuSliders[3] = new KToggleAction( i18n( "Show Slider 4" ), 0, this, TQT_SLOT( toggleShowSlider3() ), actionCollection(), TQString( "options_configure_show_slider_3" ).latin1() ); // Popup menu - KAction *mnuHide = new KAction(i18n("&Hide") ,0,view, SLOT( mnuHide_clicked() ),actionCollection(),"mnuhide" ); + KAction *mnuHide = new KAction(i18n("&Hide") ,0,view, TQT_SLOT( mnuHide_clicked() ),actionCollection(),"mnuhide" ); mnuHide->plug(m_popupmenu); - KAction *mnuRemove = new KAction(i18n("&Remove"),"editdelete", 0,view, SLOT( mnuRemove_clicked() ),actionCollection(),"mnuremove" ); + KAction *mnuRemove = new KAction(i18n("&Remove"),"editdelete", 0,view, TQT_SLOT( mnuRemove_clicked() ),actionCollection(),"mnuremove" ); mnuRemove->plug(m_popupmenu); - KAction *mnuEdit = new KAction(i18n("&Edit"),"editplots", 0,view, SLOT( mnuEdit_clicked() ),actionCollection(),"mnuedit" ); + KAction *mnuEdit = new KAction(i18n("&Edit"),"editplots", 0,view, TQT_SLOT( mnuEdit_clicked() ),actionCollection(),"mnuedit" ); mnuEdit->plug(m_popupmenu); m_popupmenu->insertSeparator(); - KAction *mnuCopy = new KAction(i18n("&Copy"), 0,view, SLOT( mnuCopy_clicked() ),actionCollection(),"mnucopy" ); + KAction *mnuCopy = new KAction(i18n("&Copy"), 0,view, TQT_SLOT( mnuCopy_clicked() ),actionCollection(),"mnucopy" ); mnuCopy->plug(m_popupmenu); - KAction *mnuMove = new KAction(i18n("&Move"), 0,view, SLOT( mnuMove_clicked() ),actionCollection(),"mnumove" ); + KAction *mnuMove = new KAction(i18n("&Move"), 0,view, TQT_SLOT( mnuMove_clicked() ),actionCollection(),"mnumove" ); mnuMove->plug(m_popupmenu); m_popupmenu->insertSeparator(); mnuYValue->plug(m_popupmenu); @@ -212,7 +212,7 @@ bool MainDlg::checkModified() if( m_modified ) { int saveit = KMessageBox::warningYesNoCancel( m_parent, i18n( "The plot has been modified.\n" - "Do you want to save it?" ), QString::null, KStdGuiItem::save(), KStdGuiItem::discard() ); + "Do you want to save it?" ), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard() ); switch( saveit ) { case KMessageBox::Yes: @@ -249,7 +249,7 @@ void MainDlg::slotSave() if ( oldfileversion) { - if ( KMessageBox::warningContinueCancel( m_parent, i18n( "This file is saved with an old file format; if you save it, you cannot open the file with older versions of Kmplot. Are you sure you want to continue?" ), QString::null, i18n("Save New Format") ) == KMessageBox::Cancel) + if ( KMessageBox::warningContinueCancel( m_parent, i18n( "This file is saved with an old file format; if you save it, you cannot open the file with older versions of Kmplot. Are you sure you want to continue?" ), TQString::null, i18n("Save New Format") ) == KMessageBox::Cancel) return; } kmplotio->save( m_url.url() ); @@ -263,7 +263,7 @@ void MainDlg::slotSaveas() { if (m_readonly) return; - const KURL url = KFileDialog::getSaveURL( QDir::currentDirPath(), i18n( "*.fkt|KmPlot Files (*.fkt)\n*|All Files" ), m_parent, i18n( "Save As" ) ); + const KURL url = KFileDialog::getSaveURL( TQDir::currentDirPath(), i18n( "*.fkt|KmPlot Files (*.fkt)\n*|All Files" ), m_parent, i18n( "Save As" ) ); if ( !url.isEmpty() ) { @@ -286,7 +286,7 @@ void MainDlg::slotSaveas() void MainDlg::slotExport() { - KURL const url = KFileDialog::getSaveURL(QDir::currentDirPath(), + KURL const url = KFileDialog::getSaveURL(TQDir::currentDirPath(), i18n("*.svg|Scalable Vector Graphics (*.svg)\n" "*.bmp|Bitmap 180dpi (*.bmp)\n" "*.png|Bitmap 180dpi (*.png)"), m_parent, i18n("Export") ); @@ -297,7 +297,7 @@ void MainDlg::slotExport() if( url.fileName().right(4).lower()==".svg") { - QPicture pic; + TQPicture pic; view->draw(&pic, 2); if (url.isLocalFile() ) pic.save( url.prettyURL(0,KURL::StripFileProtocol), "SVG"); @@ -313,7 +313,7 @@ void MainDlg::slotExport() else if( url.fileName().right(4).lower()==".bmp") { - QPixmap pic(100, 100); + TQPixmap pic(100, 100); view->draw(&pic, 3); if (url.isLocalFile() ) pic.save( url.prettyURL(0,KURL::StripFileProtocol), "BMP"); @@ -329,7 +329,7 @@ void MainDlg::slotExport() else if( url.fileName().right(4).lower()==".png") { - QPixmap pic(100, 100); + TQPixmap pic(100, 100); view->draw(&pic, 3); if (url.isLocalFile() ) pic.save( url.prettyURL(0,KURL::StripFileProtocol), "PNG"); @@ -366,8 +366,8 @@ void MainDlg::slotOpenRecent( const KURL &url ) { if( isModified() || !m_url.isEmpty() ) // open the file in a new window { - QByteArray data; - QDataStream stream(data, IO_WriteOnly); + TQByteArray data; + TQDataStream stream(data, IO_WriteOnly); stream << url; KApplication::kApplication()->dcopClient()->send(KApplication::kApplication()->dcopClient()->appId(), "KmPlotShell","openFileInNewWindow(KURL)", data); return; @@ -389,7 +389,7 @@ void MainDlg::slotOpenRecent( const KURL &url ) void MainDlg::slotPrint() { - KPrinter prt( QPrinter::PrinterResolution ); + KPrinter prt( TQPrinter::PrinterResolution ); prt.setResolution( 72 ); prt.addDialogPage( new KPrinterDlg( m_parent, "KmPlot page" ) ); if ( prt.setup( m_parent, i18n( "Print Plot" ) ) ) @@ -408,7 +408,7 @@ void MainDlg::editColors() // User edited the configuration - update your local copies of the // configuration data - connect( colorsDialog, SIGNAL( settingsChanged() ), this, SLOT(updateSettings() ) ); + connect( colorsDialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT(updateSettings() ) ); colorsDialog->show(); } @@ -420,7 +420,7 @@ void MainDlg::editAxes() coordsDialog = new CoordsConfigDialog( view->parser(), m_parent); // User edited the configuration - update your local copies of the // configuration data - connect( coordsDialog, SIGNAL( settingsChanged() ), this, SLOT(updateSettings() ) ); + connect( coordsDialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT(updateSettings() ) ); } coordsDialog->show(); } @@ -433,7 +433,7 @@ void MainDlg::editScaling() scalingDialog->addPage( new SettingsPageScaling( 0, "scalingSettings" ), i18n( "Scale" ), "scaling", i18n( "Edit Scaling" ) ); // User edited the configuration - update your local copies of the // configuration data - connect( scalingDialog, SIGNAL( settingsChanged() ), this, SLOT(updateSettings() ) ); + connect( scalingDialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT(updateSettings() ) ); scalingDialog->show(); } @@ -445,7 +445,7 @@ void MainDlg::editFonts() fontsDialog->addPage( new SettingsPageFonts( 0, "fontsSettings" ), i18n( "Fonts" ), "fonts", i18n( "Edit Fonts" ) ); // User edited the configuration - update your local copies of the // configuration data - connect( fontsDialog, SIGNAL( settingsChanged() ), this, SLOT(updateSettings() ) ); + connect( fontsDialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT(updateSettings() ) ); fontsDialog->show(); } @@ -465,7 +465,7 @@ void MainDlg::newFunction() EditFunction* editFunction = new EditFunction( view->parser(), m_parent ); editFunction->setCaption(i18n( "New Function Plot" ) ); editFunction->initDialog(); - if ( editFunction->exec() == QDialog::Accepted ) + if ( editFunction->exec() == TQDialog::Accepted ) { m_modified = true; view->updateSliders(); @@ -478,7 +478,7 @@ void MainDlg::newParametric() KEditParametric* editParametric = new KEditParametric( view->parser(), m_parent ); editParametric->setCaption(i18n( "New Parametric Plot")); editParametric->initDialog(); - if ( editParametric->exec() == QDialog::Accepted ) + if ( editParametric->exec() == TQDialog::Accepted ) { m_modified = true; view->drawPlot(); @@ -491,7 +491,7 @@ void MainDlg::newPolar() KEditPolar* editPolar = new KEditPolar( view->parser(), m_parent ); editPolar->setCaption(i18n( "New Polar Plot")); editPolar->initDialog(); - if ( editPolar->exec() == QDialog::Accepted ) + if ( editPolar->exec() == TQDialog::Accepted ) { m_modified = true; view->drawPlot(); @@ -505,7 +505,7 @@ void MainDlg::slotEditPlots() fdlg->getPlots(); KTempFile tmpfile; kmplotio->save( tmpfile.name() ); - if( fdlg->exec() == QDialog::Rejected ) + if( fdlg->exec() == TQDialog::Rejected ) { if ( fdlg->isChanged() ) { @@ -522,10 +522,10 @@ void MainDlg::slotEditPlots() tmpfile.unlink(); } -void MainDlg::slotQuickEdit(const QString& f_str_const ) +void MainDlg::slotQuickEdit(const TQString& f_str_const ) { //creates a valid name for the function if the user has forgotten that - QString f_str( f_str_const ); + TQString f_str( f_str_const ); int const pos = f_str_const.find(';'); if (pos!=-1) f_str = f_str.left(pos); @@ -557,7 +557,7 @@ void MainDlg::slotQuickEdit(const QString& f_str_const ) Ufkt *ufkt = &view->parser()->ufkt.last(); view->parser()->prepareAddingFunction(ufkt); - if ( pos!=-1 && !view->parser()->getext(ufkt, QString(f_str_const))) + if ( pos!=-1 && !view->parser()->getext(ufkt, TQString(f_str_const))) { m_quickEdit->setFocus(); m_quickEdit->selectAll(); @@ -613,9 +613,9 @@ void MainDlg::loadConstants() { KSimpleConfig conf ("kcalcrc"); conf.setGroup("UserConstants"); - QString tmp; - QString tmp_constant; - QString tmp_value; + TQString tmp; + TQString tmp_constant; + TQString tmp_value; char constant; double value; for( int i=0; ;i++) @@ -644,7 +644,7 @@ void MainDlg::loadConstants() while (!copy_found) { // go through the constant list - QValueVector::iterator it = view->parser()->constant.begin(); + TQValueVector::iterator it = view->parser()->constant.begin(); while (it!= view->parser()->constant.end() && !copy_found) { if (constant == it->constant ) @@ -677,11 +677,11 @@ void MainDlg::saveConstants() KSimpleConfig conf ("kcalcrc"); conf.deleteGroup("Constants"); conf.setGroup("UserConstants"); - QString tmp; + TQString tmp; for( int i = 0; i< (int)view->parser()->constant.size();i++) { tmp.setNum(i); - conf.writeEntry("nameConstant"+tmp, QString( QChar(view->parser()->constant[i].constant) ) ) ; + conf.writeEntry("nameConstant"+tmp, TQString( TQChar(view->parser()->constant[i].constant) ) ) ; conf.writeEntry("valueConstant"+tmp, view->parser()->constant[i].value); } } @@ -736,8 +736,8 @@ void MainDlg::toggleShowSlider(int const num) if ( view->sliders[ num ] == 0 ) { view->sliders[ num ] = new KSliderWindow( view, num); - connect( view->sliders[num]->slider, SIGNAL( valueChanged( int ) ), view, SLOT( drawPlot() ) ); - connect( view->sliders[num], SIGNAL( windowClosed( int ) ), view, SLOT( sliderWindowClosed(int) ) ); + connect( view->sliders[num]->slider, TQT_SIGNAL( valueChanged( int ) ), view, TQT_SLOT( drawPlot() ) ); + connect( view->sliders[num], TQT_SIGNAL( windowClosed( int ) ), view, TQT_SLOT( sliderWindowClosed(int) ) ); } if ( !view->sliders[ num ]->isShown() ) view->sliders[ num ]->show(); @@ -745,19 +745,19 @@ void MainDlg::toggleShowSlider(int const num) view->sliders[ num ]->hide(); } -void MainDlg::setReadOnlyStatusBarText(const QString &text) +void MainDlg::setReadOnlyStatusBarText(const TQString &text) { setStatusBarText(text); } void MainDlg::optionsConfigureKeys() { - KApplication::kApplication()->dcopClient()->send(KApplication::kApplication()->dcopClient()->appId(), "KmPlotShell","optionsConfigureKeys()", QByteArray()); + KApplication::kApplication()->dcopClient()->send(KApplication::kApplication()->dcopClient()->appId(), "KmPlotShell","optionsConfigureKeys()", TQByteArray()); } void MainDlg::optionsConfigureToolbars() { - KApplication::kApplication()->dcopClient()->send(KApplication::kApplication()->dcopClient()->appId(), "KmPlotShell","optionsConfigureToolbars()", QByteArray()); + KApplication::kApplication()->dcopClient()->send(KApplication::kApplication()->dcopClient()->appId(), "KmPlotShell","optionsConfigureToolbars()", TQByteArray()); } void MainDlg::resetZoom() @@ -785,9 +785,9 @@ KmPlotPartFactory::~KmPlotPartFactory() s_instance = 0L; } -KParts::Part* KmPlotPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *, const QStringList & ) +KParts::Part* KmPlotPartFactory::createPartObject( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *, const TQStringList & ) { // Create an instance of our Part MainDlg* obj = new MainDlg( parentWidget, widgetName, parent, name ); diff --git a/kmplot/kmplot/MainDlg.h b/kmplot/kmplot/MainDlg.h index dd3a9916..7b4d83bf 100644 --- a/kmplot/kmplot/MainDlg.h +++ b/kmplot/kmplot/MainDlg.h @@ -29,7 +29,7 @@ #define MainDlg_included // Qt includes -#include +#include // KDE includes #include @@ -77,7 +77,7 @@ public: * @param parent parent object * @param name name of this dialog */ - MainDlg(QWidget *parentWidget, const char *, QObject *parent, const char *name); + MainDlg(TQWidget *parentWidget, const char *, TQObject *parent, const char *name); /// Cleaning up a bit. virtual ~MainDlg(); /// This class needs access to private members, too. @@ -185,7 +185,7 @@ private: /// Set to true if the application is readonly bool m_readonly; /// MainDlg's parent widget - QWidget *m_parent; + TQWidget *m_parent; /// Current file KURL m_currentfile; /// The axes config dialogs @@ -204,9 +204,9 @@ protected slots: * Manages the LineEdit content after returnPressed() is emitted. * @param f_str_const the content of the KLineEdit */ - void slotQuickEdit( const QString& f_str_const ); + void slotQuickEdit( const TQString& f_str_const ); - void setReadOnlyStatusBarText(const QString &); + void setReadOnlyStatusBarText(const TQString &); /// slots for the settings-menu void optionsConfigureKeys(); @@ -219,9 +219,9 @@ class KmPlotPartFactory : public KParts::Factory public: KmPlotPartFactory(); virtual ~KmPlotPartFactory(); - virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args ); + virtual KParts::Part* createPartObject( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *classname, const TQStringList &args ); static KInstance* instance(); private: diff --git a/kmplot/kmplot/View.cpp b/kmplot/kmplot/View.cpp index 2df9647d..0d45fd2c 100644 --- a/kmplot/kmplot/View.cpp +++ b/kmplot/kmplot/View.cpp @@ -24,13 +24,13 @@ */ // Qt includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // KDE includes #include @@ -56,7 +56,7 @@ double View::xmin = 0; double View::xmax = 0; -View::View(bool const r, bool &mo, KPopupMenu *p, QWidget* parent, const char* name ) : DCOPObject("View"), QWidget( parent, name , WStaticContents ), buffer( width(), height() ), m_popupmenu(p), m_modified(mo), m_readonly(r), m_dcop_client(KApplication::kApplication()->dcopClient()) +View::View(bool const r, bool &mo, KPopupMenu *p, TQWidget* parent, const char* name ) : DCOPObject("View"), TQWidget( parent, name , WStaticContents ), buffer( width(), height() ), m_popupmenu(p), m_modified(mo), m_readonly(r), m_dcop_client(KApplication::kApplication()->dcopClient()) { csmode = csparam = -1; cstype = 0; @@ -115,12 +115,12 @@ XParser* View::parser() return m_parser; } -void View::draw(QPaintDevice *dev, int form) +void View::draw(TQPaintDevice *dev, int form) { int lx, ly; float sf; - QRect rc; - QPainter DC; // our painter + TQRect rc; + TQPainter DC; // our painter DC.begin(dev); // start painting widget rc=DC.viewport(); w=rc.width(); @@ -131,23 +131,23 @@ void View::draw(QPaintDevice *dev, int form) if(form==0) // screen { - ref=QPoint(120, 100); + ref=TQPoint(120, 100); lx=(int)((xmax-xmin)*100.*drskalx/tlgx); ly=(int)((ymax-ymin)*100.*drskaly/tlgy); DC.scale((float)h/(float)(ly+2*ref.y()), (float)h/(float)(ly+2*ref.y())); - if(DC.xForm(QPoint(lx+2*ref.x(), ly)).x() > DC.viewport().right()) + if(DC.xForm(TQPoint(lx+2*ref.x(), ly)).x() > DC.viewport().right()) { DC.resetXForm(); DC.scale((float)w/(float)(lx+2*ref.x()), (float)w/(float)(lx+2*ref.x())); } wm=DC.worldMatrix(); - s=DC.xForm(QPoint(1000, 0)).x()/1000.; + s=DC.xForm(TQPoint(1000, 0)).x()/1000.; dgr.Create( ref, lx, ly, xmin, xmax, ymin, ymax ); } else if(form==1) // printer { sf=72./254.; // 72dpi - ref=QPoint(100, 100); + ref=TQPoint(100, 100); lx=(int)((xmax-xmin)*100.*drskalx/tlgx); ly=(int)((ymax-ymin)*100.*drskaly/tlgy); DC.scale(sf, sf); @@ -158,12 +158,12 @@ void View::draw(QPaintDevice *dev, int form) if ( ( (KPrinter* )dev )->option( "app-kmplot-printbackground" ) == "-1" ) DC.fillRect( dgr.GetFrame(), backgroundcolor); //draw a colored background //DC.end(); - //((QPixmap *)dev)->fill(QColor("#FF00FF")); + //((TQPixmap *)dev)->fill(TQColor("#FF00FF")); //DC.begin(dev); } else if(form==2) // svg { - ref=QPoint(0, 0); + ref=TQPoint(0, 0); lx=(int)((xmax-xmin)*100.*drskalx/tlgx); ly=(int)((ymax-ymin)*100.*drskaly/tlgy); dgr.Create( ref, lx, ly, xmin, xmax, ymin, ymax ); @@ -173,13 +173,13 @@ void View::draw(QPaintDevice *dev, int form) else if(form==3) // bmp, png { sf=180./254.; // 180dpi - ref=QPoint(0, 0); + ref=TQPoint(0, 0); lx=(int)((xmax-xmin)*100.*drskalx/tlgx); ly=(int)((ymax-ymin)*100.*drskaly/tlgy); dgr.Create( ref, lx, ly, xmin, xmax, ymin, ymax ); DC.end(); - ((QPixmap *)dev)->resize((int)(dgr.GetFrame().width()*sf), (int)(dgr.GetFrame().height()*sf)); - ((QPixmap *)dev)->fill(backgroundcolor); + ((TQPixmap *)dev)->resize((int)(dgr.GetFrame().width()*sf), (int)(dgr.GetFrame().height()*sf)); + ((TQPixmap *)dev)->fill(backgroundcolor); DC.begin(dev); DC.translate(-dgr.GetFrame().left()*sf, -dgr.GetFrame().top()*sf); DC.scale(sf, sf); @@ -213,7 +213,7 @@ void View::draw(QPaintDevice *dev, int form) isDrawing=true; setCursor(Qt::WaitCursor ); stop_calculating = false; - for(QValueVector::iterator ufkt=m_parser->ufkt.begin(); ufkt!=m_parser->ufkt.end() && !stop_calculating; ++ufkt) + for(TQValueVector::iterator ufkt=m_parser->ufkt.begin(); ufkt!=m_parser->ufkt.end() && !stop_calculating; ++ufkt) if ( !ufkt->fname.isEmpty() ) plotfkt(ufkt, &DC); @@ -224,13 +224,13 @@ void View::draw(QPaintDevice *dev, int form) } -void View::plotfkt(Ufkt *ufkt, QPainter *pDC) +void View::plotfkt(Ufkt *ufkt, TQPainter *pDC) { char p_mode; int iy, k, ke, mflg; double x, y, dmin, dmax; - QPoint p1, p2; - QPen pen; + TQPoint p1, p2; + TQPen pen; pen.setCapStyle(Qt::RoundCap); iy=0; y=0.0; @@ -440,18 +440,18 @@ void View::plotfkt(Ufkt *ufkt, QPainter *pDC) KMessageBox::error(this,i18n("The drawing was cancelled by the user.")); } -void View::drawHeaderTable(QPainter *pDC) +void View::drawHeaderTable(TQPainter *pDC) { - QString alx, aly, atx, aty, dfx, dfy; + TQString alx, aly, atx, aty, dfx, dfy; if( m_printHeaderTable ) { pDC->translate(250., 150.); - pDC->setPen(QPen(black, (int)(5.*s))); - pDC->setFont(QFont( Settings::headerTableFont(), 30) ); + pDC->setPen(TQPen(black, (int)(5.*s))); + pDC->setFont(TQFont( Settings::headerTableFont(), 30) ); puts( Settings::headerTableFont().latin1() ); - QString minStr = Settings::xMin(); - QString maxStr = Settings::xMax(); + TQString minStr = Settings::xMin(); + TQString maxStr = Settings::xMax(); getMinMax( Settings::xRange(), minStr, maxStr); alx="[ "+minStr+" | "+maxStr+" ]"; minStr = Settings::yMin(); @@ -492,7 +492,7 @@ void View::drawHeaderTable(QPainter *pDC) pDC->Lineh(0, 320, 700); int ypos = 380; //for(uint ix=0; ixcountFunctions() && !stop_calculating; ++ix) - for(QValueVector::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end() && !stop_calculating; ++it) + for(TQValueVector::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end() && !stop_calculating; ++it) { pDC->drawText(100, ypos, it->fstr); ypos+=60; @@ -503,7 +503,7 @@ void View::drawHeaderTable(QPainter *pDC) } -void View::getMinMax( int koord, QString &mini, QString &maxi ) +void View::getMinMax( int koord, TQString &mini, TQString &maxi ) { switch(koord) { @@ -526,10 +526,10 @@ void View::getMinMax( int koord, QString &mini, QString &maxi ) } -void View::setpi(QString *s) +void View::setpi(TQString *s) { int i; - QChar c(960); + TQChar c(960); while((i=s->find('p')) != -1) s->replace(i, 2, &c, 1); } @@ -570,15 +570,15 @@ bool View::root(double *x0, Ufkt *it) } } -void View::paintEvent(QPaintEvent *) +void View::paintEvent(TQPaintEvent *) { - QPainter p; + TQPainter p; p.begin(this); bitBlt( this, 0, 0, &buffer, 0, 0, width(), height() ); p.end(); } -void View::resizeEvent(QResizeEvent *) +void View::resizeEvent(TQResizeEvent *) { if (isDrawing) //stop drawing integrals { @@ -595,28 +595,28 @@ void View::drawPlot() m_minmax->updateFunctions(); buffer.fill(backgroundcolor); draw(&buffer, 0); - QPainter p; + TQPainter p; p.begin(this); bitBlt( this, 0, 0, &buffer, 0, 0, width(), height() ); p.end(); } -void View::mouseMoveEvent(QMouseEvent *e) +void View::mouseMoveEvent(TQMouseEvent *e) { if ( isDrawing) return; if (zoom_mode==4 && e->stateAfter() != Qt::NoButton) { - QPainter p; + TQPainter p; p.begin(this); bitBlt( this, 0, 0, &buffer, 0, 0, width(), height() ); p.end(); - QPainter painter(this); - QPen pen(Qt::white, 1, Qt::DotLine); + TQPainter painter(this); + TQPen pen(Qt::white, 1, Qt::DotLine); painter.setRasterOp (Qt::XorROP); painter.setPen(pen); - painter.setBackgroundMode (QPainter::OpaqueMode); + painter.setBackgroundMode (TQPainter::OpaqueMode); painter.setBackgroundColor (Qt::blue); painter.drawRect(rectangle_point.x(), rectangle_point.y(), e->pos().x()-rectangle_point.x(), e->pos().y()-rectangle_point.y()); @@ -641,8 +641,8 @@ void View::mouseMoveEvent(QMouseEvent *e) if(area.contains(e->pos()) || (e->button()==Qt::LeftButton && e->state()==Qt::LeftButton && csxpos>xmin && csxpos0) return; @@ -785,7 +785,7 @@ void View::mousePressEvent(QMouseEvent *e) } else if ( zoom_mode==Z_ZoomIn ) //zoom in { - QPainter DC; + TQPainter DC; DC.begin(this); DC.setWindow(0, 0, w, h); DC.setWorldMatrix(wm); @@ -812,7 +812,7 @@ void View::mousePressEvent(QMouseEvent *e) } else if ( zoom_mode==3 ) //zoom out { - QPainter DC; + TQPainter DC; DC.begin(this); DC.setWindow(0, 0, w, h); DC.setWorldMatrix(wm); @@ -839,7 +839,7 @@ void View::mousePressEvent(QMouseEvent *e) } else if ( zoom_mode==5 ) //center { - QPainter DC; + TQPainter DC; DC.begin(this); DC.setWindow(0, 0, w, h); DC.setWorldMatrix(wm); @@ -865,7 +865,7 @@ void View::mousePressEvent(QMouseEvent *e) if( !m_readonly && e->button()==RightButton) //clicking with the right mouse button { char function_type; - for( QValueVector::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it) { function_type = it->fstr[0].latin1(); if ( function_type=='y' || function_type=='r' || it->fname.isEmpty()) continue; @@ -889,7 +889,7 @@ void View::mousePressEvent(QMouseEvent *e) if ( function_type=='x' && fabs(csxpos-m_parser->fkt(it, csxpos))< g && it->fstr.contains('t')==1) //parametric plot { - QValueVector::iterator ufkt_y = it+1; + TQValueVector::iterator ufkt_y = it+1; if ( fabs(csypos-m_parser->fkt(ufkt_y, csxpos)fstr.contains('t')==1) { if ( csmode == -1) @@ -901,13 +901,13 @@ void View::mousePressEvent(QMouseEvent *e) } else m_popupmenushown = 2; - QString y_name( ufkt_y->fstr ); + TQString y_name( ufkt_y->fstr ); m_popupmenu->setItemEnabled(m_popupmenu->idAt(m_popupmenu->count()-1),false); m_popupmenu->setItemEnabled(m_popupmenu->idAt(m_popupmenu->count()-2),false); m_popupmenu->setItemEnabled(m_popupmenu->idAt(m_popupmenu->count()-3),false); m_popupmenu->setItemEnabled(m_popupmenu->idAt(m_popupmenu->count()-4),false); m_popupmenu->changeTitle(10,ufkt_y->fstr+";"+y_name); - m_popupmenu->exec(QCursor::pos()); + m_popupmenu->exec(TQCursor::pos()); m_popupmenu->setItemEnabled(m_popupmenu->idAt(m_popupmenu->count()-1),true); m_popupmenu->setItemEnabled(m_popupmenu->idAt(m_popupmenu->count()-2),true); m_popupmenu->setItemEnabled(m_popupmenu->idAt(m_popupmenu->count()-3),true); @@ -927,7 +927,7 @@ void View::mousePressEvent(QMouseEvent *e) else m_popupmenushown = 2; m_popupmenu->changeTitle(10, it->fstr); - m_popupmenu->exec(QCursor::pos()); + m_popupmenu->exec(TQCursor::pos()); return; } else if(fabs(csypos-m_parser->a1fkt( it, csxpos))< g && it->f1_mode) @@ -941,10 +941,10 @@ void View::mousePressEvent(QMouseEvent *e) } else m_popupmenushown = 2; - QString function = it->fstr; + TQString function = it->fstr; function = function.left(function.find('(')) + '\''; m_popupmenu->changeTitle(10, function); - m_popupmenu->exec(QCursor::pos()); + m_popupmenu->exec(TQCursor::pos()); return; } else if(fabs(csypos-m_parser->a2fkt(it, csxpos))< g && it->f2_mode) @@ -958,10 +958,10 @@ void View::mousePressEvent(QMouseEvent *e) } else m_popupmenushown = 2; - QString function = it->fstr; + TQString function = it->fstr; function = function.left(function.find('(')) + "\'\'"; m_popupmenu->changeTitle(10, function); - m_popupmenu->exec(QCursor::pos()); + m_popupmenu->exec(TQCursor::pos()); return; } } @@ -978,7 +978,7 @@ void View::mousePressEvent(QMouseEvent *e) mouseMoveEvent(e); return ; } - for( QValueVector::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it) { if (it->fname.isEmpty() ) continue; @@ -1018,7 +1018,7 @@ void View::mousePressEvent(QMouseEvent *e) cstype=1; csparam = k; m_minmax->selectItem(); - QString function = it->fstr; + TQString function = it->fstr; function = function.left(function.find('(')) + '\''; setStatusBar(function,4); mouseMoveEvent(e); @@ -1030,7 +1030,7 @@ void View::mousePressEvent(QMouseEvent *e) cstype=2; csparam = k; m_minmax->selectItem(); - QString function = it->fstr; + TQString function = it->fstr; function = function.left(function.find('(')) + "\'\'"; setStatusBar(function,4); mouseMoveEvent(e); @@ -1044,7 +1044,7 @@ void View::mousePressEvent(QMouseEvent *e) } -void View::mouseReleaseEvent ( QMouseEvent * e ) +void View::mouseReleaseEvent ( TQMouseEvent * e ) { if ( zoom_mode == Z_Center ) { @@ -1055,13 +1055,13 @@ void View::mouseReleaseEvent ( QMouseEvent * e ) update(); return; } - QPainter DC; + TQPainter DC; DC.begin(this); bitBlt( this, 0, 0, &buffer, 0, 0, width(), height() ); DC.setWindow(0, 0, w, h); DC.setWorldMatrix(wm); - QPoint p=DC.xFormDev(e->pos()); + TQPoint p=DC.xFormDev(e->pos()); double real1x = dgr.Transx(p.x() ) ; double real1y = dgr.Transy(p.y() ) ; p=DC.xFormDev(rectangle_point); @@ -1109,7 +1109,7 @@ void View::mouseReleaseEvent ( QMouseEvent * e ) } } -void View::coordToMinMax( const int koord, const QString &minStr, const QString &maxStr, +void View::coordToMinMax( const int koord, const TQString &minStr, const TQString &maxStr, double &min, double &max ) { switch ( koord ) @@ -1144,7 +1144,7 @@ void View::setPlotRange() void View::setScaling() { - QString units[ 9 ] = { "10", "5", "2", "1", "0.5", "pi/2", "pi/3", "pi/4",i18n("automatic") }; + TQString units[ 9 ] = { "10", "5", "2", "1", "0.5", "pi/2", "pi/3", "pi/4",i18n("automatic") }; if( Settings::xScaling() == 8) //automatic x-scaling { @@ -1187,7 +1187,7 @@ void View::getSettings() void View::init() { getSettings(); - QValueVector::iterator it = m_parser->ufkt.begin(); + TQValueVector::iterator it = m_parser->ufkt.begin(); it->fname=""; while ( m_parser->ufkt.count() > 1) m_parser->Parser::delfkt( &m_parser->ufkt.last() ); @@ -1200,7 +1200,7 @@ void View::stopDrawing() stop_calculating = true; } -void View::findMinMaxValue(Ufkt *ufkt, char p_mode, bool minimum, double &dmin, double &dmax, const QString &str_parameter) +void View::findMinMaxValue(Ufkt *ufkt, char p_mode, bool minimum, double &dmin, double &dmax, const TQString &str_parameter) { double x, y = 0; double result_x = 0; @@ -1210,7 +1210,7 @@ void View::findMinMaxValue(Ufkt *ufkt, char p_mode, bool minimum, double &dmin, // TODO: parameter sliders if ( !ufkt->parameters.isEmpty() ) { - for ( QValueList::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it ) + for ( TQValueList::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it ) { if ( (*it).expression == str_parameter) { @@ -1354,12 +1354,12 @@ void View::findMinMaxValue(Ufkt *ufkt, char p_mode, bool minimum, double &dmin, } } -void View::getYValue(Ufkt *ufkt, char p_mode, double x, double &y, const QString &str_parameter) +void View::getYValue(Ufkt *ufkt, char p_mode, double x, double &y, const TQString &str_parameter) { // TODO: parameter sliders if ( !ufkt->parameters.isEmpty() ) { - for ( QValueList::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it ) + for ( TQValueList::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it ) { if ( (*it).expression == str_parameter) { @@ -1447,7 +1447,7 @@ void View::getYValue(Ufkt *ufkt, char p_mode, double x, double &y, const QStrin } } -void View::keyPressEvent( QKeyEvent * e) +void View::keyPressEvent( TQKeyEvent * e) { if ( zoom_mode != Z_Normal && e->key() == Qt::Key_Escape ) { @@ -1469,14 +1469,14 @@ void View::keyPressEvent( QKeyEvent * e) if (csmode==-1 ) return; - QMouseEvent *event; + TQMouseEvent *event; if (e->key() == Qt::Key_Left ) - event = new QMouseEvent(QEvent::MouseMove,QPoint(fcx-1,fcy-1),Qt::LeftButton,Qt::LeftButton); + event = new TQMouseEvent(TQEvent::MouseMove,TQPoint(fcx-1,fcy-1),Qt::LeftButton,Qt::LeftButton); else if (e->key() == Qt::Key_Right ) - event = new QMouseEvent(QEvent::MouseMove,QPoint(fcx+1,fcy+1),Qt::LeftButton,Qt::LeftButton); + event = new TQMouseEvent(TQEvent::MouseMove,TQPoint(fcx+1,fcy+1),Qt::LeftButton,Qt::LeftButton); else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down) //switch graph in trace mode { - QValueVector::iterator it = &m_parser->ufkt[m_parser->ixValue(csmode)]; + TQValueVector::iterator it = &m_parser->ufkt[m_parser->ixValue(csmode)]; int const ke=it->parameters.count(); if (ke>0) { @@ -1560,31 +1560,31 @@ void View::keyPressEvent( QKeyEvent * e) break; case 1: { - QString function = it->fstr; + TQString function = it->fstr; function = function.left(function.find('(')) + '\''; setStatusBar(function,4); break; } case 2: { - QString function = it->fstr; + TQString function = it->fstr; function = function.left(function.find('(')) + "\'\'"; setStatusBar(function,4); break; } } - event = new QMouseEvent(QEvent::MouseMove,QPoint(fcx,fcy),Qt::LeftButton,Qt::LeftButton); + event = new TQMouseEvent(TQEvent::MouseMove,TQPoint(fcx,fcy),Qt::LeftButton,Qt::LeftButton); } else if ( e->key() == Qt::Key_Space ) { - event = new QMouseEvent(QEvent::MouseButtonPress,QCursor::pos(),Qt::RightButton,Qt::RightButton); + event = new TQMouseEvent(TQEvent::MouseButtonPress,TQCursor::pos(),Qt::RightButton,Qt::RightButton); mousePressEvent(event); delete event; return; } else { - event = new QMouseEvent(QEvent::MouseButtonPress,QPoint(fcx,fcy),Qt::LeftButton,Qt::LeftButton); + event = new TQMouseEvent(TQEvent::MouseButtonPress,TQPoint(fcx,fcy),Qt::LeftButton,Qt::LeftButton); mousePressEvent(event); delete event; return; @@ -1593,14 +1593,14 @@ void View::keyPressEvent( QKeyEvent * e) delete event; } -void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double &dmax, const QString &str_parameter, QPainter *DC ) +void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double &dmax, const TQString &str_parameter, TQPainter *DC ) { double x, y = 0; float calculated_area=0; int rectheight; areaMin = dmin; - QPoint p; - QColor color; + TQPoint p; + TQColor color; switch(p_mode) { case 0: @@ -1620,7 +1620,7 @@ void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double { int ly; buffer.fill(backgroundcolor); - DC = new QPainter(&buffer); + DC = new TQPainter(&buffer); ly=(int)((ymax-ymin)*100.*drskaly/tlgy); DC->scale((float)h/(float)(ly+2*ref.y()), (float)h/(float)(ly+2*ref.y())); } @@ -1634,7 +1634,7 @@ void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double // TODO: parameter sliders if ( !ufkt->parameters.isEmpty() ) { - for ( QValueList::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it ) + for ( TQValueList::Iterator it = ufkt->parameters.begin(); it != ufkt->parameters.end(); ++it ) { if ( (*it).expression == str_parameter) { @@ -1657,7 +1657,7 @@ void View::areaUnderGraph( Ufkt *ufkt, char const p_mode, double &dmin, double ufkt->oldyprim = ufkt->integral_precision; //paintEvent(0); - /*QPainter p; + /*TQPainter p; p.begin(this); bitBlt( this, 0, 0, &buffer, 0, 0, width(), height() ); p.end();*/ @@ -1832,7 +1832,7 @@ void View::updateSliders() } } - for(QValueVector::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end(); ++it) + for(TQValueVector::iterator it=m_parser->ufkt.begin(); it!=m_parser->ufkt.end(); ++it) { if (it->fname.isEmpty() ) continue; if( it->use_slider > -1 && (it->f_mode || it->f1_mode || it->f2_mode || it->integral_mode)) @@ -1841,8 +1841,8 @@ void View::updateSliders() if ( sliders[ it->use_slider ] == 0 ) { sliders[ it->use_slider ] = new KSliderWindow( this, it->use_slider); - connect( sliders[ it->use_slider ]->slider, SIGNAL( valueChanged( int ) ), this, SLOT( drawPlot() ) ); - connect( sliders[ it->use_slider ], SIGNAL( windowClosed( int ) ), this , SLOT( sliderWindowClosed(int) ) ); + connect( sliders[ it->use_slider ]->slider, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( drawPlot() ) ); + connect( sliders[ it->use_slider ], TQT_SIGNAL( windowClosed( int ) ), this , TQT_SLOT( sliderWindowClosed(int) ) ); mnuSliders[ it->use_slider ]->setChecked(true); //set the slider-item in the menu } sliders[ it->use_slider ]->show(); @@ -1876,14 +1876,14 @@ void View::mnuHide_clicked() if ( !ufkt->f_mode && !ufkt->f1_mode && !ufkt->f2_mode) //all graphs for the function are hidden { csmode=-1; - QMouseEvent *event = new QMouseEvent(QMouseEvent::KeyPress,QCursor::pos(),Qt::LeftButton,Qt::LeftButton); + TQMouseEvent *event = new TQMouseEvent(TQMouseEvent::KeyPress,TQCursor::pos(),Qt::LeftButton,Qt::LeftButton); mousePressEvent(event); //leave trace mode delete event; return; } else { - QKeyEvent *event = new QKeyEvent(QKeyEvent::KeyPress,Qt::Key_Up ,Qt::Key_Up ,0); + TQKeyEvent *event = new TQKeyEvent(TQKeyEvent::KeyPress,Qt::Key_Up ,Qt::Key_Up ,0); keyPressEvent(event); //change selected graph delete event; return; @@ -1894,7 +1894,7 @@ void View::mnuRemove_clicked() if ( csmode == -1 ) return; - if ( KMessageBox::warningContinueCancel(this,i18n("Are you sure you want to remove this function?"), QString::null, KStdGuiItem::del()) == KMessageBox::Continue ) + if ( KMessageBox::warningContinueCancel(this,i18n("Are you sure you want to remove this function?"), TQString::null, KStdGuiItem::del()) == KMessageBox::Continue ) { Ufkt *ufkt = &m_parser->ufkt[m_parser->ixValue(csmode)]; char const function_type = ufkt->fstr[0].latin1(); @@ -1904,7 +1904,7 @@ void View::mnuRemove_clicked() if (csmode!=-1) // if trace mode is enabled { csmode=-1; - QMouseEvent *event = new QMouseEvent(QMouseEvent::KeyPress,QCursor::pos(),Qt::LeftButton,Qt::LeftButton); + TQMouseEvent *event = new TQMouseEvent(TQMouseEvent::KeyPress,TQCursor::pos(),Qt::LeftButton,Qt::LeftButton); mousePressEvent(event); //leave trace mode delete event; } @@ -1927,7 +1927,7 @@ void View::mnuEdit_clicked() KEditParametric* editParametric = new KEditParametric( m_parser, this ); editParametric->setCaption(i18n( "New Parametric Plot" )); editParametric->initDialog( csmode,y_index ); - if( editParametric->exec() == QDialog::Accepted ) + if( editParametric->exec() == TQDialog::Accepted ) { drawPlot(); m_modified = true; @@ -1939,7 +1939,7 @@ void View::mnuEdit_clicked() EditFunction* editFunction = new EditFunction( m_parser, this ); editFunction->setCaption(i18n( "Edit Function Plot" )); editFunction->initDialog( csmode ); - if( editFunction->exec() == QDialog::Accepted ) + if( editFunction->exec() == TQDialog::Accepted ) { drawPlot(); updateSliders(); @@ -1993,7 +1993,7 @@ void View::mnuZoomIn_clicked() resetZoom(); else { - setCursor( QCursor( SmallIcon( "magnify", 32), 10, 10 ) ); + setCursor( TQCursor( SmallIcon( "magnify", 32), 10, 10 ) ); zoom_mode = Z_ZoomIn; } } @@ -2004,7 +2004,7 @@ void View::mnuZoomOut_clicked() resetZoom(); else { - setCursor( QCursor( SmallIcon( "lessen", 32), 10, 10 ) ); + setCursor( TQCursor( SmallIcon( "lessen", 32), 10, 10 ) ); zoom_mode = Z_ZoomOut; } } @@ -2037,7 +2037,7 @@ void View::mnuTrig_clicked() Settings::setYRange(4); //custom y-range drawPlot(); //update all graphs } -void View::invertColor(QColor &org, QColor &inv) +void View::invertColor(TQColor &org, TQColor &inv) { int r = org.red()-255; if ( r<0) r=r*-1; @@ -2059,10 +2059,10 @@ void View::restoreCursor() setCursor(Qt::CrossCursor); break; case Z_ZoomIn: //zoom in - setCursor( QCursor( SmallIcon( "magnify", 32), 10, 10 ) ); + setCursor( TQCursor( SmallIcon( "magnify", 32), 10, 10 ) ); break; case Z_ZoomOut: //zoom out - setCursor( QCursor( SmallIcon( "lessen", 32), 10, 10 ) ); + setCursor( TQCursor( SmallIcon( "lessen", 32), 10, 10 ) ); break; case Z_Center: //center a point setCursor(Qt::PointingHandCursor); @@ -2070,17 +2070,17 @@ void View::restoreCursor() } } -bool View::event( QEvent * e ) +bool View::event( TQEvent * e ) { - if ( e->type() == QEvent::WindowDeactivate && isDrawing) + if ( e->type() == TQEvent::WindowDeactivate && isDrawing) { stop_calculating = true; return true; } - return QWidget::event(e); //send the information further + return TQWidget::event(e); //send the information further } -void View::setStatusBar(const QString &text, const int id) +void View::setStatusBar(const TQString &text, const int id) { if ( m_readonly) //if KmPlot is shown as a KPart with e.g Konqueror, it is only possible to change the status bar in one way: to call setStatusBarText { @@ -2101,7 +2101,7 @@ void View::setStatusBar(const QString &text, const int id) default: return; } - QString statusbartext = m_statusbartext1; + TQString statusbartext = m_statusbartext1; if ( !m_statusbartext1.isEmpty() && !m_statusbartext2.isEmpty() ) statusbartext.append(" | "); statusbartext.append(m_statusbartext2); @@ -2115,32 +2115,32 @@ void View::setStatusBar(const QString &text, const int id) } else { - QByteArray parameters; - QDataStream arg( parameters, IO_WriteOnly); + TQByteArray parameters; + TQDataStream arg( parameters, IO_WriteOnly); arg << text << id; - m_dcop_client->send(m_dcop_client->appId(), "KmPlotShell","setStatusBarText(QString,int)", parameters); + m_dcop_client->send(m_dcop_client->appId(), "KmPlotShell","setStatusBarText(TQString,int)", parameters); } } void View::startProgressBar(int steps) { - QByteArray data; - QDataStream stream(data, IO_WriteOnly); + TQByteArray data; + TQDataStream stream(data, IO_WriteOnly); stream << steps; m_dcop_client->send(m_dcop_client->appId(), "KmPlotShell","startProgressBar(int)", data); } bool View::stopProgressBar() { - QCString replyType; - QByteArray replyData; - m_dcop_client->call(m_dcop_client->appId(), "KmPlotShell","stopProgressBar()", QByteArray(), replyType, replyData); + TQCString replyType; + TQByteArray replyData; + m_dcop_client->call(m_dcop_client->appId(), "KmPlotShell","stopProgressBar()", TQByteArray(), replyType, replyData); bool result; - QDataStream stream(replyData, IO_ReadOnly); + TQDataStream stream(replyData, IO_ReadOnly); stream >> result; return result; } void View::increaseProgressBar() { - m_dcop_client->send(m_dcop_client->appId(), "KmPlotShell","increaseProgressBar()", QByteArray()); + m_dcop_client->send(m_dcop_client->appId(), "KmPlotShell","increaseProgressBar()", TQByteArray()); } void View::sliderWindowClosed(int num) diff --git a/kmplot/kmplot/View.h b/kmplot/kmplot/View.h index a3079c92..a28aadbc 100644 --- a/kmplot/kmplot/View.h +++ b/kmplot/kmplot/View.h @@ -28,7 +28,7 @@ #undef GrayScale // Qt includes -#include +#include // KDE includes #include @@ -64,28 +64,28 @@ enum ZoomMode * It is the central widget of MainDlg. * @see MainDlg, MainDlg::view */ -class View : public QWidget, virtual public ViewIface +class View : public TQWidget, virtual public ViewIface { Q_OBJECT public: /// Contructor sets up the parser, too. - View(bool, bool &, KPopupMenu *, QWidget* parent=NULL, const char* name=NULL ); + View(bool, bool &, KPopupMenu *, TQWidget* parent=NULL, const char* name=NULL ); void setMinMaxDlg(KMinMax *); virtual ~View(); /// Reimplemented to draw all stuff to the view. - void draw(QPaintDevice *, int const); + void draw(TQPaintDevice *, int const); /// Getting all relevant settings using KConfig XT class Settings. void getSettings(); /// Clears all functions in the parser and gets default settings. /// @see getSettings void init(); /// Finding the minimum or maximum value - void findMinMaxValue(Ufkt *, char, bool, double &, double &,const QString &); + void findMinMaxValue(Ufkt *, char, bool, double &, double &,const TQString &); /// get a y-value from a x-value - void getYValue(Ufkt * , char, double , double &,const QString &); + void getYValue(Ufkt * , char, double , double &,const TQString &); /// draw and calculate the area between the graph and the x-axis. - void areaUnderGraph(Ufkt *, char const, double &, double &, const QString &, QPainter* ); + void areaUnderGraph(Ufkt *, char const, double &, double &, const TQString &, TQPainter* ); /// the calculation was cancelled by the user bool isCalculationStopped(); @@ -106,7 +106,7 @@ public: Ufkt * areaUfkt; char areaPMode; double areaMin, areaMax; - QString areaParameter; + TQString areaParameter; /// Slider controlling parameter values KSliderWindow* sliders[ SLIDER_COUNT ]; @@ -137,39 +137,39 @@ public slots: void mnuTrig_clicked(); protected slots: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); + void paintEvent(TQPaintEvent *); + void resizeEvent(TQResizeEvent *); /// Updating the cross hair. - void mouseMoveEvent(QMouseEvent *); + void mouseMoveEvent(TQMouseEvent *); /// Toggles the trace mode if the cursor is near to a plot. - void mousePressEvent(QMouseEvent *); + void mousePressEvent(TQMouseEvent *); /// when a key is pressed and the graph widget has focus - void keyPressEvent(QKeyEvent * ); + void keyPressEvent(TQKeyEvent * ); /// called when a mouse key is released - void mouseReleaseEvent ( QMouseEvent * e ); + void mouseReleaseEvent ( TQMouseEvent * e ); /// Is needed to be reimplement so that the user can stop a preview-drawing - bool event( QEvent * e ); + bool event( TQEvent * e ); signals: - void setStatusBarText(const QString &); + void setStatusBarText(const TQString &); void resetZoom(); private: /// Print out table with additional information. /// Only for printing. - void drawHeaderTable(QPainter *); + void drawHeaderTable(TQPainter *); /// Draw the function plots. - void plotfkt(Ufkt *ufkt, QPainter*); + void plotfkt(Ufkt *ufkt, TQPainter*); /// Gets the greek pi symbol. - void setpi(QString *); + void setpi(TQString *); /// in trace mode checks, if the function is (near by) zero bool root(double *, Ufkt *); ///return the inverted color - void invertColor(QColor &, QColor &); + void invertColor(TQColor &, TQColor &); /// Restore the mouse cursor when a drawing is finished void restoreCursor(); /// Changes the text in the statusbar - void setStatusBar(const QString &text, const int id); + void setStatusBar(const TQString &text, const int id); /// Functions for the progressbar bool stopProgressBar(); void startProgressBar(int); @@ -195,15 +195,15 @@ private: bool rootflg; CDiagr dgr; ///< Coordinate system - QPoint ref; - QRect area, + TQPoint ref; + TQRect area, PlotArea; - QPixmap hline, + TQPixmap hline, vline; - QWMatrix wm; + TQWMatrix wm; double tlgx, tlgy, drskalx, drskaly; - QString tlgxstr, tlgystr, drskalxstr, drskalystr; + TQString tlgxstr, tlgystr, drskalxstr, drskalystr; double stepWidth; ///< Absolute step width /** @name Plotrange @@ -216,14 +216,14 @@ private: */ //@{ ///Convert axes range predefinition index to boundaries. - void getMinMax(int koord, QString &mini, QString &maxi); + void getMinMax(int koord, TQString &mini, TQString &maxi); /** Handle predefiend axes ranges. * * @p koord can have the values 0 to 4 which have the following meanings: * * In the last case @p minstr and @p maxstr are evaluated. */ - void coordToMinMax( const int koord, const QString &minStr, const QString &maxStr, + void coordToMinMax( const int koord, const TQString &minStr, const TQString &maxStr, double &min, double &max ); /// Sets the plot range from Settings void setPlotRange(); @@ -241,13 +241,13 @@ private: /// if stop_calculating is true, the user has canceled drawing of an integral graph bool stop_calculating; /// the background color of the graph - QColor backgroundcolor; + TQColor backgroundcolor; /// the inverted background color used by the "Fadenkreuz" - QColor inverted_backgroundcolor; + TQColor inverted_backgroundcolor; /// pointer to KMinMax KMinMax *m_minmax; ///buffer the current window so all functions don't need to be re-drawed - QPixmap buffer; + TQPixmap buffer; /// the popup menu KPopupMenu *m_popupmenu; /// is set to true if an integral is calculated @@ -255,7 +255,7 @@ private: ///status of the popup menu char m_popupmenushown; /// 0==no popup 1==popup 2==popup+trace mode before /// for zoom-mode - QPoint rectangle_point; + TQPoint rectangle_point; /*char zoom_mode;*/ ///0=normal 1=rectangular zoom, 2=zoom in, 3=zoom out ,4=drawing a rectangle, 5=center ZoomMode zoom_mode; /// true == modifications not saved @@ -264,10 +264,10 @@ private: bool const m_readonly; DCOPClient *m_dcop_client; - QString m_statusbartext1; - QString m_statusbartext2; - QString m_statusbartext3; - QString m_statusbartext4; + TQString m_statusbartext1; + TQString m_statusbartext2; + TQString m_statusbartext3; + TQString m_statusbartext4; }; #endif // View_included diff --git a/kmplot/kmplot/coordsconfigdialog.cpp b/kmplot/kmplot/coordsconfigdialog.cpp index bc6df41e..37e92b16 100644 --- a/kmplot/kmplot/coordsconfigdialog.cpp +++ b/kmplot/kmplot/coordsconfigdialog.cpp @@ -26,13 +26,13 @@ #include #include #include -#include +#include #include "settings.h" #include "settingspagecoords.h" #include "coordsconfigdialog.h" -CoordsConfigDialog::CoordsConfigDialog(XParser *p, QWidget *parent) +CoordsConfigDialog::CoordsConfigDialog(XParser *p, TQWidget *parent) : KConfigDialog(parent, "coords", Settings::self()), m_parser(p) { configAxesDialog = new SettingsPageCoords( 0, "coordsSettings" ); diff --git a/kmplot/kmplot/coordsconfigdialog.h b/kmplot/kmplot/coordsconfigdialog.h index f7f8cc48..9fe15490 100644 --- a/kmplot/kmplot/coordsconfigdialog.h +++ b/kmplot/kmplot/coordsconfigdialog.h @@ -40,7 +40,7 @@ class CoordsConfigDialog : public KConfigDialog { Q_OBJECT public: - CoordsConfigDialog(XParser *p, QWidget *parent = 0); + CoordsConfigDialog(XParser *p, TQWidget *parent = 0); ~CoordsConfigDialog(); protected slots: virtual void slotOk(); diff --git a/kmplot/kmplot/diagr.cpp b/kmplot/kmplot/diagr.cpp index ba438c7b..ba65fce8 100644 --- a/kmplot/kmplot/diagr.cpp +++ b/kmplot/kmplot/diagr.cpp @@ -61,7 +61,7 @@ CDiagr::CDiagr() CDiagr::~CDiagr() {} -void CDiagr::Create(QPoint Ref, // Bezugspunkt links unten +void CDiagr::Create(TQPoint Ref, // Bezugspunkt links unten int lx, int ly, // Achsenl�gen double xmin, double xmax, // x-Wertebereich double ymin, double ymax) // y-Wertebereich @@ -105,9 +105,9 @@ void CDiagr::Skal( double ex, double ey ) } -void CDiagr::Plot(QPainter* pDC) +void CDiagr::Plot(TQPainter* pDC) { - QPen pen(frameColor, borderThickness); + TQPen pen(frameColor, borderThickness); if( g_mode != GRID_NONE ) drawGrid( pDC ); // draw the grid @@ -221,13 +221,13 @@ double CDiagr::Transy(int y) // Bildschirmkoordinate } -void CDiagr::drawAxes( QPainter* pDC ) // draw axes +void CDiagr::drawAxes( TQPainter* pDC ) // draw axes { int a, b, tl; double d, da, db; if( Settings::showAxes() ) { - pDC->setPen( QPen( axesColor, axesLineWidth ) ); + pDC->setPen( TQPen( axesColor, axesLineWidth ) ); b = Transy(0.); a = PlotArea.right(); pDC->Lineh(PlotArea.left(), b, a); // x-Achse @@ -249,7 +249,7 @@ void CDiagr::drawAxes( QPainter* pDC ) // draw axes } } - pDC->setPen( QPen( axesColor, ticWidth ) ); + pDC->setPen( TQPen( axesColor, ticWidth ) ); if( Settings::showAxes() ) { da=oy-ticLength; @@ -328,11 +328,11 @@ void CDiagr::drawAxes( QPainter* pDC ) // draw axes } -void CDiagr::drawGrid( QPainter* pDC ) +void CDiagr::drawGrid( TQPainter* pDC ) { int a, b; double d, x, y; - QPen pen( gridColor, gridLineWidth ); + TQPen pen( gridColor, gridLineWidth ); pDC->setPen(pen); if( g_mode==GRID_LINES ) @@ -370,7 +370,7 @@ void CDiagr::drawGrid( QPainter* pDC ) { int y2; double w; - QRect const rc=PlotArea; + TQRect const rc=PlotArea; pDC->setClipRect(pDC->xForm(rc)); double const c=hypot(xmd*skx, ymd*sky); @@ -404,21 +404,21 @@ void CDiagr::drawGrid( QPainter* pDC ) } -void CDiagr::drawLabels(QPainter* pDC) +void CDiagr::drawLabels(TQPainter* pDC) { int const dx=15; int const dy=40; - QFont const font=QFont( Settings::axesFont(), Settings::axesFontSize() ); + TQFont const font=TQFont( Settings::axesFont(), Settings::axesFontSize() ); pDC->setFont(font); int const x=Transx(0.); int const y=Transy(0.); double d; int n; - QString s; + TQString s; //pDC->drawText(x-dx, y+dy, 0, 0, Qt::AlignRight|Qt::AlignVCenter|Qt::DontClip, "0"); char draw_next=0; - QFontMetrics const test(font); + TQFontMetrics const test(font); int swidth=0; for(d=tsx, n=(int)ceil(xmin/ex); d-swidth && draw_next==0) { @@ -574,15 +574,15 @@ void CDiagr::drawLabels(QPainter* pDC) if(fabs(ey-M_PI/2.)<1e-3) { if(n==-1 || n==1) - s+="pi/2";//s+=QChar(960)+QString("/2"); + s+="pi/2";//s+=TQChar(960)+TQString("/2"); else if(n%2==0) { if(n==-2 || n==2) - s+="pi";//s+=QChar(960); + s+="pi";//s+=TQChar(960); else { - s=QString().sprintf("%+d", n/2); - s+="pi";//s+=QChar(960); + s=TQString().sprintf("%+d", n/2); + s+="pi";//s+=TQChar(960); } } else @@ -595,15 +595,15 @@ void CDiagr::drawLabels(QPainter* pDC) else if(fabs(ey-M_PI/3.)<1e-3) { if(n==-1 || n==1) - s+="pi/3";//s+=QChar(960)+QString("/3"); + s+="pi/3";//s+=TQChar(960)+TQString("/3"); else if(n%3==0) { if(n==-3 || n==3) - s+="pi";//s+=QChar(960); + s+="pi";//s+=TQChar(960); else { - s=QString().sprintf("%+d", n/3); - s+="pi";//s+=QChar(960); + s=TQString().sprintf("%+d", n/3); + s+="pi";//s+=TQChar(960); } } else @@ -616,15 +616,15 @@ void CDiagr::drawLabels(QPainter* pDC) else if(fabs(ey-M_PI/4.)<1e-3) { if(n==-1 || n==1) - s+="pi/4";//s+=QChar(960)+QString("/4"); + s+="pi/4";//s+=TQChar(960)+TQString("/4"); else if(n%4==0) { if(n==-4 || n==4) - s+="pi";//s+=QChar(960); + s+="pi";//s+=TQChar(960); else { - s=QString().sprintf("%+d", n/4); - s+="pi";//s+=QChar(960); + s=TQString().sprintf("%+d", n/4); + s+="pi";//s+=TQChar(960); } } else @@ -636,7 +636,7 @@ void CDiagr::drawLabels(QPainter* pDC) } else if((n%5==0 || n==1 || n==-1)) { - s=QString().sprintf("%+0.3g", n*ey); + s=TQString().sprintf("%+0.3g", n*ey); if (xmin>=0) pDC->drawText(x+dx, Transy(d), 0, 0, Qt::AlignVCenter|Qt::AlignLeft|Qt::DontClip, s); else diff --git a/kmplot/kmplot/diagr.h b/kmplot/kmplot/diagr.h index 45cae5a6..23375821 100644 --- a/kmplot/kmplot/diagr.h +++ b/kmplot/kmplot/diagr.h @@ -33,7 +33,7 @@ #include // Qt includes -#include +#include //@{ /// Some abbreviations for horizontal and vertical lines. @@ -61,18 +61,18 @@ public: ~CDiagr(); /// Sets all members to current values. - void Create( QPoint Ref, + void Create( TQPoint Ref, int lx, int ly, double xmin, double xmax, double ymin, double ymax ); /// Sets the current values for the scaling factors void Skal( double ex, double ey ); /// Draws all requested parts of the diagram (axes, labels, grid e.g.) - void Plot( QPainter* pDC ); + void Plot( TQPainter* pDC ); /// Returns the rectangle around the core of the plot area. - QRect GetPlotArea() { return PlotArea; } + TQRect GetPlotArea() { return PlotArea; } /// Returns the rectangle for the frame around the plot. Extra frame is bigger. - QRect GetFrame() { return m_frame; } + TQRect GetFrame() { return m_frame; } /** @name Transformations */ //@{ @@ -104,11 +104,11 @@ public: private: /// Draw the coordinate axes. - void drawAxes(QPainter*); + void drawAxes(TQPainter*); /// Draw the grid. - void drawGrid( QPainter* ); + void drawGrid( TQPainter* ); /// Write labels. - void drawLabels(QPainter*); + void drawLabels(TQPainter*); /// Current grid style. int g_mode; @@ -138,8 +138,8 @@ private: double skx, sky; //@} - QRect PlotArea; ///< plot area - QRect m_frame; ///< frame around the plot + TQRect PlotArea; ///< plot area + TQRect m_frame; ///< frame around the plot }; #endif // diagr_included diff --git a/kmplot/kmplot/editfunction.cpp b/kmplot/kmplot/editfunction.cpp index 60786d21..2d75cc49 100644 --- a/kmplot/kmplot/editfunction.cpp +++ b/kmplot/kmplot/editfunction.cpp @@ -24,15 +24,15 @@ */ // Qt includes -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // KDE includes @@ -56,23 +56,23 @@ #include "editintegralpage.h" #include "kparametereditor.h" -EditFunction::EditFunction( XParser* parser, QWidget* parent, const char* name ) : +EditFunction::EditFunction( XParser* parser, TQWidget* parent, const char* name ) : KDialogBase( IconList, "Caption", Help|Ok|Cancel, Ok, parent, name ), m_parser(parser) { - QVBox *page0 = addVBoxPage( i18n("Function"), i18n( "Function" ), SmallIcon( "func", 32 ) ); + TQVBox *page0 = addVBoxPage( i18n("Function"), i18n( "Function" ), SmallIcon( "func", 32 ) ); editfunctionpage = new EditFunctionPage( page0 ); - QVBox *page1 = addVBoxPage( i18n("Derivatives"), i18n( "Derivatives" ), SmallIcon( "deriv_func", 32 ) ); + TQVBox *page1 = addVBoxPage( i18n("Derivatives"), i18n( "Derivatives" ), SmallIcon( "deriv_func", 32 ) ); editderivativespage = new EditDerivativesPage( page1 ); - QVBox *page2 = addVBoxPage( i18n("Integral"), i18n( "Integral" ), SmallIcon( "integral_func", 32 ) ); + TQVBox *page2 = addVBoxPage( i18n("Integral"), i18n( "Integral" ), SmallIcon( "integral_func", 32 ) ); editintegralpage = new EditIntegralPage( page2 ); for( int number = 0; number < SLIDER_COUNT; number++ ) { editfunctionpage->listOfSliders->insertItem( i18n( "Slider No. %1" ).arg( number +1) ); } - connect( editfunctionpage->cmdParameter, SIGNAL ( clicked() ), this, SLOT( cmdParameter_clicked() ) ); - connect( editfunctionpage->useNoParameter, SIGNAL ( toggled(bool) ), this, SLOT( noParameter_toggled(bool) ) ); - connect( editfunctionpage->customMinRange, SIGNAL ( toggled(bool) ), this, SLOT( customMinRange_toggled(bool) ) ); - connect( editfunctionpage->customMaxRange, SIGNAL ( toggled(bool) ), this, SLOT( customMaxRange_toggled(bool) ) ); + connect( editfunctionpage->cmdParameter, TQT_SIGNAL ( clicked() ), this, TQT_SLOT( cmdParameter_clicked() ) ); + connect( editfunctionpage->useNoParameter, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT( noParameter_toggled(bool) ) ); + connect( editfunctionpage->customMinRange, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT( customMinRange_toggled(bool) ) ); + connect( editfunctionpage->customMaxRange, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT( customMaxRange_toggled(bool) ) ); m_updatedfunction = 0; } @@ -169,7 +169,7 @@ void EditFunction::setWidgets() void EditFunction::accept() { - QString f_str( editfunctionpage->equation->text() ); + TQString f_str( editfunctionpage->equation->text() ); if ( m_id!=-1 ) m_parser->fixFunctionName(f_str, XParser::Function, m_id); @@ -312,7 +312,7 @@ void EditFunction::accept() return; } added_ufkt = &m_parser->ufkt[ix]; - QString const old_fstr = added_ufkt->fstr; + TQString const old_fstr = added_ufkt->fstr; if(( (!m_parameter.isEmpty() && editfunctionpage->useList->isChecked() ) || editfunctionpage->useSlider->isChecked() ) && !functionHas2Arguments() ) fixFunctionArguments(f_str); //adding an extra argument for the parameter value added_ufkt->fstr = f_str; @@ -426,7 +426,7 @@ void EditFunction::customMaxRange_toggled(bool status) editfunctionpage->max->setEnabled(false); } -void EditFunction::fixFunctionArguments(QString &f_str) +void EditFunction::fixFunctionArguments(TQString &f_str) { int const openBracket = f_str.find( "(" ); int const closeBracket = f_str.find( ")" ); diff --git a/kmplot/kmplot/editfunction.h b/kmplot/kmplot/editfunction.h index 9ef8ee05..308beadf 100644 --- a/kmplot/kmplot/editfunction.h +++ b/kmplot/kmplot/editfunction.h @@ -43,7 +43,7 @@ class EditFunction : public KDialogBase /// @param parser points to the parser instance. /// @param parent points to the parent widget. /// @param name of this instance. - EditFunction( XParser* parser, QWidget* parent = NULL, const char* name = NULL ); + EditFunction( XParser* parser, TQWidget* parent = NULL, const char* name = NULL ); /// Nothing special to do. virtual ~EditFunction() {} /// Fill the dialog's widgets with the properties of the parser function number index. @@ -73,13 +73,13 @@ class EditFunction : public KDialogBase /// Check, if the function has 2 arguments (function group) bool functionHas2Arguments(); /// Adding an extra argument - void fixFunctionArguments(QString &); + void fixFunctionArguments(TQString &); /// Pointer to the parser instance XParser* m_parser; /// Current function index int m_id; - QValueList m_parameter; + TQValueList m_parameter; EditFunctionPage* editfunctionpage; EditDerivativesPage* editderivativespage; diff --git a/kmplot/kmplot/kconstanteditor.cpp b/kmplot/kmplot/kconstanteditor.cpp index 6014c82b..c2017c8a 100644 --- a/kmplot/kmplot/kconstanteditor.cpp +++ b/kmplot/kmplot/kconstanteditor.cpp @@ -31,24 +31,24 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "kmplotio.h" #include "kconstanteditor.h" -KConstantEditor::KConstantEditor(View *v, QWidget *parent, const char *name) +KConstantEditor::KConstantEditor(View *v, TQWidget *parent, const char *name) : QConstantEditor(parent,name), m_view(v) { - QString str_value; - QValueVector::iterator it; + TQString str_value; + TQValueVector::iterator it; for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end() ;++it) { str_value.setNum(it->value); - (void) new QListViewItem(varlist, QChar(it->constant), str_value); + (void) new TQListViewItem(varlist, TQChar(it->constant), str_value); } } @@ -61,7 +61,7 @@ void KConstantEditor::cmdNew_clicked() { constant = '0'; KEditConstant *dlg = new KEditConstant(m_view->parser(), constant, value); - connect( dlg, SIGNAL( finished() ), this,SLOT(newConstantSlot() ) ); + connect( dlg, TQT_SIGNAL( finished() ), this,TQT_SLOT(newConstantSlot() ) ); dlg->show(); } @@ -73,7 +73,7 @@ void KConstantEditor::cmdEdit_clicked() value = varlist->currentItem()->text(1); KEditConstant *dlg = new KEditConstant(m_view->parser(), constant, value); - connect( dlg, SIGNAL( finished() ), this,SLOT(editConstantSlot() ) ); + connect( dlg, TQT_SIGNAL( finished() ), this,TQT_SLOT(editConstantSlot() ) ); dlg->show(); } @@ -84,9 +84,9 @@ void KConstantEditor::cmdDelete_clicked() constant = varlist->currentItem()->text(0).at(0).latin1(); value = varlist->currentItem()->text(1); - QString str; + TQString str; - for( QValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) { str = it->fstr; for (int i=str.find(')'); (uint)i::iterator it; + TQValueVector::iterator it; for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end(); ++it) { if ( it->constant == constant) @@ -113,10 +113,10 @@ void KConstantEditor::cmdDelete_clicked() } } - delete varlist->findItem(QChar(constant), 0); //removes the item from the constant list + delete varlist->findItem(TQChar(constant), 0); //removes the item from the constant list } -void KConstantEditor::varlist_clicked( QListViewItem * item ) +void KConstantEditor::varlist_clicked( TQListViewItem * item ) { if (item) { @@ -139,12 +139,12 @@ void KConstantEditor::cmdDuplicate_clicked() constant = varlist->currentItem()->text(0).at(0).latin1(); value = varlist->currentItem()->text(1); - QStringList list; + TQStringList list; bool found; for (char i='A'; i<'Z';i++) { found = false; - QValueVector::iterator it; + TQValueVector::iterator it; for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end() && !found;++it) { if ( it->constant == i || i == constant) @@ -153,9 +153,9 @@ void KConstantEditor::cmdDuplicate_clicked() } } if (!found) - list.append(QChar(i)); + list.append(TQChar(i)); } - QStringList result = KInputDialog::getItemList(i18n("Choose Name"),i18n("Choose a name for the constant:"),list, QStringList(), false, &found); + TQStringList result = KInputDialog::getItemList(i18n("Choose Name"),i18n("Choose a name for the constant:"),list, TQStringList(), false, &found); if (found) { constant = (*result.begin()).at(0).latin1(); @@ -168,7 +168,7 @@ void KConstantEditor::newConstantSlot() { double dvalue = m_view->parser()->eval(value); m_view->parser()->constant.append( Constant(constant, dvalue) ); - (void) new QListViewItem(varlist, QChar( constant ), value); + (void) new TQListViewItem(varlist, TQChar( constant ), value); varlist->sort(); } @@ -176,7 +176,7 @@ void KConstantEditor::editConstantSlot() { double dvalue = m_view->parser()->eval(value); bool found = false; - QValueVector::iterator it; + TQValueVector::iterator it; for(it = m_view->parser()->constant.begin(); it!= m_view->parser()->constant.end() && !found;++it) { if ( it->constant == constant) @@ -191,13 +191,13 @@ void KConstantEditor::editConstantSlot() return; } - QListViewItem *item = varlist->findItem(QChar(constant), 0); + TQListViewItem *item = varlist->findItem(TQChar(constant), 0); if (item!=0) item->setText(1,value); int index = 0; - for( QValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) { if( it->fstr.contains(constant)!=0 ) m_view->parser()->reparse(index); //reparsing the function @@ -207,7 +207,7 @@ void KConstantEditor::editConstantSlot() m_view->drawPlot(); } -void KConstantEditor::varlist_doubleClicked( QListViewItem * ) +void KConstantEditor::varlist_doubleClicked( TQListViewItem * ) { cmdEdit_clicked(); } diff --git a/kmplot/kmplot/kconstanteditor.h b/kmplot/kmplot/kconstanteditor.h index 5f801891..93343ac3 100644 --- a/kmplot/kmplot/kconstanteditor.h +++ b/kmplot/kmplot/kconstanteditor.h @@ -38,7 +38,7 @@ class KConstantEditor : public QConstantEditor { Q_OBJECT public: - KConstantEditor(View *, QWidget *parent = 0, const char *name = 0); + KConstantEditor(View *, TQWidget *parent = 0, const char *name = 0); ~KConstantEditor(); public slots: @@ -49,8 +49,8 @@ public slots: void cmdDuplicate_clicked(); ///actions for the visible constant list - void varlist_clicked( QListViewItem * item ); - void varlist_doubleClicked( QListViewItem * ); + void varlist_clicked( TQListViewItem * item ); + void varlist_doubleClicked( TQListViewItem * ); /// called when a user pressed OK the the new-constant-dialog void newConstantSlot(); @@ -60,7 +60,7 @@ public slots: private: char constant; - QString value; + TQString value; View *m_view; }; diff --git a/kmplot/kmplot/keditconstant.cpp b/kmplot/kmplot/keditconstant.cpp index e7a724ac..4f4ab040 100644 --- a/kmplot/kmplot/keditconstant.cpp +++ b/kmplot/kmplot/keditconstant.cpp @@ -27,24 +27,24 @@ #include #include #include -#include +#include #include "keditconstant.h" -KEditConstant::KEditConstant(XParser *p, char &c, QString &v, QWidget *parent, const char *name) +KEditConstant::KEditConstant(XParser *p, char &c, TQString &v, TQWidget *parent, const char *name) : QEditConstant(parent, name,Qt::WDestructiveClose), constant(c), value(v), m_parser(p) { if ( constant != '0' ) { txtConstant->setEnabled(false); - txtConstant->setText(QChar(constant)); + txtConstant->setText(TQChar(constant)); txtValue->setText(value); txtValue->setFocus(); txtValue->selectAll(); } - connect( cmdCancel, SIGNAL( clicked() ), this, SLOT( deleteLater() )); - connect( cmdOK, SIGNAL( clicked() ), this, SLOT( cmdOK_clicked() )); + connect( cmdCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( deleteLater() )); + connect( cmdOK, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdOK_clicked() )); } @@ -67,7 +67,7 @@ void KEditConstant::cmdOK_clicked() if ( txtConstant->isEnabled() ) //creating, not edit a constant { bool found= false; - QValueVector::iterator it; + TQValueVector::iterator it; for(it = m_parser->constant.begin(); it!= m_parser->constant.end() && !found;++it) { if ( it->constant == constant) @@ -88,7 +88,7 @@ void KEditConstant::cmdOK_clicked() } emit finished(); - QDialog::accept(); + TQDialog::accept(); } void KEditConstant::txtVariable_lostFocus() diff --git a/kmplot/kmplot/keditconstant.h b/kmplot/kmplot/keditconstant.h index dcce75cd..e6d19d20 100644 --- a/kmplot/kmplot/keditconstant.h +++ b/kmplot/kmplot/keditconstant.h @@ -37,7 +37,7 @@ class KEditConstant : public QEditConstant { Q_OBJECT public: - KEditConstant(XParser *p, char &, QString &,QWidget *parent = 0, const char *name = 0); + KEditConstant(XParser *p, char &, TQString &,TQWidget *parent = 0, const char *name = 0); ~KEditConstant(); public slots: @@ -50,7 +50,7 @@ signals: private: char &constant; - QString &value; + TQString &value; XParser *m_parser; diff --git a/kmplot/kmplot/keditparametric.cpp b/kmplot/kmplot/keditparametric.cpp index 06b9d359..67ee0421 100644 --- a/kmplot/kmplot/keditparametric.cpp +++ b/kmplot/kmplot/keditparametric.cpp @@ -23,7 +23,7 @@ * */ // Qt includes -#include +#include // KDE includes #include @@ -41,11 +41,11 @@ #include "xparser.h" #include "View.h" -KEditParametric::KEditParametric( XParser* parser, QWidget* parent, const char* name ) : +KEditParametric::KEditParametric( XParser* parser, TQWidget* parent, const char* name ) : QEditParametric( parent, name ), m_parser(parser) { - connect( customMinRange, SIGNAL ( toggled(bool) ), this, SLOT( customMinRange_toggled(bool) ) ); - connect( customMaxRange, SIGNAL ( toggled(bool) ), this, SLOT( customMaxRange_toggled(bool) ) ); + connect( customMinRange, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT( customMinRange_toggled(bool) ) ); + connect( customMaxRange, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT( customMaxRange_toggled(bool) ) ); m_updatedfunction = 0; } @@ -74,7 +74,7 @@ void KEditParametric::clearWidgets() void KEditParametric::setWidgets() { Ufkt *ufkt = &m_parser->ufkt[ m_parser->ixValue(m_x_id) ]; - QString name, expression; + TQString name, expression; splitEquation( ufkt->fstr, name, expression ); kLineEditName->setText( name ); kLineEditXFunction->setText( expression ); @@ -114,7 +114,7 @@ void KEditParametric::accept() // find a name not already used if( kLineEditName->text().isEmpty() ) { - QString fname; + TQString fname; m_parser->fixFunctionName(fname, XParser::ParametricX, m_x_id); int const pos = fname.find('('); kLineEditName->setText(fname.mid(1,pos-1)); @@ -178,7 +178,7 @@ void KEditParametric::accept() return; } added_ufkt = &m_parser->ufkt[ix]; - QString old_fstr = added_ufkt->fstr; + TQString old_fstr = added_ufkt->fstr; added_ufkt->fstr = xFunction(); m_parser->reparse(added_ufkt); //reparse the funcion if ( m_parser->parserError() != 0) @@ -237,7 +237,7 @@ void KEditParametric::accept() if( m_y_id != -1 ) //when editing a function: { added_ufkt = &m_parser->ufkt[m_parser->ixValue(m_y_id)]; - QString old_fstr = added_ufkt->fstr; + TQString old_fstr = added_ufkt->fstr; added_ufkt->fstr = yFunction(); m_parser->reparse(added_ufkt); //reparse the funcion if ( m_parser->parserError() != 0) //when something went wrong: @@ -299,12 +299,12 @@ void KEditParametric::accept() QEditParametric::accept(); //update the function name in FktDlg } -QString KEditParametric::xFunction() +TQString KEditParametric::xFunction() { return "x" + kLineEditName->text() + "(t)=" + kLineEditXFunction->text(); } -void KEditParametric::splitEquation( const QString equation, QString &name, QString &expression ) +void KEditParametric::splitEquation( const TQString equation, TQString &name, TQString &expression ) { int start = 0; if( equation[ 0 ] == 'x' || equation[ 0 ] == 'y' ) start++; @@ -314,7 +314,7 @@ void KEditParametric::splitEquation( const QString equation, QString &name, QStr expression = equation.section( '=', 1, 1 ); } -QString KEditParametric::yFunction() +TQString KEditParametric::yFunction() { return "y" + kLineEditName->text() + "(t)=" + kLineEditYFunction->text(); } diff --git a/kmplot/kmplot/keditparametric.h b/kmplot/kmplot/keditparametric.h index 0ce5b2d4..334d997a 100644 --- a/kmplot/kmplot/keditparametric.h +++ b/kmplot/kmplot/keditparametric.h @@ -40,7 +40,7 @@ class KEditParametric : public QEditParametric /// @param parser points to the parser instance. /// @param parent points to the parent widget. /// @param name of this instance. - KEditParametric( XParser* parser, QWidget* parent = NULL, const char* name = NULL ); + KEditParametric( XParser* parser, TQWidget* parent = NULL, const char* name = NULL ); /// Nothing special to do. virtual ~KEditParametric() {} @@ -55,11 +55,11 @@ class KEditParametric : public QEditParametric /// Fill the dialog's widgets with values from the parser void setWidgets(); /// Returns the well formed function equation - QString xFunction(); + TQString xFunction(); /// Returns the well formed function equation - QString yFunction(); + TQString yFunction(); /// extract function \a name and \a expression from a given \a equation - void splitEquation( const QString equation, QString &name, QString &expression ); + void splitEquation( const TQString equation, TQString &name, TQString &expression ); /// Pointer to the parser instance. XParser* m_parser; //@{ diff --git a/kmplot/kmplot/keditpolar.cpp b/kmplot/kmplot/keditpolar.cpp index 7499be1a..787e9e32 100644 --- a/kmplot/kmplot/keditpolar.cpp +++ b/kmplot/kmplot/keditpolar.cpp @@ -23,7 +23,7 @@ * */ // Qt includes -#include +#include // KDE includes #include @@ -42,11 +42,11 @@ #include "xparser.h" #include "View.h" -KEditPolar::KEditPolar( XParser* parser, QWidget* parent, const char* name ) : +KEditPolar::KEditPolar( XParser* parser, TQWidget* parent, const char* name ) : QEditPolar( parent, name ),m_parser(parser) { - connect( customMinRange, SIGNAL ( toggled(bool) ), this, SLOT( customMinRange_toggled(bool) ) ); - connect( customMaxRange, SIGNAL ( toggled(bool) ), this, SLOT( customMaxRange_toggled(bool) ) ); + connect( customMinRange, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT( customMinRange_toggled(bool) ) ); + connect( customMaxRange, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT( customMaxRange_toggled(bool) ) ); m_updatedfunction = 0; } @@ -72,7 +72,7 @@ void KEditPolar::clearWidgets() void KEditPolar::setWidgets() { Ufkt *ufkt = &m_parser->ufkt[ m_parser->ixValue(m_id) ]; - QString function = ufkt->fstr; + TQString function = ufkt->fstr; function = function.right( function.length()-1 ); kLineEditYFunction->setText( function ); checkBoxHide->setChecked( !ufkt->f_mode); @@ -98,7 +98,7 @@ void KEditPolar::setWidgets() void KEditPolar::accept() { - QString f_str = /*"r" + */kLineEditYFunction->text(); + TQString f_str = /*"r" + */kLineEditYFunction->text(); if ( m_id!=-1 ) m_parser->fixFunctionName(f_str, XParser::Polar, m_id); @@ -161,7 +161,7 @@ void KEditPolar::accept() return; } added_ufkt = &m_parser->ufkt[ix]; - QString const old_fstr = added_ufkt->fstr; + TQString const old_fstr = added_ufkt->fstr; added_ufkt->fstr = f_str; m_parser->reparse(added_ufkt); //reparse the funcion if ( m_parser->parserError() != 0) diff --git a/kmplot/kmplot/keditpolar.h b/kmplot/kmplot/keditpolar.h index 4189450a..131f2475 100644 --- a/kmplot/kmplot/keditpolar.h +++ b/kmplot/kmplot/keditpolar.h @@ -40,7 +40,7 @@ class KEditPolar : public QEditPolar /// @param parser points to the parser instance. /// @param parent points to the parent widget. /// @param name of this instance. - KEditPolar( XParser* parser, QWidget* parent = NULL, const char* name = NULL ); + KEditPolar( XParser* parser, TQWidget* parent = NULL, const char* name = NULL ); /// Nothing special to do. virtual ~KEditPolar() {} diff --git a/kmplot/kmplot/kminmax.cpp b/kmplot/kmplot/kminmax.cpp index bf4e69a8..3f8db2c8 100644 --- a/kmplot/kmplot/kminmax.cpp +++ b/kmplot/kmplot/kminmax.cpp @@ -28,23 +28,23 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "kminmax.h" #include "xparser.h" -KMinMax::KMinMax(View *v, QWidget *parent, const char *name) +KMinMax::KMinMax(View *v, TQWidget *parent, const char *name) : QMinMax(parent, name), m_view(v) { m_mode=-1; - connect( cmdClose, SIGNAL( clicked() ), this, SLOT( close() )); - connect( cmdFind, SIGNAL( clicked() ), this, SLOT( cmdFind_clicked() )); - connect( cmdParameter, SIGNAL( clicked() ), this, SLOT( cmdParameter_clicked() )); - connect( list, SIGNAL( highlighted(QListBoxItem*) ), this, SLOT( list_highlighted(QListBoxItem*) )); - connect( list, SIGNAL( doubleClicked( QListBoxItem * ) ), this, SLOT( list_doubleClicked(QListBoxItem *) )); + connect( cmdClose, TQT_SIGNAL( clicked() ), this, TQT_SLOT( close() )); + connect( cmdFind, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdFind_clicked() )); + connect( cmdParameter, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdParameter_clicked() )); + connect( list, TQT_SIGNAL( highlighted(TQListBoxItem*) ), this, TQT_SLOT( list_highlighted(TQListBoxItem*) )); + connect( list, TQT_SIGNAL( doubleClicked( TQListBoxItem * ) ), this, TQT_SLOT( list_doubleClicked(TQListBoxItem *) )); parameter=""; } @@ -63,7 +63,7 @@ void KMinMax::init(char m) if ( m_mode < 2) //find minimum point { max->setReadOnly(false); - QString range; + TQString range; range.setNum(View::xmin); min->setText( range); range.setNum(View::xmax); @@ -71,22 +71,22 @@ void KMinMax::init(char m) lblMin->setText(i18n("Search between the x-value:")); lblMax->setText(i18n("and:")); cmdFind->setText(i18n("&Find")); - QToolTip::add(min,i18n("Lower boundary of the plot range")); - QWhatsThis::add(min,i18n("Enter the lower boundary of the plot range. Expressions like 2*pi are allowed, too.")); - QToolTip::add(max,i18n("Upper boundary of the plot range")); - QWhatsThis::add(max,i18n("Enter the upper boundary of the plot range. Expressions like 2*pi are allowed, too.")); + TQToolTip::add(min,i18n("Lower boundary of the plot range")); + TQWhatsThis::add(min,i18n("Enter the lower boundary of the plot range. Expressions like 2*pi are allowed, too.")); + TQToolTip::add(max,i18n("Upper boundary of the plot range")); + TQWhatsThis::add(max,i18n("Enter the upper boundary of the plot range. Expressions like 2*pi are allowed, too.")); if ( m_mode == 1) //find maximum point { setCaption(i18n("Find Maximum Point")); - QToolTip::add( cmdFind, i18n( "Search for the maximum point in the range you specified" ) ); - QWhatsThis::add(cmdFind,i18n("Search for the highest y-value in the x-range you specified and show the result in a message box.")); + TQToolTip::add( cmdFind, i18n( "Search for the maximum point in the range you specified" ) ); + TQWhatsThis::add(cmdFind,i18n("Search for the highest y-value in the x-range you specified and show the result in a message box.")); } else { setCaption(i18n("Find Minimum Point")); - QToolTip::add( cmdFind, i18n( "Search for the minimum point in the range you specified" ) ); - QWhatsThis::add(cmdFind,i18n("Search for the lowest y-value in the x-range you specified and show the result in a message box.")); + TQToolTip::add( cmdFind, i18n( "Search for the minimum point in the range you specified" ) ); + TQWhatsThis::add(cmdFind,i18n("Search for the lowest y-value in the x-range you specified and show the result in a message box.")); } } else if ( m_mode == 2) //get y-value @@ -97,35 +97,35 @@ void KMinMax::init(char m) max->setReadOnly(true); min->setText(""); max->setText(""); - QToolTip::add(min,i18n("Lower boundary of the plot range")); - QWhatsThis::add(min,i18n("Enter the lower boundary of the plot range. Expressions like 2*pi are allowed, too.")); - QToolTip::add(max,i18n("No returned y-value yet")); - QWhatsThis::add(max,i18n("Here you will see the y-value which you got from the x-value in the textbox above. To calculate the y-value, press the Calculate button.")); + TQToolTip::add(min,i18n("Lower boundary of the plot range")); + TQWhatsThis::add(min,i18n("Enter the lower boundary of the plot range. Expressions like 2*pi are allowed, too.")); + TQToolTip::add(max,i18n("No returned y-value yet")); + TQWhatsThis::add(max,i18n("Here you will see the y-value which you got from the x-value in the textbox above. To calculate the y-value, press the Calculate button.")); cmdFind->setText(i18n("&Calculate")); - QToolTip::add( cmdFind, i18n( "Get the y-value from the x-value you typed" ) ); - QWhatsThis::add(cmdFind,i18n("Get the y-value from the x-value you typed and show it in the y-value box.")); + TQToolTip::add( cmdFind, i18n( "Get the y-value from the x-value you typed" ) ); + TQWhatsThis::add(cmdFind,i18n("Get the y-value from the x-value you typed and show it in the y-value box.")); } else if ( m_mode == 3) //area under a graph { max->setReadOnly(false); - QString range; + TQString range; range.setNum(View::xmin); min->setText( range); range.setNum(View::xmax); max->setText(range); - QToolTip::add(min,i18n("Lower boundary of the plot range")); - QWhatsThis::add(min,i18n("Enter the lower boundary of the plot range. Expressions like 2*pi are allowed, too.")); - QToolTip::add(max,i18n("Upper boundary of the plot range")); - QWhatsThis::add(max,i18n("Enter the upper boundary of the plot range. Expressions like 2*pi are allowed, too.")); + TQToolTip::add(min,i18n("Lower boundary of the plot range")); + TQWhatsThis::add(min,i18n("Enter the lower boundary of the plot range. Expressions like 2*pi are allowed, too.")); + TQToolTip::add(max,i18n("Upper boundary of the plot range")); + TQWhatsThis::add(max,i18n("Enter the upper boundary of the plot range. Expressions like 2*pi are allowed, too.")); setCaption(i18n("Calculate Integral")); lblMin->setText(i18n("Calculate the integral between the x-values:")); lblMax->setText(i18n("and:")); cmdFind->setText(i18n("&Calculate")); - QToolTip::add( cmdFind, i18n( "Calculate the integral between the x-values" ) ); - QWhatsThis::add(cmdFind,i18n("Calculate the numeric integral between the x-values and draw the result as an area.")); + TQToolTip::add( cmdFind, i18n( "Calculate the integral between the x-values" ) ); + TQWhatsThis::add(cmdFind,i18n("Calculate the numeric integral between the x-values and draw the result as an area.")); } @@ -135,10 +135,10 @@ void KMinMax::init(char m) void KMinMax::updateFunctions() { - QString const selected_item(list->currentText() ); + TQString const selected_item(list->currentText() ); list->clear(); - for( QValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) { if( it->fname[0] != 'x' && it->fname[0] != 'y' && it->fname[0] != 'r' && !it->fname.isEmpty()) { @@ -147,7 +147,7 @@ void KMinMax::updateFunctions() if ( it->f1_mode ) //1st derivative { - QString function (it->fstr); + TQString function (it->fstr); int i= function.find('('); function.truncate(i); function +="\'"; @@ -155,7 +155,7 @@ void KMinMax::updateFunctions() } if ( it->f2_mode )//2nd derivative { - QString function (it->fstr); + TQString function (it->fstr); int i= function.find('('); function.truncate(i); function +="\'\'"; @@ -163,7 +163,7 @@ void KMinMax::updateFunctions() } if ( it->integral_mode )//integral { - QString function (it->fstr); + TQString function (it->fstr); int i= function.find('('); function.truncate(i); function = function.upper(); @@ -177,7 +177,7 @@ void KMinMax::updateFunctions() else cmdFind->setEnabled(true); selectItem(); - QListBoxItem *found_item = list->findItem(selected_item,Qt::ExactMatch); + TQListBoxItem *found_item = list->findItem(selected_item,Qt::ExactMatch); if ( found_item && m_view->csmode < 0) list->setSelected(found_item,true); } @@ -189,7 +189,7 @@ void KMinMax::selectItem() return; //kdDebug() << "cstype: " << (int)m_view->cstype << endl; Ufkt *ufkt = &m_view->parser()->ufkt[m_view->parser()->ixValue(m_view->csmode)]; - QString function = ufkt->fstr; + TQString function = ufkt->fstr; if ( m_view->cstype == 2) { int i= function.find('('); @@ -203,7 +203,7 @@ void KMinMax::selectItem() function +="\'"; } //kdDebug() << "function: " << function << endl; - QListBoxItem *item = list->findItem(function,Qt::ExactMatch); + TQListBoxItem *item = list->findItem(function,Qt::ExactMatch); list->setSelected(item,true); if ( !ufkt->parameters.isEmpty() ) @@ -256,7 +256,7 @@ void KMinMax::cmdFind_clicked() } - QString function( list->currentText() ); + TQString function( list->currentText() ); char p_mode = 0; if ( function.contains('\'') == 1) { @@ -270,17 +270,17 @@ void KMinMax::cmdFind_clicked() int pos = function.find('\''); function.remove(pos,2); } - else if ( function.at(0).category() == QChar::Letter_Uppercase) + else if ( function.at(0).category() == TQChar::Letter_Uppercase) { p_mode = 3; function.at(0) = function.at(0).lower(); } - QString fname, fstr; + TQString fname, fstr; Ufkt *ufkt = 0; - QString sec_function = function.section('(',0,0); + TQString sec_function = function.section('(',0,0); - for( QValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it != m_view->parser()->ufkt.end(); ++it) { if ( it->fstr.section('(',0,0) == sec_function) { @@ -321,12 +321,12 @@ void KMinMax::cmdFind_clicked() m_view->getYValue(ufkt,p_mode,dmin,dmax,parameter); if ( !m_view->isCalculationStopped() ) { - QString tmp; + TQString tmp; tmp.setNum(dmax); max->setText(tmp); } - QToolTip::add(max,i18n("The returned y-value")); - QWhatsThis::add(max,i18n("Here you see the result of the calculation: the returned y-value you got from the x-value in the textbox above")); + TQToolTip::add(max,i18n("The returned y-value")); + TQWhatsThis::add(max,i18n("Here you see the result of the calculation: the returned y-value you got from the x-value in the textbox above")); } else if ( m_mode == 3) { @@ -343,14 +343,14 @@ void KMinMax::cmdFind_clicked() if ( m_view->isCalculationStopped() ) KMessageBox::error(this,i18n("The operation was cancelled by the user.")); } -void KMinMax::list_highlighted(QListBoxItem* item) +void KMinMax::list_highlighted(TQListBoxItem* item) { if ( !item) { cmdParameter->hide(); return; } - QString function( list->currentText() ); + TQString function( list->currentText() ); char p_mode = 0; if ( function.contains('\'') == 1) { @@ -364,13 +364,13 @@ void KMinMax::list_highlighted(QListBoxItem* item) int pos = function.find('\''); function.remove(pos,2); } - else if ( function.at(0).category() == QChar::Letter_Uppercase) + else if ( function.at(0).category() == TQChar::Letter_Uppercase) { p_mode = 3; function.at(0) = function.at(0).lower(); } - QString const sec_function = function.section('(',0,0); - for(QValueVector::iterator it = m_view->parser()->ufkt.begin(); it!=m_view->parser()->ufkt.end(); ++it) + TQString const sec_function = function.section('(',0,0); + for(TQValueVector::iterator it = m_view->parser()->ufkt.begin(); it!=m_view->parser()->ufkt.end(); ++it) { if ( it->fstr.section('(',0,0) == sec_function) { @@ -388,7 +388,7 @@ void KMinMax::list_highlighted(QListBoxItem* item) } void KMinMax::cmdParameter_clicked() { - QString function( list->currentText() ); + TQString function( list->currentText() ); char p_mode = 0; if ( function.contains('\'') == 1) { @@ -402,22 +402,22 @@ void KMinMax::cmdParameter_clicked() int pos = function.find('\''); function.remove(pos,2); } - else if ( function.at(0).category() == QChar::Letter_Uppercase) + else if ( function.at(0).category() == TQChar::Letter_Uppercase) { p_mode = 3; function.at(0) = function.at(0).lower(); } - QString const sec_function = function.section('(',0,0); - for(QValueVector::iterator it = m_view->parser()->ufkt.begin() ; it!=m_view->parser()->ufkt.end(); ++it) + TQString const sec_function = function.section('(',0,0); + for(TQValueVector::iterator it = m_view->parser()->ufkt.begin() ; it!=m_view->parser()->ufkt.end(); ++it) { if ( it->fstr.section('(',0,0) == sec_function) { - QStringList str_parameters; - for ( QValueList::Iterator k = it->parameters.begin(); k != it->parameters.end(); ++k ) + TQStringList str_parameters; + for ( TQValueList::Iterator k = it->parameters.begin(); k != it->parameters.end(); ++k ) str_parameters.append( (*k).expression); bool ok; - QStringList result = KInputDialog::getItemList( i18n("Choose Parameter"), i18n("Choose a parameter to use:"), str_parameters, QStringList(parameter),false,&ok,this ); + TQStringList result = KInputDialog::getItemList( i18n("Choose Parameter"), i18n("Choose a parameter to use:"), str_parameters, TQStringList(parameter),false,&ok,this ); if ( ok) parameter = result.first(); break; @@ -425,7 +425,7 @@ void KMinMax::cmdParameter_clicked() } } -void KMinMax::list_doubleClicked(QListBoxItem *) +void KMinMax::list_doubleClicked(TQListBoxItem *) { if ( list->currentItem() == -1) return; diff --git a/kmplot/kmplot/kminmax.h b/kmplot/kmplot/kminmax.h index 3b818758..e564b6f5 100644 --- a/kmplot/kmplot/kminmax.h +++ b/kmplot/kmplot/kminmax.h @@ -37,7 +37,7 @@ class KMinMax : public QMinMax { Q_OBJECT public: - KMinMax(View *, QWidget *parent = 0, const char *name = 0); + KMinMax(View *, TQWidget *parent = 0, const char *name = 0); /// called every time the dialog is opened void init(char); /// update the list with functions @@ -53,14 +53,14 @@ public slots: /// the selecting a function that uses parameter function from a list the user can choose which paramater value he/she wants to use void cmdParameter_clicked(); /// the button for changing the selected parameter value - void list_highlighted(QListBoxItem*); + void list_highlighted(TQListBoxItem*); /// call cmdParameter_clicked() if parameter values is enabled for that function - void list_doubleClicked(QListBoxItem *); + void list_doubleClicked(TQListBoxItem *); private: View *m_view; char m_mode; //< 0 = minimum, 1 = maximum, 2 = y-point, 3=drawing area - QString parameter; + TQString parameter; }; diff --git a/kmplot/kmplot/kmplot.cpp b/kmplot/kmplot/kmplot.cpp index 3b0e8b3c..e6f71013 100644 --- a/kmplot/kmplot/kmplot.cpp +++ b/kmplot/kmplot/kmplot.cpp @@ -82,7 +82,7 @@ KmPlot::KmPlot( KCmdLineArgs* args) } if (!initialGeometrySet()) - resize( QSize(450, 520).expandedTo(minimumSizeHint())); + resize( TQSize(450, 520).expandedTo(minimumSizeHint())); // apply the saved mainwindow settings, if any, and ask the mainwindow // to automatically save settings if changed: window size, toolbar @@ -135,18 +135,18 @@ bool KmPlot::load(const KURL& url) void KmPlot::setupActions() { - KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); - KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection()); + KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection()); m_fullScreen = KStdAction::fullScreen( NULL, NULL, actionCollection(), this, "fullscreen"); - connect( m_fullScreen, SIGNAL( toggled( bool )), this, SLOT( slotUpdateFullScreen( bool ))); + connect( m_fullScreen, TQT_SIGNAL( toggled( bool )), this, TQT_SLOT( slotUpdateFullScreen( bool ))); } void KmPlot::saveProperties(KConfig* /*config*/) @@ -210,7 +210,7 @@ void KmPlot::optionsConfigureToolbars() saveMainWindowSettings(KGlobal::config() ); // use the standard toolbar editor KEditToolbar dlg(factory()); - connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(applyNewToolbarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(applyNewToolbarConfig())); dlg.exec(); } @@ -224,7 +224,7 @@ void KmPlot::fileOpen() // this slot is called whenever the File->Open menu is selected, // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar // button is clicked - KURL const url = KFileDialog::getOpenURL( QDir::currentDirPath(), + KURL const url = KFileDialog::getOpenURL( TQDir::currentDirPath(), i18n( "*.fkt|KmPlot Files (*.fkt)\n*.*|All Files" ), this, i18n( "Open" ) ); if ( !url.isEmpty()) @@ -263,22 +263,22 @@ void KmPlot::openFileInNewWindow(const KURL url) bool KmPlot::checkModified() { - QCString replyType; - QByteArray replyData; - kapp->dcopClient()->call(kapp->dcopClient()->appId(), "MainDlg","checkModified()", QByteArray(), replyType, replyData, false); + TQCString replyType; + TQByteArray replyData; + kapp->dcopClient()->call(kapp->dcopClient()->appId(), "MainDlg","checkModified()", TQByteArray(), replyType, replyData, false); bool result; - QDataStream stream(replyData, IO_ReadOnly); + TQDataStream stream(replyData, IO_ReadOnly); stream >> result; return result; } bool KmPlot::isModified() { - QCString replyType; - QByteArray replyData; - kapp->dcopClient()->call(kapp->dcopClient()->appId(), "MainDlg","isModified()", QByteArray(), replyType, replyData, false); + TQCString replyType; + TQByteArray replyData; + kapp->dcopClient()->call(kapp->dcopClient()->appId(), "MainDlg","isModified()", TQByteArray(), replyType, replyData, false); bool result; - QDataStream stream(replyData, IO_ReadOnly); + TQDataStream stream(replyData, IO_ReadOnly); stream >> result; return result; } @@ -288,7 +288,7 @@ bool KmPlot::queryClose() return checkModified(); } -void KmPlot::setStatusBarText(const QString &text, int id) +void KmPlot::setStatusBarText(const TQString &text, int id) { statusBar()->changeItem(text,id); } @@ -306,13 +306,13 @@ void KmPlot::setupStatusBar() m_progressbar = new KmPlotProgress( statusBar() ); m_progressbar->setMaximumHeight( statusBar()->height()-10 ); - connect( m_progressbar->button, SIGNAL (clicked() ), this, SLOT( progressbar_clicked() ) ); + connect( m_progressbar->button, TQT_SIGNAL (clicked() ), this, TQT_SLOT( progressbar_clicked() ) ); statusBar()->addWidget(m_progressbar); } void KmPlot::progressbar_clicked() { - kapp->dcopClient()->send(kapp->dcopClient()->appId(), "View","stopDrawing()", QByteArray()); + kapp->dcopClient()->send(kapp->dcopClient()->appId(), "View","stopDrawing()", TQByteArray()); } #include "kmplot.moc" diff --git a/kmplot/kmplot/kmplot.h b/kmplot/kmplot/kmplot.h index b2cf4242..bb861f49 100644 --- a/kmplot/kmplot/kmplot.h +++ b/kmplot/kmplot/kmplot.h @@ -96,7 +96,7 @@ private slots: public slots: /// Called when fullscren is enabled/disabled void slotUpdateFullScreen(bool); - void setStatusBarText(const QString &, int id); + void setStatusBarText(const TQString &, int id); private: void setupAccel(); diff --git a/kmplot/kmplot/kmplotIface.h b/kmplot/kmplot/kmplotIface.h index b176b944..b640b5ce 100644 --- a/kmplot/kmplot/kmplotIface.h +++ b/kmplot/kmplot/kmplotIface.h @@ -39,7 +39,7 @@ class KmPlotIface : virtual public DCOPObject K_DCOP k_dcop: virtual void fileOpen() = 0; - virtual void setStatusBarText(const QString &text, int id) = 0; + virtual void setStatusBarText(const TQString &text, int id) = 0; virtual void optionsConfigureKeys() = 0; virtual void optionsConfigureToolbars() = 0; virtual void openFileInNewWindow(const KURL url) = 0; diff --git a/kmplot/kmplot/kmplotio.cpp b/kmplot/kmplot/kmplotio.cpp index 1af28e25..9a5288a8 100644 --- a/kmplot/kmplot/kmplotio.cpp +++ b/kmplot/kmplot/kmplotio.cpp @@ -24,8 +24,8 @@ */ // Qt includes -#include -#include +#include +#include // KDE includes #include @@ -54,14 +54,14 @@ KmPlotIO::~KmPlotIO() bool KmPlotIO::save( const KURL &url ) { // saving as xml by a QDomDocument - QDomDocument doc( "kmpdoc" ); + TQDomDocument doc( "kmpdoc" ); // the root tag - QDomElement root = doc.createElement( "kmpdoc" ); + TQDomElement root = doc.createElement( "kmpdoc" ); root.setAttribute( "version", "2" ); doc.appendChild( root ); // the axes tag - QDomElement tag = doc.createElement( "axes" ); + TQDomElement tag = doc.createElement( "axes" ); tag.setAttribute( "color", Settings::axesColor().name() ); tag.setAttribute( "width", Settings::axesLineWidth() ); @@ -74,14 +74,14 @@ bool KmPlotIO::save( const KURL &url ) addTag( doc, tag, "show-frame", Settings::showExtraFrame() ? "1" : "-1" ); addTag( doc, tag, "show-extra-frame", Settings::showExtraFrame() ? "1" : "-1" ); - addTag( doc, tag, "xcoord", QString::number( Settings::xRange() ) ); + addTag( doc, tag, "xcoord", TQString::number( Settings::xRange() ) ); if( Settings::xRange() == 4 ) // custom plot range { addTag( doc, tag, "xmin", Settings::xMin() ); addTag( doc, tag, "xmax", Settings::xMax() ); } - addTag( doc, tag, "ycoord", QString::number( Settings::yRange() ) ); + addTag( doc, tag, "ycoord", TQString::number( Settings::yRange() ) ); if( Settings::yRange() == 4 ) // custom plot range { addTag( doc, tag, "ymin", Settings::yMin() ); @@ -95,13 +95,13 @@ bool KmPlotIO::save( const KURL &url ) tag.setAttribute( "color", Settings::gridColor().name() ); tag.setAttribute( "width", Settings::gridLineWidth() ); - addTag( doc, tag, "mode", QString::number( Settings::gridStyle() ) ); + addTag( doc, tag, "mode", TQString::number( Settings::gridStyle() ) ); root.appendChild( tag ); tag = doc.createElement( "scale" ); - QString temp; + TQString temp; temp.setNum(Settings::xScaling()); addTag( doc, tag, "tic-x", temp ); temp.setNum(Settings::yScaling()); @@ -114,7 +114,7 @@ bool KmPlotIO::save( const KURL &url ) root.appendChild( tag ); - for( QValueVector::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it) + for( TQValueVector::iterator it = m_parser->ufkt.begin(); it != m_parser->ufkt.end(); ++it) { if ( !it->fstr.isEmpty() ) { @@ -122,28 +122,28 @@ bool KmPlotIO::save( const KURL &url ) //tag.setAttribute( "number", ix ); tag.setAttribute( "visible", it->f_mode ); - tag.setAttribute( "color", QColor( it->color ).name() ); + tag.setAttribute( "color", TQColor( it->color ).name() ); tag.setAttribute( "width", it->linewidth ); tag.setAttribute( "use-slider", it->use_slider ); if ( it->f1_mode) { tag.setAttribute( "visible-deriv", it->f1_mode ); - tag.setAttribute( "deriv-color", QColor( it->f1_color ).name() ); + tag.setAttribute( "deriv-color", TQColor( it->f1_color ).name() ); tag.setAttribute( "deriv-width", it->f1_linewidth ); } if ( it->f2_mode) { tag.setAttribute( "visible-2nd-deriv", it->f2_mode ); - tag.setAttribute( "deriv2nd-color", QColor( it->f2_color ).name() ); + tag.setAttribute( "deriv2nd-color", TQColor( it->f2_color ).name() ); tag.setAttribute( "deriv2nd-width", it->f2_linewidth ); } if ( it->integral_mode) { tag.setAttribute( "visible-integral", "1" ); - tag.setAttribute( "integral-color", QColor( it->integral_color ).name() ); + tag.setAttribute( "integral-color", TQColor( it->integral_color ).name() ); tag.setAttribute( "integral-width", it->integral_linewidth ); tag.setAttribute( "integral-use-precision", it->integral_use_precision ); tag.setAttribute( "integral-precision", it->integral_precision ); @@ -153,8 +153,8 @@ bool KmPlotIO::save( const KURL &url ) addTag( doc, tag, "equation", it->fstr ); - QStringList str_parameters; - for ( QValueList::Iterator k = it->parameters.begin(); k != it->parameters.end(); ++k ) + TQStringList str_parameters; + for ( TQValueList::Iterator k = it->parameters.begin(); k != it->parameters.end(); ++k ) str_parameters.append( (*k).expression); if( !str_parameters.isEmpty() ) @@ -175,7 +175,7 @@ bool KmPlotIO::save( const KURL &url ) addTag( doc, tag, "header-table-font", Settings::headerTableFont() ); root.appendChild( tag ); - QFile xmlfile; + TQFile xmlfile; if (!url.isLocalFile() ) { KTempFile tmpfile; @@ -185,7 +185,7 @@ bool KmPlotIO::save( const KURL &url ) tmpfile.unlink(); return false; } - QTextStream ts( &xmlfile ); + TQTextStream ts( &xmlfile ); doc.save( ts, 4 ); xmlfile.close(); @@ -201,7 +201,7 @@ bool KmPlotIO::save( const KURL &url ) xmlfile.setName(url.prettyURL(0,KURL::StripFileProtocol) ); if (!xmlfile.open( IO_WriteOnly ) ) return false; - QTextStream ts( &xmlfile ); + TQTextStream ts( &xmlfile ); doc.save( ts, 4 ); xmlfile.close(); return true; @@ -210,18 +210,18 @@ bool KmPlotIO::save( const KURL &url ) } -void KmPlotIO::addTag( QDomDocument &doc, QDomElement &parentTag, const QString tagName, const QString tagValue ) +void KmPlotIO::addTag( TQDomDocument &doc, TQDomElement &parentTag, const TQString tagName, const TQString tagValue ) { - QDomElement tag = doc.createElement( tagName ); - QDomText value = doc.createTextNode( tagValue ); + TQDomElement tag = doc.createElement( tagName ); + TQDomText value = doc.createTextNode( tagValue ); tag.appendChild( value ); parentTag.appendChild( tag ); } bool KmPlotIO::load( const KURL &url ) { - QDomDocument doc( "kmpdoc" ); - QFile f; + TQDomDocument doc( "kmpdoc" ); + TQFile f; if ( !url.isLocalFile() ) { if( !KIO::NetAccess::exists( url, true, 0 ) ) @@ -229,7 +229,7 @@ bool KmPlotIO::load( const KURL &url ) KMessageBox::error(0,i18n("The file does not exist.")); return false; } - QString tmpfile; + TQString tmpfile; if( !KIO::NetAccess::download( url, tmpfile, 0 ) ) { KMessageBox::error(0,i18n("An error appeared when opening this file")); @@ -253,12 +253,12 @@ bool KmPlotIO::load( const KURL &url ) } f.close(); - QDomElement element = doc.documentElement(); - QString version = element.attribute( "version" ); + TQDomElement element = doc.documentElement(); + TQString version = element.attribute( "version" ); if ( version.isNull()) //an old kmplot-file { MainDlg::oldfileversion = true; - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { if ( n.nodeName() == "axes" ) oldParseAxes( n.toElement() ); @@ -273,7 +273,7 @@ bool KmPlotIO::load( const KURL &url ) else if (version == "1" || version == "2") { MainDlg::oldfileversion = false; - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { if ( n.nodeName() == "axes" ) parseAxes( n.toElement() ); @@ -293,10 +293,10 @@ bool KmPlotIO::load( const KURL &url ) return true; } -void KmPlotIO::parseAxes( const QDomElement &n ) +void KmPlotIO::parseAxes( const TQDomElement &n ) { Settings::setAxesLineWidth( n.attribute( "width", "1" ).toInt() ); - Settings::setAxesColor( QColor( n.attribute( "color", "#000000" ) ) ); + Settings::setAxesColor( TQColor( n.attribute( "color", "#000000" ) ) ); Settings::setTicWidth( n.attribute( "tic-width", "3" ).toInt() ); Settings::setTicLength( n.attribute( "tic-length", "10" ).toInt() ); @@ -313,17 +313,17 @@ void KmPlotIO::parseAxes( const QDomElement &n ) Settings::setYMax( n.namedItem( "ymax" ).toElement().text() ); } -void KmPlotIO::parseGrid( const QDomElement & n ) +void KmPlotIO::parseGrid( const TQDomElement & n ) { - Settings::setGridColor( QColor( n.attribute( "color", "#c0c0c0" ) ) ); + Settings::setGridColor( TQColor( n.attribute( "color", "#c0c0c0" ) ) ); Settings::setGridLineWidth( n.attribute( "width", "1" ).toInt() ); Settings::setGridStyle( n.namedItem( "mode" ).toElement().text().toInt() ); } -int unit2index( const QString unit ) +int unit2index( const TQString unit ) { - QString units[ 9 ] = { "10", "5", "2", "1", "0.5", "pi/2", "pi/3", "pi/4",i18n("automatic") }; + TQString units[ 9 ] = { "10", "5", "2", "1", "0.5", "pi/2", "pi/3", "pi/4",i18n("automatic") }; int index = 0; while( ( index < 9 ) && ( unit!= units[ index ] ) ) index ++; if( index == 9 ) index = -1; @@ -331,7 +331,7 @@ int unit2index( const QString unit ) } -void KmPlotIO::parseScale(const QDomElement & n ) +void KmPlotIO::parseScale(const TQDomElement & n ) { Settings::setXScaling( n.namedItem( "tic-x" ).toElement().text().toInt() ); Settings::setYScaling( n.namedItem( "tic-y" ).toElement().text().toInt() ); @@ -339,15 +339,15 @@ void KmPlotIO::parseScale(const QDomElement & n ) Settings::setYPrinting( n.namedItem( "print-tic-y" ).toElement().text().toInt() ); } -void KmPlotIO::parseFunction( XParser *m_parser, const QDomElement & n ) +void KmPlotIO::parseFunction( XParser *m_parser, const TQDomElement & n ) { - QString temp; + TQString temp; Ufkt ufkt; m_parser->prepareAddingFunction(&ufkt); int const next_index=m_parser->getNextIndex()+1; ufkt.f_mode = n.attribute( "visible" ).toInt(); - ufkt.color = QColor( n.attribute( "color" ) ).rgb(); + ufkt.color = TQColor( n.attribute( "color" ) ).rgb(); ufkt.linewidth = n.attribute( "width" ).toInt(); ufkt.use_slider = n.attribute( "use-slider" ).toInt(); @@ -355,7 +355,7 @@ void KmPlotIO::parseFunction( XParser *m_parser, const QDomElement & n ) if (!temp.isNull()) { ufkt.f1_mode = temp.toInt(); - ufkt.f1_color = QColor(n.attribute( "deriv-color" )).rgb(); + ufkt.f1_color = TQColor(n.attribute( "deriv-color" )).rgb(); ufkt.f1_linewidth = n.attribute( "deriv-width" ).toInt(); } else @@ -369,7 +369,7 @@ void KmPlotIO::parseFunction( XParser *m_parser, const QDomElement & n ) if (!temp.isNull()) { ufkt.f2_mode = temp.toInt(); - ufkt.f2_color = QColor(n.attribute( "deriv2nd-color" )).rgb(); + ufkt.f2_color = TQColor(n.attribute( "deriv2nd-color" )).rgb(); ufkt.f2_linewidth = n.attribute( "deriv2nd-width" ).toInt(); } else @@ -383,7 +383,7 @@ void KmPlotIO::parseFunction( XParser *m_parser, const QDomElement & n ) if (!temp.isNull()) { ufkt.integral_mode = temp.toInt(); - ufkt.integral_color = QColor(n.attribute( "integral-color" )).rgb(); + ufkt.integral_color = TQColor(n.attribute( "integral-color" )).rgb(); ufkt.integral_linewidth = n.attribute( "integral-width" ).toInt(); ufkt.integral_use_precision = n.attribute( "integral-use-precision" ).toInt(); ufkt.integral_precision = n.attribute( "integral-precision" ).toInt(); @@ -432,11 +432,11 @@ void KmPlotIO::parseFunction( XParser *m_parser, const QDomElement & n ) else parseParameters( m_parser, n, ufkt ); - QString fstr = ufkt.fstr; + TQString fstr = ufkt.fstr; if ( !fstr.isEmpty() ) { int const i = fstr.find( ';' ); - QString str; + TQString str; if ( i == -1 ) str = fstr; else @@ -473,27 +473,27 @@ void KmPlotIO::parseFunction( XParser *m_parser, const QDomElement & n ) } } -void KmPlotIO::parseParameters( XParser *m_parser, const QDomElement &n, Ufkt &ufkt ) +void KmPlotIO::parseParameters( XParser *m_parser, const TQDomElement &n, Ufkt &ufkt ) { - QStringList str_parameters; - for ( QValueList::Iterator it = ufkt.parameters.begin(); it != ufkt.parameters.end(); ++it ) + TQStringList str_parameters; + for ( TQValueList::Iterator it = ufkt.parameters.begin(); it != ufkt.parameters.end(); ++it ) str_parameters.append( (*it).expression); - str_parameters = QStringList::split( ";", n.namedItem( "parameterlist" ).toElement().text() ); - for( QStringList::Iterator it = str_parameters.begin(); it != str_parameters.end(); ++it ) + str_parameters = TQStringList::split( ";", n.namedItem( "parameterlist" ).toElement().text() ); + for( TQStringList::Iterator it = str_parameters.begin(); it != str_parameters.end(); ++it ) ufkt.parameters.append( ParameterValueItem( *it, m_parser->eval( *it ) )); } -void KmPlotIO::parseThreeDotThreeParameters( XParser *m_parser, const QDomElement &n, Ufkt &ufkt ) +void KmPlotIO::parseThreeDotThreeParameters( XParser *m_parser, const TQDomElement &n, Ufkt &ufkt ) { - QStringList str_parameters; - for ( QValueList::Iterator it = ufkt.parameters.begin(); it != ufkt.parameters.end(); ++it ) + TQStringList str_parameters; + for ( TQValueList::Iterator it = ufkt.parameters.begin(); it != ufkt.parameters.end(); ++it ) str_parameters.append( (*it).expression); - str_parameters = QStringList::split( ",", n.namedItem( "parameterlist" ).toElement().text() ); - for( QStringList::Iterator it = str_parameters.begin(); it != str_parameters.end(); ++it ) + str_parameters = TQStringList::split( ",", n.namedItem( "parameterlist" ).toElement().text() ); + for( TQStringList::Iterator it = str_parameters.begin(); it != str_parameters.end(); ++it ) ufkt.parameters.append( ParameterValueItem( *it, m_parser->eval( *it ) )); } -void KmPlotIO::oldParseFunction( XParser *m_parser, const QDomElement & n ) +void KmPlotIO::oldParseFunction( XParser *m_parser, const TQDomElement & n ) { kdDebug() << "parsing old function" << endl; Ufkt ufkt; @@ -505,7 +505,7 @@ void KmPlotIO::oldParseFunction( XParser *m_parser, const QDomElement & n ) ufkt.f2_mode = 0; ufkt.linewidth = n.attribute( "width" ).toInt(); ufkt.use_slider = -1; - ufkt.color = ufkt.f1_color = ufkt.f2_color = ufkt.integral_color = QColor( n.attribute( "color" ) ).rgb(); + ufkt.color = ufkt.f1_color = ufkt.f2_color = ufkt.integral_color = TQColor( n.attribute( "color" ) ).rgb(); ufkt.str_dmin = n.namedItem( "arg-min" ).toElement().text(); if( ufkt.str_dmin.isEmpty() ) @@ -529,7 +529,7 @@ void KmPlotIO::oldParseFunction( XParser *m_parser, const QDomElement & n ) ufkt.usecustomxmax = false; } - const QString tmp_fstr = n.namedItem( "equation" ).toElement().text(); + const TQString tmp_fstr = n.namedItem( "equation" ).toElement().text(); const int pos = tmp_fstr.find(';'); if ( pos == -1 ) ufkt.fstr = tmp_fstr; @@ -543,11 +543,11 @@ void KmPlotIO::oldParseFunction( XParser *m_parser, const QDomElement & n ) } } - QString fstr = ufkt.fstr; + TQString fstr = ufkt.fstr; if ( !fstr.isEmpty() ) { int const i = fstr.find( ';' ); - QString str; + TQString str; if ( i == -1 ) str = fstr; else @@ -584,10 +584,10 @@ void KmPlotIO::oldParseFunction( XParser *m_parser, const QDomElement & n ) } } -void KmPlotIO::oldParseAxes( const QDomElement &n ) +void KmPlotIO::oldParseAxes( const TQDomElement &n ) { Settings::setAxesLineWidth( n.attribute( "width", "1" ).toInt() ); - Settings::setAxesColor( QColor( n.attribute( "color", "#000000" ) ) ); + Settings::setAxesColor( TQColor( n.attribute( "color", "#000000" ) ) ); Settings::setTicWidth( n.attribute( "tic-width", "3" ).toInt() ); Settings::setTicLength( n.attribute( "tic-length", "10" ).toInt() ); @@ -604,7 +604,7 @@ void KmPlotIO::oldParseAxes( const QDomElement &n ) Settings::setYMax( n.namedItem( "ymax" ).toElement().text() ); } -void KmPlotIO::oldParseScale( const QDomElement & n ) +void KmPlotIO::oldParseScale( const TQDomElement & n ) { Settings::setXScaling( unit2index( n.namedItem( "tic-x" ).toElement().text() ) ); Settings::setYScaling( unit2index( n.namedItem( "tic-y" ).toElement().text() ) ); diff --git a/kmplot/kmplot/kmplotio.h b/kmplot/kmplot/kmplotio.h index 837cf4ec..8fac662e 100644 --- a/kmplot/kmplot/kmplotio.h +++ b/kmplot/kmplot/kmplotio.h @@ -64,36 +64,36 @@ class KmPlotIO * @param tagName The Name of the tag. * @param tagValue The data between the opening and cloding tag. */ - void addTag( QDomDocument &doc, QDomElement &parentTag, const QString tagName, const QString tagValue ); + void addTag( TQDomDocument &doc, TQDomElement &parentTag, const TQString tagName, const TQString tagValue ); /// Reads axes parameters from the node @a n. /// @param n Node containing the options. - void parseAxes( const QDomElement &n ); + void parseAxes( const TQDomElement &n ); /// Reads grid parameters from the node @a n. /// @param n Node containing the options. - void parseGrid( const QDomElement &n ); + void parseGrid( const TQDomElement &n ); /// Reads scale parameters from the node @a n. /// @param n Node containing the options. - void parseScale( const QDomElement &n ); + void parseScale( const TQDomElement &n ); /// Reads function parameters from the node @a n. /// @param parser points to the parser instance. /// @param n Node containing the options. - void parseFunction( XParser *parser, const QDomElement &n ); + void parseFunction( XParser *parser, const TQDomElement &n ); /// Reads parameter values for a function from the node @a n. /// @param parser points to the parser instance. /// @param n Node containing the options. /// @param ix Function index in the parser instance - void parseParameters( XParser *parser, const QDomElement &n, Ufkt &ufkt); + void parseParameters( XParser *parser, const TQDomElement &n, Ufkt &ufkt); /// For KDE 3.3 - void parseThreeDotThreeParameters( XParser *parser, const QDomElement &n, Ufkt &ufkt); + void parseThreeDotThreeParameters( XParser *parser, const TQDomElement &n, Ufkt &ufkt); ///For KDE <3.3 /// This is the same as parseScale but is made for old Kmplot-files - void oldParseScale( const QDomElement & n ); + void oldParseScale( const TQDomElement & n ); /// This is the same as parseFunction but is made for old Kmplot-files - void oldParseFunction( XParser *parser, const QDomElement &n ); + void oldParseFunction( XParser *parser, const TQDomElement &n ); /// This is the same as parseAxes but is made for old Kmplot-files - void oldParseAxes( const QDomElement &n ); + void oldParseAxes( const TQDomElement &n ); XParser *m_parser; diff --git a/kmplot/kmplot/kmplotprogress.cpp b/kmplot/kmplot/kmplotprogress.cpp index 721480e0..c470c8ba 100644 --- a/kmplot/kmplot/kmplotprogress.cpp +++ b/kmplot/kmplot/kmplotprogress.cpp @@ -29,15 +29,15 @@ #include "kmplotprogress.h" //#include "kmplotprogress.moc.cpp" -KmPlotProgress::KmPlotProgress( QWidget* parent, const char* name ) : QWidget( parent, name) +KmPlotProgress::KmPlotProgress( TQWidget* parent, const char* name ) : TQWidget( parent, name) { button = new KPushButton(this); button->setPixmap( SmallIcon( "cancel" ) ); - button->setGeometry( QRect( 0, 0, 30, 23 ) ); + button->setGeometry( TQRect( 0, 0, 30, 23 ) ); button->setMaximumHeight(height()-10); progress = new KProgress(this); - progress->setGeometry( QRect( 30, 0, 124, 23 ) ); + progress->setGeometry( TQRect( 30, 0, 124, 23 ) ); progress->setMaximumHeight(height()-10); hide(); diff --git a/kmplot/kmplot/kmplotprogress.h b/kmplot/kmplot/kmplotprogress.h index dc7bb166..c4a039f9 100644 --- a/kmplot/kmplot/kmplotprogress.h +++ b/kmplot/kmplot/kmplotprogress.h @@ -27,14 +27,14 @@ #include #include -#include +#include /// The progress-widget in the statusbar which appears when drawing integrals class KmPlotProgress: public QWidget { Q_OBJECT public: - KmPlotProgress( QWidget* parent = 0, const char* name = 0 ); + KmPlotProgress( TQWidget* parent = 0, const char* name = 0 ); ~KmPlotProgress(); void increase(); diff --git a/kmplot/kmplot/kparametereditor.cpp b/kmplot/kmplot/kparametereditor.cpp index 95b4a0c5..325241e9 100644 --- a/kmplot/kmplot/kparametereditor.cpp +++ b/kmplot/kmplot/kparametereditor.cpp @@ -34,36 +34,36 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "kparametereditor.h" class ParameterValueList; -KParameterEditor::KParameterEditor(XParser *m, QValueList *l, QWidget *parent, const char *name) +KParameterEditor::KParameterEditor(XParser *m, TQValueList *l, TQWidget *parent, const char *name) : QParameterEditor(parent,name, true, Qt::WDestructiveClose), m_parameter(l), m_parser(m) { - for ( QValueList::Iterator it = m_parameter->begin(); it != m_parameter->end(); ++it ) + for ( TQValueList::Iterator it = m_parameter->begin(); it != m_parameter->end(); ++it ) list->insertItem( (*it).expression ); list->sort(); - connect( cmdNew, SIGNAL( clicked() ), this, SLOT( cmdNew_clicked() )); - connect( cmdEdit, SIGNAL( clicked() ), this, SLOT( cmdEdit_clicked() )); - connect( cmdDelete, SIGNAL( clicked() ), this, SLOT( cmdDelete_clicked() )); - connect( cmdImport, SIGNAL( clicked() ), this, SLOT( cmdImport_clicked() )); - connect( cmdExport, SIGNAL( clicked() ), this, SLOT( cmdExport_clicked() )); - connect( cmdClose, SIGNAL( clicked() ), this, SLOT( close() )); - connect( list, SIGNAL( doubleClicked( QListBoxItem * ) ), this, SLOT( varlist_doubleClicked( QListBoxItem *) )); - connect( list, SIGNAL( clicked ( QListBoxItem * ) ), this, SLOT( varlist_clicked(QListBoxItem * ) )); + connect( cmdNew, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdNew_clicked() )); + connect( cmdEdit, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdEdit_clicked() )); + connect( cmdDelete, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdDelete_clicked() )); + connect( cmdImport, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdImport_clicked() )); + connect( cmdExport, TQT_SIGNAL( clicked() ), this, TQT_SLOT( cmdExport_clicked() )); + connect( cmdClose, TQT_SIGNAL( clicked() ), this, TQT_SLOT( close() )); + connect( list, TQT_SIGNAL( doubleClicked( TQListBoxItem * ) ), this, TQT_SLOT( varlist_doubleClicked( TQListBoxItem *) )); + connect( list, TQT_SIGNAL( clicked ( TQListBoxItem * ) ), this, TQT_SLOT( varlist_clicked(TQListBoxItem * ) )); } KParameterEditor::~KParameterEditor() { m_parameter->clear(); - QString item_text; + TQString item_text; for (int i = 0; (uint)i <= list->count();i++) { item_text = list->text(i); @@ -74,7 +74,7 @@ KParameterEditor::~KParameterEditor() void KParameterEditor::cmdNew_clicked() { - QString result=""; + TQString result=""; while (1) { bool ok; @@ -100,7 +100,7 @@ void KParameterEditor::cmdNew_clicked() void KParameterEditor::cmdEdit_clicked() { - QString result=list->currentText(); + TQString result=list->currentText(); while (1) { bool ok; @@ -134,7 +134,7 @@ void KParameterEditor::cmdDelete_clicked() void KParameterEditor::cmdImport_clicked() { - KURL url = KFileDialog::getOpenURL( QString::null,i18n("*.txt|Plain Text File ")); + KURL url = KFileDialog::getOpenURL( TQString::null,i18n("*.txt|Plain Text File ")); if ( url.isEmpty() ) return; @@ -145,8 +145,8 @@ void KParameterEditor::cmdImport_clicked() } bool verbose = false; - QFile file; - QString tmpfile; + TQFile file; + TQString tmpfile; if ( !url.isLocalFile() ) { if ( !KIO::NetAccess::download(url, tmpfile, this) ) @@ -161,8 +161,8 @@ void KParameterEditor::cmdImport_clicked() if ( file.open(IO_ReadOnly) ) { - QTextStream stream(&file); - QString line; + TQTextStream stream(&file); + TQString line; for( int i=1; !stream.atEnd();i++ ) { line = stream.readLine(); @@ -185,7 +185,7 @@ void KParameterEditor::cmdImport_clicked() KIO::NetAccess::removeTempFile( tmpfile ); return; } - else if (KMessageBox::warningYesNo(this,i18n("Would you like to be informed about other lines that cannot be read?"), QString::null, i18n("Get Informed"), i18n("Ignore Information") ) == KMessageBox::No) + else if (KMessageBox::warningYesNo(this,i18n("Would you like to be informed about other lines that cannot be read?"), TQString::null, i18n("Get Informed"), i18n("Ignore Information") ) == KMessageBox::No) verbose = true; } } @@ -202,14 +202,14 @@ void KParameterEditor::cmdExport_clicked() { if ( !list->count() ) return; - KURL url = KFileDialog::getSaveURL( QString::null,i18n("*.txt|Plain Text File ")); + KURL url = KFileDialog::getSaveURL( TQString::null,i18n("*.txt|Plain Text File ")); if ( url.isEmpty() ) return; if( !KIO::NetAccess::exists( url,false,this ) || KMessageBox::warningContinueCancel( this, i18n( "A file named \"%1\" already exists. Are you sure you want to continue and overwrite this file?" ).arg( url.url()), i18n( "Overwrite File?" ), KGuiItem( i18n( "&Overwrite" ) ) ) == KMessageBox::Continue ) { - QString tmpfile; - QFile file; + TQString tmpfile; + TQFile file; if ( !url.isLocalFile() ) { KTempFile tmpfile; @@ -217,8 +217,8 @@ void KParameterEditor::cmdExport_clicked() if (file.open( IO_WriteOnly ) ) { - QTextStream stream(&file); - QListBoxItem *it = list->firstItem(); + TQTextStream stream(&file); + TQListBoxItem *it = list->firstItem(); while ( 1 ) { stream << it->text(); @@ -246,8 +246,8 @@ void KParameterEditor::cmdExport_clicked() file.setName(url.prettyURL(0,KURL::StripFileProtocol)); if (file.open( IO_WriteOnly ) ) { - QTextStream stream(&file); - QListBoxItem *it = list->firstItem(); + TQTextStream stream(&file); + TQListBoxItem *it = list->firstItem(); while ( 1 ) { stream << it->text(); @@ -267,7 +267,7 @@ void KParameterEditor::cmdExport_clicked() } -void KParameterEditor::varlist_clicked( QListBoxItem * item ) +void KParameterEditor::varlist_clicked( TQListBoxItem * item ) { if (item) { @@ -282,12 +282,12 @@ void KParameterEditor::varlist_clicked( QListBoxItem * item ) } -void KParameterEditor::varlist_doubleClicked( QListBoxItem * ) +void KParameterEditor::varlist_doubleClicked( TQListBoxItem * ) { cmdEdit_clicked(); } -bool KParameterEditor::checkTwoOfIt(const QString & text) +bool KParameterEditor::checkTwoOfIt(const TQString & text) { if ( list->findItem(text,Qt::ExactMatch) == 0) return false; diff --git a/kmplot/kmplot/kparametereditor.h b/kmplot/kmplot/kparametereditor.h index 223ce5b8..7c1d742d 100644 --- a/kmplot/kmplot/kparametereditor.h +++ b/kmplot/kmplot/kparametereditor.h @@ -39,7 +39,7 @@ class KParameterEditor : public QParameterEditor { Q_OBJECT public: - KParameterEditor(XParser *, QValueList *, QWidget *parent = 0, const char *name = 0); + KParameterEditor(XParser *, TQValueList *, TQWidget *parent = 0, const char *name = 0); ~KParameterEditor(); public slots: @@ -48,14 +48,14 @@ public slots: void cmdDelete_clicked(); void cmdImport_clicked(); void cmdExport_clicked(); - void varlist_clicked( QListBoxItem * ); - void varlist_doubleClicked( QListBoxItem * ); + void varlist_clicked( TQListBoxItem * ); + void varlist_doubleClicked( TQListBoxItem * ); private: /// Check so that it doesn't exist two equal values - bool checkTwoOfIt( const QString & text); - QValueList *m_parameter; + bool checkTwoOfIt( const TQString & text); + TQValueList *m_parameter; XParser *m_parser; }; diff --git a/kmplot/kmplot/kprinterdlg.cpp b/kmplot/kmplot/kprinterdlg.cpp index f17308e0..aa74a7b5 100644 --- a/kmplot/kmplot/kprinterdlg.cpp +++ b/kmplot/kmplot/kprinterdlg.cpp @@ -24,7 +24,7 @@ */ // Qt includes -#include +#include // KDE includes #include @@ -33,23 +33,23 @@ // local includes #include "kprinterdlg.h" -KPrinterDlg::KPrinterDlg( QWidget *parent, const char *name ) +KPrinterDlg::KPrinterDlg( TQWidget *parent, const char *name ) : KPrintDialogPage( parent, name ) { setTitle( i18n( "KmPlot Options" ) ); - QVBoxLayout *layout = new QVBoxLayout( this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); layout->setMargin( KDialog::marginHint() ); layout->setSpacing( KDialog::spacingHint() ); - printHeaderTable = new QCheckBox( i18n( "Print header table" ), this ); - transparent_background = new QCheckBox( i18n( "Transparent background" ), this ); + printHeaderTable = new TQCheckBox( i18n( "Print header table" ), this ); + transparent_background = new TQCheckBox( i18n( "Transparent background" ), this ); layout->addWidget( printHeaderTable ); layout->addWidget( transparent_background ); layout->addStretch( 1 ); } -void KPrinterDlg::getOptions( QMap& opts, bool include_def ) +void KPrinterDlg::getOptions( TQMap& opts, bool include_def ) { if ( include_def || !printHeaderTable->isChecked() ) opts[ "app-kmplot-printtable" ] = ( printHeaderTable->isChecked() ? "1" : "-1" ); @@ -57,13 +57,13 @@ void KPrinterDlg::getOptions( QMap& opts, bool include_def ) opts[ "app-kmplot-printbackground" ] = ( transparent_background->isChecked() ? "1" : "-1" ); } -void KPrinterDlg::setOptions( const QMap& opts ) +void KPrinterDlg::setOptions( const TQMap& opts ) { printHeaderTable->setChecked( opts[ "app-kmplot-printtable" ] != "-1" ); transparent_background->setChecked( opts[ "app-kmplot-printbackground" ] != "-1" ); } -bool KPrinterDlg::isValid( const QString& ) +bool KPrinterDlg::isValid( const TQString& ) { return true; } diff --git a/kmplot/kmplot/kprinterdlg.h b/kmplot/kmplot/kprinterdlg.h index e875ee7a..46113efb 100644 --- a/kmplot/kmplot/kprinterdlg.h +++ b/kmplot/kmplot/kprinterdlg.h @@ -29,7 +29,7 @@ #define kprintdlg_included // Qt includes -#include +#include // KDE includes #include @@ -44,17 +44,17 @@ class KPrinterDlg : public KPrintDialogPage Q_OBJECT public: /// Getting the common arguments. - KPrinterDlg( QWidget *parent = 0, const char *name = 0 ); + KPrinterDlg( TQWidget *parent = 0, const char *name = 0 ); /// Reimplemented. - void getOptions( QMap& opts, bool include_def = false ); + void getOptions( TQMap& opts, bool include_def = false ); /// Reimplemented. - void setOptions( const QMap& opts ); + void setOptions( const TQMap& opts ); /// Reimplemented. - bool isValid( const QString& msg ); + bool isValid( const TQString& msg ); /// The check box for the option. - QCheckBox *printHeaderTable; - QCheckBox *transparent_background; + TQCheckBox *printHeaderTable; + TQCheckBox *transparent_background; }; #endif //kprinterdlg_included diff --git a/kmplot/kmplot/ksliderwindow.cpp b/kmplot/kmplot/ksliderwindow.cpp index 675cb9d9..24c71994 100644 --- a/kmplot/kmplot/ksliderwindow.cpp +++ b/kmplot/kmplot/ksliderwindow.cpp @@ -23,10 +23,10 @@ * */ // Qt includes -#include -#include -#include -#include +#include +#include +#include +#include // KDE includes #include @@ -42,16 +42,16 @@ // local includes #include "ksliderwindow.h" -KSliderWindow::KSliderWindow(QWidget* parent, int num ) : +KSliderWindow::KSliderWindow(TQWidget* parent, int num ) : SliderWindow( parent, "", false, Qt::WStyle_Tool-Qt::WStyle_Maximize ), m_num(num) { setCaption(i18n( "Slider %1" ).arg( num+1 ) ); - QToolTip::add( slider, i18n( "Slider no. %1" ).arg( num+1 )); - QWhatsThis::add( this, i18n( "Move slider to change the parameter of the function plot connected to this slider." ) ); + TQToolTip::add( slider, i18n( "Slider no. %1" ).arg( num+1 )); + TQWhatsThis::add( this, i18n( "Move slider to change the parameter of the function plot connected to this slider." ) ); // load the min and max value + the current value KConfig config( "kmplotrc" ); - config.setGroup( "slider" + QString::number(num) ); + config.setGroup( "slider" + TQString::number(num) ); slider->setMinValue( config.readNumEntry( "min", 0) ); slider->setMaxValue( config.readNumEntry( "max", 100) ); slider->setValue( config.readNumEntry( "value", 50) ); @@ -61,9 +61,9 @@ KSliderWindow::KSliderWindow(QWidget* parent, int num ) : installEventFilter(this); m_popupmenu = new KPopupMenu(this); - KAction *mnuMinValue = new KAction(i18n("&Change Minimum Value") ,0,this, SLOT( mnuMinValue_clicked() ),0); + KAction *mnuMinValue = new KAction(i18n("&Change Minimum Value") ,0,this, TQT_SLOT( mnuMinValue_clicked() ),0); mnuMinValue->plug(m_popupmenu); - KAction *mnuMaxValue = new KAction(i18n("&Change Maximum Value") ,0,this, SLOT( mnuMaxValue_clicked() ),0 ); + KAction *mnuMaxValue = new KAction(i18n("&Change Maximum Value") ,0,this, TQT_SLOT( mnuMaxValue_clicked() ),0 ); mnuMaxValue->plug(m_popupmenu); } @@ -71,26 +71,26 @@ KSliderWindow::~KSliderWindow() { // save the min and max value + the current value KConfig config( "kmplotrc" ); - config.setGroup( "slider" + QString::number(m_num) ); + config.setGroup( "slider" + TQString::number(m_num) ); config.writeEntry( "min", slider->minValue() ); config.writeEntry( "max", slider->maxValue() ); config.writeEntry( "value", slider->value() ); } -bool KSliderWindow::eventFilter( QObject *obj, QEvent *ev ) +bool KSliderWindow::eventFilter( TQObject *obj, TQEvent *ev ) { - if (ev->type() == QEvent::MouseButtonPress) + if (ev->type() == TQEvent::MouseButtonPress) { - QMouseEvent *e = (QMouseEvent *)ev; + TQMouseEvent *e = (TQMouseEvent *)ev; if (e->button() != Qt::RightButton) return SliderWindow::eventFilter( obj, ev ); - m_popupmenu->exec(QCursor::pos()); + m_popupmenu->exec(TQCursor::pos()); return true; } return SliderWindow::eventFilter( obj, ev ); } -void KSliderWindow::closeEvent( QCloseEvent * e) +void KSliderWindow::closeEvent( TQCloseEvent * e) { emit windowClosed(m_num); e->accept(); diff --git a/kmplot/kmplot/ksliderwindow.h b/kmplot/kmplot/ksliderwindow.h index 115c5010..ff4843c8 100644 --- a/kmplot/kmplot/ksliderwindow.h +++ b/kmplot/kmplot/ksliderwindow.h @@ -37,7 +37,7 @@ class KSliderWindow : public SliderWindow public: /// @param parent points to the parent widget. /// @param num number of this instance. - KSliderWindow(QWidget* parent, int num ); + KSliderWindow(TQWidget* parent, int num ); virtual ~KSliderWindow(); private slots: @@ -49,8 +49,8 @@ class KSliderWindow : public SliderWindow void windowClosed(int); private: - bool eventFilter( QObject *obj, QEvent *ev ); - void closeEvent( QCloseEvent * ); + bool eventFilter( TQObject *obj, TQEvent *ev ); + void closeEvent( TQCloseEvent * ); KPopupMenu *m_popupmenu; int m_num; }; diff --git a/kmplot/kmplot/parser.cpp b/kmplot/kmplot/parser.cpp index 1f3fa011..ed064b85 100644 --- a/kmplot/kmplot/parser.cpp +++ b/kmplot/kmplot/parser.cpp @@ -135,7 +135,7 @@ void Parser::ps_init() Parser::~Parser() { kdDebug() << "Exiting......" << endl; - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { kdDebug() << "Deleting something... :-)" << endl; delete [](*it).mem; @@ -150,7 +150,7 @@ void Parser::setAngleMode(int angle) m_anglemode = M_PI/180; } -void Parser::setDecimalSymbol(const QString c) +void Parser::setDecimalSymbol(const TQString c) { m_decimalsymbol = c; } @@ -168,7 +168,7 @@ uint Parser::getNewId() while (1 ) { found = false; - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { if (it->id == i && !it->fname.isEmpty()) { @@ -182,7 +182,7 @@ uint Parser::getNewId() } } -double Parser::eval(QString str) +double Parser::eval(TQString str) { stack=new double [STACKSIZE]; stkptr=stack; @@ -197,7 +197,7 @@ double Parser::eval(QString str) return 0; } for (uint i=0;i::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { if ( it->id ==id) return ix; @@ -248,7 +248,7 @@ int Parser::ixValue(uint const id) double Parser::fkt(uint const id, double const x) { - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { if ( it->id == id) return fkt(it,x); @@ -322,7 +322,7 @@ double Parser::fkt(Ufkt *it, double const x) { puf=(uint*)it->mptr; uint id = *puf++; - for( QValueVector::iterator ite = ufkt.begin(); ite != ufkt.end(); ++ite) + for( TQValueVector::iterator ite = ufkt.begin(); ite != ufkt.end(); ++ite) { if ( ite->id == id) { @@ -341,9 +341,9 @@ double Parser::fkt(Ufkt *it, double const x) } } -int Parser::addfkt(QString str) +int Parser::addfkt(TQString str) { - QString const extstr = str; + TQString const extstr = str; stkptr=stack=0; err=0; errpos=1; @@ -390,7 +390,7 @@ int Parser::addfkt(QString str) temp.mem=new unsigned char [MEMSIZE]; ufkt.append(temp ); } - QString const fname = str.left(p1); + TQString const fname = str.left(p1); Ufkt *temp = &ufkt.last(); temp->fstr=extstr; temp->mptr = 0; @@ -431,7 +431,7 @@ void Parser::reparse(int ix) void Parser::reparse(Ufkt *item) { kdDebug() << "Reparsing: " << item->fstr << endl; - QString str = item->fstr.latin1(); + TQString str = item->fstr.latin1(); err=0; errpos=1; @@ -477,21 +477,21 @@ void Parser::reparse(Ufkt *item) errpos=0; } -void Parser::fix_expression(QString &str, int const pos) +void Parser::fix_expression(TQString &str, int const pos) { str.remove(" " ); //insert '*' when it is needed - QChar ch; + TQChar ch; bool function = false; for(uint i=pos; i < str.length();i++) { ch = str.at(i); - if ( str.at(i+1)=='(' && ch.category()==QChar::Letter_Lowercase ) + if ( str.at(i+1)=='(' && ch.category()==TQChar::Letter_Lowercase ) { - QString str_function(ch); + TQString str_function(ch); int n=i-1; - while (n>0 && str.at(n).category() == QChar::Letter_Lowercase ) + while (n>0 && str.at(n).category() == TQChar::Letter_Lowercase ) { str_function.prepend(str.at(n)); --n; @@ -499,7 +499,7 @@ void Parser::fix_expression(QString &str, int const pos) if (str_function == "tanh" || str_function == "tan" || str_function =="sqrt" || str_function =="sqr" || str_function =="sin" || str_function =="sinh" || str_function =="sign" || str_function =="sech" || str_function =="sec" || str_function =="log" || str_function =="ln" || str_function =="exp" || str_function =="coth" || str_function =="cot" || str_function =="cosh" || str_function =="cosech" || str_function =="cosec" || str_function =="cos" || str_function =="artanh" || str_function =="arsinh" || str_function =="arsech" || str_function =="arctan" || str_function =="arcsin" || str_function =="arcsec" || str_function =="arcoth" || str_function =="arcosh" || str_function =="arcosech" || str_function =="arccot" || str_function =="arccosec" || str_function =="arccos" || str_function =="abs" || str_function=="arctanh" || str_function=="arcsinh" || str_function=="arccosh") function = true; else - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { for ( int j=i; j>0 && (str.at(j).isLetter() || str.at(j).isNumber() ) ; --j) { @@ -511,15 +511,15 @@ void Parser::fix_expression(QString &str, int const pos) else if (function) function = false; - if( (ch.isNumber() || ch.category()==QChar::Letter_Uppercase )&& ( str.at(i-1).isLetter() || str.at(i-1) == ')' ) || (ch.isLetter() && str.at(i-1)==')') ) + if( (ch.isNumber() || ch.category()==TQChar::Letter_Uppercase )&& ( str.at(i-1).isLetter() || str.at(i-1) == ')' ) || (ch.isLetter() && str.at(i-1)==')') ) str.insert(i,'*'); - else if( (ch.isNumber() || ch == ')' || ch.category()==QChar::Letter_Uppercase) && ( str.at(i+1).isLetter() || str.at(i+1) == '(' ) || (ch.isLetter() && str.at(i+1)=='(' && !function ) ) + else if( (ch.isNumber() || ch == ')' || ch.category()==TQChar::Letter_Uppercase) && ( str.at(i+1).isLetter() || str.at(i+1) == '(' ) || (ch.isLetter() && str.at(i+1)=='(' && !function ) ) { str.insert(i+1,'*'); i++; } } - QString str_end = str.mid(pos); + TQString str_end = str.mid(pos); str_end = str_end.replace(m_decimalsymbol, "."); //replace the locale decimal symbol with a '.' str.truncate(pos); str.append(str_end); @@ -534,11 +534,11 @@ bool Parser::delfkt( Ufkt *item) KMessageBox::error(0,i18n("This function is depending on an other function")); return false; } - for(QValueVector::iterator it1=ufkt.begin(); it1!=ufkt.end(); ++it1) + for(TQValueVector::iterator it1=ufkt.begin(); it1!=ufkt.end(); ++it1) { if (it1==item) continue; - for(QValueList::iterator it2=it1->dep.begin(); it2!=it1->dep.end(); ++it2) + for(TQValueList::iterator it2=it1->dep.begin(); it2!=it1->dep.end(); ++it2) if ( (uint)*it2 == item->id ) it2 = it1->dep.erase(it2); } @@ -551,7 +551,7 @@ bool Parser::delfkt( Ufkt *item) else { //kdDebug() << "Deleting something" << endl; - QChar const extstr_c = item->fstr.at(0); + TQChar const extstr_c = item->fstr.at(0); uint const id = item->id; delete []item->mem; ufkt.erase(item); @@ -710,9 +710,9 @@ void Parser::primary() return; } } - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { - if(QString(lptr)=="pi" || QString(lptr)=="e") continue; + if(TQString(lptr)=="pi" || TQString(lptr)=="e") continue; if( match(it->fname.latin1()) ) { @@ -931,7 +931,7 @@ void Parser::addfptr(uint id) } else { - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) if ( it->id == id) { *stkptr=fkt(it, *stkptr); @@ -941,9 +941,9 @@ void Parser::addfptr(uint id) } -int Parser::fnameToId(const QString &name) +int Parser::fnameToId(const TQString &name) { - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { if(name==it->fname) return it->id; @@ -959,33 +959,33 @@ int Parser::parserError(bool showMessageBox) switch(err) { case 1: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Syntax error").arg(QString::number(errpos)), "KmPlot"); + "Syntax error").arg(TQString::number(errpos)), "KmPlot"); break; case 2: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Missing parenthesis").arg(QString::number(errpos)), "KmPlot"); + "Missing parenthesis").arg(TQString::number(errpos)), "KmPlot"); break; case 3: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Function name unknown").arg(QString::number(errpos)), "KmPlot"); + "Function name unknown").arg(TQString::number(errpos)), "KmPlot"); break; case 4: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Void function variable").arg(QString::number(errpos)), "KmPlot"); + "Void function variable").arg(TQString::number(errpos)), "KmPlot"); break; case 5: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Too many functions").arg(QString::number(errpos)), "KmPlot"); + "Too many functions").arg(TQString::number(errpos)), "KmPlot"); break; case 6: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Token-memory overflow").arg(QString::number(errpos)), "KmPlot"); + "Token-memory overflow").arg(TQString::number(errpos)), "KmPlot"); break; case 7: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Stack overflow").arg(QString::number(errpos)), "KmPlot"); + "Stack overflow").arg(TQString::number(errpos)), "KmPlot"); break; case 8: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "Name of function not free.").arg(QString::number(errpos)), "KmPlot"); + "Name of function not free.").arg(TQString::number(errpos)), "KmPlot"); break; case 9: KMessageBox::error(0, i18n("Parser error at position %1:\n" - "recursive function not allowed.").arg(QString::number(errpos)), "KmPlot"); + "recursive function not allowed.").arg(TQString::number(errpos)), "KmPlot"); break; - case 10: KMessageBox::error(0, i18n("Could not find a defined constant at position %1." ).arg(QString::number(errpos)), + case 10: KMessageBox::error(0, i18n("Could not find a defined constant at position %1." ).arg(TQString::number(errpos)), "KmPlot"); break; case 11: KMessageBox::error(0, i18n("Empty function"), "KmPlot"); @@ -1003,9 +1003,9 @@ int Parser::parserError(bool showMessageBox) // static -QString Parser::number( double value ) +TQString Parser::number( double value ) { - QString str = QString::number( value, 'g', 6 ); + TQString str = TQString::number( value, 'g', 6 ); str.replace( 'e', "*10^" ); // kDebug() << "returning str="< -#include +#include +#include #include "parseriface.h" @@ -99,13 +99,13 @@ double arctan(double x); class ParameterValueItem { public: - ParameterValueItem(const QString &e, double v) + ParameterValueItem(const TQString &e, double v) { expression = e; value = v; } ParameterValueItem() {;} - QString expression; + TQString expression; double value; }; @@ -122,13 +122,13 @@ class Ufkt uint id; unsigned char *mem; ///< Pointer to the allocated memory for the tokens. unsigned char *mptr; ///< Pointer to the token. - QString fname; ///< Name of the function. - QString fvar; ///< Dummy variable. - QString fpar; ///< Parameter. - QString fstr; ///< Function expression. + TQString fname; ///< Name of the function. + TQString fvar; ///< Dummy variable. + TQString fpar; ///< Parameter. + TQString fstr; ///< Function expression. double k, ///< Function parameter. oldy; ///< The last y-value needed for Euler's method - QValueList dep; /// A list with all functions this function depends on + TQValueList dep; /// A list with all functions this function depends on bool f_mode, ///< \a f_mode == 1: draw the plot. f1_mode, ///< \a f1_mode == 1. draw the 1st derivative, too. @@ -138,7 +138,7 @@ class Ufkt int linewidth,f1_linewidth,f2_linewidth, integral_linewidth; ///< Line width. /** Number of parameter values. * @see FktExt::k_liste */ - QString str_dmin, str_dmax, str_startx, str_starty ; /// Plot range, input strings. + TQString str_dmin, str_dmax, str_startx, str_starty ; /// Plot range, input strings. double dmin, ///< Custom plot range, lower boundage. dmax, ///< Custom plot range, upper boundage. /** List of parameter values. @@ -151,7 +151,7 @@ class Ufkt QRgb color, ///< current color. f1_color, f2_color, integral_color; int use_slider; ///< -1: none (use list), else: slider number - QValueList parameters; ///< List with parameter for the function + TQValueList parameters; ///< List with parameter for the function bool usecustomxmin, usecustomxmax; // TODO double slider_min, slider_max; ///< extreme values of the slider }; @@ -182,24 +182,24 @@ public: /** * @return A string that is safe to use as a number in a string to be * parsed. This is needed as e.g. "1.2e-3" is not allowed (e is a - * constant) - so cannot use the QString::number. + * constant) - so cannot use the TQString::number. */ - static QString number( double value ); + static TQString number( double value ); /// Returns the result of a calculation double fkt(Ufkt *it, double const x); double fkt(uint id, double const x); /// Evaluates the given expression. - double eval(QString); + double eval(TQString); /// Adds a user defined function with the given equation. The new function's ID-number is returned. - int addfkt(QString); + int addfkt(TQString); /// Removes the function with the given id. bool delfkt(uint id); bool delfkt( Ufkt *item); /// Returns the ID-number of the function "name". If the function couldn't be found, -1 is returned. - int fnameToId(const QString &name); + int fnameToId(const TQString &name); /// Returns the current error value. If showMessageBox is true, an error message box will appear if an error was found int parserError(bool showMessageBox=TRUE); @@ -208,7 +208,7 @@ public: /// Sets the angletype. TRUE is radians and FALSE degrees void setAngleMode(int); /// sets the decimal symbol - void setDecimalSymbol(const QString ); + void setDecimalSymbol(const TQString ); /// reparse the function. It also do a grammer check for the expression void reparse(int ix); @@ -219,8 +219,8 @@ public: int ixValue(uint const id);/// Converts an ID-numer to an index-value uint countFunctions(); /// Returns how many functions there are - QValueVector constant; - QValueVector ufkt;///< Points to the array of user defined functions. + TQValueVector constant; + TQValueVector ufkt;///< Points to the array of user defined functions. private: /** Mathematical function. */ @@ -254,7 +254,7 @@ private: /// Position where the error occurred. int errpos; - void fix_expression(QString &, int const); ///adding extra *-characters, remove spaces and replace the locale .-character with '.' + void fix_expression(TQString &, int const); ///adding extra *-characters, remove spaces and replace the locale .-character with '.' void ps_init(), heir1(), @@ -279,7 +279,7 @@ private: double *stack, // Zeiger auf Stackanfang *stkptr; // Stackpointer static double m_anglemode; - QString m_decimalsymbol; + TQString m_decimalsymbol; }; #endif // parser_included diff --git a/kmplot/kmplot/parseriface.h b/kmplot/kmplot/parseriface.h index 07020ebb..eb20625f 100644 --- a/kmplot/kmplot/parseriface.h +++ b/kmplot/kmplot/parseriface.h @@ -27,8 +27,8 @@ #define XPARSERIFACE_H #include -#include -#include +#include +#include /** @author Fredrik Edemar @@ -38,14 +38,14 @@ class ParserIface : virtual public DCOPObject { K_DCOP k_dcop: - virtual bool addFunction(const QString &extstr, bool f_mode, bool f1_mode, bool f2_mode, bool integral_mode, bool integral_use_precision, int linewidth, int f1_linewidth, int f2_linewidth, int integral_linewidth, const QString &str_dmin, const QString &str_dmax, const QString &str_startx, const QString &str_starty, double integral_precision, QRgb color, QRgb f1_color, QRgb f2_color, QRgb integral_color, QStringList str_parameter, int use_slider) = 0; + virtual bool addFunction(const TQString &extstr, bool f_mode, bool f1_mode, bool f2_mode, bool integral_mode, bool integral_use_precision, int linewidth, int f1_linewidth, int f2_linewidth, int integral_linewidth, const TQString &str_dmin, const TQString &str_dmax, const TQString &str_startx, const TQString &str_starty, double integral_precision, QRgb color, QRgb f1_color, QRgb f2_color, QRgb integral_color, TQStringList str_parameter, int use_slider) = 0; - virtual int addFunction(const QString &f_str) = 0; + virtual int addFunction(const TQString &f_str) = 0; virtual bool delfkt(uint id) = 0; - virtual bool setFunctionExpression(const QString &f_str, uint id) = 0; + virtual bool setFunctionExpression(const TQString &f_str, uint id) = 0; virtual uint countFunctions() = 0; - virtual QStringList listFunctionNames() = 0; - virtual int fnameToId(const QString &name) = 0; + virtual TQStringList listFunctionNames() = 0; + virtual int fnameToId(const TQString &name) = 0; virtual double fkt(uint id, double x) = 0; virtual bool functionFVisible(uint id) = 0; virtual bool functionF1Visible(uint id) = 0; @@ -55,15 +55,15 @@ k_dcop: virtual bool setFunctionF1Visible(bool visible, uint id) = 0; virtual bool setFunctionF2Visible(bool visible, uint id) = 0; virtual bool setFunctionIntVisible(bool visible, uint id) = 0; - virtual QString functionStr(uint id) = 0; - virtual QColor functionFColor(uint id) = 0; - virtual QColor functionF1Color(uint id) = 0; - virtual QColor functionF2Color(uint id) = 0; - virtual QColor functionIntColor(uint id) = 0; - virtual bool setFunctionFColor(const QColor &color, uint id) = 0; - virtual bool setFunctionF1Color(const QColor &color, uint id) = 0; - virtual bool setFunctionF2Color(const QColor &color, uint id) = 0; - virtual bool setFunctionIntColor(const QColor &color, uint id) = 0; + virtual TQString functionStr(uint id) = 0; + virtual TQColor functionFColor(uint id) = 0; + virtual TQColor functionF1Color(uint id) = 0; + virtual TQColor functionF2Color(uint id) = 0; + virtual TQColor functionIntColor(uint id) = 0; + virtual bool setFunctionFColor(const TQColor &color, uint id) = 0; + virtual bool setFunctionF1Color(const TQColor &color, uint id) = 0; + virtual bool setFunctionF2Color(const TQColor &color, uint id) = 0; + virtual bool setFunctionIntColor(const TQColor &color, uint id) = 0; virtual int functionFLineWidth(uint id) = 0; virtual int functionF1LineWidth(uint id) = 0; virtual int functionF2LineWidth(uint id) = 0; @@ -72,17 +72,17 @@ k_dcop: virtual bool setFunctionF1LineWidth(int linewidth, uint id) = 0; virtual bool setFunctionF2LineWidth(int linewidth, uint id) = 0; virtual bool setFunctionIntLineWidth(int linewidth, uint id) = 0; - virtual QStringList functionParameterList(uint id) = 0; - virtual bool functionAddParameter(const QString &new_parameter, uint id) = 0; - virtual bool functionRemoveParameter(const QString &remove_parameter, uint id) = 0; - virtual QString functionMinValue(uint id) = 0; - virtual QString functionMaxValue(uint id) = 0; - virtual bool setFunctionMinValue(const QString &min, uint id) = 0; - virtual bool setFunctionMaxValue(const QString &max, uint id) = 0; - virtual QString functionStartXValue(uint id) = 0; - virtual QString functionStartYValue(uint id) = 0; - virtual bool setFunctionStartXValue(const QString &x, uint id) = 0; - virtual bool setFunctionStartYValue(const QString &y, uint id) = 0; + virtual TQStringList functionParameterList(uint id) = 0; + virtual bool functionAddParameter(const TQString &new_parameter, uint id) = 0; + virtual bool functionRemoveParameter(const TQString &remove_parameter, uint id) = 0; + virtual TQString functionMinValue(uint id) = 0; + virtual TQString functionMaxValue(uint id) = 0; + virtual bool setFunctionMinValue(const TQString &min, uint id) = 0; + virtual bool setFunctionMaxValue(const TQString &max, uint id) = 0; + virtual TQString functionStartXValue(uint id) = 0; + virtual TQString functionStartYValue(uint id) = 0; + virtual bool setFunctionStartXValue(const TQString &x, uint id) = 0; + virtual bool setFunctionStartYValue(const TQString &y, uint id) = 0; }; diff --git a/kmplot/kmplot/qconstanteditor.ui.h b/kmplot/kmplot/qconstanteditor.ui.h index 3c174b76..00fd2554 100644 --- a/kmplot/kmplot/qconstanteditor.ui.h +++ b/kmplot/kmplot/qconstanteditor.ui.h @@ -23,7 +23,7 @@ void QConstantEditor::cmdDelete_clicked() } -void QConstantEditor::varlist_clicked( QListViewItem * ) +void QConstantEditor::varlist_clicked( TQListViewItem * ) { } @@ -38,7 +38,7 @@ void QConstantEditor::newNewConstantSlot() } -void QConstantEditor::varlist_doubleClicked( QListViewItem * ) +void QConstantEditor::varlist_doubleClicked( TQListViewItem * ) { } diff --git a/kmplot/kmplot/xparser.cpp b/kmplot/kmplot/xparser.cpp index cc618e13..18d9a3b3 100644 --- a/kmplot/kmplot/xparser.cpp +++ b/kmplot/kmplot/xparser.cpp @@ -44,11 +44,11 @@ XParser::~XParser() { } -bool XParser::getext( Ufkt *item, const QString fstr ) +bool XParser::getext( Ufkt *item, const TQString fstr ) { bool errflg = false; int p1, p2, p3, pe; - QString tstr; + TQString tstr; pe = fstr.length(); if ( fstr.find( 'N' ) != -1 ) item->f_mode = false; @@ -71,7 +71,7 @@ bool XParser::getext( Ufkt *item, const QString fstr ) if ( p1 != -1 ) { p1 += 2; - const QString str = fstr.mid( p1, pe - p1); + const TQString str = fstr.mid( p1, pe - p1); p2 = str.find(','); p3 = str.find(']'); if ( p2 > 0 && p2 < p3 ) @@ -95,7 +95,7 @@ bool XParser::getext( Ufkt *item, const QString fstr ) { int i = 0; p1 += 2; - QString str = fstr.mid( p1, 1000); + TQString str = fstr.mid( p1, 1000); p3 = str.find( ']' ); do { @@ -134,7 +134,7 @@ double XParser::a2fkt( Ufkt *u_item, double x, double h ) return ( fkt( u_item, x + h + h ) - 2 * fkt( u_item, x + h ) + fkt( u_item, x ) ) / h / h; } -void XParser::findFunctionName(QString &function_name, int const id, int const type) +void XParser::findFunctionName(TQString &function_name, int const id, int const type) { char last_character; int pos; @@ -149,7 +149,7 @@ void XParser::findFunctionName(QString &function_name, int const id, int const t { if ( pos==0 && last_character == 'r') continue; function_name.at(pos)=last_character; - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { if (it == ufkt.begin() && it->fname.isEmpty() ) continue; if ( it->fstr.startsWith(function_name+'(') && (int)it->id!=id) //check if the name is free @@ -168,13 +168,13 @@ void XParser::findFunctionName(QString &function_name, int const id, int const t function_name = "e"; //this should never happen } -void XParser::fixFunctionName( QString &str, int const type, int const id) +void XParser::fixFunctionName( TQString &str, int const type, int const id) { if ( str.startsWith( "y=" ) ) //we find a free function name { str.remove( 0, 2 ); str.prepend("(x)="); - QString function_name; + TQString function_name; findFunctionName(function_name, id, type); str.prepend( function_name ); } @@ -195,13 +195,13 @@ void XParser::fixFunctionName( QString &str, int const type, int const id) p1++; p2++; } - QString const fname = str.left(p1); - for ( QValueVector::iterator it = ufkt.begin(); it!=ufkt.end(); ++it ) + TQString const fname = str.left(p1); + for ( TQValueVector::iterator it = ufkt.begin(); it!=ufkt.end(); ++it ) { if (it->fname == fname) { str = str.mid(p1,str.length()-1); - QString function_name; + TQString function_name; if ( type == XParser::Polar ) function_name = "rf"; else if ( type == XParser::ParametricX ) @@ -218,7 +218,7 @@ void XParser::fixFunctionName( QString &str, int const type, int const id) } else if ( p1==-1 || !str.at(p1+1).isLetter() || p2==-1 || str.at(p2+1 )!= '=') { - QString function_name; + TQString function_name; if ( type == XParser::Polar ) function_name = "rf"; else if ( type == XParser::ParametricX ) @@ -233,7 +233,7 @@ void XParser::fixFunctionName( QString &str, int const type, int const id) } } -double XParser::euler_method(const double x, const QValueVector::iterator it) +double XParser::euler_method(const double x, const TQValueVector::iterator it) { double const y = it->oldy + ((x-it->oldx) * it->oldyprim); it->oldy = y; @@ -303,10 +303,10 @@ int XParser::getNextIndex() return getNewId(); } -QStringList XParser::listFunctionNames() +TQStringList XParser::listFunctionNames() { - QStringList list; - for( QValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) + TQStringList list; + for( TQValueVector::iterator it = ufkt.begin(); it != ufkt.end(); ++it) { list.append(it->fname); } @@ -379,7 +379,7 @@ bool XParser::setFunctionIntVisible(bool visible, uint id) return true; } -QString XParser::functionStr(uint id) +TQString XParser::functionStr(uint id) { int const ix = ixValue(id); if (ix==-1) @@ -387,35 +387,35 @@ QString XParser::functionStr(uint id) return ufkt[ix].fstr; } -QColor XParser::functionFColor(uint id) +TQColor XParser::functionFColor(uint id) { int const ix = ixValue(id); if (ix==-1) - return QColor(); - return QColor(ufkt[ix].color); + return TQColor(); + return TQColor(ufkt[ix].color); } -QColor XParser::functionF1Color(uint id) +TQColor XParser::functionF1Color(uint id) { int const ix = ixValue(id); if (ix==-1) - return QColor(); - return QColor(ufkt[ix].f1_color); + return TQColor(); + return TQColor(ufkt[ix].f1_color); } -QColor XParser::functionF2Color(uint id) +TQColor XParser::functionF2Color(uint id) { int const ix = ixValue(id); if (ix==-1) - return QColor(); - return QColor(ufkt[ix].f2_color); + return TQColor(); + return TQColor(ufkt[ix].f2_color); } -QColor XParser::functionIntColor(uint id) +TQColor XParser::functionIntColor(uint id) { int const ix = ixValue(id); if (ix==-1) - return QColor(); - return QColor(ufkt[ix].integral_color); + return TQColor(); + return TQColor(ufkt[ix].integral_color); } -bool XParser::setFunctionFColor(const QColor &color, uint id) +bool XParser::setFunctionFColor(const TQColor &color, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -424,7 +424,7 @@ bool XParser::setFunctionFColor(const QColor &color, uint id) m_modified = true; return true; } -bool XParser::setFunctionF1Color(const QColor &color, uint id) +bool XParser::setFunctionF1Color(const TQColor &color, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -433,7 +433,7 @@ bool XParser::setFunctionF1Color(const QColor &color, uint id) m_modified = true; return true; } -bool XParser::setFunctionF2Color(const QColor &color, uint id) +bool XParser::setFunctionF2Color(const TQColor &color, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -442,7 +442,7 @@ bool XParser::setFunctionF2Color(const QColor &color, uint id) m_modified = true; return true; } -bool XParser::setFunctionIntColor(const QColor &color, uint id) +bool XParser::setFunctionIntColor(const TQColor &color, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -517,7 +517,7 @@ bool XParser::setFunctionIntLineWidth(int linewidth, uint id) return true; } -QString XParser::functionMinValue(uint id) +TQString XParser::functionMinValue(uint id) { int const ix = ixValue(id); if (ix==-1) @@ -525,7 +525,7 @@ QString XParser::functionMinValue(uint id) return ufkt[ix].str_dmin; } -bool XParser::setFunctionMinValue(const QString &min, uint id) +bool XParser::setFunctionMinValue(const TQString &min, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -535,7 +535,7 @@ bool XParser::setFunctionMinValue(const QString &min, uint id) return true; } -QString XParser::functionMaxValue(uint id) +TQString XParser::functionMaxValue(uint id) { int const ix = ixValue(id); if (ix==-1) @@ -543,7 +543,7 @@ QString XParser::functionMaxValue(uint id) return ufkt[ix].str_dmax; } -bool XParser::setFunctionMaxValue(const QString &max, uint id) +bool XParser::setFunctionMaxValue(const TQString &max, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -553,7 +553,7 @@ bool XParser::setFunctionMaxValue(const QString &max, uint id) return true; } -QString XParser::functionStartXValue(uint id) +TQString XParser::functionStartXValue(uint id) { int const ix = ixValue(id); if (ix==-1) @@ -561,7 +561,7 @@ QString XParser::functionStartXValue(uint id) return ufkt[ix].str_startx; } -bool XParser::setFunctionStartXValue(const QString &x, uint id) +bool XParser::setFunctionStartXValue(const TQString &x, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -571,7 +571,7 @@ bool XParser::setFunctionStartXValue(const QString &x, uint id) return true; } -QString XParser::functionStartYValue(uint id) +TQString XParser::functionStartYValue(uint id) { int const ix = ixValue(id); if (ix==-1) @@ -579,7 +579,7 @@ QString XParser::functionStartYValue(uint id) return ufkt[ix].str_starty; } -bool XParser::setFunctionStartYValue(const QString &y, uint id) +bool XParser::setFunctionStartYValue(const TQString &y, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -589,24 +589,24 @@ bool XParser::setFunctionStartYValue(const QString &y, uint id) return true; } -QStringList XParser::functionParameterList(uint id) +TQStringList XParser::functionParameterList(uint id) { int const ix = ixValue(id); if (ix==-1) - return QStringList(); + return TQStringList(); Ufkt *item = &ufkt[ix]; - QStringList str_parameter; - for ( QValueList::iterator it = item->parameters.begin(); it != item->parameters.end(); ++it) + TQStringList str_parameter; + for ( TQValueList::iterator it = item->parameters.begin(); it != item->parameters.end(); ++it) str_parameter.append( (*it).expression); return str_parameter; } -bool XParser::functionAddParameter(const QString &new_parameter, uint id) +bool XParser::functionAddParameter(const TQString &new_parameter, uint id) { int const ix = ixValue(id); if (ix==-1) return false; Ufkt *tmp_ufkt = &ufkt[ix]; - for ( QValueList::iterator it = tmp_ufkt->parameters.begin(); it != tmp_ufkt->parameters.end(); ++it) + for ( TQValueList::iterator it = tmp_ufkt->parameters.begin(); it != tmp_ufkt->parameters.end(); ++it) if ( (*it).expression == new_parameter) //check if the parameter already exists return false; @@ -617,7 +617,7 @@ bool XParser::functionAddParameter(const QString &new_parameter, uint id) m_modified = true; return true; } -bool XParser::functionRemoveParameter(const QString &remove_parameter, uint id) +bool XParser::functionRemoveParameter(const TQString &remove_parameter, uint id) { int const ix = ixValue(id); if (ix==-1) @@ -625,7 +625,7 @@ bool XParser::functionRemoveParameter(const QString &remove_parameter, uint id) Ufkt *tmp_ufkt = &ufkt[ix]; bool found = false; - QValueList::iterator it; + TQValueList::iterator it; for ( it = tmp_ufkt->parameters.begin(); it != tmp_ufkt->parameters.end(); ++it) if ( (*it).expression == remove_parameter) //check if the parameter already exists { @@ -638,9 +638,9 @@ bool XParser::functionRemoveParameter(const QString &remove_parameter, uint id) m_modified = true; return true; } -int XParser::addFunction(const QString &f_str) +int XParser::addFunction(const TQString &f_str) { - QString added_function(f_str); + TQString added_function(f_str); int const pos = added_function.find(';'); if (pos!=-1) added_function = added_function.left(pos); @@ -664,9 +664,9 @@ int XParser::addFunction(const QString &f_str) return id; } -bool XParser::addFunction(const QString &fstr_const, bool f_mode, bool f1_mode, bool f2_mode, bool integral_mode, bool integral_use_precision, int linewidth, int f1_linewidth, int f2_linewidth, int integral_linewidth, const QString &str_dmin, const QString &str_dmax, const QString &str_startx, const QString &str_starty, double integral_precision, QRgb color, QRgb f1_color, QRgb f2_color, QRgb integral_color, QStringList str_parameter, int use_slider) +bool XParser::addFunction(const TQString &fstr_const, bool f_mode, bool f1_mode, bool f2_mode, bool integral_mode, bool integral_use_precision, int linewidth, int f1_linewidth, int f2_linewidth, int integral_linewidth, const TQString &str_dmin, const TQString &str_dmax, const TQString &str_startx, const TQString &str_starty, double integral_precision, QRgb color, QRgb f1_color, QRgb f2_color, QRgb integral_color, TQStringList str_parameter, int use_slider) { - QString fstr(fstr_const); + TQString fstr(fstr_const); switch ( fstr.at(0).latin1() ) { case 'r': @@ -727,7 +727,7 @@ bool XParser::addFunction(const QString &fstr_const, bool f_mode, bool f1_mode, added_function->f2_color = f2_color; added_function->integral_color = integral_color; added_function->use_slider = use_slider; - for( QStringList::Iterator it = str_parameter.begin(); it != str_parameter.end(); ++it ) + for( TQStringList::Iterator it = str_parameter.begin(); it != str_parameter.end(); ++it ) { double result = eval(*it); if ( parserError(false) != 0) @@ -738,14 +738,14 @@ bool XParser::addFunction(const QString &fstr_const, bool f_mode, bool f1_mode, return true; } -bool XParser::setFunctionExpression(const QString &f_str, uint id) +bool XParser::setFunctionExpression(const TQString &f_str, uint id) { int const ix = ixValue(id); if (ix==-1) return false; Ufkt *tmp_ufkt = &ufkt[ix]; - QString const old_fstr = tmp_ufkt->fstr; - QString const fstr_begin = tmp_ufkt->fstr.left(tmp_ufkt->fstr.find('=')+1); + TQString const old_fstr = tmp_ufkt->fstr; + TQString const fstr_begin = tmp_ufkt->fstr.left(tmp_ufkt->fstr.find('=')+1); tmp_ufkt->fstr = fstr_begin+f_str; reparse(tmp_ufkt); if ( parserError(false) != 0) @@ -757,12 +757,12 @@ bool XParser::setFunctionExpression(const QString &f_str, uint id) return true; } -bool XParser::sendFunction(int id, const QString &dcopclient_target) +bool XParser::sendFunction(int id, const TQString &dcopclient_target) { QCStringList cstr_list = kapp->dcopClient()->registeredApplications(); - QStringList str_list; + TQStringList str_list; for ( QCStringList::iterator it = cstr_list.begin(); it!=cstr_list.end();++it ) - if ( QString(*it).startsWith("kmplot") && *it!=kapp->dcopClient()->appId() ) + if ( TQString(*it).startsWith("kmplot") && *it!=kapp->dcopClient()->appId() ) str_list.append(*it); if ( str_list.isEmpty() ) { @@ -772,7 +772,7 @@ bool XParser::sendFunction(int id, const QString &dcopclient_target) Ufkt *item = &ufkt[ixValue(id)]; kdDebug() << "Transferring " << item->fname.latin1() << endl; - QString str_result; + TQString str_result; if ( dcopclient_target.isEmpty() && item->fname.at(0) == 'y' ) return false; else if ( dcopclient_target.isEmpty() ) @@ -785,30 +785,30 @@ bool XParser::sendFunction(int id, const QString &dcopclient_target) else str_result = dcopclient_target; - QByteArray parameters; - QDataStream arg( parameters, IO_WriteOnly); + TQByteArray parameters; + TQDataStream arg( parameters, IO_WriteOnly); - QString str_dmin; + TQString str_dmin; if (!item->usecustomxmin) str_dmin = item->str_dmin; - QString str_dmax; + TQString str_dmax; if (!item->usecustomxmax) str_dmax = item->str_dmax; - QStringList str_parameters; - for ( QValueList::Iterator it = item->parameters.begin(); it != item->parameters.end(); ++it ) + TQStringList str_parameters; + for ( TQValueList::Iterator it = item->parameters.begin(); it != item->parameters.end(); ++it ) str_parameters.append( (*it).expression); arg << item->fstr << item->f_mode << item->f1_mode << item->f2_mode << item->integral_mode << item->integral_use_precision << item->linewidth << item->f1_linewidth << item->f2_linewidth << item->integral_linewidth << str_dmin << str_dmax << item->str_startx << item->str_starty << item->integral_precision << item->color << item->f1_color << item->f2_color << item->integral_color << str_parameters << item->use_slider; - QByteArray replay_data; - QCString replay_type; - bool ok = kapp->dcopClient()->call( str_result.utf8(), "Parser", "addFunction(QString,bool,bool,bool,bool,bool,int,int,int,int,QString,QString,QString,QString,double,QRgb,QRgb,QRgb,QRgb,QStringList,int)", parameters, replay_type, replay_data, false); + TQByteArray replay_data; + TQCString replay_type; + bool ok = kapp->dcopClient()->call( str_result.utf8(), "Parser", "addFunction(TQString,bool,bool,bool,bool,bool,int,int,int,int,TQString,TQString,TQString,TQString,double,QRgb,QRgb,QRgb,QRgb,TQStringList,int)", parameters, replay_type, replay_data, false); if (!ok) { KMessageBox::error(0, i18n("An error appeared during the transfer")); return false; } - QDataStream replay_arg(replay_data, IO_ReadOnly); + TQDataStream replay_arg(replay_data, IO_ReadOnly); bool result; replay_arg >> result; if (!result) @@ -817,7 +817,7 @@ bool XParser::sendFunction(int id, const QString &dcopclient_target) return false; } - kapp->dcopClient()->send(str_result.utf8(), "View","drawPlot()",QByteArray() ); //update the other window + kapp->dcopClient()->send(str_result.utf8(), "View","drawPlot()",TQByteArray() ); //update the other window if (item->fname.at(0) == 'x') // a parametric function return sendFunction(id+1, str_result); diff --git a/kmplot/kmplot/xparser.h b/kmplot/kmplot/xparser.h index 78c4463e..d54b3506 100644 --- a/kmplot/kmplot/xparser.h +++ b/kmplot/kmplot/xparser.h @@ -51,7 +51,7 @@ public: /// Evaluates the 2nd dreivative of the function with intex \a ix double a2fkt( Ufkt *, double, double h = 1e-3 ); /// calculate euler's method when drawing a numeric prime-function - double euler_method(const double, const QValueVector::iterator); + double euler_method(const double, const TQValueVector::iterator); /// Line width default int linewidth0; @@ -59,7 +59,7 @@ public: enum { Function, Polar, ParametricX, ParametricY }; ///types of functions ///Returns an unused function name if it is needed - void fixFunctionName(QString &, int const = XParser::Function , int const=-1); + void fixFunctionName(TQString &, int const = XParser::Function , int const=-1); /// Returns the index for the next function. int getNextIndex(); @@ -67,15 +67,15 @@ public: void prepareAddingFunction(Ufkt *item); /// Interpretates the extended function string (only used by the old file format) - bool getext( Ufkt *, const QString ); + bool getext( Ufkt *, const TQString ); /// Send a function to an other instance of Kmplot. Returns true if it success, otherwise false - bool sendFunction(int id, const QString &dcopclient_target=""); + bool sendFunction(int id, const TQString &dcopclient_target=""); /// Functions for the DCOP interface: /// Returns a list with all functions - QStringList listFunctionNames(); + TQStringList listFunctionNames(); /// Returns true if the graph is visible, otherwise false. bool functionFVisible(uint id); @@ -89,19 +89,19 @@ public: bool setFunctionIntVisible(bool visible, uint id); /// Returns the function expression, or an empty string if the function couldn't be found - QString functionStr(uint id); + TQString functionStr(uint id); /// Returns the complete function string including the extensions of a function, or an empty string if the function couldn't be found /// Get the color of a graph - QColor functionFColor(uint id); - QColor functionF1Color(uint id); - QColor functionF2Color(uint id); - QColor functionIntColor(uint id); + TQColor functionFColor(uint id); + TQColor functionF1Color(uint id); + TQColor functionF2Color(uint id); + TQColor functionIntColor(uint id); /// Set the color of a graph. Returns true if it succeeds, otherwise false. - bool setFunctionFColor(const QColor &color, uint id); - bool setFunctionF1Color(const QColor &color, uint id); - bool setFunctionF2Color(const QColor &color, uint id); - bool setFunctionIntColor(const QColor &color, uint id); + bool setFunctionFColor(const TQColor &color, uint id); + bool setFunctionF1Color(const TQColor &color, uint id); + bool setFunctionF2Color(const TQColor &color, uint id); + bool setFunctionIntColor(const TQColor &color, uint id); /// Get the line width of a graph int functionFLineWidth(uint id); @@ -115,30 +115,30 @@ public: bool setFunctionIntLineWidth(int linewidth, uint id); /// Returns the function's parameter list - QStringList functionParameterList(uint id); - bool functionAddParameter(const QString &new_parameter, uint id); - bool functionRemoveParameter(const QString &remove_parameter, uint id); - int addFunction(const QString &f_str); - bool addFunction(const QString &extstr, bool f_mode, bool f1_mode, bool f2_mode, bool integral_mode, bool integral_use_precision, int linewidth, int f1_linewidth, int f2_linewidth, int integral_linewidth, const QString &str_dmin, const QString &str_dmax, const QString &str_startx, const QString &str_starty, double integral_precision, QRgb color, QRgb f1_color, QRgb f2_color, QRgb integral_color, QStringList str_parameter, int use_slider); - bool setFunctionExpression(const QString &f_str, uint id); + TQStringList functionParameterList(uint id); + bool functionAddParameter(const TQString &new_parameter, uint id); + bool functionRemoveParameter(const TQString &remove_parameter, uint id); + int addFunction(const TQString &f_str); + bool addFunction(const TQString &extstr, bool f_mode, bool f1_mode, bool f2_mode, bool integral_mode, bool integral_use_precision, int linewidth, int f1_linewidth, int f2_linewidth, int integral_linewidth, const TQString &str_dmin, const TQString &str_dmax, const TQString &str_startx, const TQString &str_starty, double integral_precision, QRgb color, QRgb f1_color, QRgb f2_color, QRgb integral_color, TQStringList str_parameter, int use_slider); + bool setFunctionExpression(const TQString &f_str, uint id); /// Get the min and max value of a graph - QString functionMinValue(uint id); - QString functionMaxValue(uint id); + TQString functionMinValue(uint id); + TQString functionMaxValue(uint id); /// Set the min and max values of a graph. Returns true if it succeeds, otherwise false. - bool setFunctionMinValue(const QString &min, uint id); - bool setFunctionMaxValue(const QString &max, uint id); + bool setFunctionMinValue(const TQString &min, uint id); + bool setFunctionMaxValue(const TQString &max, uint id); /// Get the startx and starty value of a graph - QString functionStartXValue(uint id); - QString functionStartYValue(uint id); + TQString functionStartXValue(uint id); + TQString functionStartYValue(uint id); /// Set the startx and starty values of a graph. Returns true if it succeeds, otherwise false. - bool setFunctionStartXValue(const QString &x, uint id); - bool setFunctionStartYValue(const QString &y, uint id); + bool setFunctionStartXValue(const TQString &x, uint id); + bool setFunctionStartYValue(const TQString &y, uint id); private: /// finds a free function name - void findFunctionName(QString &, int const, int const); + void findFunctionName(TQString &, int const, int const); /// indicates if the widget is changed bool &m_modified; }; diff --git a/kpercentage/kpercentage/kanimation.cpp b/kpercentage/kpercentage/kanimation.cpp index a0e77910..93974af3 100644 --- a/kpercentage/kpercentage/kanimation.cpp +++ b/kpercentage/kpercentage/kanimation.cpp @@ -2,7 +2,7 @@ #include // Qt includes -#include +#include // KDE includes #include @@ -32,7 +32,7 @@ KScene::KScene() { current_frame_number = 0; setAutoDelete( TRUE ); - following = new QStrList( TRUE ); // deep copy + following = new TQStrList( TRUE ); // deep copy following->setAutoDelete( TRUE ); } @@ -58,12 +58,12 @@ KFrame *KScene::currentFrame() return 0; } -void KScene::addFollowingScene( const QString scene_name ) +void KScene::addFollowingScene( const TQString scene_name ) { following->append( scene_name.latin1() ); } -void KScene::followingSceneName( QString& scene_name ) +void KScene::followingSceneName( TQString& scene_name ) { if ( following->count() == 0 ) scene_name = ""; @@ -80,23 +80,23 @@ void KScene::setToStart() ///////////// // KStoryBoard -KStoryBoard::KStoryBoard( const QString filename ) : QDict() +KStoryBoard::KStoryBoard( const TQString filename ) : TQDict() { current_scene = 0; - QFile f( filename ); + TQFile f( filename ); KScene *c_scene = 0; if ( f.open( IO_ReadOnly ) ) // file opened successfully { - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream kdDebug() << "loading the story board..." << endl; while ( !t.eof() ) // until end of file... { - QString s = t.readLine(); // line of text excluding '\n' - QString dbgString = s; + TQString s = t.readLine(); // line of text excluding '\n' + TQString dbgString = s; int pos = s.find ( "#"); if (pos==-1) pos = s.find ( ";"); @@ -108,11 +108,11 @@ KStoryBoard::KStoryBoard( const QString filename ) : QDict() } if ( !s.isEmpty() ) { - QString command_word = s.section( " ", 0, 0 ); + TQString command_word = s.section( " ", 0, 0 ); // new scene beginning if ( command_word == "name" ) { - QString scene_name = s.section( " ", 1, 1 ); + TQString scene_name = s.section( " ", 1, 1 ); c_scene = new KScene(); insert( scene_name, c_scene ); kdDebug() << "scene found: " << scene_name << endl; @@ -120,7 +120,7 @@ KStoryBoard::KStoryBoard( const QString filename ) : QDict() // new frame if ( c_scene && command_word == "move" ) { - QString parameters = s.section( " ", 1, 1 ); + TQString parameters = s.section( " ", 1, 1 ); c_scene->append( new KFrame( parameters.section( ",", 0, 0 ).toDouble(), parameters.section( ",", 1, 1 ).toDouble(), @@ -161,7 +161,7 @@ KStoryBoard::KStoryBoard( const QString filename ) : QDict() return current_scene->currentFrame(); else { - QString scene_name; + TQString scene_name; current_scene->followingSceneName( scene_name ); current_scene = find( scene_name ); if ( current_scene ) @@ -189,9 +189,9 @@ KStoryBoard::KStoryBoard( const QString filename ) : QDict() ////////// // KAnimation - KAnimation::KAnimation( const QString story_filename, - QCanvasPixmapArray * a, QCanvas * canvas ) : - QCanvasSprite( a, canvas ) + KAnimation::KAnimation( const TQString story_filename, + TQCanvasPixmapArray * a, TQCanvas * canvas ) : + TQCanvasSprite( a, canvas ) { story = new KStoryBoard( story_filename ); } diff --git a/kpercentage/kpercentage/kanimation.h b/kpercentage/kpercentage/kanimation.h index 97d492f5..2f5b0462 100644 --- a/kpercentage/kpercentage/kanimation.h +++ b/kpercentage/kpercentage/kanimation.h @@ -1,8 +1,8 @@ #ifndef KANIMATION_H #define KANIMATION_H -#include -#include +#include +#include class QString; @@ -32,7 +32,7 @@ class KFrame * This class handles a list of frames, called "scene". * Also a list of possibly following scene names is maintained. */ -class KScene: public QPtrList +class KScene: public TQPtrList { public: /** @@ -58,26 +58,26 @@ class KScene: public QPtrList /** * adds a scene name */ - void addFollowingScene( const QString scene_name ); + void addFollowingScene( const TQString scene_name ); /** * selects a scene out of the list of possibly following scenes. */ - void followingSceneName( QString& scene_name); + void followingSceneName( TQString& scene_name); void setToStart(); private: - QStrList *following; + TQStrList *following; unsigned int current_frame_number; }; /** * KStoryBoard */ -class KStoryBoard: public QDict +class KStoryBoard: public TQDict { public: - KStoryBoard( const QString filename ); + KStoryBoard( const TQString filename ); ~KStoryBoard(); KFrame *nextFrame(); @@ -91,7 +91,7 @@ class KStoryBoard: public QDict class KAnimation: public QCanvasSprite { public: - KAnimation( const QString stroy_filename, QCanvasPixmapArray *a, QCanvas *canvas ); + KAnimation( const TQString stroy_filename, TQCanvasPixmapArray *a, TQCanvas *canvas ); ~KAnimation(); virtual void advance( int phase ); diff --git a/kpercentage/kpercentage/kanswer.cpp b/kpercentage/kpercentage/kanswer.cpp index 3042008c..d723629b 100644 --- a/kpercentage/kpercentage/kanswer.cpp +++ b/kpercentage/kpercentage/kanswer.cpp @@ -24,9 +24,9 @@ #include // Qt includes -#include -#include -#include +#include +#include +#include // KDE includes #include @@ -40,42 +40,42 @@ #include "kanimation.h" #include "kanswer.h" -KAnswer::KAnswer( QWidget *parent ): KDialog( parent, "answer", TRUE ) +KAnswer::KAnswer( TQWidget *parent ): KDialog( parent, "answer", TRUE ) { setFont( parent->font() ); // fix size for the background pixmap - setFixedSize( QSize( 430, 190 ) ); + setFixedSize( TQSize( 430, 190 ) ); // load background pixmap - QPixmap bgp( locate( "data", "kpercentage/pics/kanswer_bg.png" ) ); + TQPixmap bgp( locate( "data", "kpercentage/pics/kanswer_bg.png" ) ); setBackgroundPixmap( bgp ); setupSprite(); ButtonOK = new KPushButton( KStdGuiItem::ok(), this ); // for the bottons edges - ButtonOK->setBackgroundOrigin( QPushButton::ParentOrigin ); - ButtonOK->setIconSet( QIconSet( DesktopIcon( "button_ok" ) ) ); + ButtonOK->setBackgroundOrigin( TQPushButton::ParentOrigin ); + ButtonOK->setIconSet( TQIconSet( DesktopIcon( "button_ok" ) ) ); // ButtonOK->hide(); - TextLabelAnswer = new QLabel( this ); + TextLabelAnswer = new TQLabel( this ); // make the label transparent - TextLabelAnswer->setBackgroundOrigin( QLabel::ParentOrigin ); + TextLabelAnswer->setBackgroundOrigin( TQLabel::ParentOrigin ); TextLabelAnswer->setBackgroundPixmap( bgp ); canvas->setBackgroundPixmap( bgp ); - canvas_view->setBackgroundOrigin( QCanvasView::ParentOrigin ); + canvas_view->setBackgroundOrigin( TQCanvasView::ParentOrigin ); canvas_view->setBackgroundPixmap( bgp ); /////// // begin layouting /////// - mainLayout = new QHBoxLayout( this ); - mainLayout->setDirection(QBoxLayout::LeftToRight); + mainLayout = new TQHBoxLayout( this ); + mainLayout->setDirection(TQBoxLayout::LeftToRight); // mainLayout->addSpacing( 20 ); - QVBoxLayout *leftLayout = new QVBoxLayout( mainLayout, -1, "main" ); + TQVBoxLayout *leftLayout = new TQVBoxLayout( mainLayout, -1, "main" ); // leftLayout->addSpacing( 20 ); leftLayout->addWidget( canvas_view ); leftLayout->addSpacing( 20 ); @@ -83,20 +83,20 @@ KAnswer::KAnswer( QWidget *parent ): KDialog( parent, "answer", TRUE ) mainLayout->addSpacing( 60 ); - QVBoxLayout *rightLayout = new QVBoxLayout( mainLayout, -1, "right" ); + TQVBoxLayout *rightLayout = new TQVBoxLayout( mainLayout, -1, "right" ); rightLayout->addStretch( 2 ); - QHBoxLayout *topLayout = new QHBoxLayout( rightLayout, -1, "top" ); - topLayout->setDirection(QBoxLayout::LeftToRight); + TQHBoxLayout *topLayout = new TQHBoxLayout( rightLayout, -1, "top" ); + topLayout->setDirection(TQBoxLayout::LeftToRight); topLayout->addStretch(); topLayout->addWidget( TextLabelAnswer ); topLayout->addStretch(); rightLayout->addStretch( 2 ); - QHBoxLayout *bottomLayout = new QHBoxLayout( rightLayout, -1, "bottom" ); - bottomLayout->setDirection(QBoxLayout::LeftToRight); + TQHBoxLayout *bottomLayout = new TQHBoxLayout( rightLayout, -1, "bottom" ); + bottomLayout->setDirection(TQBoxLayout::LeftToRight); bottomLayout->addStretch(); bottomLayout->addWidget( ButtonOK ); bottomLayout->addSpacing( 20 ); @@ -106,22 +106,22 @@ KAnswer::KAnswer( QWidget *parent ): KDialog( parent, "answer", TRUE ) // end layouting /////// - connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( ButtonOK, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); loadAnswers(); } void KAnswer::loadAnswers() { // helping to manage the IO - QString s; - QFile f; - QTextStream t; + TQString s; + TQFile f; + TQTextStream t; //reading proper answers from file f.setName( locate( "data", "kpercentage/right.txt" ) ); if ( f.open( IO_ReadOnly ) ) // file opened successfully { - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream while ( !t.eof() ) // until end of file... { s = t.readLine(); // line of text excluding '\n' @@ -134,7 +134,7 @@ void KAnswer::loadAnswers() f.setName( locate( "data", "kpercentage/wrong.txt" ) ); if ( f.open( IO_ReadOnly ) ) // file opened successfully { - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream while ( !t.eof() ) // until end of file... { s = t.readLine(); // line of text excluding '\n' @@ -198,13 +198,13 @@ void KAnswer::setAnswer( int modus ) } // reads one answer out of the list by chance -QString KAnswer::getRightAnswer() +TQString KAnswer::getRightAnswer() { return i18n( rightAnswerList[ random() % rightAnswerList.count() ].utf8() ); } // reads one answer out of the list by chance -QString KAnswer::getWrongAnswer() +TQString KAnswer::getWrongAnswer() { return i18n( wrongAnswerList[ random() % wrongAnswerList.count() ].utf8() ); } @@ -217,24 +217,24 @@ void KAnswer::setupSprite() advPer = 80; - canvas = new QCanvas( this ); + canvas = new TQCanvas( this ); canvas->resize( size().width(), size().height() ); - pixs = new QCanvasPixmapArray( locate( "data", "kpercentage/pics/" )+"smily%1.png", 7 ); + pixs = new TQCanvasPixmapArray( locate( "data", "kpercentage/pics/" )+"smily%1.png", 7 ); right_animation = new KAnimation( locate( "data", "kpercentage/story/right.story" ), pixs , canvas ); right_animation->setAnimated( TRUE ); wrong_animation = new KAnimation( locate( "data", "kpercentage/story/wrong.story" ), pixs , canvas ); wrong_animation->setAnimated( TRUE ); - canvas_view = new QCanvasView( canvas, this ); + canvas_view = new TQCanvasView( canvas, this ); canvas_view->resize( size() ); - canvas_view->setVScrollBarMode( QCanvasView::AlwaysOff ); - canvas_view->setHScrollBarMode( QCanvasView::AlwaysOff ); - canvas_view->setFrameStyle( QCanvasView::NoFrame ); + canvas_view->setVScrollBarMode( TQCanvasView::AlwaysOff ); + canvas_view->setHScrollBarMode( TQCanvasView::AlwaysOff ); + canvas_view->setFrameStyle( TQCanvasView::NoFrame ); } -void KAnswer::timerEvent( QTimerEvent *event ) +void KAnswer::timerEvent( TQTimerEvent *event ) { accept(); } diff --git a/kpercentage/kpercentage/kanswer.h b/kpercentage/kpercentage/kanswer.h index 32519398..5d603e41 100644 --- a/kpercentage/kpercentage/kanswer.h +++ b/kpercentage/kpercentage/kanswer.h @@ -54,7 +54,7 @@ class KAnswer : public KDialog * * @param parent Parent widget for modal functionality */ - KAnswer( QWidget *parent ); + KAnswer( TQWidget *parent ); // public functions /** setting/changing feedback text and pic */ @@ -62,7 +62,7 @@ class KAnswer : public KDialog public slots: /** reimplemented: close the window after some time */ - void timerEvent( QTimerEvent * ); + void timerEvent( TQTimerEvent * ); void accept(); int exec(); @@ -72,31 +72,31 @@ class KAnswer : public KDialog /** Loads feadback sentences from file */ void loadAnswers(); /** Gets a answer by chance for well solved tasks. */ - QString getRightAnswer(); + TQString getRightAnswer(); /** Gets a answer by chance for not solved tasks. */ - QString getWrongAnswer(); + TQString getWrongAnswer(); // GUI widgets /** Label for the answer text */ - QLabel *TextLabelAnswer; + TQLabel *TextLabelAnswer; /** OK button */ KPushButton *ButtonOK; /** List of feedback text for well solved tasks. */ - QStringList rightAnswerList; + TQStringList rightAnswerList; /** List of feedback text for not solved tasks. */ - QStringList wrongAnswerList; + TQStringList wrongAnswerList; - QHBoxLayout *mainLayout; + TQHBoxLayout *mainLayout; KAnimation *right_animation; KAnimation *wrong_animation; int advPer; - QCanvasView *canvas_view; - QCanvasPixmapArray *pixs; - QCanvas *canvas; + TQCanvasView *canvas_view; + TQCanvasPixmapArray *pixs; + TQCanvas *canvas; void setupSprite(); }; diff --git a/kpercentage/kpercentage/kpercentage.cpp b/kpercentage/kpercentage/kpercentage.cpp index d8ff8e34..f51f8364 100644 --- a/kpercentage/kpercentage/kpercentage.cpp +++ b/kpercentage/kpercentage/kpercentage.cpp @@ -23,10 +23,10 @@ #include // Qt includes -#include -#include -#include -#include +#include +#include +#include +#include // KDE includes #include @@ -52,7 +52,7 @@ KPercentage::KPercentage( const char *name ) : KIconLoader icon_loader; // let's set a suitable, not too small font size - QFont the_font( font() ); + TQFont the_font( font() ); the_font.setPointSize( 14 ); //the_font.setBold(true); setFont( the_font ); @@ -61,59 +61,59 @@ KPercentage::KPercentage( const char *name ) : percent_main = new KPercentMain( this, "KPercentage" ); // fixed geometry bacause of background pixmap - setFixedSize( QSize( 548, 248 ) ); + setFixedSize( TQSize( 548, 248 ) ); /** load and set background pixmap */ - QPixmap bgp( locate( "data", QApplication::reverseLayout() ? "kpercentage/pics/kpercentage_bg_rtl.png" : "kpercentage/pics/kpercentage_bg.png" ) ); + TQPixmap bgp( locate( "data", TQApplication::reverseLayout() ? "kpercentage/pics/kpercentage_bg_rtl.png" : "kpercentage/pics/kpercentage_bg.png" ) ); setBackgroundPixmap( bgp ); - QLabel *label_number = new QLabel( i18n( "Number of tasks:" ), this ); - QLabel *label_level = new QLabel( i18n( "Level:" ), this ); - QLabel *label_choose = new QLabel( i18n( "Choose an exercise type:" ), this ); + TQLabel *label_number = new TQLabel( i18n( "Number of tasks:" ), this ); + TQLabel *label_level = new TQLabel( i18n( "Level:" ), this ); + TQLabel *label_choose = new TQLabel( i18n( "Choose an exercise type:" ), this ); /** make labels transparent */ label_number->setBackgroundPixmap( bgp ); - label_number->setBackgroundOrigin( QLabel::ParentOrigin ); + label_number->setBackgroundOrigin( TQLabel::ParentOrigin ); label_level->setBackgroundPixmap( bgp ); - label_level->setBackgroundOrigin( QLabel::ParentOrigin ); + label_level->setBackgroundOrigin( TQLabel::ParentOrigin ); label_choose->setBackgroundPixmap( bgp ); - label_choose->setBackgroundOrigin( QLabel::ParentOrigin ); + label_choose->setBackgroundOrigin( TQLabel::ParentOrigin ); KPushButton *button_basevalue = new KPushButton( i18n( "x% &of ?? = y" ), this ); KPushButton *button_percentvalue = new KPushButton( i18n( "x% of &y = ??" ), this ); KPushButton *button_percentage = new KPushButton( i18n( "??% o&f x = y" ), this ); KPushButton *button_random = new KPushButton( i18n( "??" ), this ); KPushButton *button_help = new KPushButton( KStdGuiItem::help().text(), this ); - button_help->setIconSet( QIconSet( icon_loader.loadIcon( "help", KIcon::NoGroup, 32 ) ) ); + button_help->setIconSet( TQIconSet( icon_loader.loadIcon( "help", KIcon::NoGroup, 32 ) ) ); KHelpMenu *help_menu = new KHelpMenu( this, KGlobal::instance()->aboutData(), true ); - button_help->setPopup( ( QPopupMenu* ) ( help_menu->menu() ) ); + button_help->setPopup( ( TQPopupMenu* ) ( help_menu->menu() ) ); KPushButton *button_close = new KPushButton( i18n( "E&xit" ), this ); - button_close->setIconSet( QIconSet( icon_loader.loadIcon( "exit", KIcon::NoGroup, 32 ) ) ); + button_close->setIconSet( TQIconSet( icon_loader.loadIcon( "exit", KIcon::NoGroup, 32 ) ) ); combo_box_level = new KComboBox( this ); combo_box_level->insertItem( i18n( "Easy" ) ); combo_box_level->insertItem( i18n( "Medium" ) ); combo_box_level->insertItem( i18n( "Crazy" ) ); - spin_box_number = new QSpinBox( 1, 10, 1, this ); + spin_box_number = new TQSpinBox( 1, 10, 1, this ); spin_box_number->setValue( 5 ); // connecting all the slots - connect( button_basevalue, SIGNAL( clicked() ), this, SLOT( selBasevalue() ) ); - connect( button_percentvalue, SIGNAL( clicked() ), this, SLOT( selPercentvalue() ) ); - connect( button_percentage, SIGNAL( clicked() ), this, SLOT( selPercentage() ) ); - connect( button_random, SIGNAL( clicked() ), this, SLOT( selRandom() ) ); - connect( button_help, SIGNAL( clicked() ), this, SLOT( needHelp() ) ); - connect( button_close, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( button_basevalue, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selBasevalue() ) ); + connect( button_percentvalue, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selPercentvalue() ) ); + connect( button_percentage, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selPercentage() ) ); + connect( button_random, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selRandom() ) ); + connect( button_help, TQT_SIGNAL( clicked() ), this, TQT_SLOT( needHelp() ) ); + connect( button_close, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); //////// // begin layouting //////// - QVBoxLayout *main_layout = new QVBoxLayout( this, 20, 20, "main_layout" ); - main_layout->setResizeMode( QLayout::FreeResize ); + TQVBoxLayout *main_layout = new TQVBoxLayout( this, 20, 20, "main_layout" ); + main_layout->setResizeMode( TQLayout::FreeResize ); - QHBoxLayout *top_layout = new QHBoxLayout( main_layout, -1, "top_layout" ); + TQHBoxLayout *top_layout = new TQHBoxLayout( main_layout, -1, "top_layout" ); top_layout->addWidget( label_number ); top_layout->addWidget( spin_box_number ); top_layout->addSpacing( 20 ); @@ -124,12 +124,12 @@ KPercentage::KPercentage( const char *name ) : main_layout->addSpacing( 40 ); main_layout->addStretch(); - QHBoxLayout *bottom_layout = new QHBoxLayout( main_layout, -1, "bottom_layout" ); - QVBoxLayout *bLeftLayout = new QVBoxLayout( bottom_layout ); + TQHBoxLayout *bottom_layout = new TQHBoxLayout( main_layout, -1, "bottom_layout" ); + TQVBoxLayout *bLeftLayout = new TQVBoxLayout( bottom_layout ); bLeftLayout->addWidget( label_choose ); bLeftLayout->addSpacing( 10 ); - QGridLayout *grid_layout = new QGridLayout( bLeftLayout, 2, 2, 10 ); + TQGridLayout *grid_layout = new TQGridLayout( bLeftLayout, 2, 2, 10 ); grid_layout->addWidget( button_basevalue, 0, 0 ); grid_layout->addWidget( button_percentvalue, 1, 0 ); grid_layout->addWidget( button_percentage, 0, 1 ); @@ -137,7 +137,7 @@ KPercentage::KPercentage( const char *name ) : bottom_layout->addStretch(); - QVBoxLayout *b_right_layout = new QVBoxLayout( bottom_layout ); + TQVBoxLayout *b_right_layout = new TQVBoxLayout( bottom_layout ); b_right_layout->addStretch(); b_right_layout->addWidget( button_help ); b_right_layout->addSpacing( 10 ); @@ -150,25 +150,25 @@ KPercentage::KPercentage( const char *name ) : //////// // Tooltips - QToolTip::add( button_basevalue, i18n( "Exercises with base value omitted" ) ); - QToolTip::add( button_percentvalue, i18n( "Exercises with percent value omitted" ) ); - QToolTip::add( button_percentage, i18n( "Exercises with percentage omitted" ) ); - QToolTip::add( button_random, i18n( "Several exercise types in random" ) ); - QToolTip::add( spin_box_number, i18n( "Choose the number of exercises from 1 to 10." ) ); - QToolTip::add( combo_box_level, i18n( "Choose the level of difficulty." ) ); - QToolTip::add( button_close, i18n( "Close KPercentage." ) ); - QToolTip::add( button_help, i18n( "Get some help." ) ); + TQToolTip::add( button_basevalue, i18n( "Exercises with base value omitted" ) ); + TQToolTip::add( button_percentvalue, i18n( "Exercises with percent value omitted" ) ); + TQToolTip::add( button_percentage, i18n( "Exercises with percentage omitted" ) ); + TQToolTip::add( button_random, i18n( "Several exercise types in random" ) ); + TQToolTip::add( spin_box_number, i18n( "Choose the number of exercises from 1 to 10." ) ); + TQToolTip::add( combo_box_level, i18n( "Choose the level of difficulty." ) ); + TQToolTip::add( button_close, i18n( "Close KPercentage." ) ); + TQToolTip::add( button_help, i18n( "Get some help." ) ); //////// // WhatsThis - QWhatsThis::add( button_basevalue, i18n( "Click here to start a sequence of exercises where the base value is omitted.") ); - QWhatsThis::add( button_percentvalue, i18n( "Click here to start a sequence of exercises where the percent value is omitted." ) ); - QWhatsThis::add( button_percentage, i18n( "Click here to start a sequence of exercises where the percentage is omitted." ) ); - QWhatsThis::add( button_random, i18n( "Click here to start a sequence of exercises where one value is omitted at random." ) ); - QWhatsThis::add( spin_box_number, i18n( "Here you can adjust the number of exercises from 1 to 10." ) ); - QWhatsThis::add( combo_box_level, i18n( "Choose one of the levels easy, medium, and crazy." ) ); - QWhatsThis::add( button_close, i18n( "Close KPercentage." ) ); - QWhatsThis::add( button_help, i18n( "Get some help." ) ); + TQWhatsThis::add( button_basevalue, i18n( "Click here to start a sequence of exercises where the base value is omitted.") ); + TQWhatsThis::add( button_percentvalue, i18n( "Click here to start a sequence of exercises where the percent value is omitted." ) ); + TQWhatsThis::add( button_percentage, i18n( "Click here to start a sequence of exercises where the percentage is omitted." ) ); + TQWhatsThis::add( button_random, i18n( "Click here to start a sequence of exercises where one value is omitted at random." ) ); + TQWhatsThis::add( spin_box_number, i18n( "Here you can adjust the number of exercises from 1 to 10." ) ); + TQWhatsThis::add( combo_box_level, i18n( "Choose one of the levels easy, medium, and crazy." ) ); + TQWhatsThis::add( button_close, i18n( "Close KPercentage." ) ); + TQWhatsThis::add( button_help, i18n( "Get some help." ) ); } void KPercentage::selPercentage() @@ -210,7 +210,7 @@ void KPercentage::startExercise() percent_main->setNumber( spin_box_number->value() ); percent_main->selected_level = combo_box_level->currentItem(); percent_main->initExercise(); - QPoint p = pos(); + TQPoint p = pos(); hide(); percent_main->move( p ); percent_main->exec(); @@ -223,7 +223,7 @@ void KPercentage::needHelp() kapp->invokeHelp( "", "kpercentage" ); } -void KPercentage::closeEvent( QCloseEvent * ) +void KPercentage::closeEvent( TQCloseEvent * ) { exit( 0 ); } diff --git a/kpercentage/kpercentage/kpercentage.h b/kpercentage/kpercentage/kpercentage.h index ff06c102..c4b9b42c 100644 --- a/kpercentage/kpercentage/kpercentage.h +++ b/kpercentage/kpercentage/kpercentage.h @@ -27,7 +27,7 @@ #endif // Qt includes -#include +#include // KDE includes #include @@ -70,13 +70,13 @@ public slots: // Public slots protected: /** closes the application */ - void closeEvent(QCloseEvent *); + void closeEvent(TQCloseEvent *); private: /** Choose the level: easy, medium, crazy */ KComboBox *combo_box_level; /** Choose the number of exercises. */ - QSpinBox *spin_box_number; + TQSpinBox *spin_box_number; /** common preparing the exercise */ void startExercise(); diff --git a/kpercentage/kpercentage/kpercentmain.cpp b/kpercentage/kpercentage/kpercentmain.cpp index 276b787d..67f4a687 100644 --- a/kpercentage/kpercentage/kpercentmain.cpp +++ b/kpercentage/kpercentage/kpercentmain.cpp @@ -24,11 +24,11 @@ #include // Qt includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // KDE includes #include @@ -42,94 +42,94 @@ #include "kpercentage.h" -KPercentMain::KPercentMain( QWidget *parent, const char *name ) : +KPercentMain::KPercentMain( TQWidget *parent, const char *name ) : KDialog( parent, name, TRUE ) // TRUE for modal dialog { setFont( parent->font() ); /** load and set the background pixmap */ - QPixmap bgp( locate( "data", QApplication::reverseLayout() ? "kpercentage/pics/kpercentmain_bg_rtl.png" : "kpercentage/pics/kpercentmain_bg.png" ) ); + TQPixmap bgp( locate( "data", TQApplication::reverseLayout() ? "kpercentage/pics/kpercentmain_bg_rtl.png" : "kpercentage/pics/kpercentmain_bg.png" ) ); // resize( 520, 220 ); - setFixedSize( QSize( 520, 275 ) ); + setFixedSize( TQSize( 520, 275 ) ); setBackgroundPixmap( bgp ); - setBackgroundOrigin( QDialog::ParentOrigin ); + setBackgroundOrigin( TQDialog::ParentOrigin ); KIntValidator *validLine = new KIntValidator( this ); - line_edit_percentage = new QLineEdit( this, "line_edit_percentage" ); - line_edit_percentage->setAlignment( int( QLineEdit::AlignHCenter ) ); + line_edit_percentage = new TQLineEdit( this, "line_edit_percentage" ); + line_edit_percentage->setAlignment( int( TQLineEdit::AlignHCenter ) ); line_edit_percentage->setValidator( validLine ); - line_edit_basevalue = new QLineEdit( this, "line_edit_basevalue" ); - line_edit_basevalue->setAlignment( int( QLineEdit::AlignHCenter ) ); + line_edit_basevalue = new TQLineEdit( this, "line_edit_basevalue" ); + line_edit_basevalue->setAlignment( int( TQLineEdit::AlignHCenter ) ); line_edit_basevalue->setValidator( validLine ); - line_edit_percentvalue = new QLineEdit( this, "line_edit_percentvalue" ); - line_edit_percentvalue->setAlignment( int( QLineEdit::AlignHCenter ) ); + line_edit_percentvalue = new TQLineEdit( this, "line_edit_percentvalue" ); + line_edit_percentvalue->setAlignment( int( TQLineEdit::AlignHCenter ) ); line_edit_percentvalue->setValidator( validLine ); - progress_bar_count = new QProgressBar( this, "progress_bar_count" ); - progress_bar_count->setFrameShape( QProgressBar::Panel ); - progress_bar_count->setFrameShadow( QProgressBar::Sunken ); + progress_bar_count = new TQProgressBar( this, "progress_bar_count" ); + progress_bar_count->setFrameShape( TQProgressBar::Panel ); + progress_bar_count->setFrameShadow( TQProgressBar::Sunken ); // progress_bar_count->setFixedWidth( 250 ); - progress_bar_right_wrong = new QProgressBar( this, "progress_bar_right" ); - progress_bar_right_wrong->setFrameShape( QProgressBar::Panel ); - progress_bar_right_wrong->setFrameShadow( QProgressBar::Sunken ); + progress_bar_right_wrong = new TQProgressBar( this, "progress_bar_right" ); + progress_bar_right_wrong->setFrameShape( TQProgressBar::Panel ); + progress_bar_right_wrong->setFrameShadow( TQProgressBar::Sunken ); // progress_bar_right_wrong->setFixedWidth( 250 ); progress_bar_right_wrong->setPercentageVisible( FALSE ); - progress_bar_right_wrong->setPaletteBackgroundColor( QColor( "red" ) ); + progress_bar_right_wrong->setPaletteBackgroundColor( TQColor( "red" ) ); - label_right = new QLabel( this, "" ); + label_right = new TQLabel( this, "" ); label_right->setBackgroundPixmap( bgp ); - label_right->setBackgroundOrigin( QDialog::ParentOrigin ); - label_wrong = new QLabel( this, "" ); + label_right->setBackgroundOrigin( TQDialog::ParentOrigin ); + label_wrong = new TQLabel( this, "" ); label_wrong->setBackgroundPixmap( bgp ); - label_wrong->setBackgroundOrigin( QDialog::ParentOrigin ); + label_wrong->setBackgroundOrigin( TQDialog::ParentOrigin ); - push_button_apply = new QPushButton( this, "push_button_apply" ); + push_button_apply = new TQPushButton( this, "push_button_apply" ); push_button_apply->setText( KStdGuiItem::apply().text() ); push_button_apply->setDefault( TRUE ); push_button_apply->setBackgroundPixmap( bgp); - push_button_apply->setBackgroundOrigin( QPushButton::ParentOrigin ); + push_button_apply->setBackgroundOrigin( TQPushButton::ParentOrigin ); - push_button_cancel = new QPushButton( this, "push_button_cancel" ); + push_button_cancel = new TQPushButton( this, "push_button_cancel" ); push_button_cancel->setText( KStdGuiItem::cancel().text() ); KIconLoader icon_loader; - push_button_apply->setIconSet( QIconSet( icon_loader.loadIcon( "button_ok", KIcon::NoGroup, 32 ) ) ); - push_button_cancel->setIconSet( QIconSet( icon_loader.loadIcon( "button_cancel", KIcon::NoGroup, 32 ) ) ); + push_button_apply->setIconSet( TQIconSet( icon_loader.loadIcon( "button_ok", KIcon::NoGroup, 32 ) ) ); + push_button_cancel->setIconSet( TQIconSet( icon_loader.loadIcon( "button_cancel", KIcon::NoGroup, 32 ) ) ); - label_1 = new QLabel( this, "label_1" ); + label_1 = new TQLabel( this, "label_1" ); label_1->setText( i18n( " % of " ) ); label_1->setBackgroundPixmap( bgp ); - label_1->setBackgroundOrigin( QDialog::ParentOrigin ); + label_1->setBackgroundOrigin( TQDialog::ParentOrigin ); - label_2 = new QLabel( this, "label_2" ); + label_2 = new TQLabel( this, "label_2" ); label_2->setText( i18n( " = " ) ); label_2->setBackgroundPixmap( bgp ); - label_2->setBackgroundOrigin( QDialog::ParentOrigin ); + label_2->setBackgroundOrigin( TQDialog::ParentOrigin ); - label_number = new QLabel( this, "label_number" ); + label_number = new TQLabel( this, "label_number" ); label_number->setBackgroundPixmap( bgp ); - label_number->setBackgroundOrigin( QDialog::ParentOrigin ); + label_number->setBackgroundOrigin( TQDialog::ParentOrigin ); label_number->setText( i18n( "Task no. MM:" ) ); // for the right width - label_count = new QLabel( this, "label_count" ); + label_count = new TQLabel( this, "label_count" ); label_count->setText( i18n( "You got MM of MM." ) ); // for the right width label_count->setBackgroundPixmap( bgp ); - label_count->setBackgroundOrigin( QDialog::ParentOrigin ); + label_count->setBackgroundOrigin( TQDialog::ParentOrigin ); ////// // begin layouting ////// - QVBoxLayout *main_layout = new QVBoxLayout ( this, 0, -1, "main_layout" ); + TQVBoxLayout *main_layout = new TQVBoxLayout ( this, 0, -1, "main_layout" ); main_layout->setMargin( 20 ); main_layout->setSpacing( 10 ); - QHBoxLayout *label_number_layout = new QHBoxLayout ( main_layout, -1, "label_number_layout" ); + TQHBoxLayout *label_number_layout = new TQHBoxLayout ( main_layout, -1, "label_number_layout" ); label_number_layout->addWidget( label_number ); label_number_layout->addStretch(); - QHBoxLayout *line_edit_layout = new QHBoxLayout ( main_layout, -1, "line_edit_layout" ); + TQHBoxLayout *line_edit_layout = new TQHBoxLayout ( main_layout, -1, "line_edit_layout" ); line_edit_layout->addWidget( line_edit_percentage ); line_edit_layout->addWidget( label_1 ); @@ -140,18 +140,18 @@ KPercentMain::KPercentMain( QWidget *parent, const char *name ) : main_layout->addStretch(); - QHBoxLayout *bottom_layout = new QHBoxLayout( main_layout, -1, "bottom_layout" ); + TQHBoxLayout *bottom_layout = new TQHBoxLayout( main_layout, -1, "bottom_layout" ); - QVBoxLayout *current_state_layout = new QVBoxLayout ( bottom_layout, -1, "current_state_layout" ); + TQVBoxLayout *current_state_layout = new TQVBoxLayout ( bottom_layout, -1, "current_state_layout" ); - QHBoxLayout *label_count_layout = new QHBoxLayout ( current_state_layout, -1, "label_count_layout" ); + TQHBoxLayout *label_count_layout = new TQHBoxLayout ( current_state_layout, -1, "label_count_layout" ); label_count_layout->addWidget( label_count ); label_count_layout->addStretch(); current_state_layout->addSpacing( 10 ); current_state_layout->addWidget( progress_bar_count ); - QHBoxLayout *right_wrong_layout = new QHBoxLayout( current_state_layout, -1, "right_wrong_layout" ); + TQHBoxLayout *right_wrong_layout = new TQHBoxLayout( current_state_layout, -1, "right_wrong_layout" ); right_wrong_layout->addWidget( label_right ); right_wrong_layout->addWidget( progress_bar_right_wrong ); @@ -159,7 +159,7 @@ KPercentMain::KPercentMain( QWidget *parent, const char *name ) : bottom_layout->addSpacing( 40 ); - QVBoxLayout *button_layout = new QVBoxLayout ( bottom_layout, -1, "button_layout" ); + TQVBoxLayout *button_layout = new TQVBoxLayout ( bottom_layout, -1, "button_layout" ); button_layout->addWidget( push_button_apply ); button_layout->addSpacing( 10 ); @@ -175,14 +175,14 @@ KPercentMain::KPercentMain( QWidget *parent, const char *name ) : /////////// // ToolTips - QToolTip::add( progress_bar_count, i18n( "Number of managed exercises" ) ); - QToolTip::add( progress_bar_right_wrong, i18n( "Relation of right to wrong inputs" ) ); - QToolTip::add( push_button_apply, i18n( "Check your answer" ) ); - QToolTip::add( push_button_cancel, i18n( "Back to the main window" ) ); + TQToolTip::add( progress_bar_count, i18n( "Number of managed exercises" ) ); + TQToolTip::add( progress_bar_right_wrong, i18n( "Relation of right to wrong inputs" ) ); + TQToolTip::add( push_button_apply, i18n( "Check your answer" ) ); + TQToolTip::add( push_button_cancel, i18n( "Back to the main window" ) ); // signals and slots connections - connect( push_button_apply, SIGNAL( clicked() ), this, SLOT( slotApplyInput() ) ); - connect( push_button_cancel, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( push_button_apply, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotApplyInput() ) ); + connect( push_button_cancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); // build up the answer window answer = new KAnswer( this ); @@ -202,12 +202,12 @@ void KPercentMain::newTask() line_edit_percentvalue->setFocusPolicy( NoFocus ); // set the number of managed tasks into a label - label_count->setText( QString( i18n("You got %1 of %2 exercises.").arg(count).arg(number) ) ); // update Label for the Progress + label_count->setText( TQString( i18n("You got %1 of %2 exercises.").arg(count).arg(number) ) ); // update Label for the Progress // progress_bar_count->setProgress( count*100 ); // updating Progrssbar startTimer( 10 ); // set string which task is just workin on (Task x of y) - QString taskNumber( i18n( "Exercise no. %1:" ).arg(count+1) ); + TQString taskNumber( i18n( "Exercise no. %1:" ).arg(count+1) ); label_number->setText( taskNumber ); // label_number->adjustSize(); @@ -313,9 +313,9 @@ void KPercentMain::slotApplyInput() /** inserts the numbers of a new task in the line_edit_layouts */ void KPercentMain::showNumbers() { - line_edit_percentage->setText( QString::number( percentage[ count ] ) ); - line_edit_basevalue->setText( QString::number( basevalue[ count ] ) ); - line_edit_percentvalue->setText( QString::number( percentvalue[ count ] ) ); + line_edit_percentage->setText( TQString::number( percentage[ count ] ) ); + line_edit_basevalue->setText( TQString::number( basevalue[ count ] ) ); + line_edit_percentvalue->setText( TQString::number( percentvalue[ count ] ) ); } /** called, if number tasks are managed */ @@ -444,7 +444,7 @@ void KPercentMain::initExercise() newTask(); /** prepare the window for the first task */ } -void KPercentMain::timerEvent( QTimerEvent *event ) +void KPercentMain::timerEvent( TQTimerEvent *event ) { if( progress_bar_count->progress()progress()==number*100 ) finished(); } -void KPercentMain::keyPressEvent( QKeyEvent * e ) +void KPercentMain::keyPressEvent( TQKeyEvent * e ) { if ( e->key() == Key_Enter ) slotApplyInput(); else diff --git a/kpercentage/kpercentage/kpercentmain.h b/kpercentage/kpercentage/kpercentmain.h index 6e6aea64..845e8289 100644 --- a/kpercentage/kpercentage/kpercentmain.h +++ b/kpercentage/kpercentage/kpercentmain.h @@ -45,7 +45,7 @@ class KPercentMain : public KDialog { Q_OBJECT public: - KPercentMain( QWidget *parent, const char *name = 0 ); + KPercentMain( TQWidget *parent, const char *name = 0 ); /** checks, if the task is solved right */ bool validateTask(); /** prepares the dialog for a new task */ @@ -88,30 +88,30 @@ class KPercentMain : public KDialog /** percentvalues to be calculated with */ int percentvalue[ 10 ]; - QLabel *label_1; - QLabel *label_2; - QLabel *label_number; - QLabel *label_count; + TQLabel *label_1; + TQLabel *label_2; + TQLabel *label_number; + TQLabel *label_count; /** editline for the actual task */ - QLineEdit *line_edit_input; + TQLineEdit *line_edit_input; /** editline for the percentage */ - QLineEdit *line_edit_percentage; + TQLineEdit *line_edit_percentage; /** editline for the basevalue */ - QLineEdit *line_edit_basevalue; + TQLineEdit *line_edit_basevalue; /** editline for the percentvalue */ - QLineEdit *line_edit_percentvalue; + TQLineEdit *line_edit_percentvalue; /** showing the effort of the user */ - QProgressBar *progress_bar_count; + TQProgressBar *progress_bar_count; /** button to apply the current input */ - QPushButton *push_button_apply; + TQPushButton *push_button_apply; /** button to cancel the exercise series */ - QPushButton *push_button_cancel; + TQPushButton *push_button_cancel; - QProgressBar *progress_bar_right_wrong; - QLabel *label_right; - QLabel *label_wrong; + TQProgressBar *progress_bar_right_wrong; + TQLabel *label_right; + TQLabel *label_wrong; /** the answer window */ KAnswer *answer; @@ -119,7 +119,7 @@ class KPercentMain : public KDialog int selected_level; private: - void keyPressEvent( QKeyEvent * e ); + void keyPressEvent( TQKeyEvent * e ); public slots: // Public slots @@ -131,7 +131,7 @@ class KPercentMain : public KDialog */ void slotApplyInput(); /** reimplemented: growing the progressbar step by step */ - void timerEvent( QTimerEvent * ); + void timerEvent( TQTimerEvent * ); }; #endif diff --git a/kpercentage/kpercentage/ksplashscreen.cpp b/kpercentage/kpercentage/ksplashscreen.cpp index bd0adea1..4eb43959 100644 --- a/kpercentage/kpercentage/ksplashscreen.cpp +++ b/kpercentage/kpercentage/ksplashscreen.cpp @@ -20,8 +20,8 @@ ***************************************************************************/ // Qt includes -#include -#include +#include +#include // KDE includes #include @@ -32,30 +32,30 @@ /* creates the splash window without titlebar and border */ KSplashScreen::KSplashScreen( KPercentage *percentage, const char *name ) : - KDialog( 0L, name, FALSE, QWidget::WStyle_Customize | QWidget::WStyle_NoBorder ) + KDialog( 0L, name, FALSE, TQWidget::WStyle_Customize | TQWidget::WStyle_NoBorder ) { percentage_window = percentage; resize( 380, 300 ); /* load the background pixmap */ - QPixmap bgp( locate( "data", "kpercentage/pics/splash.png" ) ); + TQPixmap bgp( locate( "data", "kpercentage/pics/splash.png" ) ); /* wait some time and start the main window */ - QCanvas *canvas = new QCanvas( this ); + TQCanvas *canvas = new TQCanvas( this ); canvas->resize( 400, 300 ); /* set the background pixmap */ canvas->setBackgroundPixmap( bgp ); //remove version number from splash annma 14/02/2005 - //QCanvasText *t = new QCanvasText( KPERCENTAGE_VERSION, canvas ); + //TQCanvasText *t = new TQCanvasText( KPERCENTAGE_VERSION, canvas ); //t->move( 330.0, 260.0 ); //t->show(); canvas->setAllChanged(); canvas->update(); - QCanvasView *view = new QCanvasView( canvas, this, "", QCanvasView::WStyle_Customize | QCanvasView::WStyle_NoBorder ); + TQCanvasView *view = new TQCanvasView( canvas, this, "", TQCanvasView::WStyle_Customize | TQCanvasView::WStyle_NoBorder ); view->resize( 380, 300 ); - view->setVScrollBarMode( QCanvasView::AlwaysOff ); - view->setHScrollBarMode( QCanvasView::AlwaysOff ); - view->setFrameStyle( QCanvasView::NoFrame ); + view->setVScrollBarMode( TQCanvasView::AlwaysOff ); + view->setHScrollBarMode( TQCanvasView::AlwaysOff ); + view->setFrameStyle( TQCanvasView::NoFrame ); view->show(); - QTimer::singleShot( 2000, this, SLOT( showPercentage() ) ); + TQTimer::singleShot( 2000, this, TQT_SLOT( showPercentage() ) ); } /* show the main window and close the splah window */ diff --git a/kstars/kstars/addcatdialog.cpp b/kstars/kstars/addcatdialog.cpp index e0be99de..07af36ff 100644 --- a/kstars/kstars/addcatdialog.cpp +++ b/kstars/kstars/addcatdialog.cpp @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include #include @@ -30,22 +30,22 @@ #include "addcatdialog.h" -AddCatDialog::AddCatDialog( QWidget *parent ) +AddCatDialog::AddCatDialog( TQWidget *parent ) : KDialogBase( KDialogBase::Plain, i18n( "Import Catalog" ), Help|Ok|Cancel, Ok, parent ) { - QFrame *page = plainPage(); + TQFrame *page = plainPage(); setMainWidget(page); - QDir::setCurrent( QDir::homeDirPath() ); + TQDir::setCurrent( TQDir::homeDirPath() ); - vlay = new QVBoxLayout( page, 0, spacingHint() ); + vlay = new TQVBoxLayout( page, 0, spacingHint() ); acd = new AddCatDialogUI(page); vlay->addWidget( acd ); - connect( acd->DataURL->lineEdit(), SIGNAL( lostFocus() ), this, SLOT( slotShowDataFile() ) ); - connect( acd->DataURL, SIGNAL( urlSelected( const QString & ) ), - this, SLOT( slotShowDataFile() ) ); - connect( acd->PreviewButton, SIGNAL( clicked() ), this, SLOT( slotPreviewCatalog() ) ); - connect( this, SIGNAL( okClicked() ), this, SLOT( slotCreateCatalog() ) ); + connect( acd->DataURL->lineEdit(), TQT_SIGNAL( lostFocus() ), this, TQT_SLOT( slotShowDataFile() ) ); + connect( acd->DataURL, TQT_SIGNAL( urlSelected( const TQString & ) ), + this, TQT_SLOT( slotShowDataFile() ) ); + connect( acd->PreviewButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotPreviewCatalog() ) ); + connect( this, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( slotCreateCatalog() ) ); acd->FieldList->insertItem( i18n( "ID Number" ) ); acd->FieldList->insertItem( i18n( "Right Ascension" ) ); @@ -65,7 +65,7 @@ AddCatDialog::~AddCatDialog(){ void AddCatDialog::slotOk() { //Overriding slotOk() so that custom data file can be validated before -//QDialog::accept() is emitted and the window is closed. +//TQDialog::accept() is emitted and the window is closed. //the validation code needs to be aware of AddCatDialog members, so I will just //emit the okClicked() signal, which is connected to AddCatDialog::validateFile() @@ -73,7 +73,7 @@ void AddCatDialog::slotOk() { } void AddCatDialog::slotHelp() { - QString message = + TQString message = i18n( "A valid custom catalog file has one line per object, " "with the following fields in each line:") + "\n\t" + i18n( "1. Type identifier. Must be one of: 0 (star), 3 (open cluster), 4 (globular cluster), " @@ -112,9 +112,9 @@ bool AddCatDialog::validateDataFile() { CatalogContents = writeCatalogHeader(); //Next, the data lines (fill from user-specified file) - QFile dataFile( acd->DataURL->url() ); + TQFile dataFile( acd->DataURL->url() ); if ( ! acd->DataURL->url().isEmpty() && dataFile.open( IO_ReadOnly ) ) { - QTextStream dataStream( &dataFile ); + TQTextStream dataStream( &dataFile ); CatalogContents += dataStream.read(); dataFile.close(); @@ -122,10 +122,10 @@ bool AddCatDialog::validateDataFile() { //Now create a temporary file for the Catalog, and attempt to parse it into a CustomCatalog KTempFile ktf; - QFile tmpFile( ktf.name() ); + TQFile tmpFile( ktf.name() ); ktf.unlink(); //just need filename if ( tmpFile.open( IO_WriteOnly ) ) { - QTextStream ostream( &tmpFile ); + TQTextStream ostream( &tmpFile ); ostream << CatalogContents; tmpFile.close(); CustomCatalog *newCat; @@ -141,18 +141,18 @@ bool AddCatDialog::validateDataFile() { return false; } -QString AddCatDialog::writeCatalogHeader() { - QString name = ( acd->CatalogName->text().isEmpty() ? i18n("Custom") : acd->CatalogName->text() ); - QString pre = ( acd->Prefix->text().isEmpty() ? "CC" : acd->Prefix->text() ); +TQString AddCatDialog::writeCatalogHeader() { + TQString name = ( acd->CatalogName->text().isEmpty() ? i18n("Custom") : acd->CatalogName->text() ); + TQString pre = ( acd->Prefix->text().isEmpty() ? "CC" : acd->Prefix->text() ); - QString h = QString("# Name: %1\n").arg( name ); - h += QString("# Prefix: %1\n").arg( pre ); - h += QString("# Color: %1\n").arg( acd->ColorButton->color().name() ); - h += QString("# Epoch: %1\n").arg( acd->Epoch->value() ); - h += QString("# "); + TQString h = TQString("# Name: %1\n").arg( name ); + h += TQString("# Prefix: %1\n").arg( pre ); + h += TQString("# Color: %1\n").arg( acd->ColorButton->color().name() ); + h += TQString("# Epoch: %1\n").arg( acd->Epoch->value() ); + h += TQString("# "); for ( uint i=0; i < acd->FieldList->count(); ++i ) { - QString f = acd->FieldList->text( i ); + TQString f = acd->FieldList->text( i ); if ( f == i18n( "ID Number" ) ) { h += "ID "; @@ -183,11 +183,11 @@ QString AddCatDialog::writeCatalogHeader() { } void AddCatDialog::slotShowDataFile() { - QFile dataFile( acd->DataURL->url() ); + TQFile dataFile( acd->DataURL->url() ); if ( ! acd->DataURL->url().isEmpty() && dataFile.open( IO_ReadOnly ) ) { acd->DataFileBox->clear(); - QTextStream dataStream( &dataFile ); - acd->DataFileBox->insertStringList( QStringList::split( "\n", dataStream.read(), TRUE ) ); + TQTextStream dataStream( &dataFile ); + acd->DataFileBox->insertStringList( TQStringList::split( "\n", dataStream.read(), TRUE ) ); dataFile.close(); } } @@ -195,7 +195,7 @@ void AddCatDialog::slotShowDataFile() { void AddCatDialog::slotPreviewCatalog() { if ( validateDataFile() ) { KMessageBox::informationList( 0, i18n( "Preview of %1" ).arg( acd->CatalogName->text() ), - QStringList::split( "\n", CatalogContents ), i18n( "Catalog Preview" ) ); + TQStringList::split( "\n", CatalogContents ), i18n( "Catalog Preview" ) ); } } @@ -205,7 +205,7 @@ void AddCatDialog::slotCreateCatalog() { //and objList contains the parsed objects //Warn user if file exists! - if ( QFile::exists( acd->CatalogURL->url() ) ) + if ( TQFile::exists( acd->CatalogURL->url() ) ) { KURL u( acd->CatalogURL->url() ); int r=KMessageBox::warningContinueCancel( 0, @@ -217,17 +217,17 @@ void AddCatDialog::slotCreateCatalog() { if(r==KMessageBox::Cancel) return; } - QFile OutFile( acd->CatalogURL->url() ); + TQFile OutFile( acd->CatalogURL->url() ); if ( ! OutFile.open( IO_WriteOnly ) ) { KMessageBox::sorry( 0, i18n( "Could not open the file %1 for writing." ).arg( acd->CatalogURL->url() ), i18n( "Error Opening Output File" ) ); } else { - QTextStream outStream( &OutFile ); + TQTextStream outStream( &OutFile ); outStream << CatalogContents; OutFile.close(); - emit QDialog::accept(); + emit TQDialog::accept(); close(); } } diff --git a/kstars/kstars/addcatdialog.h b/kstars/kstars/addcatdialog.h index 46b108ba..be839181 100644 --- a/kstars/kstars/addcatdialog.h +++ b/kstars/kstars/addcatdialog.h @@ -18,8 +18,8 @@ #ifndef ADDCATDIALOG_H #define ADDCATDIALOG_H -#include -#include +#include +#include #include #include @@ -39,7 +39,7 @@ class AddCatDialog : public KDialogBase { public: /**Default constructor */ - AddCatDialog( QWidget *parent=0 ); + AddCatDialog( TQWidget *parent=0 ); /**Destructor (empty) */ @@ -47,11 +47,11 @@ public: /**@return the name for the custom catalog. */ - QString name() const { return acd->CatalogName->text(); } + TQString name() const { return acd->CatalogName->text(); } /**@return the filename of the custom catalog. */ - QString filename() const { return acd->CatalogURL->url(); } + TQString filename() const { return acd->CatalogURL->url(); } private slots: /**Display contents of the import file. @@ -86,11 +86,11 @@ private: /**Write a header line describing the data fields in the catalog, and *defining the catalog name, ID prefix, and coordinate epoch. */ - QString writeCatalogHeader(); + TQString writeCatalogHeader(); - QVBoxLayout *vlay; + TQVBoxLayout *vlay; AddCatDialogUI *acd; - QString CatalogContents; + TQString CatalogContents; }; #endif diff --git a/kstars/kstars/addlinkdialog.cpp b/kstars/kstars/addlinkdialog.cpp index 9f9a0e97..a5f5978e 100644 --- a/kstars/kstars/addlinkdialog.cpp +++ b/kstars/kstars/addlinkdialog.cpp @@ -19,27 +19,27 @@ #include #include #include -#include -#include +#include +#include #include "addlinkdialog.h" #include "skyobject.h" -AddLinkDialog::AddLinkDialog( QWidget *parent, const QString &oname ) +AddLinkDialog::AddLinkDialog( TQWidget *parent, const TQString &oname ) : KDialogBase( KDialogBase::Plain, i18n( "Add Custom URL to %1" ).arg( oname ), Ok|Cancel, Ok, parent ), ObjectName( oname ) { - QFrame *page = plainPage(); + TQFrame *page = plainPage(); setMainWidget(page); - vlay = new QVBoxLayout( page, 0, spacingHint() ); + vlay = new TQVBoxLayout( page, 0, spacingHint() ); ald = new AddLinkDialogUI(page); vlay->addWidget( ald ); vlay->activate(); //connect signals to slots - connect( ald->URLButton, SIGNAL( clicked() ), this, SLOT( checkURL() ) ); - connect( ald->TypeBox, SIGNAL( clicked( int ) ), this, SLOT( changeDefaultDescription( int ) ) ); + connect( ald->URLButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( checkURL() ) ); + connect( ald->TypeBox, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( changeDefaultDescription( int ) ) ); ald->ImageRadio->setChecked(true); ald->DescBox->setText( i18n( "Show image of " ) + ObjectName ); @@ -50,8 +50,8 @@ void AddLinkDialog::checkURL( void ) { if ( _url.isValid() ) { //Is the string a valid URL? kapp->invokeBrowser( _url.url() ); //If so, launch the browser to see if it's the correct document } else { //If not, print a warning message box that offers to open the browser to a search engine. - QString message = i18n( "The URL is not valid. Would you like to open a browser window\nto the Google search engine?" ); - QString caption = i18n( "Invalid URL" ); + TQString message = i18n( "The URL is not valid. Would you like to open a browser window\nto the Google search engine?" ); + TQString caption = i18n( "Invalid URL" ); if ( KMessageBox::warningYesNo( 0, message, caption, i18n("Browse Google"), i18n("Do Not Browse") )==KMessageBox::Yes ) { kapp->invokeBrowser( "http://www.google.com" ); } diff --git a/kstars/kstars/addlinkdialog.h b/kstars/kstars/addlinkdialog.h index d6017d3d..3bf6e02e 100644 --- a/kstars/kstars/addlinkdialog.h +++ b/kstars/kstars/addlinkdialog.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "addlinkdialogui.h" @@ -38,26 +38,26 @@ class AddLinkDialog : public KDialogBase { Q_OBJECT public: /**Constructor. */ - AddLinkDialog( QWidget* parent = 0, const QString &oname=i18n("object") ); + AddLinkDialog( TQWidget* parent = 0, const TQString &oname=i18n("object") ); /**Destructor (empty) */ ~AddLinkDialog() {} -/**@return QString of the entered URL */ - QString url() const { return ald->URLBox->text(); } +/**@return TQString of the entered URL */ + TQString url() const { return ald->URLBox->text(); } /**@short Set the URL text *@param s the new URL text */ - void setURL( const QString &s ) { ald->URLBox->setText( s ); } + void setURL( const TQString &s ) { ald->URLBox->setText( s ); } -/**@return QString of the entered menu entry text */ - QString desc() const { return ald->DescBox->text(); } +/**@return TQString of the entered menu entry text */ + TQString desc() const { return ald->DescBox->text(); } /**@short Set the Description text *@param s the new description text */ - void setDesc( const QString &s ) { ald->DescBox->setText( s ); } + void setDesc( const TQString &s ) { ald->DescBox->setText( s ); } /**@return TRUE if user declared the link is an image */ bool isImageLink() const { return ald->ImageRadio->isChecked(); } @@ -80,8 +80,8 @@ private slots: void changeDefaultDescription( int id ); private: - QString ObjectName; - QVBoxLayout *vlay; + TQString ObjectName; + TQVBoxLayout *vlay; AddLinkDialogUI *ald; }; diff --git a/kstars/kstars/ccdpreviewwg.cpp b/kstars/kstars/ccdpreviewwg.cpp index 41eed90e..18ee3892 100644 --- a/kstars/kstars/ccdpreviewwg.cpp +++ b/kstars/kstars/ccdpreviewwg.cpp @@ -28,13 +28,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -49,7 +49,7 @@ FILE *CCDwfp; - CCDPreviewWG::CCDPreviewWG(INDIStdDevice *inStdDev, QWidget * parent, const char * name) : CCDPreviewForm(parent, name) + CCDPreviewWG::CCDPreviewWG(INDIStdDevice *inStdDev, TQWidget * parent, const char * name) : CCDPreviewForm(parent, name) { stdDev = inStdDev; @@ -74,14 +74,14 @@ FILE *CCDwfp; playB->setPixmap(pausePix); captureB->setPixmap(capturePix); - imgFormatCombo->insertStrList(QImage::outputFormats()); + imgFormatCombo->insertStrList(TQImage::outputFormats()); - connect(playB, SIGNAL(clicked()), this, SLOT(playPressed())); - connect(captureB, SIGNAL(clicked()), this, SLOT(captureImage())); - connect(brightnessBar, SIGNAL(valueChanged(int)), this, SLOT(brightnessChanged(int))); - connect(contrastBar, SIGNAL(valueChanged(int)), this, SLOT(contrastChanged(int))); - connect(gammaBar, SIGNAL(valueChanged(int)), this, SLOT(gammaChanged(int))); - connect(focalEdit, SIGNAL(returnPressed()), this, SLOT(updateFWHM())); + connect(playB, TQT_SIGNAL(clicked()), this, TQT_SLOT(playPressed())); + connect(captureB, TQT_SIGNAL(clicked()), this, TQT_SLOT(captureImage())); + connect(brightnessBar, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(brightnessChanged(int))); + connect(contrastBar, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(contrastChanged(int))); + connect(gammaBar, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(gammaChanged(int))); + connect(focalEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(updateFWHM())); } CCDPreviewWG::~CCDPreviewWG() @@ -89,7 +89,7 @@ CCDPreviewWG::~CCDPreviewWG() } -void CCDPreviewWG::closeEvent ( QCloseEvent * e ) +void CCDPreviewWG::closeEvent ( TQCloseEvent * e ) { stdDev->streamDisabled(); processStream = false; @@ -101,12 +101,12 @@ void CCDPreviewWG::setColorFrame(bool color) colorFrame = color; } -/*void CCDPreviewWG::establishDataChannel(QString host, int port) +/*void CCDPreviewWG::establishDataChannel(TQString host, int port) { - QString errMsg; + TQString errMsg; struct sockaddr_in pin; struct hostent *serverHostName = gethostbyname(host.ascii()); - errMsg = QString("Connection to INDI host at %1 on port %2 failed.").arg(host).arg(port); + errMsg = TQString("Connection to INDI host at %1 on port %2 failed.").arg(host).arg(port); memset(&pin, 0, sizeof(pin)); pin.sin_family = AF_INET; @@ -127,8 +127,8 @@ void CCDPreviewWG::setColorFrame(bool color) } // callback notified - sNotifier = new QSocketNotifier( streamFD, QSocketNotifier::Read, this); - QObject::connect( sNotifier, SIGNAL(activated(int)), this, SLOT(streamReceived())); + sNotifier = new TQSocketNotifier( streamFD, TQSocketNotifier::Read, this); + TQObject::connect( sNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(streamReceived())); }*/ void CCDPreviewWG::enableStream(bool enable) @@ -197,12 +197,12 @@ void CCDPreviewWG::updateFWHM() fwhm_arcsec = (206.26 / focal_length) * fwhm * mu; - FWHMLabel->setText(QString("%1").arg(fwhm_arcsec, 0, 'g', 3)); + FWHMLabel->setText(TQString("%1").arg(fwhm_arcsec, 0, 'g', 3)); } -void CCDPreviewWG::resizeEvent(QResizeEvent *ev) +void CCDPreviewWG::resizeEvent(TQResizeEvent *ev) { streamFrame->resize(ev->size().width() - layout()->margin() * 2, ev->size().height() - playB->height() - layout()->margin() * 2 - layout()->spacing()); } @@ -225,10 +225,10 @@ void CCDPreviewWG::playPressed() void CCDPreviewWG::captureImage() { - QString fname; - QString fmt; + TQString fname; + TQString fmt; KURL currentFileURL; - QString currentDir = Options::fitsSaveDirectory(); + TQString currentDir = Options::fitsSaveDirectory(); KTempFile tmpfile; tmpfile.setAutoDelete(true); @@ -261,23 +261,23 @@ void CCDPreviewWG::captureImage() if ( tmpfile.name() == fname ) { //need to upload to remote location - if ( ! KIO::NetAccess::upload( tmpfile.name(), currentFileURL, (QWidget*) 0 ) ) + if ( ! KIO::NetAccess::upload( tmpfile.name(), currentFileURL, (TQWidget*) 0 ) ) { - QString message = i18n( "Could not upload image to remote location: %1" ).arg( currentFileURL.prettyURL() ); + TQString message = i18n( "Could not upload image to remote location: %1" ).arg( currentFileURL.prettyURL() ); KMessageBox::sorry( 0, message, i18n( "Could not upload file" ) ); } } } else { - QString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); + TQString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); KMessageBox::sorry( 0, message, i18n( "Invalid URL" ) ); } } -CCDVideoWG::CCDVideoWG(QWidget * parent, const char * name) : QFrame(parent, name, Qt::WNoAutoErase) +CCDVideoWG::CCDVideoWG(TQWidget * parent, const char * name) : TQFrame(parent, name, Qt::WNoAutoErase) { streamImage = NULL; streamBuffer = NULL; @@ -333,9 +333,9 @@ void CCDVideoWG::newFrame(unsigned char *buffer, int buffSize, int w, int h) } streamBufferPos=i; /*if (buffSize > totalBaseCount) - streamImage = new QImage(buffer, w, h, 32, 0, 0, QImage::BigEndian); + streamImage = new TQImage(buffer, w, h, 32, 0, 0, TQImage::BigEndian); else - streamImage = new QImage(streamBuffer, w, h, 8, grayTable, 256, QImage::IgnoreEndian); + streamImage = new TQImage(streamBuffer, w, h, 8, grayTable, 256, TQImage::IgnoreEndian); update(); */ redrawVideoWG(); @@ -383,12 +383,12 @@ void CCDVideoWG::redrawVideoWG(void) } } } - streamImage = new QImage(displayBuffer, Width, Height, 8, grayTable, 256, QImage::IgnoreEndian); + streamImage = new TQImage(displayBuffer, Width, Height, 8, grayTable, 256, TQImage::IgnoreEndian); update(); } -void CCDVideoWG::paintEvent(QPaintEvent */*ev*/) +void CCDVideoWG::paintEvent(TQPaintEvent */*ev*/) { if (streamImage) diff --git a/kstars/kstars/ccdpreviewwg.h b/kstars/kstars/ccdpreviewwg.h index f054a8a5..831c7d10 100644 --- a/kstars/kstars/ccdpreviewwg.h +++ b/kstars/kstars/ccdpreviewwg.h @@ -13,11 +13,11 @@ #ifndef CCDPREVIEWWG_H #define CCDPREVIEWWG_H - #include + #include #include #include "ccdpreviewui.h" - #include "qframe.h" + #include "tqframe.h" enum Pixelorder {PIXELORDER_NORMAL=1, PIXELORDER_DUAL=2}; @@ -33,7 +33,7 @@ enum Pixelorder {PIXELORDER_NORMAL=1, PIXELORDER_DUAL=2}; Q_OBJECT public: - CCDPreviewWG(INDIStdDevice *inStdDev, QWidget * parent =0, const char * name =0); + CCDPreviewWG(INDIStdDevice *inStdDev, TQWidget * parent =0, const char * name =0); ~CCDPreviewWG(); friend class CCDVideoWG; @@ -51,14 +51,14 @@ enum Pixelorder {PIXELORDER_NORMAL=1, PIXELORDER_DUAL=2}; private: INDIStdDevice *stdDev; - QPixmap playPix, pausePix, capturePix; - QVBoxLayout *videoFrameLayout; + TQPixmap playPix, pausePix, capturePix; + TQVBoxLayout *videoFrameLayout; double fwhm; int mu; protected: - void closeEvent ( QCloseEvent * e ); - void resizeEvent(QResizeEvent *ev); + void closeEvent ( TQCloseEvent * e ); + void resizeEvent(TQResizeEvent *ev); public slots: @@ -75,7 +75,7 @@ enum Pixelorder {PIXELORDER_NORMAL=1, PIXELORDER_DUAL=2}; Q_OBJECT public: - CCDVideoWG(QWidget * parent =0, const char * name =0); + CCDVideoWG(TQWidget * parent =0, const char * name =0); ~CCDVideoWG(); friend class CCDPreviewWG; @@ -97,7 +97,7 @@ enum Pixelorder {PIXELORDER_NORMAL=1, PIXELORDER_DUAL=2}; int Width, Height; unsigned long maxGoodData; protected: - void paintEvent(QPaintEvent *ev); + void paintEvent(TQPaintEvent *ev); public slots: }; diff --git a/kstars/kstars/colorscheme.cpp b/kstars/kstars/colorscheme.cpp index 575206fa..5449c48e 100644 --- a/kstars/kstars/colorscheme.cpp +++ b/kstars/kstars/colorscheme.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include #include #include @@ -25,11 +25,11 @@ #include "ksutils.h" #include "colorscheme.h" -typedef QStringList::const_iterator SL_it; +typedef TQStringList::const_iterator SL_it; ColorScheme::ColorScheme() : FileName() { //Each color has two names associated with it. The KeyName is its - //identification in the QMap, the *.colors file, and the config file. + //identification in the TQMap, the *.colors file, and the config file. //The Name is what appears in the ViewOpsDialog ListBox. //In addition, we define default RGB strings for each item. //To add another color to the Palette, just add an entry for KeyName, @@ -141,8 +141,8 @@ void ColorScheme::copy( const ColorScheme &cs ) { FileName = cs.FileName; } -QString ColorScheme::colorNamed( const QString &name ) const { - //QString color( Palette[ name ] ); +TQString ColorScheme::colorNamed( const TQString &name ) const { + //TQString color( Palette[ name ] ); if ( ! hasColorNamed( name ) ) { kdWarning() << i18n( "No color named \"%1\" found in color scheme." ).arg( name ) << endl; //color = "#FFFFFF"; //set to white if no color found @@ -152,39 +152,39 @@ QString ColorScheme::colorNamed( const QString &name ) const { return Palette[ name ]; } -QString ColorScheme::colorAt( int i ) const { +TQString ColorScheme::colorAt( int i ) const { SL_it it = KeyName.at(i); - return Palette[ QString(*it) ]; + return Palette[ TQString(*it) ]; } -QString ColorScheme::nameAt( int i ) const { +TQString ColorScheme::nameAt( int i ) const { SL_it it = Name.at(i); - return QString(*it); + return TQString(*it); } -QString ColorScheme::keyAt( int i ) const { +TQString ColorScheme::keyAt( int i ) const { SL_it it = KeyName.at(i); - return QString(*it); + return TQString(*it); } -QString ColorScheme::nameFromKey( const QString &key ) const { +TQString ColorScheme::nameFromKey( const TQString &key ) const { return nameAt( KeyName.findIndex( key ) ); } -void ColorScheme::setColor( const QString &key, const QString &color ) { +void ColorScheme::setColor( const TQString &key, const TQString &color ) { //We can blindly insert() the new value; if the key exists, the old value is replaced Palette.insert( key, color ); } -bool ColorScheme::load( const QString &filename ) { - QFile file; +bool ColorScheme::load( const TQString &filename ) { + TQFile file; int inew(0),iold(0); if ( !KSUtils::openDataFile( file, filename ) ) return false; - QTextStream stream( &file ); - QString line; + TQTextStream stream( &file ); + TQString line; //first line is the star-color mode and star color intensity line = stream.readLine(); @@ -206,13 +206,13 @@ bool ColorScheme::load( const QString &filename ) { if ( iold ) return false; //we read at least one line without a colon...file is corrupted. //If this line has a valid Key, set the color. - QString tkey = line.mid( line.find(':')+1 ).stripWhiteSpace(); - QString tname = line.left( line.find(':')-1 ); + TQString tkey = line.mid( line.find(':')+1 ).stripWhiteSpace(); + TQString tname = line.left( line.find(':')-1 ); if ( KeyName.contains( tkey ) ) { setColor( tkey, tname ); } else { //attempt to translate from old color ID - QString k( line.mid( 5 ).stripWhiteSpace() + "Color" ); + TQString k( line.mid( 5 ).stripWhiteSpace() + "Color" ); if ( KeyName.contains( k ) ) { setColor( k, tname ); } else { @@ -229,10 +229,10 @@ bool ColorScheme::load( const QString &filename ) { //Assuming the old *.colors format. Loop through the KeyName list, //and assign each color. Note that order matters here, but only here //(so if you don't use the old format, then order doesn't ever matter) - QStringList::Iterator it = KeyName.begin(); - QStringList::Iterator it_end = KeyName.end(); + TQStringList::Iterator it = KeyName.begin(); + TQStringList::Iterator it_end = KeyName.end(); for ( ; it != it_end; ++it ) - setColor( QString(*it), line.left( 7 ) ); + setColor( TQString(*it), line.left( 7 ) ); } } @@ -240,12 +240,12 @@ bool ColorScheme::load( const QString &filename ) { return true; } -bool ColorScheme::save( const QString &name ) { - QFile file; +bool ColorScheme::save( const TQString &name ) { + TQFile file; //Construct a file name from the scheme name. Make lowercase, replace spaces with "-", //and append ".colors". - QString filename = name.lower().stripWhiteSpace(); + TQString filename = name.lower().stripWhiteSpace(); if ( !filename.isEmpty() ) { for( unsigned int i=0; ireadEntry( QString(*it), QString( *Default.at( KeyName.findIndex(*it) ) ) ) ); + setColor( TQString(*it), conf->readEntry( TQString(*it), TQString( *Default.at( KeyName.findIndex(*it) ) ) ) ); setStarColorMode( conf->readNumEntry( "StarColorMode", 0 ) ); setStarColorIntensity( conf->readNumEntry( "StarColorIntensity", 5 ) ); } void ColorScheme::saveToConfig( KConfig *conf ) { - QStringList::Iterator it = KeyName.begin(); - QStringList::Iterator it_end = KeyName.end(); + TQStringList::Iterator it = KeyName.begin(); + TQStringList::Iterator it_end = KeyName.end(); for ( ; it != it_end; ++it ) - conf->writeEntry( QString(*it), colorNamed( QString(*it) ) ); + conf->writeEntry( TQString(*it), colorNamed( TQString(*it) ) ); conf->writeEntry( "StarColorMode", starColorMode() ); conf->writeEntry( "StarColorIntensity", starColorIntensity() ); diff --git a/kstars/kstars/colorscheme.h b/kstars/kstars/colorscheme.h index b7c17b2b..e61c455b 100644 --- a/kstars/kstars/colorscheme.h +++ b/kstars/kstars/colorscheme.h @@ -18,19 +18,19 @@ #ifndef COLORSCHEME_H #define COLORSCHEME_H -#include -#include +#include +#include class KConfig; /** *@class ColorScheme *This class stores all of the adjustable colors in KStars, in - *a QMap object keyed by the names of the colors. It also stores + *a TQMap object keyed by the names of the colors. It also stores *information on how stars are to be rendered in the map *(with realistic colors, or as solid red/whit/black circles). *In addition to the brief "Key names" used to index the colors in - *the QMap, each color has a "long name" description that is a bit + *the TQMap, each color has a "long name" description that is a bit *more verbose, and suitable for UI display. *@author Jason Harris *@version 1.0 @@ -41,7 +41,7 @@ class ColorScheme { public: /**Constructor. Enter all adjustable colors and their default - *values into the QMap. Also assign the corresponding long names. + *values into the TQMap. Also assign the corresponding long names. */ ColorScheme(); @@ -55,57 +55,57 @@ class ColorScheme { /**@return true if the Palette contains the given key name */ - bool hasColorNamed( const QString &name ) const { return ( ! Palette[ name ].isEmpty() ); } + bool hasColorNamed( const TQString &name ) const { return ( ! Palette[ name ].isEmpty() ); } /** *@short Retrieve a color by name. *@p name the key name of the color to be retrieved. *@return the requested color, or "#FFFFFF" (white) if color name not found. */ - QString colorNamed( const QString &name ) const; + TQString colorNamed( const TQString &name ) const; /**@p i the index of the color to retrieve *@return a color by its index in the QMap */ - QString colorAt( int i ) const; + TQString colorAt( int i ) const; /**@p i the index of the long name to retrieve *@return the name of the color at index i */ - QString nameAt( int i ) const; + TQString nameAt( int i ) const; /**@p i the index of the key name to retrieve *@return the key name of the color at index i */ - QString keyAt( int i ) const; + TQString keyAt( int i ) const; /** *@return the long name of the color whose key name is given *@p key the key name identifying the color. */ - QString nameFromKey( const QString &key ) const; + TQString nameFromKey( const TQString &key ) const; /**Change the color with the given key to the given value *@p key the key-name of the color to be changed *@p color the new color value */ - void setColor( const QString &key, const QString &color ); + void setColor( const TQString &key, const TQString &color ); /**Load a color scheme from a *.colors file *@p filename the filename of the color scheme to be loaded. *@return TRUE if the scheme was successfully loaded */ - bool load( const QString &filename ); + bool load( const TQString &filename ); /**Save the current color scheme to a *.colors file. *@p name the filename to create *@return TRUE if the color scheme is successfully writeen to a file */ - bool save( const QString &name ); + bool save( const TQString &name ); /**@return the Filename associated with the color scheme. */ - QString fileName() const { return FileName; } + TQString fileName() const { return FileName; } /**Copy a color scheme *@p cs the color scheme to be copied into this object @@ -137,9 +137,9 @@ class ColorScheme { private: int StarColorMode, StarColorIntensity; - QString FileName; - QStringList KeyName, Name, Default; - QMap Palette; + TQString FileName; + TQStringList KeyName, Name, Default; + TQMap Palette; }; diff --git a/kstars/kstars/conbridlg.cpp b/kstars/kstars/conbridlg.cpp index 57bb84c7..ec9aa240 100644 --- a/kstars/kstars/conbridlg.cpp +++ b/kstars/kstars/conbridlg.cpp @@ -20,9 +20,9 @@ #include #include - #include - #include - #include + #include + #include + #include #include #include @@ -36,7 +36,7 @@ //TODO find a better and faster way to implement this, this operation can be memory and CPU intensive. -ContrastBrightnessDlg::ContrastBrightnessDlg(QWidget *parent) : +ContrastBrightnessDlg::ContrastBrightnessDlg(TQWidget *parent) : KDialogBase(KDialogBase::Plain, i18n( "Brightness/Contrast" ), Ok|Cancel, Ok, parent ) { @@ -44,7 +44,7 @@ ContrastBrightnessDlg::ContrastBrightnessDlg(QWidget *parent) : contrast = brightness = 0; viewer = (FITSViewer *) parent; displayImage = viewer->image->displayImage; - tempImage = new QImage(displayImage->copy()); + tempImage = new TQImage(displayImage->copy()); width = displayImage->width(); height = displayImage->height(); @@ -68,8 +68,8 @@ ContrastBrightnessDlg::ContrastBrightnessDlg(QWidget *parent) : setMainWidget(ConBriDlg); show(); - connect(ConBriDlg->conSlider, SIGNAL( valueChanged(int)), this, SLOT (setContrast(int ))); - connect(ConBriDlg->briSlider, SIGNAL( valueChanged(int)), this, SLOT (setBrightness(int))); + connect(ConBriDlg->conSlider, TQT_SIGNAL( valueChanged(int)), this, TQT_SLOT (setContrast(int ))); + connect(ConBriDlg->briSlider, TQT_SIGNAL( valueChanged(int)), this, TQT_SLOT (setBrightness(int))); } @@ -98,7 +98,7 @@ void ContrastBrightnessDlg::setContrast(int contrastValue) int val = 0, index=0, totalPix = width * height; int min = (int) viewer->imgBuffer[0], max = 0; if (!viewer) return; - QColor myCol; + TQColor myCol; contrast = contrastValue; @@ -167,7 +167,7 @@ void ContrastBrightnessDlg::setBrightness(int brightnessValue) int val = 0, index=0, totalPix = width * height; int min = (int) viewer->imgBuffer[0], max = 0; if (!viewer) return; - QColor myCol; + TQColor myCol; brightness = brightnessValue; // Apply Contrast and brightness @@ -231,9 +231,9 @@ void ContrastBrightnessDlg::setBrightness(int brightnessValue) } -QSize ContrastBrightnessDlg::sizeHint() const +TQSize ContrastBrightnessDlg::sizeHint() const { - return QSize(400,130); + return TQSize(400,130); } #include "conbridlg.moc" diff --git a/kstars/kstars/conbridlg.h b/kstars/kstars/conbridlg.h index e653ed70..ef531eaa 100644 --- a/kstars/kstars/conbridlg.h +++ b/kstars/kstars/conbridlg.h @@ -30,10 +30,10 @@ class ContrastBrightnessDlg : public KDialogBase { Q_OBJECT public: - ContrastBrightnessDlg(QWidget *parent=0); + ContrastBrightnessDlg(TQWidget *parent=0); ~ContrastBrightnessDlg(); - QSize sizeHint() const; + TQSize sizeHint() const; void range(int min, int max, int & num); void range(float min, float max, float & num); @@ -50,8 +50,8 @@ class ContrastBrightnessDlg : public KDialogBase { ConBriForm *ConBriDlg; //unsigned char *localImgBuffer; - QImage *displayImage; - QImage *tempImage; + TQImage *displayImage; + TQImage *tempImage; public slots: void setContrast(int contrastValue); diff --git a/kstars/kstars/csegment.cpp b/kstars/kstars/csegment.cpp index e01802f9..24242022 100644 --- a/kstars/kstars/csegment.cpp +++ b/kstars/kstars/csegment.cpp @@ -27,7 +27,7 @@ void CSegment::addPoint( double ra, double dec ) { Nodes.append( p ); } -bool CSegment::setNames( QString n1, QString n2 ) { +bool CSegment::setNames( TQString n1, TQString n2 ) { if ( n1.length() == 3 && n2.length() == 3 ) { Name1 = n1; Name2 = n2; @@ -37,7 +37,7 @@ bool CSegment::setNames( QString n1, QString n2 ) { } } -bool CSegment::borders( QString cname ) { +bool CSegment::borders( TQString cname ) { if ( Name1 == cname || Name2 == cname ) return true; return false; } diff --git a/kstars/kstars/csegment.h b/kstars/kstars/csegment.h index dea55c9f..06d751b5 100644 --- a/kstars/kstars/csegment.h +++ b/kstars/kstars/csegment.h @@ -18,8 +18,8 @@ #ifndef CSEGMENT_H #define CSEGMENT_H -#include -#include +#include +#include /**@class CSegment *A segment of a constellation boundary. The segment consists @@ -53,24 +53,24 @@ public: /**@return the name of one of the constellations *that borders this boundary segment. */ - QString name1() const { return Name1; } + TQString name1() const { return Name1; } /**@return the name of one of the constellations *that borders this boundary segment. */ - QString name2() const { return Name2; } + TQString name2() const { return Name2; } /**Set the names of the bounding constellations. Use the IAU *three-letter abbreviations. *@p n1 IAU name of one bounding constellation *@p n2 IAU name of the other bounding constellation */ - bool setNames( QString n1, QString n2 ); + bool setNames( TQString n1, TQString n2 ); /**Determine if a given constellation borders this boundary segment *@p cname the IAU code of the constellation to be tested. */ - bool borders( QString cname ); + bool borders( TQString cname ); /**@return pointer to the first node in the segment */ @@ -81,11 +81,11 @@ public: SkyPoint* nextNode() { return Nodes.next(); } /**@return pointer to the list of nodes*/ - QPtrList* nodes() { return &Nodes; } + TQPtrList* nodes() { return &Nodes; } private: - QPtrList Nodes; - QString Name1, Name2; + TQPtrList Nodes; + TQString Name1, Name2; }; #endif diff --git a/kstars/kstars/customcatalog.cpp b/kstars/kstars/customcatalog.cpp index 199ef099..40de33c2 100644 --- a/kstars/kstars/customcatalog.cpp +++ b/kstars/kstars/customcatalog.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include "customcatalog.h" @@ -23,8 +23,8 @@ CustomCatalog::CustomCatalog() : m_Name( i18n("Custom") ), m_Prefix( "CC" ), m_Color( "#FF0000" ), m_Epoch( 2000.0 ), m_ObjList() { } -CustomCatalog::CustomCatalog( QString nm, QString px, QString co, float ep, - QPtrList ol ) : m_Name(nm), m_Prefix(px), m_Color(co), +CustomCatalog::CustomCatalog( TQString nm, TQString px, TQString co, float ep, + TQPtrList ol ) : m_Name(nm), m_Prefix(px), m_Color(co), m_Epoch(ep), m_ObjList( ol ) { } diff --git a/kstars/kstars/customcatalog.h b/kstars/kstars/customcatalog.h index ee2eef94..d7179691 100644 --- a/kstars/kstars/customcatalog.h +++ b/kstars/kstars/customcatalog.h @@ -18,7 +18,7 @@ #ifndef CUSTOM_CATALOG_H #define CUSTOM_CATALOG_H -#include +#include #include "skyobject.h" class QString; @@ -29,25 +29,25 @@ class QString; class CustomCatalog { public: CustomCatalog(); - CustomCatalog( QString nm, QString px, QString co, float ep, QPtrList ol ); + CustomCatalog( TQString nm, TQString px, TQString co, float ep, TQPtrList ol ); ~CustomCatalog(); - QString name() const { return m_Name; } - QString prefix() const { return m_Prefix; } - QString color() const { return m_Color; } + TQString name() const { return m_Name; } + TQString prefix() const { return m_Prefix; } + TQString color() const { return m_Color; } float epoch() const { return m_Epoch; } - QPtrList objList() const { return m_ObjList; } + TQPtrList objList() const { return m_ObjList; } - void setName( const QString &name ) { m_Name = name; } - void setPrefix( const QString &prefix ) { m_Prefix = prefix; } - void setColor( const QString &color ) { m_Color = color; } + void setName( const TQString &name ) { m_Name = name; } + void setPrefix( const TQString &prefix ) { m_Prefix = prefix; } + void setColor( const TQString &color ) { m_Color = color; } void setEpoch( float epoch ) { m_Epoch = epoch; } - void setObjectList( QPtrList ol ) { m_ObjList = ol; } + void setObjectList( TQPtrList ol ) { m_ObjList = ol; } private: - QString m_Name, m_Prefix, m_Color; + TQString m_Name, m_Prefix, m_Color; float m_Epoch; - QPtrList m_ObjList; + TQPtrList m_ObjList; }; #endif //CUSTOM_CATALOG_H diff --git a/kstars/kstars/deepskyobject.cpp b/kstars/kstars/deepskyobject.cpp index b189404f..280729e5 100644 --- a/kstars/kstars/deepskyobject.cpp +++ b/kstars/kstars/deepskyobject.cpp @@ -17,11 +17,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "deepskyobject.h" #include "kstarsdata.h" @@ -41,7 +41,7 @@ DeepSkyObject::DeepSkyObject( DeepSkyObject &o ) } DeepSkyObject::DeepSkyObject( int t, dms r, dms d, float m, - QString n, QString n2, QString lname, QString cat, + TQString n, TQString n2, TQString lname, TQString cat, float a, float b, double pa, int pgc, int ugc ) : SkyObject( t, r, d, m, n, n2, lname ) { MajorAxis = a; @@ -54,7 +54,7 @@ DeepSkyObject::DeepSkyObject( int t, dms r, dms d, float m, } DeepSkyObject::DeepSkyObject( int t, double r, double d, float m, - QString n, QString n2, QString lname, QString cat, + TQString n, TQString n2, TQString lname, TQString cat, float a, float b, double pa, int pgc, int ugc ) : SkyObject( t, r, d, m, n, n2, lname ) { MajorAxis = a; @@ -71,28 +71,28 @@ float DeepSkyObject::e( void ) const { return MinorAxis / MajorAxis; } -QString DeepSkyObject::catalog() const { - if ( isCatalogM() ) return QString("M"); - if ( isCatalogNGC() ) return QString("NGC"); - if ( isCatalogIC() ) return QString("IC"); - return QString(""); +TQString DeepSkyObject::catalog() const { + if ( isCatalogM() ) return TQString("M"); + if ( isCatalogNGC() ) return TQString("NGC"); + if ( isCatalogIC() ) return TQString("IC"); + return TQString(""); } -void DeepSkyObject::setCatalog( const QString &cat ) { +void DeepSkyObject::setCatalog( const TQString &cat ) { if ( cat.upper() == "M" ) Catalog = (unsigned char)CAT_MESSIER; else if ( cat.upper() == "NGC" ) Catalog = (unsigned char)CAT_NGC; else if ( cat.upper() == "IC" ) Catalog = (unsigned char)CAT_IC; else Catalog = (unsigned char)CAT_UNKNOWN; } -QImage* DeepSkyObject::readImage( void ) { - QFile file; +TQImage* DeepSkyObject::readImage( void ) { + TQFile file; if ( Image==0 ) { //Image not currently set; try to load it from disk. - QString fname = name().lower().replace( QRegExp(" "), "" ) + ".png"; + TQString fname = name().lower().replace( TQRegExp(" "), "" ) + ".png"; if ( KSUtils::openDataFile( file, fname ) ) { file.close(); - Image = new QImage( file.name(), "PNG" ); + Image = new TQImage( file.name(), "PNG" ); } } @@ -101,7 +101,7 @@ QImage* DeepSkyObject::readImage( void ) { void DeepSkyObject::deleteImage() { delete Image; Image = 0; } -void DeepSkyObject::drawSymbol( QPainter &psky, int x, int y, double PositionAngle, double zoom, double scale ) { +void DeepSkyObject::drawSymbol( TQPainter &psky, int x, int y, double PositionAngle, double zoom, double scale ) { // if size is 0.0 set it to 1.0, this are normally stars (type 0 and 1) // if we use size 0.0 the star wouldn't be drawn float majorAxis = a(); @@ -128,7 +128,7 @@ void DeepSkyObject::drawSymbol( QPainter &psky, int x, int y, double PositionAng int psize; - QBrush tempBrush; + TQBrush tempBrush; switch ( type() ) { case 0: @@ -223,9 +223,9 @@ void DeepSkyObject::drawSymbol( QPainter &psky, int x, int y, double PositionAng } } -void DeepSkyObject::drawImage( QPainter &psky, int x, int y, double PositionAngle, double zoom, double scale ) { - QImage *image = readImage(); - QImage ScaledImage; +void DeepSkyObject::drawImage( TQPainter &psky, int x, int y, double PositionAngle, double zoom, double scale ) { + TQImage *image = readImage(); + TQImage ScaledImage; if ( image ) { int w = int( a() * scale * dms::PI * zoom/10800.0 ); diff --git a/kstars/kstars/deepskyobject.h b/kstars/kstars/deepskyobject.h index f8291ae6..e1712c7f 100644 --- a/kstars/kstars/deepskyobject.h +++ b/kstars/kstars/deepskyobject.h @@ -18,7 +18,7 @@ #ifndef DEEPSKYOBJECT_H #define DEEPSKYOBJECT_H -#include +#include #include "skyobject.h" #include "dms.h" @@ -57,8 +57,8 @@ public: *@param ugc UGC catalog number */ DeepSkyObject( int t=SkyObject::STAR, dms r=dms(0.0), dms d=dms(0.0), - float m=0.0, QString n="unnamed", QString n2="", - QString lname="", QString cat="", + float m=0.0, TQString n="unnamed", TQString n2="", + TQString lname="", TQString cat="", float a=0.0, float b=0.0, double pa=0.0, int pgc=0, int ugc=0 ); @@ -79,8 +79,8 @@ public: *@param ugc UGC catalog number */ DeepSkyObject( int t, double r, double d, float m=0.0, - QString n="unnamed", QString n2="", QString lname="", - QString cat="", float a=0.0, float b=0.0, + TQString n="unnamed", TQString n2="", TQString lname="", + TQString cat="", float a=0.0, float b=0.0, double pa=0.0, int pgc=0, int ugc=0 ); /**Copy constructor. @@ -98,14 +98,14 @@ public: */ enum CATALOG { CAT_MESSIER=0, CAT_NGC=1, CAT_IC=2, CAT_UNKNOWN }; -/**@return a QString identifying the object's primary catalog. +/**@return a TQString identifying the object's primary catalog. *@warning this is only used for deep-sky objects. Possible values are: *- "M" for Messier catalog *- "NGC" for NGC catalog *- "IC" for IC catalog *- empty string is presumed to be an object in a custom catalog */ - QString catalog( void ) const; + TQString catalog( void ) const; /**Set the internal Catalog value according to the QString *argument: @@ -113,7 +113,7 @@ public: * "NGC" : CAT_NGC * "IC" : CAT_IC */ - void setCatalog( const QString &s ); + void setCatalog( const TQString &s ); /**@return the object's major axis length, in arcminute. */ @@ -143,12 +143,12 @@ public: /**Read in this object's image from disk, unless it already exists in memory. *@returns pointer to newly-created image. */ - QImage *readImage(); + TQImage *readImage(); /**@return pointer to the object's inline image. If it is currently *a null pointer, it loads the image from disk. */ - QImage *image() const { return Image; } + TQImage *image() const { return Image; } /**delete the Image pointer, and set it to 0. */ @@ -172,25 +172,25 @@ public: /**Draw the object's symbol on the map */ - void drawSymbol( QPainter &psky, int x, int y, double PositionAngle, double zoom, double scale=1.0 ); + void drawSymbol( TQPainter &psky, int x, int y, double PositionAngle, double zoom, double scale=1.0 ); /**Draw the Object's image on the map */ - void drawImage( QPainter &psky, int x, int y, double PositionAngle, double zoom, double scale=1.0 ); + void drawImage( TQPainter &psky, int x, int y, double PositionAngle, double zoom, double scale=1.0 ); /**Show Deep-sky object popup menu. Overloaded from virtual *SkyObject::showPopupMenu() *@param pmenu pointer to the KSPopupMenu object *@param pos QPojnt holding the x,y coordinates for the menu */ - virtual void showPopupMenu( KSPopupMenu *pmenu, QPoint pos ) { pmenu->createDeepSkyObjectMenu( this ); pmenu->popup( pos ); } + virtual void showPopupMenu( KSPopupMenu *pmenu, TQPoint pos ) { pmenu->createDeepSkyObjectMenu( this ); pmenu->popup( pos ); } private: unsigned char Catalog; double PositionAngle; int UGC, PGC; float MajorAxis, MinorAxis; - QImage *Image; + TQImage *Image; }; #endif diff --git a/kstars/kstars/detaildialog.cpp b/kstars/kstars/detaildialog.cpp index 24949c50..4bbb6a91 100644 --- a/kstars/kstars/detaildialog.cpp +++ b/kstars/kstars/detaildialog.cpp @@ -15,11 +15,11 @@ * * ***************************************************************************/ -#include -#include //still needed for secondary dialogs -#include -#include -#include +#include +#include //still needed for secondary dialogs +#include +#include +#include #include #include @@ -57,32 +57,32 @@ #include "devicemanager.h" #include "indistd.h" -LogEdit::LogEdit( QWidget *parent, const char *name ) : KTextEdit( parent, name ) +LogEdit::LogEdit( TQWidget *parent, const char *name ) : KTextEdit( parent, name ) { - setFrameStyle( QFrame::StyledPanel ); - setFrameShadow( QFrame::Plain ); + setFrameStyle( TQFrame::StyledPanel ); + setFrameShadow( TQFrame::Plain ); setLineWidth( 4 ); } -void LogEdit::focusOutEvent( QFocusEvent *e ) { +void LogEdit::focusOutEvent( TQFocusEvent *e ) { emit focusOut(); - QWidget::focusOutEvent(e); + TQWidget::focusOutEvent(e); } -ClickLabel::ClickLabel( QWidget *parent, const char *name ) : QLabel( parent, name ) +ClickLabel::ClickLabel( TQWidget *parent, const char *name ) : TQLabel( parent, name ) {} DetailDialog::DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *geo, - QWidget *parent, const char *name ) : + TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Tabbed, i18n( "Object Details" ), Close, Close, parent, name ) , selectedObject(o), ksw((KStars*)parent), Data(0), Pos(0), Links(0), Adv(0), Log(0) { //Modify color palette - setPaletteBackgroundColor( palette().color( QPalette::Active, QColorGroup::Base ) ); - setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::Text ) ); + setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Base ) ); + setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::Text ) ); //Create thumbnail image - Thumbnail = new QPixmap( 200, 200 ); + Thumbnail = new TQPixmap( 200, 200 ); createGeneralTab(); createPositionTab( ut, geo ); @@ -91,21 +91,21 @@ DetailDialog::DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation * createLogTab(); //Connections - connect( Data->ObsListButton, SIGNAL( clicked() ), this, SLOT( addToObservingList() ) ); - connect( Data->CenterButton, SIGNAL( clicked() ), this, SLOT( centerMap() ) ); - connect( Data->ScopeButton, SIGNAL( clicked() ), this, SLOT( centerTelescope() ) ); - connect( Data->Image, SIGNAL( clicked() ), this, SLOT( updateThumbnail() ) ); + connect( Data->ObsListButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addToObservingList() ) ); + connect( Data->CenterButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( centerMap() ) ); + connect( Data->ScopeButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( centerTelescope() ) ); + connect( Data->Image, TQT_SIGNAL( clicked() ), this, TQT_SLOT( updateThumbnail() ) ); } void DetailDialog::createGeneralTab() { - QFrame *DataTab = addPage(i18n("General")); + TQFrame *DataTab = addPage(i18n("General")); Data = new DetailsDataUI( DataTab, "general_data_tab" ); //Modify colors - Data->Names->setPaletteBackgroundColor( palette().color( QPalette::Active, QColorGroup::Highlight ) ); - Data->Names->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::HighlightedText ) ); - Data->DataFrame->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::Highlight ) ); + Data->Names->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); + Data->Names->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::HighlightedText ) ); + Data->DataFrame->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); Data->Type->setPalette( palette() ); Data->Constellation->setPalette( palette() ); Data->Mag->setPalette( palette() ); @@ -119,7 +119,7 @@ void DetailDialog::createGeneralTab() //Show object thumbnail image showThumbnail(); - QVBoxLayout *vlay = new QVBoxLayout( DataTab, 0, 0 ); + TQVBoxLayout *vlay = new TQVBoxLayout( DataTab, 0, 0 ); vlay->addWidget( Data ); //Fill in the data fields @@ -127,7 +127,7 @@ void DetailDialog::createGeneralTab() StarObject *s = 0L; DeepSkyObject *dso = 0L; KSPlanetBase *ps = 0L; - QString pname(""), oname(""); + TQString pname(""), oname(""); switch ( selectedObject->type() ) { case 0: //stars @@ -140,10 +140,10 @@ void DetailDialog::createGeneralTab() //distance if ( s->distance() > 2000. || s->distance() < 0. ) // parallax < 0.5 mas - Data->Distance->setText( QString(i18n("larger than 2000 parsecs", "> 2000 pc") ) ); + Data->Distance->setText( TQString(i18n("larger than 2000 parsecs", "> 2000 pc") ) ); else if ( s->distance() > 50.0 ) //show to nearest integer Data->Distance->setText( i18n( "number in parsecs", "%1 pc" ).arg( - QString::number( int( s->distance() + 0.5 ) ) ) ); + TQString::number( int( s->distance() + 0.5 ) ) ) ); else if ( s->distance() > 10.0 ) //show to tenths place Data->Distance->setText( i18n( "number in parsecs", "%1 pc" ).arg( KGlobal::locale()->formatNumber( s->distance(), 1 ) ) ); @@ -183,7 +183,7 @@ void DetailDialog::createGeneralTab() //Magnitude: The moon displays illumination fraction instead if ( selectedObject->name() == "Moon" ) { Data->MagLabel->setText( i18n("Illumination:") ); - Data->Mag->setText( QString("%1 %").arg( int( ((KSMoon *)selectedObject)->illum()*100. ) ) ); + Data->Mag->setText( TQString("%1 %").arg( int( ((KSMoon *)selectedObject)->illum()*100. ) ) ); } else { Data->Mag->setText( i18n( "number in magnitudes", "%1 mag" ).arg( KGlobal::locale()->formatNumber( ps->mag(), 1 ) ) ); //show to tenths place @@ -230,11 +230,11 @@ void DetailDialog::createGeneralTab() if ( dso->ugc() != 0 ) { if ( ! oname.isEmpty() ) oname += ", "; - oname += "UGC " + QString("%1").arg( dso->ugc() ); + oname += "UGC " + TQString("%1").arg( dso->ugc() ); } if ( dso->pgc() != 0 ) { if ( ! oname.isEmpty() ) oname += ", "; - oname += "PGC " + QString("%1").arg( dso->pgc() ); + oname += "PGC " + TQString("%1").arg( dso->pgc() ); } if ( ! oname.isEmpty() ) pname += ", " + oname; @@ -270,16 +270,16 @@ void DetailDialog::createGeneralTab() } void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo ) { - QFrame *PosTab = addPage( i18n("Position") ); + TQFrame *PosTab = addPage( i18n("Position") ); Pos = new DetailsPositionUI( PosTab, "position_tab" ); //Modify colors - Pos->CoordTitle->setPaletteBackgroundColor( palette().color( QPalette::Active, QColorGroup::Highlight ) ); - Pos->CoordTitle->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::HighlightedText ) ); - Pos->CoordFrame->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::Highlight ) ); - Pos->RSTTitle->setPaletteBackgroundColor( palette().color( QPalette::Active, QColorGroup::Highlight ) ); - Pos->RSTTitle->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::HighlightedText ) ); - Pos->RSTFrame->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::Highlight ) ); + Pos->CoordTitle->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); + Pos->CoordTitle->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::HighlightedText ) ); + Pos->CoordFrame->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); + Pos->RSTTitle->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); + Pos->RSTTitle->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::HighlightedText ) ); + Pos->RSTFrame->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); Pos->RA->setPalette( palette() ); Pos->Dec->setPalette( palette() ); Pos->Az->setPalette( palette() ); @@ -305,13 +305,13 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo Pos->AltTransitLabel->setPalette( palette() ); Pos->AzSetLabel->setPalette( palette() ); - QVBoxLayout *vlay = new QVBoxLayout( PosTab, 0, 0 ); + TQVBoxLayout *vlay = new TQVBoxLayout( PosTab, 0, 0 ); vlay->addWidget( Pos ); //Coordinates Section: //Don't use KLocale::formatNumber() for the epoch string, //because we don't want a thousands-place separator! - QString sEpoch = QString::number( ut.epoch(), 'f', 1 ); + TQString sEpoch = TQString::number( ut.epoch(), 'f', 1 ); //Replace the decimal point with localized decimal symbol sEpoch.replace( ".", KGlobal::locale()->decimalSymbol() ); @@ -326,12 +326,12 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo //Here's a kludgy workaround: dms lst = geo->GSTtoLST( ut.gst() ); dms ha( lst.Degrees() - selectedObject->ra()->Degrees() ); - QChar sgn('+'); + TQChar sgn('+'); if ( ha.Hours() > 12.0 ) { ha.setH( 24.0 - ha.Hours() ); sgn = '-'; } - Pos->HA->setText( QString("%1%2").arg(sgn).arg( ha.toHMSString() ) ); + Pos->HA->setText( TQString("%1%2").arg(sgn).arg( ha.toHMSString() ) ); //Airmass is approximated as the secant of the zenith distance, //equivalent to 1./sin(Alt). Beware of Inf at Alt=0! @@ -344,11 +344,11 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo //Rise/Set/Transit Section: //Prepare time/position variables - QTime rt = selectedObject->riseSetTime( ut, geo, true ); //true = use rise time + TQTime rt = selectedObject->riseSetTime( ut, geo, true ); //true = use rise time dms raz = selectedObject->riseSetTimeAz( ut, geo, true ); //true = use rise time //If transit time is before rise time, use transit time for tomorrow - QTime tt = selectedObject->transitTime( ut, geo ); + TQTime tt = selectedObject->transitTime( ut, geo ); dms talt = selectedObject->transitAltitude( ut, geo ); if ( tt < rt ) { tt = selectedObject->transitTime( ut.addDays( 1 ), geo ); @@ -356,7 +356,7 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo } //If set time is before rise time, use set time for tomorrow - QTime st = selectedObject->riseSetTime( ut, geo, false ); //false = use set time + TQTime st = selectedObject->riseSetTime( ut, geo, false ); //false = use set time dms saz = selectedObject->riseSetTimeAz( ut, geo, false ); //false = use set time if ( st < rt ) { st = selectedObject->riseSetTime( ut.addDays( 1 ), geo, false ); //false = use set time @@ -364,8 +364,8 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo } if ( rt.isValid() ) { - Pos->TimeRise->setText( QString().sprintf( "%02d:%02d", rt.hour(), rt.minute() ) ); - Pos->TimeSet->setText( QString().sprintf( "%02d:%02d", st.hour(), st.minute() ) ); + Pos->TimeRise->setText( TQString().sprintf( "%02d:%02d", rt.hour(), rt.minute() ) ); + Pos->TimeSet->setText( TQString().sprintf( "%02d:%02d", st.hour(), st.minute() ) ); Pos->AzRise->setText( raz.toDMSString() ); Pos->AzSet->setText( saz.toDMSString() ); } else { @@ -381,39 +381,39 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo Pos->AzSet->setText( i18n( "Not Applicable", "N/A" ) ); } - Pos->TimeTransit->setText( QString().sprintf( "%02d:%02d", tt.hour(), tt.minute() ) ); + Pos->TimeTransit->setText( TQString().sprintf( "%02d:%02d", tt.hour(), tt.minute() ) ); Pos->AltTransit->setText( talt.toDMSString() ); } void DetailDialog::createLinksTab() { // don't create a link tab for an unnamed star - if (selectedObject->name() == QString("star")) + if (selectedObject->name() == TQString("star")) return; - QFrame *LinksTab = addPage( i18n( "Links" ) ); + TQFrame *LinksTab = addPage( i18n( "Links" ) ); Links = new DetailsLinksUI( LinksTab, "links_tab" ); //Modify colors - Links->InfoTitle->setPaletteBackgroundColor( palette().color( QPalette::Active, QColorGroup::Text ) ); - Links->InfoTitle->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::Base ) ); - Links->ImagesTitle->setPaletteBackgroundColor( palette().color( QPalette::Active, QColorGroup::Text ) ); - Links->ImagesTitle->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::Base ) ); + Links->InfoTitle->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Text ) ); + Links->InfoTitle->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::Base ) ); + Links->ImagesTitle->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Text ) ); + Links->ImagesTitle->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::Base ) ); - QPalette p = palette(); - p.setColor( QPalette::Active, QColorGroup::Dark, palette().color( QPalette::Active, QColorGroup::Highlight ) ); + TQPalette p = palette(); + p.setColor( TQPalette::Active, TQColorGroup::Dark, palette().color( TQPalette::Active, TQColorGroup::Highlight ) ); Links->InfoList->setPalette( p ); Links->ImagesList->setPalette( p ); - QVBoxLayout *vlay = new QVBoxLayout( LinksTab, 0, 0 ); + TQVBoxLayout *vlay = new TQVBoxLayout( LinksTab, 0, 0 ); vlay->addWidget( Links ); - QStringList::Iterator itList = selectedObject->InfoList.begin(); - QStringList::Iterator itTitle = selectedObject->InfoTitle.begin(); - QStringList::Iterator itListEnd = selectedObject->InfoList.end(); + TQStringList::Iterator itList = selectedObject->InfoList.begin(); + TQStringList::Iterator itTitle = selectedObject->InfoTitle.begin(); + TQStringList::Iterator itListEnd = selectedObject->InfoList.end(); for ( ; itList != itListEnd; ++itList ) { - Links->InfoList->insertItem(QString(*itTitle)); + Links->InfoList->insertItem(TQString(*itTitle)); itTitle++; } @@ -424,7 +424,7 @@ void DetailDialog::createLinksTab() itListEnd = selectedObject->ImageList.end(); for ( ; itList != itListEnd; ++itList ) { - Links->ImagesList->insertItem(QString(*itTitle)); + Links->ImagesList->insertItem(TQString(*itTitle)); itTitle++; } @@ -434,34 +434,34 @@ void DetailDialog::createLinksTab() } // Signals/Slots - connect( Links->ViewButton, SIGNAL(clicked()), this, SLOT( viewLink() ) ); - connect( Links->AddLinkButton, SIGNAL(clicked()), ksw->map(), SLOT( addLink() ) ); - connect( Links->EditLinkButton, SIGNAL(clicked()), this, SLOT( editLinkDialog() ) ); - connect( Links->RemoveLinkButton, SIGNAL(clicked()), this, SLOT( removeLinkDialog() ) ); - connect( Links->InfoList, SIGNAL(highlighted(int)), this, SLOT( unselectImagesList() ) ); - connect( Links->ImagesList, SIGNAL(highlighted(int)), this, SLOT( unselectInfoList() ) ); - connect( ksw->map(), SIGNAL(linkAdded()), this, SLOT( updateLists() ) ); + connect( Links->ViewButton, TQT_SIGNAL(clicked()), this, TQT_SLOT( viewLink() ) ); + connect( Links->AddLinkButton, TQT_SIGNAL(clicked()), ksw->map(), TQT_SLOT( addLink() ) ); + connect( Links->EditLinkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT( editLinkDialog() ) ); + connect( Links->RemoveLinkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT( removeLinkDialog() ) ); + connect( Links->InfoList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT( unselectImagesList() ) ); + connect( Links->ImagesList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT( unselectInfoList() ) ); + connect( ksw->map(), TQT_SIGNAL(linkAdded()), this, TQT_SLOT( updateLists() ) ); } void DetailDialog::createAdvancedTab() { // Don't create an adv tab for an unnamed star or if advinterface file failed loading // We also don't need adv dialog for solar system objects. - if (selectedObject->name() == QString("star") || + if (selectedObject->name() == TQString("star") || ksw->data()->ADVtreeList.isEmpty() || selectedObject->type() == SkyObject::PLANET || selectedObject->type() == SkyObject::COMET || selectedObject->type() == SkyObject::ASTEROID ) return; - QFrame *AdvancedTab = addPage(i18n("Advanced")); + TQFrame *AdvancedTab = addPage(i18n("Advanced")); Adv = new DetailsDatabaseUI( AdvancedTab, "database_tab" ); -// Adv->setPaletteBackgroundColor( QColor( "white" ) ); - QVBoxLayout *vlay = new QVBoxLayout( AdvancedTab, 0, 0 ); +// Adv->setPaletteBackgroundColor( TQColor( "white" ) ); + TQVBoxLayout *vlay = new TQVBoxLayout( AdvancedTab, 0, 0 ); vlay->addWidget( Adv ); - treeIt = new QPtrListIterator (ksw->data()->ADVtreeList); - connect( Adv->ADVTree, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(viewADVData())); + treeIt = new TQPtrListIterator (ksw->data()->ADVtreeList); + connect( Adv->ADVTree, TQT_SIGNAL(doubleClicked(TQListViewItem*)), this, TQT_SLOT(viewADVData())); populateADVTree(NULL); } @@ -469,18 +469,18 @@ void DetailDialog::createAdvancedTab() void DetailDialog::createLogTab() { //Don't create a a log tab for an unnamed star - if (selectedObject->name() == QString("star")) + if (selectedObject->name() == TQString("star")) return; // Log Tab - QFrame *LogTab = addPage(i18n("Log")); + TQFrame *LogTab = addPage(i18n("Log")); Log = new DetailsLogUI( LogTab, "log_tab" ); //Modify colors - Log->LogTitle->setPaletteBackgroundColor( palette().color( QPalette::Active, QColorGroup::Text ) ); - Log->LogTitle->setPaletteForegroundColor( palette().color( QPalette::Active, QColorGroup::Base ) ); + Log->LogTitle->setPaletteBackgroundColor( palette().color( TQPalette::Active, TQColorGroup::Text ) ); + Log->LogTitle->setPaletteForegroundColor( palette().color( TQPalette::Active, TQColorGroup::Base ) ); - QVBoxLayout *vlay = new QVBoxLayout( LogTab, 0, 0 ); + TQVBoxLayout *vlay = new TQVBoxLayout( LogTab, 0, 0 ); vlay->addWidget( Log ); if ( selectedObject->userLog.isEmpty() ) @@ -489,7 +489,7 @@ void DetailDialog::createLogTab() Log->UserLog->setText(selectedObject->userLog); //Automatically save the log contents when the widget loses focus - connect( Log->UserLog, SIGNAL( focusOut() ), this, SLOT( saveLogData() ) ); + connect( Log->UserLog, TQT_SIGNAL( focusOut() ), this, TQT_SLOT( saveLogData() ) ); } @@ -505,13 +505,13 @@ void DetailDialog::unselectImagesList() void DetailDialog::viewLink() { - QString URL; + TQString URL; if ( Links->InfoList->currentItem() != -1 && Links->InfoList->isSelected( Links->InfoList->currentItem() ) ) - URL = QString( *selectedObject->InfoList.at( Links->InfoList->currentItem() ) ); + URL = TQString( *selectedObject->InfoList.at( Links->InfoList->currentItem() ) ); else if ( Links->ImagesList->currentItem() != -1 ) - URL = QString( *selectedObject->ImageList.at( Links->ImagesList->currentItem() ) ); + URL = TQString( *selectedObject->ImageList.at( Links->ImagesList->currentItem() ) ); if (!URL.isEmpty()) kapp->invokeBrowser(URL); @@ -522,12 +522,12 @@ void DetailDialog::updateLists() Links->InfoList->clear(); Links->ImagesList->clear(); - QStringList::Iterator itList = selectedObject->InfoList.begin(); - QStringList::Iterator itTitle = selectedObject->InfoTitle.begin(); - QStringList::Iterator itListEnd = selectedObject->InfoList.end(); + TQStringList::Iterator itList = selectedObject->InfoList.begin(); + TQStringList::Iterator itTitle = selectedObject->InfoTitle.begin(); + TQStringList::Iterator itListEnd = selectedObject->InfoList.end(); for ( ; itList != itListEnd; ++itList ) { - Links->InfoList->insertItem(QString(*itTitle)); + Links->InfoList->insertItem(TQString(*itTitle)); itTitle++; } @@ -537,7 +537,7 @@ void DetailDialog::updateLists() itListEnd = selectedObject->ImageList.end(); for ( ; itList != itListEnd; ++itList ) { - Links->ImagesList->insertItem(QString(*itTitle)); + Links->ImagesList->insertItem(TQString(*itTitle)); itTitle++; } } @@ -546,17 +546,17 @@ void DetailDialog::editLinkDialog() { int type; uint i; - QString defaultURL , entry; - QFile newFile; + TQString defaultURL , entry; + TQFile newFile; KDialogBase editDialog(KDialogBase::Plain, i18n("Edit Link"), Ok|Cancel, Ok , this, "editlink", false); - QFrame *editFrame = editDialog.plainPage(); + TQFrame *editFrame = editDialog.plainPage(); - editLinkURL = new QLabel(i18n("URL:"), editFrame); - editLinkField = new QLineEdit(editFrame, "lineedit"); + editLinkURL = new TQLabel(i18n("URL:"), editFrame); + editLinkField = new TQLineEdit(editFrame, "lineedit"); editLinkField->setMinimumWidth(300); editLinkField->home(false); - editLinkLayout = new QHBoxLayout(editFrame, 6, 6, "editlinklayout"); + editLinkLayout = new TQHBoxLayout(editFrame, 6, 6, "editlinklayout"); editLinkLayout->addWidget(editLinkURL); editLinkLayout->addWidget(editLinkField); @@ -579,7 +579,7 @@ void DetailDialog::editLinkDialog() else return; // If user presses cancel then return - if (!editDialog.exec() == QDialog::Accepted) + if (!editDialog.exec() == TQDialog::Accepted) return; // if it wasn't edit, don't do anything if (!editLinkField->edited()) @@ -609,7 +609,7 @@ void DetailDialog::editLinkDialog() newFile.setName(file.name()); newFile.open(IO_WriteOnly); - QTextStream newStream(&newFile); + TQTextStream newStream(&newFile); for (i=0; iInfoList->currentItem(); @@ -682,7 +682,7 @@ void DetailDialog::removeLinkDialog() newFile.setName(file.name()); newFile.open(IO_WriteOnly); - QTextStream newStream(&newFile); + TQTextStream newStream(&newFile); for (i=0; icurrent()) @@ -795,21 +795,21 @@ void DetailDialog::populateADVTree(QListViewItem *parent) break; if (parent) - new QListViewItem( parent, treeIt->current()->Name); + new TQListViewItem( parent, treeIt->current()->Name); else - new QListViewItem( Adv->ADVTree, treeIt->current()->Name); + new TQListViewItem( Adv->ADVTree, treeIt->current()->Name); ++(*treeIt); } } -void DetailDialog::forkTree(QListViewItem *parent) +void DetailDialog::forkTree(TQListViewItem *parent) { - QListViewItem *current = 0; + TQListViewItem *current = 0; if (parent) - current = new QListViewItem(parent, treeIt->current()->Name); + current = new TQListViewItem(parent, treeIt->current()->Name); else - current = new QListViewItem(Adv->ADVTree, treeIt->current()->Name); + current = new TQListViewItem(Adv->ADVTree, treeIt->current()->Name); // we need to increment the iterator before and after populating the tree ++(*treeIt); @@ -819,8 +819,8 @@ void DetailDialog::forkTree(QListViewItem *parent) void DetailDialog::viewADVData() { - QString link; - QListViewItem * current = Adv->ADVTree->currentItem(); + TQString link; + TQListViewItem * current = Adv->ADVTree->currentItem(); if (!current) return; @@ -840,9 +840,9 @@ void DetailDialog::viewADVData() kapp->invokeBrowser(link); } -QString DetailDialog::parseADVData(QString link) +TQString DetailDialog::parseADVData(TQString link) { - QString subLink; + TQString subLink; int index; if ( (index = link.find("KSOBJ")) != -1) @@ -854,7 +854,7 @@ QString DetailDialog::parseADVData(QString link) if ( (index = link.find("KSRA")) != -1) { link.remove(index, 4); - subLink = QString().sprintf("%02d%02d%02d", selectedObject->ra0()->hour(), selectedObject->ra0()->minute(), selectedObject->ra0()->second()); + subLink = TQString().sprintf("%02d%02d%02d", selectedObject->ra0()->hour(), selectedObject->ra0()->minute(), selectedObject->ra0()->second()); subLink = subLink.insert(2, "%20"); subLink = subLink.insert(7, "%20"); @@ -865,13 +865,13 @@ QString DetailDialog::parseADVData(QString link) link.remove(index, 5); if (selectedObject->dec()->degree() < 0) { - subLink = QString().sprintf("%03d%02d%02d", selectedObject->dec0()->degree(), selectedObject->dec0()->arcmin(), selectedObject->dec0()->arcsec()); + subLink = TQString().sprintf("%03d%02d%02d", selectedObject->dec0()->degree(), selectedObject->dec0()->arcmin(), selectedObject->dec0()->arcsec()); subLink = subLink.insert(3, "%20"); subLink = subLink.insert(8, "%20"); } else { - subLink = QString().sprintf("%02d%02d%02d", selectedObject->dec0()->degree(), selectedObject->dec0()->arcmin(), selectedObject->dec0()->arcsec()); + subLink = TQString().sprintf("%02d%02d%02d", selectedObject->dec0()->degree(), selectedObject->dec0()->arcmin(), selectedObject->dec0()->arcsec()); subLink = subLink.insert(0, "%2B"); subLink = subLink.insert(5, "%20"); subLink = subLink.insert(10, "%20"); @@ -992,8 +992,8 @@ void DetailDialog::centerTelescope() if (useJ2000) sp.apparentCoord(ksw->data()->ut().djd(), (long double) J2000); - RAEle->write_w->setText(QString("%1:%2:%3").arg(sp.ra()->hour()).arg(sp.ra()->minute()).arg(sp.ra()->second())); - DecEle->write_w->setText(QString("%1:%2:%3").arg(sp.dec()->degree()).arg(sp.dec()->arcmin()).arg(sp.dec()->arcsec())); + RAEle->write_w->setText(TQString("%1:%2:%3").arg(sp.ra()->hour()).arg(sp.ra()->minute()).arg(sp.ra()->second())); + DecEle->write_w->setText(TQString("%1:%2:%3").arg(sp.dec()->degree()).arg(sp.dec()->arcmin()).arg(sp.dec()->arcsec())); break; @@ -1009,8 +1009,8 @@ void DetailDialog::centerTelescope() sp.setAlt(*ksw->map()->clickedPoint()->alt()); } - AzEle->write_w->setText(QString("%1:%2:%3").arg(sp.az()->degree()).arg(sp.az()->arcmin()).arg(sp.az()->arcsec())); - AltEle->write_w->setText(QString("%1:%2:%3").arg(sp.alt()->degree()).arg(sp.alt()->arcmin()).arg(sp.alt()->arcsec())); + AzEle->write_w->setText(TQString("%1:%2:%3").arg(sp.az()->degree()).arg(sp.az()->arcmin()).arg(sp.az()->arcsec())); + AltEle->write_w->setText(TQString("%1:%2:%3").arg(sp.alt()->degree()).arg(sp.alt()->arcmin()).arg(sp.alt()->arcsec())); break; } @@ -1039,8 +1039,8 @@ void DetailDialog::showThumbnail() { //Try to load the object's image from disk //If no image found, load "no image" image //If that isn't found, make it blank. - QFile file; - QString fname = "thumb-" + selectedObject->name().lower().replace( QRegExp(" "), "" ) + ".png"; + TQFile file; + TQString fname = "thumb-" + selectedObject->name().lower().replace( TQRegExp(" "), "" ) + ".png"; if ( KSUtils::openDataFile( file, fname ) ) { file.close(); Thumbnail->load( file.name(), "PNG" ); @@ -1058,9 +1058,9 @@ void DetailDialog::showThumbnail() { void DetailDialog::updateThumbnail() { ThumbnailPicker tp( selectedObject, *Thumbnail, this, "thumbnaileditor" ); - if ( tp.exec() == QDialog::Accepted ) { - QString fname = locateLocal( "appdata", "thumb-" - + selectedObject->name().lower().replace( QRegExp(" "), "" ) + ".png" ); + if ( tp.exec() == TQDialog::Accepted ) { + TQString fname = locateLocal( "appdata", "thumb-" + + selectedObject->name().lower().replace( TQRegExp(" "), "" ) + ".png" ); Data->Image->setPixmap( *(tp.image()) ); @@ -1070,7 +1070,7 @@ void DetailDialog::updateThumbnail() { Data->Image->pixmap()->save( fname, "PNG" ); *Thumbnail = *(Data->Image->pixmap()); } else { - QFile f; + TQFile f; f.setName( fname ); f.remove(); } diff --git a/kstars/kstars/detaildialog.h b/kstars/kstars/detaildialog.h index 115353e2..2bf6a452 100644 --- a/kstars/kstars/detaildialog.h +++ b/kstars/kstars/detaildialog.h @@ -18,9 +18,9 @@ #ifndef DETAILDIALOG_H #define DETAILDIALOG_H -#include -#include -#include +#include +#include +#include #include #include @@ -44,8 +44,8 @@ class DetailsLogUI; struct ADVTreeData { - QString Name; - QString Link; + TQString Name; + TQString Link; int Type; }; @@ -57,31 +57,31 @@ struct ADVTreeData class LogEdit : public KTextEdit { Q_OBJECT public: - LogEdit( QWidget *parent=0, const char *name=0 ); + LogEdit( TQWidget *parent=0, const char *name=0 ); ~LogEdit() {} signals: void focusOut(); protected: - void focusOutEvent( QFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); }; -/**@class ClickLabel is a QLabel with a clicked() signal. +/**@class ClickLabel is a TQLabel with a clicked() signal. *@author Jason Harris *@version 1.0 */ -class ClickLabel : public QLabel { +class ClickLabel : public TQLabel { Q_OBJECT public: - ClickLabel( QWidget *parent=0, const char *name=0 ); + ClickLabel( TQWidget *parent=0, const char *name=0 ); ~ClickLabel() {} signals: void clicked(); protected: - void mousePressEvent( QMouseEvent *e ) { if ( e->button() == LeftButton ) emit clicked(); } + void mousePressEvent( TQMouseEvent *e ) { if ( e->button() == LeftButton ) emit clicked(); } }; /**@class DetailDialog is a window showing detailed information for a selected object. @@ -107,13 +107,13 @@ class DetailDialog : public KDialogBase { public: /**Constructor */ - DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *geo, QWidget *parent=0, const char *name=0); + DetailDialog(SkyObject *o, const KStarsDateTime &ut, GeoLocation *geo, TQWidget *parent=0, const char *name=0); /**Destructor (empty) */ ~DetailDialog() {} - QPixmap* thumbnail() { return Thumbnail; } + TQPixmap* thumbnail() { return Thumbnail; } public slots: /**@short Add this object to the observing list. @@ -177,12 +177,12 @@ public slots: private: /**Read in the user's customized URL file (either images or info webpages), - *and store the file's lines in a QStringList. + *and store the file's lines in a TQStringList. *@param type 0=Image URLs; 1=Info URLs */ bool readUserFile(int type); -/**Parse the QStringList containing the User's URLs. +/**Parse the TQStringList containing the User's URLs. *@param type 0=Image URLs; 1=Info URLs */ bool verifyUserData(int type); @@ -211,32 +211,32 @@ private: /**Populate the TreeView of known astronomical databases in the Advanced Tab */ - void populateADVTree(QListViewItem *parent); + void populateADVTree(TQListViewItem *parent); /**For the databases TreeView */ - void forkTree(QListViewItem *parent); + void forkTree(TQListViewItem *parent); /**Data for the Advanced Tab TreeView is stored in the file advinterface.dat. *This function parses advinterface.dat. */ - QString parseADVData(QString link); + TQString parseADVData(TQString link); SkyObject *selectedObject; KStars* ksw; // Edit Link Dialog - QHBoxLayout *editLinkLayout; - QLabel *editLinkURL; - QLineEdit *editLinkField; - QFile file; - QPixmap *Thumbnail; + TQHBoxLayout *editLinkLayout; + TQLabel *editLinkURL; + TQLineEdit *editLinkField; + TQFile file; + TQPixmap *Thumbnail; int currentItemIndex; - QString currentItemURL, currentItemTitle; - QStringList dataList; + TQString currentItemURL, currentItemTitle; + TQStringList dataList; - QPtrListIterator * treeIt; + TQPtrListIterator * treeIt; DetailsDataUI *Data; DetailsPositionUI *Pos; diff --git a/kstars/kstars/devicemanager.cpp b/kstars/kstars/devicemanager.cpp index 5552fe39..0f95455c 100644 --- a/kstars/kstars/devicemanager.cpp +++ b/kstars/kstars/devicemanager.cpp @@ -21,8 +21,8 @@ #include "kstars.h" #include "kstarsdatetime.h" -#include -#include +#include +#include #include #include @@ -80,14 +80,14 @@ DeviceManager::~DeviceManager() } -bool DeviceManager::indiConnect(QString inHost, QString inPort) +bool DeviceManager::indiConnect(TQString inHost, TQString inPort) { host = inHost; port = inPort; - QString errMsg; + TQString errMsg; struct sockaddr_in pin; struct hostent *serverHostName = gethostbyname(host.ascii()); - errMsg = QString("Connection to INDI host at %1 on port %2 failed.").arg(host).arg(port); + errMsg = TQString("Connection to INDI host at %1 on port %2 failed.").arg(host).arg(port); memset(&pin, 0, sizeof(pin)); pin.sin_family = AF_INET; @@ -108,8 +108,8 @@ bool DeviceManager::indiConnect(QString inHost, QString inPort) } // callback notified - sNotifier = new QSocketNotifier( serverFD, QSocketNotifier::Read, this); - QObject::connect( sNotifier, SIGNAL(activated(int)), this, SLOT(dataReceived())); + sNotifier = new TQSocketNotifier( serverFD, TQSocketNotifier::Read, this); + TQObject::connect( sNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(dataReceived())); if (XMLParser) delLilXML(XMLParser); @@ -155,7 +155,7 @@ void DeviceManager::dataReceived() sNotifier->disconnect(); close(serverFD); parent->removeDeviceMgr(mgrID); - KMessageBox::error(0, QString::fromLatin1(errmsg)); + KMessageBox::error(0, TQString::fromLatin1(errmsg)); return; } @@ -244,7 +244,7 @@ int DeviceManager::delPropertyCmd (XMLEle *root, char errmsg[]) /* Delete property if it exists, otherwise, delete the whole device */ if (ap) { - pp = dp->findProp(QString(valuXMLAtt(ap))); + pp = dp->findProp(TQString(valuXMLAtt(ap))); if(pp) return dp->removeProperty(pp); @@ -257,7 +257,7 @@ int DeviceManager::delPropertyCmd (XMLEle *root, char errmsg[]) } -int DeviceManager::removeDevice(QString devName, char errmsg[]) +int DeviceManager::removeDevice(TQString devName, char errmsg[]) { // remove all devices if devName == NULL @@ -281,7 +281,7 @@ int DeviceManager::removeDevice(QString devName, char errmsg[]) return -1; } -INDI_D * DeviceManager::findDev (QString devName, char errmsg[]) +INDI_D * DeviceManager::findDev (TQString devName, char errmsg[]) { /* search for existing */ for (unsigned int i = 0; i < indi_dev.count(); i++) @@ -312,7 +312,7 @@ INDI_D * DeviceManager::addDevice (XMLEle *dep, char errmsg[]) if (parent->currentLabel.isEmpty()) parent->setCustomLabel(valuXMLAtt(ap)); - dp = new INDI_D(parent, this, QString(valuXMLAtt(ap)), parent->currentLabel); + dp = new INDI_D(parent, this, TQString(valuXMLAtt(ap)), parent->currentLabel); indi_dev.append(dp); @@ -339,7 +339,7 @@ INDI_D * DeviceManager::findDev (XMLEle *root, int create, char errmsg[]) /* search for existing */ for (uint i = 0; i < indi_dev.count(); i++) { - if (indi_dev.at(i)->name == QString(dn)) + if (indi_dev.at(i)->name == TQString(dn)) return (indi_dev.at(i)); } @@ -379,7 +379,7 @@ void DeviceManager::checkMsg (XMLEle *root, INDI_D *dp) */ void DeviceManager::doMsg (XMLEle *msg, INDI_D *dp) { - QTextEdit *txt_w; + TQTextEdit *txt_w; XMLAtt *message; XMLAtt *timestamp; @@ -395,17 +395,17 @@ void DeviceManager::doMsg (XMLEle *msg, INDI_D *dp) timestamp = findXMLAtt (msg, "timestamp"); if (timestamp) - txt_w->insert(QString(valuXMLAtt(timestamp)) + QString(" ")); + txt_w->insert(TQString(valuXMLAtt(timestamp)) + TQString(" ")); else txt_w->insert( KStarsDateTime::currentDateTime().toString("yyyy/mm/dd - h:m:s ap ")); /* finally! the msg */ message = findXMLAtt(msg, "message"); - txt_w->insert( QString(valuXMLAtt(message)) + QString("\n")); + txt_w->insert( TQString(valuXMLAtt(message)) + TQString("\n")); if ( Options::indiMessages() ) - parent->ksw->statusBar()->changeItem( QString(valuXMLAtt(message)), 0); + parent->ksw->statusBar()->changeItem( TQString(valuXMLAtt(message)), 0); } @@ -468,7 +468,7 @@ void DeviceManager::sendNewSwitch (INDI_P *pp, int index) } -void DeviceManager::startBlob (QString devName, QString propName, QString timestamp) +void DeviceManager::startBlob (TQString devName, TQString propName, TQString timestamp) { fprintf (serverFP, " indi_dev; + TQPtrList indi_dev; int mgrID; int serverFD; FILE *serverFP; LilXML *XMLParser; - QSocketNotifier *sNotifier; + TQSocketNotifier *sNotifier; QString host; QString port; @@ -53,22 +53,22 @@ class DeviceManager : public QObject void sendNewText (INDI_P *pp); void sendNewNumber (INDI_P *pp); void sendNewSwitch (INDI_P *pp, int index); - void startBlob (QString devName, QString propName, QString timestamp); - void sendOneBlob(QString blobName, unsigned int blobSize, QString blobFormat, unsigned char * blobBuffer); + void startBlob (TQString devName, TQString propName, TQString timestamp); + void sendOneBlob(TQString blobName, unsigned int blobSize, TQString blobFormat, unsigned char * blobBuffer); void finishBlob(); /***************************************************************** * Misc. ******************************************************************/ int delPropertyCmd (XMLEle *root, char errmsg[]); - int removeDevice (QString devName, char errmsg[]); - INDI_D * findDev (QString devName, char errmsg[]); + int removeDevice (TQString devName, char errmsg[]); + INDI_D * findDev (TQString devName, char errmsg[]); int messageCmd (XMLEle *root, char errmsg[]); void checkMsg (XMLEle *root, INDI_D *dp); void doMsg (XMLEle *msg , INDI_D *dp); - bool indiConnect (QString inHost, QString inPort); + bool indiConnect (TQString inHost, TQString inPort); public slots: void dataReceived(); diff --git a/kstars/kstars/dms.cpp b/kstars/kstars/dms.cpp index c6defc32..724f9af2 100644 --- a/kstars/kstars/dms.cpp +++ b/kstars/kstars/dms.cpp @@ -20,7 +20,7 @@ #include "dms.h" #include #include -#include +#include void dms::setD( const double &x ) { D = x; @@ -51,26 +51,26 @@ void dms::setRadians( const double &Rad ) { Radians = Rad; } -bool dms::setFromString( const QString &str, bool isDeg ) { +bool dms::setFromString( const TQString &str, bool isDeg ) { int d(0), m(0); double s(0.0); bool checkValue( false ), badEntry( false ), negative( false ); - QString entry = str.stripWhiteSpace(); + TQString entry = str.stripWhiteSpace(); //remove any instances of unit characters. //h, d, m, s, ', ", or the degree symbol (ASCII 176) - entry.replace( QRegExp("h"), "" ); - entry.replace( QRegExp("d"), "" ); - entry.replace( QRegExp("m"), "" ); - entry.replace( QRegExp("s"), "" ); - QString sdeg; + entry.replace( TQRegExp("h"), "" ); + entry.replace( TQRegExp("d"), "" ); + entry.replace( TQRegExp("m"), "" ); + entry.replace( TQRegExp("s"), "" ); + TQString sdeg; sdeg.sprintf("%c", 176); - entry.replace( QRegExp(sdeg), "" ); - entry.replace( QRegExp("\'"), "" ); - entry.replace( QRegExp("\""), "" ); + entry.replace( TQRegExp(sdeg), "" ); + entry.replace( TQRegExp("\'"), "" ); + entry.replace( TQRegExp("\""), "" ); //Account for localized decimal-point settings - //QString::toDouble() requires that the decimal symbol is "." + //TQString::toDouble() requires that the decimal symbol is "." entry.replace( KGlobal::locale()->decimalSymbol(), "." ); //empty entry returns false @@ -96,12 +96,12 @@ bool dms::setFromString( const QString &str, bool isDeg ) { } //try parsing multiple fields. - QStringList fields; + TQStringList fields; //check for colon-delimiters or space-delimiters if ( entry.contains(':') ) - fields = QStringList::split( ':', entry ); - else fields = QStringList::split( " ", entry ); + fields = TQStringList::split( ':', entry ); + else fields = TQStringList::split( " ", entry ); //anything with one field is invalid! if ( fields.count() == 1 ) { @@ -116,12 +116,12 @@ bool dms::setFromString( const QString &str, bool isDeg ) { //If field[1] is neither int nor double, return false. if ( fields.count() == 2 ) { m = fields[1].toInt( &checkValue ); - if ( checkValue ) fields.append( QString( "0" ) ); + if ( checkValue ) fields.append( TQString( "0" ) ); else { double mx = fields[1].toDouble( &checkValue ); if ( checkValue ) { - fields[1] = QString("%1").arg( int(mx) ); - fields.append( QString("%1").arg( int( 60.0*(mx - int(mx)) ) ) ); + fields[1] = TQString("%1").arg( int(mx) ); + fields.append( TQString("%1").arg( int( 60.0*(mx - int(mx)) ) ) ); } else { setD( 0.0 ); return false; @@ -277,8 +277,8 @@ const dms dms::reduce( void ) const { return dms( a ); } -const QString dms::toDMSString(bool forceSign) const { - QString dummy; +const TQString dms::toDMSString(bool forceSign) const { + TQString dummy; char pm(' '); int dd = abs(degree()); int dm = abs(arcmin()); @@ -287,19 +287,19 @@ const QString dms::toDMSString(bool forceSign) const { if ( Degrees() < 0.0 ) pm = '-'; else if (forceSign && Degrees() > 0.0 ) pm = '+'; - QString format( "%c%3d%c %02d\' %02d\"" ); + TQString format( "%c%3d%c %02d\' %02d\"" ); if ( dd < 100 ) format = "%c%2d%c %02d\' %02d\""; if ( dd < 10 ) format = "%c%1d%c %02d\' %02d\""; return dummy.sprintf(format.local8Bit(), pm, dd, 176, dm, ds); } -const QString dms::toHMSString() const { - QString dummy; +const TQString dms::toHMSString() const { + TQString dummy; return dummy.sprintf("%02dh %02dm %02ds", hour(), minute(), second()); } -dms dms::fromString(QString & st, bool deg) { +dms dms::fromString(TQString & st, bool deg) { dms result; bool ok( false ); diff --git a/kstars/kstars/dms.h b/kstars/kstars/dms.h index 33efa118..7cbbaa22 100644 --- a/kstars/kstars/dms.h +++ b/kstars/kstars/dms.h @@ -19,7 +19,7 @@ #define DMS_H #include -#include +#include #include //TODO: Remove these when KStarsDateTime is added! @@ -75,7 +75,7 @@ public: *@param isDeg if true, value is in degrees; if false, value is in hours. *@sa setFromString() */ - dms( const QString &s, bool isDeg=true ) { setFromString( s, isDeg ); } + dms( const TQString &s, bool isDeg=true ) { setFromString( s, isDeg ); } /**Destructor (empty). */ @@ -234,7 +234,7 @@ public: *@return true if sting was parsed successfully. Otherwise, set the dms value *to 0.0 and return false. */ - bool setFromString( const QString &s, bool isDeg=true ); + bool setFromString( const TQString &s, bool isDeg=true ); /** *Addition operator. Add two dms objects. @@ -320,12 +320,12 @@ public: /**@return a nicely-formatted string representation of the angle *in degrees, arcminutes, and arcseconds. */ - const QString toDMSString(const bool forceSign = false) const; + const TQString toDMSString(const bool forceSign = false) const; /**@return a nicely-formatted string representation of the angle *in hours, minutes, and seconds. */ - const QString toHMSString() const; + const TQString toHMSString() const; /**PI is a const static member; it's public so that it can be used anywhere, *as long as dms.h is included. @@ -337,7 +337,7 @@ public: */ static const double DegToRad; -/**@short Static function to create a DMS object from a QString. +/**@short Static function to create a DMS object from a TQString. * *There are several ways to specify the angle: *@li Integer numbers ( 5 or -33 ) @@ -351,7 +351,7 @@ public: *@param deg if TRUE, s is expressed in degrees; if FALSE, s is expressed in hours *@return a dms object whose value is parsed from the string argument */ - static dms fromString(QString & s, bool deg); + static dms fromString(TQString & s, bool deg); private: double D; diff --git a/kstars/kstars/dmsbox.cpp b/kstars/kstars/dmsbox.cpp index fa734fae..1857b1bf 100644 --- a/kstars/kstars/dmsbox.cpp +++ b/kstars/kstars/dmsbox.cpp @@ -21,31 +21,31 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -dmsBox::dmsBox(QWidget *parent, const char *name, bool dg) +dmsBox::dmsBox(TQWidget *parent, const char *name, bool dg) : KLineEdit(parent,name), EmptyFlag(true) { setMaxLength(14); setMaximumWidth(160); setDegType( dg ); - connect( this, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotTextChanged( const QString & ) ) ); + connect( this, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( slotTextChanged( const TQString & ) ) ); } void dmsBox::setEmptyText() { - QPalette p = palette(); - QColor txc = p.color( QPalette::Active, QColorGroup::Text ); - QColor bgc = paletteBackgroundColor(); + TQPalette p = palette(); + TQColor txc = p.color( TQPalette::Active, TQColorGroup::Text ); + TQColor bgc = paletteBackgroundColor(); int r( ( txc.red() + bgc.red() )/2 ); int g( ( txc.green() + bgc.green() )/2 ); int b( ( txc.blue() + bgc.blue() )/2 ); - p.setColor( QPalette::Active, QColorGroup::Text, QColor( r, g, b ) ); - p.setColor( QPalette::Inactive, QColorGroup::Text, QColor( r, g, b ) ); + p.setColor( TQPalette::Active, TQColorGroup::Text, TQColor( r, g, b ) ); + p.setColor( TQPalette::Inactive, TQColorGroup::Text, TQColor( r, g, b ) ); setPalette( p ); if ( degType() ) @@ -56,7 +56,7 @@ void dmsBox::setEmptyText() { EmptyFlag = true; } -void dmsBox::focusInEvent( QFocusEvent *e ) { +void dmsBox::focusInEvent( TQFocusEvent *e ) { KLineEdit::focusInEvent( e ); if ( EmptyFlag ) { @@ -66,7 +66,7 @@ void dmsBox::focusInEvent( QFocusEvent *e ) { } } -void dmsBox::focusOutEvent( QFocusEvent *e ) { +void dmsBox::focusOutEvent( TQFocusEvent *e ) { KLineEdit::focusOutEvent( e ); if ( text().isEmpty() ) { @@ -74,7 +74,7 @@ void dmsBox::focusOutEvent( QFocusEvent *e ) { } } -void dmsBox::slotTextChanged( const QString &t ) { +void dmsBox::slotTextChanged( const TQString &t ) { if ( ! hasFocus() ) { if ( EmptyFlag && ! t.isEmpty() ) { unsetPalette(); @@ -91,11 +91,11 @@ void dmsBox::setDegType( bool t ) { deg = t; if ( deg ) { - QToolTip::add( this, i18n( "Angle value in degrees. You may enter a simple integer \nor a floating-point value, or space- or colon-delimited values \nspecifying degrees, arcminutes and arcseconds." ) ); - QWhatsThis::add( this, i18n( "Enter an angle value in degrees. The angle can be expressed as a simple integer (\"45\") or floating-point (\"45.333\") value, or as space- or colon-delimited values specifying degrees, arcminutes and arcseconds (\"45:20\", \"45:20:00\", \"45:20\", \"45 20.0\", etc.)." ) ); + TQToolTip::add( this, i18n( "Angle value in degrees. You may enter a simple integer \nor a floating-point value, or space- or colon-delimited values \nspecifying degrees, arcminutes and arcseconds." ) ); + TQWhatsThis::add( this, i18n( "Enter an angle value in degrees. The angle can be expressed as a simple integer (\"45\") or floating-point (\"45.333\") value, or as space- or colon-delimited values specifying degrees, arcminutes and arcseconds (\"45:20\", \"45:20:00\", \"45:20\", \"45 20.0\", etc.)." ) ); } else { - QToolTip::add( this, i18n( "Angle value in hours. You may enter a simple integer \nor floating-point value, or space- or colon-delimited values \nspecifying hours, minutes and seconds." ) ); - QWhatsThis::add( this, i18n( "Enter an angle value in hours. The angle can be expressed as a simple integer (\"12\") or floating-point (\"12.333\") value, or as space- or colon-delimited values specifying hours, minutes and seconds (\"12:20\", \"12:20:00\", \"12:20\", \"12 20.0\", etc.)." ) ); + TQToolTip::add( this, i18n( "Angle value in hours. You may enter a simple integer \nor floating-point value, or space- or colon-delimited values \nspecifying hours, minutes and seconds." ) ); + TQWhatsThis::add( this, i18n( "Enter an angle value in hours. The angle can be expressed as a simple integer (\"12\") or floating-point (\"12.333\") value, or as space- or colon-delimited values specifying hours, minutes and seconds (\"12:20\", \"12:20:00\", \"12:20\", \"12 20.0\", etc.)." ) ); } clear(); @@ -108,14 +108,14 @@ void dmsBox::showInDegrees (const dms *d) { showInDegrees( dms( *d ) ); } void dmsBox::showInDegrees (dms d) { double seconds = d.arcsec() + d.marcsec()/1000.; - setDMS( QString().sprintf( "%02d %02d %05.2f", d.degree(), d.arcmin(), seconds ) ); + setDMS( TQString().sprintf( "%02d %02d %05.2f", d.degree(), d.arcmin(), seconds ) ); } void dmsBox::showInHours (const dms *d) { showInHours( dms( *d ) ); } void dmsBox::showInHours (dms d) { double seconds = d.second() + d.msecond()/1000.; - setDMS( QString().sprintf( "%02d %02d %05.2f", d.hour(), d.minute(), seconds ) ); + setDMS( TQString().sprintf( "%02d %02d %05.2f", d.hour(), d.minute(), seconds ) ); } void dmsBox::show(const dms *d, bool deg) { show( dms( *d ),deg ); } diff --git a/kstars/kstars/dmsbox.h b/kstars/kstars/dmsbox.h index 2e66042b..c98bc2c1 100644 --- a/kstars/kstars/dmsbox.h +++ b/kstars/kstars/dmsbox.h @@ -51,7 +51,7 @@ public: *@param deg if TRUE use deg/arcmin/arcsec; otherwise * use hours/min/sec. */ - dmsBox(QWidget *parent, const char *ni=0, bool deg=TRUE); + dmsBox(TQWidget *parent, const char *ni=0, bool deg=TRUE); /**Destructor (empty)*/ ~dmsBox(); @@ -99,7 +99,7 @@ public: *@note JH: Why don't we just use KLineEdit::setText() instead? *@param s the string to display (it need not be a valid angle value). */ - void setDMS(QString s) { setText(s); } + void setDMS(TQString s) { setText(s); } /**Parse the text in the dmsBox as an angle. The text may be an integer *or double value, or it may be a triplet of integer values (separated by spaces @@ -128,11 +128,11 @@ public: void clearFields (void) { setDMS(""); } protected: - void focusInEvent( QFocusEvent *e ); - void focusOutEvent( QFocusEvent *e ); + void focusInEvent( TQFocusEvent *e ); + void focusOutEvent( TQFocusEvent *e ); private slots: - void slotTextChanged( const QString &t ); + void slotTextChanged( const TQString &t ); private: void setEmptyText(); diff --git a/kstars/kstars/draglistbox.cpp b/kstars/kstars/draglistbox.cpp index 4e8dd9e7..74cd169f 100644 --- a/kstars/kstars/draglistbox.cpp +++ b/kstars/kstars/draglistbox.cpp @@ -15,13 +15,13 @@ * * ***************************************************************************/ -#include +#include #include #include #include "draglistbox.h" -DragListBox::DragListBox( QWidget *parent, const char *name, WFlags f ) +DragListBox::DragListBox( TQWidget *parent, const char *name, WFlags f ) : KListBox( parent, name, f ) { setAcceptDrops( TRUE ); @@ -30,36 +30,36 @@ DragListBox::DragListBox( QWidget *parent, const char *name, WFlags f ) DragListBox::~DragListBox() {} -void DragListBox::dragEnterEvent( QDragEnterEvent *evt ) +void DragListBox::dragEnterEvent( TQDragEnterEvent *evt ) { - if ( QTextDrag::canDecode( evt ) ) + if ( TQTextDrag::canDecode( evt ) ) evt->accept(); } -bool DragListBox::contains( const QString &s ) const { +bool DragListBox::contains( const TQString &s ) const { for ( uint i=0; ipos().y())/float(itemHeight()) + 0.5 ) + topItem(); if ( i > count() + 1 ) i = count() + 1; - if ( QTextDrag::decode( evt, text ) ) { + if ( TQTextDrag::decode( evt, text ) ) { //If we dragged an "Ignore item from the FieldList to the FieldPool, then we don't //need to insert the item, because FieldPool already has a persistent Ignore item. - if ( !( text == i18n("Ignore" ) && QString(evt->source()->name()) == "FieldList" && + if ( !( text == i18n("Ignore" ) && TQString(evt->source()->name()) == "FieldList" && evt->source() != this )) { insertItem( text, i ); } //If we dragged the "Ignore" item from FieldPool to FieldList, then we don't //want to remove the item from the FieldPool - if ( !( text == i18n("Ignore" ) && QString(evt->source()->name()) == "FieldPool" && + if ( !( text == i18n("Ignore" ) && TQString(evt->source()->name()) == "FieldPool" && evt->source() != this ) ) { DragListBox *fp = (DragListBox*)evt->source(); fp->removeItem( fp->currentItem() ); @@ -68,8 +68,8 @@ void DragListBox::dropEvent( QDropEvent *evt ) { } -void DragListBox::mousePressEvent( QMouseEvent *evt ) { - QListBox::mousePressEvent( evt ); +void DragListBox::mousePressEvent( TQMouseEvent *evt ) { + TQListBox::mousePressEvent( evt ); dragging = TRUE; //Record position of the Ignore item; we may have to restore it. @@ -80,10 +80,10 @@ void DragListBox::mousePressEvent( QMouseEvent *evt ) { } -void DragListBox::mouseMoveEvent( QMouseEvent * ) +void DragListBox::mouseMoveEvent( TQMouseEvent * ) { if ( dragging ) { - QDragObject *drag = new QTextDrag( currentText(), this ); + TQDragObject *drag = new TQTextDrag( currentText(), this ); drag->dragMove(); dragging = FALSE; } diff --git a/kstars/kstars/draglistbox.h b/kstars/kstars/draglistbox.h index cf6d5c3c..c4fce08b 100644 --- a/kstars/kstars/draglistbox.h +++ b/kstars/kstars/draglistbox.h @@ -35,19 +35,19 @@ class DragListBox : public KListBox { public: /**@short Default constructor */ - DragListBox( QWidget *parent = 0, const char *name = 0, WFlags = 0 ); + DragListBox( TQWidget *parent = 0, const char *name = 0, WFlags = 0 ); /**@short Default destructor */ ~DragListBox(); int ignoreIndex() const { return IgnoreIndex; } - bool contains( const QString &s ) const; + bool contains( const TQString &s ) const; - void dragEnterEvent( QDragEnterEvent *evt ); - void dropEvent( QDropEvent *evt ); - void mousePressEvent( QMouseEvent *evt ); - void mouseMoveEvent( QMouseEvent * ); + void dragEnterEvent( TQDragEnterEvent *evt ); + void dropEvent( TQDropEvent *evt ); + void mousePressEvent( TQMouseEvent *evt ); + void mouseMoveEvent( TQMouseEvent * ); private: bool dragging; int IgnoreIndex; diff --git a/kstars/kstars/filesource.cpp b/kstars/kstars/filesource.cpp index 61977937..8e38d9a4 100644 --- a/kstars/kstars/filesource.cpp +++ b/kstars/kstars/filesource.cpp @@ -50,17 +50,17 @@ FileSource::~FileSource() { int FileSource::readyToSend() { // readyToSend == 0 -> no data but not end of stream // readyToSend > 0 -> data ready to send - // readyToSend == -1 -> end of stream, QDataPump will destroy this FileSource object + // readyToSend == -1 -> end of stream, TQDataPump will destroy this FileSource object if (readingData == true) return 1; else return -1; } -void FileSource::sendTo(QDataSink *sink, int) { +void FileSource::sendTo(TQDataSink *sink, int) { counter = 0; while (data->starFileReader->hasMoreLines() && counter < maxLines) { - QString line = data->starFileReader->readLine(); + TQString line = data->starFileReader->readLine(); float mag = line.mid( 46, 5 ).toFloat(); // check magnitude // kdDebug() << "mag=" << mag << " maxmag=" << maxMagnitude << endl; if (mag > maxMagnitude) { diff --git a/kstars/kstars/filesource.h b/kstars/kstars/filesource.h index 39fb83bd..d9ab95d9 100644 --- a/kstars/kstars/filesource.h +++ b/kstars/kstars/filesource.h @@ -20,20 +20,20 @@ /**@class FileSource *FileSource is an asynchronous class for reloading star data while running - *the program. It's basing on QDataSource class and implements the function - *for reading a file step by step and send these data to an QDataSink object. + *the program. It's basing on TQDataSource class and implements the function + *for reading a file step by step and send these data to an TQDataSink object. *KStarsData uses this class for asynchronous io. *@author Thomas Kabelmann *@version 1.0 */ -#include -#include +#include +#include class KStarsData; class KSFileReader; -class FileSource : public QDataSource { +class FileSource : public TQDataSource { public: /**constructor needs an KStarsData object, a file name and the new magnitude @@ -53,12 +53,12 @@ class FileSource : public QDataSource { */ bool rewindable() { return false; } - /**The function for sending data to an QDataSink object. Here will all data + /**The function for sending data to an TQDataSink object. Here will all data *operations defined. Because this function is virtual, we need a second int *parameter, but we don't use it, so it's unnamed. - *@p sink pointer to the QDataSink object which will receive the data stream + *@p sink pointer to the TQDataSink object which will receive the data stream */ - void sendTo( QDataSink *sink, int ); + void sendTo( TQDataSink *sink, int ); /**@return current magnitude to load (always returns maxMagnitude) */ @@ -82,7 +82,7 @@ class FileSource : public QDataSource { KStarsData *data; /**maxLines defines how many lines in data file should be read and - *send to QDataSink. This is only needed if a data block is longer + *send to TQDataSink. This is only needed if a data block is longer *than the max defined lines. I figured out this value of 500 *on a fast system, so if it is to high the value might be decreased. *A high value means faster reloading but perhaps on slow systems this @@ -98,7 +98,7 @@ class FileSource : public QDataSource { /**The loaded data will stored in a string array and a pointer to first *object in array will send to StarDataSink. */ - QString stringArray[ maxLines ]; + TQString stringArray[ maxLines ]; }; diff --git a/kstars/kstars/finddialog.cpp b/kstars/kstars/finddialog.cpp index cf203e34..29dfa6cb 100644 --- a/kstars/kstars/finddialog.cpp +++ b/kstars/kstars/finddialog.cpp @@ -15,12 +15,12 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -33,25 +33,25 @@ #include "objectnamelist.h" -FindDialog::FindDialog( QWidget* parent ) : +FindDialog::FindDialog( TQWidget* parent ) : KDialogBase( KDialogBase::Plain, i18n( "Find Object" ), Ok|Cancel, Ok, parent ), vlay(0), hlay(0), SearchList(0), SearchBox(0), filterTypeLabel(0), filterType(0), currentitem(0) { - QFrame *page = plainPage(); + TQFrame *page = plainPage(); //Create Layout managers - vlay = new QVBoxLayout( page, 2, 2 ); - hlay = new QHBoxLayout( 2 ); //this mgr will be added to vlay + vlay = new TQVBoxLayout( page, 2, 2 ); + hlay = new TQHBoxLayout( 2 ); //this mgr will be added to vlay //Create Widgets - SearchBox = new QLineEdit( page, "SearchBox" ); + SearchBox = new TQLineEdit( page, "SearchBox" ); - filterTypeLabel = new QLabel( page, "filterTypeLabel" ); + filterTypeLabel = new TQLabel( page, "filterTypeLabel" ); filterTypeLabel->setAlignment( AlignRight ); filterTypeLabel->setText( i18n( "Filter by type: " ) ); - filterType = new QComboBox( page, "filterType" ); + filterType = new TQComboBox( page, "filterType" ); filterType->setEditable( false ); filterType->insertItem( i18n ("Any") ); filterType->insertItem( i18n ("Stars") ); @@ -67,11 +67,11 @@ FindDialog::FindDialog( QWidget* parent ) : filterType->insertItem( i18n ("Asteroids") ); filterType->insertItem( i18n ("Constellations") ); - SearchList = new QListBox( page, "SearchList" ); + SearchList = new TQListBox( page, "SearchList" ); SearchList->setMinimumWidth( 256 ); SearchList->setMinimumHeight( 320 ); - SearchList->setVScrollBarMode( QListBox::AlwaysOn ); - SearchList->setHScrollBarMode( QListBox::AlwaysOff ); + SearchList->setVScrollBarMode( TQListBox::AlwaysOn ); + SearchList->setHScrollBarMode( TQListBox::AlwaysOff ); //Pack Widgets into layout manager hlay->addWidget( filterTypeLabel, 0, 0 ); @@ -91,16 +91,16 @@ FindDialog::FindDialog( QWidget* parent ) : Filter = 0; //Connect signals to slots -// connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) ) ; - connect( this, SIGNAL( cancelClicked() ), this, SLOT( reject() ) ); - connect( SearchBox, SIGNAL( textChanged( const QString & ) ), SLOT( filter() ) ); - connect( SearchBox, SIGNAL( returnPressed() ), SLOT( slotOk() ) ); - connect( filterType, SIGNAL( activated( int ) ), this, SLOT( setFilter( int ) ) ); - connect( SearchList, SIGNAL (selectionChanged (QListBoxItem *)), SLOT (updateSelection (QListBoxItem *))); - connect( SearchList, SIGNAL( doubleClicked ( QListBoxItem * ) ), SLOT( slotOk() ) ); +// connect( this, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( accept() ) ) ; + connect( this, TQT_SIGNAL( cancelClicked() ), this, TQT_SLOT( reject() ) ); + connect( SearchBox, TQT_SIGNAL( textChanged( const TQString & ) ), TQT_SLOT( filter() ) ); + connect( SearchBox, TQT_SIGNAL( returnPressed() ), TQT_SLOT( slotOk() ) ); + connect( filterType, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( setFilter( int ) ) ); + connect( SearchList, TQT_SIGNAL (selectionChanged (TQListBoxItem *)), TQT_SLOT (updateSelection (TQListBoxItem *))); + connect( SearchList, TQT_SIGNAL( doubleClicked ( TQListBoxItem * ) ), TQT_SLOT( slotOk() ) ); // first create and paint dialog and then load list - QTimer::singleShot(0, this, SLOT( init() )); + TQTimer::singleShot(0, this, TQT_SLOT( init() )); } FindDialog::~FindDialog() { @@ -121,7 +121,7 @@ void FindDialog::filter() { //Filter the list of names with the string in the S // check if latin names are used ObjNames.setLanguage( Options::useLatinConstellNames() ); - QString searchFor = SearchBox->text().lower(); + TQString searchFor = SearchBox->text().lower(); for ( SkyObjectName *name = ObjNames.first( searchFor ); name; name = ObjNames.next() ) { if ( name->text().lower().startsWith( searchFor ) ) { new SkyObjectNameListItem ( SearchList, name ); @@ -139,7 +139,7 @@ void FindDialog::filterByType() { KStars *p = (KStars *)parent(); SearchList->clear(); // QListBox - QString searchFor = SearchBox->text().lower(); // search string + TQString searchFor = SearchBox->text().lower(); // search string ObjectNameList &ObjNames = p->data()->ObjNames; // check if latin names are used @@ -167,7 +167,7 @@ void FindDialog::setListItemEnabled() { updateSelection (0); } -void FindDialog::updateSelection (QListBoxItem *it) { +void FindDialog::updateSelection (TQListBoxItem *it) { currentitem = (SkyObjectNameListItem *) it; SearchBox->setFocus(); // set cursor to QLineEdit } @@ -182,14 +182,14 @@ void FindDialog::setFilter( int f ) { Filter = f2; if ( Filter == 0 ) { // any type will shown // delete old connections and create new connections - disconnect( SearchBox, SIGNAL( textChanged( const QString & ) ), this, SLOT( filterByType() ) ); - connect( SearchBox, SIGNAL( textChanged( const QString & ) ), SLOT( filter() ) ); + disconnect( SearchBox, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( filterByType() ) ); + connect( SearchBox, TQT_SIGNAL( textChanged( const TQString & ) ), TQT_SLOT( filter() ) ); filter(); } else { // delete old connections and create new connections - disconnect( SearchBox, SIGNAL( textChanged( const QString & ) ), this, SLOT( filter() ) ); - connect( SearchBox, SIGNAL( textChanged( const QString & ) ), SLOT( filterByType() ) ); + disconnect( SearchBox, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( filter() ) ); + connect( SearchBox, TQT_SIGNAL( textChanged( const TQString & ) ), TQT_SLOT( filterByType() ) ); filterByType(); } } @@ -198,14 +198,14 @@ void FindDialog::setFilter( int f ) { void FindDialog::slotOk() { //If no valid object selected, show a sorry-box. Otherwise, emit accept() if ( currentItem() == 0 ) { - QString message = i18n( "No object named %1 found." ).arg( SearchBox->text() ); + TQString message = i18n( "No object named %1 found." ).arg( SearchBox->text() ); KMessageBox::sorry( 0, message, i18n( "Bad object name" ) ); } else { accept(); } } -void FindDialog::keyPressEvent( QKeyEvent *e ) { +void FindDialog::keyPressEvent( TQKeyEvent *e ) { switch( e->key() ) { case Key_Down : if ( SearchList->currentItem() < ((int) SearchList->count()) - 1 ) diff --git a/kstars/kstars/finddialog.h b/kstars/kstars/finddialog.h index dc18441c..76531f03 100644 --- a/kstars/kstars/finddialog.h +++ b/kstars/kstars/finddialog.h @@ -36,7 +36,7 @@ class SkyObjectNameListItem; /**@class FindDialog *Dialog window for finding SkyObjects by name. The dialog contains - *a QListBox showing the list of named objects, a QLineEdit for filtering + *a TQListBox showing the list of named objects, a TQLineEdit for filtering *the list by name, and a QCombobox for filtering the list by object type. * *@short Find Object Dialog @@ -51,7 +51,7 @@ public: /**Constructor. Creates all widgets and packs them in QLayouts. Connects *Signals and Slots. Runs initObjectList(). */ - FindDialog( QWidget* parent = 0 ); + FindDialog( TQWidget* parent = 0 ); /**Destructor */ @@ -62,12 +62,12 @@ public: SkyObjectNameListItem * currentItem() const { return currentitem; } public slots: -/**When Text is entered in the QLineEdit, filter the List of objects +/**When Text is entered in the TQLineEdit, filter the List of objects *so that only objects which start with the filter text are shown. */ void filter(); -/**When the selection of the object type QComboBox is changed, filter +/**When the selection of the object type TQComboBox is changed, filter *the List of objects so that only objects of the selected Type are shown. */ void filterByType(); @@ -85,7 +85,7 @@ private slots: /**Set the selected item in the list to the item specified. */ - void updateSelection (QListBoxItem *); + void updateSelection (TQListBoxItem *); /**Change current filter options. */ @@ -94,9 +94,9 @@ private slots: protected: /**Process Keystrokes. The Up and Down arrow keys are used to select the *Previous/Next item in the listbox of named objects. - *@param e The QKeyEvent pointer + *@param e The TQKeyEvent pointer */ - void keyPressEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); private: /** @@ -104,12 +104,12 @@ private: */ void setListItemEnabled(); - QVBoxLayout *vlay; - QHBoxLayout *hlay; - QListBox *SearchList; - QLineEdit *SearchBox; - QLabel *filterTypeLabel; - QComboBox *filterType; + TQVBoxLayout *vlay; + TQHBoxLayout *hlay; + TQListBox *SearchList; + TQLineEdit *SearchBox; + TQLabel *filterTypeLabel; + TQComboBox *filterType; SkyObjectNameListItem *currentitem; diff --git a/kstars/kstars/fitshistogram.cpp b/kstars/kstars/fitshistogram.cpp index 399aa548..3d28de46 100644 --- a/kstars/kstars/fitshistogram.cpp +++ b/kstars/kstars/fitshistogram.cpp @@ -23,13 +23,13 @@ #include #include - #include - #include - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include + #include + #include #include #include @@ -37,7 +37,7 @@ - FITSHistogram::FITSHistogram(QWidget *parent, const char * name) : histDialog(parent, name) + FITSHistogram::FITSHistogram(TQWidget *parent, const char * name) : histDialog(parent, name) { viewer = (FITSViewer *) parent; @@ -58,11 +58,11 @@ histFrame->setMouseTracking(true); setMouseTracking(true); - connect(minSlider, SIGNAL(valueChanged(int)), this, SLOT(updateBoxes())); - connect(minSlider, SIGNAL(valueChanged(int)), this, SLOT(updateIntenFreq(int ))); - connect(maxSlider, SIGNAL(valueChanged(int)), this, SLOT(updateBoxes())); - connect(maxSlider, SIGNAL(valueChanged(int)), this, SLOT(updateIntenFreq(int ))); - connect(applyB, SIGNAL(clicked()), this, SLOT(applyScale())); + connect(minSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateBoxes())); + connect(minSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateIntenFreq(int ))); + connect(maxSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateBoxes())); + connect(maxSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(updateIntenFreq(int ))); + connect(applyB, TQT_SIGNAL(clicked()), this, TQT_SLOT(applyScale())); constructHistogram(viewer->imgBuffer); @@ -75,14 +75,14 @@ void FITSHistogram::updateBoxes() { if (minSlider->value() == BARS) - minOUT->setText(QString("%1").arg((int) viewer->stats.max)); + minOUT->setText(TQString("%1").arg((int) viewer->stats.max)); else - minOUT->setText(QString("%1").arg( (int) ( ceil (minSlider->value() * binSize) + viewer->stats.min))); + minOUT->setText(TQString("%1").arg( (int) ( ceil (minSlider->value() * binSize) + viewer->stats.min))); if (maxSlider->value() == BARS) - maxOUT->setText(QString("%1").arg((int) viewer->stats.max)); + maxOUT->setText(TQString("%1").arg((int) viewer->stats.max)); else - maxOUT->setText(QString("%1").arg( (int) ( ceil (maxSlider->value() * binSize) + viewer->stats.min))); + maxOUT->setText(TQString("%1").arg( (int) ( ceil (maxSlider->value() * binSize) + viewer->stats.min))); update(); } @@ -164,10 +164,10 @@ void FITSHistogram::constructHistogram(float * buffer) kdDebug() << "Maximum height is " << maxHeight << " -- binsize " << binSize << endl; - histogram = new QPixmap(500, 150, 1); + histogram = new TQPixmap(500, 150, 1); histogram->fill(Qt::black); - QPainter p(histogram); - QPen pen( white, 1); + TQPainter p(histogram); + TQPen pen( white, 1); p.setPen(pen); for (int i=0; i < BARS; i++) @@ -175,13 +175,13 @@ void FITSHistogram::constructHistogram(float * buffer) } -void FITSHistogram::paintEvent( QPaintEvent */*e*/) +void FITSHistogram::paintEvent( TQPaintEvent */*e*/) { int height = histFrame->height(); int xMin = minSlider->value(), xMax = maxSlider->value(); - QPainter p(histFrame); - QPen pen; + TQPainter p(histFrame); + TQPen pen; pen.setWidth(1); bitBlt(histFrame, 0, 0, histogram); @@ -197,7 +197,7 @@ void FITSHistogram::paintEvent( QPaintEvent */*e*/) } -void FITSHistogram::mouseMoveEvent( QMouseEvent *e) +void FITSHistogram::mouseMoveEvent( TQMouseEvent *e) { int x = e->x(); int y = e->y(); @@ -217,9 +217,9 @@ void FITSHistogram::updateIntenFreq(int x) int index = (int) ceil(x * binSize); - intensityOUT->setText(QString("%1").arg((int) ( index + viewer->stats.min))); + intensityOUT->setText(TQString("%1").arg((int) ( index + viewer->stats.min))); - frequencyOUT->setText(QString("%1").arg(histArray[x])); + frequencyOUT->setText(TQString("%1").arg(histArray[x])); } @@ -234,12 +234,12 @@ int FITSHistogram::findMax() return max; } -FITSHistogramCommand::FITSHistogramCommand(QWidget * parent, FITSHistogram *inHisto, int newType, int lmin, int lmax) +FITSHistogramCommand::FITSHistogramCommand(TQWidget * parent, FITSHistogram *inHisto, int newType, int lmin, int lmax) { viewer = (FITSViewer *) parent; type = newType; histo = inHisto; - oldImage = new QImage(); + oldImage = new TQImage(); // TODO apply maximum compression against this buffer buffer = (float *) malloc (viewer->image->width * viewer->image->height * sizeof(float)); @@ -387,7 +387,7 @@ void FITSHistogramCommand::unexecute() } } -QString FITSHistogramCommand::name() const +TQString FITSHistogramCommand::name() const { switch (type) diff --git a/kstars/kstars/fitshistogram.h b/kstars/kstars/fitshistogram.h index dcc64409..15d8d264 100644 --- a/kstars/kstars/fitshistogram.h +++ b/kstars/kstars/fitshistogram.h @@ -31,7 +31,7 @@ Q_OBJECT public: - FITSHistogram(QWidget *parent, const char * name = 0); + FITSHistogram(TQWidget *parent, const char * name = 0); ~FITSHistogram(); void constructHistogram(float *buffer); @@ -44,12 +44,12 @@ double binSize; FITSViewer * viewer; - QPixmap *histogram; + TQPixmap *histogram; protected: - void paintEvent( QPaintEvent *e); - void mouseMoveEvent( QMouseEvent *e); + void paintEvent( TQPaintEvent *e); + void mouseMoveEvent( TQMouseEvent *e); public slots: @@ -63,12 +63,12 @@ class FITSHistogramCommand : public KCommand { public: - FITSHistogramCommand(QWidget * parent, FITSHistogram *inHisto, int newType, int lmin, int lmax); + FITSHistogramCommand(TQWidget * parent, FITSHistogram *inHisto, int newType, int lmin, int lmax); ~FITSHistogramCommand(); void execute(); void unexecute(); - QString name() const; + TQString name() const; private: @@ -77,7 +77,7 @@ int min, max; float *buffer; FITSViewer *viewer; - QImage *oldImage; + TQImage *oldImage; }; diff --git a/kstars/kstars/fitsimage.cpp b/kstars/kstars/fitsimage.cpp index 301ea64b..d5d5ce3c 100644 --- a/kstars/kstars/fitsimage.cpp +++ b/kstars/kstars/fitsimage.cpp @@ -33,11 +33,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -64,7 +64,7 @@ static FITSLoadVals plvals = 0 /* Dont compose images */ }; -FITSImage::FITSImage(QWidget * parent, const char * name) : QScrollView(parent, name), zoomFactor(1.2) +FITSImage::FITSImage(TQWidget * parent, const char * name) : TQScrollView(parent, name), zoomFactor(1.2) { viewer = (FITSViewer *) parent; reducedImgBuffer = NULL; @@ -89,7 +89,7 @@ FITSImage::~FITSImage() delete(displayImage); } -/*void FITSImage::drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ) +/*void FITSImage::drawContents ( TQPainter * p, int clipx, int clipy, int clipw, int cliph ) { //kdDebug() << "in draw contents " << endl; //imgFrame->update(); @@ -97,19 +97,19 @@ FITSImage::~FITSImage() }*/ /**Bitblt the image onto the viewer widget */ -/*void FITSImage::paintEvent (QPaintEvent *ev) +/*void FITSImage::paintEvent (TQPaintEvent *ev) { //kdDebug() << "in paint event " << endl; //bitBlt(imgFrame, 0, 0, &qpix); }*/ /* Resize event */ -void FITSImage::resizeEvent (QResizeEvent */*ev*/) +void FITSImage::resizeEvent (TQResizeEvent */*ev*/) { updateScrollBars(); } -void FITSImage::contentsMouseMoveEvent ( QMouseEvent * e ) +void FITSImage::contentsMouseMoveEvent ( TQMouseEvent * e ) { double x,y; @@ -161,18 +161,18 @@ void FITSImage::contentsMouseMoveEvent ( QMouseEvent * e ) if (validPoint) { - viewer->statusBar()->changeItem(QString("%1 , %2").arg( (int) x).arg( (int) y), 0); + viewer->statusBar()->changeItem(TQString("%1 , %2").arg( (int) x).arg( (int) y), 0); viewer->statusBar()->changeItem( KGlobal::locale()->formatNumber( viewer->imgBuffer[(int) (y * width + x)], 3 ), 1 ); setCursor(Qt::CrossCursor); } else { - //viewer->statusBar()->changeItem(QString("(X,Y)"), 0); + //viewer->statusBar()->changeItem(TQString("(X,Y)"), 0); setCursor(Qt::ArrowCursor); } } -void FITSImage::viewportResizeEvent ( QResizeEvent * /*e*/) +void FITSImage::viewportResizeEvent ( TQResizeEvent * /*e*/) { int w, h, conW, conH, x, y; if (!displayImage) return; @@ -204,7 +204,7 @@ void FITSImage::reLoadTemplateImage() void FITSImage::saveTemplateImage() { - templateImage = new QImage(displayImage->copy()); + templateImage = new TQImage(displayImage->copy()); } void FITSImage::destroyTemplateImage() @@ -258,7 +258,7 @@ int FITSImage::loadFits (const char *filename) return (-1); } - //displayImage = new QImage(); + //displayImage = new TQImage(); KProgressDialog fitsProgress(this, 0, i18n("FITS Viewer"), i18n("Loading FITS...")); hdl = fits_seek_image (ifp, 1); @@ -314,10 +314,10 @@ int FITSImage::loadFits (const char *filename) delete (displayImage); - displayImage = new QImage(width, height, 8, 256, QImage::IgnoreEndian); + displayImage = new TQImage(width, height, 8, 256, TQImage::IgnoreEndian); for (int i=0; i < 256; i++) displayImage->setColor(i, grayTable[i]); -//displayImage = new QImage(); +//displayImage = new TQImage(); //displayImage->create(width, height, 32); @@ -356,7 +356,7 @@ int FITSImage::loadFits (const char *filename) fits_record_list * FRList = hdl->header_record_list; while (FRList != NULL) { - viewer->record << QString((char *) FRList->data); + viewer->record << TQString((char *) FRList->data); FRList = FRList->next_record; } //memcpy(viewer->record, hdl->header_record_list->data , FITS_RECORD_SIZE); @@ -459,7 +459,7 @@ void FITSImage::fitsZoomDefault() } -FITSFrame::FITSFrame(FITSImage * img, QWidget * parent, const char * name) : QFrame(parent, name, Qt::WNoAutoErase) +FITSFrame::FITSFrame(FITSImage * img, TQWidget * parent, const char * name) : TQFrame(parent, name, Qt::WNoAutoErase) { image = img; setPaletteBackgroundColor(image->viewport()->paletteBackgroundColor()); @@ -467,7 +467,7 @@ FITSFrame::FITSFrame(FITSImage * img, QWidget * parent, const char * name) : QFr FITSFrame::~FITSFrame() {} -void FITSFrame::paintEvent(QPaintEvent * /*e*/) +void FITSFrame::paintEvent(TQPaintEvent * /*e*/) { bitBlt(this, 20, 20, &(image->qpix)); diff --git a/kstars/kstars/fitsimage.h b/kstars/kstars/fitsimage.h index 50b8cf80..de40da52 100644 --- a/kstars/kstars/fitsimage.h +++ b/kstars/kstars/fitsimage.h @@ -20,14 +20,14 @@ #ifndef FITSIMAGE_H #define FITSIMAGE_H -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -42,7 +42,7 @@ class QScrollView; class FITSViewer; class FITSFrame; -class FITSImage : public QScrollView { +class FITSImage : public TQScrollView { Q_OBJECT public: @@ -56,15 +56,15 @@ class FITSImage : public QScrollView { friend class FITSChangeCommand; friend class FITSProcessCommand; - FITSImage(QWidget * parent, const char * name = 0); + FITSImage(TQWidget * parent, const char * name = 0); ~FITSImage(); enum scaleType { FITSAuto = 0 , FITSLinear, FITSLog, FITSSqrt, FITSCustom }; /**Bitblt the image onto the viewer widget */ - /*void paintEvent (QPaintEvent *ev);*/ + /*void paintEvent (TQPaintEvent *ev);*/ /* Resize event */ - void resizeEvent (QResizeEvent *ev); + void resizeEvent (TQResizeEvent *ev); /* Loads FITS image, scales it, and displays it in the GUI */ int loadFits(const char *filename); /* Convert current image to a pixmap */ @@ -75,11 +75,11 @@ class FITSImage : public QScrollView { private: FITSViewer *viewer; /* parent FITSViewer */ FITSFrame *imgFrame; /* Frame holding the image */ - QImage *displayImage; /* FITS image that is displayed in the GUI */ - QImage *templateImage; /* backup image for currentImage */ - QPixmap qpix; /* Pixmap for drawing */ + TQImage *displayImage; /* FITS image that is displayed in the GUI */ + TQImage *templateImage; /* backup image for currentImage */ + TQPixmap qpix; /* Pixmap for drawing */ KPixmapIO kpix; /* Pixmap IO for fast converting */ - QRect currentRect; /* Current rectangle encapsulating the image */ + TQRect currentRect; /* Current rectangle encapsulating the image */ int bitpix, bpp; /* bits per pixel and bytes per pixels for FITS */ int width, height; /* Original FITS dimensions */ double currentWidth,currentHeight; /* Current width and height due to zoom */ @@ -95,9 +95,9 @@ class FITSImage : public QScrollView { void zoomToCurrent(); /* Zoom the image to current zoom level without modifying it */ protected: - /*void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph );*/ - void contentsMouseMoveEvent ( QMouseEvent * e ); - void viewportResizeEvent ( QResizeEvent * e) ; + /*void drawContents ( TQPainter * p, int clipx, int clipy, int clipw, int cliph );*/ + void contentsMouseMoveEvent ( TQMouseEvent * e ); + void viewportResizeEvent ( TQResizeEvent * e) ; public slots: void fitsZoomIn(); @@ -110,14 +110,14 @@ class FITSFrame : public QFrame Q_OBJECT public: - FITSFrame(FITSImage * img, QWidget * parent = 0, const char * name = 0); + FITSFrame(FITSImage * img, TQWidget * parent = 0, const char * name = 0); ~FITSFrame(); private: FITSImage *image; protected: - void paintEvent( QPaintEvent * e); + void paintEvent( TQPaintEvent * e); }; diff --git a/kstars/kstars/fitsprocess.cpp b/kstars/kstars/fitsprocess.cpp index 60d3e539..6a4d7fcd 100644 --- a/kstars/kstars/fitsprocess.cpp +++ b/kstars/kstars/fitsprocess.cpp @@ -23,7 +23,7 @@ #include #include - #include + #include #include "fitsprocess.h" #include "fitsviewer.h" @@ -31,7 +31,7 @@ #define ELEM_SWAP(a,b) { register float t=(a);(a)=(b);(b)=t; } - FITSProcess::FITSProcess(FITSViewer *parent, QStringList darkFiles, QStringList flatFiles, QStringList darkflatFiles, int darkMode, int flatMode, int darkflatMode) + FITSProcess::FITSProcess(FITSViewer *parent, TQStringList darkFiles, TQStringList flatFiles, TQStringList darkflatFiles, int darkMode, int flatMode, int darkflatMode) { float * buffer = NULL; darkCombineMode = darkMode; @@ -101,7 +101,7 @@ FITSProcess::~FITSProcess() {} -float * FITSProcess::combine(QPtrList & frames, int mode) +float * FITSProcess::combine(TQPtrList & frames, int mode) { int nframes = frames.count(); float *dest; @@ -315,7 +315,7 @@ FITSProcessCommand::FITSProcessCommand(FITSViewer *parent) { viewer = parent; - oldImage = new QImage(); + oldImage = new TQImage(); // TODO apply maximum compression against this buffer buffer = (float *) malloc (viewer->image->width * viewer->image->height * sizeof(float)); memcpy(buffer, viewer->imgBuffer, viewer->image->width * viewer->image->height * sizeof(float)); @@ -344,7 +344,7 @@ void FITSProcessCommand::unexecute() } -QString FITSProcessCommand::name() const +TQString FITSProcessCommand::name() const { return i18n("Image Reduction"); } diff --git a/kstars/kstars/fitsprocess.h b/kstars/kstars/fitsprocess.h index db0286eb..97d4f35a 100644 --- a/kstars/kstars/fitsprocess.h +++ b/kstars/kstars/fitsprocess.h @@ -18,12 +18,12 @@ #ifndef FITSPROCESS_H #define FITSPROCESS_H - #include - #include + #include + #include #include - /*1. QPtrList darkFrames; - 2. QPtrList flatFrames; + /*1. TQPtrList darkFrames; + 2. TQPtrList flatFrames; 3. The class reads the hdu of each FITS, the size of each frame must match the original frame, if not, abort and inform the user. 4. Ignore the EXPOSURE (time in milliseconds) differences for now. We need to compensate for differences by employing different methods of extrapolation later. 5. void combine(int mode); mode is either FITS_AVERAGE or FITS_MEDIAN. @@ -36,12 +36,12 @@ class QImage; class FITSProcess { public: - FITSProcess(FITSViewer *parent, QStringList darkFiles, QStringList flatFiles, QStringList darkflatFiles, int darkMode, int flatMode, int darkflatMode); + FITSProcess(FITSViewer *parent, TQStringList darkFiles, TQStringList flatFiles, TQStringList darkflatFiles, int darkMode, int flatMode, int darkflatMode); ~FITSProcess(); - QPtrList darkFrames; - QPtrList flatFrames; - QPtrList darkflatFrames; + TQPtrList darkFrames; + TQPtrList flatFrames; + TQPtrList darkflatFrames; FITSViewer *viewer; int npix; @@ -52,7 +52,7 @@ class FITSProcess float *finalFlat; float *finalDarkFlat; - float * combine(QPtrList & frames, int mode); + float * combine(TQPtrList & frames, int mode); void subtract(float * img1, float * img2); void divide(float * img1, float * img2); void reduce(); @@ -72,12 +72,12 @@ class FITSProcessCommand : public KCommand void execute(); void unexecute(); - QString name() const; + TQString name() const; private: FITSViewer *viewer; float * buffer; - QImage *oldImage; + TQImage *oldImage; }; diff --git a/kstars/kstars/fitsviewer.cpp b/kstars/kstars/fitsviewer.cpp index e7bd0cb9..2d0ca2ed 100644 --- a/kstars/kstars/fitsviewer.cpp +++ b/kstars/kstars/fitsviewer.cpp @@ -36,14 +36,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -91,7 +91,7 @@ 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, QWidget *parent, const char *name) +FITSViewer::FITSViewer (const KURL *url, TQWidget *parent, const char *name) : KMainWindow (parent, name) { image = NULL; @@ -105,7 +105,7 @@ FITSViewer::FITSViewer (const KURL *url, QWidget *parent, const char *name) history->setUndoLimit(10); history->setRedoLimit(10); history->documentSaved(); - connect(history, SIGNAL(documentRestored()), this, SLOT(fitsRestore())); + connect(history, TQT_SIGNAL(documentRestored()), this, TQT_SLOT(fitsRestore())); /* Setup image widget */ image = new FITSImage(this); @@ -127,43 +127,43 @@ FITSViewer::FITSViewer (const KURL *url, QWidget *parent, const char *name) return; } - QFile tempFile; + TQFile tempFile; if (KSUtils::openDataFile( tempFile, "imgreduction.png" ) ) { - new KAction( i18n("Image Reduction"), tempFile.name(), KShortcut( "Ctrl+R" ), this, SLOT( imageReduction()), actionCollection(), "image_reduce"); + new KAction( i18n("Image Reduction"), tempFile.name(), KShortcut( "Ctrl+R" ), this, TQT_SLOT( imageReduction()), actionCollection(), "image_reduce"); tempFile.close(); } else - new KAction( i18n("Image Reduction"), "blend", KShortcut( "Ctrl+R" ), this, SLOT( imageReduction()), actionCollection(), "image_reduce"); + new KAction( i18n("Image Reduction"), "blend", KShortcut( "Ctrl+R" ), this, TQT_SLOT( imageReduction()), actionCollection(), "image_reduce"); /*if (KSUtils::openDataFile( tempFile, "bricon.png" ) ) { - new KAction( i18n("Brightness/Contrast"), tempFile.name(), KShortcut( "Ctrl+T" ), this, SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); + new KAction( i18n("Brightness/Contrast"), tempFile.name(), KShortcut( "Ctrl+T" ), this, TQT_SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); tempFile.close(); } else*/ - new KAction( i18n("Brightness/Contrast"), "contrast+", KShortcut( "Ctrl+T" ), this, SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); + new KAction( i18n("Brightness/Contrast"), "contrast+", KShortcut( "Ctrl+T" ), this, TQT_SLOT( BrightContrastDlg()), actionCollection(), "image_brightness_contrast"); if (KSUtils::openDataFile( tempFile, "histogram.png" ) ) { - new KAction ( i18n("Histogram"), tempFile.name(), KShortcut("Ctrl+H"), this, SLOT (imageHistogram()), actionCollection(), "image_histogram"); + new KAction ( i18n("Histogram"), tempFile.name(), KShortcut("Ctrl+H"), this, TQT_SLOT (imageHistogram()), actionCollection(), "image_histogram"); tempFile.close(); } else - new KAction ( i18n("Histogram"), "wizard", KShortcut("Ctrl+H"), this, SLOT (imageHistogram()), actionCollection(), "image_histogram"); + new KAction ( i18n("Histogram"), "wizard", KShortcut("Ctrl+H"), this, TQT_SLOT (imageHistogram()), actionCollection(), "image_histogram"); - KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - KStdAction::save(this, SLOT(fileSave()), actionCollection()); - KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); - KStdAction::close(this, SLOT(slotClose()), actionCollection()); - KStdAction::copy(this, SLOT(fitsCOPY()), actionCollection()); - KStdAction::zoomIn(image, SLOT(fitsZoomIn()), actionCollection()); - KStdAction::zoomOut(image, SLOT(fitsZoomOut()), actionCollection()); + 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()); new KAction( i18n( "&Default Zoom" ), "viewmagfit.png", KShortcut( "Ctrl+D" ), - image, SLOT(fitsZoomDefault()), actionCollection(), "zoom_default" ); - new KAction( i18n( "Statistics"), "sum", 0, this, SLOT(fitsStatistics()), actionCollection(), "image_stats"); - new KAction( i18n( "FITS Header"), "frame_spreadsheet.png", 0, this, SLOT(fitsHeader()), actionCollection(), "fits_editor"); + 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"); /* Create GUI */ createGUI("fitsviewer.rc"); @@ -211,8 +211,8 @@ void FITSViewer::slotClose() if (Dirty) { - QString caption = i18n( "Save Changes to FITS?" ); - QString message = i18n( "The current FITS file has unsaved changes. Would you like to save before closing it?" ); + TQString caption = i18n( "Save Changes to FITS?" ); + TQString message = i18n( "The current FITS file has unsaved changes. Would you like to save before closing it?" ); int ans = KMessageBox::warningYesNoCancel( 0, message, caption, KStdGuiItem::save(), KStdGuiItem::discard() ); if ( ans == KMessageBox::Yes ) fileSave(); @@ -224,14 +224,14 @@ void FITSViewer::slotClose() close(); } -void FITSViewer::closeEvent(QCloseEvent *ev) +void FITSViewer::closeEvent(TQCloseEvent *ev) { if (Dirty) { - QString caption = i18n( "Save Changes to FITS?" ); - QString message = i18n( "The current FITS file has unsaved changes. Would you like to save before closing it?" ); + TQString caption = i18n( "Save Changes to FITS?" ); + TQString message = i18n( "The current FITS file has unsaved changes. Would you like to save before closing it?" ); int ans = KMessageBox::warningYesNoCancel( 0, message, caption, KStdGuiItem::save(), KStdGuiItem::discard() ); if ( ans == KMessageBox::Yes ) fileSave(); @@ -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( QString("%1 x %2").arg( (int) stats.width).arg( (int) stats.height), 2); + statusBar()->changeItem( TQString("%1 x %2").arg( (int) stats.width).arg( (int) stats.height), 2); } @@ -474,9 +474,9 @@ double FITSViewer::stddev() } -void FITSViewer::keyPressEvent (QKeyEvent *ev) +void FITSViewer::keyPressEvent (TQKeyEvent *ev) { - //QImage Tempimage = imageList.at(undo+1)->copy(); + //TQImage Tempimage = imageList.at(undo+1)->copy(); ev->accept(); //make sure key press events are captured. switch (ev->key()) @@ -496,8 +496,8 @@ void FITSViewer::fileOpen() if (Dirty) { - QString caption = i18n( "Save Changes to FITS?" ); - QString message = i18n( "The current FITS file has unsaved changes. Would you like to save before closing it?" ); + TQString caption = i18n( "Save Changes to FITS?" ); + TQString message = i18n( "The current FITS file has unsaved changes. Would you like to save before closing it?" ); int ans = KMessageBox::warningYesNoCancel( 0, message, caption, KStdGuiItem::save(), KStdGuiItem::discard() ); if ( ans == KMessageBox::Yes ) fileSave(); @@ -505,7 +505,7 @@ void FITSViewer::fileOpen() fitsRestore(); } - KURL fileURL = KFileDialog::getOpenURL( QDir::homeDirPath(), "*.fits *.fit *.fts|Flexible Image Transport System"); + KURL fileURL = KFileDialog::getOpenURL( TQDir::homeDirPath(), "*.fits *.fit *.fts|Flexible Image Transport System"); if (fileURL.isEmpty()) return; @@ -521,9 +521,9 @@ void FITSViewer::fileSave() { FITS_FILE *ifp; - QString recordList; + TQString recordList; KURL backupCurrent = currentURL; - QString bitpixRec; + TQString bitpixRec; FITS_BITPIX16 pixval_16 =0; FITS_BITPIX32 pixval_32 =0; FITS_BITPIXM32 pixval_m32 =0; @@ -531,7 +531,7 @@ void FITSViewer::fileSave() unsigned char *transData; int index=0, i=0, transCount = 0, totalCount= image->width * image->height; - QString currentDir = Options::fitsSaveDirectory(); + TQString currentDir = Options::fitsSaveDirectory(); //kdDebug() << "We doing stats BEFORE we save!! " << endl; //calculateStats(); @@ -551,9 +551,9 @@ void FITSViewer::fileSave() } if (currentURL.path().contains('.') == 0) currentURL.setPath(currentURL.path() + ".fits"); - if (QFile::exists(currentURL.path())) + if (TQFile::exists(currentURL.path())) { - int r=KMessageBox::warningContinueCancel(static_cast(parent()), + int r=KMessageBox::warningContinueCancel(static_cast(parent()), i18n( "A file named \"%1\" already exists. " "Overwrite it?" ).arg(currentURL.fileName()), i18n( "Overwrite File?" ), @@ -692,7 +692,7 @@ void FITSViewer::fileSave() } else { - QString message = i18n( "Invalid URL: %1" ).arg( currentURL.url() ); + TQString message = i18n( "Invalid URL: %1" ).arg( currentURL.url() ); KMessageBox::sorry( 0, message, i18n( "Invalid URL" ) ); } @@ -728,14 +728,14 @@ void FITSViewer::imageReduction() { FITSProcessCommand *cbc; FITSHistogramCommand *hbc; - QStringList darkFiles, flatFiles, darkflatFiles; + TQStringList darkFiles, flatFiles, darkflatFiles; int darkCombineMode = 0 , flatCombineMode = 0, darkflatCombineMode =0; - QListViewItem *file; + TQListViewItem *file; image->saveTemplateImage(); ImageReductionDlg irDialog(this); - if (irDialog.exec() == QDialog::Accepted) + if (irDialog.exec() == TQDialog::Accepted) { if (irDialog.darkListView->childCount() == 0 && irDialog.flatListView->childCount() == 0) @@ -789,7 +789,7 @@ void FITSViewer::BrightContrastDlg() image->saveTemplateImage(); ContrastBrightnessDlg conbriDlg(this); - if (conbriDlg.exec() == QDialog::Rejected) + if (conbriDlg.exec() == TQDialog::Rejected) { image->reLoadTemplateImage(); image->zoomToCurrent(); @@ -835,7 +835,7 @@ void FITSViewer::imageHistogram() histo->show(); } - /*if (hist.exec() == QDialog::Rejected) + /*if (hist.exec() == TQDialog::Rejected) { if (hist.napply > 0) for (int i=0; i < hist.napply; i++) @@ -880,15 +880,15 @@ void FITSViewer::fitsStatistics() calculateStats(); - stat.widthOUT->setText(QString("%1").arg(stats.width)); - stat.heightOUT->setText(QString("%1").arg(stats.height)); - stat.bitpixOUT->setText(QString("%1").arg(stats.bitpix)); - stat.maxOUT->setText(QString("%1").arg(stats.max)); - stat.minOUT->setText(QString("%1").arg(stats.min)); - stat.atMaxOUT->setText(QString("%1").arg(stats.maxAt)); - stat.atMinOUT->setText(QString("%1").arg(stats.minAt)); - stat.meanOUT->setText(QString("%1").arg(stats.average)); - stat.stddevOUT->setText(QString("%1").arg(stats.stddev)); + 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.exec(); @@ -896,9 +896,9 @@ void FITSViewer::fitsStatistics() void FITSViewer::fitsHeader() { - QStringList cards; - QString recordList; - QString property; + TQStringList cards; + TQString recordList; + TQString property; int equal, slash; fitsHeaderDialog header(this); @@ -908,7 +908,7 @@ void FITSViewer::fitsHeader() for (unsigned int i=0; i < record.count(); i++) { recordList = record[i]; - //recordList = QString((char *) record); + //recordList = TQString((char *) record); for (int j=0; j < FITS_RECORD_SIZE / FITS_CARD_SIZE; j++) { @@ -944,7 +944,7 @@ void FITSViewer::fitsHeader() } for (int k= cards.count() - 3; k >=0 ; k-=3) - new QListViewItem( header.headerView, cards[k], cards[k+1], cards[k+2]); + new TQListViewItem( header.headerView, cards[k], cards[k+1], cards[k+2]); header.exec(); @@ -952,11 +952,11 @@ void FITSViewer::fitsHeader() } -FITSChangeCommand::FITSChangeCommand(QWidget * parent, int inType, QImage* newIMG, QImage *oldIMG) +FITSChangeCommand::FITSChangeCommand(TQWidget * parent, int inType, TQImage* newIMG, TQImage *oldIMG) { viewer = (FITSViewer *) parent; - newImage = new QImage(); - oldImage = new QImage(); + newImage = new TQImage(); + oldImage = new TQImage(); *newImage = newIMG->copy(); *oldImage = oldIMG->copy(); type = inType; @@ -981,7 +981,7 @@ void FITSChangeCommand::unexecute() } -QString FITSChangeCommand::name() const +TQString FITSChangeCommand::name() const { switch (type) { diff --git a/kstars/kstars/fitsviewer.h b/kstars/kstars/fitsviewer.h index 334b72f5..e9560d1e 100644 --- a/kstars/kstars/fitsviewer.h +++ b/kstars/kstars/fitsviewer.h @@ -20,15 +20,15 @@ #ifndef FITSViewer_H #define FITSViewer_H -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -59,7 +59,7 @@ class FITSViewer : public KMainWindow { friend class FITSProcessCommand; /**Constructor. */ - FITSViewer (const KURL *imageName, QWidget *parent, const char *name = 0); + FITSViewer (const KURL *imageName, TQWidget *parent, const char *name = 0); ~FITSViewer(); @@ -68,10 +68,10 @@ class FITSViewer : public KMainWindow { protected: /* key press event */ - void keyPressEvent (QKeyEvent *ev); + void keyPressEvent (TQKeyEvent *ev); /* Calculate stats */ void calculateStats(); - void closeEvent(QCloseEvent *ev); + void closeEvent(TQCloseEvent *ev); public slots: void fitsChange(); @@ -106,7 +106,7 @@ class FITSViewer : public KMainWindow { KURL currentURL; /* FITS File name and path */ float *imgBuffer; /* Main unmodified FITS data buffer */ KCommandHistory *history; /* History for undo/redo */ - QStringList record; /* FITS records */ + TQStringList record; /* FITS records */ FITSHistogram *histo; /* stats struct to hold statisical data about the FITS data */ @@ -124,20 +124,20 @@ class FITSViewer : public KMainWindow { class FITSChangeCommand : public KCommand { public: - FITSChangeCommand(QWidget * parent, int inType, QImage *newIMG, QImage *oldIMG); + FITSChangeCommand(TQWidget * parent, int inType, TQImage *newIMG, TQImage *oldIMG); ~FITSChangeCommand(); void execute(); void unexecute(); - QString name() const; + TQString name() const; private: int type; protected: FITSViewer *viewer; - QImage *newImage; - QImage *oldImage; + TQImage *newImage; + TQImage *oldImage; }; diff --git a/kstars/kstars/focusdialog.cpp b/kstars/kstars/focusdialog.cpp index db08a570..4f243f0e 100644 --- a/kstars/kstars/focusdialog.cpp +++ b/kstars/kstars/focusdialog.cpp @@ -15,14 +15,14 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include #include -#include +#include #include #include "kstars.h" @@ -32,24 +32,24 @@ #include "dmsbox.h" #include "focusdialog.h" -FocusDialog::FocusDialog( QWidget *parent ) +FocusDialog::FocusDialog( TQWidget *parent ) : KDialogBase( KDialogBase::Plain, i18n( "Set Focus Manually" ), Ok|Cancel, Ok, parent ) { Point = 0; //initialize pointer to null UsedAltAz = false; //assume RA/Dec by default - QFrame *page = plainPage(); + TQFrame *page = plainPage(); setMainWidget(page); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, spacingHint() ); fdlg = new FocusDialogDlg(page); fdlg->epochName->setValidator( new KDoubleValidator( fdlg->epochName ) ); vlay->addWidget( fdlg ); - connect( fdlg->raBox, SIGNAL(textChanged( const QString & ) ), this, SLOT( checkLineEdits() ) ); - connect( fdlg->decBox, SIGNAL(textChanged( const QString & ) ), this, SLOT( checkLineEdits() ) ); - connect( fdlg->azBox, SIGNAL(textChanged( const QString & ) ), this, SLOT( checkLineEdits() ) ); - connect( fdlg->altBox, SIGNAL(textChanged( const QString & ) ), this, SLOT( checkLineEdits() ) ); - connect( this, SIGNAL( okClicked() ), this, SLOT( validatePoint() ) ); + connect( fdlg->raBox, TQT_SIGNAL(textChanged( const TQString & ) ), this, TQT_SLOT( checkLineEdits() ) ); + connect( fdlg->decBox, TQT_SIGNAL(textChanged( const TQString & ) ), this, TQT_SLOT( checkLineEdits() ) ); + connect( fdlg->azBox, TQT_SIGNAL(textChanged( const TQString & ) ), this, TQT_SLOT( checkLineEdits() ) ); + connect( fdlg->altBox, TQT_SIGNAL(textChanged( const TQString & ) ), this, TQT_SLOT( checkLineEdits() ) ); + connect( this, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( validatePoint() ) ); fdlg->raBox->setDegType(false); //RA box should be HMS-style fdlg->raBox->setFocus(); //set input focus @@ -79,7 +79,7 @@ void FocusDialog::validatePoint() { bool raOk(false), decOk(false), azOk(false), altOk(false); dms ra( fdlg->raBox->createDms( false, &raOk ) ); //false means expressed in hours dms dec( fdlg->decBox->createDms( true, &decOk ) ); - QString message; + TQString message; KStars *ks = (KStars*) parent(); @@ -99,7 +99,7 @@ void FocusDialog::validatePoint() { long double jd0 = epochToJd ( epoch0 ); Point->apparentCoord(jd0, ks->data()->ut().djd() ); - QDialog::accept(); + TQDialog::accept(); } else { dms az( fdlg->azBox->createDms( true, &azOk ) ); dms alt( fdlg->altBox->createDms( true, &altOk ) ); @@ -120,14 +120,14 @@ void FocusDialog::validatePoint() { Point->setAlt( alt ); UsedAltAz = true; - QDialog::accept(); + TQDialog::accept(); } else { - QDialog::reject(); + TQDialog::reject(); } } } -double FocusDialog::getEpoch (QString eName) { +double FocusDialog::getEpoch (TQString eName) { //If eName is empty (or not a number) assume 2000.0 bool ok(false); double epoch = eName.toDouble( &ok ); @@ -152,9 +152,9 @@ long double FocusDialog::epochToJd (double epoch) { } -QSize FocusDialog::sizeHint() const +TQSize FocusDialog::sizeHint() const { - return QSize(240,210); + return TQSize(240,210); } void FocusDialog::activateAzAltPage() { diff --git a/kstars/kstars/focusdialog.h b/kstars/kstars/focusdialog.h index 8efef068..24eccad5 100644 --- a/kstars/kstars/focusdialog.h +++ b/kstars/kstars/focusdialog.h @@ -37,7 +37,7 @@ class FocusDialog : public KDialogBase { Q_OBJECT public: /**Constructor. */ - FocusDialog( QWidget *parent=0 ); + FocusDialog( TQWidget *parent=0 ); /**Destructor (empty). */ ~FocusDialog(); @@ -46,7 +46,7 @@ public: SkyPoint* point() const { return Point; } /**@return suggested size of focus window. */ - QSize sizeHint() const; + TQSize sizeHint() const; /**@return whether user set the AltAz coords */ bool usedAltAz() const { return UsedAltAz; } @@ -54,7 +54,7 @@ public: void activateAzAltPage(); long double epochToJd (double epoch); - double getEpoch (QString eName); + double getEpoch (TQString eName); public slots: /**If text has been entered in both KLineEdits, enable the Ok button. */ @@ -67,8 +67,8 @@ public slots: void slotOk(); private: - QVBoxLayout *vlay; - QHBoxLayout *hlayRA, *hlayDec; + TQVBoxLayout *vlay; + TQHBoxLayout *hlayRA, *hlayDec; KLineEdit *editRA, *editDec; SkyPoint *Point; FocusDialogDlg *fdlg; diff --git a/kstars/kstars/fov.cpp b/kstars/kstars/fov.cpp index d7fd5d32..2820221a 100644 --- a/kstars/kstars/fov.cpp +++ b/kstars/kstars/fov.cpp @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include #include @@ -24,23 +24,23 @@ #include "fov.h" //------------FOV-----------------// -FOV::FOV( QString n, float sz, int sh, QString col ) : Name( n ), Color( col ), Size( sz ), Shape( sh ) +FOV::FOV( TQString n, float sz, int sh, TQString col ) : Name( n ), Color( col ), Size( sz ), Shape( sh ) {} FOV::FOV() : Name( i18n( "No FOV" ) ), Color( "#FFFFFF" ), Size( 0.0 ), Shape( 0 ) {} -FOV::FOV( QString sname ) { - QFile f; +FOV::FOV( TQString sname ) { + TQFile f; f.setName( locate( "appdata", "fov.dat" ) ); int sh; float sz; if ( f.exists() && f.open( IO_ReadOnly ) ) { - QTextStream stream( &f ); + TQTextStream stream( &f ); while ( !stream.eof() ) { - QStringList fields = QStringList::split( ":", stream.readLine() ); + TQStringList fields = TQStringList::split( ":", stream.readLine() ); bool ok( false ); if ( fields.count() == 4 ) { @@ -71,8 +71,8 @@ FOV::FOV( QString sname ) { Color = "#FFFFFF"; } -void FOV::draw( QPainter &p, float pixelsize ) { - p.setPen( QColor( color() ) ); +void FOV::draw( TQPainter &p, float pixelsize ) { + p.setPen( TQColor( color() ) ); p.setBrush( Qt::NoBrush ); int w = p.viewport().width(); int h = p.viewport().height(); @@ -128,7 +128,7 @@ void FOV::draw( QPainter &p, float pixelsize ) { } case 4: { // Solid Circle int s = int( pixelsize ); - p.setBrush( QBrush ( QColor( color() ), Qt::Dense4Pattern) ); + p.setBrush( TQBrush ( TQColor( color() ), Qt::Dense4Pattern) ); p.drawEllipse( (w - s)/2, (h - s)/2, s, s ); p.setBrush(Qt::NoBrush); break; diff --git a/kstars/kstars/fov.h b/kstars/kstars/fov.h index 11d3d769..64a3fd04 100644 --- a/kstars/kstars/fov.h +++ b/kstars/kstars/fov.h @@ -18,7 +18,7 @@ #ifndef FOV_H #define FOV_H -#include +#include #include /**@class FOV A simple class encapulating a Field-of-View symbol @@ -31,29 +31,29 @@ class QPainter; class FOV { public: FOV(); - FOV( QString name ); //in this case, read params from fov.dat - FOV( QString name, float size, int shape=0, QString color="#FFFFFF" ); + FOV( TQString name ); //in this case, read params from fov.dat + FOV( TQString name, float size, int shape=0, TQString color="#FFFFFF" ); ~FOV() {} // enum SHAPE { FOV_SQUARE=0, FOV_CIRCLE=1, FOV_CROSSHAIRS=2, FOV_BULLSEYE=3, FOV_UNKNOWN }; - QString name() const { return Name; } - void setName( const QString &n ) { Name = n; } + TQString name() const { return Name; } + void setName( const TQString &n ) { Name = n; } int shape() const { return Shape; } void setShape( int s ) { Shape = s; } float size() const { return Size; } void setSize( float s ) { Size = s; } - QString color() const { return Color; } - void setColor( const QString &c ) { Color = c; } + TQString color() const { return Color; } + void setColor( const TQString &c ) { Color = c; } /**@short draw the FOV symbol on a QPainter - *@param p reference to the target QPainter. The painter should already be started. + *@param p reference to the target TQPainter. The painter should already be started. *@param size the size of the target symbol, in pixels. */ - void draw( QPainter &p, float size ); + void draw( TQPainter &p, float size ); private: - QString Name, Color; + TQString Name, Color; float Size; int Shape; }; diff --git a/kstars/kstars/fovdialog.cpp b/kstars/kstars/fovdialog.cpp index 5d7b093a..05080043 100644 --- a/kstars/kstars/fovdialog.cpp +++ b/kstars/kstars/fovdialog.cpp @@ -15,11 +15,11 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -39,20 +39,20 @@ //---------FOVDialog---------------// -FOVDialog::FOVDialog( QWidget *parent ) +FOVDialog::FOVDialog( TQWidget *parent ) : KDialogBase( KDialogBase::Plain, i18n( "Set FOV Indicator" ), Ok|Cancel, Ok, parent ) { ks = (KStars*)parent; - QFrame *page = plainPage(); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, 0 ); + TQFrame *page = plainPage(); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, 0 ); fov = new FOVDialogUI( page ); vlay->addWidget( fov ); - connect( fov->FOVListBox, SIGNAL( currentChanged( QListBoxItem* ) ), SLOT( slotSelect( QListBoxItem* ) ) ); - connect( fov->NewButton, SIGNAL( clicked() ), SLOT( slotNewFOV() ) ); - connect( fov->EditButton, SIGNAL( clicked() ), SLOT( slotEditFOV() ) ); - connect( fov->RemoveButton, SIGNAL( clicked() ), SLOT( slotRemoveFOV() ) ); + connect( fov->FOVListBox, TQT_SIGNAL( currentChanged( TQListBoxItem* ) ), TQT_SLOT( slotSelect( TQListBoxItem* ) ) ); + connect( fov->NewButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotNewFOV() ) ); + connect( fov->EditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotEditFOV() ) ); + connect( fov->RemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRemoveFOV() ) ); FOVList.setAutoDelete( true ); initList(); @@ -62,21 +62,21 @@ FOVDialog::~FOVDialog() {} void FOVDialog::initList() { - QStringList fields; - QFile f; + TQStringList fields; + TQFile f; - QString nm, cl; + TQString nm, cl; int sh(0); float sz(0.0); f.setName( locate( "appdata", "fov.dat" ) ); if ( f.exists() && f.open( IO_ReadOnly ) ) { - QListBoxItem *item = 0; + TQListBoxItem *item = 0; - QTextStream stream( &f ); + TQTextStream stream( &f ); while ( !stream.eof() ) { - fields = QStringList::split( ":", stream.readLine() ); + fields = TQStringList::split( ":", stream.readLine() ); bool ok( false ); if ( fields.count() == 4 ) { @@ -108,7 +108,7 @@ void FOVDialog::initList() { } } -void FOVDialog::slotSelect(QListBoxItem *item) { +void FOVDialog::slotSelect(TQListBoxItem *item) { if ( item == 0 ) { //no item selected fov->RemoveButton->setEnabled( false ); fov->EditButton->setEnabled( false ); @@ -121,17 +121,17 @@ void FOVDialog::slotSelect(QListBoxItem *item) { update(); } -void FOVDialog::paintEvent( QPaintEvent * ) { +void FOVDialog::paintEvent( TQPaintEvent * ) { //Draw the selected target symbol in the pixmap. - QPainter p; + TQPainter p; p.begin( fov->ViewBox ); - p.fillRect( fov->ViewBox->contentsRect(), QColor( "black" ) ); + p.fillRect( fov->ViewBox->contentsRect(), TQColor( "black" ) ); if ( fov->FOVListBox->currentItem() >= 0 ) { FOV *f = FOVList.at( fov->FOVListBox->currentItem() ); if ( f->size() > 0 ) { f->draw( p, (float)( 0.3*fov->ViewBox->contentsRect().width() ) ); - QFont smallFont = p.font(); + TQFont smallFont = p.font(); smallFont.setPointSize( p.font().pointSize() - 2 ); p.setFont( smallFont ); p.drawText( 0, fov->ViewBox->contentsRect().height(), i18n("angular size in arcminutes", "%1 arcmin").arg( KGlobal::locale()->formatNumber( f->size() ), 3 ) ); @@ -144,7 +144,7 @@ void FOVDialog::paintEvent( QPaintEvent * ) { void FOVDialog::slotNewFOV() { NewFOV newfdlg( this ); - if ( newfdlg.exec() == QDialog::Accepted ) { + if ( newfdlg.exec() == TQDialog::Accepted ) { FOV *newfov = new FOV( newfdlg.ui->FOVName->text(), newfdlg.ui->FOVEdit->text().toDouble(), newfdlg.ui->ShapeBox->currentItem(), newfdlg.ui->ColorButton->color().name() ); fov->FOVListBox->insertItem( newfdlg.ui->FOVName->text() ); @@ -163,11 +163,11 @@ void FOVDialog::slotEditFOV() { newfdlg.ui->FOVName->setText( f->name() ); newfdlg.ui->FOVEdit->setText( KGlobal::locale()->formatNumber( f->size(), 3 ) ); - newfdlg.ui->ColorButton->setColor( QColor( f->color() ) ); + newfdlg.ui->ColorButton->setColor( TQColor( f->color() ) ); newfdlg.ui->ShapeBox->setCurrentItem( f->shape() ); newfdlg.slotUpdateFOV(); - if ( newfdlg.exec() == QDialog::Accepted ) { + if ( newfdlg.exec() == TQDialog::Accepted ) { FOV *newfov = new FOV( newfdlg.ui->FOVName->text(), newfdlg.ui->FOVEdit->text().toDouble(), newfdlg.ui->ShapeBox->currentItem(), newfdlg.ui->ColorButton->color().name() ); fov->FOVListBox->changeItem( newfdlg.ui->FOVName->text(), fov->FOVListBox->currentItem() ); @@ -184,7 +184,7 @@ void FOVDialog::slotRemoveFOV() { fov->FOVListBox->update(); if ( FOVList.isEmpty() ) { - QString message( i18n( "You have removed all FOV symbols. If the list remains empty when you exit this tool, the default symbols will be regenerated." ) ); + TQString message( i18n( "You have removed all FOV symbols. If the list remains empty when you exit this tool, the default symbols will be regenerated." ) ); KMessageBox::information( 0, message, i18n( "FOV list is empty" ), "dontShowFOVMessage" ); } @@ -192,20 +192,20 @@ void FOVDialog::slotRemoveFOV() { } //-------------NewFOV------------------// -NewFOV::NewFOV( QWidget *parent ) +NewFOV::NewFOV( TQWidget *parent ) : KDialogBase( KDialogBase::Plain, i18n( "New FOV Indicator" ), Ok|Cancel, Ok, parent ), f() { - QFrame *page = plainPage(); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, 0 ); + TQFrame *page = plainPage(); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, 0 ); ui = new NewFOVUI( page ); vlay->addWidget( ui ); - connect( ui->FOVName, SIGNAL( textChanged( const QString & ) ), SLOT( slotUpdateFOV() ) ); - connect( ui->FOVEdit, SIGNAL( textChanged( const QString & ) ), SLOT( slotUpdateFOV() ) ); - connect( ui->ColorButton, SIGNAL( changed( const QColor & ) ), SLOT( slotUpdateFOV() ) ); - connect( ui->ShapeBox, SIGNAL( activated( int ) ), SLOT( slotUpdateFOV() ) ); - connect( ui->ComputeEyeFOV, SIGNAL( clicked() ), SLOT( slotComputeFOV() ) ); - connect( ui->ComputeCameraFOV, SIGNAL( clicked() ), SLOT( slotComputeFOV() ) ); - connect( ui->ComputeHPBW, SIGNAL( clicked() ), SLOT( slotComputeFOV() ) ); + connect( ui->FOVName, TQT_SIGNAL( textChanged( const TQString & ) ), TQT_SLOT( slotUpdateFOV() ) ); + connect( ui->FOVEdit, TQT_SIGNAL( textChanged( const TQString & ) ), TQT_SLOT( slotUpdateFOV() ) ); + connect( ui->ColorButton, TQT_SIGNAL( changed( const TQColor & ) ), TQT_SLOT( slotUpdateFOV() ) ); + connect( ui->ShapeBox, TQT_SIGNAL( activated( int ) ), TQT_SLOT( slotUpdateFOV() ) ); + connect( ui->ComputeEyeFOV, TQT_SIGNAL( clicked() ), TQT_SLOT( slotComputeFOV() ) ); + connect( ui->ComputeCameraFOV, TQT_SIGNAL( clicked() ), TQT_SLOT( slotComputeFOV() ) ); + connect( ui->ComputeHPBW, TQT_SIGNAL( clicked() ), TQT_SLOT( slotComputeFOV() ) ); slotUpdateFOV(); } @@ -226,10 +226,10 @@ void NewFOV::slotUpdateFOV() { update(); } -void NewFOV::paintEvent( QPaintEvent * ) { - QPainter p; +void NewFOV::paintEvent( TQPaintEvent * ) { + TQPainter p; p.begin( ui->ViewBox ); - p.fillRect( ui->ViewBox->contentsRect(), QColor( "black" ) ); + p.fillRect( ui->ViewBox->contentsRect(), TQColor( "black" ) ); f.draw( p, (float)( 0.3*ui->ViewBox->contentsRect().width() ) ); p.drawText( 0, 0, i18n("angular size in arcminutes", "%1 arcmin").arg( KGlobal::locale()->formatNumber( f.size() ), 3 ) ); p.end(); @@ -238,14 +238,14 @@ void NewFOV::paintEvent( QPaintEvent * ) { void NewFOV::slotComputeFOV() { //DEBUG kdDebug() << ":" << sender()->name() << ":" << endl; - if ( sender()->name() == QString( "ComputeEyeFOV" ) ) kdDebug() << "A" << endl; - if ( sender()->name() == QString( "ComputeEyeFOV" ) && ui->TLength1->value() > 0.0 ) kdDebug() << "B" << endl; + if ( sender()->name() == TQString( "ComputeEyeFOV" ) ) kdDebug() << "A" << endl; + if ( sender()->name() == TQString( "ComputeEyeFOV" ) && ui->TLength1->value() > 0.0 ) kdDebug() << "B" << endl; - if ( sender()->name() == QString( "ComputeEyeFOV" ) && ui->TLength1->value() > 0.0 ) + if ( sender()->name() == TQString( "ComputeEyeFOV" ) && ui->TLength1->value() > 0.0 ) ui->FOVEdit->setText( KGlobal::locale()->formatNumber( ui->EyeFOV->value() * ui->EyeLength->value() / ui->TLength1->value() ) ); - else if ( sender()->name() == QString( "ComputeCameraFOV" ) && ui->TLength2->value() > 0.0 ) + else if ( sender()->name() == TQString( "ComputeCameraFOV" ) && ui->TLength2->value() > 0.0 ) ui->FOVEdit->setText( KGlobal::locale()->formatNumber( ui->ChipSize->value() * 3438.0 / ui->TLength2->value() ) ); - else if ( sender()->name() == QString( "ComputeHPBW" ) && ui->RTDiameter->value() > 0.0 && ui->WaveLength->value() > 0.0 ) { + else if ( sender()->name() == TQString( "ComputeHPBW" ) && ui->RTDiameter->value() > 0.0 && ui->WaveLength->value() > 0.0 ) { ui->FOVEdit->setText( KGlobal::locale()->formatNumber( 34.34 * 1.2 * ui->WaveLength->value() / ui->RTDiameter->value() ) ); // Beam width for an antenna is usually a circle on the sky. ui->ShapeBox->setCurrentItem(4); diff --git a/kstars/kstars/fovdialog.h b/kstars/kstars/fovdialog.h index aea38cf0..8f7b6de8 100644 --- a/kstars/kstars/fovdialog.h +++ b/kstars/kstars/fovdialog.h @@ -18,7 +18,7 @@ #ifndef FOVDIALOG_H #define FOVDIALOG_H -#include +#include #include #include "fov.h" @@ -35,19 +35,19 @@ class FOVDialog : public KDialogBase { Q_OBJECT public: - FOVDialog( QWidget *parent=0 ); + FOVDialog( TQWidget *parent=0 ); ~FOVDialog(); unsigned int currentItem() const; - QPtrList FOVList; + TQPtrList FOVList; protected: - void paintEvent( QPaintEvent * ); + void paintEvent( TQPaintEvent * ); private slots: void slotNewFOV(); void slotEditFOV(); void slotRemoveFOV(); - void slotSelect(QListBoxItem*); + void slotSelect(TQListBoxItem*); private: void initList(); @@ -64,7 +64,7 @@ class NewFOV : public KDialogBase { Q_OBJECT public: - NewFOV( QWidget *parent=0 ); + NewFOV( TQWidget *parent=0 ); ~NewFOV() {} NewFOVUI *ui; @@ -73,7 +73,7 @@ public slots: void slotComputeFOV(); protected: - void paintEvent( QPaintEvent * ); + void paintEvent( TQPaintEvent * ); private: FOV f; diff --git a/kstars/kstars/geolocation.cpp b/kstars/kstars/geolocation.cpp index 3750803c..f6ce95e5 100644 --- a/kstars/kstars/geolocation.cpp +++ b/kstars/kstars/geolocation.cpp @@ -17,7 +17,7 @@ * * ***************************************************************************/ -#include +#include #include "geolocation.h" #include "timezonerule.h" @@ -56,7 +56,7 @@ GeoLocation::GeoLocation( GeoLocation *g ) { } GeoLocation::GeoLocation( dms lng, dms lat, - QString name, QString province, QString country, double tz, TimeZoneRule *tzrule, int iEllips, double hght ) { + TQString name, TQString province, TQString country, double tz, TimeZoneRule *tzrule, int iEllips, double hght ) { Longitude = lng; Latitude = lat; Name = name; @@ -71,7 +71,7 @@ GeoLocation::GeoLocation( dms lng, dms lat, } GeoLocation::GeoLocation( double lng, double lat, - QString name, QString province, QString country, double tz, TimeZoneRule *tzrule, int iEllips, double hght ) { + TQString name, TQString province, TQString country, double tz, TimeZoneRule *tzrule, int iEllips, double hght ) { Longitude.set( lng ); Latitude.set( lat ); Name = name; @@ -85,7 +85,7 @@ GeoLocation::GeoLocation( double lng, double lat, geodToCart(); } -GeoLocation::GeoLocation( double x, double y, double z, QString name, QString province, QString country, double TZ, TimeZoneRule *tzrule, int iEllips ) { +GeoLocation::GeoLocation( double x, double y, double z, TQString name, TQString province, TQString country, double TZ, TimeZoneRule *tzrule, int iEllips ) { PosCartX = x; PosCartY = y; PosCartZ = z; @@ -99,8 +99,8 @@ GeoLocation::GeoLocation( double x, double y, double z, QString name, QString pr cartToGeod(); } -QString GeoLocation::fullName() const { - QString s; +TQString GeoLocation::fullName() const { + TQString s; if ( province().isEmpty() ) { s = translatedName() + ", " + translatedCountry(); } else { diff --git a/kstars/kstars/geolocation.h b/kstars/kstars/geolocation.h index 8acce1be..c3b6524e 100644 --- a/kstars/kstars/geolocation.h +++ b/kstars/kstars/geolocation.h @@ -64,7 +64,7 @@ public: *@param iEllips type of geodetic ellipsoid model *@param hght the elevation above sea level (in meters?) */ - GeoLocation( dms lng, dms lat, QString name="Nowhere", QString province="Nowhere", QString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10 ); + GeoLocation( dms lng, dms lat, TQString name="Nowhere", TQString province="Nowhere", TQString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10 ); /**Constructor using doubles to specify longitude and latitude. *@param lng the longitude @@ -77,7 +77,7 @@ public: *@param iEllips type of geodetic ellipsoid model *@param hght the elevation above sea level (in meters?) */ - GeoLocation( double lng, double lat, QString name="Nowhere", QString province="Nowhere", QString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10 ); + GeoLocation( double lng, double lat, TQString name="Nowhere", TQString province="Nowhere", TQString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10 ); /**Constructor using doubles to specify X, Y and Z referred to the center of the Earth. *@param x the x-position, in m @@ -90,7 +90,7 @@ public: *@param TZrule pointer to the daylight savings time rule *@param iEllips type of geodetic ellipsoid model */ - GeoLocation( double x, double y, double z, QString name="Nowhere", QString province="Nowhere", QString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4 ); + GeoLocation( double x, double y, double z, TQString name="Nowhere", TQString province="Nowhere", TQString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4 ); /**Destructor (empty) @@ -121,26 +121,26 @@ public: /**@return untranslated City name */ - QString name() const { return Name; } + TQString name() const { return Name; } /**@return translated City name */ - QString translatedName() const { return i18n("City name (optional, probably does not need a translation)", Name.utf8().data()); } + TQString translatedName() const { return i18n("City name (optional, probably does not need a translation)", Name.utf8().data()); } /**@return untranslated Province name */ - QString province() const { return Province; } + TQString province() const { return Province; } /**@return translated Province name */ - QString translatedProvince() const { return i18n("Region/state name (optional, rarely needs a translation)", Province.utf8().data()); } + TQString translatedProvince() const { return i18n("Region/state name (optional, rarely needs a translation)", Province.utf8().data()); } /**@return untranslated Country name */ - QString country() const { return Country; } + TQString country() const { return Country; } /**@return translated Country name */ - QString translatedCountry() const { return i18n("Country name (optional, but should be translated)", Country.utf8().data()); } + TQString translatedCountry() const { return i18n("Country name (optional, but should be translated)", Country.utf8().data()); } /**@return comma-separated city, province, country names (each localized) */ - QString fullName() const; + TQString fullName() const; /**@return time zone without DST correction */ @@ -226,17 +226,17 @@ public: /**Set City name according to argument. *@p n new city name */ - void setName( const QString &n ) { Name = n; } + void setName( const TQString &n ) { Name = n; } /**Set Province name according to argument. *@p n new province name */ - void setProvince( const QString &n ) { Province = n; } + void setProvince( const TQString &n ) { Province = n; } /**Set Country name according to argument. *@p n new country name */ - void setCountry( const QString &n ) { Country = n; } + void setCountry( const TQString &n ) { Country = n; } /**Sets Time Zone according to argument. *@p tz new timezone offset @@ -312,7 +312,7 @@ public: private: dms Longitude, Latitude; - QString Name, Province, Country; + TQString Name, Province, Country; TimeZoneRule *TZrule; double TimeZone, Height; double axis, flattening; diff --git a/kstars/kstars/imagereductiondlg.cpp b/kstars/kstars/imagereductiondlg.cpp index 0cf63972..bfcafebc 100644 --- a/kstars/kstars/imagereductiondlg.cpp +++ b/kstars/kstars/imagereductiondlg.cpp @@ -15,8 +15,8 @@ * * ***************************************************************************/ - #include - #include + #include + #include #include #include @@ -24,17 +24,17 @@ #include "imagereductiondlg.h" - ImageReductionDlg::ImageReductionDlg(QWidget * parent, const char * name) : imageReductionUI(parent, name) + ImageReductionDlg::ImageReductionDlg(TQWidget * parent, const char * name) : imageReductionUI(parent, name) { - connect(darkAddB, SIGNAL(clicked()), this, SLOT(addDarkFile())); - connect(flatAddB, SIGNAL(clicked()), this, SLOT(addFlatFile())); - connect(darkRemoveB, SIGNAL(clicked()), this, SLOT(removeDarkFile())); - connect(flatRemoveB, SIGNAL(clicked()), this, SLOT(removeFlatFile())); - connect(darkDetailsB, SIGNAL(clicked()), this, SLOT(detailsDarkFile())); - connect(flatDetailsB, SIGNAL(clicked()), this, SLOT(detailsFlatFile())); - connect(darkflatAddB, SIGNAL(clicked()), this, SLOT(addDarkFlatFile())); - connect(darkflatRemoveB, SIGNAL(clicked()), this, SLOT(removeDarkFlatFile())); - connect(darkflatDetailsB, SIGNAL(clicked()), this, SLOT(detailsDarkFlatFile())); + connect(darkAddB, TQT_SIGNAL(clicked()), this, TQT_SLOT(addDarkFile())); + connect(flatAddB, TQT_SIGNAL(clicked()), this, TQT_SLOT(addFlatFile())); + connect(darkRemoveB, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeDarkFile())); + connect(flatRemoveB, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeFlatFile())); + connect(darkDetailsB, TQT_SIGNAL(clicked()), this, TQT_SLOT(detailsDarkFile())); + connect(flatDetailsB, TQT_SIGNAL(clicked()), this, TQT_SLOT(detailsFlatFile())); + connect(darkflatAddB, TQT_SIGNAL(clicked()), this, TQT_SLOT(addDarkFlatFile())); + connect(darkflatRemoveB, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeDarkFlatFile())); + connect(darkflatDetailsB, TQT_SIGNAL(clicked()), this, TQT_SLOT(detailsDarkFlatFile())); darkListView->setSorting(-1); flatListView->setSorting(-1); @@ -52,11 +52,11 @@ ImageReductionDlg::~ImageReductionDlg() void ImageReductionDlg::addDarkFile() { - KURL::List fileURLs = KFileDialog::getOpenURLs( QString::null, "*.fits *.fit *.fts|Flexible Image Transport System", 0, i18n("Dark Frames")); + KURL::List fileURLs = KFileDialog::getOpenURLs( TQString::null, "*.fits *.fit *.fts|Flexible Image Transport System", 0, i18n("Dark Frames")); const int limit = (int) fileURLs.size(); for (int i=0; i < limit ; ++i) - new QListViewItem( darkListView, fileURLs[i].path()); + new TQListViewItem( darkListView, fileURLs[i].path()); darkRemoveB->setEnabled(true); darkDetailsB->setEnabled(true); @@ -65,12 +65,12 @@ void ImageReductionDlg::addDarkFile() void ImageReductionDlg::addFlatFile() { - KURL::List fileURLs = KFileDialog::getOpenURLs( QString::null, "*.fits *.fit *.fts|Flexible Image Transport System", 0, i18n("Flat Frames")); + KURL::List fileURLs = KFileDialog::getOpenURLs( TQString::null, "*.fits *.fit *.fts|Flexible Image Transport System", 0, i18n("Flat Frames")); const int limit = (int) fileURLs.size(); for (int i=0; i < limit; ++i) - new QListViewItem( flatListView, fileURLs[i].path()); + new TQListViewItem( flatListView, fileURLs[i].path()); flatRemoveB->setEnabled(true); flatDetailsB->setEnabled(true); @@ -79,11 +79,11 @@ void ImageReductionDlg::addFlatFile() void ImageReductionDlg::addDarkFlatFile() { - KURL::List fileURLs = KFileDialog::getOpenURLs( QString::null, "*.fits *.fit *.fts|Flexible Image Transport System", 0, i18n("Dark Flat Frames")); + KURL::List fileURLs = KFileDialog::getOpenURLs( TQString::null, "*.fits *.fit *.fts|Flexible Image Transport System", 0, i18n("Dark Flat Frames")); const int limit = (int) fileURLs.size(); for (int i=0; i < limit; ++i) - new QListViewItem( darkflatListView, fileURLs[i].path()); + new TQListViewItem( darkflatListView, fileURLs[i].path()); darkflatRemoveB->setEnabled(true); darkflatDetailsB->setEnabled(true); diff --git a/kstars/kstars/imagereductiondlg.h b/kstars/kstars/imagereductiondlg.h index eeb2532b..2e7bff26 100644 --- a/kstars/kstars/imagereductiondlg.h +++ b/kstars/kstars/imagereductiondlg.h @@ -25,7 +25,7 @@ Q_OBJECT public: - ImageReductionDlg(QWidget * parent, const char * name = 0); + ImageReductionDlg(TQWidget * parent, const char * name = 0); ~ImageReductionDlg(); diff --git a/kstars/kstars/imagesequence.cpp b/kstars/kstars/imagesequence.cpp index 86305869..7ad344da 100644 --- a/kstars/kstars/imagesequence.cpp +++ b/kstars/kstars/imagesequence.cpp @@ -27,17 +27,17 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define RETRY_MAX 12 #define RETRY_PERIOD 5000 -imagesequence::imagesequence(QWidget* parent, const char* name, bool modal, WFlags fl) +imagesequence::imagesequence(TQWidget* parent, const char* name, bool modal, WFlags fl) : imgSequenceDlg(parent,name, modal,fl) { @@ -46,21 +46,21 @@ imagesequence::imagesequence(QWidget* parent, const char* name, bool modal, WFla if (devMenu) { - connect (devMenu, SIGNAL(newDevice()), this, SLOT(newCCD())); - connect (devMenu, SIGNAL(newDevice()), this, SLOT(newFilter())); + connect (devMenu, TQT_SIGNAL(newDevice()), this, TQT_SLOT(newCCD())); + connect (devMenu, TQT_SIGNAL(newDevice()), this, TQT_SLOT(newFilter())); } - seqTimer = new QTimer(this); + seqTimer = new TQTimer(this); setModal(false); // Connect signals and slots - connect(startB, SIGNAL(clicked()), this, SLOT(startSequence())); - connect(stopB, SIGNAL(clicked()), this, SLOT(stopSequence())); - connect(closeB, SIGNAL(clicked()), this, SLOT(close())); - connect(seqTimer, SIGNAL(timeout()), this, SLOT(prepareCapture())); - connect(CCDCombo, SIGNAL(activated(int)), this, SLOT(checkCCD(int))); - connect(filterCombo, SIGNAL(activated(int)), this, SLOT(updateFilterCombo(int))); + connect(startB, TQT_SIGNAL(clicked()), this, TQT_SLOT(startSequence())); + connect(stopB, TQT_SIGNAL(clicked()), this, TQT_SLOT(stopSequence())); + connect(closeB, TQT_SIGNAL(clicked()), this, TQT_SLOT(close())); + connect(seqTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(prepareCapture())); + connect(CCDCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(checkCCD(int))); + connect(filterCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateFilterCombo(int))); active = false; ISOStamp = false; @@ -249,11 +249,11 @@ void imagesequence::startSequence() currentFilter = filterCombo->currentText(); lastFilter = filterCombo->currentItem(); - fullImgCountOUT->setText( QString("%1").arg(seqTotalCount)); - currentImgCountOUT->setText(QString("%1").arg(seqCurrentCount)); + fullImgCountOUT->setText( TQString("%1").arg(seqTotalCount)); + currentImgCountOUT->setText(TQString("%1").arg(seqCurrentCount)); // Ok, now let's connect signals and slots for this device - connect(stdDevCCD, SIGNAL(FITSReceived(QString)), this, SLOT(newFITS(QString))); + connect(stdDevCCD, TQT_SIGNAL(FITSReceived(TQString)), this, TQT_SLOT(newFITS(TQString))); // set the progress info imgProgress->setEnabled(true); @@ -294,7 +294,7 @@ void imagesequence::stopSequence() stdDevCCD->batchMode = false; stdDevCCD->ISOMode = false; - stdDevCCD->disconnect( SIGNAL(FITSReceived(QString))); + stdDevCCD->disconnect( TQT_SIGNAL(FITSReceived(TQString))); } } @@ -302,7 +302,7 @@ void imagesequence::stopSequence() void imagesequence::checkCCD(int ccdNum) { INDI_D *idevice = NULL; - QString targetCCD = CCDCombo->text(ccdNum); + TQString targetCCD = CCDCombo->text(ccdNum); INDIMenu *imenu = ksw->getINDIMenu(); if (!imenu) @@ -335,7 +335,7 @@ void imagesequence::checkCCD(int ccdNum) } -void imagesequence::newFITS(QString deviceLabel) +void imagesequence::newFITS(TQString deviceLabel) { // If the FITS is not for our device, simply ignore if (deviceLabel != currentCCD) @@ -344,7 +344,7 @@ void imagesequence::newFITS(QString deviceLabel) seqCurrentCount++; imgProgress->setProgress(seqCurrentCount); - currentImgCountOUT->setText( QString("%1").arg(seqCurrentCount)); + currentImgCountOUT->setText( TQString("%1").arg(seqCurrentCount)); // if we're done if (seqCurrentCount == seqTotalCount) @@ -358,7 +358,7 @@ void imagesequence::newFITS(QString deviceLabel) seqTimer->stop(); if (stdDevCCD) - stdDevCCD->disconnect( SIGNAL(FITSReceived(QString))); + stdDevCCD->disconnect( TQT_SIGNAL(FITSReceived(TQString))); resetButtons(); } @@ -371,7 +371,7 @@ void imagesequence::newFITS(QString deviceLabel) bool imagesequence::verifyCCDIntegrity() { - QString targetCCD; + TQString targetCCD; INDI_D *idevice = NULL; INDI_P *exposeProp; INDI_E *exposeElem; @@ -430,7 +430,7 @@ bool imagesequence::verifyCCDIntegrity() bool imagesequence::verifyFilterIntegrity() { - QString targetFilter; + TQString targetFilter; INDIMenu *devMenu = ksw->getINDIMenu(); INDI_D *filterDevice (NULL); INDI_E *filterElem(NULL); @@ -469,7 +469,7 @@ bool imagesequence::verifyFilterIntegrity() return false; } - // #3 Make sure it has FILTER_SLOT std property by searching for its SLOT element + // #3 Make sure it has FILTER_SLOT std property by searching for its TQT_SLOT element filterElem = filterDevice->findElem("SLOT"); if (filterElem == NULL) { @@ -507,7 +507,7 @@ void imagesequence::prepareCapture() if ( stdDevFilter && ((tempProp = stdDevFilter->dp->findProp("FILTER_SLOT")) != NULL)) { - connect (tempProp, SIGNAL(okState()), this, SLOT(captureImage())); + connect (tempProp, TQT_SIGNAL(okState()), this, TQT_SLOT(captureImage())); selectFilter(); } else @@ -531,7 +531,7 @@ void imagesequence::captureImage() // D. The property has been lost. if ( stdDevFilter && ((tempProp = stdDevFilter->dp->findProp("FILTER_SLOT")) != NULL)) - tempProp->disconnect( SIGNAL (okState())); + tempProp->disconnect( TQT_SIGNAL (okState())); if (!verifyCCDIntegrity()) { @@ -580,7 +580,7 @@ void imagesequence::captureImage() exposeElem->spinChanged(seqExpose); } else - exposeElem->write_w->setText( QString("%1").arg(seqExpose)); + exposeElem->write_w->setText( TQString("%1").arg(seqExpose)); } @@ -592,7 +592,7 @@ void imagesequence::captureImage() void imagesequence::updateFilterCombo(int filterNum) { INDIMenu *devMenu = ksw->getINDIMenu(); - QStringList filterList; + TQStringList filterList; INDI_E *filterElem; unsigned int filterMax; @@ -609,19 +609,19 @@ void imagesequence::updateFilterCombo(int filterNum) if (filterList.empty()) for (unsigned int i=0; i <= filterMax; i++) - filterList << QString("%1").arg(i); + filterList << TQString("%1").arg(i); // Fill filter combo if (filterList.count() <= filterMax) { filterPosCombo->insertStringList(filterList); for (unsigned int i = filterList.count() ; i <= filterMax ; i++) - filterPosCombo->insertItem(QString("%1").arg(i)); + filterPosCombo->insertItem(TQString("%1").arg(i)); } else { // filterMax < filterList.count() for (unsigned int i = 0 ; i <= filterMax ; i++) - filterPosCombo->insertItem(QString("%1").arg(filterList[i])); + filterPosCombo->insertItem(TQString("%1").arg(filterList[i])); } @@ -668,7 +668,7 @@ void imagesequence::selectFilter() filterElem->spinChanged(filterElem->targetValue); } else - filterElem->write_w->setText(QString("%1").arg(filterElem->targetValue)); + filterElem->write_w->setText(TQString("%1").arg(filterElem->targetValue)); // We're done! Send it to the driver filterProp->newText(); diff --git a/kstars/kstars/imagesequence.h b/kstars/kstars/imagesequence.h index bdffcd93..f16d3daa 100644 --- a/kstars/kstars/imagesequence.h +++ b/kstars/kstars/imagesequence.h @@ -23,7 +23,7 @@ class imagesequence : public imgSequenceDlg Q_OBJECT public: - imagesequence(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + imagesequence(TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~imagesequence(); @@ -31,7 +31,7 @@ bool updateStatus(); private: KStars *ksw; -QTimer *seqTimer; +TQTimer *seqTimer; INDIStdDevice *stdDevCCD; INDIStdDevice *stdDevFilter; @@ -44,8 +44,8 @@ int seqDelay; int retries; int lastCCD; int lastFilter; -QString currentCCD; -QString currentFilter; +TQString currentCCD; +TQString currentFilter; bool verifyCCDIntegrity(); bool verifyFilterIntegrity(); @@ -62,7 +62,7 @@ public slots: void stopSequence(); void captureImage(); void prepareCapture(); - void newFITS(QString deviceLabel); + void newFITS(TQString deviceLabel); void checkCCD(int CCDNum); void updateFilterCombo(int filterNum); diff --git a/kstars/kstars/imageviewer.cpp b/kstars/kstars/imageviewer.cpp index 1a277ed2..4d3e5a15 100644 --- a/kstars/kstars/imageviewer.cpp +++ b/kstars/kstars/imageviewer.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -29,7 +29,7 @@ #include -ImageViewer::ImageViewer (const KURL *url, const QString &capText, QWidget *parent, const char *name) +ImageViewer::ImageViewer (const KURL *url, const TQString &capText, TQWidget *parent, const char *name) : KMainWindow (parent, name), imageURL (*url), fileIsImage (false), ctrl (false), key_s (false), key_q (false), downloadJob(0) { @@ -37,14 +37,14 @@ ImageViewer::ImageViewer (const KURL *url, const QString &capText, QWidget *pare // JH: easier to just disable its mobility toolBar()->setMovingEnabled( false ); - KAction *action = new KAction (i18n ("Close Window"), "fileclose", CTRL+Key_Q, this, SLOT (close()), actionCollection()); + KAction *action = new KAction (i18n ("Close Window"), "fileclose", CTRL+Key_Q, this, TQT_SLOT (close()), actionCollection()); action->plug (toolBar()); - action = new KAction (i18n ("Save Image"), "filesave", CTRL+Key_S, this, SLOT (saveFileToDisc()), actionCollection()); + action = new KAction (i18n ("Save Image"), "filesave", CTRL+Key_S, this, TQT_SLOT (saveFileToDisc()), actionCollection()); action->plug (toolBar()); statusBar()->insertItem( capText, 0, 1, true ); statusBar()->setItemAlignment( 0, AlignLeft | AlignVCenter ); - QFont fnt = statusBar()->font(); + TQFont fnt = statusBar()->font(); fnt.setPointSize( fnt.pointSize() - 2 ); statusBar()->setFont( fnt ); @@ -60,9 +60,9 @@ ImageViewer::~ImageViewer() { if (!file->remove()) // if the file was not complete downloaded the suffix is ".part" { - kdDebug()<name())<name())<setName (file->name() + ".part"); // set new suffix to filename - kdDebug()<name())<name())<remove()) kdDebug()<<"file removed\n"; else @@ -70,20 +70,20 @@ ImageViewer::~ImageViewer() { } } -void ImageViewer::paintEvent (QPaintEvent */*ev*/) +void ImageViewer::paintEvent (TQPaintEvent */*ev*/) { bitBlt (this, 0, toolBar()->height() + 1, &pix); } -void ImageViewer::resizeEvent (QResizeEvent */*ev*/) +void ImageViewer::resizeEvent (TQResizeEvent */*ev*/) { if ( !downloadJob ) // only if image is loaded - pix = kpix.convertToPixmap ( image.smoothScale ( size().width() , size().height() - toolBar()->height() - statusBar()->height() ) ); // convert QImage to QPixmap (fastest method) + pix = kpix.convertToPixmap ( image.smoothScale ( size().width() , size().height() - toolBar()->height() - statusBar()->height() ) ); // convert TQImage to TQPixmap (fastest method) update(); } -void ImageViewer::closeEvent (QCloseEvent *ev) +void ImageViewer::closeEvent (TQCloseEvent *ev) { if (ev) // not if closeEvent (0) is called, because segfault ev->accept(); // parent-widgets should not get this event, so it will be filtered @@ -91,7 +91,7 @@ void ImageViewer::closeEvent (QCloseEvent *ev) } -void ImageViewer::keyPressEvent (QKeyEvent *ev) +void ImageViewer::keyPressEvent (TQKeyEvent *ev) { ev->accept(); //make sure key press events are captured. switch (ev->key()) @@ -111,7 +111,7 @@ void ImageViewer::keyPressEvent (QKeyEvent *ev) } } -void ImageViewer::keyReleaseEvent (QKeyEvent *ev) +void ImageViewer::keyReleaseEvent (TQKeyEvent *ev) { ev->accept(); switch (ev->key()) @@ -132,7 +132,7 @@ void ImageViewer::loadImageFromURL() kdDebug()<<"tempfile-URL is malformed\n"; downloadJob = KIO::copy (imageURL, saveURL); // starts the download asynchron - connect (downloadJob, SIGNAL (result (KIO::Job *)), SLOT (downloadReady (KIO::Job *))); + connect (downloadJob, TQT_SIGNAL (result (KIO::Job *)), TQT_SLOT (downloadReady (KIO::Job *))); } void ImageViewer::downloadReady (KIO::Job *job) @@ -161,7 +161,7 @@ void ImageViewer::showImage() { if (!image.load (file->name())) // if loading failed { - QString text = i18n ("Loading of the image %1 failed."); + TQString text = i18n ("Loading of the image %1 failed."); KMessageBox::error (this, text.arg (imageURL.prettyURL() )); closeEvent (0); return; @@ -173,7 +173,7 @@ void ImageViewer::showImage() image.smoothScale ( statusBar()->width() , image.height() * statusBar()->width() / image.width() ); } - QRect deskRect = kapp->desktop()->availableGeometry(); + TQRect deskRect = kapp->desktop()->availableGeometry(); int w = deskRect.width(); // screen width int h = deskRect.height(); // screen height int h2 = image.height() + toolBar()->height() + statusBar()->height(); //height required for ImageViewer @@ -205,10 +205,10 @@ void ImageViewer::saveFileToDisc() KURL newURL = KFileDialog::getSaveURL(imageURL.fileName()); // save-dialog with default filename if (!newURL.isEmpty()) { - QFile f (newURL.directory() + "/" + newURL.fileName()); + TQFile f (newURL.directory() + "/" + newURL.fileName()); if (f.exists()) { - int r=KMessageBox::warningContinueCancel(static_cast(parent()), + int r=KMessageBox::warningContinueCancel(static_cast(parent()), i18n( "A file named \"%1\" already exists. " "Overwrite it?" ).arg(newURL.fileName()), i18n( "Overwrite File?" ), @@ -223,9 +223,9 @@ void ImageViewer::saveFileToDisc() void ImageViewer::saveFile (KURL &url) { // synchronous Access to prevent segfaults - if (!KIO::NetAccess::copy (KURL (file->name()), url, (QWidget*) 0)) + if (!KIO::NetAccess::copy (KURL (file->name()), url, (TQWidget*) 0)) { - QString text = i18n ("Saving of the image %1 failed."); + TQString text = i18n ("Saving of the image %1 failed."); KMessageBox::error (this, text.arg (url.prettyURL() )); } } diff --git a/kstars/kstars/imageviewer.h b/kstars/kstars/imageviewer.h index 7b1d3d45..7ebf8afb 100644 --- a/kstars/kstars/imageviewer.h +++ b/kstars/kstars/imageviewer.h @@ -18,8 +18,8 @@ #ifndef IMAGEVIEWER_H #define IMAGEVIEWER_H -#include -#include +#include +#include #include #include @@ -32,10 +32,10 @@ *@version 1.0 * *This image-viewer automatically resizes the picture. The output - *works with kio-slaves and not directly with the QImage save-routines + *works with kio-slaves and not directly with the TQImage save-routines *because normally the image-files are in GIF-format and QT does not *save these files. For other formats, like PNG, this is not so important - *because they can directly saved by QImage. + *because they can directly saved by TQImage. * *The download-slave works asynchron so the parent-widget can be used at *this time. The save-slave works synchronously, but this is not important @@ -50,34 +50,34 @@ class ImageViewer : public KMainWindow { public: /**Constructor. */ - ImageViewer (const KURL *imageName, const QString &capText, QWidget *parent, const char *name = 0); + ImageViewer (const KURL *imageName, const TQString &capText, TQWidget *parent, const char *name = 0); /**Destructor. If there is a partially downloaded image file, delete it.*/ ~ImageViewer(); protected: /**Bitblt the image onto the viewer widget */ - void paintEvent (QPaintEvent *ev); + void paintEvent (TQPaintEvent *ev); /**The window is resized when a file finishes downloading, before it is displayed. - *The resizeEvent converts the downloaded QImage to a QPixmap + *The resizeEvent converts the downloaded TQImage to a TQPixmap *@note (JH: not sure why this conversion is not done in showImage) */ - void resizeEvent (QResizeEvent *ev); + void resizeEvent (TQResizeEvent *ev); /**Make sure all events have been processed before closing the dialog */ - void closeEvent (QCloseEvent *ev); + void closeEvent (TQCloseEvent *ev); /**Keyboard shortcuts for saving files and closing the window *@note (this should be deprecated; instead just assign KAccel *to the close/save buttons) */ - void keyPressEvent (QKeyEvent *ev); + void keyPressEvent (TQKeyEvent *ev); /**Unset the bool variables that indicate keys were pressed. *(this should be deprecated; see above) */ - void keyReleaseEvent (QKeyEvent *ev); + void keyReleaseEvent (TQKeyEvent *ev); private: /**Display the downloaded image. Resize the window to fit the image, If the image is @@ -98,15 +98,15 @@ class ImageViewer : public KMainWindow { */ void checkJob(); - QImage image; - QPixmap pix; + TQImage image; + TQPixmap pix; KPixmapIO kpix; KTempFile tempfile; - QFile *file; + TQFile *file; const KURL imageURL; bool fileIsImage; - QString filename; + TQString filename; bool ctrl, key_s, key_q; // the keys KIO::Job *downloadJob; // download job of image -> 0 == no job is running diff --git a/kstars/kstars/indi/webcam/v4l1_pwc.h b/kstars/kstars/indi/webcam/v4l1_pwc.h index ad0fab1f..fd2e2032 100644 --- a/kstars/kstars/indi/webcam/v4l1_pwc.h +++ b/kstars/kstars/indi/webcam/v4l1_pwc.h @@ -62,7 +62,7 @@ class V4L1_PWC : public V4L1_Base int setWhiteBalanceBlue(int val, char *errmsg); /* TODO consider the SC modded cam after this - void setLongExposureTime(const QString& str); + void setLongExposureTime(const TQString& str); void setFrameRateMultiplicateur(int value);*/ diff --git a/kstars/kstars/indidevice.cpp b/kstars/kstars/indidevice.cpp index 44e77bb0..e7a36efc 100644 --- a/kstars/kstars/indidevice.cpp +++ b/kstars/kstars/indidevice.cpp @@ -44,24 +44,24 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -87,7 +87,7 @@ const char * indi_std[NINDI_STD] = ** INDI Device: The work-horse. Responsible for handling its ** child properties and managing signal and changes. *******************************************************************/ -INDI_D::INDI_D(INDIMenu *menuParent, DeviceManager *parentManager, QString inName, QString inLabel) +INDI_D::INDI_D(INDIMenu *menuParent, DeviceManager *parentManager, TQString inName, TQString inLabel) { name = inName; label = inLabel; @@ -97,9 +97,9 @@ INDI_D::INDI_D(INDIMenu *menuParent, DeviceManager *parentManager, QString inNam gl.setAutoDelete(true); deviceVBox = menuParent->addVBoxPage(inLabel); - groupContainer = new QTabWidget(deviceVBox); + groupContainer = new TQTabWidget(deviceVBox); - msgST_w = new QTextEdit(deviceVBox); + msgST_w = new TQTextEdit(deviceVBox); msgST_w->setReadOnly(true); msgST_w->setMaximumHeight(100); @@ -253,7 +253,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) XMLEle *ep; XMLAtt *ap; INDI_E *lp; - QString elementName; + TQString elementName; char iNumber[32]; double min, max; @@ -286,7 +286,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) case PP_RO: if (pp->guitype == PG_TEXT) { - lp->text = QString(pcdataXMLEle(ep)); + lp->text = TQString(pcdataXMLEle(ep)); lp->read_w->setText(lp->text); } else if (pp->guitype == PG_NUMERIC) @@ -312,7 +312,7 @@ int INDI_D::setTextValue (INDI_P *pp, XMLEle *root, char errmsg[]) case PP_WO: if (pp->guitype == PG_TEXT) - lp->write_w->setText(QString(pcdataXMLEle(ep))); + lp->write_w->setText(TQString(pcdataXMLEle(ep))); else if (pp->guitype == PG_NUMERIC) { lp->value = atof(pcdataXMLEle(ep)); @@ -385,7 +385,7 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[]) /* find matching label */ //fprintf(stderr, "Find matching label. Name from XML is %s\n", valuXMLAtt(ap)); - lp = pp->findElement(QString(valuXMLAtt(ap))); + lp = pp->findElement(TQString(valuXMLAtt(ap))); if (!lp) { @@ -394,7 +394,7 @@ int INDI_D::setLabelState (INDI_P *pp, XMLEle *root, char errmsg[]) return (-1); } - QFont buttonFont; + TQFont buttonFont; /* engage new state */ lp->state = state; @@ -457,7 +457,7 @@ int INDI_D::setBLOB(INDI_P *pp, XMLEle * root, char errmsg[]) if (strcmp(tagXMLEle(ep), "oneBLOB") == 0) { - blobEL = pp->findElement(QString(findXMLAttValu (ep, "name"))); + blobEL = pp->findElement(TQString(findXMLAttValu (ep, "name"))); if (blobEL) return processBlob(blobEL, ep, errmsg); @@ -481,7 +481,7 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[]) XMLAtt *ap; int blobSize=0, r=0, dataType=0; uLongf dataSize=0; - QString dataFormat; + TQString dataFormat; char *baseBuffer; unsigned char *blobBuffer(NULL); bool iscomp(false); @@ -502,7 +502,7 @@ int INDI_D::processBlob(INDI_E *blobEL, XMLEle *ep, char errmsg[]) return (-1); } - dataFormat = QString(valuXMLAtt(ap)); + dataFormat = TQString(valuXMLAtt(ap)); baseBuffer = (char *) malloc ( (3*pcdatalenXMLEle(ep)/4) * sizeof (char)); blobSize = from64tobits (baseBuffer, pcdataXMLEle(ep)); @@ -567,11 +567,11 @@ bool INDI_D::isOn() INDI_P *prop; - prop = findProp(QString("CONNECTION")); + prop = findProp(TQString("CONNECTION")); if (!prop) return false; - return (prop->isOn(QString("CONNECT"))); + return (prop->isOn(TQString("CONNECT"))); } INDI_P * INDI_D::addProperty (XMLEle *root, char errmsg[]) @@ -584,11 +584,11 @@ INDI_P * INDI_D::addProperty (XMLEle *root, char errmsg[]) ap = findAtt (root, "group", errmsg); if (!ap) { - kdDebug() << QString(errmsg) << endl; + kdDebug() << TQString(errmsg) << endl; return NULL; } // Find an existing group, if none found, create one - pg = findGroup(QString(valuXMLAtt(ap)), 1, errmsg); + pg = findGroup(TQString(valuXMLAtt(ap)), 1, errmsg); if (!pg) return NULL; @@ -610,7 +610,7 @@ INDI_P * INDI_D::addProperty (XMLEle *root, char errmsg[]) * properties */ pg->propertyLayout->removeItem(pg->VerticalSpacer); - pp = new INDI_P(pg, QString(valuXMLAtt(ap))); + pp = new INDI_P(pg, TQString(valuXMLAtt(ap))); /* init state */ ap = findAtt (root, "state", errmsg); @@ -642,7 +642,7 @@ INDI_P * INDI_D::addProperty (XMLEle *root, char errmsg[]) return (pp); } -INDI_P * INDI_D::findProp (QString name) +INDI_P * INDI_D::findProp (TQString name) { for (unsigned int i = 0; i < gl.count(); i++) for (unsigned int j = 0; j < gl.at(i)->pl.count(); j++) @@ -652,7 +652,7 @@ INDI_P * INDI_D::findProp (QString name) return NULL; } -INDI_G * INDI_D::findGroup (QString grouptag, int create, char errmsg[]) +INDI_G * INDI_D::findGroup (TQString grouptag, int create, char errmsg[]) { INDI_G *ig; @@ -976,7 +976,7 @@ int INDI_D::buildBLOBGUI (XMLEle *root, char errmsg[]) return (0); } -INDI_E * INDI_D::findElem(QString name) +INDI_E * INDI_D::findElem(TQString name) { INDI_G *grp; INDI_P *prop; diff --git a/kstars/kstars/indidevice.h b/kstars/kstars/indidevice.h index 88188fb6..ce7b0827 100644 --- a/kstars/kstars/indidevice.h +++ b/kstars/kstars/indidevice.h @@ -13,7 +13,7 @@ #include #include -#include +#include #include "indielement.h" @@ -71,26 +71,26 @@ class INDI_D : public KDialogBase { Q_OBJECT public: - INDI_D(INDIMenu *parentMenu, DeviceManager *parentManager, QString inName, QString inLabel); + INDI_D(INDIMenu *parentMenu, DeviceManager *parentManager, TQString inName, TQString inLabel); ~INDI_D(); - QString name; /* device name */ + TQString name; /* device name */ QString label; /* device label */ QVBox *deviceVBox; /* device tab frame */ - QTabWidget *groupContainer; /* Groups within the device */ + TQTabWidget *groupContainer; /* Groups within the device */ QTextEdit *msgST_w; /* scrolled text for messages */ unsigned char *dataBuffer; /* Generic buffer */ - //QScrollView *sv; /* Scroll view */ - //QVBoxLayout *mainLayout; - //QVBox *propertyLayout; - //QSpacerItem *vSpacer; - //QSpacerItem *hSpacer; - - //QPushButton *clear; - //QHBoxLayout *buttonLayout; + //TQScrollView *sv; /* Scroll view */ + //TQVBoxLayout *mainLayout; + //TQVBox *propertyLayout; + //TQSpacerItem *vSpacer; + //TQSpacerItem *hSpacer; + + //TQPushButton *clear; + //TQHBoxLayout *buttonLayout; INDIStdDevice *stdDev; - QPtrList gl; /* list of pointers to groups */ + TQPtrList gl; /* list of pointers to groups */ INDI_G *curGroup; bool INDIStdSupport; @@ -118,9 +118,9 @@ class INDI_D : public KDialogBase /***************************************************************** * Find ******************************************************************/ - INDI_P * findProp (QString name); - INDI_E * findElem (QString name); - INDI_G * findGroup (QString grouptag, int create, char errmsg[]); + INDI_P * findProp (TQString name); + INDI_E * findElem (TQString name); + INDI_G * findGroup (TQString grouptag, int create, char errmsg[]); int findPerm (INDI_P *pp , XMLEle *root, PPerm *permp, char errmsg[]); /***************************************************************** diff --git a/kstars/kstars/indidriver.cpp b/kstars/kstars/indidriver.cpp index 52e2a1c5..8c2e0db6 100644 --- a/kstars/kstars/indidriver.cpp +++ b/kstars/kstars/indidriver.cpp @@ -25,11 +25,11 @@ #include "kstarsdata.h" #include "ksutils.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,7 +48,7 @@ * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -INDIDriver::INDIDriver(QWidget *parent) : devManager( parent ) +INDIDriver::INDIDriver(TQWidget *parent) : devManager( parent ) { @@ -86,7 +86,7 @@ INDIDriver::INDIDriver(QWidget *parent) : devManager( parent ) for (uint i = 0; i < ksw->data()->INDIHostsList.count(); i++) { - QListViewItem *item = new QListViewItem(clientListView, lastGroup); + TQListViewItem *item = new TQListViewItem(clientListView, lastGroup); lastGroup = item; item->setPixmap(0, disconnected); item->setText(1, ksw->data()->INDIHostsList.at(i)->name); @@ -96,28 +96,28 @@ INDIDriver::INDIDriver(QWidget *parent) : devManager( parent ) lastGroup = NULL; - QObject::connect(addB, SIGNAL(clicked()), this, SLOT(addINDIHost())); - QObject::connect(modifyB, SIGNAL(clicked()), this, SLOT(modifyINDIHost())); - QObject::connect(removeB, SIGNAL(clicked()), this, SLOT(removeINDIHost())); + TQObject::connect(addB, TQT_SIGNAL(clicked()), this, TQT_SLOT(addINDIHost())); + TQObject::connect(modifyB, TQT_SIGNAL(clicked()), this, TQT_SLOT(modifyINDIHost())); + TQObject::connect(removeB, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeINDIHost())); - QObject::connect(clientListView, SIGNAL(rightButtonPressed ( QListViewItem *, const QPoint &, int )), this, SLOT(ClientprocessRightButton( QListViewItem *, const QPoint &, int ))); + TQObject::connect(clientListView, TQT_SIGNAL(rightButtonPressed ( TQListViewItem *, const TQPoint &, int )), this, TQT_SLOT(ClientprocessRightButton( TQListViewItem *, const TQPoint &, int ))); -QObject::connect(ClientpopMenu, SIGNAL(activated(int)), this, SLOT(processHostStatus(int))); +TQObject::connect(ClientpopMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(processHostStatus(int))); -QObject::connect(localListView, SIGNAL(rightButtonPressed ( QListViewItem *, const QPoint &, int )), this, SLOT(LocalprocessRightButton( QListViewItem *, const QPoint &, int ))); +TQObject::connect(localListView, TQT_SIGNAL(rightButtonPressed ( TQListViewItem *, const TQPoint &, int )), this, TQT_SLOT(LocalprocessRightButton( TQListViewItem *, const TQPoint &, int ))); -QObject::connect(LocalpopMenu, SIGNAL(activated(int)), this, SLOT(processDeviceStatus(int))); +TQObject::connect(LocalpopMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(processDeviceStatus(int))); -QObject::connect(ksw->getINDIMenu(), SIGNAL(driverDisconnected(int)), this, SLOT(shutdownHost(int))); +TQObject::connect(ksw->getINDIMenu(), TQT_SIGNAL(driverDisconnected(int)), this, TQT_SLOT(shutdownHost(int))); -QObject::connect(connectHostB, SIGNAL(clicked()), this, SLOT(activateHostConnection())); -QObject::connect(disconnectHostB, SIGNAL(clicked()), this, SLOT(activateHostDisconnection())); +TQObject::connect(connectHostB, TQT_SIGNAL(clicked()), this, TQT_SLOT(activateHostConnection())); +TQObject::connect(disconnectHostB, TQT_SIGNAL(clicked()), this, TQT_SLOT(activateHostDisconnection())); -QObject::connect(runServiceB, SIGNAL(clicked()), this, SLOT(activateRunService())); -QObject::connect(stopServiceB, SIGNAL(clicked()), this, SLOT(activateStopService())); +TQObject::connect(runServiceB, TQT_SIGNAL(clicked()), this, TQT_SLOT(activateRunService())); +TQObject::connect(stopServiceB, TQT_SIGNAL(clicked()), this, TQT_SLOT(activateStopService())); -QObject::connect(localListView, SIGNAL(selectionChanged()), this, SLOT(updateLocalButtons())); -QObject::connect(clientListView, SIGNAL(selectionChanged()), this, SLOT(updateClientButtons())); +TQObject::connect(localListView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(updateLocalButtons())); +TQObject::connect(clientListView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(updateClientButtons())); readXMLDriver(); resize( 500, 300); @@ -126,7 +126,7 @@ resize( 500, 300); void INDIDriver::shutdownHost(int mgrID) { - QListViewItem *affectedItem; + TQListViewItem *affectedItem; for (uint i=0; i < ksw->data()->INDIHostsList.count(); i++) { @@ -150,7 +150,7 @@ for (uint i=0; i < ksw->data()->INDIHostsList.count(); i++) if (!affectedItem) return; affectedItem->setPixmap(1, stopPix); affectedItem->setPixmap(2, NULL); - affectedItem->setText(4, QString("")); + affectedItem->setText(4, TQString("")); runServiceB->setEnabled(true); stopServiceB->setEnabled(false); devices[i]->managed = false; @@ -163,7 +163,7 @@ for (uint i=0; i < ksw->data()->INDIHostsList.count(); i++) } -void INDIDriver::ClientprocessRightButton( QListViewItem *item, const QPoint &p, int column) +void INDIDriver::ClientprocessRightButton( TQListViewItem *item, const TQPoint &p, int column) { column = 0; @@ -172,7 +172,7 @@ void INDIDriver::ClientprocessRightButton( QListViewItem *item, const QPoint &p, ClientpopMenu->popup(p); } -void INDIDriver::LocalprocessRightButton( QListViewItem *item, const QPoint &p, int column) +void INDIDriver::LocalprocessRightButton( TQListViewItem *item, const TQPoint &p, int column) { column = 0; @@ -215,7 +215,7 @@ void INDIDriver::updateLocalButtons() serverLogText->clear(); - for ( QStringList::Iterator it = devices[i]->serverBuffer.begin(); it != devices[i]->serverBuffer.end(); ++it ) + for ( TQStringList::Iterator it = devices[i]->serverBuffer.begin(); it != devices[i]->serverBuffer.end(); ++it ) serverLogText->insert(*it); break; @@ -280,7 +280,7 @@ void INDIDriver::processDeviceStatus(int id) } localListView->selectedItem()->setPixmap(1, runningPix); - localListView->selectedItem()->setText(4, QString("%1").arg(devices[i]->indiPort)); + localListView->selectedItem()->setText(4, TQString("%1").arg(devices[i]->indiPort)); runServiceB->setEnabled(false); stopServiceB->setEnabled(true); @@ -292,7 +292,7 @@ void INDIDriver::processDeviceStatus(int id) localListView->selectedItem()->setPixmap(1, stopPix); localListView->selectedItem()->setPixmap(2, NULL); - localListView->selectedItem()->setText(4, QString("")); + localListView->selectedItem()->setText(4, TQString("")); runServiceB->setEnabled(true); stopServiceB->setEnabled(false); devices[i]->restart(); @@ -305,7 +305,7 @@ void INDIDriver::processHostStatus(int id) { int mgrID; bool toConnect = (id == 0); - QListViewItem *currentItem = clientListView->selectedItem(); + TQListViewItem *currentItem = clientListView->selectedItem(); if (!currentItem) return; INDIHostsInfo *hostInfo; @@ -405,7 +405,7 @@ bool INDIDriver::runDevice(IDevice *dev) dev->proc = new KProcess; *dev->proc << "indiserver"; - *dev->proc << "-v" << "-r" << "0" << "-p" << QString("%1").arg(dev->indiPort) << dev->driver; + *dev->proc << "-v" << "-r" << "0" << "-p" << TQString("%1").arg(dev->indiPort) << dev->driver; // Check Mode dev->mode = localR->isChecked() ? IDevice::M_LOCAL : IDevice::M_SERVER; @@ -415,7 +415,7 @@ bool INDIDriver::runDevice(IDevice *dev) else localListView->selectedItem()->setPixmap(2, serverMode); - connect(dev->proc, SIGNAL(receivedStderr (KProcess *, char *, int)), dev, SLOT(processstd(KProcess *, char*, int))); + connect(dev->proc, TQT_SIGNAL(receivedStderr (KProcess *, char *, int)), dev, TQT_SLOT(processstd(KProcess *, char*, int))); dev->proc->start(KProcess::NotifyOnExit, KProcess::Stderr); //dev->proc->start(); @@ -431,7 +431,7 @@ void INDIDriver::removeDevice(IDevice *dev) devices[i]->restart(); } -void INDIDriver::removeDevice(QString deviceLabel) +void INDIDriver::removeDevice(TQString deviceLabel) { for (unsigned int i=0 ; i < devices.size(); i++) if (deviceLabel == devices[i]->label) @@ -442,19 +442,19 @@ void INDIDriver::removeDevice(QString deviceLabel) void INDIDriver::saveDevicesToDisk() { - QFile file; - QString elementData; + TQFile file; + TQString elementData; file.setName( locateLocal( "appdata", "drivers.xml" ) ); //determine filename in local user KDE directory tree. if ( !file.open( IO_WriteOnly)) { - QString message = i18n( "unable to write to file 'drivers.xml'\nAny changes to INDI device drivers will not be saved." ); + TQString message = i18n( "unable to write to file 'drivers.xml'\nAny changes to INDI device drivers will not be saved." ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); return; } - QTextStream outstream(&file); + TQTextStream outstream(&file); // Let's write drivers first outstream << "" << endl; @@ -471,7 +471,7 @@ void INDIDriver::saveDevicesToDisk() { if (devices[i]->deviceType == KSTARS_TELESCOPE) { - outstream << QString("").arg(devices[i]->label).arg(devices[i]->focal_length > 0 ? devices[i]->focal_length : -1).arg(devices[i]->aperture > 0 ? devices[i]->aperture : -1) << endl; + outstream << TQString("").arg(devices[i]->label).arg(devices[i]->focal_length > 0 ? devices[i]->focal_length : -1).arg(devices[i]->aperture > 0 ? devices[i]->aperture : -1) << endl; outstream << " " << devices[i]->driver << "" << endl; outstream << " " << devices[i]->version << "" << endl; @@ -486,7 +486,7 @@ void INDIDriver::saveDevicesToDisk() { if (devices[i]->deviceType == KSTARS_CCD) { - outstream << QString("").arg(devices[i]->label) << endl; + outstream << TQString("").arg(devices[i]->label) << endl; outstream << " " << devices[i]->driver << "" << endl; outstream << " " << devices[i]->version << "" << endl; outstream << "" << endl; @@ -500,7 +500,7 @@ void INDIDriver::saveDevicesToDisk() { if (devices[i]->deviceType == KSTARS_FILTER) { - outstream << QString("").arg(devices[i]->label) << endl; + outstream << TQString("").arg(devices[i]->label) << endl; outstream << " " << devices[i]->driver << "" << endl; outstream << " " << devices[i]->version << "" << endl; outstream << "" << endl; @@ -514,7 +514,7 @@ void INDIDriver::saveDevicesToDisk() { if (devices[i]->deviceType == KSTARS_VIDEO) { - outstream << QString("").arg(devices[i]->label) << endl; + outstream << TQString("").arg(devices[i]->label) << endl; outstream << " " << devices[i]->driver << "" << endl; outstream << " " << devices[i]->version << "" << endl; outstream << "" << endl; @@ -526,7 +526,7 @@ void INDIDriver::saveDevicesToDisk() } -bool INDIDriver::isDeviceRunning(QString deviceLabel) +bool INDIDriver::isDeviceRunning(TQString deviceLabel) { for (unsigned int i=0 ; i < devices.size(); i++) @@ -546,7 +546,7 @@ int INDIDriver::getINDIPort() lastPort+=5; - KExtendedSocket ks(QString::null, lastPort, KExtendedSocket::passiveSocket | KExtendedSocket::noResolve); + KExtendedSocket ks(TQString::null, lastPort, KExtendedSocket::passiveSocket | KExtendedSocket::noResolve); for (uint i=0 ; i < 10; i++) { @@ -564,8 +564,8 @@ int INDIDriver::getINDIPort() bool INDIDriver::readXMLDriver() { - QString indiFile("drivers.xml"); - QFile file; + TQString indiFile("drivers.xml"); + TQFile file; char errmsg[1024]; if ( !KSUtils::openDataFile( file, indiFile ) ) @@ -592,7 +592,7 @@ bool INDIDriver::readXMLDriver() } else if (errmsg[0]) { - kdDebug() << QString(errmsg); + kdDebug() << TQString(errmsg); return false; } } @@ -619,7 +619,7 @@ bool INDIDriver::buildDeviceGroup(XMLEle *root, char errmsg[]) XMLAtt *ap; XMLEle *ep; - QString groupName; + TQString groupName; int groupType = KSTARS_TELESCOPE; if (!strcmp(tagXMLEle(root), "ScopeDrivers")) @@ -657,7 +657,7 @@ bool INDIDriver::buildDeviceGroup(XMLEle *root, char errmsg[]) //KListViewItem *group = new KListViewItem(topItem, lastGroup); - QListViewItem *group = new QListViewItem(localListView, lastGroup); + TQListViewItem *group = new TQListViewItem(localListView, lastGroup); group->setText(0, groupName); lastGroup = group; //group->setOpen(true); @@ -671,14 +671,14 @@ bool INDIDriver::buildDeviceGroup(XMLEle *root, char errmsg[]) return true; } -bool INDIDriver::buildDriverElement(XMLEle *root, QListViewItem *DGroup, int groupType, char errmsg[]) +bool INDIDriver::buildDriverElement(XMLEle *root, TQListViewItem *DGroup, int groupType, char errmsg[]) { XMLAtt *ap; XMLEle *el; IDevice *dv; - QString label; - QString driver; - QString version; + TQString label; + TQString driver; + TQString version; double focal_length (-1), aperture (-1); ap = findXMLAtt(root, "label"); @@ -693,11 +693,11 @@ bool INDIDriver::buildDriverElement(XMLEle *root, QListViewItem *DGroup, int gro // Let's look for telescope-specfic attributes: focal length and aperture ap = findXMLAtt(root, "focal_length"); if (ap) - focal_length = QString(valuXMLAtt(ap)).toDouble(); + focal_length = TQString(valuXMLAtt(ap)).toDouble(); ap = findXMLAtt(root, "aperture"); if (ap) - aperture = QString(valuXMLAtt(ap)).toDouble(); + aperture = TQString(valuXMLAtt(ap)).toDouble(); el = findXMLEle(root, "driver"); @@ -714,17 +714,17 @@ bool INDIDriver::buildDriverElement(XMLEle *root, QListViewItem *DGroup, int gro version = pcdataXMLEle(el); - QListViewItem *device = new QListViewItem(DGroup, lastDevice); + TQListViewItem *device = new TQListViewItem(DGroup, lastDevice); - device->setText(0, QString(label)); + device->setText(0, TQString(label)); device->setPixmap(1, stopPix); - device->setText(3, QString(version)); + device->setText(3, TQString(version)); lastDevice = device; dv = new IDevice(label, driver, version); dv->deviceType = groupType; - connect(dv, SIGNAL(newServerInput()), this, SLOT(updateLocalButtons())); + connect(dv, TQT_SIGNAL(newServerInput()), this, TQT_SLOT(updateLocalButtons())); if (focal_length > 0) dv->focal_length = focal_length; if (aperture > 0) @@ -759,7 +759,7 @@ void INDIDriver::addINDIHost() hostConf.setCaption(i18n("Add Host")); bool portOk = false; - if (hostConf.exec() == QDialog::Accepted) + if (hostConf.exec() == TQDialog::Accepted) { INDIHostsInfo *hostItem = new INDIHostsInfo; hostItem->name = hostConf.nameIN->text(); @@ -787,7 +787,7 @@ void INDIDriver::addINDIHost() ksw->data()->INDIHostsList.append(hostItem); - QListViewItem *item = new QListViewItem(clientListView); + TQListViewItem *item = new TQListViewItem(clientListView); item->setPixmap(0, disconnected); item->setText(1, hostConf.nameIN->text()); item->setText(2, hostConf.portnumber->text()); @@ -805,7 +805,7 @@ void INDIDriver::modifyINDIHost() INDIHostConf hostConf(this); hostConf.setCaption(i18n("Modify Host")); - QListViewItem *currentItem = clientListView->currentItem(); + TQListViewItem *currentItem = clientListView->currentItem(); if (currentItem == NULL) return; @@ -819,7 +819,7 @@ void INDIDriver::modifyINDIHost() hostConf.hostname->setText(ksw->data()->INDIHostsList.at(i)->hostname); hostConf.portnumber->setText(ksw->data()->INDIHostsList.at(i)->portnumber); - if (hostConf.exec() == QDialog::Accepted) + if (hostConf.exec() == TQDialog::Accepted) { INDIHostsInfo *hostItem = new INDIHostsInfo; hostItem->name = hostConf.nameIN->text(); @@ -870,19 +870,19 @@ void INDIDriver::removeINDIHost() void INDIDriver::saveHosts() { - QFile file; - QString hostData; + TQFile file; + TQString hostData; file.setName( locateLocal( "appdata", "indihosts.xml" ) ); //determine filename in local user KDE directory tree. if ( !file.open( IO_WriteOnly)) { - QString message = i18n( "unable to write to file 'indihosts.xml'\nAny changes to INDI hosts configurations will not be saved." ); + TQString message = i18n( "unable to write to file 'indihosts.xml'\nAny changes to INDI hosts configurations will not be saved." ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); return; } - QTextStream outstream(&file); + TQTextStream outstream(&file); for (uint i= 0; i < ksw->data()->INDIHostsList.count(); i++) { @@ -911,7 +911,7 @@ INDIDriver::~INDIDriver() } -IDevice::IDevice(QString inLabel, QString inDriver, QString inVersion) +IDevice::IDevice(TQString inLabel, TQString inDriver, TQString inVersion) { label = inLabel;; driver = inDriver;; diff --git a/kstars/kstars/indidriver.h b/kstars/kstars/indidriver.h index 8cb41b30..3511112e 100644 --- a/kstars/kstars/indidriver.h +++ b/kstars/kstars/indidriver.h @@ -17,7 +17,7 @@ #ifndef INDIDRIVER_H #define INDIDRIVER_H -#include +#include #include #include #include @@ -33,9 +33,9 @@ class KProcess; struct INDIHostsInfo { - QString name; - QString hostname; - QString portnumber; + TQString name; + TQString hostname; + TQString portnumber; bool isConnected; int mgrID; }; @@ -45,14 +45,14 @@ class IDevice : public QObject Q_OBJECT public: - IDevice(QString inLabel, QString inDriver, QString inVersion); + IDevice(TQString inLabel, TQString inDriver, TQString inVersion); ~IDevice(); enum ServeMODE { M_LOCAL, M_SERVER }; - QString label; - QString driver; - QString version; - QStringList serverBuffer; + TQString label; + TQString driver; + TQString version; + TQStringList serverBuffer; int state; int mode; int indiPort; @@ -82,7 +82,7 @@ class INDIDriver : public devManager public: - INDIDriver(QWidget * parent = 0); + INDIDriver(TQWidget * parent = 0); ~INDIDriver(); KListView* deviceContainer; @@ -91,20 +91,20 @@ class INDIDriver : public devManager bool buildDriversList( XMLEle *root, char errmsg[]); bool buildDeviceGroup (XMLEle *root, char errmsg[]); - bool buildDriverElement(XMLEle *root, QListViewItem *DGroup, int groupType, char errmsg[]); + bool buildDriverElement(XMLEle *root, TQListViewItem *DGroup, int groupType, char errmsg[]); - QListViewItem *lastGroup; - QListViewItem *lastDevice; + TQListViewItem *lastGroup; + TQListViewItem *lastDevice; - QStringList driversList; + TQStringList driversList; - QPixmap runningPix; - QPixmap stopPix; - QPixmap connected; - QPixmap disconnected; - QPixmap establishConnection; - QPixmap localMode; - QPixmap serverMode; + TQPixmap runningPix; + TQPixmap stopPix; + TQPixmap connected; + TQPixmap disconnected; + TQPixmap establishConnection; + TQPixmap localMode; + TQPixmap serverMode; KPopupMenu *ClientpopMenu; KPopupMenu *LocalpopMenu; @@ -113,11 +113,11 @@ class INDIDriver : public devManager bool runDevice(IDevice *dev); void removeDevice(IDevice *dev); - void removeDevice(QString deviceLabel); + void removeDevice(TQString deviceLabel); void saveDevicesToDisk(); int getINDIPort(); int activeDriverCount(); - bool isDeviceRunning(QString deviceLabel); + bool isDeviceRunning(TQString deviceLabel); void saveHosts(); @@ -128,8 +128,8 @@ class INDIDriver : public devManager public slots: void updateMenuActions(); - void ClientprocessRightButton( QListViewItem *, const QPoint &, int ); - void LocalprocessRightButton( QListViewItem *, const QPoint &, int ); + void ClientprocessRightButton( TQListViewItem *, const TQPoint &, int ); + void LocalprocessRightButton( TQListViewItem *, const TQPoint &, int ); void processDeviceStatus(int); void processHostStatus(int); void addINDIHost(); diff --git a/kstars/kstars/indielement.cpp b/kstars/kstars/indielement.cpp index 4c7092ea..0ae460f7 100644 --- a/kstars/kstars/indielement.cpp +++ b/kstars/kstars/indielement.cpp @@ -16,13 +16,13 @@ #include "indi/indicom.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -66,14 +66,14 @@ XMLEle * findEle (XMLEle *ep, INDI_P *pp, const char *child, char errmsg[]) /******************************************************************* ** INDI Element *******************************************************************/ -INDI_E::INDI_E(INDI_P *parentProperty, QString inName, QString inLabel) +INDI_E::INDI_E(INDI_P *parentProperty, TQString inName, TQString inLabel) { name = inName; label = inLabel; pp = parentProperty; - EHBox = new QHBoxLayout(0, 0, KDialog::spacingHint()); + EHBox = new TQHBoxLayout(0, 0, KDialog::spacingHint()); label_w = NULL; read_w = NULL; write_w = NULL; @@ -108,13 +108,13 @@ label_w = new KSqueezedTextLabel(pp->pg->propertyContainer); label_w->setMinimumWidth(ELEMENT_LABEL_WIDTH); label_w->setMaximumWidth(ELEMENT_LABEL_WIDTH); label_w->setFrameShape( KSqueezedTextLabel::Box ); -label_w->setPaletteBackgroundColor( QColor( 224, 232, 238 ) ); -label_w->setTextFormat( QLabel::RichText ); -label_w->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); +label_w->setPaletteBackgroundColor( TQColor( 224, 232, 238 ) ); +label_w->setTextFormat( TQLabel::RichText ); +label_w->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignCenter ) ); if (label.length() > MAX_LABEL_LENGTH) { - QFont tempFont( label_w->font() ); + TQFont tempFont( label_w->font() ); tempFont.setPointSize( tempFont.pointSize() - MED_INDI_FONT ); label_w->setFont( tempFont ); } @@ -124,7 +124,7 @@ label_w->setText(label); EHBox->addWidget(label_w); } -int INDI_E::buildTextGUI(QString initText) +int INDI_E::buildTextGUI(TQString initText) { setupElementLabel(); @@ -287,17 +287,17 @@ void INDI_E::setupElementScale(int length) int steps = (int) ((max - min) / step); spin_w = new KDoubleSpinBox(min, max, step, value, 2, pp->pg->propertyContainer ); -slider_w = new QSlider(0, steps, 1, (int) ((value - min) / step), Qt::Horizontal, pp->pg->propertyContainer ); +slider_w = new TQSlider(0, steps, 1, (int) ((value - min) / step), Qt::Horizontal, pp->pg->propertyContainer ); -connect(spin_w, SIGNAL(valueChanged(double)), this, SLOT(spinChanged(double ))); -connect(slider_w, SIGNAL(sliderMoved(int)), this, SLOT(sliderChanged(int ))); +connect(spin_w, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(spinChanged(double ))); +connect(slider_w, TQT_SIGNAL(sliderMoved(int)), this, TQT_SLOT(sliderChanged(int ))); //kdDebug() << "For element " << label << " we have step of " << step << endl; if (length == ELEMENT_FULL_WIDTH) - spin_w->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, spin_w->sizePolicy().hasHeightForWidth() ) ); + spin_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, spin_w->sizePolicy().hasHeightForWidth() ) ); else - spin_w->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, spin_w->sizePolicy().hasHeightForWidth() ) ); + spin_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, spin_w->sizePolicy().hasHeightForWidth() ) ); spin_w->setMinimumWidth( (int) (length * 0.45) ); slider_w->setMinimumWidth( (int) (length * 0.55) ); @@ -359,11 +359,11 @@ void INDI_E::setMax (double inMax) void INDI_E::setupElementWrite(int length) { write_w = new KLineEdit( pp->pg->propertyContainer); - write_w->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, write_w->sizePolicy().hasHeightForWidth() )); + write_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, write_w->sizePolicy().hasHeightForWidth() )); write_w->setMinimumWidth( length ); write_w->setMaximumWidth( length); - QObject::connect(write_w, SIGNAL(returnPressed()), pp, SLOT(newText())); + TQObject::connect(write_w, TQT_SIGNAL(returnPressed()), pp, TQT_SLOT(newText())); EHBox->addWidget(write_w); } @@ -388,12 +388,12 @@ void INDI_E::setupElementRead(int length) void INDI_E::setupBrowseButton() { browse_w = new KPushButton("...", pp->pg->propertyContainer); - browse_w->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, browse_w->sizePolicy().hasHeightForWidth() ) ); + browse_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, browse_w->sizePolicy().hasHeightForWidth() ) ); browse_w->setMinimumWidth( MIN_SET_WIDTH ); browse_w->setMaximumWidth( MAX_SET_WIDTH ); EHBox->addWidget(browse_w); - QObject::connect(browse_w, SIGNAL(clicked()), this, SLOT(browseBlob())); + TQObject::connect(browse_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(browseBlob())); } @@ -410,7 +410,7 @@ void INDI_E::browseBlob() KURL currentURL; - currentURL = KFileDialog::getOpenURL( QDir::homeDirPath(), "*"); + currentURL = KFileDialog::getOpenURL( TQDir::homeDirPath(), "*"); // if user presses cancel if (currentURL.isEmpty()) diff --git a/kstars/kstars/indielement.h b/kstars/kstars/indielement.h index c7a6521d..cc92d960 100644 --- a/kstars/kstars/indielement.h +++ b/kstars/kstars/indielement.h @@ -14,8 +14,8 @@ #include #include -#include -#include +#include +#include #include "indi/lilxml.h" @@ -90,14 +90,14 @@ class INDI_E : public QObject { Q_OBJECT public: - INDI_E(INDI_P *parentProperty, QString inName, QString inLabel); + INDI_E(INDI_P *parentProperty, TQString inName, TQString inLabel); ~INDI_E(); - QString name; /* name */ - QString label; /* label is the name by default, unless specefied */ + TQString name; /* name */ + TQString label; /* label is the name by default, unless specefied */ PState state; /* control on/off t/f etc */ INDI_P *pp; /* parent property */ - QHBoxLayout *EHBox; /* Horizontal layout */ + TQHBoxLayout *EHBox; /* Horizontal layout */ /* GUI widgets, only malloced when needed */ KSqueezedTextLabel *label_w; // label @@ -108,16 +108,16 @@ class INDI_E : public QObject QSlider *slider_w; // Slider KPushButton *push_w; // push button KPushButton *browse_w; // browse button - QCheckBox *check_w; // check box - QSpacerItem *hSpacer; // Horizontal spacer + TQCheckBox *check_w; // check box + TQSpacerItem *hSpacer; // Horizontal spacer double min, max, step; // params for scale double value; // current value double targetValue; // target value - QString text; // current text - QString format; // number format, if applicable + TQString text; // current text + TQString format; // number format, if applicable - int buildTextGUI (QString initText); + int buildTextGUI (TQString initText); int buildNumberGUI (double initValue); int buildLightGUI(); int buildBLOBGUI(); diff --git a/kstars/kstars/indifitsconf.cpp b/kstars/kstars/indifitsconf.cpp index 571ad738..5c4cddae 100644 --- a/kstars/kstars/indifitsconf.cpp +++ b/kstars/kstars/indifitsconf.cpp @@ -17,20 +17,20 @@ #include #include -#include -#include -#include +#include +#include +#include #include "Options.h" -INDIFITSConf::INDIFITSConf(QWidget* parent, const char* name, bool modal, WFlags fl) +INDIFITSConf::INDIFITSConf(TQWidget* parent, const char* name, bool modal, WFlags fl) : INDIConf(parent,name, modal,fl) { KIconLoader *icons = KGlobal::iconLoader(); selectDirB->setPixmap( icons->loadIcon( "fileopen", KIcon::Toolbar ) ); - connect(selectDirB, SIGNAL(clicked()), this, SLOT(saveFITSDirectory())); - connect(filterCombo, SIGNAL(activated (int)), this, SLOT(comboUpdate(int))); + connect(selectDirB, TQT_SIGNAL(clicked()), this, TQT_SLOT(saveFITSDirectory())); + connect(filterCombo, TQT_SIGNAL(activated (int)), this, TQT_SLOT(comboUpdate(int))); } @@ -42,7 +42,7 @@ INDIFITSConf::~INDIFITSConf() void INDIFITSConf::saveFITSDirectory() { - QString dir = KFileDialog::getExistingDirectory(fitsDIR_IN->text()); + TQString dir = KFileDialog::getExistingDirectory(fitsDIR_IN->text()); if (!dir.isEmpty()) fitsDIR_IN->setText(dir); @@ -50,7 +50,7 @@ void INDIFITSConf::saveFITSDirectory() void INDIFITSConf::loadOptions() { - QStringList filterNumbers; + TQStringList filterNumbers; lastIndex = 0; filterNumbers << "0" << "1" << "2" << "3" << "4" << "5" << "6" << "7" << "8" << "9"; @@ -66,7 +66,7 @@ void INDIFITSConf::loadOptions() if (Options::fitsSaveDirectory().isEmpty()) { - fitsDIR_IN->setText (QDir:: homeDirPath()); + fitsDIR_IN->setText (TQDir:: homeDirPath()); Options::setFitsSaveDirectory( fitsDIR_IN->text()); } else diff --git a/kstars/kstars/indifitsconf.h b/kstars/kstars/indifitsconf.h index fa825d83..600fcb12 100644 --- a/kstars/kstars/indifitsconf.h +++ b/kstars/kstars/indifitsconf.h @@ -17,7 +17,7 @@ class INDIFITSConf : public INDIConf Q_OBJECT public: - INDIFITSConf(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + INDIFITSConf(TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~INDIFITSConf(); /*$PUBLIC_FUNCTIONS$*/ @@ -30,7 +30,7 @@ public slots: private: int lastIndex; - QStringList filterList; + TQStringList filterList; }; diff --git a/kstars/kstars/indigroup.cpp b/kstars/kstars/indigroup.cpp index 7ef606b6..0dcbb8b9 100644 --- a/kstars/kstars/indigroup.cpp +++ b/kstars/kstars/indigroup.cpp @@ -18,17 +18,17 @@ #include - #include - #include - #include - #include + #include + #include + #include + #include /******************************************************************* ** INDI Group: a tab widget for common properties. All properties ** belong to a group, whether they have one or not but how the group ** is displayed differs *******************************************************************/ -INDI_G::INDI_G(INDI_D *parentDevice, QString inName) +INDI_G::INDI_G(INDI_D *parentDevice, TQString inName) { dp = parentDevice; @@ -38,12 +38,12 @@ INDI_G::INDI_G(INDI_D *parentDevice, QString inName) // FIXME what's the parent exactly? // You can do this eaither way: - // 1. Propertycontainer is a QFrame, then you make QVBoxLayout for it (check form1.cpp) - // 2. Keep it as QVBox and let it handle its children. + // 1. Propertycontainer is a TQFrame, then you make TQVBoxLayout for it (check form1.cpp) + // 2. Keep it as TQVBox and let it handle its children. // Depends on which one works best. - propertyContainer = new QFrame(dp->groupContainer); - propertyLayout = new QVBoxLayout(propertyContainer, 20, KDialog::spacingHint() ); - VerticalSpacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + propertyContainer = new TQFrame(dp->groupContainer); + propertyLayout = new TQVBoxLayout(propertyContainer, 20, KDialog::spacingHint() ); + VerticalSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); propertyLayout->addItem(VerticalSpacer); diff --git a/kstars/kstars/indigroup.h b/kstars/kstars/indigroup.h index d08186bf..d9361c2d 100644 --- a/kstars/kstars/indigroup.h +++ b/kstars/kstars/indigroup.h @@ -15,8 +15,8 @@ #define INDIGROUP_H #include "indielement.h" -#include -#include +#include +#include class INDI_P; class INDI_D; @@ -28,16 +28,16 @@ class QVBoxLayout; class INDI_G { public: - INDI_G(INDI_D *parentDevice, QString inName); + INDI_G(INDI_D *parentDevice, TQString inName); ~INDI_G(); - QString name; /* Group name */ + TQString name; /* Group name */ INDI_D *dp; /* Parent device */ - QFrame *propertyContainer; /* Properties container */ - QVBoxLayout *propertyLayout; /* Properties layout */ - QSpacerItem *VerticalSpacer; /* Vertical spacer */ + TQFrame *propertyContainer; /* Properties container */ + TQVBoxLayout *propertyLayout; /* Properties layout */ + TQSpacerItem *VerticalSpacer; /* Vertical spacer */ - QPtrList pl; /* malloced list of pointers to properties */ + TQPtrList pl; /* malloced list of pointers to properties */ void addProperty(INDI_P *pp); bool removeProperty(INDI_P *pp); diff --git a/kstars/kstars/indimenu.cpp b/kstars/kstars/indimenu.cpp index 9ecd6e61..99181b0b 100644 --- a/kstars/kstars/indimenu.cpp +++ b/kstars/kstars/indimenu.cpp @@ -26,18 +26,18 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -59,7 +59,7 @@ ** INDI Menu: Handles communication to server and fetching basic XML ** data. *******************************************************************/ -INDIMenu::INDIMenu(QWidget *parent, const char *name ) : KDialogBase(KDialogBase::Tabbed, i18n("INDI Control Panel"), 0, KDialogBase::Default, parent, name, false) +INDIMenu::INDIMenu(TQWidget *parent, const char *name ) : KDialogBase(KDialogBase::Tabbed, i18n("INDI Control Panel"), 0, KDialogBase::Default, parent, name, false) { ksw = (KStars *) parent; @@ -122,13 +122,13 @@ DeviceManager *dev; if (drivers->devices[i]->state && drivers->devices[i]->managed == false && drivers->devices[i]->mode == IDevice::M_LOCAL) { dev = new DeviceManager(this, mgrCounter); - if (dev->indiConnect("localhost", QString("%1").arg(drivers->devices[i]->indiPort))) + if (dev->indiConnect("localhost", TQString("%1").arg(drivers->devices[i]->indiPort))) { drivers->devices[i]->mgrID = mgrCounter; drivers->devices[i]->managed = true; mgr.append(dev); - connect(dev, SIGNAL(newDevice()), drivers, SLOT(updateMenuActions())); - connect(dev, SIGNAL(newDevice()), this, SLOT(discoverDevice())); + connect(dev, TQT_SIGNAL(newDevice()), drivers, TQT_SLOT(updateMenuActions())); + connect(dev, TQT_SIGNAL(newDevice()), this, TQT_SLOT(discoverDevice())); mgrCounter++; @@ -153,7 +153,7 @@ DeviceManager *dev; } -int INDIMenu::processClient(QString hostname, QString portnumber) +int INDIMenu::processClient(TQString hostname, TQString portnumber) { DeviceManager *dev; @@ -165,8 +165,8 @@ int INDIMenu::processClient(QString hostname, QString portnumber) mgr.append(dev); if (drivers) { - connect(dev, SIGNAL(newDevice()), drivers, SLOT(updateMenuActions())); - connect(dev, SIGNAL(newDevice()), this, SLOT(discoverDevice())); + connect(dev, TQT_SIGNAL(newDevice()), drivers, TQT_SLOT(updateMenuActions())); + connect(dev, TQT_SIGNAL(newDevice()), this, TQT_SLOT(discoverDevice())); } } else @@ -191,7 +191,7 @@ void INDIMenu::removeDeviceMgr(int mgrID) } } -INDI_D * INDIMenu::findDevice(QString deviceName) +INDI_D * INDIMenu::findDevice(TQString deviceName) { for (unsigned int i=0; i < mgr.count(); i++) { @@ -202,7 +202,7 @@ INDI_D * INDIMenu::findDevice(QString deviceName) return NULL; } -INDI_D * INDIMenu::findDeviceByLabel(QString label) +INDI_D * INDIMenu::findDeviceByLabel(TQString label) { for (unsigned int i=0; i < mgr.count(); i++) { @@ -215,7 +215,7 @@ INDI_D * INDIMenu::findDeviceByLabel(QString label) } -void INDIMenu::setCustomLabel(QString deviceName) +void INDIMenu::setCustomLabel(TQString deviceName) { int nset=0; @@ -226,7 +226,7 @@ for (unsigned int i=0; i < mgr.count(); i++) nset++; if (nset) - currentLabel = deviceName + QString(" %1").arg(nset+1); + currentLabel = deviceName + TQString(" %1").arg(nset+1); else currentLabel = deviceName; @@ -234,7 +234,7 @@ else void INDIMenu::discoverDevice() { - QTimer::singleShot( 1000, this, SLOT(announceDevice()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(announceDevice()) ); } void INDIMenu::announceDevice() diff --git a/kstars/kstars/indimenu.h b/kstars/kstars/indimenu.h index 4f6a07eb..8afd533d 100644 --- a/kstars/kstars/indimenu.h +++ b/kstars/kstars/indimenu.h @@ -49,7 +49,7 @@ class INDIMenu : public KDialogBase { Q_OBJECT public: - INDIMenu(QWidget * parent = 0 , const char *name = 0); + INDIMenu(TQWidget * parent = 0 , const char *name = 0); ~INDIMenu(); /***************************************************************** @@ -57,25 +57,25 @@ class INDIMenu : public KDialogBase ******************************************************************/ QVBoxLayout *mainLayout; QTabWidget *deviceContainer; - QTextEdit *msgST_w; + TQTextEdit *msgST_w; QWidget *tab; - QPushButton *clear; + TQPushButton *clear; QString currentLabel; KStars *ksw; - QPtrList mgr; + TQPtrList mgr; void updateStatus(); - //bool removeDevice(QString devName); + //bool removeDevice(TQString devName); void removeDeviceMgr(int mgrID); - void setCustomLabel(QString deviceName); + void setCustomLabel(TQString deviceName); int mgrCounter; bool processServer(); - int processClient(QString hostname, QString portnumber); - INDI_D * findDevice(QString deviceName); - INDI_D * findDeviceByLabel(QString label); + int processClient(TQString hostname, TQString portnumber); + INDI_D * findDevice(TQString deviceName); + INDI_D * findDeviceByLabel(TQString label); public slots: diff --git a/kstars/kstars/indiproperty.cpp b/kstars/kstars/indiproperty.cpp index c5a26b1b..058e154c 100644 --- a/kstars/kstars/indiproperty.cpp +++ b/kstars/kstars/indiproperty.cpp @@ -34,14 +34,14 @@ #include #include - #include - #include - #include - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include + #include + #include + #include #include #include @@ -49,7 +49,7 @@ /******************************************************************* ** INDI Property: contains widgets, labels, and their status *******************************************************************/ -INDI_P::INDI_P(INDI_G *parentGroup, QString inName) +INDI_P::INDI_P(INDI_G *parentGroup, TQString inName) { name = inName; @@ -61,8 +61,8 @@ INDI_P::INDI_P(INDI_G *parentGroup, QString inName) indistd = new INDIStdProperty(this, pg->dp->parent->ksw, pg->dp->stdDev); - PHBox = new QHBoxLayout(0, 0, KDialogBase::spacingHint()); - PVBox = new QVBoxLayout(0, 0, KDialogBase::spacingHint()); + PHBox = new TQHBoxLayout(0, 0, KDialogBase::spacingHint()); + PVBox = new TQVBoxLayout(0, 0, KDialogBase::spacingHint()); light = NULL; label_w = NULL; set_w = NULL; @@ -83,7 +83,7 @@ INDI_P::~INDI_P() delete (groupB); } -bool INDI_P::isOn(QString component) +bool INDI_P::isOn(TQString component) { INDI_E *lp; @@ -101,7 +101,7 @@ bool INDI_P::isOn(QString component) return false; } -INDI_E * INDI_P::findElement(QString elementName) +INDI_E * INDI_P::findElement(TQString elementName) { INDI_E *element = NULL; @@ -126,7 +126,7 @@ void INDI_P::drawLt(PState lstate) case PS_OK: light->setColor(Qt::green); emit okState(); - disconnect( this, SIGNAL(okState()), 0, 0 ); + disconnect( this, TQT_SIGNAL(okState()), 0, 0 ); break; case PS_BUSY: @@ -203,7 +203,7 @@ void INDI_P::convertSwitch(int id) { INDI_E *lp; - QString mLabel; + TQString mLabel; int switchIndex=0; if (assosiatedPopup == NULL) @@ -254,7 +254,7 @@ void INDI_P::convertSwitch(int id) void INDI_P::newSwitch(int id) { - QFont buttonFont; + TQFont buttonFont; INDI_E *lp; lp = el.at(id); @@ -318,10 +318,10 @@ void INDI_P::newSwitch(int id) */ void INDI_P::newBlob() { - QFile fp; - QString filename; - QString format; - QDataStream binaryStream; + TQFile fp; + TQString filename; + TQString format; + TQDataStream binaryStream; int data64_size=0, pos=0; char *data_file; unsigned char *data, *data64; @@ -379,7 +379,7 @@ void INDI_P::newBlob() if (sending == false) { sending = true; - pg->dp->parentMgr->startBlob (pg->dp->name, name, QString(timestamp())); + pg->dp->parentMgr->startBlob (pg->dp->name, name, TQString(timestamp())); } pg->dp->parentMgr->sendOneBlob(el.at(i)->name, data64_size, format, data64); @@ -433,17 +433,17 @@ void INDI_P::addGUI (XMLEle *root) if (label.isEmpty()) { label = name; - label_w = new QLabel(label, pg->propertyContainer); + label_w = new TQLabel(label, pg->propertyContainer); } else - label_w = new QLabel(label, pg->propertyContainer); + label_w = new TQLabel(label, pg->propertyContainer); - label_w->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, label_w->sizePolicy().hasHeightForWidth() ) ); - label_w->setFrameShape( QLabel::GroupBoxPanel ); + label_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, label_w->sizePolicy().hasHeightForWidth() ) ); + label_w->setFrameShape( TQLabel::GroupBoxPanel ); label_w->setMinimumWidth(PROPERTY_LABEL_WIDTH); label_w->setMaximumWidth(PROPERTY_LABEL_WIDTH); - label_w->setTextFormat( QLabel::RichText ); - label_w->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignHCenter) ); + label_w->setTextFormat( TQLabel::RichText ); + label_w->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter | TQLabel::AlignHCenter) ); PHBox->addWidget(label_w); @@ -459,7 +459,7 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[]) INDI_E *lp; XMLEle *text; XMLAtt *ap; - QString textName, textLabel; + TQString textName, textLabel; errmsg=errmsg; for (text = nextXMLEle (root, 1); text != NULL; text = nextXMLEle (root, 0)) @@ -495,7 +495,7 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[]) lp = new INDI_E(this, textName, textLabel); - lp->buildTextGUI(QString(pcdataXMLEle(text))); + lp->buildTextGUI(TQString(pcdataXMLEle(text))); el.append(lp); @@ -508,12 +508,12 @@ int INDI_P::buildTextGUI(XMLEle *root, char errmsg[]) if (name == "TIME") { setupSetButton("Time"); - QObject::connect(set_w, SIGNAL(clicked()), indistd, SLOT(newTime())); + TQObject::connect(set_w, TQT_SIGNAL(clicked()), indistd, TQT_SLOT(newTime())); } else { setupSetButton("Set"); - QObject::connect(set_w, SIGNAL(clicked()), this, SLOT(newText())); + TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newText())); } return 0; @@ -527,7 +527,7 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[]) XMLEle *number; XMLAtt *ap; INDI_E *lp; - QString numberName, numberLabel; + TQString numberName, numberLabel; errmsg=errmsg; for (number = nextXMLEle (root, 1); number != NULL; number = nextXMLEle (root, 0)) @@ -591,16 +591,16 @@ int INDI_P::buildNumberGUI (XMLEle *root, char errmsg[]) else setupSetButton("Set"); - QObject::connect(set_w, SIGNAL(clicked()), this, SLOT(newText())); + TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newText())); return (0); } -void INDI_P::setupSetButton(QString caption) +void INDI_P::setupSetButton(TQString caption) { - set_w = new QPushButton(caption, pg->propertyContainer); - set_w->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, set_w->sizePolicy().hasHeightForWidth() ) ); + set_w = new TQPushButton(caption, pg->propertyContainer); + set_w->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, set_w->sizePolicy().hasHeightForWidth() ) ); set_w->setMinimumWidth( MIN_SET_WIDTH ); set_w->setMaximumWidth( MAX_SET_WIDTH ); @@ -612,8 +612,8 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[]) XMLEle *sep = NULL; XMLAtt *ap; INDI_E *lp; - QString switchName, switchLabel; - QStringList menuOptions; + TQString switchName, switchLabel; + TQStringList menuOptions; int i=0, onItem=-1; guitype = PG_MENU; @@ -677,12 +677,12 @@ int INDI_P::buildMenuGUI(XMLEle *root, char errmsg[]) om_w->insertStringList(menuOptions); om_w->setCurrentItem(onItem); - HorSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); PHBox->addWidget(om_w); PHBox->addItem(HorSpacer); - QObject::connect(om_w, SIGNAL(activated(int)), this, SLOT(newSwitch(int))); + TQObject::connect(om_w, TQT_SIGNAL(activated(int)), this, TQT_SLOT(newSwitch(int))); return (0); } @@ -693,17 +693,17 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) XMLAtt *ap; INDI_E *lp; KPushButton *button(NULL); - QCheckBox *checkbox; - QFont buttonFont; - QString switchName, switchLabel; + TQCheckBox *checkbox; + TQFont buttonFont; + TQString switchName, switchLabel; int j; - groupB = new QButtonGroup(0); - groupB->setFrameShape(QFrame::NoFrame); + groupB = new TQButtonGroup(0); + groupB->setFrameShape(TQFrame::NoFrame); if (guitype == PG_BUTTONS) groupB->setExclusive(true); - QObject::connect(groupB, SIGNAL(clicked(int)), this, SLOT(newSwitch(int))); + TQObject::connect(groupB, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(newSwitch(int))); for (sep = nextXMLEle (root, 1), j=-1; sep != NULL; sep = nextXMLEle (root, 0)) { @@ -767,7 +767,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) break; case PG_RADIO: - checkbox = new QCheckBox(switchLabel, pg->propertyContainer); + checkbox = new TQCheckBox(switchLabel, pg->propertyContainer); groupB->insert(checkbox, j); if (lp->state == PS_ON) @@ -792,7 +792,7 @@ int INDI_P::buildSwitchesGUI(XMLEle *root, char errmsg[]) if (j < 0) return (-1); - HorSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); PHBox->addItem(HorSpacer); @@ -804,7 +804,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[]) XMLEle *lep; XMLAtt *ap; INDI_E *lp; - QString sname, slabel; + TQString sname, slabel; for (lep = nextXMLEle (root, 1); lep != NULL; lep = nextXMLEle (root, 0)) { @@ -841,7 +841,7 @@ int INDI_P::buildLightsGUI(XMLEle *root, char errmsg[]) el.append(lp); } - HorSpacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + HorSpacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); PHBox->addItem(HorSpacer); @@ -855,7 +855,7 @@ int INDI_P::buildBLOBGUI(XMLEle *root, char errmsg[]) INDI_E *lp; XMLEle *blob; XMLAtt *ap; - QString blobName, blobLabel ; + TQString blobName, blobLabel ; errmsg=errmsg; for (blob = nextXMLEle (root, 1); blob != NULL; blob = nextXMLEle (root, 0)) @@ -900,13 +900,13 @@ int INDI_P::buildBLOBGUI(XMLEle *root, char errmsg[]) return 0; setupSetButton(i18n("Upload")); - QObject::connect(set_w, SIGNAL(clicked()), this, SLOT(newBlob())); + TQObject::connect(set_w, TQT_SIGNAL(clicked()), this, TQT_SLOT(newBlob())); return 0; } -void INDI_P::activateSwitch(QString name) +void INDI_P::activateSwitch(TQString name) { int iCounter = 0; INDI_E *element; diff --git a/kstars/kstars/indiproperty.h b/kstars/kstars/indiproperty.h index 727aa2e0..3bc3c087 100644 --- a/kstars/kstars/indiproperty.h +++ b/kstars/kstars/indiproperty.h @@ -35,11 +35,11 @@ class INDI_P : public QObject { Q_OBJECT public: - INDI_P(INDI_G *parentGroup, QString inName); + INDI_P(INDI_G *parentGroup, TQString inName); ~INDI_P(); QString name; /* property name */ - QString label; /* property label */ + TQString label; /* property label */ INDI_G *pg; /* parent group */ KPopupMenu *assosiatedPopup; /* assosiated popup menu, if any */ @@ -53,17 +53,17 @@ class INDI_P : public QObject int stdID; /* Standard property ID, if any */ - QLabel *label_w; /* Label widget */ - QPushButton *set_w; /* set button */ + TQLabel *label_w; /* Label widget */ + TQPushButton *set_w; /* set button */ - QSpacerItem *HorSpacer; /* Horizontal spacer */ - QHBoxLayout *PHBox; /* Horizontal container */ - QVBoxLayout *PVBox; /* Vertical container */ + TQSpacerItem *HorSpacer; /* Horizontal spacer */ + TQHBoxLayout *PHBox; /* Horizontal container */ + TQVBoxLayout *PVBox; /* Vertical container */ - QButtonGroup *groupB; /* group button for radio and check boxes (Elements) */ + TQButtonGroup *groupB; /* group button for radio and check boxes (Elements) */ KComboBox *om_w; /* Combo box for menu */ - QPtrList el; /* list of elements */ + TQPtrList el; /* list of elements */ /* Draw state LED */ void drawLt(PState lstate); @@ -75,9 +75,9 @@ class INDI_P : public QObject void setGroup(INDI_G *parentGroup) { pg = parentGroup; } /* Find an element within the property */ - INDI_E * findElement(QString elementName); + INDI_E * findElement(TQString elementName); /* Search for an element, and if found, evaluate its state */ - bool isOn(QString component); + bool isOn(TQString component); /* Build Functions */ int buildTextGUI (XMLEle *root, char errmsg[]); @@ -88,10 +88,10 @@ class INDI_P : public QObject int buildBLOBGUI (XMLEle *root, char errmsg[]); /* Setup the 'set' button in the property */ - void setupSetButton(QString caption); + void setupSetButton(TQString caption); /* Turn a switch on */ - void activateSwitch(QString name); + void activateSwitch(TQString name); public slots: void newText(); diff --git a/kstars/kstars/indistd.cpp b/kstars/kstars/indistd.cpp index 429e8824..b21f46b5 100644 --- a/kstars/kstars/indistd.cpp +++ b/kstars/kstars/indistd.cpp @@ -35,11 +35,11 @@ #include #include - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include #include #include @@ -71,14 +71,14 @@ streamWindow = new StreamWG(this, ksw); CCDPreviewWindow = new CCDPreviewWG(this, ksw); - devTimer = new QTimer(this); + devTimer = new TQTimer(this); seqLister = new KDirLister(); telescopeSkyObject = new SkyObject(0, 0, 0, 0, i18n("Telescope")); ksw->data()->appendTelescopeObject(telescopeSkyObject); - connect( devTimer, SIGNAL(timeout()), this, SLOT(timerDone()) ); - connect( seqLister, SIGNAL(newItems (const KFileItemList & )), this, SLOT(checkSeqBoundary(const KFileItemList &))); + connect( devTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerDone()) ); + connect( seqLister, TQT_SIGNAL(newItems (const KFileItemList & )), this, TQT_SLOT(checkSeqBoundary(const KFileItemList &))); downloadDialog = new KProgressDialog(NULL, 0, i18n("INDI"), i18n("Downloading Data...")); downloadDialog->cancel(); @@ -96,7 +96,7 @@ delete (seqLister); } -void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString dataFormat) +void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, TQString dataFormat) { if (dataFormat == ".fits") dataType = DATA_FITS; @@ -124,7 +124,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString da char filename[256]; FILE *fitsTempFile; int fd, nr, n=0; - QString currentDir = Options::fitsSaveDirectory(); + TQString currentDir = Options::fitsSaveDirectory(); streamWindow->close(); @@ -220,7 +220,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString da double fwhm; int d, m, y, min, sec, hour; ExtDate indiDate; - QTime indiTime; + TQTime indiTime; KStarsDateTime indiDateTime; switch (pp->stdID) @@ -347,7 +347,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString da INDI_P *imgProp; KAction *tmpAction; INDIDriver *drivers = ksw->getINDIDriver(); - QFont buttonFont; + TQFont buttonFont; switch (pp->stdID) { @@ -441,11 +441,11 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString da } - void INDIStdDevice::updateSequencePrefix(QString newPrefix) + void INDIStdDevice::updateSequencePrefix(TQString newPrefix) { seqPrefix = newPrefix; - seqLister->setNameFilter(QString("%1_*.fits").arg(seqPrefix)); + seqLister->setNameFilter(TQString("%1_*.fits").arg(seqPrefix)); seqCount = 0; @@ -460,7 +460,7 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString da void INDIStdDevice::checkSeqBoundary(const KFileItemList & items) { int newFileIndex; - QString tempName; + TQString tempName; char *tempPrefix = new char[64]; // No need to check when in ISO mode @@ -506,10 +506,10 @@ void INDIStdDevice::handleBLOB(unsigned char *buffer, int bufferSize, QString da if (!lp) return; - QTime newTime( ksw->data()->ut().time()); + TQTime newTime( ksw->data()->ut().time()); ExtDate newDate( ksw->data()->ut().date()); - lp->write_w->setText(QString("%1-%2-%3T%4:%5:%6").arg(newDate.year()).arg(newDate.month()) + lp->write_w->setText(TQString("%1-%2-%3T%4:%5:%6").arg(newDate.year()).arg(newDate.month()) .arg(newDate.day()).arg(newTime.hour()) .arg(newTime.minute()).arg(newTime.second())); pp->newText(); @@ -543,8 +543,8 @@ void INDIStdDevice::updateLocation() longEle = pp->findElement("LONG"); if (!longEle) return; - longEle->write_w->setText(QString("%1:%2:%3").arg(tempLong.degree()).arg(tempLong.arcmin()).arg(tempLong.arcsec())); - latEle->write_w->setText(QString("%1:%2:%3").arg(geo->lat()->degree()).arg(geo->lat()->arcmin()).arg(geo->lat()->arcsec())); + longEle->write_w->setText(TQString("%1:%2:%3").arg(tempLong.degree()).arg(tempLong.arcmin()).arg(tempLong.arcsec())); + latEle->write_w->setText(TQString("%1:%2:%3").arg(geo->lat()->degree()).arg(geo->lat()->arcmin()).arg(geo->lat()->arcsec())); pp->newText(); } @@ -554,7 +554,7 @@ void INDIStdDevice::updateLocation() { INDI_E * portEle; INDIDriver *drivers = ksw->getINDIDriver(); - QString str; + TQString str; switch (pp->stdID) { @@ -661,8 +661,8 @@ bool INDIStdDevice::handleNonSidereal() // then we take advantage of it. Otherwise, we send RA/DEC to the telescope and start a timer // based on the object type. Objects with high proper motions will require faster updates. // handle Non Sideral is ONLY called when tracking an object, not slewing. - INDI_P *prop = dp->findProp(QString("SOLAR_SYSTEM")); - INDI_P *setMode = dp->findProp(QString("ON_COORD_SET")); + INDI_P *prop = dp->findProp(TQString("SOLAR_SYSTEM")); + INDI_P *setMode = dp->findProp(TQString("ON_COORD_SET")); // If the device support it if (prop && setMode) @@ -779,10 +779,10 @@ void INDIStdDevice::timerDone() DecEle = prop->findElement("DEC"); if (!DecEle) return; - RAEle->write_w->setText(QString("%1:%2:%3").arg(sp.ra()->hour()) + RAEle->write_w->setText(TQString("%1:%2:%3").arg(sp.ra()->hour()) .arg(sp.ra()->minute()) .arg(sp.ra()->second())); - DecEle->write_w->setText(QString("%1:%2:%3").arg(sp.dec()->degree()) + DecEle->write_w->setText(TQString("%1:%2:%3").arg(sp.dec()->degree()) .arg(sp.dec()->arcmin()) .arg(sp.dec()->arcsec())); prop->newText(); @@ -928,8 +928,8 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN if (useJ2000) sp.apparentCoord(ksw->data()->ut().djd(), (long double) J2000); - RAEle->write_w->setText(QString("%1:%2:%3").arg(sp.ra()->hour()).arg(sp.ra()->minute()).arg(sp.ra()->second())); - DecEle->write_w->setText(QString("%1:%2:%3").arg(sp.dec()->degree()).arg(sp.dec()->arcmin()).arg(sp.dec()->arcsec())); + RAEle->write_w->setText(TQString("%1:%2:%3").arg(sp.ra()->hour()).arg(sp.ra()->minute()).arg(sp.ra()->second())); + DecEle->write_w->setText(TQString("%1:%2:%3").arg(sp.dec()->degree()).arg(sp.dec()->arcmin()).arg(sp.dec()->arcsec())); break; @@ -945,8 +945,8 @@ INDIStdProperty::INDIStdProperty(INDI_P *associatedProperty, KStars * kswPtr, IN sp.setAlt(*ksw->map()->clickedPoint()->alt()); } - AzEle->write_w->setText(QString("%1:%2:%3").arg(sp.az()->degree()).arg(sp.az()->arcmin()).arg(sp.az()->arcsec())); - AltEle->write_w->setText(QString("%1:%2:%3").arg(sp.alt()->degree()).arg(sp.alt()->arcmin()).arg(sp.alt()->arcsec())); + AzEle->write_w->setText(TQString("%1:%2:%3").arg(sp.az()->degree()).arg(sp.az()->arcmin()).arg(sp.az()->arcsec())); + AltEle->write_w->setText(TQString("%1:%2:%3").arg(sp.alt()->degree()).arg(sp.alt()->arcmin()).arg(sp.alt()->arcsec())); break; } @@ -1020,12 +1020,12 @@ void INDIStdProperty::newTime() TimeDialog timedialog ( ksw->data()->ut(), ksw ); - if ( timedialog.exec() == QDialog::Accepted ) + if ( timedialog.exec() == TQDialog::Accepted ) { - QTime newTime( timedialog.selectedTime() ); + TQTime newTime( timedialog.selectedTime() ); ExtDate newDate( timedialog.selectedDate() ); - timeEle->write_w->setText(QString("%1-%2-%3T%4:%5:%6") + timeEle->write_w->setText(TQString("%1-%2-%3T%4:%5:%6") .arg(newDate.year()).arg(newDate.month()) .arg(newDate.day()).arg(newTime.hour()) .arg(newTime.minute()).arg(newTime.second())); diff --git a/kstars/kstars/indistd.h b/kstars/kstars/indistd.h index f2780493..c69bec46 100644 --- a/kstars/kstars/indistd.h +++ b/kstars/kstars/indistd.h @@ -12,7 +12,7 @@ #ifndef INDISTD_H #define INDISTD_H - #include + #include #include #include @@ -43,7 +43,7 @@ StreamWG *streamWindow; CCDPreviewWG *CCDPreviewWindow; SkyObject *currentObject; - QTimer *devTimer; + TQTimer *devTimer; KProgressDialog *downloadDialog; @@ -52,7 +52,7 @@ void setTextValue(INDI_P *pp); void setLabelState(INDI_P *pp); void registerProperty(INDI_P *pp); - void handleBLOB(unsigned char *buffer, int bufferSize, QString dataFormat); + void handleBLOB(unsigned char *buffer, int bufferSize, TQString dataFormat); /* Device options */ void initDeviceOptions(); @@ -66,7 +66,7 @@ /* INDI STD: Updates device location */ void updateLocation(); /* Update image prefix */ - void updateSequencePrefix(QString newPrefix); + void updateSequencePrefix(TQString newPrefix); int dataType; int initDevCounter; @@ -89,7 +89,7 @@ signals: void linkRejected(); void linkAccepted(); - void FITSReceived(QString deviceLabel); + void FITSReceived(TQString deviceLabel); }; diff --git a/kstars/kstars/infobox.cpp b/kstars/kstars/infobox.cpp index 0b14b0cc..b2f64bcd 100644 --- a/kstars/kstars/infobox.cpp +++ b/kstars/kstars/infobox.cpp @@ -16,7 +16,7 @@ ***************************************************************************/ #include -#include +#include #include "infobox.h" @@ -36,7 +36,7 @@ InfoBox::InfoBox(){ Shaded = false; } -InfoBox::InfoBox( int x, int y, bool shade, QString t1, QString t2, QString t3 ) { +InfoBox::InfoBox( int x, int y, bool shade, TQString t1, TQString t2, TQString t3 ) { setText1( t1 ); setText2( t2 ); setText3( t3 ); @@ -52,7 +52,7 @@ InfoBox::InfoBox( int x, int y, bool shade, QString t1, QString t2, QString t3 ) Visible = true; } -InfoBox::InfoBox( QPoint pt, bool shade, QString t1, QString t2, QString t3 ) { +InfoBox::InfoBox( TQPoint pt, bool shade, TQString t1, TQString t2, TQString t3 ) { setText1( t1 ); setText2( t2 ); setText3( t3 ); @@ -97,21 +97,21 @@ void InfoBox::updateSize() { // kdDebug() << "Size=" << Size.width() << "," << Size.height() << endl; } -bool InfoBox::constrain( QRect r, bool inside ) { +bool InfoBox::constrain( TQRect r, bool inside ) { if ( inside ) { - //Place InfoBox within QRect r: + //Place InfoBox within TQRect r: if ( x() < r.x() ) move( r.x(), y() ); if ( y() < r.y() ) move( x(), r.y() ); if ( x() + width() > r.right() ) move( r.right() - width(), y() ); if ( y() + height() > r.bottom() ) move( x(), r.bottom() - height() ); - //The InfoBox is now within the bounds of QRect r, unless it is bigger than r. + //The InfoBox is now within the bounds of TQRect r, unless it is bigger than r. //In that case, we cannot obey the constraint, but the current position is as //close as we can get. Return false in this case. if ( width() > r.width() || height() > r.height() ) return false; else return true; } else { //FIXME... - //Place InfoBox outside QRect r. First, determine if InfoBox is within r: + //Place InfoBox outside TQRect r. First, determine if InfoBox is within r: // if ( rect().intersects( r ) ) { //Move the InfoBox in all four directions until it no longer intersects r. //Determine which displacement is shortest @@ -120,8 +120,8 @@ bool InfoBox::constrain( QRect r, bool inside ) { } } -void InfoBox::draw( QPainter &p, QColor BGColor, unsigned int BGMode ) { - QRect r; +void InfoBox::draw( TQPainter &p, TQColor BGColor, unsigned int BGMode ) { + TQRect r; int w,h; r = p.boundingRect( x(), y(), p.window().width(), p.window().height(), Qt::AlignCenter, text1() ); @@ -147,11 +147,11 @@ void InfoBox::draw( QPainter &p, QColor BGColor, unsigned int BGMode ) { FullTextHeight = h; updateSize(); - constrain( QRect( 0, 0, p.window().width(), p.window().height() ) ); + constrain( TQRect( 0, 0, p.window().width(), p.window().height() ) ); //Draw the box boundary and the text - if ( BGMode==1 ) p.fillRect( x(), y(), width(), height(), QBrush( BGColor, Dense4Pattern ) ); - if ( BGMode==2 ) p.fillRect( x(), y(), width(), height(), QBrush( BGColor ) ); + if ( BGMode==1 ) p.fillRect( x(), y(), width(), height(), TQBrush( BGColor, Dense4Pattern ) ); + if ( BGMode==2 ) p.fillRect( x(), y(), width(), height(), TQBrush( BGColor ) ); p.drawText( x() + padx(), y() + ShadedTextHeight/2 + pady(), text1() ); @@ -161,16 +161,16 @@ void InfoBox::draw( QPainter &p, QColor BGColor, unsigned int BGMode ) { } } -QRect InfoBox::rect() const { - return QRect( pos(), size() ); +TQRect InfoBox::rect() const { + return TQRect( pos(), size() ); } void InfoBox::move( int x, int y ) { - Pos.setX( x ); Pos.setY( y ); emit moved( QPoint(x,y) ); + Pos.setX( x ); Pos.setY( y ); emit moved( TQPoint(x,y) ); } -void InfoBox::move( QPoint p ) { - move( p.x(), p.y() ); emit moved( QPoint( p.x(), p.y() ) ); +void InfoBox::move( TQPoint p ) { + move( p.x(), p.y() ); emit moved( TQPoint( p.x(), p.y() ) ); } #include "infobox.moc" diff --git a/kstars/kstars/infobox.h b/kstars/kstars/infobox.h index 205b4bd9..bfc67b91 100644 --- a/kstars/kstars/infobox.h +++ b/kstars/kstars/infobox.h @@ -18,11 +18,11 @@ #ifndef INFOBOX_H #define INFOBOX_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /**@class InfoBox *InfoBoxencapsulates a lightweight floating "window" to be drawn directly @@ -35,7 +35,7 @@ class QPainter; -class InfoBox : public QObject { +class InfoBox : public TQObject { Q_OBJECT public: /**default constructor. Creates an infobox with empty text string @@ -51,7 +51,7 @@ public: *@param t2 The second line of text *@param t3 The third line of text */ - InfoBox( int x, int y, bool shade, QString t1="", QString t2="", QString t3="" ); + InfoBox( int x, int y, bool shade, TQString t1="", TQString t2="", TQString t3="" ); /**General constructor. Specify The text string, x,y position and size. *This behaves just like the above function. It differs only in the data types @@ -62,20 +62,20 @@ public: *@param t2 The second line of text *@param t3 The third line of text */ - InfoBox( QPoint p, bool shade, QString t1="", QString t2="", QString t3="" ); + InfoBox( TQPoint p, bool shade, TQString t1="", TQString t2="", TQString t3="" ); /**Destructor (empty)*/ ~InfoBox(); /**Draw the InfoBox. First calls updateSize() and constrain() to make sure *the box is onscreen and the correct size. - *@param p reference to the QPainter on which to draw the box + *@param p reference to the TQPainter on which to draw the box *@param BGColor the background color to be used *@param BGMode the background mode (0=none; 1=semi-transparent; 2=opaque) *@see InfoBox::updateSize() *@see InfoBox::constrain() */ - void draw( QPainter &p, QColor BGColor, unsigned int BGMode ); + void draw( TQPainter &p, TQColor BGColor, unsigned int BGMode ); /**Toggle the Shaded state of the box. */ @@ -92,7 +92,7 @@ public: *only in the data type of its arguments. *@param p the new (X,Y) position */ - void move( QPoint p ); + void move( TQPoint p ); /**Reset the width and height. *@param w the new width @@ -104,33 +104,33 @@ public: *function. It differs only in the data type of its arguments. *@param s the new size */ - void resize( QSize s ) { Size.setWidth( s.width() ); Size.setHeight( s.height() ); } + void resize( TQSize s ) { Size.setWidth( s.width() ); Size.setHeight( s.height() ); } /**Set the size of the box to fit the current displayed text */ void updateSize(); - /**Make sure the InfoBox is inside (or outside) the QRect r. + /**Make sure the InfoBox is inside (or outside) the TQRect r. *@return true if the function was able to obey the constraint. *@param r the Rect which the box must lie completely inside/outside of. *@param inside if TRUE (the default), the box must lie inside the rect r. *Otherwise, the box must lie *outside* rect r. */ - bool constrain( QRect r, bool inside=true ); + bool constrain( TQRect r, bool inside=true ); /**Reset the first text string *@param newt the new text. */ - void setText1( QString newt ) { Text1 = newt; } + void setText1( TQString newt ) { Text1 = newt; } /**Reset the second text string *@param newt the new text. */ - void setText2( QString newt ) { Text2 = newt; } + void setText2( TQString newt ) { Text2 = newt; } /**Reset the third text string *@param newt the new text. */ - void setText3( QString newt ) { Text3 = newt; } + void setText3( TQString newt ) { Text3 = newt; } //temporarily, padx() and pady() simply return a constant int padx() const { return 6; } @@ -146,7 +146,7 @@ public: int y() const { return Pos.y(); } /**@return the (X,Y) position of the box*/ - QPoint pos() const { return Pos; } + TQPoint pos() const { return Pos; } /**@return the width of the box*/ int width() const { return Size.width(); } @@ -155,22 +155,22 @@ public: int height() const { return Size.height(); } /**@return the size of the box*/ - QSize size() const { return Size; } + TQSize size() const { return Size; } /**@return whether the box is visible */ bool isVisible() const { return Visible; } /**@return the first line of text*/ - QString text1() const { return Text1; } + TQString text1() const { return Text1; } /**@return the second line of text*/ - QString text2() const { return Text2; } + TQString text2() const { return Text2; } /**@return the third line of text*/ - QString text3() const { return Text3; } + TQString text3() const { return Text3; } /**@return the geometry of the box*/ - QRect rect() const; + TQRect rect() const; /**@return TRUE if the box is anchored to the right window edge*/ bool anchorRight() const { return ( AnchorFlag & AnchorRight ); } @@ -202,7 +202,7 @@ signals: *@param p the new (X,Y) position *@see InfoBox::move() */ - void moved( QPoint p ); + void moved( TQPoint p ); /**Signal emitted when the box's shaded-state is toggled *@param s the new shaded state @@ -217,9 +217,9 @@ private: int FullTextWidth, FullTextHeight; int ShadedTextWidth, ShadedTextHeight; int AnchorFlag; - QPoint Pos; - QSize Size; - QString Text1, Text2, Text3; + TQPoint Pos; + TQSize Size; + TQString Text1, Text2, Text3; }; #endif diff --git a/kstars/kstars/infoboxes.cpp b/kstars/kstars/infoboxes.cpp index 4671d8e9..dff865e4 100644 --- a/kstars/kstars/infoboxes.cpp +++ b/kstars/kstars/infoboxes.cpp @@ -17,8 +17,8 @@ #include #include -//#include -#include +//#include +#include #include "infoboxes.h" #include "kstarsdatetime.h" @@ -26,9 +26,9 @@ #include "geolocation.h" #include "skypoint.h" -InfoBoxes::InfoBoxes( int w, int h, QPoint tp, bool tshade, - QPoint gp, bool gshade, QPoint fp, bool fshade, - QColor colorText, QColor colorGrab, QColor colorBG ) : +InfoBoxes::InfoBoxes( int w, int h, TQPoint tp, bool tshade, + TQPoint gp, bool gshade, TQPoint fp, bool fshade, + TQColor colorText, TQColor colorGrab, TQColor colorBG ) : boxColor(colorText), grabColor(colorGrab), bgColor(colorBG), GeoBox(0), FocusBox(0), TimeBox(0) { @@ -41,7 +41,7 @@ InfoBoxes::InfoBoxes( int w, int h, QPoint tp, bool tshade, int fy = fp.y(); GrabbedBox = 0; - GrabPos = QPoint( 0, 0 ); + GrabPos = TQPoint( 0, 0 ); Visible = true; Width = w; @@ -60,11 +60,11 @@ InfoBoxes::InfoBoxes( int w, int h, QPoint tp, bool tshade, InfoBoxes::InfoBoxes( int w, int h, int tx, int ty, bool tshade, int gx, int gy, bool gshade, int fx, int fy, bool fshade, - QColor colorText, QColor colorGrab, QColor colorBG ) : + TQColor colorText, TQColor colorGrab, TQColor colorBG ) : boxColor(colorText), grabColor(colorGrab), bgColor(colorBG) { GrabbedBox = 0; - GrabPos = QPoint( 0, 0 ); + GrabPos = TQPoint( 0, 0 ); Visible = true; Width = w; @@ -93,31 +93,31 @@ void InfoBoxes::resize( int w, int h ) { checkBorders(false); } -void InfoBoxes::drawBoxes( QPainter &p, QColor FGColor, QColor grabColor, - QColor BGColor, unsigned int BGMode ) { +void InfoBoxes::drawBoxes( TQPainter &p, TQColor FGColor, TQColor grabColor, + TQColor BGColor, unsigned int BGMode ) { if ( isVisible() ) { if ( GeoBox->isVisible() ) { - p.setPen( QPen( FGColor ) ); + p.setPen( TQPen( FGColor ) ); if ( GrabbedBox == 1 ) { - p.setPen( QPen( grabColor ) ); + p.setPen( TQPen( grabColor ) ); p.drawRect( GeoBox->x(), GeoBox->y(), GeoBox->width(), GeoBox->height() ); } GeoBox->draw( p, BGColor, BGMode ); } if ( TimeBox->isVisible() ) { - p.setPen( QPen( FGColor ) ); + p.setPen( TQPen( FGColor ) ); if ( GrabbedBox == 2 ) { - p.setPen( QPen( grabColor ) ); + p.setPen( TQPen( grabColor ) ); p.drawRect( TimeBox->x(), TimeBox->y(), TimeBox->width(), TimeBox->height() ); } TimeBox->draw( p, BGColor, BGMode ); } if ( FocusBox->isVisible() ) { - p.setPen( QPen( FGColor ) ); + p.setPen( TQPen( FGColor ) ); if ( GrabbedBox == 3 ) { - p.setPen( QPen( grabColor ) ); + p.setPen( TQPen( grabColor ) ); p.drawRect( FocusBox->x(), FocusBox->y(), FocusBox->width(), FocusBox->height() ); } FocusBox->draw( p, BGColor, BGMode ); @@ -125,7 +125,7 @@ void InfoBoxes::drawBoxes( QPainter &p, QColor FGColor, QColor grabColor, } } -bool InfoBoxes::grabBox( QMouseEvent *e ) { +bool InfoBoxes::grabBox( TQMouseEvent *e ) { if ( GeoBox->rect().contains( e->pos() ) ) { GrabbedBox = 1; GrabPos.setX( e->x() - GeoBox->x() ); @@ -157,7 +157,7 @@ bool InfoBoxes::unGrabBox( void ) { } } -bool InfoBoxes::dragBox( QMouseEvent *e ) { +bool InfoBoxes::dragBox( TQMouseEvent *e ) { switch( GrabbedBox ) { case 1: //GeoBox GeoBox->move( e->x() - GrabPos.x(), e->y() - GrabPos.y() ); @@ -179,7 +179,7 @@ bool InfoBoxes::dragBox( QMouseEvent *e ) { } } -bool InfoBoxes::shadeBox( QMouseEvent *e ) { +bool InfoBoxes::shadeBox( TQMouseEvent *e ) { if ( GeoBox->rect().contains( e->pos() ) ) { GeoBox->toggleShade(); if ( GeoBox->rect().bottom() > height() ) GeoBox->move( GeoBox->x(), height() - GeoBox->height() ); @@ -213,32 +213,32 @@ bool InfoBoxes::shadeBox( QMouseEvent *e ) { bool InfoBoxes::fixCollisions( InfoBox *target ) { int dLeft(0), dRight(0), dUp(0), dDown(0); - QRect area = QRect( 0, 0, Width, Height ); - QRect t = target->rect(); - QRect Box1, Box2; + TQRect area = TQRect( 0, 0, Width, Height ); + TQRect t = target->rect(); + TQRect Box1, Box2; //Set Box1 and Box2 to the rects of the other two InfoBoxes, unless -//they are not visible (if so, set a null QRect) +//they are not visible (if so, set a null TQRect) if ( target == GeoBox ) { if ( FocusBox->isVisible() ) Box1 = FocusBox->rect(); - else Box1 = QRect(0,0,0,0); + else Box1 = TQRect(0,0,0,0); if ( TimeBox->isVisible() ) Box2 = TimeBox->rect(); - else Box2 = QRect(0,0,0,0); + else Box2 = TQRect(0,0,0,0); } else if ( target == FocusBox ) { if ( GeoBox->isVisible() ) Box1 = GeoBox->rect(); - else Box1 = QRect(0,0,0,0); + else Box1 = TQRect(0,0,0,0); if ( TimeBox->isVisible() ) Box2 = TimeBox->rect(); - else Box2 = QRect(0,0,0,0); + else Box2 = TQRect(0,0,0,0); } else if ( target == TimeBox ) { if ( FocusBox->isVisible() ) Box1 = FocusBox->rect(); - else Box1 = QRect(0,0,0,0); + else Box1 = TQRect(0,0,0,0); if ( GeoBox->isVisible() ) Box2 = GeoBox->rect(); - else Box2 = QRect(0,0,0,0); + else Box2 = TQRect(0,0,0,0); } else { return false; } //none of the Boxes match target! @@ -266,10 +266,10 @@ bool InfoBoxes::fixCollisions( InfoBox *target ) { t = target->rect(); } - QRect upRect = t; - QRect downRect = t; - QRect leftRect = t; - QRect rightRect = t; + TQRect upRect = t; + TQRect downRect = t; + TQRect leftRect = t; + TQRect rightRect = t; //Fix collisions if ( t.intersects( Box1 ) || t.intersects( Box2 ) ) { @@ -277,26 +277,26 @@ bool InfoBoxes::fixCollisions( InfoBox *target ) { //intersection with Box1 or Box2. while ( leftRect.intersects( Box1 ) || leftRect.intersects( Box2 ) ) { ++dLeft; - leftRect.moveTopLeft( QPoint( t.x() - dLeft, t.y() ) ); + leftRect.moveTopLeft( TQPoint( t.x() - dLeft, t.y() ) ); } //If leftRect is outside area, set dLeft to a nonsense large value if ( !area.contains( leftRect ) ) { dLeft = 100000; } //repeat for right, up and down directions. while ( rightRect.intersects( Box1 ) || rightRect.intersects( Box2 ) ) { ++dRight; - rightRect.moveTopLeft( QPoint( t.x() + dRight, t.y() ) ); + rightRect.moveTopLeft( TQPoint( t.x() + dRight, t.y() ) ); } if ( !area.contains( rightRect ) ) { dRight = 100000; } while ( upRect.intersects( Box1 ) || upRect.intersects( Box2 ) ) { ++dUp; - upRect.moveTopLeft( QPoint( t.x(), t.y() - dUp ) ); + upRect.moveTopLeft( TQPoint( t.x(), t.y() - dUp ) ); } if ( !area.contains( upRect ) ) { dUp = 100000; } while ( downRect.intersects( Box1 ) || downRect.intersects( Box2 ) ) { ++dDown; - downRect.moveTopLeft( QPoint( t.x(), t.y() + dDown ) ); + downRect.moveTopLeft( TQPoint( t.x(), t.y() + dDown ) ); } if ( !area.contains( downRect ) ) { dDown = 100000; } @@ -336,21 +336,21 @@ bool InfoBoxes::fixCollisions( InfoBox *target ) { } bool InfoBoxes::timeChanged( const KStarsDateTime &ut, const KStarsDateTime <, dms *lst ) { - QString ot1 = TimeBox->text1(); - QString ot2 = TimeBox->text2(); - QString ot3 = TimeBox->text3(); + TQString ot1 = TimeBox->text1(); + TQString ot2 = TimeBox->text2(); + TQString ot3 = TimeBox->text3(); TimeBox->setText1( i18n( "Local Time", "LT: " ) + lt.time().toString() + " " + lt.date().toString( "%d %b %Y" ) ); TimeBox->setText2( i18n( "Universal Time", "UT: " ) + ut.time().toString() + " " + ut.date().toString( "%d %b %Y" ) ); - QString STString; + TQString STString; STString = STString.sprintf( "%02d:%02d:%02d ", lst->hour(), lst->minute(), lst->second() ); //Don't use KLocale::formatNumber() for Julian Day because we don't want //thousands-place separators - QString JDString = QString::number( ut.djd(), 'f', 2 ); + TQString JDString = TQString::number( ut.djd(), 'f', 2 ); JDString.replace( ".", KGlobal::locale()->decimalSymbol() ); TimeBox->setText3( i18n( "Sidereal Time", "ST: " ) + STString + @@ -366,10 +366,10 @@ bool InfoBoxes::timeChanged( const KStarsDateTime &ut, const KStarsDateTime <, } bool InfoBoxes::geoChanged(const GeoLocation *geo) { - QString ot1 = GeoBox->text1(); - QString ot2 = GeoBox->text2(); + TQString ot1 = GeoBox->text1(); + TQString ot2 = GeoBox->text2(); - QString name = geo->translatedName() + ", "; + TQString name = geo->translatedName() + ", "; if ( ! geo->province().isEmpty() ) name += geo->translatedProvince() + ", "; name += geo->translatedCountry(); GeoBox->setText1( name ); @@ -387,8 +387,8 @@ bool InfoBoxes::geoChanged(const GeoLocation *geo) { } } -bool InfoBoxes::focusObjChanged( const QString &n ) { - QString ot1 = FocusBox->text1(); +bool InfoBoxes::focusObjChanged( const TQString &n ) { + TQString ot1 = FocusBox->text1(); FocusBox->setText1( i18n( "Focused on: " ) + n ); if ( ot1 == FocusBox->text1() ) return false; @@ -399,8 +399,8 @@ bool InfoBoxes::focusObjChanged( const QString &n ) { } bool InfoBoxes::focusCoordChanged(const SkyPoint *p) { - QString ot2 = FocusBox->text2(); - QString ot3 = FocusBox->text3(); + TQString ot2 = FocusBox->text2(); + TQString ot3 = FocusBox->text3(); FocusBox->setText2( i18n( "Right Ascension", "RA" ) + ": " + p->ra()->toHMSString() + " " + i18n( "Declination", "Dec" ) + ": " + p->dec()->toDMSString(true) ); diff --git a/kstars/kstars/infoboxes.h b/kstars/kstars/infoboxes.h index 0a1b6669..645f2bbe 100644 --- a/kstars/kstars/infoboxes.h +++ b/kstars/kstars/infoboxes.h @@ -18,10 +18,10 @@ #ifndef INFOBOXES_H #define INFOBOXES_H -#include -#include -#include -#include +#include +#include +#include +#include #include #include "infobox.h" @@ -43,7 +43,7 @@ class dms; class InfoBox; class KStarsDateTime; -class InfoBoxes : public QObject { +class InfoBoxes : public TQObject { Q_OBJECT public: /**Constructor. Create three infoboxes and place them in the skymap. @@ -65,7 +65,7 @@ public: *"grabbed" by the user *@param colorBG The background color for infoboxes * - *@todo Use Qt::white as default color instead of QColor("white"), + *@todo Use Qt::white as default color instead of TQColor("white"), * for default values of colorText, colorGrab and colorBG, * since that's considerably faster. */ @@ -73,9 +73,9 @@ public: int tx=0, int ty=0, bool tshade=false, int gx=0, int gy=600, bool gshade=false, int fx=600, int fy=0, bool fshade=false, - QColor colorText=QColor("white"), - QColor colorGrab=QColor("red"), - QColor colorBG=QColor("black") ); + TQColor colorText=TQColor("white"), + TQColor colorGrab=TQColor("red"), + TQColor colorBG=TQColor("black") ); /**Constructor. Create three infoboxes and place them in the skymap. *Differs from the above function only in the types of its arguments. @@ -95,12 +95,12 @@ public: *@param colorBG The background color for infoboxes */ InfoBoxes( int w, int h, - QPoint tp, bool tshade, - QPoint gp, bool gshade, - QPoint fp, bool fshade, - QColor colorText=QColor("white"), - QColor colorGrab=QColor("red"), - QColor colorBG=QColor("black") ); + TQPoint tp, bool tshade, + TQPoint gp, bool gshade, + TQPoint fp, bool fshade, + TQColor colorText=TQColor("white"), + TQColor colorGrab=TQColor("red"), + TQColor colorBG=TQColor("black") ); /**Destructor (empty)*/ ~InfoBoxes(); @@ -132,14 +132,14 @@ public: int height() const { return Height; } /**Draw the boxes on a Qpainter object (representing the SkyMap). - *@param p The QPainter on which to draw the boxes. + *@param p The TQPainter on which to draw the boxes. *@param FGColor The foreground color (Pen color) to use when drawing boxes. *@param grabColor The foreground color to use if the box is "grabbed" by the user. *@param BGColor The background color (brush color) to use *@param BGMode: 0=no BG fill; 1=transparent BG fill; 2=Opaque BG fill. */ - void drawBoxes( QPainter &p, QColor FGColor=QColor("white"), - QColor grabColor=QColor("red"), QColor BGColor=QColor("black"), + void drawBoxes( TQPainter &p, TQColor FGColor=TQColor("white"), + TQColor grabColor=TQColor("red"), TQColor BGColor=TQColor("black"), unsigned int BGMode=0 ); /**Determine whether a mouse click occurred inside one of the infoboxes. @@ -149,7 +149,7 @@ public: *@param e The mouse event to check (it's a mousePressEvent) *@return true if the mouse press occurred inside one of the infoboxes. */ - bool grabBox( QMouseEvent *e ); + bool grabBox( TQMouseEvent *e ); /**Set the internal variable GrabBox to 0, indicating that no box is currently *grabbed. Also determine if any box should be anchored to an edge. (This @@ -165,7 +165,7 @@ public: *@param e The mouse event which contains the new mouse cursor position *@return false if no box is grabbed; otherwise, moves the grabbed box and returns true. */ - bool dragBox( QMouseEvent *e ); + bool dragBox( TQMouseEvent *e ); /**Toggle the shade-state of the infobox in which the user double-clicked. *After shading the box, call fixCollisions() on the other two boxes. @@ -174,7 +174,7 @@ public: *@return false if the double-click was not inside any box; otherwise shade the *target box and return true. */ - bool shadeBox( QMouseEvent *e ); + bool shadeBox( TQMouseEvent *e ); /**Make sure the target Infobox lies within the SkyMap boundaries, and that it does *not overlap with the other two Infoboxes. If an overlap is detected, the target @@ -240,7 +240,7 @@ public slots: *@param n The object name *@return true if values have changed */ - bool focusObjChanged(const QString &n); + bool focusObjChanged(const TQString &n); /**Check if boxes are anchored with bottom or right border. @param resetToDefault reset all borders of boxes to false before checking borders. @@ -251,8 +251,8 @@ private: int Width, Height; int GrabbedBox; bool Visible; - const QColor boxColor, grabColor, bgColor; - QPoint GrabPos; + const TQColor boxColor, grabColor, bgColor; + TQPoint GrabPos; InfoBox *GeoBox, *FocusBox, *TimeBox; }; diff --git a/kstars/kstars/jupitermoons.cpp b/kstars/kstars/jupitermoons.cpp index ca152fd3..deba668a 100644 --- a/kstars/kstars/jupitermoons.cpp +++ b/kstars/kstars/jupitermoons.cpp @@ -38,7 +38,7 @@ JupiterMoons::JupiterMoons(){ JupiterMoons::~JupiterMoons(){ } -int JupiterMoons::moonNamed( const QString &name ) const { +int JupiterMoons::moonNamed( const TQString &name ) const { for ( int i=0; i<4; ++i ) { if ( Name[i] == name ) return i; } diff --git a/kstars/kstars/jupitermoons.h b/kstars/kstars/jupitermoons.h index 23163f26..4555d74a 100644 --- a/kstars/kstars/jupitermoons.h +++ b/kstars/kstars/jupitermoons.h @@ -77,13 +77,13 @@ public: /**@return the name of a moon. *@param id which moon? 0=Io, 1=Europa, 2=Ganymede, 3=Callisto */ - QString name( int id ) const { return Name[id]; } + TQString name( int id ) const { return Name[id]; } /**@return ID number of a moon, given its name: *0=Io, 1=Europa, 2=Ganymede, 3=Callisto. *Return -1 if the name does not match one of these. */ - int moonNamed( const QString &name ) const; + int moonNamed( const TQString &name ) const; /**Convert the RA,Dec coordinates of each moon to Az,Alt *@param LSTh pointer to the current local sidereal time @@ -107,7 +107,7 @@ public: double z( int i ) const { return ZJ[i]; } private: SkyPoint Pos[4]; - QString Name[4]; + TQString Name[4]; bool InFront[4]; //the rectangular position, relative to Jupiter. X-axis is equator of Jupiter; usints are Jup. Radius double XJ[4], YJ[4], ZJ[4]; diff --git a/kstars/kstars/ksasteroid.cpp b/kstars/kstars/ksasteroid.cpp index 4ac314fb..9da8a3d4 100644 --- a/kstars/kstars/ksasteroid.cpp +++ b/kstars/kstars/ksasteroid.cpp @@ -23,7 +23,7 @@ #include "ksutils.h" #include "kstarsdata.h" -KSAsteroid::KSAsteroid( KStarsData *_kd, QString s, QString imfile, +KSAsteroid::KSAsteroid( KStarsData *_kd, TQString s, TQString imfile, long double _JD, double _a, double _e, dms _i, dms _w, dms _Node, dms _M, double _H ) : KSPlanetBase(_kd, s, imfile), kd(_kd), JD(_JD), a(_a), e(_e), H(_H), i(_i), w(_w), M(_M), N(_Node) { diff --git a/kstars/kstars/ksasteroid.h b/kstars/kstars/ksasteroid.h index a1fa12c2..326b4b43 100644 --- a/kstars/kstars/ksasteroid.h +++ b/kstars/kstars/ksasteroid.h @@ -61,7 +61,7 @@ class KSAsteroid : public KSPlanetBase *@p M the mean anomaly for the Julian Day *@p H absolute magnitude */ - KSAsteroid( KStarsData *kd, QString s, QString image_file, + KSAsteroid( KStarsData *kd, TQString s, TQString image_file, long double JD, double a, double e, dms i, dms w, dms N, dms M, double H ); /**Destructor (empty)*/ diff --git a/kstars/kstars/kscomet.cpp b/kstars/kstars/kscomet.cpp index 6f2c34a2..94ed1762 100644 --- a/kstars/kstars/kscomet.cpp +++ b/kstars/kstars/kscomet.cpp @@ -24,7 +24,7 @@ #include "kscomet.h" -KSComet::KSComet( KStarsData *_kd, QString _s, QString imfile, +KSComet::KSComet( KStarsData *_kd, TQString _s, TQString imfile, long double _JD, double _q, double _e, dms _i, dms _w, dms _Node, double Tp ) : KSPlanetBase(_kd, _s, imfile), kd(_kd), JD(_JD), q(_q), e(_e), i(_i), w(_w), N(_Node) { @@ -40,7 +40,7 @@ KSComet::KSComet( KStarsData *_kd, QString _s, QString imfile, int m = int( 60.0 * ( Hour - h ) ); int s = int( 60.0 * ( 60.0 * ( Hour - h) - m ) ); - JDp = KStarsDateTime( ExtDate( year, month, day ), QTime( h, m, s ) ).djd(); + JDp = KStarsDateTime( ExtDate( year, month, day ), TQTime( h, m, s ) ).djd(); //compute the semi-major axis, a: a = q/(1.0-e); diff --git a/kstars/kstars/kscomet.h b/kstars/kstars/kscomet.h index 62a26458..a6089ec3 100644 --- a/kstars/kstars/kscomet.h +++ b/kstars/kstars/kscomet.h @@ -60,7 +60,7 @@ class KSComet : public KSPlanetBase *@p M the mean anomaly for the Julian Day *@p Tp The date of the most proximate perihelion passage (YYYYMMDD.DDD) */ - KSComet( KStarsData *kd, QString s, QString image_file, + KSComet( KStarsData *kd, TQString s, TQString image_file, long double JD, double q, double e, dms i, dms w, dms N, double Tp ); /**Destructor (empty)*/ diff --git a/kstars/kstars/ksfilereader.cpp b/kstars/kstars/ksfilereader.cpp index 565cdf1b..4e2542ec 100644 --- a/kstars/kstars/ksfilereader.cpp +++ b/kstars/kstars/ksfilereader.cpp @@ -15,17 +15,17 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include "ksfilereader.h" -KSFileReader::KSFileReader(QFile& file) { +KSFileReader::KSFileReader(TQFile& file) { // read the whole file at once. This works well at least for the smaller files. - QByteArray data = file.readAll(); - QString sAll = QString::fromUtf8( data.data(), data.size() ); + TQByteArray data = file.readAll(); + TQString sAll = TQString::fromUtf8( data.data(), data.size() ); // split into list of lines - lines = QStringList::split( "\n", sAll ); + lines = TQStringList::split( "\n", sAll ); // how many lines did we get? numLines = lines.size(); // set index to start @@ -41,7 +41,7 @@ bool KSFileReader::hasMoreLines() { return (curLine < numLines); } -QString& KSFileReader::readLine(){ +TQString& KSFileReader::readLine(){ // hint: use curLine as index, after that increment curLine // This means that the programming language c++ should better be renamed to ++c, // otherwise the name means: improve the c programming language, but use it the diff --git a/kstars/kstars/ksfilereader.h b/kstars/kstars/ksfilereader.h index 25c56b96..005d6987 100644 --- a/kstars/kstars/ksfilereader.h +++ b/kstars/kstars/ksfilereader.h @@ -18,11 +18,11 @@ #ifndef KSFILEREADER_H #define KSFILEREADER_H -#include -#include +#include +#include /**@class KSFileReader - *This class will read an entire file into a QStringList, where each item + *This class will read an entire file into a TQStringList, where each item *in the list is a line in the file. It can then access each line in the *list very quickly. *@author Heiko Evermann @@ -32,13 +32,13 @@ class QFile; class QString; -class KSFileReader : public QObject { +class KSFileReader : public TQObject { Q_OBJECT public: - /**Constructor. Read an entire file into a QStringList object. + /**Constructor. Read an entire file into a TQStringList object. *@p file the file to be read */ - KSFileReader( QFile& file); + KSFileReader( TQFile& file); /**Destructor*/ ~KSFileReader(); @@ -48,9 +48,9 @@ public: bool hasMoreLines(); /**Read a line from the file, and increment the "current line" counter. - *@return the line that we read, as a QString. + *@return the line that we read, as a TQString. */ - QString& readLine(); + TQString& readLine(); /**Go to a specific line in the file. *@p i the line number to skip to. @@ -59,7 +59,7 @@ public: private: /** After loading the whole file, we split it into lines and keep them here. */ - QStringList lines; + TQStringList lines; /** How many lines do we have in the file? */ int numLines; /** Which line are we at? */ diff --git a/kstars/kstars/ksmoon.cpp b/kstars/kstars/ksmoon.cpp index d63cc319..86c6fcd0 100644 --- a/kstars/kstars/ksmoon.cpp +++ b/kstars/kstars/ksmoon.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "ksnumbers.h" #include "ksutils.h" @@ -36,22 +36,22 @@ KSMoon::~KSMoon() { } bool KSMoon::data_loaded = false; -QPtrList KSMoon::LRData; -QPtrList KSMoon::BData; +TQPtrList KSMoon::LRData; +TQPtrList KSMoon::BData; bool KSMoon::loadData() { if (data_loaded) return true; - QString line; - QFile f; + TQString line; + TQFile f; int nd, nm, nm1, nf; double Li, Ri, Bi; //coefficients of the sums if ( KSUtils::openDataFile( f, "moonLR.dat" ) ) { - QTextStream stream( &f ); + TQTextStream stream( &f ); while ( !stream.eof() ) { line = stream.readLine(); - QTextIStream instream( &line ); + TQTextIStream instream( &line ); instream >> nd >> nm >> nm1 >> nf >> Li >> Ri; LRData.append(new MoonLRData(nd, nm, nm1, nf, Li, Ri)); } @@ -61,10 +61,10 @@ bool KSMoon::loadData() { if ( KSUtils::openDataFile( f, "moonB.dat" ) ) { - QTextStream stream( &f ); + TQTextStream stream( &f ); while ( !stream.eof() ) { line = stream.readLine(); - QTextIStream instream( &line ); + TQTextIStream instream( &line ); instream >> nd >> nm >> nm1 >> nf >> Bi; BData.append(new MoonBData(nd, nm, nm1, nf, Bi)); } @@ -78,8 +78,8 @@ bool KSMoon::loadData() { bool KSMoon::findGeocentricPosition( const KSNumbers *num, const KSPlanetBase* ) { //Algorithms in this subroutine are taken from Chapter 45 of "Astronomical Algorithms" //by Jean Meeus (1991, Willmann-Bell, Inc. ISBN 0-943396-35-2. http://www.willbell.com/math/mc1.htm) - QString fname, snum, line; - QFile f; + TQString fname, snum, line; + TQFile f; double DegtoRad; double T, L, D, M, M1, F, E, A1, A2, A3; double sumL, sumR, sumB; @@ -182,11 +182,11 @@ void KSMoon::findPhase( const KSSun *Sun ) { Phase.setD( Phase.reduce().Degrees() ); int iPhase = int( 0.1*Phase.Degrees()+0.5 ); if (iPhase==36) iPhase = 0; - QString sPhase; + TQString sPhase; sPhase = sPhase.sprintf( "%02d", iPhase ); - QString imName = "moon" + sPhase + ".png"; + TQString imName = "moon" + sPhase + ".png"; - QFile imFile; + TQFile imFile; if ( KSUtils::openDataFile( imFile, imName ) ) { imFile.close(); image0()->load( imFile.name() ); @@ -195,7 +195,7 @@ void KSMoon::findPhase( const KSSun *Sun ) { } } -QString KSMoon::phaseName() const { +TQString KSMoon::phaseName() const { double f = illum(); double p = phase().Degrees(); diff --git a/kstars/kstars/ksmoon.h b/kstars/kstars/ksmoon.h index 80f65c3e..ad424d73 100644 --- a/kstars/kstars/ksmoon.h +++ b/kstars/kstars/ksmoon.h @@ -61,7 +61,7 @@ public: /**@return a short string describing the moon's phase */ - QString phaseName( void ) const; + TQString phaseName( void ) const; /** reimplemented from KSPlanetBase */ @@ -106,7 +106,7 @@ private: nd(pnd), nm(pnm), nm1(pnm1), nf(pnf), Li(pLi), Ri(pRi) {} }; - static QPtrList LRData; + static TQPtrList LRData; /**@class MoonBData *Encapsulates the Latitude terms of the sums @@ -127,7 +127,7 @@ private: nd(pnd), nm(pnm), nm1(pnm1), nf(pnf), Bi(pBi) {} }; - static QPtrList BData; + static TQPtrList BData; }; #endif diff --git a/kstars/kstars/ksnewstuff.cpp b/kstars/kstars/ksnewstuff.cpp index 591b5e50..e416388e 100644 --- a/kstars/kstars/ksnewstuff.cpp +++ b/kstars/kstars/ksnewstuff.cpp @@ -26,9 +26,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "ksnewstuff.h" #include "kstars.h" @@ -37,15 +37,15 @@ #include "objectnamelist.h" #include "skymap.h" -KSNewStuff::KSNewStuff( QWidget *parent ) : - QObject(), KNewStuff( "kstars", parent ), NGCUpdated( false ) +KSNewStuff::KSNewStuff( TQWidget *parent ) : + TQObject(), KNewStuff( "kstars", parent ), NGCUpdated( false ) { ks = (KStars*)parent; kdw = new KDirWatch( this ); kdw->addDir( KGlobal::dirs()->saveLocation("data", kapp->instanceName(), true) ); } -bool KSNewStuff::install( const QString &fileName ) +bool KSNewStuff::install( const TQString &fileName ) { kdDebug() << "KSNewStuff::install(): " << fileName << endl; @@ -54,11 +54,11 @@ bool KSNewStuff::install( const QString &fileName ) return false; const KArchiveDirectory *archiveDir = archive.directory(); - const QString destDir = KGlobal::dirs()->saveLocation("data", kapp->instanceName(), true); + const TQString destDir = KGlobal::dirs()->saveLocation("data", kapp->instanceName(), true); KStandardDirs::makeDir( destDir ); //monitor destDir for changes; inform updateData when files are created. - connect( kdw, SIGNAL( dirty( const QString & ) ), this, SLOT( updateData( const QString & ) ) ); + connect( kdw, TQT_SIGNAL( dirty( const TQString & ) ), this, TQT_SLOT( updateData( const TQString & ) ) ); archiveDir->copyTo(destDir); archive.close(); @@ -69,13 +69,13 @@ bool KSNewStuff::install( const QString &fileName ) return true; } -void KSNewStuff::updateData( const QString &path ) { - QDir qd( path ); - qd.setSorting( QDir::Time ); - qd.setFilter( QDir::Files ); +void KSNewStuff::updateData( const TQString &path ) { + TQDir qd( path ); + qd.setSorting( TQDir::Time ); + qd.setFilter( TQDir::Files ); //Show the Wait cursor - ks->setCursor(QCursor(Qt::WaitCursor)); + ks->setCursor(TQCursor(Qt::WaitCursor)); //Handle the Steinicke NGC/IC catalog @@ -105,8 +105,8 @@ void KSNewStuff::updateData( const QString &path ) { ks->data()->deepSkyList.clear(); //Send progress messages to the console - connect( ks->data(), SIGNAL( progressText(QString) ), ks->data(), SLOT( slotConsoleMessage(QString) ) ); - connect( ks->data(), SIGNAL( progressText(QString) ), ks->data(), SLOT( slotProcessEvents() ) ); + connect( ks->data(), TQT_SIGNAL( progressText(TQString) ), ks->data(), TQT_SLOT( slotConsoleMessage(TQString) ) ); + connect( ks->data(), TQT_SIGNAL( progressText(TQString) ), ks->data(), TQT_SLOT( slotProcessEvents() ) ); //We are now ready to read the new NGC/IC catalog ks->data()->readDeepSkyData(); @@ -150,7 +150,7 @@ void KSNewStuff::updateData( const QString &path ) { ks->data()->cometList.clear(); //Send progress messages to the console - connect( ks->data(), SIGNAL( progressText(QString) ), ks->data(), SLOT( slotConsoleMessage(QString) ) ); + connect( ks->data(), TQT_SIGNAL( progressText(TQString) ), ks->data(), TQT_SLOT( slotConsoleMessage(TQString) ) ); //add new asteroids and comets ks->data()->readAsteroidData(); @@ -163,7 +163,7 @@ void KSNewStuff::updateData( const QString &path ) { } //Restore arrow cursor - ks->setCursor(QCursor(Qt::ArrowCursor)); + ks->setCursor(TQCursor(Qt::ArrowCursor)); } void KSNewStuff::slotProcessEvents() { kapp->processEvents( 500 ); } diff --git a/kstars/kstars/ksnewstuff.h b/kstars/kstars/ksnewstuff.h index 1578ed95..fc653e55 100644 --- a/kstars/kstars/ksnewstuff.h +++ b/kstars/kstars/ksnewstuff.h @@ -36,14 +36,14 @@ #include #include -#include +#include #include class KDirWatch; class KStars; -class KSNewStuff : public QObject, public KNewStuff +class KSNewStuff : public TQObject, public KNewStuff { Q_OBJECT public: @@ -51,21 +51,21 @@ class KSNewStuff : public QObject, public KNewStuff *Constructor *@p parent pointer to the parent widget */ - KSNewStuff( QWidget *parent = 0 ); + KSNewStuff( TQWidget *parent = 0 ); /** *Install new application data *@p fileName the name of the file to be installed *@note overloaded from KNewStuff */ - bool install( const QString &fileName ); + bool install( const TQString &fileName ); /** *Upload a data file *@p fileName The file to upload *@note this function is not yet implemented, and is just a placeholder */ - bool createUploadFile( const QString & /*fileName*/ ) { + bool createUploadFile( const TQString & /*fileName*/ ) { kdDebug() << i18n( "Uploading data is not possible yet!" ); return false; } @@ -76,7 +76,7 @@ class KSNewStuff : public QObject, public KNewStuff *This slot is called whenever files are added to the data directory *@p newFile The name of the file that was just added to the data directory */ - void updateData( const QString &newFile ); + void updateData( const TQString &newFile ); /** *Simply calls kapp->processEvents(), to make the UI responsive while diff --git a/kstars/kstars/ksplanet.cpp b/kstars/kstars/ksplanet.cpp index 1118e218..497ff88c 100644 --- a/kstars/kstars/ksplanet.cpp +++ b/kstars/kstars/ksplanet.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include "ksplanet.h" #include "ksnumbers.h" @@ -41,28 +41,28 @@ KSPlanet::OrbitDataManager::OrbitDataManager() : dict(31, true) { dict.setAutoDelete(true); } -bool KSPlanet::OrbitDataManager::readOrbitData(QString fname, - QPtrVector *vector) { - QString line; - QFile f; +bool KSPlanet::OrbitDataManager::readOrbitData(TQString fname, + TQPtrVector *vector) { + TQString line; + TQFile f; double A, B, C; - QPtrList DData; + TQPtrList DData; if ( KSUtils::openDataFile( f, fname ) ) { KSFileReader fileReader( f ); // close file is included while ( fileReader.hasMoreLines() ) { line = fileReader.readLine(); - QTextIStream instream( &line ); + TQTextIStream instream( &line ); instream >> A >> B >> C; DData.append(new OrbitData(A, B, C)); } /* old code - QTextStream stream( &f ); + TQTextStream stream( &f ); while ( !stream.eof() ) { line = stream.readLine(); - QTextIStream instream( &line ); + TQTextIStream instream( &line ); instream >> A >> B >> C; DData.append(new OrbitData(A, B, C)); @@ -78,9 +78,9 @@ bool KSPlanet::OrbitDataManager::readOrbitData(QString fname, return true; } -KSPlanet::OrbitDataColl *KSPlanet::OrbitDataManager::loadData(QString n) { - QString fname, snum, line; - QFile f; +KSPlanet::OrbitDataColl *KSPlanet::OrbitDataManager::loadData(TQString n) { + TQString fname, snum, line; + TQFile f; int nCount = 0; OrbitDataColl *ret; @@ -144,7 +144,7 @@ KSPlanet::OrbitDataColl *KSPlanet::OrbitDataManager::loadData(QString n) { return ret; } -KSPlanet::KSPlanet( KStarsData *kd, QString s, QString imfile, double pSize ) +KSPlanet::KSPlanet( KStarsData *kd, TQString s, TQString imfile, double pSize ) : KSPlanetBase(kd, s, imfile, pSize ), data_loaded(false) { } diff --git a/kstars/kstars/ksplanet.h b/kstars/kstars/ksplanet.h index 7f3603da..c30e40e7 100644 --- a/kstars/kstars/ksplanet.h +++ b/kstars/kstars/ksplanet.h @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include "ksplanetbase.h" #include "dms.h" @@ -52,7 +52,7 @@ public: * *@todo figure out what @p kd does. */ - KSPlanet( KStarsData *kd, QString s="unnamed", QString image_file="", double pSize=0 ); + KSPlanet( KStarsData *kd, TQString s="unnamed", TQString image_file="", double pSize=0 ); /**Destructor (empty) */ @@ -101,9 +101,9 @@ protected: double A, B, C; }; - typedef QPtrVector OBArray[6]; + typedef TQPtrVector OBArray[6]; -/**OrbitDataColl contains three groups of six QPtrVectors. Each QPtrVector is a +/**OrbitDataColl contains three groups of six QPtrVectors. Each TQPtrVector is a *list of OrbitData objects, representing a single sum used in computing *the planet's position. A set of six of these vectors comprises the large *"meta-sum" which yields the planet's Longitude, Latitude, or Distance value. @@ -139,7 +139,7 @@ protected: *@p n the name of the planet whose data is to be loaded from disk. *@return pointer to the OrbitDataColl containing the planet's orbital data. */ - OrbitDataColl *loadData(QString n); + OrbitDataColl *loadData(TQString n); private: /**Read a single orbital data file from disk into an OrbitData vector. @@ -148,9 +148,9 @@ protected: *@p fname the filename to be read. *@p vector pointer to the OrbitData vector to be filled with these data. */ - bool readOrbitData(QString fname, QPtrVector *vector); + bool readOrbitData(TQString fname, TQPtrVector *vector); - QDict dict; + TQDict dict; }; static OrbitDataManager odm; diff --git a/kstars/kstars/ksplanetbase.cpp b/kstars/kstars/ksplanetbase.cpp index 4eb92f03..469c5307 100644 --- a/kstars/kstars/ksplanetbase.cpp +++ b/kstars/kstars/ksplanetbase.cpp @@ -17,9 +17,9 @@ #include -#include -#include -#include +#include +#include +#include #include "ksplanetbase.h" #include "ksplanet.h" @@ -29,11 +29,11 @@ #include "kspopupmenu.h" -KSPlanetBase::KSPlanetBase( KStarsData *kd, QString s, QString image_file, double pSize ) +KSPlanetBase::KSPlanetBase( KStarsData *kd, TQString s, TQString image_file, double pSize ) : SkyObject( 2, 0.0, 0.0, 0.0, s, "" ), Rearth(0.0), Image(0), data(kd) { if (! image_file.isEmpty()) { - QFile imFile; + TQFile imFile; if ( KSUtils::openDataFile( imFile, image_file ) ) { imFile.close(); @@ -185,14 +185,14 @@ void KSPlanetBase::findPA( const KSNumbers *num ) { void KSPlanetBase::rotateImage( double imAngle ) { ImageAngle = imAngle; - QWMatrix m; + TQWMatrix m; m.rotate( ImageAngle ); Image = Image0.xForm( m ); } void KSPlanetBase::scaleRotateImage( int scale, double imAngle ) { ImageAngle = imAngle; - QWMatrix m; + TQWMatrix m; m.rotate( ImageAngle ); Image = Image0.xForm( m ).smoothScale( scale, scale ); } diff --git a/kstars/kstars/ksplanetbase.h b/kstars/kstars/ksplanetbase.h index 6d29c8ad..0c15a1a5 100644 --- a/kstars/kstars/ksplanetbase.h +++ b/kstars/kstars/ksplanetbase.h @@ -19,9 +19,9 @@ #ifndef KSPLANETBASE_H #define KSPLANETBASE_H -#include -#include -#include +#include +#include +#include #include @@ -80,7 +80,7 @@ public: * *@todo Figure out what @p kd does. */ - KSPlanetBase( KStarsData *kd, QString s = i18n("unnamed"), QString image_file="", double pSize=0 ); + KSPlanetBase( KStarsData *kd, TQString s = i18n("unnamed"), TQString image_file="", double pSize=0 ); /** *Destructor (empty) @@ -166,11 +166,11 @@ public: /**@return pointer to image of planet */ - QImage* image( void ) { return &Image; } + TQImage* image( void ) { return &Image; } /**@return pointer to unrotated image of planet */ - QImage* image0( void ) { return &Image0; } + TQImage* image0( void ) { return &Image0; } /**@return distance from Sun, in Astronomical Units (1 AU is Earth-Sun distance) */ @@ -249,7 +249,7 @@ public: /**@return a reference to the planet's trail */ - QPtrList* trail() { return &Trail; } + TQPtrList* trail() { return &Trail; } /**@short adds a point to the planet's trail */ @@ -283,10 +283,10 @@ public: *@param pmenu pointer to the KSPopupMenu object *@param pos QPojnt holding the x,y coordinates for the menu */ - virtual void showPopupMenu( KSPopupMenu *pmenu, QPoint pos ) { pmenu->createPlanetMenu( this ); pmenu->popup( pos ); } + virtual void showPopupMenu( KSPopupMenu *pmenu, TQPoint pos ) { pmenu->createPlanetMenu( this ); pmenu->popup( pos ); } protected: - virtual bool loadData(QString n) { + virtual bool loadData(TQString n) { kdDebug() << "didn't reimplement for " << n << endl; return false; } @@ -311,7 +311,7 @@ protected: // Heliocentric ecliptic position referred to the equinox of the epoch // as obtained from VSOP. EclipticPosition helEcPos; - QPtrList Trail; + TQPtrList Trail; double Rearth; private: @@ -333,7 +333,7 @@ private: */ void findMagnitude(const KSNumbers *num); - QImage Image0, Image; + TQImage Image0, Image; double PositionAngle, ImageAngle, AngularSize, PhysicalSize; KStarsData *data; }; diff --git a/kstars/kstars/kspluto.cpp b/kstars/kstars/kspluto.cpp index 558c265c..c544b528 100644 --- a/kstars/kstars/kspluto.cpp +++ b/kstars/kstars/kspluto.cpp @@ -17,7 +17,7 @@ #include -#include +#include #include #include "kspluto.h" @@ -29,7 +29,7 @@ #undef B0 #endif -KSPluto::KSPluto(KStarsData *kd, QString fn, double pSize ) +KSPluto::KSPluto(KStarsData *kd, TQString fn, double pSize ) : KSAsteroid( kd, I18N_NOOP( "Pluto" ), fn, J2000, 39.48168677, 0.24880766, dms(17.14175), dms(113.76329), dms(110.30347), dms(14.86205), 1.0 ) { diff --git a/kstars/kstars/kspluto.h b/kstars/kstars/kspluto.h index 55e1224e..b30b5a54 100644 --- a/kstars/kstars/kspluto.h +++ b/kstars/kstars/kspluto.h @@ -49,7 +49,7 @@ public: *@p fn filename of Pluto's image *@p pSize physical diameter of Pluto, in km */ - KSPluto(KStarsData *kd, QString fn="", double pSize=0); + KSPluto(KStarsData *kd, TQString fn="", double pSize=0); /**Destructor (empty) */ virtual ~KSPluto(); diff --git a/kstars/kstars/kspopupmenu.cpp b/kstars/kstars/kspopupmenu.cpp index 53804035..5f1a7829 100644 --- a/kstars/kstars/kspopupmenu.cpp +++ b/kstars/kstars/kspopupmenu.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include "kspopupmenu.h" #include "kstars.h" @@ -32,7 +32,7 @@ #include "indigroup.h" #include "indiproperty.h" -KSPopupMenu::KSPopupMenu( QWidget *parent, const char *name ) +KSPopupMenu::KSPopupMenu( TQWidget *parent, const char *name ) : KPopupMenu( parent, name ) { ksw = ( KStars* )parent; @@ -43,10 +43,10 @@ KSPopupMenu::~KSPopupMenu() } void KSPopupMenu::createEmptyMenu( SkyObject *nullObj ) { - initPopupMenu( nullObj, i18n( "Empty sky" ), QString::null, QString::null, true, true, false, false, false, true, false ); + initPopupMenu( nullObj, i18n( "Empty sky" ), TQString::null, TQString::null, true, true, false, false, false, true, false ); - insertItem( i18n( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ksw->map(), SLOT( slotDSS() ) ); - insertItem( i18n( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ksw->map(), SLOT( slotDSS2() ) ); + insertItem( i18n( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ksw->map(), TQT_SLOT( slotDSS() ) ); + insertItem( i18n( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ksw->map(), TQT_SLOT( slotDSS2() ) ); } void KSPopupMenu::createStarMenu( StarObject *star ) { @@ -58,14 +58,14 @@ void KSPopupMenu::createStarMenu( StarObject *star ) { if ( star->name() != "star" ) { addLinksToMenu( star ); } else { - insertItem( i18n( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ksw->map(), SLOT( slotDSS() ) ); - insertItem( i18n( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ksw->map(), SLOT( slotDSS2() ) ); + insertItem( i18n( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ksw->map(), TQT_SLOT( slotDSS() ) ); + insertItem( i18n( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ksw->map(), TQT_SLOT( slotDSS2() ) ); } } void KSPopupMenu::createDeepSkyObjectMenu( SkyObject *obj ) { - QString TypeName = ksw->data()->TypeName[ obj->type() ]; - QString secondName = obj->translatedName2(); + TQString TypeName = ksw->data()->TypeName[ obj->type() ]; + TQString secondName = obj->translatedName2(); if ( obj->longname() != obj->name() ) secondName = obj->translatedLongName(); initPopupMenu( obj, obj->translatedName(), secondName, TypeName ); @@ -73,8 +73,8 @@ void KSPopupMenu::createDeepSkyObjectMenu( SkyObject *obj ) { } void KSPopupMenu::createCustomObjectMenu( SkyObject *obj ) { - QString TypeName = ksw->data()->TypeName[ obj->type() ]; - QString secondName = obj->translatedName2(); + TQString TypeName = ksw->data()->TypeName[ obj->type() ]; + TQString secondName = obj->translatedName2(); if ( obj->longname() != obj->name() ) secondName = obj->translatedLongName(); initPopupMenu( obj, obj->translatedName(), secondName, TypeName ); @@ -84,7 +84,7 @@ void KSPopupMenu::createCustomObjectMenu( SkyObject *obj ) { void KSPopupMenu::createPlanetMenu( SkyObject *p ) { bool addTrail( ! ((KSPlanetBase*)p)->hasTrail() ); - QString oname = ""; + TQString oname = ""; if ( p->name() == "Moon" ) { oname = ((KSMoon *)p)->phaseName(); } @@ -93,8 +93,8 @@ void KSPopupMenu::createPlanetMenu( SkyObject *p ) { } void KSPopupMenu::addLinksToMenu( SkyObject *obj, bool showDSS, bool allowCustom ) { - QString sURL; - QStringList::Iterator itList, itTitle, itListEnd; + TQString sURL; + TQStringList::Iterator itList, itTitle, itListEnd; itList = obj->ImageList.begin(); itTitle = obj->ImageTitle.begin(); @@ -102,15 +102,15 @@ void KSPopupMenu::addLinksToMenu( SkyObject *obj, bool showDSS, bool allowCustom int id = 100; for ( ; itList != itListEnd; ++itList ) { - QString t = QString(*itTitle); - sURL = QString(*itList); - insertItem( i18n( "Image/info menu item (should be translated)", t.local8Bit() ), ksw->map(), SLOT( slotImage( int ) ), 0, id++ ); + TQString t = TQString(*itTitle); + sURL = TQString(*itList); + insertItem( i18n( "Image/info menu item (should be translated)", t.local8Bit() ), ksw->map(), TQT_SLOT( slotImage( int ) ), 0, id++ ); ++itTitle; } if ( showDSS ) { - insertItem( i18n( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ksw->map(), SLOT( slotDSS() ) ); - insertItem( i18n( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ksw->map(), SLOT( slotDSS2() ) ); + insertItem( i18n( "First Generation Digitized Sky Survey", "Show 1st-Gen DSS Image" ), ksw->map(), TQT_SLOT( slotDSS() ) ); + insertItem( i18n( "Second Generation Digitized Sky Survey", "Show 2nd-Gen DSS Image" ), ksw->map(), TQT_SLOT( slotDSS2() ) ); insertSeparator(); } else if ( obj->ImageList.count() ) insertSeparator(); @@ -121,15 +121,15 @@ void KSPopupMenu::addLinksToMenu( SkyObject *obj, bool showDSS, bool allowCustom id = 200; for ( ; itList != itListEnd; ++itList ) { - QString t = QString(*itTitle); - sURL = QString(*itList); - insertItem( i18n( "Image/info menu item (should be translated)", t.local8Bit() ), ksw->map(), SLOT( slotInfo( int ) ), 0, id++ ); + TQString t = TQString(*itTitle); + sURL = TQString(*itList); + insertItem( i18n( "Image/info menu item (should be translated)", t.local8Bit() ), ksw->map(), TQT_SLOT( slotInfo( int ) ), 0, id++ ); ++itTitle; } if ( allowCustom ) { insertSeparator(); - insertItem( i18n( "Add Link..." ), ksw->map(), SLOT( addLink() ), 0, id++ ); + insertItem( i18n( "Add Link..." ), ksw->map(), TQT_SLOT( addLink() ), 0, id++ ); } } @@ -201,7 +201,7 @@ bool KSPopupMenu::addINDI(void) } } - QObject::connect(menuDevice, SIGNAL(activated(int)), prop, SLOT (convertSwitch(int))); + TQObject::connect(menuDevice, TQT_SIGNAL(activated(int)), prop, TQT_SLOT (convertSwitch(int))); } // end property } // end group @@ -217,7 +217,7 @@ bool KSPopupMenu::addINDI(void) prop = dev->findElem("ALT")->pp; prop->assosiatedPopup = menuDevice; - QObject::connect(menuDevice, SIGNAL(activated(int)), prop, SLOT(convertSwitch(int))); + TQObject::connect(menuDevice, TQT_SIGNAL(activated(int)), prop, TQT_SLOT(convertSwitch(int))); } } // end device @@ -226,7 +226,7 @@ bool KSPopupMenu::addINDI(void) return true; } -void KSPopupMenu::initPopupMenu( SkyObject *obj, QString s1, QString s2, QString s3, +void KSPopupMenu::initPopupMenu( SkyObject *obj, TQString s1, TQString s2, TQString s3, bool showRiseSet, bool showCenterTrack, bool showDetails, bool showTrail, bool addTrail, bool showAngularDistance, bool showObsList ) { @@ -236,47 +236,47 @@ void KSPopupMenu::initPopupMenu( SkyObject *obj, QString s1, QString s2, QString bool showLabel( true ); if ( s1 == i18n( "star" ) || s1 == i18n( "Empty sky" ) ) showLabel = false; - pmTitle = new QLabel( s1, this ); + pmTitle = new TQLabel( s1, this ); pmTitle->setAlignment( AlignCenter ); - QPalette pal( pmTitle->palette() ); - pal.setColor( QPalette::Normal, QColorGroup::Background, pal.color( QPalette::Normal, QColorGroup::Base ) ); - pal.setColor( QPalette::Normal, QColorGroup::Foreground, pal.color( QPalette::Normal, QColorGroup::Text ) ); + TQPalette pal( pmTitle->palette() ); + pal.setColor( TQPalette::Normal, TQColorGroup::Background, pal.color( TQPalette::Normal, TQColorGroup::Base ) ); + pal.setColor( TQPalette::Normal, TQColorGroup::Foreground, pal.color( TQPalette::Normal, TQColorGroup::Text ) ); pmTitle->setPalette( pal ); insertItem( pmTitle ); if ( ! s2.isEmpty() ) { - pmTitle2 = new QLabel( s2, this ); + pmTitle2 = new TQLabel( s2, this ); pmTitle2->setAlignment( AlignCenter ); pmTitle2->setPalette( pal ); insertItem( pmTitle2 ); } if ( ! s3.isEmpty() ) { - pmType = new QLabel( s3, this ); + pmType = new TQLabel( s3, this ); pmType->setAlignment( AlignCenter ); pmType->setPalette( pal ); insertItem( pmType ); } - QString c = obj->constellation( ksw->data()->csegmentList, ksw->data()->cnameList ); - pmConstellation = new QLabel( c, this ); + TQString c = obj->constellation( ksw->data()->csegmentList, ksw->data()->cnameList ); + pmConstellation = new TQLabel( c, this ); pmConstellation->setAlignment( AlignCenter ); pmConstellation->setPalette( pal ); insertItem( pmConstellation ); //Insert Rise/Set/Transit labels if ( showRiseSet && obj ) { - pmRiseTime = new QLabel( i18n( "Rise time: 00:00" ), this ); + pmRiseTime = new TQLabel( i18n( "Rise time: 00:00" ), this ); pmRiseTime->setAlignment( AlignCenter ); pmRiseTime->setPalette( pal ); - QFont rsFont = pmRiseTime->font(); + TQFont rsFont = pmRiseTime->font(); rsFont.setPointSize( rsFont.pointSize() - 2 ); pmRiseTime->setFont( rsFont ); - pmSetTime = new QLabel( i18n( "the time at which an object falls below the horizon", "Set time:" ) + " 00:00", this ); + pmSetTime = new TQLabel( i18n( "the time at which an object falls below the horizon", "Set time:" ) + " 00:00", this ); pmSetTime->setAlignment( AlignCenter ); pmSetTime->setPalette( pal ); pmSetTime->setFont( rsFont ); - pmTransitTime = new QLabel( i18n( "Transit time: 00:00" ), this ); + pmTransitTime = new TQLabel( i18n( "Transit time: 00:00" ), this ); pmTransitTime->setAlignment( AlignCenter ); pmTransitTime->setPalette( pal ); pmTransitTime->setFont( rsFont ); @@ -291,15 +291,15 @@ void KSPopupMenu::initPopupMenu( SkyObject *obj, QString s1, QString s2, QString //Insert item for centering on object if ( showCenterTrack && obj ) { insertSeparator(); - insertItem( i18n( "Center && Track" ), ksw->map(), SLOT( slotCenter() ) ); + insertItem( i18n( "Center && Track" ), ksw->map(), TQT_SLOT( slotCenter() ) ); } //Insert item for measuring distances if ( showAngularDistance && obj ) { if (! (ksw->map()->isAngleMode()) ) { - insertItem( i18n( "Angular Distance To... [" ), ksw->map(), SLOT( slotBeginAngularDistance() ) ); + insertItem( i18n( "Angular Distance To... [" ), ksw->map(), TQT_SLOT( slotBeginAngularDistance() ) ); } else { - insertItem( i18n( "Compute Angular Distance ]" ), ksw->map(), SLOT( slotEndAngularDistance() ) ); + insertItem( i18n( "Compute Angular Distance ]" ), ksw->map(), TQT_SLOT( slotEndAngularDistance() ) ); } } @@ -307,30 +307,30 @@ void KSPopupMenu::initPopupMenu( SkyObject *obj, QString s1, QString s2, QString //Insert item for Showing details dialog if ( showDetails && obj ) { - insertItem( i18n( "Show Detailed Information Dialog", "Details" ), ksw->map(), SLOT( slotDetail() ) ); + insertItem( i18n( "Show Detailed Information Dialog", "Details" ), ksw->map(), TQT_SLOT( slotDetail() ) ); } //Insert "Add/Remove Label" item if ( showLabel && obj ) { if ( ksw->map()->isObjectLabeled( obj ) ) { - insertItem( i18n( "Remove Label" ), ksw->map(), SLOT( slotRemoveObjectLabel() ) ); + insertItem( i18n( "Remove Label" ), ksw->map(), TQT_SLOT( slotRemoveObjectLabel() ) ); } else { - insertItem( i18n( "Attach Label" ), ksw->map(), SLOT( slotAddObjectLabel() ) ); + insertItem( i18n( "Attach Label" ), ksw->map(), TQT_SLOT( slotAddObjectLabel() ) ); } } if ( showObsList && obj ) { if ( ksw->observingList()->contains( obj ) ) - insertItem( i18n("Remove From List"), ksw->observingList(), SLOT( slotRemoveObject() ) ); + insertItem( i18n("Remove From List"), ksw->observingList(), TQT_SLOT( slotRemoveObject() ) ); else - insertItem( i18n("Add to List"), ksw->observingList(), SLOT( slotAddObject() ) ); + insertItem( i18n("Add to List"), ksw->observingList(), TQT_SLOT( slotAddObject() ) ); } if ( showTrail && obj && obj->isSolarSystem() ) { if ( addTrail ) { - insertItem( i18n( "Add Trail" ), ksw->map(), SLOT( slotAddPlanetTrail() ) ); + insertItem( i18n( "Add Trail" ), ksw->map(), TQT_SLOT( slotAddPlanetTrail() ) ); } else { - insertItem( i18n( "Remove Trail" ), ksw->map(), SLOT( slotRemovePlanetTrail() ) ); + insertItem( i18n( "Remove Trail" ), ksw->map(), TQT_SLOT( slotRemovePlanetTrail() ) ); } } @@ -343,8 +343,8 @@ void KSPopupMenu::initPopupMenu( SkyObject *obj, QString s1, QString s2, QString void KSPopupMenu::setRiseSetLabels( SkyObject *obj ) { if ( ! obj ) return; - QString rt, rt2, rt3; - QTime rtime = obj->riseSetTime( ksw->data()->ut(), ksw->geo(), true ); + TQString rt, rt2, rt3; + TQTime rtime = obj->riseSetTime( ksw->data()->ut(), ksw->geo(), true ); dms rAz = obj->riseSetTimeAz( ksw->data()->ut(), ksw->geo(), true ); if ( rtime.isValid() ) { @@ -358,9 +358,9 @@ void KSPopupMenu::setRiseSetLabels( SkyObject *obj ) { } KStarsDateTime dt = ksw->data()->ut(); - QTime stime = obj->riseSetTime( dt, ksw->geo(), false ); + TQTime stime = obj->riseSetTime( dt, ksw->geo(), false ); - QString st, st2, st3; + TQString st, st2, st3; dms sAz = obj->riseSetTimeAz( dt, ksw->geo(), false ); if ( stime.isValid() ) { @@ -373,9 +373,9 @@ void KSPopupMenu::setRiseSetLabels( SkyObject *obj ) { st = i18n( "No set time: Never rises" ); } - QTime ttime = obj->transitTime( dt, ksw->geo() ); + TQTime ttime = obj->transitTime( dt, ksw->geo() ); dms trAlt = obj->transitAltitude( dt, ksw->geo() ); - QString tt, tt2, tt3; + TQString tt, tt2, tt3; if ( ttime.isValid() ) { //We can round to the nearest minute by simply adding 30 seconds to the time. diff --git a/kstars/kstars/kspopupmenu.h b/kstars/kstars/kspopupmenu.h index a91d8307..ebf34842 100644 --- a/kstars/kstars/kspopupmenu.h +++ b/kstars/kstars/kspopupmenu.h @@ -41,7 +41,7 @@ class KSPopupMenu : public KPopupMenu Q_OBJECT public: /**Default constructor*/ - KSPopupMenu( QWidget *parent = 0, const char *name = 0 ); + KSPopupMenu( TQWidget *parent = 0, const char *name = 0 ); /**Destructor (empty)*/ ~KSPopupMenu(); @@ -62,7 +62,7 @@ public: *@param showAngularDistance if true, the Angular Distance item is added. *@param showObsList if true, the Add to List/Remove from List item is added. */ - void initPopupMenu( SkyObject *obj, QString name1, QString name2, QString type, + void initPopupMenu( SkyObject *obj, TQString name1, TQString name2, TQString type, bool showRiseSet=true, bool showCenterTrack=true, bool showDetails=true, bool showTrail=false, bool addTrail=false, bool showAngularDistance=true, @@ -150,8 +150,8 @@ public: private: KStars *ksw; - QLabel *pmTitle, *pmTitle2, *pmType, *pmConstellation; - QLabel *pmRiseTime, *pmSetTime, *pmTransitTime; + TQLabel *pmTitle, *pmTitle2, *pmType, *pmConstellation; + TQLabel *pmRiseTime, *pmSetTime, *pmTransitTime; }; diff --git a/kstars/kstars/kssun.cpp b/kstars/kstars/kssun.cpp index ce3a60d1..5df14c59 100644 --- a/kstars/kstars/kssun.cpp +++ b/kstars/kstars/kssun.cpp @@ -16,14 +16,14 @@ ***************************************************************************/ #include -#include +#include #include "kssun.h" #include "ksutils.h" #include "ksnumbers.h" #include "kstarsdatetime.h" -KSSun::KSSun( KStarsData *kd, QString fn, double pSize ) : KSPlanet( kd, I18N_NOOP( "Sun" ), fn, pSize ) { +KSSun::KSSun( KStarsData *kd, TQString fn, double pSize ) : KSPlanet( kd, I18N_NOOP( "Sun" ), fn, pSize ) { /* JD0 = 2447892.5; //Jan 1, 1990 eclong0 = 279.403303; //mean ecliptic longitude at JD0 @@ -156,7 +156,7 @@ long double KSSun::equinox(int year, int d, int m, double angle) { long double eclipticLongitude[5]; for(int i = 0; i<5; ++i) { - jd0[i] = KStarsDateTime( ExtDate(year,m,d+i), QTime(0,0,0) ).djd(); + jd0[i] = KStarsDateTime( ExtDate(year,m,d+i), TQTime(0,0,0) ).djd(); KSNumbers *ksn = new KSNumbers(jd0[i]); //FIXME this is the Earth position findGeocentricPosition( ksn ); diff --git a/kstars/kstars/kssun.h b/kstars/kstars/kssun.h index ed5a3023..76b79143 100644 --- a/kstars/kstars/kssun.h +++ b/kstars/kstars/kssun.h @@ -18,7 +18,7 @@ #ifndef KSSUN_H #define KSSUN_H -#include +#include #include "ksplanet.h" /**@class KSSun @@ -38,7 +38,7 @@ public: *@param fn filename of Sun image *@param pSize physical diameter of the Sun, in km */ - KSSun(KStarsData *kd, QString fn = "", double pSize=0 ); + KSSun(KStarsData *kd, TQString fn = "", double pSize=0 ); /**Destructor (empty) */ diff --git a/kstars/kstars/kstars.cpp b/kstars/kstars/kstars.cpp index 8be622e5..b18f65fe 100644 --- a/kstars/kstars/kstars.cpp +++ b/kstars/kstars/kstars.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "Options.h" @@ -46,7 +46,7 @@ #include "indimenu.h" #include "indidriver.h" -KStars::KStars( bool doSplash, bool clockrun, const QString &startdate ) : +KStars::KStars( bool doSplash, bool clockrun, const TQString &startdate ) : DCOPObject("KStarsInterface"), KMainWindow(), skymap(0), centralWidget(0), topLayout(0), viewToolBar(0), TimeStep(0), actCoordSys(0), colorActionMenu(0), fovActionMenu(0), @@ -61,13 +61,13 @@ KStars::KStars( bool doSplash, bool clockrun, const QString &startdate ) : if ( doSplash ) { pd->kstarsData = new KStarsData(); - QObject::connect(pd->kstarsData, SIGNAL( initFinished(bool) ), - this, SLOT( datainitFinished(bool) ) ); + TQObject::connect(pd->kstarsData, TQT_SIGNAL( initFinished(bool) ), + this, TQT_SLOT( datainitFinished(bool) ) ); pd->splash = new KStarsSplash(0, "Splash"); - QObject::connect(pd->splash, SIGNAL( closeWindow() ), kapp, SLOT( quit() ) ); - QObject::connect(pd->kstarsData, SIGNAL( progressText(QString) ), - pd->splash, SLOT( setMessage(QString) )); + TQObject::connect(pd->splash, TQT_SIGNAL( closeWindow() ), kapp, TQT_SLOT( quit() ) ); + TQObject::connect(pd->kstarsData, TQT_SIGNAL( progressText(TQString) ), + pd->splash, TQT_SLOT( setMessage(TQString) )); pd->splash->show(); } @@ -80,13 +80,13 @@ KStars::KStars( bool doSplash, bool clockrun, const QString &startdate ) : if ( ! StartClockRunning ) pd->kstarsData->clock()->stop(); //set up Dark color scheme for application windows - DarkPalette = QPalette(QColor("red4"), QColor("DarkRed")); - DarkPalette.setColor( QPalette::Normal, QColorGroup::Base, QColor( "black" ) ); - DarkPalette.setColor( QPalette::Normal, QColorGroup::Text, QColor( "red2" ) ); - DarkPalette.setColor( QPalette::Normal, QColorGroup::Highlight, QColor( "red2" ) ); - DarkPalette.setColor( QPalette::Normal, QColorGroup::HighlightedText, QColor( "black" ) ); + DarkPalette = TQPalette(TQColor("red4"), TQColor("DarkRed")); + DarkPalette.setColor( TQPalette::Normal, TQColorGroup::Base, TQColor( "black" ) ); + DarkPalette.setColor( TQPalette::Normal, TQColorGroup::Text, TQColor( "red2" ) ); + DarkPalette.setColor( TQPalette::Normal, TQColorGroup::Highlight, TQColor( "red2" ) ); + DarkPalette.setColor( TQPalette::Normal, TQColorGroup::HighlightedText, TQColor( "black" ) ); //store original color scheme - OriginalPalette = QApplication::palette(); + OriginalPalette = TQApplication::palette(); #if ( __GLIBC__ >= 2 &&__GLIBC_MINOR__ >= 1 && !defined(__UCLIBC__)) kdDebug() << "glibc >= 2.1 detected. Using GNU extension sincos()" << endl; @@ -184,9 +184,9 @@ void KStars::applyConfig() { //color scheme pd->kstarsData->colorScheme()->loadFromConfig( kapp->config() ); if ( Options::darkAppColors() ) { - QApplication::setPalette( DarkPalette, true ); + TQApplication::setPalette( DarkPalette, true ); } else { - QApplication::setPalette( OriginalPalette, true ); + TQApplication::setPalette( OriginalPalette, true ); } //Infoboxes, toolbars, statusbars @@ -243,7 +243,7 @@ void KStars::updateTime( const bool automaticDSTchange ) { //Wrap the call to manualTick() in a singleshot timer so that it doesn't get called until //the skymap has been completely updated. if ( Data->clock()->isManualMode() && Data->clock()->isActive() ) { - QTimer::singleShot( 0, Data->clock(), SLOT( manualTick() ) ); + TQTimer::singleShot( 0, Data->clock(), TQT_SLOT( manualTick() ) ); } } @@ -255,7 +255,7 @@ InfoBoxes* KStars::infoBoxes( void ) { return map()->infoBoxes(); } GeoLocation* KStars::geo() { return data()->geo(); } -void KStars::mapGetsFocus() { map()->QWidget::setFocus(); } +void KStars::mapGetsFocus() { map()->TQWidget::setFocus(); } dms* KStars::LST() { return data()->LST; } diff --git a/kstars/kstars/kstars.h b/kstars/kstars/kstars.h index 88b7ab2c..34957208 100644 --- a/kstars/kstars/kstars.h +++ b/kstars/kstars/kstars.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "kstarsinterface.h" #include "observinglist.h" @@ -78,7 +78,7 @@ class KStars : public KMainWindow, virtual public KStarsInterface * * @todo Refer to documentation on date format. */ - KStars( bool doSplash, bool startClockRunning = true, const QString &startDateString = "" ); + KStars( bool doSplash, bool startClockRunning = true, const TQString &startDateString = "" ); /**Destructor. Synchs config file. Deletes objects. */ @@ -122,12 +122,12 @@ class KStars : public KMainWindow, virtual public KStarsInterface *@param name The name to use in the menu *@param actionName The internal name for the action (derived from filename) */ - void addColorMenuItem( QString name, QString actionName ); + void addColorMenuItem( TQString name, TQString actionName ); /**Remove an item from the color-scheme action manu *@param actionName The internal name of the action (derived from filename) */ - void removeColorMenuItem( QString actionName ); + void removeColorMenuItem( TQString actionName ); /**DCOP interface function. *Set focus to given Ra/Dec coordinates @@ -147,7 +147,7 @@ class KStars : public KMainWindow, virtual public KStarsInterface *Point in the direction described by the string argument. *@p direction either an object name, a compass direction (e.g., "north"), or "zenith" */ - ASYNC lookTowards( const QString direction ); + ASYNC lookTowards( const TQString direction ); /**DCOP interface function. Zoom in one step. */ ASYNC zoomIn(void) { slotZoomIn(); } @@ -181,7 +181,7 @@ class KStars : public KMainWindow, virtual public KStarsInterface /**DCOP interface function. Pause further DCOP execution until a key is pressed. *@p k the key which will resume DCOP execution */ - ASYNC waitForKey( const QString k ); + ASYNC waitForKey( const TQString k ); /**DCOP interface function. Toggle tracking. *@p track engage tracking if true; else disengage tracking @@ -192,13 +192,13 @@ class KStars : public KMainWindow, virtual public KStarsInterface *@p option the name of the option to be modified *@p value the option's new value */ - ASYNC changeViewOption( const QString option, const QString value ); + ASYNC changeViewOption( const TQString option, const TQString value ); /**DCOP interface function. *@p name the name of the option to query *@return the current value of the named option */ - QString getOption( const QString &name ); + TQString getOption( const TQString &name ); /**DCOP interface function. Read config file. *This function is useful for restoring the user settings from the config file, @@ -220,7 +220,7 @@ class KStars : public KMainWindow, virtual public KStarsInterface *@p y y-coordinate for message window *@p message the text to display in the message window */ - ASYNC popupMessage( int x, int y, const QString message ); + ASYNC popupMessage( int x, int y, const TQString message ); /**DCOP interface function. Draw a line on the sky map. *@note Not Yet Implemented @@ -237,25 +237,25 @@ class KStars : public KMainWindow, virtual public KStarsInterface *@p province the province name of the location *@p country the country name of the location */ - ASYNC setGeoLocation( const QString city, const QString province, const QString country ); + ASYNC setGeoLocation( const TQString city, const TQString province, const TQString country ); /**DCOP interface function. Modify a color. *@p colorName the name of the color to be modified (e.g., "SkyColor") *@p value the new color to use */ - ASYNC setColor( const QString colorName, const QString value ); + ASYNC setColor( const TQString colorName, const TQString value ); /**DCOP interface function. Load a color scheme. *@p name the name of the color scheme to load (e.g., "Moonless Night") */ - ASYNC loadColorScheme( const QString name ); + ASYNC loadColorScheme( const TQString name ); /**DCOP interface function. Export the sky image to a file. *@p filename the filename for the exported image *@p width the width for the exported image *@p height the height for the exported image */ - ASYNC exportImage( const QString filename, int width, int height ); + ASYNC exportImage( const TQString filename, int width, int height ); /**DCOP interface function. Print the sky image. *@p usePrintDialog if true, the KDE print dialog will be shown; otherwise, default parameters will be used @@ -267,110 +267,110 @@ class KStars : public KMainWindow, virtual public KStarsInterface *@p driverName the name of the driver to be established *@p useLocal establish driver locally? */ - ASYNC startINDI (QString driverName, bool useLocal); + ASYNC startINDI (TQString driverName, bool useLocal); /**DCOP interface function. Shutdown an INDI driver. *@p driverName the name of the driver to be shut down */ - ASYNC shutdownINDI (QString driverName); + ASYNC shutdownINDI (TQString driverName); /**DCOP interface function. Turn INDI driver on/off. *@p driverName the name of the driver to be switched on/off *@p turnOn if true, turn driver on; otherwise turn off */ - ASYNC switchINDI(QString driverName, bool turnOn); + ASYNC switchINDI(TQString driverName, bool turnOn); /**DCOP interface function. Set INDI connection port. *@p driverName the name of the driver for which the port will be set *@p port the port identifier */ - ASYNC setINDIPort(QString driverName, QString port); + ASYNC setINDIPort(TQString driverName, TQString port); /**DCOP interface function. Set INDI target RA/DEC coordinates *@p driverName the name of the driver *@p RA the target's Right Ascension coordinate (in Hours) *@p DEC the target's Declination coordinate (in Degrees) */ - ASYNC setINDITargetCoord(QString driverName, double RA, double DEC); + ASYNC setINDITargetCoord(TQString driverName, double RA, double DEC); /**DCOP interface function. Set INDI target to a named object. *@p driverName the name of the driver *@p objectName the name of the object to be targeted */ - ASYNC setINDITargetName(QString driverName, QString objectName); + ASYNC setINDITargetName(TQString driverName, TQString objectName); /**DCOP interface function. Set INDI action. *@p driverName the name of the driver *@p action the action to set */ - ASYNC setINDIAction(QString driverName, QString action); + ASYNC setINDIAction(TQString driverName, TQString action); /**DCOP interface function. Pause DCOP execution until named INDI action is completed. *@p driverName the name of the driver *@p action the action which is to be completed before resuming DCOP execution */ - ASYNC waitForINDIAction(QString driverName, QString action); + ASYNC waitForINDIAction(TQString driverName, TQString action); /**DCOP interface function. Set INDI focus speed. *@p driverName the name of the driver *@p action the name of the action (??) */ - ASYNC setINDIFocusSpeed(QString driverName,unsigned int speed); + ASYNC setINDIFocusSpeed(TQString driverName,unsigned int speed); /**DCOP interface function. Set INDI focus direction and focus. *@p driverName the name of the driver *@p focusDir 0 = focus in; 1 = focus out */ - ASYNC startINDIFocus(QString driverName, int focusDir); + ASYNC startINDIFocus(TQString driverName, int focusDir); /**DCOP interface function. Set INDI geographical information. *@p driverName the name of the driver *@p longitude the longitude to set, in Degrees *@p latitude the latitude to set, in Degrees */ - ASYNC setINDIGeoLocation(QString driverName, double longitude, double latitude); + ASYNC setINDIGeoLocation(TQString driverName, double longitude, double latitude); /**DCOP interface function. Sets focus operation timeout. *@p driverName the name of the driver *@p timeout the timeout interval, in seconds (?) */ - ASYNC setINDIFocusTimeout(QString driverName, int timeout); + ASYNC setINDIFocusTimeout(TQString driverName, int timeout); /**DCOP interface function. Start camera exposure with a timeout. *@p driverName the name of the driver *@p timeout the exposure time, in seconds (?) */ - ASYNC startINDIExposure(QString driverName, int timeout); + ASYNC startINDIExposure(TQString driverName, int timeout); /**DCOP interface function. Set INDI UTC date and time. *@p driverName the name of the driver *@p UTCDateTime the UTC date and time (e.g., "23 June 2004 12:30:00" ?) */ - ASYNC setINDIUTC(QString driverName, QString UTCDateTime); + ASYNC setINDIUTC(TQString driverName, TQString UTCDateTime); /**DCOP interface function. Set INDI Telescope action. *@p deviceName the name of the telescope device *@p action the action to set */ - ASYNC setINDIScopeAction(QString deviceName, QString action); + ASYNC setINDIScopeAction(TQString deviceName, TQString action); /**DCOP interface function. Set CCD camera frame type. *@p deviceName the name of the CCD device *@p type the frame type */ - ASYNC setINDIFrameType(QString deviceName, QString type); + ASYNC setINDIFrameType(TQString deviceName, TQString type); /**DCOP interface function. Set CCD filter. *@p deviceName the name of the CCD device *@p filter_num identifier of the CCD filter */ - ASYNC setINDIFilterNum(QString deviceName, int filter_num); + ASYNC setINDIFilterNum(TQString deviceName, int filter_num); /**DCOP interface function. Set CCD target temperature. *@p deviceName the name of the CCD device *@p temp the target CCD temperature (in Celsius ?) */ - ASYNC setINDICCDTemp(QString deviceName, int temp); + ASYNC setINDICCDTemp(TQString deviceName, int temp); /**@short Apply config options throughout the program. @@ -630,8 +630,8 @@ class KStars : public KMainWindow, virtual public KStarsInterface SkyMap *skymap; - QWidget *centralWidget; - QVBoxLayout *topLayout; + TQWidget *centralWidget; + TQVBoxLayout *topLayout; KToolBar *viewToolBar; TimeStepBox *TimeStep; @@ -651,9 +651,9 @@ class KStars : public KMainWindow, virtual public KStarsInterface int idSpinBox; bool DialogIsObsolete; bool StartClockRunning; - QString StartDateString; + TQString StartDateString; - QPalette OriginalPalette, DarkPalette; + TQPalette OriginalPalette, DarkPalette; class privatedata; friend class privatedata; diff --git a/kstars/kstars/kstarsactions.cpp b/kstars/kstars/kstarsactions.cpp index b31e616c..c370d55e 100644 --- a/kstars/kstars/kstarsactions.cpp +++ b/kstars/kstars/kstarsactions.cpp @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include //FIXME GLSOSSARY (uncomment these when content is added) //#include @@ -93,23 +93,23 @@ void KStars::slotViewToolBar() { - if ( sender()->name() == QString( "show_stars" ) ) { + if ( sender()->name() == TQString( "show_stars" ) ) { Options::setShowStars( !Options::showStars() ); - } else if ( sender()->name() == QString( "show_deepsky" ) ) { + } else if ( sender()->name() == TQString( "show_deepsky" ) ) { Options::setShowDeepSky( ! Options::showDeepSky() ); - } else if ( sender()->name() == QString( "show_planets" ) ) { + } else if ( sender()->name() == TQString( "show_planets" ) ) { Options::setShowPlanets( ! Options::showPlanets() ); - } else if ( sender()->name() == QString( "show_clines" ) ) { + } else if ( sender()->name() == TQString( "show_clines" ) ) { Options::setShowCLines( !Options::showCLines() ); - } else if ( sender()->name() == QString( "show_cnames" ) ) { + } else if ( sender()->name() == TQString( "show_cnames" ) ) { Options::setShowCNames( !Options::showCNames() ); - } else if ( sender()->name() == QString( "show_cbounds" ) ) { + } else if ( sender()->name() == TQString( "show_cbounds" ) ) { Options::setShowCBounds( !Options::showCBounds() ); - } else if ( sender()->name() == QString( "show_mw" ) ) { + } else if ( sender()->name() == TQString( "show_mw" ) ) { Options::setShowMilkyWay( !Options::showMilkyWay() ); - } else if ( sender()->name() == QString( "show_grid" ) ) { + } else if ( sender()->name() == TQString( "show_grid" ) ) { Options::setShowGrid( !Options::showGrid() ); - } else if ( sender()->name() == QString( "show_horizon" ) ) { + } else if ( sender()->name() == TQString( "show_horizon" ) ) { Options::setShowGround( !Options::showGround() ); } @@ -130,7 +130,7 @@ void KStars::slotCalculator() { void KStars::slotWizard() { KSWizard wizard(this); - if ( wizard.exec() == QDialog::Accepted ) { + if ( wizard.exec() == TQDialog::Accepted ) { Options::setRunStartupWizard( false ); //don't run on startup next time data()->setLocation( wizard.geo() ); @@ -199,7 +199,7 @@ void KStars::slotWUT() { //FIXME GLOSSARY // void KStars::slotGlossary(){ // GlossaryDialog *dlg = new GlossaryDialog( true, this, "glossary" ); -// QString glossaryfile =data()->stdDirs->findResource( "data", "kstars/glossary.xml" ); +// TQString glossaryfile =data()->stdDirs->findResource( "data", "kstars/glossary.xml" ); // KURL u = glossaryfile; // Glossary *g = Glossary::readFromXML( u ); // g->setName( i18n( "Knowledge" ) ); @@ -262,7 +262,7 @@ void KStars::slotINDIConf() { INDIFITSConf indioptions(this); indioptions.loadOptions(); - /*QStringList filterList; + /*TQStringList filterList; indiconf.timeCheck->setChecked( Options::indiAutoTime() ); @@ -275,7 +275,7 @@ void KStars::slotINDIConf() { if (Options::fitsSaveDirectory().isEmpty()) { - indiconf.fitsDIR_IN->setText (QDir:: homeDirPath()); + indiconf.fitsDIR_IN->setText (TQDir:: homeDirPath()); Options::setFitsSaveDirectory( indiconf.fitsDIR_IN->text()); } else @@ -288,7 +288,7 @@ void KStars::slotINDIConf() { indiconf.filterCombo->insertStringList(filterList); }*/ - if (indioptions.exec() == QDialog::Accepted) + if (indioptions.exec() == TQDialog::Accepted) { /*Options::setIndiAutoTime( indiconf.timeCheck->isChecked() ); Options::setIndiAutoGeo( indiconf.GeoCheck->isChecked() ); @@ -306,7 +306,7 @@ void KStars::slotINDIConf() { void KStars::slotGeoLocator() { LocationDialog locationdialog (this); - if ( locationdialog.exec() == QDialog::Accepted ) { + if ( locationdialog.exec() == TQDialog::Accepted ) { GeoLocation *newLocation = locationdialog.selectedCity(); if ( newLocation ) { // set new location in options @@ -356,8 +356,8 @@ void KStars::slotViewOps() { KConfigDialog* dialog = new KConfigDialog( this, "settings", Options::self() ); - connect( dialog, SIGNAL( applyClicked() ), this, SLOT( slotApplySettings() ) ); - connect( dialog, SIGNAL( okClicked() ), this, SLOT( slotApplySettings() ) ); + connect( dialog, TQT_SIGNAL( applyClicked() ), this, TQT_SLOT( slotApplySettings() ) ); + connect( dialog, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( slotApplySettings() ) ); OpsCatalog *opcatalog = new OpsCatalog( this, "catalogs" ); OpsGuides *opguides = new OpsGuides( this, "guides" ); @@ -384,7 +384,7 @@ void KStars::slotApplyConfigChanges() { void KStars::slotSetTime() { TimeDialog timedialog ( data()->lt(), this ); - if ( timedialog.exec() == QDialog::Accepted ) { + if ( timedialog.exec() == TQDialog::Accepted ) { data()->changeDateTime( geo()->LTtoUT( timedialog.selectedDateTime() ) ); if ( Options::useAltAz() ) { @@ -408,7 +408,7 @@ void KStars::slotFind() { if ( !findDialog ) kdWarning() << i18n( "KStars::slotFind() - Not enough memory for dialog" ) << endl; - if ( findDialog->exec() == QDialog::Accepted && findDialog->currentItem() ) { + if ( findDialog->exec() == TQDialog::Accepted && findDialog->currentItem() ) { map()->setClickedObject( findDialog->currentItem()->objName()->skyObject() ); map()->setClickedPoint( map()->clickedObject() ); map()->slotCenter(); @@ -434,7 +434,7 @@ void KStars::closeWindow() { void KStars::slotOpenFITS() { - KURL fileURL = KFileDialog::getOpenURL( QDir::homeDirPath(), "*.fits *.fit *.fts|Flexible Image Transport System"); + KURL fileURL = KFileDialog::getOpenURL( TQDir::homeDirPath(), "*.fits *.fit *.fts|Flexible Image Transport System"); if (fileURL.isEmpty()) return; @@ -445,12 +445,12 @@ void KStars::slotOpenFITS() } void KStars::slotExportImage() { - KURL fileURL = KFileDialog::getSaveURL( QDir::homeDirPath(), "image/png image/jpeg image/gif image/x-portable-pixmap image/x-bmp" ); + KURL fileURL = KFileDialog::getSaveURL( TQDir::homeDirPath(), "image/png image/jpeg image/gif image/x-portable-pixmap image/x-bmp" ); //Warn user if file exists! - if (QFile::exists(fileURL.path())) + if (TQFile::exists(fileURL.path())) { - int r=KMessageBox::warningContinueCancel(static_cast(parent()), + int r=KMessageBox::warningContinueCancel(static_cast(parent()), i18n( "A file named \"%1\" already exists. " "Overwrite it?" ).arg(fileURL.fileName()), i18n( "Overwrite File?" ), @@ -463,14 +463,14 @@ void KStars::slotExportImage() { } void KStars::slotRunScript() { - KURL fileURL = KFileDialog::getOpenURL( QDir::homeDirPath(), "*.kstars|KStars Scripts (*.kstars)" ); - QFile f; - QString fname; + KURL fileURL = KFileDialog::getOpenURL( TQDir::homeDirPath(), "*.kstars|KStars Scripts (*.kstars)" ); + TQFile f; + TQString fname; if ( fileURL.isValid() ) { if ( ! fileURL.isLocalFile() ) { //Warn the user about executing remote code. - QString message = i18n( "Warning: You are about to execute a remote shell script on your machine. " ); + TQString message = i18n( "Warning: You are about to execute a remote shell script on your machine. " ); message += i18n( "If you absolutely trust the source of this script, press Continue to execute the script; " ); message += i18n( "to save the file without executing it, press Save; " ); message += i18n( "to cancel the download, press Cancel. " ); @@ -480,14 +480,14 @@ void KStars::slotRunScript() { if ( result == KMessageBox::Cancel ) return; if ( result == KMessageBox::No ) { //save file - KURL saveURL = KFileDialog::getSaveURL( QDir::homeDirPath(), "*.kstars|KStars Scripts (*.kstars)" ); + KURL saveURL = KFileDialog::getSaveURL( TQDir::homeDirPath(), "*.kstars|KStars Scripts (*.kstars)" ); KTempFile tmpfile; tmpfile.setAutoDelete(true); while ( ! saveURL.isValid() ) { message = i18n( "Save location is invalid. Try another location?" ); if ( KMessageBox::warningYesNo( 0, message, i18n( "Invalid Save Location" ), i18n("Try Another"), i18n("Do Not Try") ) == KMessageBox::No ) return; - saveURL = KFileDialog::getSaveURL( QDir::homeDirPath(), "*.kstars|KStars Scripts (*.kstars)" ); + saveURL = KFileDialog::getSaveURL( TQDir::homeDirPath(), "*.kstars|KStars Scripts (*.kstars)" ); } if ( saveURL.isLocalFile() ) { @@ -501,7 +501,7 @@ void KStars::slotRunScript() { if ( tmpfile.name() == fname ) { //upload to remote location if ( ! KIO::NetAccess::upload( tmpfile.name(), fileURL, this ) ) { - QString message = i18n( "Could not upload image to remote location: %1" ).arg( fileURL.prettyURL() ); + TQString message = i18n( "Could not upload image to remote location: %1" ).arg( fileURL.prettyURL() ); KMessageBox::sorry( 0, message, i18n( "Could not upload file" ) ); } } @@ -528,7 +528,7 @@ void KStars::slotRunScript() { } if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1" ).arg( f.name() ); + TQString message = i18n( "Could not open file %1" ).arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); return; } @@ -536,8 +536,8 @@ void KStars::slotRunScript() { // Before we run the script, make sure that it's safe. Each line must either begin with "#" // or begin with "dcop $KSTARS". Otherwise, the line must be equal to one of the following: // "KSTARS=`dcopfind -a 'kstars*'`"; "MAIN=KStarsInterface"; or "CLOCK=clock#1" - QTextStream istream(&f); - QString line; + TQTextStream istream(&f); + TQString line; bool fileOK( true ); while ( ! istream.eof() ) { @@ -578,7 +578,7 @@ void KStars::slotPrint() { //Suggest Chart color scheme if ( data()->colorScheme()->colorNamed( "SkyColor" ) != "#FFFFFF" ) { - QString message = i18n( "You can save printer ink by using the \"Star Chart\" " + TQString message = i18n( "You can save printer ink by using the \"Star Chart\" " "color scheme, which uses a white background. Would you like to " "temporarily switch to the Star Chart color scheme for printing?" ); @@ -623,7 +623,7 @@ void KStars::slotToggleTimer() { //Focus void KStars::slotPointFocus() { - QString sentFrom( sender()->name() ); + TQString sentFrom( sender()->name() ); if ( sentFrom == "zenith" ) map()->invokeKey( KKey( "Z" ).keyCodeQt() ); @@ -667,7 +667,7 @@ void KStars::slotManualFocus() { FocusDialog focusDialog( this ); // = new FocusDialog( this ); if ( Options::useAltAz() ) focusDialog.activateAzAltPage(); - if ( focusDialog.exec() == QDialog::Accepted ) { + if ( focusDialog.exec() == TQDialog::Accepted ) { //If the requested position is very near the pole, we need to point first //to an intermediate location just below the pole in order to get the longitudinal //position (RA/Az) right. @@ -813,12 +813,12 @@ void KStars::slotCoordSys() { //Settings Menu: void KStars::slotColorScheme() { //use mid(3) to exclude the leading "cs_" prefix from the action name - QString filename = QString( sender()->name() ).mid(3) + ".colors"; + TQString filename = TQString( sender()->name() ).mid(3) + ".colors"; loadColorScheme( filename ); } void KStars::slotTargetSymbol() { - QString symbolName( sender()->name() ); + TQString symbolName( sender()->name() ); FOV f( symbolName ); //read data from fov.dat Options::setFOVName( f.name() ); @@ -839,9 +839,9 @@ void KStars::slotTargetSymbol() { void KStars::slotFOVEdit() { FOVDialog fovdlg( this ); - if ( fovdlg.exec() == QDialog::Accepted ) { + if ( fovdlg.exec() == TQDialog::Accepted ) { //replace existing fov.dat with data from the FOVDialog - QFile f; + TQFile f; f.setName( locateLocal( "appdata", "fov.dat" ) ); //rebuild fov.dat if FOVList is empty @@ -852,11 +852,11 @@ void KStars::slotFOVEdit() { if ( ! f.open( IO_WriteOnly ) ) { kdDebug() << i18n( "Could not open fov.dat for writing." ) << endl; } else { - QTextStream ostream(&f); + TQTextStream ostream(&f); for ( FOV *fov = fovdlg.FOVList.first(); fov; fov = fovdlg.FOVList.next() ) ostream << fov->name() << ":" << fov->size() - << ":" << QString("%1").arg( fov->shape() ) << ":" << fov->color() << endl; + << ":" << TQString("%1").arg( fov->shape() ) << ":" << fov->color() << endl; f.close(); } @@ -866,14 +866,14 @@ void KStars::slotFOVEdit() { fovActionMenu->popupMenu()->clear(); if ( f.open( IO_ReadOnly ) ) { - QTextStream stream( &f ); + TQTextStream stream( &f ); while ( !stream.eof() ) { - QString line = stream.readLine(); - QStringList fields = QStringList::split( ":", line ); + TQString line = stream.readLine(); + TQStringList fields = TQStringList::split( ":", line ); if ( fields.count() == 4 ) { - QString nm = fields[0].stripWhiteSpace(); - KToggleAction *kta = new KToggleAction( nm, 0, this, SLOT( slotTargetSymbol() ), + TQString nm = fields[0].stripWhiteSpace(); + KToggleAction *kta = new KToggleAction( nm, 0, this, TQT_SLOT( slotTargetSymbol() ), actionCollection(), nm.utf8() ); kta->setExclusiveGroup( "fovsymbol" ); fovActionMenu->insert( kta ); @@ -885,7 +885,7 @@ void KStars::slotFOVEdit() { fovActionMenu->popupMenu()->insertSeparator(); fovActionMenu->insert( new KAction( i18n( "Edit FOV Symbols..." ), 0, this, - SLOT( slotFOVEdit() ), actionCollection(), "edit_fov" ) ); + TQT_SLOT( slotFOVEdit() ), actionCollection(), "edit_fov" ) ); //set FOV to whatever was highlighted in FOV dialog if ( fovdlg.FOVList.count() > 0 ) { @@ -955,31 +955,31 @@ void KStars::slotClearAllTrails() { //toggle display of GUI Items on/off void KStars::slotShowGUIItem( bool show ) { //Toolbars - if ( sender()->name() == QString( "show_mainToolBar" ) ) { + if ( sender()->name() == TQString( "show_mainToolBar" ) ) { Options::setShowMainToolBar( show ); if ( show ) toolBar( "mainToolBar" )->show(); else toolBar( "mainToolBar" )->hide(); } - if ( sender()->name() == QString( "show_viewToolBar" ) ) { + if ( sender()->name() == TQString( "show_viewToolBar" ) ) { Options::setShowViewToolBar( show ); if ( show ) toolBar( "viewToolBar" )->show(); else toolBar( "viewToolBar" )->hide(); } - if ( sender()->name() == QString( "show_statusBar" ) ) { + if ( sender()->name() == TQString( "show_statusBar" ) ) { Options::setShowStatusBar( show ); if ( show ) statusBar()->show(); else statusBar()->hide(); } - if ( sender()->name() == QString( "show_sbAzAlt" ) ) { + if ( sender()->name() == TQString( "show_sbAzAlt" ) ) { Options::setShowAltAzField( show ); if ( show ) { //To preserve the order (AzAlt before RADec), we have to remove //the RADec field and then add both back. if ( Options::showRADecField() ) statusBar()->removeItem( 2 ); - QString s = "000d 00m 00s, +00d 00\' 00\""; //only need this to set the width + TQString s = "000d 00m 00s, +00d 00\' 00\""; //only need this to set the width statusBar()->insertFixedItem( s, 1, true ); statusBar()->setItemAlignment( 1, AlignRight | AlignVCenter ); statusBar()->changeItem( "", 1 ); @@ -994,10 +994,10 @@ void KStars::slotShowGUIItem( bool show ) { } } - if ( sender()->name() == QString( "show_sbRADec" ) ) { + if ( sender()->name() == TQString( "show_sbRADec" ) ) { Options::setShowRADecField( show ); if ( show ) { - QString s = "000d 00m 00s, +00d 00\' 00\""; //only need this to set the width + TQString s = "000d 00m 00s, +00d 00\' 00\""; //only need this to set the width statusBar()->insertFixedItem( s, 2, true ); statusBar()->setItemAlignment( 2, AlignRight | AlignVCenter ); statusBar()->changeItem( "", 2 ); @@ -1008,22 +1008,22 @@ void KStars::slotShowGUIItem( bool show ) { //InfoBoxes: we only change options here; these are also connected to slots in //InfoBoxes that actually toggle the display. - if ( sender()->name() == QString( "show_boxes" ) ) + if ( sender()->name() == TQString( "show_boxes" ) ) Options::setShowInfoBoxes( show ); - if ( sender()->name() == QString( "show_time_box" ) ) + if ( sender()->name() == TQString( "show_time_box" ) ) Options::setShowTimeBox( show ); - if ( sender()->name() == QString( "show_location_box" ) ) + if ( sender()->name() == TQString( "show_location_box" ) ) Options::setShowGeoBox( show ); - if ( sender()->name() == QString( "show_focus_box" ) ) + if ( sender()->name() == TQString( "show_focus_box" ) ) Options::setShowFocusBox( show ); } -void KStars::addColorMenuItem( QString name, QString actionName ) { +void KStars::addColorMenuItem( TQString name, TQString actionName ) { colorActionMenu->insert( new KAction( name, 0, - this, SLOT( slotColorScheme() ), actionCollection(), actionName.local8Bit() ) ); + this, TQT_SLOT( slotColorScheme() ), actionCollection(), actionName.local8Bit() ) ); } -void KStars::removeColorMenuItem( QString actionName ) { +void KStars::removeColorMenuItem( TQString actionName ) { kdDebug() << "removing " << actionName << endl; colorActionMenu->remove( actionCollection()->action( actionName.local8Bit() ) ); } diff --git a/kstars/kstars/kstarsdata.cpp b/kstars/kstars/kstarsdata.cpp index 8404e538..5863d449 100644 --- a/kstars/kstars/kstarsdata.cpp +++ b/kstars/kstars/kstarsdata.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -55,9 +55,9 @@ #include "csegment.h" #include "customcatalog.h" -QPtrList KStarsData::geoList = QPtrList(); -QMap KStarsData::Rulebook = QMap(); -QStringList KStarsData::CustomColumns = QStringList::split( " ", "ID RA Dc Tp Nm Mg Mj Mn PA Ig" ); +TQPtrList KStarsData::geoList = TQPtrList(); +TQMap KStarsData::Rulebook = TQMap(); +TQStringList KStarsData::CustomColumns = TQStringList::split( " ", "ID RA Dc Tp Nm Mg Mj Mn PA Ig" ); int KStarsData::objects = 0; KStarsData::KStarsData() : stdDirs(0), locale(0), @@ -75,8 +75,8 @@ KStarsData::KStarsData() : stdDirs(0), locale(0), //Check to see if config file already exists. If not, set //useDefaultOptions = true - QString fname = locateLocal( "config", "kstarsrc" ); - useDefaultOptions = ! ( QFile(fname).exists() ); + TQString fname = locateLocal( "config", "kstarsrc" ); + useDefaultOptions = ! ( TQFile(fname).exists() ); //Instantiate LST and HourAngle LST = new dms(); @@ -163,10 +163,10 @@ KStarsData::~KStarsData() { } bool KStarsData::readMWData( void ) { - QFile file; + TQFile file; for ( unsigned int i=0; i<11; ++i ) { - QString snum, fname, szero; + TQString snum, fname, szero; snum = snum.setNum( i+1 ); if ( i+1 < 10 ) szero = "0"; else szero = ""; fname = "mw" + szero + snum + ".dat"; @@ -174,7 +174,7 @@ bool KStarsData::readMWData( void ) { if ( KSUtils::openDataFile( file, fname ) ) { KSFileReader fileReader( file ); // close file is included while ( fileReader.hasMoreLines() ) { - QString line; + TQString line; double ra, dec; line = fileReader.readLine(); @@ -195,18 +195,18 @@ bool KStarsData::readMWData( void ) { bool KStarsData::readADVTreeData(void) { - QFile file; - QString Interface; + TQFile file; + TQString Interface; if (!KSUtils::openDataFile(file, "advinterface.dat")) return false; - QTextStream stream(&file); - QString Line; + TQTextStream stream(&file); + TQString Line; while (!stream.atEnd()) { - QString Name, Link, subName; + TQString Name, Link, subName; int Type, interfaceIndex; Line = stream.readLine(); @@ -236,7 +236,7 @@ bool KStarsData::readADVTreeData(void) subName = Name; interfaceIndex = Link.find("KSINTERFACE"); Link.remove(interfaceIndex, 11); - Link = Link.insert(interfaceIndex, subName.replace( QRegExp(" "), "+")); + Link = Link.insert(interfaceIndex, subName.replace( TQRegExp(" "), "+")); } @@ -260,9 +260,9 @@ bool KStarsData::readADVTreeData(void) bool KStarsData::readVARData(void) { - QString varFile("valaav.txt"); - QFile localeFile; - QFile file; + TQString varFile("valaav.txt"); + TQFile localeFile; + TQFile file; file.setName( locateLocal( "appdata", varFile ) ); if ( !file.open( IO_ReadOnly ) ) @@ -275,8 +275,8 @@ bool KStarsData::readVARData(void) if (localeFile.open(IO_WriteOnly)) { - QTextStream readStream(&file); - QTextStream writeStream(&localeFile); + TQTextStream readStream(&file); + TQTextStream writeStream(&localeFile); writeStream << readStream.read(); localeFile.close(); file.reset(); @@ -287,19 +287,19 @@ bool KStarsData::readVARData(void) } - QTextStream stream(&file); + TQTextStream stream(&file); stream.readLine(); while (!stream.atEnd()) { - QString Name; - QString Designation; - QString Line; + TQString Name; + TQString Designation; + TQString Line; Line = stream.readLine(); - if (Line[0] == QChar('*')) + if (Line[0] == TQChar('*')) break; Designation = Line.mid(0,8).stripWhiteSpace(); @@ -319,9 +319,9 @@ bool KStarsData::readVARData(void) bool KStarsData::readINDIHosts(void) { - QString indiFile("indihosts.xml"); - QFile localeFile; - QFile file; + TQString indiFile("indihosts.xml"); + TQFile localeFile; + TQFile file; char errmsg[1024]; signed char c; LilXML *xmlParser = newLilXML(); @@ -348,7 +348,7 @@ bool KStarsData::readINDIHosts(void) INDIHostsInfo *VInfo = new INDIHostsInfo; - VInfo->name = QString(valuXMLAtt(ap)); + VInfo->name = TQString(valuXMLAtt(ap)); // Get host name ap = findXMLAtt(root, "hostname"); @@ -358,7 +358,7 @@ bool KStarsData::readINDIHosts(void) return false; } - VInfo->hostname = QString(valuXMLAtt(ap)); + VInfo->hostname = TQString(valuXMLAtt(ap)); ap = findXMLAtt(root, "port"); @@ -367,7 +367,7 @@ bool KStarsData::readINDIHosts(void) return false; } - VInfo->portnumber = QString(valuXMLAtt(ap)); + VInfo->portnumber = TQString(valuXMLAtt(ap)); VInfo->isConnected = false; VInfo->mgrID = -1; @@ -394,7 +394,7 @@ bool KStarsData::readCLineData( void ) { //of abbreviated genetive star names in the same format as they //appear in the star data files (hipNNN.dat). // - //Each constellation consists of a QPtrList of SkyPoints, + //Each constellation consists of a TQPtrList of SkyPoints, //corresponding to the stars at each "node" of the constellation. //These are pointers to the starobjects themselves, so the nodes //will automatically be fixed to the stars even as the star @@ -402,13 +402,13 @@ bool KStarsData::readCLineData( void ) { //has a corresponding flag that determines whether a line should //connect this node and the previous one. - QFile file; + TQFile file; if ( KSUtils::openDataFile( file, "clines.dat" ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.eof() ) { - QString line, name; - QChar *mode; + TQString line, name; + TQChar *mode; line = stream.readLine(); @@ -426,7 +426,7 @@ bool KStarsData::readCLineData( void ) { starFound = true; clineList.append( (SkyPoint *)( oname->skyObject() ) ); - mode = new QChar( line.at( 0 ) ); + mode = new TQChar( line.at( 0 ) ); clineModeList.append( mode ); break; } @@ -445,16 +445,16 @@ bool KStarsData::readCLineData( void ) { } bool KStarsData::readCNameData( void ) { - QFile file; + TQFile file; cnameFile = "cnames.dat"; if ( KSUtils::openDataFile( file, cnameFile ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.eof() ) { - QString line, name, abbrev; + TQString line, name, abbrev; int rah, ram, ras, dd, dm, ds; - QChar sgn; + TQChar sgn; line = stream.readLine(); @@ -488,14 +488,14 @@ bool KStarsData::readCNameData( void ) { } bool KStarsData::readCBoundData( void ) { - QFile file; + TQFile file; if ( KSUtils::openDataFile( file, "cbound.dat" ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); unsigned int nn(0); double ra(0.0), dec(0.0); - QString d1, d2; + TQString d1, d2; bool ok(false), comment(false); //read the stream one field at a time. Individual segments can span @@ -564,9 +564,9 @@ bool KStarsData::readCBoundData( void ) { bool KStarsData::openStarFile( int i ) { if (starFileReader != 0) delete starFileReader; - QFile file; - QString snum, fname; - snum = QString().sprintf("%03d", i); + TQFile file; + TQString snum, fname; + snum = TQString().sprintf("%03d", i); fname = "hip" + snum + ".dat"; if (KSUtils::openDataFile(file, fname)) { starFileReader = new KSFileReader(file); // close file is included @@ -588,7 +588,7 @@ bool KStarsData::readStarData( void ) { if (openStarFile(i) == true) { while (starFileReader->hasMoreLines()) { - QString line; + TQString line; float mag; line = starFileReader->readLine(); @@ -619,11 +619,11 @@ bool KStarsData::readStarData( void ) { return true; } -void KStarsData::processStar( QString *line, bool reloadMode ) { - QString name, gname, SpType; +void KStarsData::processStar( TQString *line, bool reloadMode ) { + TQString name, gname, SpType; int rah, ram, ras, ras2, dd, dm, ds, ds2; bool mult, var; - QChar sgn; + TQChar sgn; double mag, bv, dmag, vper; double pmra, pmdec, plx; @@ -703,13 +703,13 @@ void KStarsData::processStar( QString *line, bool reloadMode ) { } bool KStarsData::readAsteroidData( void ) { - QFile file; + TQFile file; if ( KSUtils::openDataFile( file, "asteroids.dat" ) ) { KSFileReader fileReader( file ); while( fileReader.hasMoreLines() ) { - QString line, name; + TQString line, name; int mJD; double a, e, dble_i, dble_w, dble_N, dble_M, H; long double JD; @@ -741,13 +741,13 @@ bool KStarsData::readAsteroidData( void ) { } bool KStarsData::readCometData( void ) { - QFile file; + TQFile file; if ( KSUtils::openDataFile( file, "comets.dat" ) ) { KSFileReader fileReader( file ); while( fileReader.hasMoreLines() ) { - QString line, name; + TQString line, name; int mJD; double q, e, dble_i, dble_w, dble_N, Tp; long double JD; @@ -781,11 +781,11 @@ bool KStarsData::readCometData( void ) { //02/2003: NEW: split data files, using Heiko's new KSFileReader. bool KStarsData::readDeepSkyData( void ) { - QFile file; + TQFile file; for ( unsigned int i=0; ilanguage() != "en_US" ) localFile = locale->language() + "/" + urlfile; @@ -941,27 +941,27 @@ bool KStarsData::openURLFile(QString urlfile, QFile & file) { //local file found. Now, if global file has newer timestamp, then merge the two files. //First load local file into QStringList bool newDataFound( false ); - QStringList urlData; - QTextStream lStream( &file ); + TQStringList urlData; + TQTextStream lStream( &file ); while ( ! lStream.eof() ) urlData.append( lStream.readLine() ); //Find global file(s) in findAllResources() list. - QFileInfo fi_local( file.name() ); - QStringList flist = KGlobal::instance()->dirs()->findAllResources( "appdata", urlfile ); + TQFileInfo fi_local( file.name() ); + TQStringList flist = KGlobal::instance()->dirs()->findAllResources( "appdata", urlfile ); for ( unsigned int i=0; i< flist.count(); i++ ) { if ( flist[i] != file.name() ) { - QFileInfo fi_global( flist[i] ); + TQFileInfo fi_global( flist[i] ); //Is this global file newer than the local file? if ( fi_global.lastModified() > fi_local.lastModified() ) { //Global file has newer timestamp than local. Add lines in global file that don't already exist in local file. //be smart about this; in some cases the URL is updated but the image is probably the same if its //label string is the same. So only check strings up to last ":" - QFile globalFile( flist[i] ); + TQFile globalFile( flist[i] ); if ( globalFile.open( IO_ReadOnly ) ) { - QTextStream gStream( &globalFile ); + TQTextStream gStream( &globalFile ); while ( ! gStream.eof() ) { - QString line = gStream.readLine(); + TQString line = gStream.readLine(); //If global-file line begins with "XXX:" then this line should be removed from the local file. if ( line.left( 4 ) == "XXX:" && urlData.contains( line.mid( 4 ) ) ) { @@ -996,7 +996,7 @@ bool KStarsData::openURLFile(QString urlfile, QFile & file) { //(possibly) write appended local file if ( newDataFound ) { if ( file.open( IO_WriteOnly ) ) { - QTextStream outStream( &file ); + TQTextStream outStream( &file ); for ( unsigned int i=0; i cat = CustomCatalogs.at(i)->objList(); + TQPtrList cat = CustomCatalogs.at(i)->objList(); for ( SkyObject *o=cat.first(); o; o=cat.next() ) { ObjNames.remove( o->name() ); @@ -1163,35 +1163,35 @@ bool KStarsData::removeCatalog( int i ) { return true; } -CustomCatalog* KStarsData::createCustomCatalog( QString filename, bool showerrs ) { - QDir::setCurrent( QDir::homeDirPath() ); //for files with relative path - QPtrList objList; - QString CatalogName, CatalogPrefix, CatalogColor; +CustomCatalog* KStarsData::createCustomCatalog( TQString filename, bool showerrs ) { + TQDir::setCurrent( TQDir::homeDirPath() ); //for files with relative path + TQPtrList objList; + TQString CatalogName, CatalogPrefix, CatalogColor; float CatalogEpoch; //If the filename begins with "~", replace the "~" with the user's home directory //(otherwise, the file will not successfully open) if ( filename.at(0)=='~' ) - filename = QDir::homeDirPath() + filename.mid( 1, filename.length() ); - QFile ccFile( filename ); + filename = TQDir::homeDirPath() + filename.mid( 1, filename.length() ); + TQFile ccFile( filename ); if ( ccFile.open( IO_ReadOnly ) ) { int iStart(0); //the line number of the first non-header line - QStringList errs; //list of error messages - QStringList Columns; //list of data column descriptors in the header + TQStringList errs; //list of error messages + TQStringList Columns; //list of data column descriptors in the header - QTextStream stream( &ccFile ); - QStringList lines = QStringList::split( "\n", stream.read() ); + TQTextStream stream( &ccFile ); + TQStringList lines = TQStringList::split( "\n", stream.read() ); if ( parseCustomDataHeader( lines, Columns, CatalogName, CatalogPrefix, CatalogColor, CatalogEpoch, iStart, showerrs, errs ) ) { - QStringList::Iterator it = lines.begin(); - QStringList::Iterator itEnd = lines.end(); + TQStringList::Iterator it = lines.begin(); + TQStringList::Iterator itEnd = lines.end(); it += iStart; //jump ahead past header for ( uint i=iStart; i < lines.count(); i++ ) { - QStringList d = QStringList::split( " ", lines[i] ); + TQStringList d = TQStringList::split( " ", lines[i] ); //Now, if one of the columns is the "Name" field, the name may contain spaces. //In this case, the name field will need to be surrounded by quotes. @@ -1227,7 +1227,7 @@ CustomCatalog* KStarsData::createCustomCatalog( QString filename, bool showerrs if ( objList.count() ) { if ( errs.count() > 0 ) { //some data parsed, but there are errs to report - QString message( i18n( "Some lines in the custom catalog could not be parsed; see error messages below." ) + "\n" + + TQString message( i18n( "Some lines in the custom catalog could not be parsed; see error messages below." ) + "\n" + i18n( "To reject the file, press Cancel. " ) + i18n( "To accept the file (ignoring unparsed lines), press Accept." ) ); if ( KMessageBox::warningContinueCancelList( 0, message, errs, @@ -1237,7 +1237,7 @@ CustomCatalog* KStarsData::createCustomCatalog( QString filename, bool showerrs } } else { //objList.count() == 0 if ( showerrs ) { - QString message( i18n( "No lines could be parsed from the specified file, see error messages below." ) ); + TQString message( i18n( "No lines could be parsed from the specified file, see error messages below." ) ); KMessageBox::informationList( 0, message, errs, i18n( "No Valid Data Found in File" ) ); } @@ -1260,14 +1260,14 @@ CustomCatalog* KStarsData::createCustomCatalog( QString filename, bool showerrs } -bool KStarsData::processCustomDataLine( int lnum, QStringList d, QStringList Columns, - QString Prefix, QPtrList &objList, bool showerrs, QStringList &errs ) { +bool KStarsData::processCustomDataLine( int lnum, TQStringList d, TQStringList Columns, + TQString Prefix, TQPtrList &objList, bool showerrs, TQStringList &errs ) { //object data unsigned char iType(0); dms RA, Dec; float mag(0.0), a(0.0), b(0.0), PA(0.0); - QString name(""); QString lname(""); + TQString name(""); TQString lname(""); for ( uint i=0; istart(1); } -void KStarsData::initError(QString s, bool required = false) { - QString message, caption; +void KStarsData::initError(TQString s, bool required = false) { + TQString message, caption; initTimer->stop(); if (required) { message = i18n( "The file %1 could not be found. " "KStars cannot run properly without this file. " "To continue loading, place the file in one of the " "following locations, then press Retry:\n\n" ).arg( s ) - + QString( "\t$(KDEDIR)/share/apps/kstars/%1\n" ).arg( s ) - + QString( "\t~/.kde/share/apps/kstars/%1\n\n" ).arg( s ) + + TQString( "\t$(KDEDIR)/share/apps/kstars/%1\n" ).arg( s ) + + TQString( "\t~/.kde/share/apps/kstars/%1\n\n" ).arg( s ) + i18n( "Otherwise, press Cancel to shutdown." ); caption = i18n( "Critical File Not Found: %1" ).arg( s ); } else { @@ -1784,8 +1784,8 @@ void KStarsData::initError(QString s, bool required = false) { "KStars can still run without this file. " "However, to avoid seeing this message in the future, you can " "place the file in one of the following locations, then press Retry:\n\n" ).arg( s ) - + QString( "\t$(KDEDIR)/share/apps/kstars/%1\n" ).arg( s ) - + QString( "\t~/.kde/share/apps/kstars/%1\n\n" ).arg( s ) + + TQString( "\t$(KDEDIR)/share/apps/kstars/%1\n" ).arg( s ) + + TQString( "\t~/.kde/share/apps/kstars/%1\n\n" ).arg( s ) + i18n( "Otherwise, press Cancel to continue loading without this file." ).arg( s ); caption = i18n( "Non-Critical File Not Found: %1" ).arg( s ); } @@ -1805,8 +1805,8 @@ void KStarsData::initError(QString s, bool required = false) { } void KStarsData::slotInitialize() { - QFile imFile; - QString ImageName; + TQFile imFile; + TQString ImageName; kapp->flush(); // flush all paint events before loading data @@ -2154,7 +2154,7 @@ void KStarsData::updateTime( GeoLocation *geo, SkyMap *skymap, const bool automa //Custom Catalogs for ( unsigned int j=0; j< CustomCatalogs.count(); ++j ) { - QPtrList cat = CustomCatalogs.at(j)->objList(); + TQPtrList cat = CustomCatalogs.at(j)->objList(); if ( Options::showCatalog()[j] ) { for ( SkyObject *o = cat.first(); o; o = cat.next() ) { if (needNewCoords) o->updateCoords( &num ); @@ -2219,7 +2219,7 @@ void KStarsData::updateTime( GeoLocation *geo, SkyMap *skymap, const bool automa skymap->updateFocus(); if ( clock()->isManualMode() ) - QTimer::singleShot( 0, skymap, SLOT( forceUpdateNow() ) ); + TQTimer::singleShot( 0, skymap, TQT_SLOT( forceUpdateNow() ) ); else skymap->forceUpdate(); } } @@ -2236,7 +2236,7 @@ void KStarsData::setFullTimeUpdate() { } void KStarsData::setLocationFromOptions() { - QMap::Iterator it = Rulebook.find( Options::dST() ); + TQMap::Iterator it = Rulebook.find( Options::dST() ); setLocation( GeoLocation ( Options::longitude(), Options::latitude(), Options::cityName(), Options::provinceName(), Options::countryName(), Options::timeZone(), &(it.data()), 4, Options::elevation() ) ); @@ -2282,7 +2282,7 @@ void KStarsData::changeDateTime( const KStarsDateTime &newDate ) { setNextDSTChange( geo()->tzrule()->nextDSTChange() ); } -SkyObject* KStarsData::objectNamed( const QString &name ) { +SkyObject* KStarsData::objectNamed( const TQString &name ) { if ( (name== "star") || (name== "nothing") || name.isEmpty() ) return NULL; if ( name== Moon->name() ) return Moon; @@ -2323,7 +2323,7 @@ SkyObject* KStarsData::objectNamed( const QString &name ) { //Custom catalogs. for ( unsigned int i=0; i custCatObjs = CustomCatalogs.at(i)->objList(); + TQPtrList custCatObjs = CustomCatalogs.at(i)->objList(); for ( unsigned int j = 0; j < custCatObjs.count(); ++j ) { if ( name==custCatObjs.at(j)->name() ) return custCatObjs.at(j); } @@ -2340,27 +2340,27 @@ SkyObject* KStarsData::objectNamed( const QString &name ) { //also, even functions that do make sense in this context have aspects that should //be modified or ignored. For example, we don't need to call slotCenter() on recentering //commands, just setDestination(). (sltoCenter() does additional things that we dont need). -bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) { +bool KStarsData::executeScript( const TQString &scriptname, SkyMap *map ) { int cmdCount(0); - QFile f( scriptname ); + TQFile f( scriptname ); if ( !f.open( IO_ReadOnly) ) { kdDebug() << i18n( "Could not open file %1" ).arg( f.name() ) << endl; return false; } - QTextStream istream(&f); + TQTextStream istream(&f); while ( ! istream.eof() ) { - QString line = istream.readLine(); + TQString line = istream.readLine(); //found a dcop line if ( line.left(4) == "dcop" ) { line = line.mid( 20 ); //strip away leading characters - QStringList fn = QStringList::split( " ", line ); + TQStringList fn = TQStringList::split( " ", line ); if ( fn[0] == "lookTowards" && fn.count() >= 2 ) { double az(-1.0); - QString arg = fn[1].lower(); + TQString arg = fn[1].lower(); if ( arg == "n" || arg == "north" ) az = 0.0; if ( arg == "ne" || arg == "northeast" ) az = 45.0; if ( arg == "e" || arg == "east" ) az = 90.0; @@ -2441,7 +2441,7 @@ bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) { if ( ok ) min = fn[5].toInt(&ok); if ( ok ) sec = fn[6].toInt(&ok); if ( ok ) { - changeDateTime( geo()->LTtoUT( KStarsDateTime( ExtDate(yr, mth, day), QTime(hr,min,sec) ) ) ); + changeDateTime( geo()->LTtoUT( KStarsDateTime( ExtDate(yr, mth, day), TQTime(hr,min,sec) ) ) ); cmdCount++; } else { kdWarning() << i18n( "Could not set time: %1 / %2 / %3 ; %4:%5:%6" ) @@ -2539,7 +2539,7 @@ bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) { cmdCount++; } } else if ( fn[0] == "setGeoLocation" && ( fn.count() == 3 || fn.count() == 4 ) ) { - QString city( fn[1] ), province( "" ), country( fn[2] ); + TQString city( fn[1] ), province( "" ), country( fn[2] ); if ( fn.count() == 4 ) { province = fn[2]; country = fn[3]; @@ -2576,8 +2576,8 @@ void KStarsData::appendTelescopeObject(SkyObject * object) void KStarsData::saveTimeBoxShaded( bool b ) { Options::setShadeTimeBox( b ); } void KStarsData::saveGeoBoxShaded( bool b ) { Options::setShadeGeoBox( b ); } void KStarsData::saveFocusBoxShaded( bool b ) { Options::setShadeFocusBox( b ); } -void KStarsData::saveTimeBoxPos( QPoint p ) { Options::setPositionTimeBox( p ); } -void KStarsData::saveGeoBoxPos( QPoint p ) { Options::setPositionGeoBox( p ); } -void KStarsData::saveFocusBoxPos( QPoint p ) { Options::setPositionFocusBox( p ); } +void KStarsData::saveTimeBoxPos( TQPoint p ) { Options::setPositionTimeBox( p ); } +void KStarsData::saveGeoBoxPos( TQPoint p ) { Options::setPositionGeoBox( p ); } +void KStarsData::saveFocusBoxPos( TQPoint p ) { Options::setPositionFocusBox( p ); } #include "kstarsdata.moc" diff --git a/kstars/kstars/kstarsdata.h b/kstars/kstars/kstarsdata.h index 3df7292c..b6d5b752 100644 --- a/kstars/kstars/kstarsdata.h +++ b/kstars/kstars/kstarsdata.h @@ -18,9 +18,9 @@ #ifndef KSTARSDATA_H #define KSTARSDATA_H -#include -#include -#include +#include +#include +#include #include @@ -154,7 +154,7 @@ public: *@return true if location successfully parsed; otherwise false. *@see KStarsData::readCityData() */ - bool processCity( QString& line ); + bool processCity( TQString& line ); /**Populate list of star objects from the stars database file. *Each line in the file provides the information required to construct a @@ -195,7 +195,7 @@ public: *@param reloadMode makes additional calculations in reload mode, not needed at start up *@see KStarsData::readStarData() */ - void processStar( QString *line, bool reloadMode = false ); + void processStar( TQString *line, bool reloadMode = false ); /**Populate the list of deep-sky objects from the database file. *Each line in the file is parsed according to column position: @@ -361,14 +361,14 @@ public: *@short Read in image and information URLs. *@return true if data files were successfully read. */ - bool readURLData( QString url, int type=0, bool deepOnly=false ); + bool readURLData( TQString url, int type=0, bool deepOnly=false ); /**@short open a file containing URL links. *@param urlfile string representation of the filename to open - *@param file reference to the QFile object which will be opened to this file. + *@param file reference to the TQFile object which will be opened to this file. *@return TRUE if file successfully opened. */ - bool openURLFile(QString urlfile, QFile& file); + bool openURLFile(TQString urlfile, TQFile& file); /**Initialize custom object catalogs from the files listed in the config file */ @@ -377,7 +377,7 @@ public: /**Add a user-defined object catalog to the list of custom catalogs. *(Basically just calls createCustomCatalog() ) */ - bool addCatalog( QString filename ); + bool addCatalog( TQString filename ); /**Remove a user-defined object catalog from the list of custom catalogs. *Also removes the objects from the ObjNames list. @@ -391,7 +391,7 @@ public: *@param showerrs show GUI window summarizing parsing errors *@return pointer to the new catalog */ - CustomCatalog* createCustomCatalog( QString filename, bool showerrs = false ); + CustomCatalog* createCustomCatalog( TQString filename, bool showerrs = false ); /**@short Parse the header of the custom object catalog. *@param lines string list containing the lines from the custom catalog file @@ -404,9 +404,9 @@ public: *@param showerrs if true, notify user of problems parsing the header. *@param errs reference to the cumulative list of error reports */ - bool parseCustomDataHeader( QStringList lines, QStringList &Columns, - QString &catName, QString &catPrefix, QString &catColor, float &catEpoch, int &iStart, - bool showerrs, QStringList &errs ); + bool parseCustomDataHeader( TQStringList lines, TQStringList &Columns, + TQString &catName, TQString &catPrefix, TQString &catColor, float &catEpoch, int &iStart, + bool showerrs, TQStringList &errs ); /**@short Parse a line from custom object catalog. If parsing is successful, add *the object to the object list @@ -418,8 +418,8 @@ public: *@param showerrs if true, notify user of problems parsing the header. *@param errs reference to the cumulative list of error reports */ - bool processCustomDataLine( int num, QStringList d, QStringList Columns, - QString Prefix, QPtrList &objList, bool showerrs, QStringList &errs ); + bool processCustomDataLine( int num, TQStringList d, TQStringList Columns, + TQString Prefix, TQPtrList &objList, bool showerrs, TQStringList &errs ); /**@short reset the faint limit for the stellar database *@param newMagnitude the new faint limit. @@ -452,7 +452,7 @@ public: *@param name Object name to find *@return pointer to SkyObject matching this name */ - SkyObject* objectNamed( const QString &name ); + SkyObject* objectNamed( const TQString &name ); /**The Sky is updated more frequently than the moon, which is updated more frequently *than the planets. The date of the last update for each category is recorded so we @@ -504,7 +504,7 @@ public: /**@return reference to the CustomCatalogs list */ - QPtrList& customCatalogs() { return CustomCatalogs; } + TQPtrList& customCatalogs() { return CustomCatalogs; } /**Set the GeoLocation according to the argument. *@param l reference to the new GeoLocation @@ -537,7 +537,7 @@ public: *@param map pointer to the SkyMap object. *@return TRUE if the script was successfully parsed. */ - bool executeScript( const QString &name, SkyMap *map ); + bool executeScript( const TQString &name, SkyMap *map ); /**@short Initialize celestial equator, horizon and ecliptic. *@param num pointer to a KSNumbers object to use. @@ -554,7 +554,7 @@ public: signals: /**Signal that specifies the text that should be drawn in the KStarsSplash window. */ - void progressText(QString); + void progressText(TQString); /**Signal that the Data initialization has finished. */ @@ -576,7 +576,7 @@ public slots: void initialize(); /**@short send a message to the console*/ - void slotConsoleMessage( QString s ) { std::cout << s.utf8() << std::endl; } + void slotConsoleMessage( TQString s ) { std::cout << s.utf8() << std::endl; } /**Update the Simulation Clock. Update positions of Planets. Update *Alt/Az coordinates of objects. Update precession. Update Focus position. @@ -612,17 +612,17 @@ public slots: /**@short Save the screen position of the Time infobox. *@param p the position of the box */ - void saveTimeBoxPos( QPoint p ); + void saveTimeBoxPos( TQPoint p ); /**@short Save the screen position of the Time infobox. *@param p the position of the box */ - void saveGeoBoxPos( QPoint p ); + void saveGeoBoxPos( TQPoint p ); /**@short Save the screen position of the Time infobox. *@param p the position of the box */ - void saveFocusBoxPos( QPoint p ); + void saveFocusBoxPos( TQPoint p ); private slots: /**This function runs while the splash screen is displayed as KStars is @@ -658,7 +658,7 @@ private: *@param required if TRUE, then the error message is more severe, and the program *exits when the messagebox is closed. */ - void initError(QString fn, bool required); + void initError(TQString fn, bool required); /**Reset local time to new daylight saving time. Use this function if DST has changed. *Used by updateTime(). @@ -681,49 +681,49 @@ private: /* bool openSAOFile(int i);*/ bool openStarFile(int i); - static QPtrList geoList; - QPtrList objList; + static TQPtrList geoList; + TQPtrList objList; - QPtrList starList; + TQPtrList starList; unsigned int StarCount; /** List of all deep sky objects */ - QPtrList deepSkyList; + TQPtrList deepSkyList; /** List of all deep sky objects per type, to speed up drawing the sky map */ - QPtrList deepSkyListMessier; + TQPtrList deepSkyListMessier; /** List of all deep sky objects per type, to speed up drawing the sky map */ - QPtrList deepSkyListNGC; + TQPtrList deepSkyListNGC; /** List of all deep sky objects per type, to speed up drawing the sky map */ - QPtrList deepSkyListIC; + TQPtrList deepSkyListIC; /** List of all deep sky objects per type, to speed up drawing the sky map */ - QPtrList deepSkyListOther; - - QPtrList asteroidList; - QPtrList cometList; - - QPtrList MilkyWay[NMWFILES]; - - QPtrList clineList; - QPtrList csegmentList; - QPtrList clineModeList; - QPtrList cnameList; - QPtrList ObjLabelList; - - QPtrList Equator; - QPtrList Ecliptic; - QPtrList Horizon; - QPtrList VariableStarsList; - QPtrList ADVtreeList; - QPtrList INDIHostsList; - QPtrList INDITelescopeList; + TQPtrList deepSkyListOther; + + TQPtrList asteroidList; + TQPtrList cometList; + + TQPtrList MilkyWay[NMWFILES]; + + TQPtrList clineList; + TQPtrList csegmentList; + TQPtrList clineModeList; + TQPtrList cnameList; + TQPtrList ObjLabelList; + + TQPtrList Equator; + TQPtrList Ecliptic; + TQPtrList Horizon; + TQPtrList VariableStarsList; + TQPtrList ADVtreeList; + TQPtrList INDIHostsList; + TQPtrList INDITelescopeList; - QPtrList CustomCatalogs; + TQPtrList CustomCatalogs; ObjectNameList ObjNames; - static QMap Rulebook; - static QStringList CustomColumns; + static TQMap Rulebook; + static TQStringList CustomColumns; GeoLocation Geo; SimClock Clock; @@ -733,13 +733,13 @@ private: bool TimeRunsForward, temporaryTrail, snapToFocus; - QString cnameFile; + TQString cnameFile; KStandardDirs *stdDirs; KLocale *locale; dms *LST, *HourAngle; - QString TypeName[NTYPENAME]; + TQString TypeName[NTYPENAME]; KKey resumeKey; PlanetCatalog *PCat; @@ -755,16 +755,16 @@ private: KStarsDateTime NextDSTChange; KStarsDateTime StoredDate; - QTimer *initTimer; + TQTimer *initTimer; int initCounter; /** *Reloading of star data asynchronous: - *QDataPump connects FileSource and StarDataSink and starts data transmission. + *TQDataPump connects FileSource and StarDataSink and starts data transmission. */ FileSource *source; StarDataSink *loader; - QDataPump *pump; + TQDataPump *pump; /** *Count the number of KStarsData objects. diff --git a/kstars/kstars/kstarsdatetime.cpp b/kstars/kstars/kstarsdatetime.cpp index 74d1fc20..6b406f44 100644 --- a/kstars/kstars/kstarsdatetime.cpp +++ b/kstars/kstars/kstarsdatetime.cpp @@ -35,13 +35,13 @@ KStarsDateTime::KStarsDateTime( const KStarsDateTime &kdt ) : ExtDateTime() { KStarsDateTime::KStarsDateTime( const ExtDateTime &edt ) : ExtDateTime( edt ) { //don't call setDJD() because we don't need to compute the time; just set DJD directly - QTime _t = edt.time(); + TQTime _t = edt.time(); ExtDate _d = edt.date(); long double jdFrac = ( _t.hour()-12 + ( _t.minute() + ( _t.second() + _t.msec()/1000.)/60.)/60.)/24.; DJD = (long double)( _d.jd() ) + jdFrac; } -KStarsDateTime::KStarsDateTime( const ExtDate &_d, const QTime &_t ) : ExtDateTime( _d, _t ) { +KStarsDateTime::KStarsDateTime( const ExtDate &_d, const TQTime &_t ) : ExtDateTime( _d, _t ) { //don't call setDJD() because we don't need to compute the time; just set DJD directly long double jdFrac = ( _t.hour()-12 + ( _t.minute() + ( _t.second() + _t.msec()/1000.)/60.)/60.)/24.; DJD = (long double)( _d.jd() ) + jdFrac; @@ -56,7 +56,7 @@ KStarsDateTime::KStarsDateTime( long double _jd ) : ExtDateTime() { } KStarsDateTime KStarsDateTime::currentDateTime() { - KStarsDateTime dt( ExtDate::currentDate(), QTime::currentTime() ); + KStarsDateTime dt( ExtDate::currentDate(), TQTime::currentTime() ); if ( dt.time().hour()==0 && dt.time().minute()==0 ) // midnight or right after? dt.setDate( ExtDate::currentDate() ); // fetch date again @@ -78,7 +78,7 @@ void KStarsDateTime::setDJD( long double _jd ) { int s = int( 60.*(60.*(hour - h) - m) ); int ms = int( 1000.*(60.*(60.*(hour - h) - m) - s) ); - ExtDateTime::setTime( QTime( h, m, s, ms ) ); + ExtDateTime::setTime( TQTime( h, m, s, ms ) ); } void KStarsDateTime::setDate( const ExtDate &_d ) { @@ -89,7 +89,7 @@ void KStarsDateTime::setDate( const ExtDate &_d ) { setDJD( (long double)_d.jd() + jdFrac ); } -void KStarsDateTime::setTime( const QTime &_t ) { +void KStarsDateTime::setTime( const TQTime &_t ) { KStarsDateTime _dt( date(), _t ); setDJD( _dt.djd() ); } @@ -110,7 +110,7 @@ dms KStarsDateTime::GSTat0hUT() const { double sinOb, cosOb; // Mean greenwich sidereal time - KStarsDateTime t0( date(), QTime( 0, 0, 0 ) ); + KStarsDateTime t0( date(), TQTime( 0, 0, 0 ) ); long double s = t0.djd() - J2000; double t = s/36525.0; double t1 = 6.697374558 + 2400.051336*t + 0.000025862*t*t + @@ -132,7 +132,7 @@ dms KStarsDateTime::GSTat0hUT() const { return gst.reduce(); } -QTime KStarsDateTime::GSTtoUT( dms GST ) const { +TQTime KStarsDateTime::GSTtoUT( dms GST ) const { dms gst0 = GSTat0hUT(); //dt is the number of sidereal hours since UT 0h. @@ -148,7 +148,7 @@ QTime KStarsDateTime::GSTtoUT( dms GST ) const { int sc = int( 60.0*( 60.0*( dt - double( hr ) ) - double( mn ) ) ); int ms = int( 1000.0*( 60.0*( 60.0*( dt - double(hr) ) - double(mn) ) - double(sc) ) ); - return( QTime( hr, mn, sc, ms ) ); + return( TQTime( hr, mn, sc, ms ) ); } void KStarsDateTime::setFromEpoch( double epoch ) { @@ -158,7 +158,7 @@ void KStarsDateTime::setFromEpoch( double epoch ) { setDJD( J2000 ); } else { int year = int( epoch ); - KStarsDateTime dt( ExtDate( year, 1, 1 ), QTime( 0, 0, 0 ) ); + KStarsDateTime dt( ExtDate( year, 1, 1 ), TQTime( 0, 0, 0 ) ); double days = (double)(dt.date().daysInYear())*( epoch - (double)year ); dt = dt.addSecs( days*86400. ); //set date and time based on the number of days into the year setDJD( dt.djd() ); diff --git a/kstars/kstars/kstarsdatetime.h b/kstars/kstars/kstarsdatetime.h index 37e565aa..a45e2495 100644 --- a/kstars/kstars/kstarsdatetime.h +++ b/kstars/kstars/kstarsdatetime.h @@ -88,9 +88,9 @@ public: *@short Constructor *Create a KStarsDateTimne based on the specified Date and Time. *@p _d The ExtDate to assign - *@p _t The QTime to assign + *@p _t The TQTime to assign */ - KStarsDateTime( const ExtDate &_d, const QTime &_t ); + KStarsDateTime( const ExtDate &_d, const TQTime &_t ); /** *Assign the (long double) Julian Day value, which includes the time of day @@ -106,10 +106,10 @@ public: void setDate( const ExtDate &d ); /** - *Assign the Time according to a QTime object. - *@p t the QTime to assign + *Assign the Time according to a TQTime object. + *@p t the TQTime to assign */ - void setTime( const QTime &t ); + void setTime( const TQTime &t ); /** *Modify the Date/Time by adding a number of seconds. @@ -167,7 +167,7 @@ public: *Convert a given Greenwich Sidereal Time to Universal Time (=Greenwich Mean Time). *@p GST the Greenwich Sidereal Time to convert to Universal Time. */ - QTime GSTtoUT( dms GST ) const; + TQTime GSTtoUT( dms GST ) const; /** diff --git a/kstars/kstars/kstarsdcop.cpp b/kstars/kstars/kstarsdcop.cpp index b6dae356..b4a22ba9 100644 --- a/kstars/kstars/kstarsdcop.cpp +++ b/kstars/kstars/kstarsdcop.cpp @@ -17,9 +17,9 @@ //KStars DCOP functions -#include -#include -#include +#include +#include +#include #include #include @@ -56,8 +56,8 @@ void KStars::setAltAz( double alt, double az ) { map()->setDestinationAltAz(alt,az); } -void KStars::lookTowards ( const QString direction ) { - QString dir = direction.lower(); +void KStars::lookTowards ( const TQString direction ) { + TQString dir = direction.lower(); if (dir == "zenith" || dir=="z") map()->invokeKey( KKey( "Z" ).keyCodeQt() ); else if (dir == "north" || dir=="n") map()->invokeKey( KKey( "N" ).keyCodeQt() ); else if (dir == "east" || dir=="e") map()->invokeKey( KKey( "E" ).keyCodeQt() ); @@ -101,15 +101,15 @@ void KStars::zoom( double z ) { } void KStars::setLocalTime(int yr, int mth, int day, int hr, int min, int sec) { - data()->changeDateTime( geo()->LTtoUT( KStarsDateTime( ExtDate(yr, mth, day), QTime(hr,min,sec) ) ) ); + data()->changeDateTime( geo()->LTtoUT( KStarsDateTime( ExtDate(yr, mth, day), TQTime(hr,min,sec) ) ) ); } void KStars::waitFor( double t ) { kapp->dcopClient()->suspend(); - QTimer::singleShot( int( 1000.*t ), this, SLOT( resumeDCOP() ) ); + TQTimer::singleShot( int( 1000.*t ), this, TQT_SLOT( resumeDCOP() ) ); } -void KStars::waitForKey( const QString k ) { +void KStars::waitForKey( const TQString k ) { data()->resumeKey = KKey( k ); if ( ! data()->resumeKey.isNull() ) { kapp->dcopClient()->suspend(); @@ -122,7 +122,7 @@ void KStars::setTracking( bool track ) { if ( track != Options::isTracking() ) slotTrack(); } -void KStars::popupMessage( int /*x*/, int /*y*/, QString /*message*/ ){ +void KStars::popupMessage( int /*x*/, int /*y*/, TQString /*message*/ ){ //Show a small popup window at (x,y) with a text message } @@ -130,7 +130,7 @@ void KStars::drawLine( int /*x1*/, int /*y1*/, int /*x2*/, int /*y2*/, int /*spe //Draw a line on the skymap display } -void KStars::setGeoLocation( QString city, QString province, QString country ) { +void KStars::setGeoLocation( TQString city, TQString province, TQString country ) { //Set the geographic location bool cityFound( false ); @@ -204,18 +204,18 @@ void KStars::writeConfig() { data()->StoredDate.setDJD( data()->lt().djd() ); } -QString KStars::getOption( const QString &name ) { +TQString KStars::getOption( const TQString &name ) { //Some config items are not stored in the Options object while //the program is running; catch these here and returntheir current value. - if ( name == "FocusRA" ) { return QString::number( map()->focus()->ra()->Hours(), 'f', 6 ); } - if ( name == "FocusDec" ) { return QString::number( map()->focus()->dec()->Degrees(), 'f', 6 ); } + if ( name == "FocusRA" ) { return TQString::number( map()->focus()->ra()->Hours(), 'f', 6 ); } + if ( name == "FocusDec" ) { return TQString::number( map()->focus()->dec()->Degrees(), 'f', 6 ); } KConfigSkeletonItem *it = Options::self()->findItem( name ); if ( it ) return it->property().toString(); - else return QString::null; + else return TQString::null; } -void KStars::changeViewOption( const QString op, const QString val ) { +void KStars::changeViewOption( const TQString op, const TQString val ) { bool bOk(false), nOk(false), dOk(false); //parse bool value @@ -332,7 +332,7 @@ void KStars::changeViewOption( const QString op, const QString val ) { map()->forceUpdate(); } -void KStars::setColor( const QString name, const QString value ) { +void KStars::setColor( const TQString name, const TQString value ) { ColorScheme *cs = data()->colorScheme(); if ( cs->hasColorNamed( name ) ) { cs->setColor( name, value ); @@ -340,9 +340,9 @@ void KStars::setColor( const QString name, const QString value ) { } } -void KStars::loadColorScheme( const QString _name ) { - QString name( _name ); - QString filename = name.lower().stripWhiteSpace(); +void KStars::loadColorScheme( const TQString _name ) { + TQString name( _name ); + TQString filename = name.lower().stripWhiteSpace(); bool ok( false ); //Parse default names which don't follow the regular file-naming scheme @@ -375,32 +375,32 @@ void KStars::loadColorScheme( const QString _name ) { //set the application colors for the Night Vision scheme if ( Options::darkAppColors() == false && filename == "night.colors" ) { Options::setDarkAppColors( true ); - OriginalPalette = QApplication::palette(); - QApplication::setPalette( DarkPalette, true ); + OriginalPalette = TQApplication::palette(); + TQApplication::setPalette( DarkPalette, true ); } if ( Options::darkAppColors() && filename != "night.colors" ) { Options::setDarkAppColors( false ); - QApplication::setPalette( OriginalPalette, true ); + TQApplication::setPalette( OriginalPalette, true ); } map()->forceUpdate(); } } -void KStars::exportImage( const QString url, int w, int h ) { +void KStars::exportImage( const TQString url, int w, int h ) { //If the filename string contains no "/" separators, assume the //user wanted to place a file in their home directory. KURL fileURL; - if ( ! url.contains( "/" ) ) fileURL = QDir::homeDirPath() + "/" + url; + if ( ! url.contains( "/" ) ) fileURL = TQDir::homeDirPath() + "/" + url; else fileURL = url; KTempFile tmpfile; - QString fname; + TQString fname; tmpfile.setAutoDelete(true); - QPixmap skyimage( map()->width(), map()->height() ); - QPixmap outimage( w, h ); + TQPixmap skyimage( map()->width(), map()->height() ); + TQPixmap outimage( w, h ); outimage.fill(); if ( fileURL.isValid() ) { @@ -411,7 +411,7 @@ void KStars::exportImage( const QString url, int w, int h ) { } //Determine desired image format from filename extension - QString ext = fname.mid( fname.findRev(".")+1 ); + TQString ext = fname.mid( fname.findRev(".")+1 ); const char* format = "PNG"; if ( ext.lower() == "png" ) { format = "PNG"; } else if ( ext.lower() == "jpg" || ext.lower() == "jpeg" ) { format = "JPG"; } @@ -452,7 +452,7 @@ void KStars::exportImage( const QString url, int w, int h ) { if ( tmpfile.name() == fname ) { //attempt to upload image to remote location if ( ! KIO::NetAccess::upload( tmpfile.name(), fileURL, this ) ) { - QString message = i18n( "Could not upload image to remote location: %1" ).arg( fileURL.prettyURL() ); + TQString message = i18n( "Could not upload image to remote location: %1" ).arg( fileURL.prettyURL() ); KMessageBox::sorry( 0, message, i18n( "Could not upload file" ) ); } } @@ -460,7 +460,7 @@ void KStars::exportImage( const QString url, int w, int h ) { } void KStars::printImage( bool usePrintDialog, bool useChartColors ) { - KPrinter printer( true, QPrinter::HighResolution ); + KPrinter printer( true, TQPrinter::HighResolution ); printer.setFullPage( false ); //Set up the printer (either with the Print Dialog, @@ -500,7 +500,7 @@ void KStars::printImage( bool usePrintDialog, bool useChartColors ) { } } -void KStars::startINDI (QString deviceName, bool useLocal) +void KStars::startINDI (TQString deviceName, bool useLocal) { establishINDI(); @@ -511,7 +511,7 @@ void KStars::startINDI (QString deviceName, bool useLocal) return; } - QListViewItem *driverItem = NULL; + TQListViewItem *driverItem = NULL; driverItem = indidriver->localListView->findItem(deviceName, 0); if (driverItem == NULL) { @@ -542,7 +542,7 @@ void KStars::startINDI (QString deviceName, bool useLocal) } -void KStars::shutdownINDI (QString deviceName) +void KStars::shutdownINDI (TQString deviceName) { if (!indidriver || !indimenu) { @@ -550,7 +550,7 @@ void KStars::shutdownINDI (QString deviceName) return; } - QListViewItem *driverItem = NULL; + TQListViewItem *driverItem = NULL; driverItem = indidriver->localListView->findItem(deviceName, 0); if (driverItem == NULL) { @@ -563,7 +563,7 @@ void KStars::shutdownINDI (QString deviceName) } -void KStars::switchINDI(QString deviceName, bool turnOn) +void KStars::switchINDI(TQString deviceName, bool turnOn) { INDI_D *dev; INDI_P *prop; @@ -597,7 +597,7 @@ void KStars::switchINDI(QString deviceName, bool turnOn) } -void KStars::setINDIPort(QString deviceName, QString port) +void KStars::setINDIPort(TQString deviceName, TQString port) { INDI_D *dev; INDI_P *prop; @@ -633,7 +633,7 @@ void KStars::setINDIPort(QString deviceName, QString port) } -void KStars::setINDITargetCoord(QString deviceName, double RA, double DEC) +void KStars::setINDITargetCoord(TQString deviceName, double RA, double DEC) { INDI_D *dev; INDI_P *prop; @@ -661,20 +661,20 @@ void KStars::setINDITargetCoord(QString deviceName, double RA, double DEC) if (!el) return; if (!el->write_w) return; - el->write_w->setText(QString("%1").arg(RA)); + el->write_w->setText(TQString("%1").arg(RA)); el = prop->findElement("DEC"); if (!el) return; if (!el->write_w) return; - el->write_w->setText(QString("%1").arg(DEC)); + el->write_w->setText(TQString("%1").arg(DEC)); prop->newText(); } -void KStars::setINDITargetName(QString deviceName, QString objectName) +void KStars::setINDITargetName(TQString deviceName, TQString objectName) { INDI_D *dev; INDI_P *prop; @@ -705,20 +705,20 @@ void KStars::setINDITargetName(QString deviceName, QString objectName) if (!el) return; if (!el->write_w) return; - el->write_w->setText(QString("%1").arg(target->ra()->Hours())); + el->write_w->setText(TQString("%1").arg(target->ra()->Hours())); el = prop->findElement("DEC"); if (!el) return; if (!el->write_w) return; - el->write_w->setText(QString("%1").arg(target->dec()->Degrees())); + el->write_w->setText(TQString("%1").arg(target->dec()->Degrees())); prop->newText(); } -void KStars::setINDIAction(QString deviceName, QString action) +void KStars::setINDIAction(TQString deviceName, TQString action) { INDI_D *dev; INDI_E *el; @@ -746,7 +746,7 @@ void KStars::setINDIAction(QString deviceName, QString action) } -void KStars::waitForINDIAction(QString deviceName, QString action) +void KStars::waitForINDIAction(TQString deviceName, TQString action) { INDI_D *dev; @@ -775,17 +775,17 @@ void KStars::waitForINDIAction(QString deviceName, QString action) el = dev->findElem(action); if (!el) return; - QObject::connect(el->pp, SIGNAL(okState()), this, SLOT(resumeDCOP(void ))); + TQObject::connect(el->pp, TQT_SIGNAL(okState()), this, TQT_SLOT(resumeDCOP(void ))); } else - QObject::connect(prop, SIGNAL(okState()), this, SLOT(resumeDCOP(void ))); + TQObject::connect(prop, TQT_SIGNAL(okState()), this, TQT_SLOT(resumeDCOP(void ))); kapp->dcopClient()->suspend(); } -void KStars::setINDIFocusSpeed(QString deviceName, unsigned int speed) +void KStars::setINDIFocusSpeed(TQString deviceName, unsigned int speed) { INDI_D *dev; INDI_P *prop; @@ -813,14 +813,14 @@ void KStars::setINDIFocusSpeed(QString deviceName, unsigned int speed) if (!el) return; if (!el->write_w) return; - el->write_w->setText(QString("%1").arg(speed)); + el->write_w->setText(TQString("%1").arg(speed)); prop->newText(); } -void KStars::startINDIFocus(QString deviceName, int focusDir) +void KStars::startINDIFocus(TQString deviceName, int focusDir) { if (!indidriver || !indimenu) { @@ -836,7 +836,7 @@ void KStars::startINDIFocus(QString deviceName, int focusDir) } -void KStars::setINDIGeoLocation(QString deviceName, double longitude, double latitude) +void KStars::setINDIGeoLocation(TQString deviceName, double longitude, double latitude) { INDI_D *dev; @@ -865,20 +865,20 @@ void KStars::setINDIGeoLocation(QString deviceName, double longitude, double lat if (!el) return; if (!el->write_w) return; - el->write_w->setText(QString("%1").arg(longitude)); + el->write_w->setText(TQString("%1").arg(longitude)); el = prop->findElement("LAT"); if (!el) return; if (!el->write_w) return; - el->write_w->setText(QString("%1").arg(latitude)); + el->write_w->setText(TQString("%1").arg(latitude)); prop->newText(); } -void KStars::setINDIFocusTimeout(QString deviceName, int timeout) +void KStars::setINDIFocusTimeout(TQString deviceName, int timeout) { INDI_D *dev; INDI_P *prop; @@ -907,7 +907,7 @@ void KStars::setINDIFocusTimeout(QString deviceName, int timeout) if (!el) return; if (el->write_w) - el->write_w->setText(QString("%1").arg(timeout)); + el->write_w->setText(TQString("%1").arg(timeout)); else if (el->spin_w) el->spin_w->setValue(timeout); @@ -916,7 +916,7 @@ void KStars::setINDIFocusTimeout(QString deviceName, int timeout) } -void KStars::startINDIExposure(QString deviceName, int timeout) +void KStars::startINDIExposure(TQString deviceName, int timeout) { INDI_D *dev; INDI_P *prop; @@ -944,7 +944,7 @@ void KStars::startINDIExposure(QString deviceName, int timeout) if (!el) return; if (el->write_w) - el->write_w->setText(QString("%1").arg(timeout)); + el->write_w->setText(TQString("%1").arg(timeout)); else if (el->spin_w) el->spin_w->setValue(timeout); @@ -953,7 +953,7 @@ void KStars::startINDIExposure(QString deviceName, int timeout) } -void KStars::setINDIFilterNum(QString deviceName, int filter_num) +void KStars::setINDIFilterNum(TQString deviceName, int filter_num) { INDI_D *dev; INDI_P *prop; @@ -981,7 +981,7 @@ void KStars::setINDIFilterNum(QString deviceName, int filter_num) if (!el) return; if (el->write_w) - el->write_w->setText(QString("%1").arg(filter_num)); + el->write_w->setText(TQString("%1").arg(filter_num)); else if (el->spin_w) el->spin_w->setValue(filter_num); @@ -989,7 +989,7 @@ void KStars::setINDIFilterNum(QString deviceName, int filter_num) } -void KStars::setINDIUTC(QString deviceName, QString UTCDateTime) +void KStars::setINDIUTC(TQString deviceName, TQString UTCDateTime) { INDI_D *dev; INDI_P *prop; @@ -1023,17 +1023,17 @@ void KStars::setINDIUTC(QString deviceName, QString UTCDateTime) } -void KStars::setINDIScopeAction(QString deviceName, QString action) +void KStars::setINDIScopeAction(TQString deviceName, TQString action) { setINDIAction(deviceName, action); } -void KStars::setINDIFrameType(QString deviceName, QString type) +void KStars::setINDIFrameType(TQString deviceName, TQString type) { setINDIAction(deviceName, type); } -void KStars::setINDICCDTemp(QString deviceName, int temp) +void KStars::setINDICCDTemp(TQString deviceName, int temp) { INDI_D *dev; INDI_P *prop; @@ -1061,7 +1061,7 @@ void KStars::setINDICCDTemp(QString deviceName, int temp) if (!el) return; if (el->write_w) - el->write_w->setText(QString("%1").arg(temp)); + el->write_w->setText(TQString("%1").arg(temp)); else if (el->spin_w) el->spin_w->setValue(temp); diff --git a/kstars/kstars/kstarsinit.cpp b/kstars/kstars/kstarsinit.cpp index 22c4cfb6..276e5c8a 100644 --- a/kstars/kstars/kstarsinit.cpp +++ b/kstars/kstars/kstarsinit.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include #include @@ -49,66 +49,66 @@ void KStars::initActions() { //File Menu: new KAction(i18n("&New Window"), "window_new", KShortcut( "Ctrl+N" ), - this, SLOT( newWindow() ), actionCollection(), "new_window"); + this, TQT_SLOT( newWindow() ), actionCollection(), "new_window"); new KAction(i18n("&Close Window"), "fileclose", KShortcut( "Ctrl+W" ), - this, SLOT( closeWindow() ), actionCollection(), "close_window"); + this, TQT_SLOT( closeWindow() ), actionCollection(), "close_window"); new KAction( i18n( "&Download Data..." ), "knewstuff", KShortcut( "Ctrl+D" ), - this, SLOT( slotDownload() ), actionCollection(), "get_data" ); - new KAction( i18n( "Open FITS..."), "fileopen", KShortcut( "Ctrl+O"), this, SLOT( slotOpenFITS()), actionCollection(), "open_file"); + this, TQT_SLOT( slotDownload() ), actionCollection(), "get_data" ); + new KAction( i18n( "Open FITS..."), "fileopen", KShortcut( "Ctrl+O"), this, TQT_SLOT( slotOpenFITS()), actionCollection(), "open_file"); new KAction( i18n( "&Save Sky Image..." ), "fileexport", KShortcut( "Ctrl+I" ), - this, SLOT( slotExportImage() ), actionCollection(), "export_image" ); + this, TQT_SLOT( slotExportImage() ), actionCollection(), "export_image" ); new KAction( i18n( "&Run Script..." ), "launch", KShortcut( "Ctrl+R" ), - this, SLOT( slotRunScript() ), actionCollection(), "run_script" ); - KStdAction::print(this, SLOT( slotPrint() ), actionCollection(), "print" ); - KStdAction::quit(this, SLOT( close() ), actionCollection(), "quit" ); + this, TQT_SLOT( slotRunScript() ), actionCollection(), "run_script" ); + KStdAction::print(this, TQT_SLOT( slotPrint() ), actionCollection(), "print" ); + KStdAction::quit(this, TQT_SLOT( close() ), actionCollection(), "quit" ); //Time Menu: new KAction( i18n( "Set Time to &Now" ), KShortcut( "Ctrl+E" ), - this, SLOT( slotSetTimeToNow() ), actionCollection(), "time_to_now" ); + this, TQT_SLOT( slotSetTimeToNow() ), actionCollection(), "time_to_now" ); new KAction( i18n( "set Clock to New Time", "&Set Time..." ), "clock", KShortcut( "Ctrl+S" ), - this, SLOT( slotSetTime() ), actionCollection(), "time_dialog" ); + this, TQT_SLOT( slotSetTime() ), actionCollection(), "time_dialog" ); ToggleAction *actTimeRun = new ToggleAction( i18n( "Stop &Clock" ), BarIcon("player_pause"), i18n("Start &Clock"), BarIcon("1rightarrow"), - 0, this, SLOT( slotToggleTimer() ), actionCollection(), "timer_control" ); + 0, this, TQT_SLOT( slotToggleTimer() ), actionCollection(), "timer_control" ); actTimeRun->setOffToolTip( i18n( "Start Clock" ) ); actTimeRun->setOnToolTip( i18n( "Stop Clock" ) ); - QObject::connect(data()->clock(), SIGNAL(clockStarted()), actTimeRun, SLOT(turnOn()) ); - QObject::connect(data()->clock(), SIGNAL(clockStopped()), actTimeRun, SLOT(turnOff()) ); + TQObject::connect(data()->clock(), TQT_SIGNAL(clockStarted()), actTimeRun, TQT_SLOT(turnOn()) ); + TQObject::connect(data()->clock(), TQT_SIGNAL(clockStopped()), actTimeRun, TQT_SLOT(turnOff()) ); //UpdateTime() if clock is stopped (so hidden objects get drawn) - QObject::connect(data()->clock(), SIGNAL(clockStopped()), this, SLOT(updateTime()) ); + TQObject::connect(data()->clock(), TQT_SIGNAL(clockStopped()), this, TQT_SLOT(updateTime()) ); //Focus Menu: new KAction(i18n( "&Zenith" ), KShortcut( "Z" ), - this, SLOT( slotPointFocus() ), actionCollection(), "zenith"); + this, TQT_SLOT( slotPointFocus() ), actionCollection(), "zenith"); new KAction(i18n( "&North" ), KShortcut( "N" ), - this, SLOT( slotPointFocus() ), actionCollection(), "north"); + this, TQT_SLOT( slotPointFocus() ), actionCollection(), "north"); new KAction(i18n( "&East" ), KShortcut( "E" ), - this, SLOT( slotPointFocus() ), actionCollection(), "east"); + this, TQT_SLOT( slotPointFocus() ), actionCollection(), "east"); new KAction(i18n( "&South" ), KShortcut( "S" ), - this, SLOT( slotPointFocus() ), actionCollection(), "south"); + this, TQT_SLOT( slotPointFocus() ), actionCollection(), "south"); new KAction(i18n( "&West" ), KShortcut( "W" ), - this, SLOT( slotPointFocus() ), actionCollection(), "west"); - KAction *tmpAction = KStdAction::find( this, SLOT( slotFind() ), + this, TQT_SLOT( slotPointFocus() ), actionCollection(), "west"); + KAction *tmpAction = KStdAction::find( this, TQT_SLOT( slotFind() ), actionCollection(), "find_object" ); tmpAction->setText( i18n( "&Find Object..." ) ); tmpAction->setToolTip( i18n( "Find object" ) ); new KAction( i18n( "Engage &Tracking" ), "decrypted", KShortcut( "Ctrl+T" ), - this, SLOT( slotTrack() ), actionCollection(), "track_object" ); + this, TQT_SLOT( slotTrack() ), actionCollection(), "track_object" ); new KAction( i18n( "Set Focus &Manually..." ), KShortcut( "Ctrl+M" ), - this, SLOT( slotManualFocus() ), actionCollection(), "manual_focus" ); + this, TQT_SLOT( slotManualFocus() ), actionCollection(), "manual_focus" ); //View Menu: - KStdAction::zoomIn(this, SLOT( slotZoomIn() ), actionCollection(), "zoom_in" ); - KStdAction::zoomOut(this, SLOT( slotZoomOut() ), actionCollection(), "zoom_out" ); + KStdAction::zoomIn(this, TQT_SLOT( slotZoomIn() ), actionCollection(), "zoom_in" ); + KStdAction::zoomOut(this, TQT_SLOT( slotZoomOut() ), actionCollection(), "zoom_out" ); new KAction( i18n( "&Default Zoom" ), "viewmagfit.png", KShortcut( "Ctrl+Z" ), - this, SLOT( slotDefaultZoom() ), actionCollection(), "zoom_default" ); + this, TQT_SLOT( slotDefaultZoom() ), actionCollection(), "zoom_default" ); new KAction( i18n( "&Zoom to Angular Size..." ), "viewmag.png", KShortcut( "Ctrl+Shift+Z" ), - this, SLOT( slotSetZoom() ), actionCollection(), "zoom_set" ); + this, TQT_SLOT( slotSetZoom() ), actionCollection(), "zoom_set" ); actCoordSys = new ToggleAction( i18n("Horizontal &Coordinates"), i18n( "Equatorial &Coordinates" ), - Key_Space, this, SLOT( slotCoordSys() ), actionCollection(), "coordsys" ); - KStdAction::fullScreen( this, SLOT( slotFullScreen() ), actionCollection(), 0 ); + Key_Space, this, TQT_SLOT( slotCoordSys() ), actionCollection(), "coordsys" ); + KStdAction::fullScreen( this, TQT_SLOT( slotFullScreen() ), actionCollection(), 0 ); //Settings Menu: @@ -122,45 +122,45 @@ void KStars::initActions() { KToggleAction *a = new KToggleAction(i18n( "Show the information boxes", "Show &Info Boxes"), 0, 0, 0, actionCollection(), "show_boxes"); a->setChecked( Options::showInfoBoxes() ); - QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(setVisible(bool))); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), infoBoxes(), TQT_SLOT(setVisible(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); a = new KToggleAction(i18n( "Show time-related info box", "Show &Time Box"), 0, 0, 0, actionCollection(), "show_time_box"); - QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(showTimeBox(bool))); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), infoBoxes(), TQT_SLOT(showTimeBox(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); a = new KToggleAction(i18n( "Show focus-related info box", "Show &Focus Box"), 0, 0, 0, actionCollection(), "show_focus_box"); - QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(showFocusBox(bool))); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), infoBoxes(), TQT_SLOT(showFocusBox(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); a = new KToggleAction(i18n( "Show location-related info box", "Show &Location Box"), 0, 0, 0, actionCollection(), "show_location_box"); - QObject::connect(a, SIGNAL( toggled(bool) ), infoBoxes(), SLOT(showGeoBox(bool))); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), infoBoxes(), TQT_SLOT(showGeoBox(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); //Toolbar view options a = new KToggleAction(i18n( "Show Main Toolbar" ), 0, 0, 0, actionCollection(), "show_mainToolBar"); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); a = new KToggleAction(i18n( "Show View Toolbar" ), 0, 0, 0, actionCollection(), "show_viewToolBar"); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); //Statusbar view options a = new KToggleAction(i18n( "Show Statusbar" ), 0, 0, 0, actionCollection(), "show_statusBar"); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); a = new KToggleAction(i18n( "Show Az/Alt Field" ), 0, 0, 0, actionCollection(), "show_sbAzAlt"); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); a = new KToggleAction(i18n( "Show RA/Dec Field" ), 0, 0, 0, actionCollection(), "show_sbRADec"); - QObject::connect(a, SIGNAL( toggled(bool) ), this, SLOT(slotShowGUIItem(bool))); + TQObject::connect(a, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT(slotShowGUIItem(bool))); //Color scheme actions. These are added to the "colorschemes" KActionMenu. colorActionMenu = new KActionMenu( i18n( "C&olor Schemes" ), actionCollection(), "colorschemes" ); @@ -170,11 +170,11 @@ void KStars::initActions() { addColorMenuItem( i18n( "&Moonless Night" ), "cs_moonless-night" ); //Add any user-defined color schemes: - QFile file; - QString line, schemeName, filename; + TQFile file; + TQString line, schemeName, filename; file.setName( locate( "appdata", "colors.dat" ) ); //determine filename in local user KDE directory tree. if ( file.exists() && file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.eof() ) { line = stream.readLine(); @@ -192,61 +192,61 @@ void KStars::initActions() { new KAction( i18n( "Location on Earth", "&Geographic..." ), "kstars_geo", KShortcut( "Ctrl+G" ), this, - SLOT( slotGeoLocator() ), actionCollection(), "geolocation" ); + TQT_SLOT( slotGeoLocator() ), actionCollection(), "geolocation" ); - KStdAction::preferences( this, SLOT( slotViewOps() ), actionCollection(), "configure" ); + KStdAction::preferences( this, TQT_SLOT( slotViewOps() ), actionCollection(), "configure" ); new KAction(i18n( "Startup Wizard..." ), "wizard", KShortcut(), - this, SLOT( slotWizard() ), actionCollection(), "startwizard" ); + this, TQT_SLOT( slotWizard() ), actionCollection(), "startwizard" ); //Tools Menu: new KAction(i18n( "Calculator..."), KShortcut( "Ctrl+C"), - this, SLOT( slotCalculator() ), actionCollection(), "astrocalculator"); + this, TQT_SLOT( slotCalculator() ), actionCollection(), "astrocalculator"); new KAction(i18n( "Observing List..."), KShortcut( "Ctrl+L"), - this, SLOT( slotObsList() ), actionCollection(), "obslist"); + this, TQT_SLOT( slotObsList() ), actionCollection(), "obslist"); // enable action only if file was loaded and processed successfully. if (!data()->VariableStarsList.isEmpty()) new KAction(i18n( "AAVSO Light Curves..."), KShortcut( "Ctrl+V"), - this, SLOT( slotLCGenerator() ), actionCollection(), "lightcurvegenerator"); + this, TQT_SLOT( slotLCGenerator() ), actionCollection(), "lightcurvegenerator"); new KAction(i18n( "Altitude vs. Time..."), KShortcut( "Ctrl+A"), - this, SLOT( slotAVT() ), actionCollection(), "altitude_vs_time"); + this, TQT_SLOT( slotAVT() ), actionCollection(), "altitude_vs_time"); new KAction(i18n( "What's up Tonight..."), KShortcut("Ctrl+U"), - this, SLOT(slotWUT()), actionCollection(), "whats_up_tonight"); + this, TQT_SLOT(slotWUT()), actionCollection(), "whats_up_tonight"); //FIXME GLOSSARY // new KAction(i18n( "Glossary..."), KShortcut("Ctrl+K"), -// this, SLOT(slotGlossary()), actionCollection(), "glossary"); +// this, TQT_SLOT(slotGlossary()), actionCollection(), "glossary"); new KAction(i18n( "Script Builder..."), KShortcut("Ctrl+B"), - this, SLOT(slotScriptBuilder()), actionCollection(), "scriptbuilder"); + this, TQT_SLOT(slotScriptBuilder()), actionCollection(), "scriptbuilder"); new KAction(i18n( "Solar System..."), KShortcut("Ctrl+Y"), - this, SLOT(slotSolarSystem()), actionCollection(), "solarsystem"); + this, TQT_SLOT(slotSolarSystem()), actionCollection(), "solarsystem"); new KAction(i18n( "Jupiter's Moons..."), KShortcut("Ctrl+J"), - this, SLOT(slotJMoonTool()), actionCollection(), "jmoontool"); + this, TQT_SLOT(slotJMoonTool()), actionCollection(), "jmoontool"); // devices Menu - new KAction(i18n("Telescope Wizard..."), 0, this, SLOT(slotTelescopeWizard()), actionCollection(), "telescope_wizard"); - new KAction(i18n("Telescope Properties..."), 0, this, SLOT(slotTelescopeProperties()), actionCollection(), "telescope_properties"); - new KAction(i18n("Device Manager..."), 0, this, SLOT(slotINDIDriver()), actionCollection(), "device_manager"); + new KAction(i18n("Telescope Wizard..."), 0, this, TQT_SLOT(slotTelescopeWizard()), actionCollection(), "telescope_wizard"); + new KAction(i18n("Telescope Properties..."), 0, this, TQT_SLOT(slotTelescopeProperties()), actionCollection(), "telescope_properties"); + new KAction(i18n("Device Manager..."), 0, this, TQT_SLOT(slotINDIDriver()), actionCollection(), "device_manager"); - tmpAction = new KAction(i18n("Capture Image Sequence..."), 0, this, SLOT(slotImageSequence()), actionCollection(), "capture_sequence"); + tmpAction = new KAction(i18n("Capture Image Sequence..."), 0, this, TQT_SLOT(slotImageSequence()), actionCollection(), "capture_sequence"); tmpAction->setEnabled(false); - tmpAction = new KAction(i18n("INDI Control Panel..."), 0, this, SLOT(slotINDIPanel()), actionCollection(), "indi_control_panel"); + tmpAction = new KAction(i18n("INDI Control Panel..."), 0, this, TQT_SLOT(slotINDIPanel()), actionCollection(), "indi_control_panel"); tmpAction->setEnabled(false); - new KAction(i18n("Configure INDI..."), 0, this, SLOT(slotINDIConf()), actionCollection(), "configure_indi"); + new KAction(i18n("Configure INDI..."), 0, this, TQT_SLOT(slotINDIConf()), actionCollection(), "configure_indi"); //Help Menu: new KAction( i18n( "Tip of the Day" ), "idea", 0, - this, SLOT( slotTipOfDay() ), actionCollection(), "help_tipofday" ); + this, TQT_SLOT( slotTipOfDay() ), actionCollection(), "help_tipofday" ); //Handbook toolBar item: new KAction( i18n( "&Handbook" ), "contents", KShortcut( "F1" ), - this, SLOT( appHelpActivated() ), actionCollection(), "handbook" ); + this, TQT_SLOT( appHelpActivated() ), actionCollection(), "handbook" ); // //viewToolBar actions: @@ -254,50 +254,50 @@ void KStars::initActions() { //show_stars: a = new KToggleAction( i18n( "Toggle Stars" ), "kstars_stars", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_stars" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_stars" ); //show_deepsky: a = new KToggleAction( i18n( "Toggle Deep Sky Objects" ), "kstars_deepsky", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_deepsky" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_deepsky" ); //show_planets: a = new KToggleAction( i18n( "Toggle Solar System" ), "kstars_planets", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_planets" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_planets" ); //show_clines: a = new KToggleAction( i18n( "Toggle Constellation Lines" ), "kstars_clines", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_clines" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_clines" ); //show_cnames: a = new KToggleAction( i18n( "Toggle Constellation Names" ), "kstars_cnames", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_cnames" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_cnames" ); //show_cbound: a = new KToggleAction( i18n( "Toggle Constellation Boundaries" ), "kstars_cbound", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_cbounds" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_cbounds" ); //show_mw: a = new KToggleAction( i18n( "Toggle Milky Way" ), "kstars_mw", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_mw" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_mw" ); //show_grid: a = new KToggleAction( i18n( "Toggle Coordinate Grid" ), "kstars_grid", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_grid" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_grid" ); //show_horizon: a = new KToggleAction( i18n( "Toggle Ground" ), "kstars_horizon", - 0, this, SLOT( slotViewToolBar() ), actionCollection(), "show_horizon" ); + 0, this, TQT_SLOT( slotViewToolBar() ), actionCollection(), "show_horizon" ); if (Options::fitsSaveDirectory().isEmpty()) - Options::setFitsSaveDirectory(QDir:: homeDirPath()); + Options::setFitsSaveDirectory(TQDir:: homeDirPath()); } void KStars::initFOV() { //Read in the user's fov.dat and populate the FOV menu with its symbols. If no fov.dat exists, populate //create a default version. - QFile f; - QStringList fields; - QString nm; + TQFile f; + TQStringList fields; + TQString nm; f.setName( locateLocal( "appdata", "fov.dat" ) ); @@ -308,7 +308,7 @@ void KStars::initFOV() { if ( ! f.open( IO_WriteOnly ) ) { kdDebug() << i18n( "Could not open fov.dat." ) << endl; } else { - QTextStream ostream(&f); + TQTextStream ostream(&f); ostream << i18n( "Do not use a field-of-view indicator", "No FOV" ) << ":0.0:0:#AAAAAA" << endl; ostream << i18n( "use field-of-view for binoculars", "7x35 Binoculars" ) << ":558:1:#AAAAAA" << endl; ostream << i18n( "use 1-degree field-of-view indicator", "One Degree" ) << ":60:2:#AAAAAA" << endl; @@ -320,14 +320,14 @@ void KStars::initFOV() { //just populate the FOV menu with items, don't need to fully parse the lines if ( f.open( IO_ReadOnly ) ) { - QTextStream stream( &f ); + TQTextStream stream( &f ); while ( !stream.eof() ) { - QString line = stream.readLine(); - fields = QStringList::split( ":", line ); + TQString line = stream.readLine(); + fields = TQStringList::split( ":", line ); if ( fields.count() == 4 ) { nm = fields[0].stripWhiteSpace(); - KToggleAction *kta = new KToggleAction( nm, 0, this, SLOT( slotTargetSymbol() ), + KToggleAction *kta = new KToggleAction( nm, 0, this, TQT_SLOT( slotTargetSymbol() ), actionCollection(), nm.utf8() ); kta->setExclusiveGroup( "fovsymbol" ); if ( nm == Options::fOVName() ) kta->setChecked( true ); @@ -339,14 +339,14 @@ void KStars::initFOV() { } fovActionMenu->popupMenu()->insertSeparator(); - fovActionMenu->insert( new KAction( i18n( "Edit FOV Symbols..." ), 0, this, SLOT( slotFOVEdit() ), actionCollection(), "edit_fov" ) ); + fovActionMenu->insert( new KAction( i18n( "Edit FOV Symbols..." ), 0, this, TQT_SLOT( slotFOVEdit() ), actionCollection(), "edit_fov" ) ); } void KStars::initStatusBar() { statusBar()->insertItem( i18n( " Welcome to KStars " ), 0, 1, true ); statusBar()->setItemAlignment( 0, AlignLeft | AlignVCenter ); - QString s = "000d 00m 00s, +00d 00\' 00\""; //only need this to set the width + TQString s = "000d 00m 00s, +00d 00\' 00\""; //only need this to set the width if ( Options::showAltAzField() ) { statusBar()->insertFixedItem( s, 1, true ); @@ -404,8 +404,8 @@ void KStars::datainitFinished(bool worked) { //it simply exits. Very strange. if ( Options::useAltAz() && Options::showGround() && map()->focus()->alt()->Degrees() < -1.0 ) { - QString caption = i18n( "Initial Position is Below Horizon" ); - QString message = i18n( "The initial position is below the horizon.\nWould you like to reset to the default position?" ); + TQString caption = i18n( "Initial Position is Below Horizon" ); + TQString message = i18n( "The initial position is below the horizon.\nWould you like to reset to the default position?" ); if ( KMessageBox::warningYesNo( this, message, caption, i18n("Reset Position"), i18n("Do Not Reset"), "dag_start_below_horiz" ) == KMessageBox::Yes ) { map()->setClickedObject( NULL ); @@ -442,7 +442,7 @@ void KStars::datainitFinished(bool worked) { void KStars::privatedata::buildGUI() { //create the widgets - ks->centralWidget = new QWidget( ks ); + ks->centralWidget = new TQWidget( ks ); ks->setCentralWidget( ks->centralWidget ); //set AAVSO modaless dialog pointer to 0 @@ -459,16 +459,16 @@ void KStars::privatedata::buildGUI() { ks->skymap = new SkyMap( ks->data(), ks->centralWidget ); // update skymap if KStarsData send update signal - QObject::connect(kstarsData, SIGNAL( update() ), ks->skymap, SLOT( forceUpdateNow() ) ); + TQObject::connect(kstarsData, TQT_SIGNAL( update() ), ks->skymap, TQT_SLOT( forceUpdateNow() ) ); // get focus of keyboard and mouse actions (for example zoom in with +) - ks->map()->QWidget::setFocus(); + ks->map()->TQWidget::setFocus(); ks->initStatusBar(); ks->initActions(); // create the layout of the central widget - ks->topLayout = new QVBoxLayout( ks->centralWidget ); + ks->topLayout = new TQVBoxLayout( ks->centralWidget ); ks->topLayout->addWidget( ks->skymap ); // 2nd parameter must be false, or plugActionList won't work! @@ -484,11 +484,11 @@ void KStars::privatedata::buildGUI() { //Changing the timestep needs to propagate to the clock, check if slew mode should be //(dis)engaged, and return input focus to the skymap. - connect( ks->TimeStep, SIGNAL( scaleChanged( float ) ), ks->data(), SLOT( setTimeDirection( float ) ) ); - connect( ks->TimeStep, SIGNAL( scaleChanged( float ) ), ks->data()->clock(), SLOT( setScale( float )) ); -// connect( ks->TimeStep, SIGNAL( scaleChanged( float ) ), ks->skymap, SLOT( slotClockSlewing() ) ); - connect( ks->data()->clock(), SIGNAL( scaleChanged( float ) ), ks->map(), SLOT( slotClockSlewing() ) ); - connect( ks->TimeStep, SIGNAL( scaleChanged( float ) ), ks, SLOT( mapGetsFocus() ) ); + connect( ks->TimeStep, TQT_SIGNAL( scaleChanged( float ) ), ks->data(), TQT_SLOT( setTimeDirection( float ) ) ); + connect( ks->TimeStep, TQT_SIGNAL( scaleChanged( float ) ), ks->data()->clock(), TQT_SLOT( setScale( float )) ); +// connect( ks->TimeStep, TQT_SIGNAL( scaleChanged( float ) ), ks->skymap, TQT_SLOT( slotClockSlewing() ) ); + connect( ks->data()->clock(), TQT_SIGNAL( scaleChanged( float ) ), ks->map(), TQT_SLOT( slotClockSlewing() ) ); + connect( ks->TimeStep, TQT_SIGNAL( scaleChanged( float ) ), ks, TQT_SLOT( mapGetsFocus() ) ); ks->resize( Options::windowWidth(), Options::windowHeight() ); @@ -507,11 +507,11 @@ void KStars::privatedata::buildGUI() { ks->data()->initGuides(&tempnum); //Connect the clock. - QObject::connect( ks->data()->clock(), SIGNAL( timeAdvanced() ), ks, SLOT( updateTime() ) ); - QObject::connect( ks->data()->clock(), SIGNAL( timeChanged() ), ks, SLOT( updateTime() ) ); + TQObject::connect( ks->data()->clock(), TQT_SIGNAL( timeAdvanced() ), ks, TQT_SLOT( updateTime() ) ); + TQObject::connect( ks->data()->clock(), TQT_SIGNAL( timeChanged() ), ks, TQT_SLOT( updateTime() ) ); // Connect cache function - QObject::connect( kstarsData, SIGNAL( clearCache() ), ks, SLOT( clearCachedFindDialog() ) ); + TQObject::connect( kstarsData, TQT_SIGNAL( clearCache() ), ks, TQT_SLOT( clearCachedFindDialog() ) ); SkyPoint newPoint; if ( ks->data()->useDefaultOptions ) { diff --git a/kstars/kstars/kstarsinterface.h b/kstars/kstars/kstarsinterface.h index 665dbb64..af3be358 100644 --- a/kstars/kstars/kstarsinterface.h +++ b/kstars/kstars/kstarsinterface.h @@ -52,7 +52,7 @@ class KStarsInterface : virtual public DCOPObject *@li zenith, z * */ - virtual ASYNC lookTowards( const QString direction ) = 0; + virtual ASYNC lookTowards( const TQString direction ) = 0; /**Set the zoomFactor. The zoomFactor is equal to the number of *pixels which subtend one radian of angle. @@ -102,7 +102,7 @@ class KStarsInterface : virtual public DCOPObject /**Pause execution of the script until a key is pressed *@param k the key which will resume the script */ - virtual ASYNC waitForKey( const QString k ) = 0; + virtual ASYNC waitForKey( const TQString k ) = 0; /**Turn tracking mode on or off. If tracking is on, then the coordinates at *the center of the screen remain fixed with time. If tracking is off, then @@ -122,25 +122,25 @@ class KStarsInterface : virtual public DCOPObject /**@return the value of an option in the config file *@param name the name of the option to be read */ - virtual QString getOption( const QString &name ) = 0; + virtual TQString getOption( const TQString &name ) = 0; /**Reset a View option. There are dozens of view options which can be adjusted *with this function. See the ScriptBuilder tool for a hierarchical list, or *see the kstarsrc config file. Different options require different data types - *for their argument. The value parameter will be recast from a QString to the + *for their argument. The value parameter will be recast from a TQString to the *correct data type for the specified option. If the value cannot be recast, *then the option will not be changed. *@param option the name of the option to change *@param value the new value for the option */ - virtual ASYNC changeViewOption( const QString option, const QString value ) = 0; + virtual ASYNC changeViewOption( const TQString option, const TQString value ) = 0; /**Show a message in a popup window (NOT YET IMPLEMENTED) *@param x the X-coordinate of the window *@param y the Y-coordinate of the window *@param message the text to be displayed */ - virtual ASYNC popupMessage( int x, int y, const QString message ) = 0; + virtual ASYNC popupMessage( int x, int y, const TQString message ) = 0; /**Draw a line on the sky map (NOT YET IMPLEMENTED) *@param x1 the x-coordinate of the starting point of the line @@ -157,18 +157,18 @@ class KStarsInterface : virtual public DCOPObject *@param province the name of the province or US state *@param country the name of the country */ - virtual ASYNC setGeoLocation( const QString city, const QString province, const QString country ) = 0; + virtual ASYNC setGeoLocation( const TQString city, const TQString province, const TQString country ) = 0; /**Adjust one of the color settings. *@param colorName The name of the color to change (see one of the *.colors files, or colorscheme.cpp) *@param value The new color setting */ - virtual ASYNC setColor( const QString colorName, const QString value ) = 0; + virtual ASYNC setColor( const TQString colorName, const TQString value ) = 0; /**Load a color scheme *@param name The name of the color scheme to be loaded */ - virtual ASYNC loadColorScheme( const QString name ) = 0; + virtual ASYNC loadColorScheme( const TQString name ) = 0; /**Export an image of the current sky to a file on disk. *@param filename The filename for the exported image (the image type @@ -177,7 +177,7 @@ class KStarsInterface : virtual public DCOPObject *@param width the width of the image *@param height the height of the image */ - virtual ASYNC exportImage( const QString filename, int width, int height ) = 0; + virtual ASYNC exportImage( const TQString filename, int width, int height ) = 0; /**Print the current sky map. Options to show the Print Dialog and to use Star Chart colors. */ @@ -189,38 +189,38 @@ class KStarsInterface : virtual public DCOPObject *@param deviceName The INDI device name *@param useLocal If true, starts the device in local mode. Otherwise, in server mode. */ - virtual ASYNC startINDI (QString deviceName, bool useLocal) = 0; + virtual ASYNC startINDI (TQString deviceName, bool useLocal) = 0; /**Shotdown a device *@param deviceName The INDI device name */ - virtual ASYNC shutdownINDI (QString deviceName) = 0; + virtual ASYNC shutdownINDI (TQString deviceName) = 0; /**Turn the INDI device on/off *@param deviceName The INDI device name *@param turnOn If true, the device is switched on, otherwise it is switches off. */ - virtual ASYNC switchINDI(QString deviceName, bool turnOn) = 0; + virtual ASYNC switchINDI(TQString deviceName, bool turnOn) = 0; /**Set INDI connection port *@param deviceName The INDI device name *@param port The connection port (e.g. /dev/ttyS0) */ - virtual ASYNC setINDIPort(QString deviceName, QString port) = 0; + virtual ASYNC setINDIPort(TQString deviceName, TQString port) = 0; /**Set INDI device action. This action is an element of a valid switch * property in the device. *@param deviceName The INDI device name *@param action The generic action to invoke */ - virtual ASYNC setINDIAction(QString deviceName, QString action) = 0; + virtual ASYNC setINDIAction(TQString deviceName, TQString action) = 0; /** Wait for action to complete (state changed to OK or IDLE) *@param deviceName The INDI device name *@param action The action. The action can be any valid device property. * script will pause until the property status becomes OK. */ - virtual ASYNC waitForINDIAction(QString deviceName, QString action) = 0; + virtual ASYNC waitForINDIAction(TQString deviceName, TQString action) = 0; // Telescope Functions @@ -229,32 +229,32 @@ class KStarsInterface : virtual public DCOPObject *@param RA Target's right ascension in JNOW *@param DEC Target's declination in JNOW */ - virtual ASYNC setINDITargetCoord(QString deviceName, double RA, double DEC) = 0; + virtual ASYNC setINDITargetCoord(TQString deviceName, double RA, double DEC) = 0; /**Set telescope target *@param deviceName The INDI device name *@param objectName Object's name as found in KStars */ - virtual ASYNC setINDITargetName(QString deviceName, QString objectName) = 0; + virtual ASYNC setINDITargetName(TQString deviceName, TQString objectName) = 0; /**Set telescope action *@param deviceName The INDI device name *@param action The specfic action to perform. Either SLEW, TRACK, SYNC, PARK, or ABORT. */ - virtual ASYNC setINDIScopeAction(QString deviceName, QString action) = 0; + virtual ASYNC setINDIScopeAction(TQString deviceName, TQString action) = 0; /** Set INDI geographical location *@param deviceName The INDI device name *@param longitude Longitude expressed in double. E of N *@param latitude Latitude expressed in double. */ - virtual ASYNC setINDIGeoLocation(QString deviceName, double longitude, double latitude) = 0; + virtual ASYNC setINDIGeoLocation(TQString deviceName, double longitude, double latitude) = 0; /** Start INDI UTC date and time in ISO 8601 format *@param deviceName The INDI device name *@param UTCDateTime UTC date and time in ISO 8601 format. */ - virtual ASYNC setINDIUTC(QString deviceName, QString UTCDateTime) = 0; + virtual ASYNC setINDIUTC(TQString deviceName, TQString UTCDateTime) = 0; // Focus Functions @@ -266,26 +266,26 @@ class KStarsInterface : virtual public DCOPObject * *@todo Be more explicit about allowed action strings. */ - virtual ASYNC setINDIFocusSpeed(QString deviceName, unsigned int speed) = 0; + virtual ASYNC setINDIFocusSpeed(TQString deviceName, unsigned int speed) = 0; /** Set INDI focus timeout *@param deviceName The INDI device name *@param timeout Number of seconds to perform focusing. */ - virtual ASYNC setINDIFocusTimeout(QString deviceName, int timeout) = 0; + virtual ASYNC setINDIFocusTimeout(TQString deviceName, int timeout) = 0; /** Start INDI focus operation in the selected direction *@param deviceName The INDI device name *@param focusDir Focus direction. If 0, focus in, if 1 focus out */ - virtual ASYNC startINDIFocus(QString deviceName, int focusDir) = 0; + virtual ASYNC startINDIFocus(TQString deviceName, int focusDir) = 0; // Filter Functions /** Sets the Filter position *@param deviceName The INDI device name *@param filter_num The filter position (0-20) */ - virtual ASYNC setINDIFilterNum(QString deviceName, int filter_num) = 0; + virtual ASYNC setINDIFilterNum(TQString deviceName, int filter_num) = 0; // Camera CCD Functions @@ -294,19 +294,19 @@ class KStarsInterface : virtual public DCOPObject *@param type The frame type can be either FRAME_LIGHT, FRAME_DARK, * FRAME_BIAS, or FRAME_FLAT */ - virtual ASYNC setINDIFrameType(QString deviceName, QString type) = 0; + virtual ASYNC setINDIFrameType(TQString deviceName, TQString type) = 0; /** Set CCD target temperature *@param deviceName The INDI device name *@param temp The target CCD temperature. */ - virtual ASYNC setINDICCDTemp(QString deviceName, int temp) = 0; + virtual ASYNC setINDICCDTemp(TQString deviceName, int temp) = 0; /** Start camera exposure *@param deviceName The INDI device name *@param timeout Number of seconds to perform exposure. */ - virtual ASYNC startINDIExposure(QString deviceName, int timeout) = 0; + virtual ASYNC startINDIExposure(TQString deviceName, int timeout) = 0; }; diff --git a/kstars/kstars/kstarssplash.cpp b/kstars/kstars/kstarssplash.cpp index 463f38a3..7e57364b 100644 --- a/kstars/kstars/kstarssplash.cpp +++ b/kstars/kstars/kstarssplash.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -25,71 +25,71 @@ #include "kstarssplash.h" #include "ksutils.h" -KStarsSplash::KStarsSplash( QWidget *parent, const char* name ) +KStarsSplash::KStarsSplash( TQWidget *parent, const char* name ) : KDialogBase( KDialogBase::Plain, i18n( "Loading KStars..." ), 0 /*no buttons*/, Ok, parent, name, false /*not modal*/ ) { //Set up widgets for splashscreen. - QFrame *page = plainPage(); - page->setBackgroundColor( QColor( "Black" ) ); - setBackgroundColor( QColor( "Black" ) ); + TQFrame *page = plainPage(); + page->setBackgroundColor( TQColor( "Black" ) ); + setBackgroundColor( TQColor( "Black" ) ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, 0 ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, 0 ); topLayout->setMargin( 0 ); //Load the KStars banner. Use an empty image if it can't be opened. - QFile imFile; + TQFile imFile; if ( KSUtils::openDataFile( imFile, "kstars.png" ) ) { imFile.close(); //Just need the filename... - splashImage = new QPixmap( imFile.name() ); + splashImage = new TQPixmap( imFile.name() ); } else { - splashImage = new QPixmap(); //null image + splashImage = new TQPixmap(); //null image } - Banner = new QWidget( page ); + Banner = new TQWidget( page ); Banner->setFixedWidth( splashImage->width() ); Banner->setFixedHeight( splashImage->height() ); topLayout->addWidget( Banner ); //initialize the "Welcome to KStars message label - label = new QLabel( page, "label1" ); - QPalette pal( label->palette() ); - pal.setColor( QPalette::Normal, QColorGroup::Background, QColor( "Black" ) ); - pal.setColor( QPalette::Inactive, QColorGroup::Background, QColor( "Black" ) ); - pal.setColor( QPalette::Normal, QColorGroup::Foreground, QColor( "White" ) ); - pal.setColor( QPalette::Inactive, QColorGroup::Foreground, QColor( "White" ) ); + label = new TQLabel( page, "label1" ); + TQPalette pal( label->palette() ); + pal.setColor( TQPalette::Normal, TQColorGroup::Background, TQColor( "Black" ) ); + pal.setColor( TQPalette::Inactive, TQColorGroup::Background, TQColor( "Black" ) ); + pal.setColor( TQPalette::Normal, TQColorGroup::Foreground, TQColor( "White" ) ); + pal.setColor( TQPalette::Inactive, TQColorGroup::Foreground, TQColor( "White" ) ); label->setPalette( pal ); label->setAlignment( AlignHCenter ); label->setText( i18n( "Welcome to KStars. Please stand by while loading..." ) ); topLayout->addWidget( label ); //initialize the progress message label - textCurrentStatus = new QLabel( page, "label2" ); + textCurrentStatus = new TQLabel( page, "label2" ); textCurrentStatus->setPalette( pal ); textCurrentStatus->setAlignment( AlignHCenter ); topLayout->addWidget( textCurrentStatus ); topLayout->activate(); disableResize(); - setMessage(QString::null); // force repaint of widget with no text + setMessage(TQString::null); // force repaint of widget with no text } KStarsSplash::~KStarsSplash() { delete splashImage; } -void KStarsSplash::paintEvent( QPaintEvent* ) { +void KStarsSplash::paintEvent( TQPaintEvent* ) { bitBlt( Banner, 0, 0, splashImage, 0, 0, -1, -1 ); label->repaint(); // standard text label textCurrentStatus->repaint(); // status text label } -void KStarsSplash::closeEvent( QCloseEvent *e ) { +void KStarsSplash::closeEvent( TQCloseEvent *e ) { e->ignore(); emit closeWindow(); } -void KStarsSplash::setMessage( QString s ) { +void KStarsSplash::setMessage( TQString s ) { textCurrentStatus->setText( s ); repaint(); // repaint splash screen /** diff --git a/kstars/kstars/kstarssplash.h b/kstars/kstars/kstarssplash.h index 13ec4a6e..2750d3c9 100644 --- a/kstars/kstars/kstarssplash.h +++ b/kstars/kstars/kstarssplash.h @@ -37,7 +37,7 @@ class KStarsSplash : public KDialogBase public: /**Constructor. Create widgets. Load KStars logo. Start load timer. */ - KStarsSplash( QWidget *parent, const char* name ); + KStarsSplash( TQWidget *parent, const char* name ); /**Destructor */ @@ -45,8 +45,8 @@ class KStarsSplash : public KDialogBase public slots: /**Display the text argument in the Splash Screen's status label. - *This is connected to KStarsData::progressText(QString)*/ - void setMessage(QString s); + *This is connected to KStarsData::progressText(TQString)*/ + void setMessage(TQString s); protected: /**Paint event to redraw the widgets. This only gets called when the timer fires. @@ -54,20 +54,20 @@ class KStarsSplash : public KDialogBase *this may be difficult to implement (it may be that the program is too busy loading data *to notice that a redraw is required). */ - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); /**If the user clicks on the "X" close-window button, then abort loading *as soon as possible and shut down the program. */ - void closeEvent( QCloseEvent *e ); + void closeEvent( TQCloseEvent *e ); signals: void closeWindow(); private: - QLabel *textCurrentStatus, *label; - QWidget *Banner; - QPixmap *splashImage; + TQLabel *textCurrentStatus, *label; + TQWidget *Banner; + TQPixmap *splashImage; }; #endif diff --git a/kstars/kstars/ksutils.cpp b/kstars/kstars/ksutils.cpp index b8db47f6..91ff1ff0 100644 --- a/kstars/kstars/ksutils.cpp +++ b/kstars/kstars/ksutils.cpp @@ -16,12 +16,12 @@ ***************************************************************************/ #include -#include +#include #include "ksutils.h" -bool KSUtils::openDataFile( QFile &file, const QString &s ) { +bool KSUtils::openDataFile( TQFile &file, const TQString &s ) { bool result; - QString FileName = locate( "appdata", s ); + TQString FileName = locate( "appdata", s ); if ( !FileName.isNull() ) { file.setName( FileName ); diff --git a/kstars/kstars/ksutils.h b/kstars/kstars/ksutils.h index 95c9b7e1..4f43b9cb 100644 --- a/kstars/kstars/ksutils.h +++ b/kstars/kstars/ksutils.h @@ -31,17 +31,17 @@ class QFile; class KSUtils { public: - /**Attempt to open the data file named filename, using the QFile object "file". + /**Attempt to open the data file named filename, using the TQFile object "file". *First look in the standard KDE directories, then look in a local "data" *subdirectory. If the data file cannot be found or opened, display a warning *messagebox. *@short Open a data file. - *@param &file The QFile object to be opened + *@param &file The TQFile object to be opened *@param filename The name of the data file. *@returns bool Returns true if data file was opened successfully. *@returns a reference to the opened file. */ - static bool openDataFile( QFile &file, const QString &filename ); + static bool openDataFile( TQFile &file, const TQString &filename ); /** Lagrange interpolation using a maximum number of 10 points. *@param x[] double array with x values diff --git a/kstars/kstars/kswizard.cpp b/kstars/kstars/kswizard.cpp index 6ed9078b..85258362 100644 --- a/kstars/kstars/kswizard.cpp +++ b/kstars/kstars/kswizard.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include #include @@ -31,7 +31,7 @@ #include "kswizardui.h" #include "kswizard.h" -KSWizard::KSWizard( QWidget *parent, const char *name ) +KSWizard::KSWizard( TQWidget *parent, const char *name ) : KSWizardUI( parent, name ) { ksw = (KStars *)parent; @@ -54,8 +54,8 @@ KSWizard::KSWizard( QWidget *parent, const char *name ) setNextEnabled( page( pageCount() - 1 ), false ); //Load images into banner frames. - QFile imFile; - QPixmap im = QPixmap(); + TQFile imFile; + TQPixmap im = TQPixmap(); if ( KSUtils::openDataFile( imFile, "wzstars.png" ) ) { imFile.close(); //Just need the filename... @@ -86,14 +86,14 @@ KSWizard::KSWizard( QWidget *parent, const char *name ) #endif //connect signals/slots - connect( CityListBox, SIGNAL( selectionChanged() ), this, SLOT( slotChangeCity() ) ); - connect( CityFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotFilterCities() ) ); - connect( ProvinceFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotFilterCities() ) ); - connect( CountryFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotFilterCities() ) ); + connect( CityListBox, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotChangeCity() ) ); + connect( CityFilter, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( slotFilterCities() ) ); + connect( ProvinceFilter, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( slotFilterCities() ) ); + connect( CountryFilter, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( slotFilterCities() ) ); //Uncomment if we ever need the telescope page... -// connect( TelescopeWizardButton, SIGNAL( clicked() ), this, SLOT( slotTelescopeSetup() ) ); +// connect( TelescopeWizardButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotTelescopeSetup() ) ); #if ( KDE_IS_VERSION( 3, 2, 90 ) ) - connect( DownloadButton, SIGNAL( clicked() ), ksw, SLOT( slotDownload() ) ); + connect( DownloadButton, TQT_SIGNAL( clicked() ), ksw, TQT_SLOT( slotDownload() ) ); #endif //Initialize Geographic Location page @@ -149,9 +149,9 @@ void KSWizard::slotFilterCities() { filteredCityList.clear(); for (GeoLocation *loc = ksw->data()->geoList.first(); loc; loc = ksw->data()->geoList.next()) { - QString sc( loc->translatedName() ); - QString ss( loc->translatedCountry() ); - QString sp = ""; + TQString sc( loc->translatedName() ); + TQString ss( loc->translatedCountry() ); + TQString sp = ""; if ( !loc->province().isEmpty() ) sp = loc->translatedProvince(); diff --git a/kstars/kstars/kswizard.h b/kstars/kstars/kswizard.h index f822149a..ea570498 100644 --- a/kstars/kstars/kswizard.h +++ b/kstars/kstars/kswizard.h @@ -18,7 +18,7 @@ #ifndef KSWIZARD_H #define KSWIZARD_H -#include +#include #include "kswizardui.h" class GeoLocation; @@ -45,7 +45,7 @@ public: *@p parent pointer to the parent widget *@p name name for the KSWizard object */ - KSWizard( QWidget *parent=0, const char *name=0 ); + KSWizard( TQWidget *parent=0, const char *name=0 ); /**Destructor */ ~KSWizard(); @@ -81,9 +81,9 @@ private: void initGeoPage(); KStars *ksw; - QMemArray GeoID; + TQMemArray GeoID; GeoLocation *Geo; - QPtrList filteredCityList; + TQPtrList filteredCityList; }; #endif diff --git a/kstars/kstars/locationdialog.cpp b/kstars/kstars/locationdialog.cpp index dfb5ebf2..8bbd34ac 100644 --- a/kstars/kstars/locationdialog.cpp +++ b/kstars/kstars/locationdialog.cpp @@ -22,13 +22,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "locationdialog.h" #include "kstars.h" @@ -36,64 +36,64 @@ #include "mapcanvas.h" #include "dmsbox.h" -LocationDialog::LocationDialog( QWidget* parent ) +LocationDialog::LocationDialog( TQWidget* parent ) : KDialogBase( KDialogBase::Plain, i18n( "Set Geographic Location" ), Ok|Cancel, Ok, parent ) { KStars *p = (KStars *)parent; - QFrame *page = plainPage(); - CityBox = new QGroupBox( page, "CityBox" ); - CoordBox = new QGroupBox( page, "CoordBox" ); + TQFrame *page = plainPage(); + CityBox = new TQGroupBox( page, "CityBox" ); + CoordBox = new TQGroupBox( page, "CoordBox" ); CityBox->setTitle( i18n( "Choose City" ) ); CoordBox->setTitle( i18n( "Choose/Modify Coordinates" ) ); //Create Layout managers - RootLay = new QVBoxLayout( page, 4, 4 ); //root mgr for dialog - CityLay = new QVBoxLayout( CityBox, 6, 4 ); //root mgr for CityBox + RootLay = new TQVBoxLayout( page, 4, 4 ); //root mgr for dialog + CityLay = new TQVBoxLayout( CityBox, 6, 4 ); //root mgr for CityBox CityLay->setSpacing( 6 ); CityLay->setMargin( 6 ); - hlay = new QHBoxLayout( 2 ); //this layout will be added to CityLay - vlay = new QVBoxLayout( 2 ); //this layout will be added to hlay - glay = new QGridLayout( 3, 2, 6 ); //this layout will be added to vlay + hlay = new TQHBoxLayout( 2 ); //this layout will be added to CityLay + vlay = new TQVBoxLayout( 2 ); //this layout will be added to hlay + glay = new TQGridLayout( 3, 2, 6 ); //this layout will be added to vlay - CoordLay = new QVBoxLayout( CoordBox, 6, 4 ); //root mgr for coordbox + CoordLay = new TQVBoxLayout( CoordBox, 6, 4 ); //root mgr for coordbox CoordLay->setSpacing( 6 ); CoordLay->setMargin( 6 ); - glay2 = new QGridLayout( 3, 4, 4 ); //this layout will be added to CoordLay - hlayCoord = new QHBoxLayout( 2 ); //this layout will be added to glay2 - hlayTZ = new QHBoxLayout( 2 ); //this layout will be added to glay2 - hlayButtons = new QHBoxLayout( 2 ); //this layout will be added to glay2 - hlay3 = new QHBoxLayout( 2 ); //this layout will be added to CoordLay + glay2 = new TQGridLayout( 3, 4, 4 ); //this layout will be added to CoordLay + hlayCoord = new TQHBoxLayout( 2 ); //this layout will be added to glay2 + hlayTZ = new TQHBoxLayout( 2 ); //this layout will be added to glay2 + hlayButtons = new TQHBoxLayout( 2 ); //this layout will be added to glay2 + hlay3 = new TQHBoxLayout( 2 ); //this layout will be added to CoordLay //Create widgets - CityFiltLabel = new QLabel( CityBox ); + CityFiltLabel = new TQLabel( CityBox ); CityFiltLabel->setText( i18n( "City filter:" ) ); - ProvinceFiltLabel = new QLabel( CityBox ); + ProvinceFiltLabel = new TQLabel( CityBox ); ProvinceFiltLabel->setText( i18n( "Province filter:" ) ); - CountryFiltLabel = new QLabel( CityBox ); + CountryFiltLabel = new TQLabel( CityBox ); CountryFiltLabel->setText( i18n( "Country filter:" ) ); - CountLabel = new QLabel( CityBox ); + CountLabel = new TQLabel( CityBox ); CityFilter = new KLineEdit( CityBox ); CityFilter->setFocus(); // set focus to city inputline ProvinceFilter = new KLineEdit( CityBox ); CountryFilter = new KLineEdit( CityBox ); - GeoBox = new QListBox( CityBox ); - GeoBox->setVScrollBarMode( QListBox::AlwaysOn ); - GeoBox->setHScrollBarMode( QListBox::AlwaysOff ); + GeoBox = new TQListBox( CityBox ); + GeoBox->setVScrollBarMode( TQListBox::AlwaysOn ); + GeoBox->setHScrollBarMode( TQListBox::AlwaysOff ); MapView = new MapCanvas( CityBox ); MapView->setFixedSize( 360, 180 ); //each pixel 1 deg x 2 deg - NewCityLabel = new QLabel( i18n( "City:" ), CoordBox ); - NewProvinceLabel = new QLabel( i18n( "State/Province:" ), CoordBox ); - NewCountryLabel = new QLabel( i18n( "Country:" ), CoordBox ); - LongLabel = new QLabel( i18n( "Longitude:" ), CoordBox ); - LatLabel = new QLabel( i18n( "Latitude:" ), CoordBox ); - TZLabel = new QLabel( i18n( "timezone offset from universal time", "UT offset:" ), CoordBox ); - TZRuleLabel = new QLabel( i18n( "daylight savings time rule", "DST rule:" ), CoordBox ); + NewCityLabel = new TQLabel( i18n( "City:" ), CoordBox ); + NewProvinceLabel = new TQLabel( i18n( "State/Province:" ), CoordBox ); + NewCountryLabel = new TQLabel( i18n( "Country:" ), CoordBox ); + LongLabel = new TQLabel( i18n( "Longitude:" ), CoordBox ); + LatLabel = new TQLabel( i18n( "Latitude:" ), CoordBox ); + TZLabel = new TQLabel( i18n( "timezone offset from universal time", "UT offset:" ), CoordBox ); + TZRuleLabel = new TQLabel( i18n( "daylight savings time rule", "DST rule:" ), CoordBox ); NewCityName = new KLineEdit( CoordBox ); NewProvinceName = new KLineEdit( CoordBox ); @@ -101,8 +101,8 @@ LocationDialog::LocationDialog( QWidget* parent ) NewLong = new dmsBox( CoordBox ); NewLat = new dmsBox( CoordBox ); - TZBox = new QComboBox( CoordBox ); - TZRuleBox = new QComboBox( CoordBox ); + TZBox = new TQComboBox( CoordBox ); + TZRuleBox = new TQComboBox( CoordBox ); TZBox->setMinimumWidth( 16 ); TZRuleBox->setMinimumWidth( 16 ); TZBox->setEditable( true ); @@ -111,16 +111,16 @@ LocationDialog::LocationDialog( QWidget* parent ) for ( int i=0; i<25; ++i ) TZBox->insertItem( KGlobal::locale()->formatNumber( (double)(i-12) ) ); - QMap::Iterator it = p->data()->Rulebook.begin(); - QMap::Iterator itEnd = p->data()->Rulebook.end(); + TQMap::Iterator it = p->data()->Rulebook.begin(); + TQMap::Iterator itEnd = p->data()->Rulebook.end(); for ( ; it != itEnd; ++it ) if ( it.key().length() ) TZRuleBox->insertItem( it.key() ); - ClearFields = new QPushButton( i18n( "Clear Fields" ), CoordBox, "ClearFields" ); - ShowTZRules = new QPushButton( i18n( "Explain DST Rules" ), CoordBox, "ShowDSTRules" ); + ClearFields = new TQPushButton( i18n( "Clear Fields" ), CoordBox, "ClearFields" ); + ShowTZRules = new TQPushButton( i18n( "Explain DST Rules" ), CoordBox, "ShowDSTRules" ); - AddCityButton = new QPushButton( i18n ( "Add to List" ), CoordBox, "AddCityButton" ); + AddCityButton = new TQPushButton( i18n ( "Add to List" ), CoordBox, "AddCityButton" ); //Pack the widgets into the layouts RootLay->addWidget( CityBox, 0, 0 ); @@ -180,21 +180,21 @@ LocationDialog::LocationDialog( QWidget* parent ) CoordLay->activate(); RootLay->activate(); - connect( this, SIGNAL( cancelClicked() ), this, SLOT( reject() ) ); - connect( CityFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( filterCity() ) ); - connect( ProvinceFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( filterCity() ) ); - connect( CountryFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( filterCity() ) ); - connect( NewCityName, SIGNAL( textChanged( const QString & ) ), this, SLOT( nameChanged() ) ); - connect( NewProvinceName, SIGNAL( textChanged( const QString & ) ), this, SLOT( nameChanged() ) ); - connect( NewCountryName, SIGNAL( textChanged( const QString & ) ), this, SLOT( nameChanged() ) ); - connect( NewLong, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged() ) ); - connect( NewLat, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged() ) ); - connect( TZBox, SIGNAL( activated(int) ), this, SLOT( dataChanged() ) ); - connect( TZRuleBox, SIGNAL( activated(int) ), this, SLOT( dataChanged() ) ); - connect( GeoBox, SIGNAL( selectionChanged() ), this, SLOT( changeCity() ) ); - connect( AddCityButton, SIGNAL( clicked() ), this, SLOT( addCity() ) ); - connect( ClearFields, SIGNAL( clicked() ), this, SLOT( clearFields() ) ); - connect( ShowTZRules, SIGNAL( clicked() ), this, SLOT( showTZRules() ) ); + connect( this, TQT_SIGNAL( cancelClicked() ), this, TQT_SLOT( reject() ) ); + connect( CityFilter, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( filterCity() ) ); + connect( ProvinceFilter, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( filterCity() ) ); + connect( CountryFilter, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( filterCity() ) ); + connect( NewCityName, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( nameChanged() ) ); + connect( NewProvinceName, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( nameChanged() ) ); + connect( NewCountryName, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( nameChanged() ) ); + connect( NewLong, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( dataChanged() ) ); + connect( NewLat, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( dataChanged() ) ); + connect( TZBox, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( dataChanged() ) ); + connect( TZRuleBox, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( dataChanged() ) ); + connect( GeoBox, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( changeCity() ) ); + connect( AddCityButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addCity() ) ); + connect( ClearFields, TQT_SIGNAL( clicked() ), this, TQT_SLOT( clearFields() ) ); + connect( ShowTZRules, TQT_SIGNAL( clicked() ), this, TQT_SLOT( showTZRules() ) ); dataModified = false; nameModified = false; @@ -261,9 +261,9 @@ void LocationDialog::filterCity( void ) { AddCityButton->setEnabled( false ); for (GeoLocation *loc = p->data()->geoList.first(); loc; loc = p->data()->geoList.next()) { - QString sc( loc->translatedName() ); - QString ss( loc->translatedCountry() ); - QString sp = ""; + TQString sc( loc->translatedName() ); + TQString ss( loc->translatedCountry() ); + TQString sp = ""; if ( !loc->province().isEmpty() ) sp = loc->translatedProvince(); @@ -332,7 +332,7 @@ void LocationDialog::addCity( void ) { bCityAdded = false; if ( !nameModified && !dataModified ) { - QString message = i18n( "This City already exists in the database." ); + TQString message = i18n( "This City already exists in the database." ); KMessageBox::sorry( 0, message, i18n( "Error: Duplicate Entry" ) ); return; } @@ -343,41 +343,41 @@ void LocationDialog::addCity( void ) { double TZ = TZBox->lineEdit()->text().toDouble( &tzOk ); if ( NewCityName->text().isEmpty() || NewCountryName->text().isEmpty() ) { - QString message = i18n( "All fields (except province) must be filled to add this location." ); + TQString message = i18n( "All fields (except province) must be filled to add this location." ); KMessageBox::sorry( 0, message, i18n( "Fields are Empty" ) ); return; //FIXME after strings freeze lifts, separate TZ check from lat/long check } else if ( ! latOk || ! lngOk || ! tzOk ) { - QString message = i18n( "Could not parse coordinates." ); + TQString message = i18n( "Could not parse coordinates." ); KMessageBox::sorry( 0, message, i18n( "Bad Coordinates" ) ); return; } else { if ( !nameModified ) { - QString message = i18n( "Really override original data for this city?" ); + TQString message = i18n( "Really override original data for this city?" ); if ( KMessageBox::questionYesNo( 0, message, i18n( "Override Existing Data?" ), i18n("Override Data"), i18n("Do Not Override")) == KMessageBox::No ) return; //user answered No. } - QString entry; - QFile file; + TQString entry; + TQFile file; //Strip off white space - QString name = NewCityName->text().stripWhiteSpace(); - QString province = NewProvinceName->text().stripWhiteSpace(); - QString country = NewCountryName->text().stripWhiteSpace(); + TQString name = NewCityName->text().stripWhiteSpace(); + TQString province = NewProvinceName->text().stripWhiteSpace(); + TQString country = NewCountryName->text().stripWhiteSpace(); //check for user's city database. If it doesn't exist, create it. file.setName( locateLocal( "appdata", "mycities.dat" ) ); //determine filename in local user KDE directory tree. if ( !file.open( IO_ReadWrite | IO_Append ) ) { - QString message = i18n( "Local cities database could not be opened.\nLocation will not be recorded." ); + TQString message = i18n( "Local cities database could not be opened.\nLocation will not be recorded." ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); return; } else { char ltsgn = 'N'; if ( lat.degree()<0 ) ltsgn = 'S'; char lgsgn = 'E'; if ( lng.degree()<0 ) lgsgn = 'W'; - QString TZrule = TZRuleBox->currentText(); + TQString TZrule = TZRuleBox->currentText(); entry = entry.sprintf( "%-32s : %-21s : %-21s : %2d : %2d : %2d : %c : %3d : %2d : %2d : %c : %5.1f : %2s\n", name.local8Bit().data(), province.local8Bit().data(), country.local8Bit().data(), @@ -385,7 +385,7 @@ void LocationDialog::addCity( void ) { abs(lng.degree()), lng.arcmin(), lat.arcsec(), lgsgn, TZ, TZrule.local8Bit().data() ); - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << entry; file.close(); @@ -473,7 +473,7 @@ void LocationDialog::clearFields( void ) { } void LocationDialog::showTZRules( void ) { - QStringList lines; + TQStringList lines; lines.append( i18n( " Start Date (Start Time) / Revert Date (Revert Time)" ) ); lines.append( " " ); lines.append( i18n( "--: No DST correction" ) ); @@ -503,7 +503,7 @@ void LocationDialog::showTZRules( void ) { lines.append( i18n( "US: 1st Sun in Apr. (02:00) / Last Sun in Oct. (02:00)" ) ); lines.append( i18n( "ZN: Apr. 1 (01:00) / Oct. 1 (00:00)" ) ); - QString message = i18n( "Daylight Saving Time Rules" ); + TQString message = i18n( "Daylight Saving Time Rules" ); KMessageBox::informationList( 0, message, lines, message ); } diff --git a/kstars/kstars/locationdialog.h b/kstars/kstars/locationdialog.h index 0ed13489..275d8288 100644 --- a/kstars/kstars/locationdialog.h +++ b/kstars/kstars/locationdialog.h @@ -33,7 +33,7 @@ * *The bottom section allows the location to be specified manually. *The Longitude, Latitude, City name, Province/State name, and Country name - *are entered into KLineEdits. There is also a QPushButton for adding the + *are entered into KLineEdits. There is also a TQPushButton for adding the *location to the custom Cities database. If the user selects "Add" without *filling in all of the manual entry fields, an error message is displayed. *@short Geographic Location dialog @@ -64,7 +64,7 @@ public: *Constructor. Create all widgets, and pack them into QLayouts. *Connect Signals to Slots. Run initCityList(). */ - LocationDialog( QWidget* parent = 0 ); + LocationDialog( TQWidget* parent = 0 ); /** *Destructor (empty) */ @@ -83,7 +83,7 @@ public: /**@return pointer to the List of filtered city pointers. */ - QPtrList* filteredList() { return &filteredCityList; } + TQPtrList* filteredList() { return &filteredCityList; } /**@short Show only cities within 3 degrees of point specified by arguments *@param longitude the longitude of the search point (int) @@ -93,15 +93,15 @@ public: /**@return the city name of the selected location. */ - QString selectedCityName( void ) const { return SelectedCity->translatedName(); } + TQString selectedCityName( void ) const { return SelectedCity->translatedName(); } /**@return the province name of the selected location. */ - QString selectedProvinceName( void ) const { return SelectedCity->translatedProvince(); } + TQString selectedProvinceName( void ) const { return SelectedCity->translatedProvince(); } /**@return the country name of the selected location. */ - QString selectedCountryName( void ) const { return SelectedCity->translatedCountry(); } + TQString selectedCountryName( void ) const { return SelectedCity->translatedCountry(); } /**@return true if the AddCityBUtton is enabled */ @@ -111,18 +111,18 @@ public slots: /** *When text is entered in the City/Province/Country Filter KLineEdits, *the List of cities is trimmed to show only cities beginning with the entered text. - *Also, the QMemArray of ID numbers is kept in sync with the filtered list. + *Also, the TQMemArray of ID numbers is kept in sync with the filtered list. */ void filterCity( void ); /** - *When the selected city in the QListBox changes, repaint the MapCanvas + *When the selected city in the TQListBox changes, repaint the MapCanvas *so that the crosshairs icon appears on the newly selected city. */ void changeCity( void ); /** - *When the "Add new city" QPushButton is clicked, add the manually-entered + *When the "Add new city" TQPushButton is clicked, add the manually-entered *city information to the user's custom city database. */ void addCity( void ); @@ -141,24 +141,24 @@ private: bool checkLongLat( void ); bool dataModified, nameModified, bCityAdded; - QGridLayout *glay, *glay2; - QHBoxLayout *hlay, *hlayCoord, *hlayTZ, *hlayButtons, *hlay3; - QVBoxLayout *RootLay, *CityLay, *CoordLay, *vlay; - QGroupBox *CityBox, *CoordBox; - QLabel *CityFiltLabel, *ProvinceFiltLabel, *CountryFiltLabel; - QLabel *NewCityLabel, *NewProvinceLabel, *NewCountryLabel; - QLabel *LongLabel, *LatLabel, *CountLabel; - QLabel *TZLabel, *TZRuleLabel; + TQGridLayout *glay, *glay2; + TQHBoxLayout *hlay, *hlayCoord, *hlayTZ, *hlayButtons, *hlay3; + TQVBoxLayout *RootLay, *CityLay, *CoordLay, *vlay; + TQGroupBox *CityBox, *CoordBox; + TQLabel *CityFiltLabel, *ProvinceFiltLabel, *CountryFiltLabel; + TQLabel *NewCityLabel, *NewProvinceLabel, *NewCountryLabel; + TQLabel *LongLabel, *LatLabel, *CountLabel; + TQLabel *TZLabel, *TZRuleLabel; KLineEdit *NewCityName, *NewProvinceName, *NewCountryName; KLineEdit *CityFilter, *ProvinceFilter, *CountryFilter; dmsBox *NewLong, *NewLat; - QComboBox *TZBox, *TZRuleBox; - QPushButton *AddCityButton, *ClearFields, *ShowTZRules; + TQComboBox *TZBox, *TZRuleBox; + TQPushButton *AddCityButton, *ClearFields, *ShowTZRules; MapCanvas *MapView; - QListBox *GeoBox; + TQListBox *GeoBox; GeoLocation *SelectedCity; - QPtrList filteredCityList; + TQPtrList filteredCityList; }; #endif diff --git a/kstars/kstars/magnitudespinbox.cpp b/kstars/kstars/magnitudespinbox.cpp index baa7d05e..2f4b1930 100644 --- a/kstars/kstars/magnitudespinbox.cpp +++ b/kstars/kstars/magnitudespinbox.cpp @@ -17,13 +17,13 @@ #include "magnitudespinbox.h" -MagnitudeSpinBox::MagnitudeSpinBox( QWidget * parent , const char * name ) +MagnitudeSpinBox::MagnitudeSpinBox( TQWidget * parent , const char * name ) : KDoubleNumInput( 0.0, 10.0, 0.0, 0.1 /*step*/, 1 /*precision*/, parent, name) { } MagnitudeSpinBox::MagnitudeSpinBox( double minValue, double maxValue, - QWidget * parent , const char * name ) + TQWidget * parent , const char * name ) : KDoubleNumInput( minValue, maxValue, minValue, 0.1 /* step */, 1, parent, name) { } diff --git a/kstars/kstars/magnitudespinbox.h b/kstars/kstars/magnitudespinbox.h index cc4dc619..f4f62d53 100644 --- a/kstars/kstars/magnitudespinbox.h +++ b/kstars/kstars/magnitudespinbox.h @@ -36,11 +36,11 @@ class MagnitudeSpinBox : public KDoubleNumInput /**Default Constructor. */ - MagnitudeSpinBox( QWidget* parent = 0, const char* name = 0); + MagnitudeSpinBox( TQWidget* parent = 0, const char* name = 0); /**Constructor. Set minimum and maximum values for the spinbox. */ - MagnitudeSpinBox( double minValue, double maxValue, QWidget* parent = 0, const char* name = 0); + MagnitudeSpinBox( double minValue, double maxValue, TQWidget* parent = 0, const char* name = 0); }; diff --git a/kstars/kstars/main.cpp b/kstars/kstars/main.cpp index d3ddbfe2..a16acfbc 100644 --- a/kstars/kstars/main.cpp +++ b/kstars/kstars/main.cpp @@ -72,8 +72,8 @@ int main(int argc, char *argv[]) //parse filename and image format const char* format = "PNG"; - QString fname = args->getOption( "filename" ); - QString ext = fname.mid( fname.findRev(".")+1 ); + TQString fname = args->getOption( "filename" ); + TQString ext = fname.mid( fname.findRev(".")+1 ); if ( ext.lower() == "png" ) { format = "PNG"; } else if ( ext.lower() == "jpg" || ext.lower() == "jpeg" ) { format = "JPG"; } else if ( ext.lower() == "gif" ) { format = "GIF"; } @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) } KStarsData *dat = new KStarsData(); - QObject::connect( dat, SIGNAL( progressText(QString) ), dat, SLOT( slotConsoleMessage(QString) ) ); + TQObject::connect( dat, TQT_SIGNAL( progressText(TQString) ), dat, TQT_SLOT( slotConsoleMessage(TQString) ) ); dat->initialize(); while (!dat->startupComplete) { kapp->processEvents(50); } @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) //set clock now that we have a location: //Check to see if user provided a date/time string. If not, use current CPU time - QString datestring = args->getOption( "date" ); + TQString datestring = args->getOption( "date" ); KStarsDateTime kdt; if ( ! datestring.isEmpty() ) { if ( datestring.contains( "-" ) ) { //assume ISODate format @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) kdt = KStarsDateTime::fromString( datestring, Qt::ISODate ); } else { //string probably contains date only kdt.setDate( ExtDate::fromString( datestring, Qt::ISODate ) ); - kdt.setTime( QTime( 0, 0, 0 ) ); + kdt.setTime( TQTime( 0, 0, 0 ) ); } } else { //assume Text format for date string kdt = dat->geo()->LTtoUT( KStarsDateTime::fromString( datestring, Qt::TextDate ) ); @@ -140,7 +140,7 @@ int main(int argc, char *argv[]) SkyMap *map = new SkyMap( dat ); map->resize( w, h ); - QPixmap sky( w, h ); + TQPixmap sky( w, h ); map->setDestination( new SkyPoint( Options::focusRA(), Options::focusDec() ) ); map->destination()->EquatorialToHorizontal( dat->lst(), dat->geo()->lat() ); @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) map->focus()->EquatorialToHorizontal( dat->lst(), dat->geo()->lat() ); //Execute the specified script - QString scriptfile = args->getOption( "script" ); + TQString scriptfile = args->getOption( "script" ); if ( ! scriptfile.isEmpty() ) { if ( dat->executeScript( scriptfile, map ) ) { std::cout << i18n( "Script executed." ).utf8() << std::endl; @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) //start up normally in GUI mode //Try to parse the given date string - QString datestring = args->getOption( "date" ); + TQString datestring = args->getOption( "date" ); if ( ! datestring.isEmpty() && ! KStarsDateTime::fromString( datestring ).isValid() ) { kdWarning() << i18n("Specified date (%1) is invalid. Will use current CPU date instead." ).arg( datestring ) << endl; @@ -185,7 +185,7 @@ int main(int argc, char *argv[]) new KStars( true, ! args->isSet( "paused" ), datestring ); args->clear(); - QObject::connect(kapp, SIGNAL(lastWindowClosed()), kapp, SLOT(quit())); + TQObject::connect(kapp, TQT_SIGNAL(lastWindowClosed()), kapp, TQT_SLOT(quit())); return a.exec(); } diff --git a/kstars/kstars/mapcanvas.cpp b/kstars/kstars/mapcanvas.cpp index dc60c2bc..85dbd1ca 100644 --- a/kstars/kstars/mapcanvas.cpp +++ b/kstars/kstars/mapcanvas.cpp @@ -17,23 +17,23 @@ #include #include -#include -#include +#include +#include #include "mapcanvas.h" #include "locationdialog.h" #include "kstars.h" #include "kstarsdata.h" -MapCanvas::MapCanvas(QWidget *parent, const char *name ) : QWidget(parent,name) { +MapCanvas::MapCanvas(TQWidget *parent, const char *name ) : TQWidget(parent,name) { BGColor = "#33A"; - setBackgroundColor( QColor( BGColor ) ); - setBackgroundMode( QWidget::NoBackground ); - Canvas = new QPixmap(); - bgImage = new QPixmap(); + setBackgroundColor( TQColor( BGColor ) ); + setBackgroundMode( TQWidget::NoBackground ); + Canvas = new TQPixmap(); + bgImage = new TQPixmap(); LocationDialog *ld = (LocationDialog *)topLevelWidget(); KStars *ks = (KStars *)ld->parent(); - QString bgFile = ks->data()->stdDirs->findResource( "data", "kstars/geomap.png" ); + TQString bgFile = ks->data()->stdDirs->findResource( "data", "kstars/geomap.png" ); bgImage->load( bgFile, "PNG" ); } @@ -43,20 +43,20 @@ MapCanvas::~MapCanvas(){ } void MapCanvas::setGeometry( int x, int y, int w, int h ) { - QWidget::setGeometry( x, y, w, h ); + TQWidget::setGeometry( x, y, w, h ); Canvas->resize( w, h ); origin.setX( w/2 ); origin.setY( h/2 ); } -void MapCanvas::setGeometry( const QRect &r ) { - QWidget::setGeometry( r ); +void MapCanvas::setGeometry( const TQRect &r ) { + TQWidget::setGeometry( r ); Canvas->resize( r.width(), r.height() ); origin.setX( r.width()/2 ); origin.setY( r.height()/2 ); } -void MapCanvas::mousePressEvent( QMouseEvent *e ) { +void MapCanvas::mousePressEvent( TQMouseEvent *e ) { LocationDialog *ld = (LocationDialog *)topLevelWidget(); //Determine Lat/Long corresponding to event press @@ -66,20 +66,20 @@ void MapCanvas::mousePressEvent( QMouseEvent *e ) { ld->findCitiesNear( lng, lat ); } -void MapCanvas::paintEvent( QPaintEvent * ) { - QPainter pcanvas; +void MapCanvas::paintEvent( TQPaintEvent * ) { + TQPainter pcanvas; LocationDialog *ld = (LocationDialog *)topLevelWidget(); KStars *ks = (KStars *)ld->parent(); //prepare the canvas pcanvas.begin( Canvas ); -// pcanvas.fillRect( 0, 0, width(), height(), QBrush( QColor( BGColor ) ) ); +// pcanvas.fillRect( 0, 0, width(), height(), TQBrush( TQColor( BGColor ) ) ); pcanvas.drawPixmap( 0, 0, *bgImage ); // pcanvas.setBrush( white ); - pcanvas.setPen( QPen( QColor( "SlateGrey" ) ) ); + pcanvas.setPen( TQPen( TQColor( "SlateGrey" ) ) ); //Draw cities - QPoint o; + TQPoint o; for ( GeoLocation *g=ks->data()->geoList.first(); g; g = ks->data()->geoList.next() ) { o.setX( int( g->lng()->Degrees() + origin.x() ) ); diff --git a/kstars/kstars/mapcanvas.h b/kstars/kstars/mapcanvas.h index 7183d939..666e51d2 100644 --- a/kstars/kstars/mapcanvas.h +++ b/kstars/kstars/mapcanvas.h @@ -21,8 +21,8 @@ #ifndef MAPCANVAS_H #define MAPCANVAS_H -#include -#include +#include +#include /**@class MapCanvas *Used in LocationDialog for displaying a map of the Earth. @@ -36,22 +36,22 @@ class QPixmap; -class MapCanvas : public QWidget { +class MapCanvas : public TQWidget { Q_OBJECT public: /**Default constructor. Initialize the widget: create pixmaps, load the *world map bitmap, set pointers to the main window and the *LocationDialog parent. */ - MapCanvas(QWidget *parent=0, const char *name=0); + MapCanvas(TQWidget *parent=0, const char *name=0); /**Destructor (empty) */ ~MapCanvas(); public slots: - /**Set the geometry of the map widget (overloaded from QWidget). + /**Set the geometry of the map widget (overloaded from TQWidget). *Resizes the size of the map pixmap to match the widget, and resets - *the Origin QPoint so it remains at the center of the widget. + *the Origin TQPoint so it remains at the center of the widget. *@note this is called automatically by resize events. *@p x the x-position of the widget *@p y the y-position of the widget @@ -60,15 +60,15 @@ public slots: */ virtual void setGeometry( int x, int y, int w, int h ); - /**Set the geometry of the map widget (overloaded from QWidget). + /**Set the geometry of the map widget (overloaded from TQWidget). *Resizes the size of the map pixmap to match the widget, and resets - *the Origin QPoint so it remains at the center of the widget. + *the Origin TQPoint so it remains at the center of the widget. *This function behaves just like the above function. It differs *only in the data type of its argument. *@note this is called automatically by resize events. - *@p r QRect describing geometry + *@p r TQRect describing geometry */ - virtual void setGeometry( const QRect &r ); + virtual void setGeometry( const TQRect &r ); protected: /**Draw the map. Draw grey dots on the locations of all cities, @@ -77,18 +77,18 @@ protected: *currently-selected city. *@see LocationDialog */ - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); /**Trim the list of cities so that only those within 2 degrees *of the mouse click are shown in the list. *@see LocationDialog */ - virtual void mousePressEvent( QMouseEvent *e ); + virtual void mousePressEvent( TQMouseEvent *e ); private: - QPixmap *Canvas, *bgImage; - QString BGColor; - QPoint origin; + TQPixmap *Canvas, *bgImage; + TQString BGColor; + TQPoint origin; }; #endif diff --git a/kstars/kstars/objectnamelist.cpp b/kstars/kstars/objectnamelist.cpp index daa1305d..b86fdac8 100644 --- a/kstars/kstars/objectnamelist.cpp +++ b/kstars/kstars/objectnamelist.cpp @@ -20,7 +20,7 @@ #include "skyobject.h" #include "starobject.h" -#include +#include #include ObjectNameList::ObjectNameList() { @@ -55,14 +55,14 @@ void ObjectNameList::setMode( Mode m ) { void ObjectNameList::append( SkyObject *object, bool useLongName ) { amount++; // create name string and init with longname if forced by parameter else default name - QString name = ( useLongName ) ? object->longname() : object->name(); + TQString name = ( useLongName ) ? object->longname() : object->name(); //if star's name is it's genetive name, make sure we don't use the Greek charcter here if ( object->type() == 0 && name == ((StarObject*)object)->gname() ) name = ((StarObject*)object)->gname( false ); // create string with translated name - QString iName; + TQString iName; if ( object->type() == -1 ) { // constellation iName = i18n( "Constellation name (optional)", name.local8Bit().data() ); @@ -94,7 +94,7 @@ void ObjectNameList::append( SkyObject *object, bool useLongName ) { unsorted[currentIndex] = true; } -SkyObjectName* ObjectNameList::first( const QString &name ) { +SkyObjectName* ObjectNameList::first( const TQString &name ) { sort(); SkyObjectName *soName = 0; // set mode: string is empty set mode to all lists @@ -138,13 +138,13 @@ SkyObjectName* ObjectNameList::next() { return soName; } -int ObjectNameList::getIndex( const QString &name ) { +int ObjectNameList::getIndex( const TQString &name ) { // default index is 0 if object name starts with a number int index = 0; // if object name starts with a letter, so get index number between 1 and 26 if ( !name.isEmpty() ) { - QChar firstLetter = name[0]; + TQChar firstLetter = name[0]; if ( firstLetter ) { if ( firstLetter.isLetter() ) { const unsigned char letter = (unsigned char) firstLetter.lower(); @@ -179,7 +179,7 @@ void ObjectNameList::sort() { } } -void ObjectNameList::remove ( const QString &name ) { +void ObjectNameList::remove ( const TQString &name ) { setMode(oneList); int index = getIndex(name); SortedList *l = &(list[language][index]); @@ -188,14 +188,14 @@ void ObjectNameList::remove ( const QString &name ) { if ( son ) l->remove( son ); } -SkyObjectName* ObjectNameList::find(const QString &name) { +SkyObjectName* ObjectNameList::find(const TQString &name) { sort(); if (name.isNull()) return 0; // find works only in one list and not in all lists setMode(oneList); // items are stored translated (JH: Why? this whole class is confusing...) - QString translatedName = i18n(name.utf8()); + TQString translatedName = i18n(name.utf8()); int index = getIndex(name); diff --git a/kstars/kstars/objectnamelist.h b/kstars/kstars/objectnamelist.h index 8e819c3a..691311ee 100644 --- a/kstars/kstars/objectnamelist.h +++ b/kstars/kstars/objectnamelist.h @@ -20,7 +20,7 @@ /**@class ObjectNameList - *This class provides an interface like a QPtrList, but sorts objects internally + *This class provides an interface like a TQPtrList, but sorts objects internally *in 27 lists. The objects are sorted alphabetically. List 0 contains all objects *beginning not with a letter. List 1 - 26 contains objects beginning with a letter. *The number of the list is similar to positon of letter in alphabet. (A = 1 .. Z = 26 ) @@ -29,17 +29,17 @@ */ -#include -#include -#include +#include +#include +#include class SkyObject; class SkyObjectName; -/**Reimplemented from QPtrList for sorting objects in the list. */ -template class SortedList : public QPtrList { +/**Reimplemented from TQPtrList for sorting objects in the list. */ +template class SortedList : public TQPtrList { protected: - int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) { + int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { if ( *((T*)item1) == *((T*)item2) ) return 0; return ( *((T*)item1) < *((T*)item2) ) ? -1 : 1; } @@ -71,7 +71,7 @@ class ObjectNameList { *@return pointer to the first object in the selected list. *@param name the name to use in selecting a list. */ - SkyObjectName* first(const QString &name = QString::null); + SkyObjectName* first(const TQString &name = TQString::null); /**Returns next object in the currently selected list. *@return pointer to the next object in the current list, or NULL if @@ -87,13 +87,13 @@ class ObjectNameList { *@param name name of object to find. *@return pointer to object with the given name */ - SkyObjectName* find(const QString &name = QString::null); + SkyObjectName* find(const TQString &name = TQString::null); /**@short remove the named object from the list. *@param name the name of the object to be removed. *@note If the object is not found, then nothing happens. */ - void remove( const QString &name = QString::null ); + void remove( const TQString &name = TQString::null ); /**Define the language which should be used for constellation names */ @@ -128,7 +128,7 @@ class ObjectNameList { *of the list itself. *@param name the name of the object whose index is to be found */ - int getIndex( const QString &name = QString::null ); + int getIndex( const TQString &name = TQString::null ); /**Two modes are available: *allLists = loop through the whole list if next() is called @@ -158,7 +158,7 @@ class ObjectNameList { *are in first list too. We just have to delete objects which are not in first list. These objects *will stored in this list. */ - QPtrList constellations; + TQPtrList constellations; /** *Which list was accessed last time by first() or next() diff --git a/kstars/kstars/opsadvanced.cpp b/kstars/kstars/opsadvanced.cpp index 5fe1953b..7a503f08 100644 --- a/kstars/kstars/opsadvanced.cpp +++ b/kstars/kstars/opsadvanced.cpp @@ -15,16 +15,16 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include "opsadvanced.h" #include "Options.h" #include "kstars.h" #include "timestepbox.h" -OpsAdvanced::OpsAdvanced( QWidget *p, const char *name, WFlags fl ) +OpsAdvanced::OpsAdvanced( TQWidget *p, const char *name, WFlags fl ) : OpsAdvancedUI( p, name, fl ) { ksw = (KStars *)p; @@ -32,9 +32,9 @@ OpsAdvanced::OpsAdvanced( QWidget *p, const char *name, WFlags fl ) //Initialize the timestep value SlewTimeScale->tsbox()->changeScale( Options::slewTimeScale() ); - connect( SlewTimeScale, SIGNAL( scaleChanged( float ) ), this, SLOT( slotChangeTimeScale( float ) ) ); + connect( SlewTimeScale, TQT_SIGNAL( scaleChanged( float ) ), this, TQT_SLOT( slotChangeTimeScale( float ) ) ); - connect( kcfg_HideOnSlew, SIGNAL( clicked() ), this, SLOT( slotToggleHideOptions() ) ); + connect( kcfg_HideOnSlew, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotToggleHideOptions() ) ); } OpsAdvanced::~OpsAdvanced() {} diff --git a/kstars/kstars/opsadvanced.h b/kstars/kstars/opsadvanced.h index fd5596ee..9295e437 100644 --- a/kstars/kstars/opsadvanced.h +++ b/kstars/kstars/opsadvanced.h @@ -38,7 +38,7 @@ class OpsAdvanced : public OpsAdvancedUI Q_OBJECT public: - OpsAdvanced( QWidget *parent=0, const char *name=0, WFlags fl = 0 ); + OpsAdvanced( TQWidget *parent=0, const char *name=0, WFlags fl = 0 ); ~OpsAdvanced(); private slots: diff --git a/kstars/kstars/opscatalog.cpp b/kstars/kstars/opscatalog.cpp index d67f58ac..60f45aaa 100644 --- a/kstars/kstars/opscatalog.cpp +++ b/kstars/kstars/opscatalog.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include //QCheckListItem -#include -#include +#include //QCheckListItem +#include +#include #include #include "opscatalog.h" @@ -29,22 +29,22 @@ #include "magnitudespinbox.h" #include "customcatalog.h" -OpsCatalog::OpsCatalog( QWidget *p, const char *name, WFlags fl ) +OpsCatalog::OpsCatalog( TQWidget *p, const char *name, WFlags fl ) : OpsCatalogUI( p, name, fl ) { ksw = (KStars *)p; //Populate CatalogList - showIC = new QCheckListItem( CatalogList, i18n( "Index Catalog (IC)" ), QCheckListItem::CheckBox ); + showIC = new TQCheckListItem( CatalogList, i18n( "Index Catalog (IC)" ), TQCheckListItem::CheckBox ); showIC->setOn( Options::showIC() ); - showNGC = new QCheckListItem( CatalogList, i18n( "New General Catalog (NGC)" ), QCheckListItem::CheckBox ); + showNGC = new TQCheckListItem( CatalogList, i18n( "New General Catalog (NGC)" ), TQCheckListItem::CheckBox ); showNGC->setOn( Options::showNGC() ); - showMessImages = new QCheckListItem( CatalogList, i18n( "Messier Catalog (images)" ), QCheckListItem::CheckBox ); + showMessImages = new TQCheckListItem( CatalogList, i18n( "Messier Catalog (images)" ), TQCheckListItem::CheckBox ); showMessImages->setOn( Options::showMessierImages() ); - showMessier = new QCheckListItem( CatalogList, i18n( "Messier Catalog (symbols)" ), QCheckListItem::CheckBox ); + showMessier = new TQCheckListItem( CatalogList, i18n( "Messier Catalog (symbols)" ), TQCheckListItem::CheckBox ); showMessier->setOn( Options::showMessier() ); kcfg_MagLimitDrawStar->setValue( Options::magLimitDrawStar() ); @@ -60,21 +60,21 @@ OpsCatalog::OpsCatalog( QWidget *p, const char *name, WFlags fl ) //Add custom catalogs, if necessary for ( unsigned int i=0; idata()->customCatalogs().count(); ++i ) { //loop over custom catalogs - QCheckListItem *newItem = new QCheckListItem( CatalogList, ksw->data()->customCatalogs().at(i)->name(), QCheckListItem::CheckBox ); + TQCheckListItem *newItem = new TQCheckListItem( CatalogList, ksw->data()->customCatalogs().at(i)->name(), TQCheckListItem::CheckBox ); newItem->setOn( Options::showCatalog()[i] ); } - connect( CatalogList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( updateDisplay() ) ); - connect( CatalogList, SIGNAL( selectionChanged() ), this, SLOT( selectCatalog() ) ); - connect( AddCatalog, SIGNAL( clicked() ), this, SLOT( slotAddCatalog() ) ); - connect( LoadCatalog, SIGNAL( clicked() ), this, SLOT( slotLoadCatalog() ) ); - connect( RemoveCatalog, SIGNAL( clicked() ), this, SLOT( slotRemoveCatalog() ) ); - - connect( kcfg_MagLimitDrawStar, SIGNAL( valueChanged(double) ), - SLOT( slotSetDrawStarMagnitude(double) ) ); - connect( kcfg_MagLimitDrawStarZoomOut, SIGNAL( valueChanged(double) ), - SLOT( slotSetDrawStarZoomOutMagnitude(double) ) ); - connect( kcfg_ShowStars, SIGNAL( toggled(bool) ), SLOT( slotStarWidgets(bool) ) ); + connect( CatalogList, TQT_SIGNAL( clicked( TQListViewItem* ) ), this, TQT_SLOT( updateDisplay() ) ); + connect( CatalogList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( selectCatalog() ) ); + connect( AddCatalog, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddCatalog() ) ); + connect( LoadCatalog, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotLoadCatalog() ) ); + connect( RemoveCatalog, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveCatalog() ) ); + + connect( kcfg_MagLimitDrawStar, TQT_SIGNAL( valueChanged(double) ), + TQT_SLOT( slotSetDrawStarMagnitude(double) ) ); + connect( kcfg_MagLimitDrawStarZoomOut, TQT_SIGNAL( valueChanged(double) ), + TQT_SLOT( slotSetDrawStarZoomOutMagnitude(double) ) ); + connect( kcfg_ShowStars, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotStarWidgets(bool) ) ); } //empty destructor @@ -82,7 +82,7 @@ OpsCatalog::~OpsCatalog() {} void OpsCatalog::updateDisplay() { //Modify display according to settings in the CatalogList - if ( sender()->name() == QString( "CatalogList" ) ) + if ( sender()->name() == TQString( "CatalogList" ) ) Options::setShowDeepSky( true ); Options::setShowMessier( showMessier->isOn() ); @@ -90,7 +90,7 @@ void OpsCatalog::updateDisplay() { Options::setShowNGC( showNGC->isOn() ); Options::setShowIC( showIC->isOn() ); for ( unsigned int i=0; idata()->customCatalogs().count(); ++i ) { - QCheckListItem *item = (QCheckListItem*)( CatalogList->findItem( ksw->data()->customCatalogs().at(i)->name(), 0 )); + TQCheckListItem *item = (TQCheckListItem*)( CatalogList->findItem( ksw->data()->customCatalogs().at(i)->name(), 0 )); Options::showCatalog()[i] = item->isOn(); } @@ -114,13 +114,13 @@ void OpsCatalog::selectCatalog() { void OpsCatalog::slotAddCatalog() { AddCatDialog ac(this); - if ( ac.exec()==QDialog::Accepted ) + if ( ac.exec()==TQDialog::Accepted ) insertCatalog( ac.filename() ); } void OpsCatalog::slotLoadCatalog() { //Get the filename from the user - QString filename = KFileDialog::getOpenFileName( QDir::homeDirPath(), "*"); + TQString filename = KFileDialog::getOpenFileName( TQDir::homeDirPath(), "*"); if ( ! filename.isEmpty() ) { //test integrity of file before trying to add it CustomCatalog *newCat = ksw->data()->createCustomCatalog( filename, true ); //true = show errors @@ -133,19 +133,19 @@ void OpsCatalog::slotLoadCatalog() { } } -void OpsCatalog::insertCatalog( const QString &filename ) { +void OpsCatalog::insertCatalog( const TQString &filename ) { //Add new custom catalog, based on the list of SkyObjects we just parsed ksw->data()->addCatalog( filename ); //Get the new catalog's name, add entry to the listbox - QString name = ksw->data()->customCatalogs().current()->name(); - QCheckListItem *newCat = new QCheckListItem( CatalogList, name, QCheckListItem::CheckBox ); + TQString name = ksw->data()->customCatalogs().current()->name(); + TQCheckListItem *newCat = new TQCheckListItem( CatalogList, name, TQCheckListItem::CheckBox ); newCat->setOn( true ); CatalogList->insertItem( newCat ); //update Options object - QStringList tFileList = Options::catalogFile(); - QValueList tShowList = Options::showCatalog(); + TQStringList tFileList = Options::catalogFile(); + TQValueList tShowList = Options::showCatalog(); tFileList.append( filename ); tShowList.append( true ); Options::setCatalogFile( tFileList ); @@ -162,8 +162,8 @@ void OpsCatalog::slotRemoveCatalog() { ksw->data()->removeCatalog( i ); //Update Options object - QStringList tFileList = Options::catalogFile(); - QValueList tShowList = Options::showCatalog(); + TQStringList tFileList = Options::catalogFile(); + TQValueList tShowList = Options::showCatalog(); tFileList.remove( tFileList[i] ); tShowList.remove( tShowList[i] ); Options::setCatalogFile( tFileList ); diff --git a/kstars/kstars/opscatalog.h b/kstars/kstars/opscatalog.h index dd33f60a..514d9ea9 100644 --- a/kstars/kstars/opscatalog.h +++ b/kstars/kstars/opscatalog.h @@ -41,7 +41,7 @@ class OpsCatalog : public OpsCatalogUI Q_OBJECT public: - OpsCatalog( QWidget *parent=0, const char *name=0, WFlags fl = 0 ); + OpsCatalog( TQWidget *parent=0, const char *name=0, WFlags fl = 0 ); ~OpsCatalog(); private slots: @@ -55,9 +55,9 @@ private slots: void slotStarWidgets(bool on); private: - void insertCatalog( const QString & filename ); + void insertCatalog( const TQString & filename ); - QCheckListItem *showMessier, *showMessImages, *showNGC, *showIC; + TQCheckListItem *showMessier, *showMessImages, *showNGC, *showIC; KStars *ksw; }; diff --git a/kstars/kstars/opscolors.cpp b/kstars/kstars/opscolors.cpp index 723fd559..8746dd00 100644 --- a/kstars/kstars/opscolors.cpp +++ b/kstars/kstars/opscolors.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -32,15 +32,15 @@ #include "skymap.h" #include "colorscheme.h" -OpsColors::OpsColors( QWidget *p, const char *name, WFlags fl ) +OpsColors::OpsColors( TQWidget *p, const char *name, WFlags fl ) : OpsColorsUI( p, name, fl ) { ksw = (KStars *)p; //Populate list of adjustable colors for ( unsigned int i=0; i < ksw->data()->colorScheme()->numberOfColors(); ++i ) { - QPixmap col( 30, 20 ); - col.fill( QColor( ksw->data()->colorScheme()->colorAt( i ) ) ); + TQPixmap col( 30, 20 ); + col.fill( TQColor( ksw->data()->colorScheme()->colorAt( i ) ) ); ColorPalette->insertItem( col, ksw->data()->colorScheme()->nameAt( i ) ); } @@ -54,11 +54,11 @@ OpsColors::OpsColors( QWidget *p, const char *name, WFlags fl ) PresetFileList.append( "night.colors" ); PresetFileList.append( "moonless-night.colors" ); - QFile file; - QString line, schemeName, filename; + TQFile file; + TQString line, schemeName, filename; file.setName( locate( "appdata", "colors.dat" ) ); if ( file.exists() && file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.eof() ) { line = stream.readLine(); @@ -82,12 +82,12 @@ OpsColors::OpsColors( QWidget *p, const char *name, WFlags fl ) else kcfg_StarColorIntensity->setEnabled( true ); - connect( ColorPalette, SIGNAL( clicked( QListBoxItem* ) ), this, SLOT( newColor( QListBoxItem* ) ) ); - connect( kcfg_StarColorIntensity, SIGNAL( valueChanged( int ) ), this, SLOT( slotStarColorIntensity( int ) ) ); - connect( kcfg_StarColorMode, SIGNAL( activated( int ) ), this, SLOT( slotStarColorMode( int ) ) ); - connect( PresetBox, SIGNAL( highlighted( int ) ), this, SLOT( slotPreset( int ) ) ); - connect( AddPreset, SIGNAL( clicked() ), this, SLOT( slotAddPreset() ) ); - connect( RemovePreset, SIGNAL( clicked() ), this, SLOT( slotRemovePreset() ) ); + connect( ColorPalette, TQT_SIGNAL( clicked( TQListBoxItem* ) ), this, TQT_SLOT( newColor( TQListBoxItem* ) ) ); + connect( kcfg_StarColorIntensity, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotStarColorIntensity( int ) ) ); + connect( kcfg_StarColorMode, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotStarColorMode( int ) ) ); + connect( PresetBox, TQT_SIGNAL( highlighted( int ) ), this, TQT_SLOT( slotPreset( int ) ) ); + connect( AddPreset, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddPreset() ) ); + connect( RemovePreset, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemovePreset() ) ); RemovePreset->setEnabled( false ); } @@ -95,14 +95,14 @@ OpsColors::OpsColors( QWidget *p, const char *name, WFlags fl ) //empty destructor OpsColors::~OpsColors() {} -void OpsColors::newColor( QListBoxItem *item ) { - QPixmap pixmap( 30, 20 ); - QColor NewColor; +void OpsColors::newColor( TQListBoxItem *item ) { + TQPixmap pixmap( 30, 20 ); + TQColor NewColor; unsigned int i; for ( i=0; i < ksw->data()->colorScheme()->numberOfColors(); ++i ) { if ( item->text() == ksw->data()->colorScheme()->nameAt( i ) ) { - QColor col( ksw->data()->colorScheme()->colorAt( i ) ); + TQColor col( ksw->data()->colorScheme()->colorAt( i ) ); if(KColorDialog::getColor( col )) NewColor = col; break; @@ -120,19 +120,19 @@ void OpsColors::newColor( QListBoxItem *item ) { } void OpsColors::slotPreset( int index ) { - QStringList::Iterator it = PresetFileList.at( index ); + TQStringList::Iterator it = PresetFileList.at( index ); bool result = setColors( *it ); if (!result) { - QString message = i18n( "The specified color scheme file (%1) could not be found, or was corrupt." ).arg( QString(*it) ); + TQString message = i18n( "The specified color scheme file (%1) could not be found, or was corrupt." ).arg( TQString(*it) ); KMessageBox::sorry( 0, message, i18n( "Could Not Set Color Scheme" ) ); } } -bool OpsColors::setColors( QString filename ) { - QPixmap *temp = new QPixmap( 30, 20 ); +bool OpsColors::setColors( TQString filename ) { + TQPixmap *temp = new TQPixmap( 30, 20 ); //just checking if colorscheme is removable... - QFile test; + TQFile test; test.setName( locateLocal( "appdata", filename ) ); //try filename in local user KDE directory tree. if ( test.exists() ) RemovePreset->setEnabled( true ); else RemovePreset->setEnabled( false ); @@ -149,7 +149,7 @@ bool OpsColors::setColors( QString filename ) { ksw->map()->setStarColorIntensity( ksw->data()->colorScheme()->starColorIntensity() ); for ( unsigned int i=0; i < ksw->data()->colorScheme()->numberOfColors(); ++i ) { - temp->fill( QColor( ksw->data()->colorScheme()->colorAt( i ) ) ); + temp->fill( TQColor( ksw->data()->colorScheme()->colorAt( i ) ) ); ColorPalette->changeItem( *temp, ksw->data()->colorScheme()->nameAt( i ), i ); } @@ -159,72 +159,72 @@ bool OpsColors::setColors( QString filename ) { void OpsColors::slotAddPreset() { bool okPressed = false; - QString schemename = KInputDialog::getText( i18n( "New Color Scheme" ), + TQString schemename = KInputDialog::getText( i18n( "New Color Scheme" ), i18n( "Enter a name for the new color scheme:" ), - QString::null, &okPressed, 0 ); + TQString::null, &okPressed, 0 ); if ( okPressed && ! schemename.isEmpty() ) { if ( ksw->data()->colorScheme()->save( schemename ) ) { PresetBox->insertItem( schemename ); PresetBox->setCurrentItem( PresetBox->findItem( schemename ) ); - QString fname = ksw->data()->colorScheme()->fileName(); + TQString fname = ksw->data()->colorScheme()->fileName(); PresetFileList.append( fname ); - ksw->addColorMenuItem( schemename, QString("cs_" + fname.left(fname.find(".colors"))).utf8() ); + ksw->addColorMenuItem( schemename, TQString("cs_" + fname.left(fname.find(".colors"))).utf8() ); } } } void OpsColors::slotRemovePreset() { - QString name = PresetBox->currentText(); - QString filename = PresetFileList[ PresetBox->currentItem() ]; - QFile cdatFile; + TQString name = PresetBox->currentText(); + TQString filename = PresetFileList[ PresetBox->currentItem() ]; + TQFile cdatFile; cdatFile.setName( locateLocal( "appdata", "colors.dat" ) ); //determine filename in local user KDE directory tree. //Remove action from color-schemes menu - ksw->removeColorMenuItem( QString("cs_" + filename.left( filename.find(".colors"))).utf8() ); + ksw->removeColorMenuItem( TQString("cs_" + filename.left( filename.find(".colors"))).utf8() ); if ( !cdatFile.exists() || !cdatFile.open( IO_ReadWrite ) ) { - QString message = i18n( "Local color scheme index file could not be opened.\nScheme cannot be removed." ); + TQString message = i18n( "Local color scheme index file could not be opened.\nScheme cannot be removed." ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); } else { - //Remove entry from the ListBox and from the QStringList holding filenames. + //Remove entry from the ListBox and from the TQStringList holding filenames. //We don't want another color scheme to be selected, so first //temporarily disconnect the "highlighted" signal. - disconnect( PresetBox, SIGNAL( highlighted( int ) ), this, SLOT( slotPreset( int ) ) ); + disconnect( PresetBox, TQT_SIGNAL( highlighted( int ) ), this, TQT_SLOT( slotPreset( int ) ) ); PresetBox->removeItem( PresetBox->currentItem() ); PresetBox->setCurrentItem( -1 ); RemovePreset->setEnabled( false ); //Reconnect the "highlighted" signal - connect( PresetBox, SIGNAL( highlighted( int ) ), this, SLOT( slotPreset( int ) ) ); + connect( PresetBox, TQT_SIGNAL( highlighted( int ) ), this, TQT_SLOT( slotPreset( int ) ) ); - //Read the contents of colors.dat into a QStringList, except for the entry to be removed. - QTextStream stream( &cdatFile ); - QStringList slist; + //Read the contents of colors.dat into a TQStringList, except for the entry to be removed. + TQTextStream stream( &cdatFile ); + TQStringList slist; bool removed = false; while ( !stream.eof() ) { - QString line = stream.readLine(); + TQString line = stream.readLine(); if ( line.left( line.find(':') ) != name ) slist.append( line ); else removed = true; } if ( removed ) { //Entry was removed; delete the corresponding .colors file. - QFile colorFile; + TQFile colorFile; colorFile.setName( locateLocal( "appdata", filename ) ); //determine filename in local user KDE directory tree. if ( !colorFile.remove() ) { - QString message = i18n( "Could not delete the file: %1" ).arg( colorFile.name() ); + TQString message = i18n( "Could not delete the file: %1" ).arg( colorFile.name() ); KMessageBox::sorry( 0, message, i18n( "Error Deleting File" ) ); } //remove the old colors.dat file, and rebuild it with the modified string list. cdatFile.remove(); cdatFile.open( IO_ReadWrite ); - QTextStream stream2( &cdatFile ); + TQTextStream stream2( &cdatFile ); for( unsigned int i=0; i +#include #include "opscolorsui.h" @@ -43,11 +43,11 @@ class OpsColors : public OpsColorsUI Q_OBJECT public: - OpsColors( QWidget *parent=0, const char *name=0, WFlags fl = 0 ); + OpsColors( TQWidget *parent=0, const char *name=0, WFlags fl = 0 ); ~OpsColors(); private slots: - void newColor( QListBoxItem* item ); + void newColor( TQListBoxItem* item ); void slotPreset( int i ); void slotAddPreset(); void slotRemovePreset(); @@ -55,11 +55,11 @@ private slots: void slotStarColorIntensity( int ); private: - bool setColors( QString filename ); + bool setColors( TQString filename ); KStars *ksw; - QStringList PresetFileList; + TQStringList PresetFileList; }; #endif //OPSCOLORS_H diff --git a/kstars/kstars/opsguides.cpp b/kstars/kstars/opsguides.cpp index ae6db674..aae84244 100644 --- a/kstars/kstars/opsguides.cpp +++ b/kstars/kstars/opsguides.cpp @@ -14,17 +14,17 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include "opsguides.h" -OpsGuides::OpsGuides( QWidget* parent, const char* name, WFlags fl ) +OpsGuides::OpsGuides( TQWidget* parent, const char* name, WFlags fl ) : OpsGuidesUI( parent, name, fl ) { - connect( kcfg_ShowCNames, SIGNAL( clicked() ), - this, SLOT( slotToggleConstellOptions() ) ); - connect( kcfg_ShowMilkyWay, SIGNAL( clicked() ), - this, SLOT( slotToggleMilkyWayOptions() ) ); + connect( kcfg_ShowCNames, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotToggleConstellOptions() ) ); + connect( kcfg_ShowMilkyWay, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotToggleMilkyWayOptions() ) ); } OpsGuides::~OpsGuides() diff --git a/kstars/kstars/opsguides.h b/kstars/kstars/opsguides.h index c5b09fd3..deb2ff50 100644 --- a/kstars/kstars/opsguides.h +++ b/kstars/kstars/opsguides.h @@ -24,7 +24,7 @@ class OpsGuides : public OpsGuidesUI Q_OBJECT public: - OpsGuides( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + OpsGuides( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~OpsGuides(); private slots: diff --git a/kstars/kstars/opssolarsystem.cpp b/kstars/kstars/opssolarsystem.cpp index 85b420c3..41ee58c0 100644 --- a/kstars/kstars/opssolarsystem.cpp +++ b/kstars/kstars/opssolarsystem.cpp @@ -14,23 +14,23 @@ * (at your option) any later version. * * * ***************************************************************************/ -#include -#include +#include +#include #include #include "opssolarsystem.h" #include "kstars.h" #include "magnitudespinbox.h" -OpsSolarSystem::OpsSolarSystem( QWidget *parent, const char *name, WFlags fl ) +OpsSolarSystem::OpsSolarSystem( TQWidget *parent, const char *name, WFlags fl ) : OpsSolarSystemUI( parent, name, fl ) { ksw = (KStars *)parent; - connect( kcfg_ShowAsteroids, SIGNAL( toggled(bool) ), SLOT( slotAsteroidWidgets(bool) ) ); - connect( kcfg_ShowComets, SIGNAL( toggled(bool) ), SLOT( slotCometWidgets(bool) ) ); - connect( ClearAllTrails, SIGNAL( clicked() ), ksw, SLOT( slotClearAllTrails() ) ); - connect( showAllPlanets, SIGNAL( clicked() ), this, SLOT( slotSelectPlanets() ) ); - connect( showNonePlanets, SIGNAL( clicked() ), this, SLOT( slotSelectPlanets() ) ); + connect( kcfg_ShowAsteroids, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotAsteroidWidgets(bool) ) ); + connect( kcfg_ShowComets, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotCometWidgets(bool) ) ); + connect( ClearAllTrails, TQT_SIGNAL( clicked() ), ksw, TQT_SLOT( slotClearAllTrails() ) ); + connect( showAllPlanets, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSelectPlanets() ) ); + connect( showNonePlanets, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSelectPlanets() ) ); slotAsteroidWidgets( kcfg_ShowAsteroids->isChecked() ); slotCometWidgets( kcfg_ShowComets->isChecked() ); @@ -58,7 +58,7 @@ void OpsSolarSystem::slotCometWidgets( bool on ) { void OpsSolarSystem::slotSelectPlanets() { bool b=true; - if ( sender()->name() == QString( "showNonePlanets" ) ) b = false; + if ( sender()->name() == TQString( "showNonePlanets" ) ) b = false; kcfg_ShowSun->setChecked( b ); kcfg_ShowMoon->setChecked( b ); diff --git a/kstars/kstars/opssolarsystem.h b/kstars/kstars/opssolarsystem.h index e43fd8b7..07ce2c64 100644 --- a/kstars/kstars/opssolarsystem.h +++ b/kstars/kstars/opssolarsystem.h @@ -34,7 +34,7 @@ class OpsSolarSystem : public OpsSolarSystemUI Q_OBJECT public: - OpsSolarSystem( QWidget *parent=0, const char *name=0, WFlags fl = 0 ); + OpsSolarSystem( TQWidget *parent=0, const char *name=0, WFlags fl = 0 ); ~OpsSolarSystem(); private slots: diff --git a/kstars/kstars/planetcatalog.cpp b/kstars/kstars/planetcatalog.cpp index 9817e871..ce4b9351 100644 --- a/kstars/kstars/planetcatalog.cpp +++ b/kstars/kstars/planetcatalog.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include "planetcatalog.h" #include "dms.h" @@ -97,7 +97,7 @@ bool PlanetCatalog::initialize() { } void PlanetCatalog::addObject( ObjectNameList &ObjNames ) const { - QPtrListIterator it(planets); + TQPtrListIterator it(planets); for (KSPlanetBase *ksp = it.toFirst(); ksp != 0; ksp = ++it) { ObjNames.append( ksp ); @@ -122,7 +122,7 @@ bool PlanetCatalog::isPlanet(SkyObject *so) const { if (so == Earth) return true; - QPtrListIterator it(planets); + TQPtrListIterator it(planets); for (KSPlanetBase *ksp = it.toFirst(); ksp != 0; ksp = ++it) { if (so == ksp) @@ -132,11 +132,11 @@ bool PlanetCatalog::isPlanet(SkyObject *so) const { return false; } -KSPlanetBase *PlanetCatalog::findByName( const QString n) const { +KSPlanetBase *PlanetCatalog::findByName( const TQString n) const { if (n == "Earth") return Earth; - QPtrListIterator it(planets); + TQPtrListIterator it(planets); for (KSPlanetBase *ksp = it.toFirst(); ksp != 0; ksp = ++it) { if (ksp->name() == n) @@ -157,7 +157,7 @@ static double dist_squared(const SkyPoint *a, const SkyPoint *b) { } SkyObject *PlanetCatalog::findClosest(const SkyPoint *p, double &r) const { - QPtrListIterator it(planets); + TQPtrListIterator it(planets); SkyObject *found = 0; double trialr = 0.0; double rmin = 100000.0; diff --git a/kstars/kstars/planetcatalog.h b/kstars/kstars/planetcatalog.h index 3a263e95..976372b9 100644 --- a/kstars/kstars/planetcatalog.h +++ b/kstars/kstars/planetcatalog.h @@ -19,9 +19,9 @@ #define PLANETCATALOG_H /**@class PlanetCatalog - *This class contains a QPtrList of the eight major planets, as well as pointers + *This class contains a TQPtrList of the eight major planets, as well as pointers *to objects representing the Earth and Sun. Note that the Sun also exists - *in the QPtrList, the external pointer is just for convenience. + *in the TQPtrList, the external pointer is just for convenience. *There are methods to search *the collection by name, identify if a given object pointer is a planet, *find the coordinates of a planet, and find the planet closest to a given @@ -31,9 +31,9 @@ *@version 1.0 */ -#include -#include -#include +#include +#include +#include class QString; class KStarsData; @@ -46,14 +46,14 @@ class SkyObject; class ObjectNameList; class dms; -class PlanetCatalog : public QObject { +class PlanetCatalog : public TQObject { Q_OBJECT public: /**Constructor. */ PlanetCatalog(KStarsData *dat); - /**Destructor. Delete the Earth object (all others auto-deleted by QPtrList)*/ + /**Destructor. Delete the Earth object (all others auto-deleted by TQPtrList)*/ ~PlanetCatalog(); /**Loads all planetary data from files on disk into the appropriate objects. */ @@ -92,7 +92,7 @@ class PlanetCatalog : public QObject { *@p n the name of the planet to point to *@note if no planet with this name is found, return the NULL pointer. */ - KSPlanetBase *findByName( const QString n) const; + KSPlanetBase *findByName( const TQString n) const; /**@return a pointer to the planet closest to the given SkyPoint *(within a maximum angular search radius) @@ -102,7 +102,7 @@ class PlanetCatalog : public QObject { SkyObject *findClosest(const SkyPoint *p, double &r) const; private: - QPtrList planets; + TQPtrList planets; KSPlanet *Earth; KSSun *Sun; KStarsData *kd; diff --git a/kstars/kstars/simclock.cpp b/kstars/kstars/simclock.cpp index ee486a86..0e7c467a 100644 --- a/kstars/kstars/simclock.cpp +++ b/kstars/kstars/simclock.cpp @@ -25,9 +25,9 @@ int SimClock::idgen = 1; int SimClock::TimerInterval = 100; //msec -SimClock::SimClock(QObject *parent, const KStarsDateTime &when) : - DCOPObject("clock#" + QCString().setNum(idgen++)), - QObject(parent), +SimClock::SimClock(TQObject *parent, const KStarsDateTime &when) : + DCOPObject("clock#" + TQCString().setNum(idgen++)), + TQObject(parent), tmr(this) { if (! when.isValid() ) tmr.stop(); @@ -38,12 +38,12 @@ SimClock::SimClock(QObject *parent, const KStarsDateTime &when) : ManualMode = false; ManualActive = false; - QObject::connect(&tmr, SIGNAL(timeout()), this, SLOT(tick())); + TQObject::connect(&tmr, TQT_SIGNAL(timeout()), this, TQT_SLOT(tick())); } SimClock::SimClock (const SimClock &old) : - DCOPObject("clock#" + QCString().setNum(idgen++)), - QObject(old.parent()), + DCOPObject("clock#" + TQCString().setNum(idgen++)), + TQObject(old.parent()), SimClockInterface(), tmr(this) { @@ -54,7 +54,7 @@ SimClock::SimClock (const SimClock &old) : ManualMode = old.ManualMode; ManualActive = old.ManualActive; - QObject::connect(&tmr, SIGNAL(timeout()), this, SLOT(tick())); + TQObject::connect(&tmr, TQT_SIGNAL(timeout()), this, TQT_SLOT(tick())); } void SimClock::tick() { diff --git a/kstars/kstars/simclock.h b/kstars/kstars/simclock.h index 05992acc..d4375bdb 100644 --- a/kstars/kstars/simclock.h +++ b/kstars/kstars/simclock.h @@ -19,7 +19,7 @@ #define KSTARS_SIMCLOCK_H_ #include -#include +#include #include "simclockinterface.h" #include "kstarsdatetime.h" @@ -30,7 +30,7 @@ *@version 1.0 */ -class SimClock : public QObject, public SimClockInterface { +class SimClock : public TQObject, public SimClockInterface { Q_OBJECT public: @@ -39,7 +39,7 @@ class SimClock : public QObject, public SimClockInterface { * @param parent parent object for the clock * @param when the date/time to which the SimClock should be initialized in UTC */ - SimClock(QObject *parent = 0, const KStarsDateTime &when = KStarsDateTime::currentDateTime() ); + SimClock(TQObject *parent = 0, const KStarsDateTime &when = KStarsDateTime::currentDateTime() ); /** * Constructor * @param old a SimClock to initialize from. @@ -95,7 +95,7 @@ class SimClock : public QObject, public SimClockInterface { /**Adjust the clock timescale*/ void setScale(float s); - /**Respond to the QTimer::timeout signal */ + /**Respond to the TQTimer::timeout signal */ void tick(); /**Equivalent of tick() for manual mode. @@ -126,9 +126,9 @@ class SimClock : public QObject, public SimClockInterface { private: long double julianmark; KStarsDateTime UTC; - QTimer tmr; + TQTimer tmr; double Scale; - QTime sysmark; + TQTime sysmark; int lastelapsed; bool ManualMode, ManualActive; diff --git a/kstars/kstars/skymap.cpp b/kstars/kstars/skymap.cpp index 051ab6d0..13a5ab45 100644 --- a/kstars/kstars/skymap.cpp +++ b/kstars/kstars/skymap.cpp @@ -23,11 +23,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -51,8 +51,8 @@ #include "starobject.h" #include "customcatalog.h" -SkyMap::SkyMap(KStarsData *d, QWidget *parent, const char *name ) - : QWidget (parent,name), computeSkymap(true), angularDistanceMode(false), +SkyMap::SkyMap(KStarsData *d, TQWidget *parent, const char *name ) + : TQWidget (parent,name), computeSkymap(true), angularDistanceMode(false), ksw(0), data(d), pmenu(0), sky(0), sky2(0), IBoxes(0), ClickedObject(0), FocusObject(0), TransientObject(0), starpix(0), pts(0), sp(0) @@ -60,21 +60,21 @@ SkyMap::SkyMap(KStarsData *d, QWidget *parent, const char *name ) if ( parent ) ksw = (KStars*) parent->parent(); else ksw = 0; - pts = new QPointArray( 2000 ); // points for milkyway and horizon + pts = new TQPointArray( 2000 ); // points for milkyway and horizon sp = new SkyPoint(); // needed by coordinate grid - ZoomRect = QRect(); + ZoomRect = TQRect(); setDefaultMouseCursor(); // set the cross cursor // load the pixmaps of stars starpix = new StarPixmap( data->colorScheme()->starColorMode(), data->colorScheme()->starColorIntensity() ); - setBackgroundColor( QColor( data->colorScheme()->colorNamed( "SkyColor" ) ) ); - setBackgroundMode( QWidget::NoBackground ); - setFocusPolicy( QWidget::StrongFocus ); + setBackgroundColor( TQColor( data->colorScheme()->colorNamed( "SkyColor" ) ) ); + setBackgroundMode( TQWidget::NoBackground ); + setFocusPolicy( TQWidget::StrongFocus ); setMinimumSize( 380, 250 ); - setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); setMouseTracking (true); //Generate MouseMove events! midMouseButtonDown = false; @@ -85,14 +85,14 @@ SkyMap::SkyMap(KStarsData *d, QWidget *parent, const char *name ) ClickedObject = NULL; FocusObject = NULL; - sky = new QPixmap(); - sky2 = new QPixmap(); + sky = new TQPixmap(); + sky2 = new TQPixmap(); pmenu = new KSPopupMenu( ksw ); //Initialize Transient label stuff TransientTimeout = 100; //fade label color every 0.2 sec - connect( &HoverTimer, SIGNAL( timeout() ), this, SLOT( slotTransientLabel() ) ); - connect( &TransientTimer, SIGNAL( timeout() ), this, SLOT( slotTransientTimeout() ) ); + connect( &HoverTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientLabel() ) ); + connect( &TransientTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransientTimeout() ) ); IBoxes = new InfoBoxes( Options::windowWidth(), Options::windowHeight(), Options::positionTimeBox(), Options::shadeTimeBox(), @@ -111,14 +111,14 @@ SkyMap::SkyMap(KStarsData *d, QWidget *parent, const char *name ) IBoxes->geoChanged( data->geo() ); - connect( IBoxes->timeBox(), SIGNAL( shaded(bool) ), data, SLOT( saveTimeBoxShaded(bool) ) ); - connect( IBoxes->geoBox(), SIGNAL( shaded(bool) ), data, SLOT( saveGeoBoxShaded(bool) ) ); - connect( IBoxes->focusBox(), SIGNAL( shaded(bool) ), data, SLOT( saveFocusBoxShaded(bool) ) ); - connect( IBoxes->timeBox(), SIGNAL( moved(QPoint) ), data, SLOT( saveTimeBoxPos(QPoint) ) ); - connect( IBoxes->geoBox(), SIGNAL( moved(QPoint) ), data, SLOT( saveGeoBoxPos(QPoint) ) ); - connect( IBoxes->focusBox(), SIGNAL( moved(QPoint) ), data, SLOT( saveFocusBoxPos(QPoint) ) ); + connect( IBoxes->timeBox(), TQT_SIGNAL( shaded(bool) ), data, TQT_SLOT( saveTimeBoxShaded(bool) ) ); + connect( IBoxes->geoBox(), TQT_SIGNAL( shaded(bool) ), data, TQT_SLOT( saveGeoBoxShaded(bool) ) ); + connect( IBoxes->focusBox(), TQT_SIGNAL( shaded(bool) ), data, TQT_SLOT( saveFocusBoxShaded(bool) ) ); + connect( IBoxes->timeBox(), TQT_SIGNAL( moved(TQPoint) ), data, TQT_SLOT( saveTimeBoxPos(TQPoint) ) ); + connect( IBoxes->geoBox(), TQT_SIGNAL( moved(TQPoint) ), data, TQT_SLOT( saveGeoBoxPos(TQPoint) ) ); + connect( IBoxes->focusBox(), TQT_SIGNAL( moved(TQPoint) ), data, TQT_SLOT( saveFocusBoxPos(TQPoint) ) ); - connect( this, SIGNAL( destinationChanged() ), this, SLOT( slewFocus() ) ); + connect( this, TQT_SIGNAL( destinationChanged() ), this, TQT_SLOT( slewFocus() ) ); //Initialize Refraction correction lookup table arrays. RefractCorr1 is for calculating //the apparent altitude from the true altitude, and RefractCorr2 is for the reverse. @@ -156,13 +156,13 @@ SkyMap::~SkyMap() { } void SkyMap::setGeometry( int x, int y, int w, int h ) { - QWidget::setGeometry( x, y, w, h ); + TQWidget::setGeometry( x, y, w, h ); sky->resize( w, h ); sky2->resize( w, h ); } -void SkyMap::setGeometry( const QRect &r ) { - QWidget::setGeometry( r ); +void SkyMap::setGeometry( const TQRect &r ) { + TQWidget::setGeometry( r ); sky->resize( r.width(), r.height() ); sky2->resize( r.width(), r.height() ); } @@ -171,7 +171,7 @@ void SkyMap::setGeometry( const QRect &r ) { void SkyMap::showFocusCoords( bool coordsOnly ) { if ( ! coordsOnly ) { //display object info in infoBoxes - QString oname; + TQString oname; oname = i18n( "nothing" ); if ( focusObject() != NULL && Options::isTracking() ) oname = focusObject()->translatedLongName(); @@ -325,7 +325,7 @@ SkyObject* SkyMap::objectNearest( SkyPoint *p ) { for ( register unsigned int j=0; j< data->CustomCatalogs.count(); ++j ) { if ( Options::showCatalog()[j] ) { - QPtrList catList = data->CustomCatalogs.at(j)->objList(); + TQPtrList catList = data->CustomCatalogs.at(j)->objList(); for ( register unsigned int i=0; i cat; + TQPtrList cat; switch (icat) { case 0: //star @@ -458,8 +458,8 @@ void SkyMap::slotTransientTimeout( void ) { } //to fade the labels, we will need to smoothly transition from UserLabelColor to SkyColor. - QColor c1 = data->colorScheme()->colorNamed( "UserLabelColor" ); - QColor c2 = data->colorScheme()->colorNamed( "SkyColor" ); + TQColor c1 = data->colorScheme()->colorNamed( "UserLabelColor" ); + TQColor c2 = data->colorScheme()->colorNamed( "SkyColor" ); int dRed = ( c2.red() - c1.red() )/20; int dGreen = ( c2.green() - c1.green() )/20; @@ -505,8 +505,8 @@ void SkyMap::slotCenter( void ) { if ( Options::useAltAz() && Options::showGround() && focus()->alt()->Degrees() > -1.0 && focusPoint()->alt()->Degrees() < -1.0 ) { - QString caption = i18n( "Requested Position Below Horizon" ); - QString message = i18n( "The requested position is below the horizon.\nWould you like to go there anyway?" ); + TQString caption = i18n( "Requested Position Below Horizon" ); + TQString message = i18n( "The requested position is below the horizon.\nWould you like to go there anyway?" ); if ( KMessageBox::warningYesNo( this, message, caption, i18n("Go Anyway"), i18n("Keep Position"), "dag_focus_below_horiz" )==KMessageBox::No ) { setClickedObject( NULL ); @@ -549,11 +549,11 @@ void SkyMap::slotCenter( void ) { //display coordinates in statusBar if ( ksw ) { - QString sX = focusPoint()->az()->toDMSString(); - QString sY = focusPoint()->alt()->toDMSString(true); + TQString sX = focusPoint()->az()->toDMSString(); + TQString sY = focusPoint()->alt()->toDMSString(true); if ( Options::useAltAz() && Options::useRefraction() ) sY = refract( focusPoint()->alt(), true ).toDMSString(true); - QString s = sX + ", " + sY; + TQString s = sX + ", " + sY; ksw->statusBar()->changeItem( s, 1 ); s = focusPoint()->ra()->toHMSString() + ", " + focusPoint()->dec()->toDMSString(true); ksw->statusBar()->changeItem( s, 2 ); @@ -563,10 +563,10 @@ void SkyMap::slotCenter( void ) { } void SkyMap::slotDSS( void ) { - QString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=1" ); - QString URLsuffix( "&e=J2000&h=15.0&w=15.0&f=gif&c=none&fov=NONE" ); + TQString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=1" ); + TQString URLsuffix( "&e=J2000&h=15.0&w=15.0&f=gif&c=none&fov=NONE" ); dms ra(0.0), dec(0.0); - QString RAString, DecString; + TQString RAString, DecString; char decsgn; //ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords @@ -599,15 +599,15 @@ void SkyMap::slotDSS( void ) { //concat all the segments into the kview command line: KURL url (URLprefix + RAString + DecString + URLsuffix); - QString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." ); + TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." ); new ImageViewer (&url, message, this); } void SkyMap::slotDSS2( void ) { - QString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=2r" ); - QString URLsuffix( "&e=J2000&h=15.0&w=15.0&f=gif&c=none&fov=NONE" ); + TQString URLprefix( "http://archive.stsci.edu/cgi-bin/dss_search?v=2r" ); + TQString URLsuffix( "&e=J2000&h=15.0&w=15.0&f=gif&c=none&fov=NONE" ); dms ra(0.0), dec(0.0); - QString RAString, DecString; + TQString RAString, DecString; char decsgn; //ra and dec must be the coordinates at J2000. If we clicked on an object, just use the object's ra0, dec0 coords @@ -641,13 +641,13 @@ void SkyMap::slotDSS2( void ) { //concat all the segments into the kview command line: KURL url (URLprefix + RAString + DecString + URLsuffix); - QString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." ); + TQString message = i18n( "Digitized Sky Survey image provided by the Space Telescope Science Institute." ); new ImageViewer (&url, message, this); } void SkyMap::slotInfo( int id ) { - QStringList::Iterator it = clickedObject()->InfoList.at(id-200); - QString sURL = (*it); + TQStringList::Iterator it = clickedObject()->InfoList.at(id-200); + TQString sURL = (*it); KURL url ( sURL ); if (!url.isEmpty()) kapp->invokeBrowser(sURL); @@ -657,7 +657,7 @@ void SkyMap::slotBeginAngularDistance(void) { setPreviousClickedPoint( mousePoint() ); angularDistanceMode = true; beginRulerPoint = getXY( previousClickedPoint(), Options::useAltAz(), Options::useRefraction() ); - endRulerPoint = QPoint( beginRulerPoint.x(),beginRulerPoint.y() ); + endRulerPoint = TQPoint( beginRulerPoint.x(),beginRulerPoint.y() ); } void SkyMap::slotEndAngularDistance(void) { @@ -683,10 +683,10 @@ void SkyMap::slotCancelAngularDistance(void) { } void SkyMap::slotImage( int id ) { - QStringList::Iterator it = clickedObject()->ImageList.at(id-100); - QStringList::Iterator it2 = clickedObject()->ImageTitle.at(id-100); - QString sURL = (*it); - QString message = (*it2); + TQStringList::Iterator it = clickedObject()->ImageList.at(id-100); + TQStringList::Iterator it2 = clickedObject()->ImageTitle.at(id-100); + TQString sURL = (*it); + TQString message = (*it2); KURL url ( sURL ); if (!url.isEmpty()) new ImageViewer (&url, clickedObject()->messageFromTitle(message), this); @@ -971,7 +971,7 @@ void SkyMap::slewFocus( void ) { } void SkyMap::invokeKey( int key ) { - QKeyEvent *e = new QKeyEvent( QEvent::KeyPress, key, 0, 0 ); + TQKeyEvent *e = new TQKeyEvent( TQEvent::KeyPress, key, 0, 0 ); keyPressEvent( e ); delete e; } @@ -984,9 +984,9 @@ double SkyMap::findPA( SkyObject *o, int x, int y, double scale ) { if ( newDec > 90.0 ) newDec = 90.0; SkyPoint test( o->ra()->Hours(), newDec ); if ( Options::useAltAz() ) test.EquatorialToHorizontal( data->LST, data->geo()->lat() ); - QPoint t = getXY( &test, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint t = getXY( &test, Options::useAltAz(), Options::useRefraction(), scale ); double dx = double( t.x() - x ); - double dy = double( y - t.y() ); //backwards because QWidget Y-axis increases to the bottom + double dy = double( y - t.y() ); //backwards because TQWidget Y-axis increases to the bottom double north; if ( dy ) { north = atan( dx/dy )*180.0/dms::PI; @@ -1001,8 +1001,8 @@ double SkyMap::findPA( SkyObject *o, int x, int y, double scale ) { return ( north + o->pa() ); } -QPoint SkyMap::getXY( SkyPoint *o, bool Horiz, bool doRefraction, double scale ) { - QPoint p; +TQPoint SkyMap::getXY( SkyPoint *o, bool Horiz, bool doRefraction, double scale ) { + TQPoint p; double Y, dX; double sindX, cosdX, sinY, cosY, sinY0, cosY0; @@ -1169,7 +1169,7 @@ dms SkyMap::refract( const dms *alt, bool findApparent ) { // also, determine new coordinates of mouse cursor. void SkyMap::forceUpdate( bool now ) { - QPoint mp( mapFromGlobal( QCursor::pos() ) ); + TQPoint mp( mapFromGlobal( TQCursor::pos() ) ); double dx = ( 0.5*width() - mp.x() )/Options::zoomFactor(); double dy = ( 0.5*height() - mp.y() )/Options::zoomFactor(); @@ -1238,33 +1238,33 @@ void SkyMap::setZoomMouseCursor() { mouseMoveCursor = false; // no mousemove cursor - QPainter p; - QPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems) + TQPainter p; + TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems) // the center of the pixmap int mx = cursorPix. width() / 2; int my = cursorPix. height() / 2; cursorPix.fill (white); // white background p.begin (&cursorPix); - p.setPen (QPen (black, 2)); // black lines + p.setPen (TQPen (black, 2)); // black lines p.drawEllipse( mx - 7, my - 7, 14, 14 ); p.drawLine( mx + 5, my + 5, mx + 11, my + 11 ); p.end(); // create a mask to make parts of the pixmap invisible - QBitmap mask (32, 32); + TQBitmap mask (32, 32); mask.fill (color0); // all is invisible p.begin (&mask); // paint over the parts which should be visible - p.setPen (QPen (color1, 3)); + p.setPen (TQPen (color1, 3)); p.drawEllipse( mx - 7, my - 7, 14, 14 ); p.drawLine( mx + 5, my + 5, mx + 12, my + 12 ); p.end(); cursorPix.setMask (mask); // set the mask - QCursor cursor (cursorPix); + TQCursor cursor (cursorPix); setCursor (cursor); } @@ -1272,15 +1272,15 @@ void SkyMap::setDefaultMouseCursor() { mouseMoveCursor = false; // no mousemove cursor - QPainter p; - QPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems) + TQPainter p; + TQPixmap cursorPix (32, 32); // size 32x32 (this size is compatible to all systems) // the center of the pixmap int mx = cursorPix. width() / 2; int my = cursorPix. height() / 2; cursorPix.fill (white); // white background p.begin (&cursorPix); - p.setPen (QPen (black, 2)); // black lines + p.setPen (TQPen (black, 2)); // black lines // 1. diagonal p.drawLine (mx - 2, my - 2, mx - 8, mx - 8); p.drawLine (mx + 2, my + 2, mx + 8, mx + 8); @@ -1290,12 +1290,12 @@ void SkyMap::setDefaultMouseCursor() p.end(); // create a mask to make parts of the pixmap invisible - QBitmap mask (32, 32); + TQBitmap mask (32, 32); mask.fill (color0); // all is invisible p.begin (&mask); // paint over the parts which should be visible - p.setPen (QPen (color1, 3)); + p.setPen (TQPen (color1, 3)); // 1. diagonal p.drawLine (mx - 2, my - 2, mx - 8, mx - 8); p.drawLine (mx + 2, my + 2, mx + 8, mx + 8); @@ -1305,7 +1305,7 @@ void SkyMap::setDefaultMouseCursor() p.end(); cursorPix.setMask (mask); // set the mask - QCursor cursor (cursorPix); + TQCursor cursor (cursorPix); setCursor (cursor); } @@ -1320,10 +1320,10 @@ void SkyMap::setMouseMoveCursor() void SkyMap::addLink( void ) { AddLinkDialog adialog( this, clickedObject()->name() ); - QString entry; - QFile file; + TQString entry; + TQFile file; - if ( adialog.exec()==QDialog::Accepted ) { + if ( adialog.exec()==TQDialog::Accepted ) { if ( adialog.isImageLink() ) { //Add link to object's ImageList, and descriptive text to its ImageTitle list clickedObject()->ImageList.append( adialog.url() ); @@ -1334,12 +1334,12 @@ void SkyMap::addLink( void ) { file.setName( locateLocal( "appdata", "image_url.dat" ) ); //determine filename in local user KDE directory tree. if ( !file.open( IO_ReadWrite | IO_Append ) ) { - QString message = i18n( "Custom image-links file could not be opened.\nLink cannot be recorded for future sessions." ); + TQString message = i18n( "Custom image-links file could not be opened.\nLink cannot be recorded for future sessions." ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); return; } else { entry = clickedObject()->name() + ":" + adialog.desc() + ":" + adialog.url(); - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << entry << endl; file.close(); emit linkAdded(); @@ -1352,11 +1352,11 @@ void SkyMap::addLink( void ) { file.setName( locateLocal( "appdata", "info_url.dat" ) ); //determine filename in local user KDE directory tree. if ( !file.open( IO_ReadWrite | IO_Append ) ) { - QString message = i18n( "Custom information-links file could not be opened.\nLink cannot be recorded for future sessions." ); KMessageBox::sorry( 0, message, i18n( "Could not Open File" ) ); + TQString message = i18n( "Custom information-links file could not be opened.\nLink cannot be recorded for future sessions." ); KMessageBox::sorry( 0, message, i18n( "Could not Open File" ) ); return; } else { entry = clickedObject()->name() + ":" + adialog.desc() + ":" + adialog.url(); - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << entry << endl; file.close(); emit linkAdded(); @@ -1369,8 +1369,8 @@ void SkyMap::updateAngleRuler() { if ( Options::useAltAz() ) PreviousClickedPoint.EquatorialToHorizontal( data->LST, data->geo()->lat() ); beginRulerPoint = getXY( previousClickedPoint(), Options::useAltAz(), Options::useRefraction() ); -// endRulerPoint = QPoint(e->x(), e->y()); - endRulerPoint = mapFromGlobal( QCursor::pos() ); +// endRulerPoint = TQPoint(e->x(), e->y()); + endRulerPoint = mapFromGlobal( TQCursor::pos() ); } #include "skymap.moc" diff --git a/kstars/kstars/skymap.h b/kstars/kstars/skymap.h index fb2b8b23..04f8a52f 100644 --- a/kstars/kstars/skymap.h +++ b/kstars/kstars/skymap.h @@ -18,8 +18,8 @@ #ifndef SKYMAP_H #define SKYMAP_H -#include -#include +#include +#include #include "skypoint.h" #include "starpixmap.h" @@ -56,14 +56,14 @@ class DeepSkyObject; *@version 1.0 */ -class SkyMap : public QWidget { +class SkyMap : public TQWidget { Q_OBJECT public: /** *Constructor. Read stored settings from KConfig object (focus position, *zoom factor, sky color, etc.). Run initPopupMenus(). */ - SkyMap( KStarsData *d, QWidget *parent=0, const char *name=0); + SkyMap( KStarsData *d, TQWidget *parent=0, const char *name=0); /** *Destructor (empty) @@ -161,7 +161,7 @@ public: /**@short sets the destination point of the sky map. *@note setDestination() emits the destinationChanged() SIGNAL, - *which triggers the SLOT function SkyMap::slewFocus(). This + *which triggers the TQT_SLOT function SkyMap::slewFocus(). This *function iteratively steps the Focus point toward Destination, *repainting the sky at each step (if Options::useAnimatedSlewing()==true). *@param f a pointer to the SkyPoint the map should slew to @@ -388,12 +388,12 @@ public: /**@short Draw the current Sky map to a pixmap which is to be printed or exported to a file. * *Each of the draw functions is called, with a value for the Scale parameter computed to fit the - *geometry of the QPaintDevice. - *@param pd pointer to the QPaintDevice on which to draw. + *geometry of the TQPaintDevice. + *@param pd pointer to the TQPaintDevice on which to draw. *@see KStars::slotExportImage() *@see KStars::slotPrint() */ - void exportSkyImage( const QPaintDevice *pd ); + void exportSkyImage( const TQPaintDevice *pd ); public slots: /**@short This overloaded function is used internally to resize the Sky pixmap to match the window size. @@ -404,7 +404,7 @@ public slots: * *This function behaves essentially like the above function. It differs only in the data types *of its arguments. */ - virtual void setGeometry( const QRect &r ); + virtual void setGeometry( const TQRect &r ); /**Recalculates the positions of objects in the sky, and then repaints the sky map. *If the positions don't need to be recalculated, use update() instead of forceUpdate(). @@ -547,7 +547,7 @@ signals: protected: /**Draw the Sky, and all objects in it. */ - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); /**Process keystrokes: *@li arrow keys Slew the map @@ -562,11 +562,11 @@ protected: *@li ,/< Step backward one time step *@li ./> Step forward one time step */ - virtual void keyPressEvent( QKeyEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); /**When keyRelease is triggered, just set the "slewing" flag to false, *and update the display (to draw objects that are hidden when slewing==true). */ - virtual void keyReleaseEvent( QKeyEvent *e ); + virtual void keyReleaseEvent( TQKeyEvent *e ); /**Determine RA, Dec coordinates of clicked location. Find the SkyObject *which is nearest to the clicked location. @@ -575,13 +575,13 @@ protected: *nearest object name in status bar. *If right-clicked: display popup menu appropriate for nearest object. */ - virtual void mousePressEvent( QMouseEvent *e ); + virtual void mousePressEvent( TQMouseEvent *e ); /**set mouseButtonDown==false, slewing==false */ - virtual void mouseReleaseEvent( QMouseEvent *e ); + virtual void mouseReleaseEvent( TQMouseEvent *e ); /**Center SkyMap at double-clicked location */ - virtual void mouseDoubleClickEvent( QMouseEvent *e ); + virtual void mouseDoubleClickEvent( TQMouseEvent *e ); /**This function does several different things depending on the state of the program: *@li If Angle-measurement mode is active, update the end-ruler point to the mouse cursor, @@ -593,16 +593,16 @@ protected: *cursor remains constant. *@li If just moving the mouse, simply update the curso coordinates in the status bar. */ - virtual void mouseMoveEvent( QMouseEvent *e ); + virtual void mouseMoveEvent( TQMouseEvent *e ); /**Zoom in and out with the mouse wheel. */ - virtual void wheelEvent( QWheelEvent *e ); + virtual void wheelEvent( TQWheelEvent *e ); /**If the skymap will be resized, the sky must be new computed. So this *function calls explicitly new computing of the skymap. *It also repositions the InfoBoxes, if they are anchored to a window edge. */ - virtual void resizeEvent( QResizeEvent * ); + virtual void resizeEvent( TQResizeEvent * ); private slots: /**Gradually fade the Transient Hover Label into the background sky color, and @@ -626,112 +626,112 @@ private slots: void setMouseMoveCursor(); private: -// Drawing functions. Each takes a QPainter reference and a scaling factor as arguments. -// The QPainter is usually the Sky pixmap, but it can also be the Export-to-Image pixmap, or the +// Drawing functions. Each takes a TQPainter reference and a scaling factor as arguments. +// The TQPainter is usually the Sky pixmap, but it can also be the Export-to-Image pixmap, or the // Printer device. The scaling factors are 1.0 by default (for screen images). The scale factor // is used to resize the image to fit the page when printing or exporting to a file. /**@short Draw the Milky Way contour. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawMilkyWay( QPainter& psky, double scale = 1.0 ); + void drawMilkyWay( TQPainter& psky, double scale = 1.0 ); /**@short Draw the coordinate system grid lines. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawCoordinateGrid( QPainter& psky, double scale = 1.0 ); + void drawCoordinateGrid( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Celestial Equator line. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawEquator( QPainter& psky, double scale = 1.0 ); + void drawEquator( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Ecliptic line. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawEcliptic( QPainter& psky, double scale = 1.0 ); + void drawEcliptic( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Horizon Line, the compass point labels, and the opaque ground. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawHorizon( QPainter& psky, double scale = 1.0 ); + void drawHorizon( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Constellation Lines. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawConstellationLines( QPainter& psky, double scale = 1.0 ); + void drawConstellationLines( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Constellation Boundaries. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawConstellationBoundaries( QPainter& psky, double scale = 1.0 ); + void drawConstellationBoundaries( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Constellation Names. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawConstellationNames( QPainter& psky, double scale = 1.0 ); + void drawConstellationNames( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Stars. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawStars( QPainter& psky, double scale = 1.0 ); + void drawStars( TQPainter& psky, double scale = 1.0 ); /**@short Draw the Deep-Sky Objects. * *Calls drawDeepSkyCatalog() for each catalog (Messier/NGC/IC/Custom) - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. *@see SkyMap::drawDeepSkyCatalog() */ - void drawDeepSkyObjects( QPainter& psky, double scale = 1.0 ); + void drawDeepSkyObjects( TQPainter& psky, double scale = 1.0 ); /**@short Draw a Deep-Sky Catalog. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param catalog List of pointers to the objects in a particular deep-sky catalog. *@param color The color to be used when drawing the symbols for this catalog. *@param drawObject if TRUE, the object symbols will be drawn *@param drawImage if TRUE, the object images will be drawn *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawDeepSkyCatalog( QPainter& psky, QPtrList& catalog, QColor& color, bool drawObject, bool drawImage, double scale = 1.0 ); + void drawDeepSkyCatalog( TQPainter& psky, TQPtrList& catalog, TQColor& color, bool drawObject, bool drawImage, double scale = 1.0 ); /**@short Draw the Planet Trails. * *"Planet Trails" can be attached to any solar system body; they are lists of SkyPoints *tracing the path of a body across the sky. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param ksp pointer to the solar-system bosy whose trail is to be drawn. *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawPlanetTrail( QPainter& psky, KSPlanetBase *ksp, double scale = 1.0 ); + void drawPlanetTrail( TQPainter& psky, KSPlanetBase *ksp, double scale = 1.0 ); /**@short Draw all solar system bodies: Sun, Moon, 8 planets, comets, asteroids. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param drawPlanets if FALSE, do nothing *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawSolarSystem( QPainter& psky, bool drawPlanets, double scale = 1.0 ); + void drawSolarSystem( TQPainter& psky, bool drawPlanets, double scale = 1.0 ); /**@short Draw "User Labels". User labels are name labels attached to objects manually with *the right-click popup menu. Also adds a label to the FocusObject if the Option UseAutoLabel *is TRUE. - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param scale the scaling factor. We use the default value (1.0) everywhere, except when printing. */ - void drawAttachedLabels( QPainter &psky, double scale = 1.0 ); + void drawAttachedLabels( TQPainter &psky, double scale = 1.0 ); /**@short Attach a name label to a SkyObject. This Function is called by the object-specific *draw functions and also by drawAttachedLabels(). - *@param psky reference to the QPainter on which to draw (either the sky pixmap or printer device) + *@param psky reference to the TQPainter on which to draw (either the sky pixmap or printer device) *@param obj pointer to the SkyObject which is to be labeled. *@param x The screen X-coordinate for the label (in pixels; typically as found by SkyMap::getXY()) *@param y The screen Y-coordinate for the label (in pixels; typically as found by SkyMap::getXY()) @@ -739,13 +739,13 @@ private: *@see SkyMap::drawAttachedLabels() *@see SkyMap::getXY() */ - void drawNameLabel( QPainter &psky, SkyObject *obj, int x, int y, double scale ); + void drawNameLabel( TQPainter &psky, SkyObject *obj, int x, int y, double scale ); /**Draw a planet. This is an image if the planet image is loaded, the zoomlevel *is high enough (but not so high that the image fills the screen), and the *user has selected that planet images be shown. If one of these conditions *is false, then a simple colored circle is drawn instead. - *@param psky reference to the QPainter on which to draw + *@param psky reference to the TQPainter on which to draw *@param p pointer to the KSPlanetBase to be drawn *@param c the color of the circle to be used if not plotting an image of the planet *@param zoommin the minimum zoomlevel for drawing the planet image @@ -754,7 +754,7 @@ private: *(there's probably a better way to handle this) *@param scale the scale factor used for printing the sky image. */ - void drawPlanet(QPainter &psky, KSPlanetBase *p, QColor c, + void drawPlanet(TQPainter &psky, KSPlanetBase *p, TQColor c, double zoommin, int resize_mult = 1, double scale = 1.0 ); /**Draw the overlays on top of the sky map. These include the infoboxes, @@ -766,59 +766,59 @@ private: *drawOverlays() to refresh the overlays. *@param pm pointer to the Sky pixmap */ - void drawOverlays( QPixmap *pm ); + void drawOverlays( TQPixmap *pm ); /**Draw the Focus, Geo and Time InfoBoxes. This is called by drawOverlays(). - *@param p reference to the QPainter on which to draw (this should be the Sky pixmap). + *@param p reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. *@see SkyMap::drawOverlays() */ - void drawBoxes( QPainter &p ); + void drawBoxes( TQPainter &p ); /**Draw symbols at the position of each Telescope currently being controlled by KStars. *@note The shape of the Telescope symbol is currently a hard-coded bullseye. *@note there is no scale factor because this is only used for drawing onto the screen, not printing. - *@param psky reference to the QPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). */ - void drawTelescopeSymbols(QPainter &psky); + void drawTelescopeSymbols(TQPainter &psky); /**@short Draw symbols for objects in the observing list. - *@param psky reference to the QPainter on which to draw (this should be the sky pixmap) + *@param psky reference to the TQPainter on which to draw (this should be the sky pixmap) *@note there is no scale factor because this is only used for drawing onto the screen, not printing. */ - void drawObservingList( QPainter &psky, double scale = 1.0 ); + void drawObservingList( TQPainter &psky, double scale = 1.0 ); /**Draw a dotted-line rectangle which traces the potential new field-of-view in ZoomBox mode. - *@param psky reference to the QPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. */ - void drawZoomBox( QPainter &psky); + void drawZoomBox( TQPainter &psky); /**Draw the current TransientLabel. TransientLabels are triggered when the mouse *hovers on an object. - *@param psky reference to the QPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. *@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout() */ - void drawTransientLabel( QPainter &psky ); + void drawTransientLabel( TQPainter &psky ); /**Draw a dashed line from the Angular-Ruler start point to the current mouse cursor, *when in Angular-Ruler mode. - *@param psky reference to the QPainter on which to draw (this should be the Sky pixmap). + *@param psky reference to the TQPainter on which to draw (this should be the Sky pixmap). *@note there is no scale factor because this is only used for drawing onto the screen, not printing. */ - void drawAngleRuler( QPainter &psky ); + void drawAngleRuler( TQPainter &psky ); /**Given the coordinates of the SkyPoint argument, determine the *pixel coordinates in the SkyMap. - *@return QPoint containing screen pixel x, y coordinates of SkyPoint. + *@return TQPoint containing screen pixel x, y coordinates of SkyPoint. *@param o pointer to the SkyPoint for which to calculate x, y coordinates. *@param Horiz if TRUE, use Alt/Az coordinates. *@param doRefraction if TRUE, correct for atmospheric refraction *@param scale scaling factor (unused?) */ - QPoint getXY( SkyPoint *o, bool Horiz, bool doRefraction=true, double scale = 1.0 ); + TQPoint getXY( SkyPoint *o, bool Horiz, bool doRefraction=true, double scale = 1.0 ); /**Determine RA, Dec coordinates of the pixel at (dx, dy), which are the *screen pixel coordinate offsets from the center of the Sky pixmap. @@ -884,7 +884,7 @@ private: *NULL pointer, and the TransientTimer is not already active. These conditions *are met when the mouse did not move for HOVER_INTERVAL msec (triggering a *TransientLabel), but the mouse has since been moved, thus ending the Hover event. - *This function merely starts the TransientTimer, whose timeout SIGNAL is + *This function merely starts the TransientTimer, whose timeout TQT_SIGNAL is *connected to the slotTransientTimeout() SLOT, which handles the actual fading *of the transient label, and eventually resets TransientObject to NULL. *@sa SkyMap::slotTransientLabel(), SkyMap::slotTransientTimeout() @@ -934,26 +934,26 @@ private: double XRange, Ymax; double guideXRange; - QString sURL; + TQString sURL; KStars *ksw; KStarsData *data; KSPopupMenu *pmenu; - QPixmap *sky, *sky2; + TQPixmap *sky, *sky2; InfoBoxes *IBoxes; SkyPoint Focus, OldFocus, ClickedPoint, FocusPoint, MousePoint, Destination, PreviousClickedPoint; SkyObject *ClickedObject, *FocusObject, *TransientObject; StarPixmap *starpix; // the pixmap of the stars - QPointArray *pts; // needed in paintEvent() so it should not every event call reallocated (save time) + TQPointArray *pts; // needed in paintEvent() so it should not every event call reallocated (save time) SkyPoint *sp; // see line above - QPoint beginRulerPoint, endRulerPoint; // used in angle mode - QRect ZoomRect; //The manual-focus circle. + TQPoint beginRulerPoint, endRulerPoint; // used in angle mode + TQRect ZoomRect; //The manual-focus circle. //data for transient object labels - QTimer TransientTimer, HoverTimer; - QColor TransientColor; + TQTimer TransientTimer, HoverTimer; + TQColor TransientColor; unsigned int TransientTimeout; }; diff --git a/kstars/kstars/skymapdraw.cpp b/kstars/kstars/skymapdraw.cpp index e032b37a..8b15c57a 100644 --- a/kstars/kstars/skymapdraw.cpp +++ b/kstars/kstars/skymapdraw.cpp @@ -21,8 +21,8 @@ #include //log10() #include -#include -#include +#include +#include #include "skymap.h" #include "Options.h" @@ -47,9 +47,9 @@ #include "indielement.h" #include "indidevice.h" -void SkyMap::drawOverlays( QPixmap *pm ) { +void SkyMap::drawOverlays( TQPixmap *pm ) { if ( ksw ) { //only if we are drawing in the GUI window - QPainter p; + TQPainter p; p.begin( pm ); showFocusCoords( true ); @@ -68,25 +68,25 @@ void SkyMap::drawOverlays( QPixmap *pm ) { } } -void SkyMap::drawAngleRuler( QPainter &p ) { - p.setPen( QPen( data->colorScheme()->colorNamed( "AngularRuler" ), 1, DotLine ) ); +void SkyMap::drawAngleRuler( TQPainter &p ) { + p.setPen( TQPen( data->colorScheme()->colorNamed( "AngularRuler" ), 1, DotLine ) ); p.drawLine( beginRulerPoint, endRulerPoint ); } -void SkyMap::drawZoomBox( QPainter &p ) { +void SkyMap::drawZoomBox( TQPainter &p ) { //draw the manual zoom-box, if it exists if ( ZoomRect.isValid() ) { - p.setPen( QPen( "white", 1, DotLine ) ); + p.setPen( TQPen( "white", 1, DotLine ) ); p.drawRect( ZoomRect.x(), ZoomRect.y(), ZoomRect.width(), ZoomRect.height() ); } } -void SkyMap::drawTransientLabel( QPainter &p ) { +void SkyMap::drawTransientLabel( TQPainter &p ) { if ( transientObject() ) { p.setPen( TransientColor ); if ( checkVisibility( transientObject(), fov(), XRange ) ) { - QPoint o = getXY( transientObject(), Options::useAltAz(), Options::useRefraction(), 1.0 ); + TQPoint o = getXY( transientObject(), Options::useAltAz(), Options::useRefraction(), 1.0 ); if ( o.x() >= 0 && o.x() <= width() && o.y() >= 0 && o.y() <= height() ) { drawNameLabel( p, transientObject(), o.x(), o.y(), 1.0 ); } @@ -94,7 +94,7 @@ void SkyMap::drawTransientLabel( QPainter &p ) { } } -void SkyMap::drawBoxes( QPainter &p ) { +void SkyMap::drawBoxes( TQPainter &p ) { if ( ksw ) { //only if we are drawing in the GUI window ksw->infoBoxes()->drawBoxes( p, data->colorScheme()->colorNamed( "BoxTextColor" ), @@ -103,14 +103,14 @@ void SkyMap::drawBoxes( QPainter &p ) { } } -void SkyMap::drawObservingList( QPainter &psky, double scale ) { - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "ObsListColor" ) ), 1 ) ); +void SkyMap::drawObservingList( TQPainter &psky, double scale ) { + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "ObsListColor" ) ), 1 ) ); if ( ksw && ksw->observingList()->count() ) { for ( SkyObject* obj = ksw->observingList()->first(); obj; obj = ksw->observingList()->next() ) { if ( checkVisibility( obj, fov(), XRange ) ) { - QPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction() ); + TQPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction() ); // label object if it is currently on screen if (o.x() >= 0 && o.x() <= width() && o.y() >=0 && o.y() <= height() ) { @@ -130,7 +130,7 @@ void SkyMap::drawObservingList( QPainter &psky, double scale ) { } } -void SkyMap::drawTelescopeSymbols(QPainter &psky) { +void SkyMap::drawTelescopeSymbols(TQPainter &psky) { if ( ksw ) { //ksw doesn't exist in non-GUI mode! INDI_P *eqNum; @@ -143,7 +143,7 @@ void SkyMap::drawTelescopeSymbols(QPainter &psky) { if (!Options::indiCrosshairs() || devMenu == NULL) return; - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed("TargetColor" ) ) ) ); + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed("TargetColor" ) ) ) ); psky.setBrush( NoBrush ); int pxperdegree = int(Options::zoomFactor()/57.3); @@ -239,7 +239,7 @@ void SkyMap::drawTelescopeSymbols(QPainter &psky) { } - QPoint P = getXY( &indi_sp, Options::useAltAz(), Options::useRefraction() ); + TQPoint P = getXY( &indi_sp, Options::useAltAz(), Options::useRefraction() ); int s1 = pxperdegree/2; int s2 = pxperdegree; @@ -259,7 +259,7 @@ void SkyMap::drawTelescopeSymbols(QPainter &psky) { psky.drawEllipse( x1, y1, s1, s1 ); psky.drawEllipse( x2, y2, s2, s2 ); - psky.drawText( x0+s2 + 2 , y0, QString(devMenu->mgr.at(i)->indi_dev.at(j)->label) ); + psky.drawText( x0+s2 + 2 , y0, TQString(devMenu->mgr.at(i)->indi_dev.at(j)->label) ); } } @@ -269,7 +269,7 @@ void SkyMap::drawTelescopeSymbols(QPainter &psky) { } -void SkyMap::drawMilkyWay( QPainter& psky, double scale ) +void SkyMap::drawMilkyWay( TQPainter& psky, double scale ) { int ptsCount = 0; int mwmax = int( scale * Options::zoomFactor()/100.); @@ -279,8 +279,8 @@ void SkyMap::drawMilkyWay( QPainter& psky, double scale ) int thick(1); if ( ! Options::fillMilkyWay() ) thick=3; - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "MWColor" ) ), thick, SolidLine ) ); - psky.setBrush( QBrush( QColor( data->colorScheme()->colorNamed( "MWColor" ) ) ) ); + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "MWColor" ) ), thick, SolidLine ) ); + psky.setBrush( TQBrush( TQColor( data->colorScheme()->colorNamed( "MWColor" ) ) ) ); bool offscreen, lastoffscreen=false; for ( register unsigned int j=0; j<11; ++j ) { @@ -288,7 +288,7 @@ void SkyMap::drawMilkyWay( QPainter& psky, double scale ) ptsCount = 0; bool partVisible = false; - QPoint o = getXY( data->MilkyWay[j].at(0), Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( data->MilkyWay[j].at(0), Options::useAltAz(), Options::useRefraction(), scale ); if ( o.x() != -10000000 && o.y() != -10000000 ) pts->setPoint( ptsCount++, o.x(), o.y() ); if ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) partVisible = true; @@ -299,10 +299,10 @@ void SkyMap::drawMilkyWay( QPainter& psky, double scale ) } if ( ptsCount && partVisible ) { - psky.drawPolygon( ( const QPointArray ) *pts, false, 0, ptsCount ); + psky.drawPolygon( ( const TQPointArray ) *pts, false, 0, ptsCount ); } } else { - QPoint o = getXY( data->MilkyWay[j].at(0), Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( data->MilkyWay[j].at(0), Options::useAltAz(), Options::useRefraction(), scale ); if (o.x()==-10000000 && o.y()==-10000000) offscreen = true; else offscreen = false; @@ -327,20 +327,20 @@ void SkyMap::drawMilkyWay( QPainter& psky, double scale ) } } -void SkyMap::drawCoordinateGrid( QPainter& psky, double scale ) +void SkyMap::drawCoordinateGrid( TQPainter& psky, double scale ) { - QPoint cur; + TQPoint cur; //Draw coordinate grid - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "GridColor" ) ), 1, DotLine ) ); //change to GridColor + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "GridColor" ) ), 1, DotLine ) ); //change to GridColor //First, the parallels for ( register double Dec=-80.; Dec<=80.; Dec += 20. ) { bool newlyVisible = false; sp->set( 0.0, Dec ); if ( Options::useAltAz() ) sp->EquatorialToHorizontal( data->LST, data->geo()->lat() ); - QPoint o = getXY( sp, Options::useAltAz(), Options::useRefraction(), scale ); - QPoint o1 = o; + TQPoint o = getXY( sp, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o1 = o; cur = o; psky.moveTo( o.x(), o.y() ); @@ -353,7 +353,7 @@ void SkyMap::drawCoordinateGrid( QPainter& psky, double scale ) o = getXY( sp, Options::useAltAz(), Options::useRefraction(), scale ); //When drawing on the printer, the psky.pos() point does NOT get updated - //when lineTo or moveTo are called. Grrr. Need to store current position in QPoint cur. + //when lineTo or moveTo are called. Grrr. Need to store current position in TQPoint cur. int dx = cur.x() - o.x(); int dy = cur.y() - o.y(); cur = o; @@ -386,7 +386,7 @@ void SkyMap::drawCoordinateGrid( QPainter& psky, double scale ) bool newlyVisible = false; SkyPoint *sp1 = new SkyPoint( RA, -90. ); if ( Options::useAltAz() ) sp1->EquatorialToHorizontal( data->LST, data->geo()->lat() ); - QPoint o = getXY( sp1, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( sp1, Options::useAltAz(), Options::useRefraction(), scale ); cur = o; psky.moveTo( o.x(), o.y() ); @@ -399,7 +399,7 @@ void SkyMap::drawCoordinateGrid( QPainter& psky, double scale ) o = getXY( sp1, Options::useAltAz(), Options::useRefraction(), scale ); //When drawing on the printer, the psky.pos() point does NOT get updated - //when lineTo or moveTo are called. Grrr. Need to store current position in QPoint cur. + //when lineTo or moveTo are called. Grrr. Need to store current position in TQPoint cur. int dx = cur.x() - o.x(); int dy = cur.y() - o.y(); cur = o; @@ -420,17 +420,17 @@ void SkyMap::drawCoordinateGrid( QPainter& psky, double scale ) } } -void SkyMap::drawEquator( QPainter& psky, double scale ) +void SkyMap::drawEquator( TQPainter& psky, double scale ) { //Draw Equator (currently can't be hidden on slew) - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "EqColor" ) ), 1, SolidLine ) ); + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "EqColor" ) ), 1, SolidLine ) ); SkyPoint *p = data->Equator.first(); - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); - QPoint o1 = o; - QPoint last = o; - QPoint cur = o; - QPoint o2; + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o1 = o; + TQPoint last = o; + TQPoint cur = o; + TQPoint o2; psky.moveTo( o.x(), o.y() ); bool newlyVisible = false; @@ -454,7 +454,7 @@ void SkyMap::drawEquator( QPainter& psky, double scale ) } //When drawing on the printer, the psky.pos() point does NOT get updated - //when lineTo or moveTo are called. Grrr. Need to store current position in QPoint cur. + //when lineTo or moveTo are called. Grrr. Need to store current position in TQPoint cur. int dx = cur.x() - o.x(); int dy = cur.y() - o.y(); cur = o; @@ -564,20 +564,20 @@ void SkyMap::drawEquator( QPainter& psky, double scale ) } } -void SkyMap::drawEcliptic( QPainter& psky, double scale ) +void SkyMap::drawEcliptic( TQPainter& psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); //Draw Ecliptic (currently can't be hidden on slew) - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "EclColor" ) ), 1, SolidLine ) ); + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "EclColor" ) ), 1, SolidLine ) ); SkyPoint *p = data->Ecliptic.first(); - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); - QPoint o2 = o; - QPoint o1 = o; - QPoint last = o; - QPoint cur = o; + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o2 = o; + TQPoint o1 = o; + TQPoint last = o; + TQPoint cur = o; psky.moveTo( o.x(), o.y() ); //index of point near the right or top/bottom edge @@ -601,7 +601,7 @@ void SkyMap::drawEcliptic( QPainter& psky, double scale ) } //When drawing on the printer, the psky.pos() point does NOT get updated - //when lineTo or moveTo are called. Grrr. Need to store current position in QPoint cur. + //when lineTo or moveTo are called. Grrr. Need to store current position in TQPoint cur. int dx = cur.x() - o.x(); int dy = cur.y() - o.y(); cur = o; @@ -722,22 +722,22 @@ void SkyMap::drawEcliptic( QPainter& psky, double scale ) } } -void SkyMap::drawHorizon( QPainter& psky, double scale ) +void SkyMap::drawHorizon( TQPainter& psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); - QPtrList points; + TQPtrList points; points.setAutoDelete(true); - QPoint o, o2; + TQPoint o, o2; //Draw Horizon //The horizon should not be corrected for atmospheric refraction, so getXY has doRefract=false... if (Options::showHorizon() || Options::showGround() ) { - QPoint OutLeft(0,0), OutRight(0,0); + TQPoint OutLeft(0,0), OutRight(0,0); - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "HorzColor" ) ), 1, SolidLine ) ); - psky.setBrush( QColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "HorzColor" ) ), 1, SolidLine ) ); + psky.setBrush( TQColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); int ptsCount = 0; int maxdist = int(Options::zoomFactor()/4); @@ -760,7 +760,7 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) } } - //Use the QPtrList of points to pre-sort visible horizon points + //Use the TQPtrList of points to pre-sort visible horizon points if ( o.x() > -100 && o.x() < Width + 100 && o.y() > -100 && o.y() < Height + 100 ) { if ( Options::useAltAz() ) { register unsigned int j; @@ -771,12 +771,12 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) } } if ( found ) { - points.insert( j, new QPoint(o) ); + points.insert( j, new TQPoint(o) ); } else { - points.append( new QPoint(o) ); + points.append( new TQPoint(o) ); } } else { - points.append( new QPoint(o) ); + points.append( new TQPoint(o) ); } } else { //find the out-of-bounds points closest to the left and right borders if ( ( OutLeft.x() == 0 || o.x() > OutLeft.x() ) && o.x() < -100 ) { @@ -806,7 +806,7 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) int xtotal = ( points.at( 0 )->x() - OutLeft.x() ); int xx = ( points.at( 0 )->x() + 100 ) / xtotal; int yp = xx*OutRight.y() + (1-xx)*points.at( 0 )->y(); //interpolated left-edge y value - QPoint *LeftEdge = new QPoint( -100, yp ); + TQPoint *LeftEdge = new TQPoint( -100, yp ); points.insert( 0, LeftEdge ); //Prepend LeftEdge to the beginning of points //Interpolate from the last sorted onscreen point to ()+100, @@ -814,7 +814,7 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) xtotal = ( OutRight.x() - points.at( points.count() - 1 )->x() ); xx = ( Width + 100 - points.at( points.count() - 1 )->x() ) / xtotal; yp = xx*OutRight.y() + (1-xx)*points.at( points.count() - 1 )->y(); //interpolated right-edge y value - QPoint *RightEdge = new QPoint( Width+100, yp ); + TQPoint *RightEdge = new TQPoint( Width+100, yp ); points.append( RightEdge ); } //If there are no horizon points, then either the horizon doesn't pass through the screen @@ -828,13 +828,13 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) int xtotal = ( OutRight.x() - OutLeft.x() ); int xx = ( OutRight.x() + 100 ) / xtotal; int yp = xx*OutLeft.y() + (1-xx)*OutRight.y(); //interpolated left-edge y value -// QPoint *LeftEdge = new QPoint( -100, yp ); - points.append( new QPoint( -100, yp ) ); +// TQPoint *LeftEdge = new TQPoint( -100, yp ); + points.append( new TQPoint( -100, yp ) ); xx = ( Width + 100 - OutLeft.x() ) / xtotal; yp = xx*OutRight.y() + (1-xx)*OutLeft.y(); //interpolated right-edge y value -// QPoint *RightEdge = new QPoint( Width+100, yp ); - points.append( new QPoint( Width+100, yp ) ); +// TQPoint *RightEdge = new TQPoint( Width+100, yp ); + points.append( new TQPoint( Width+100, yp ) ); } if ( points.count() ) { @@ -872,7 +872,7 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) double r0 = 2.0*sin(0.25*dms::PI); // //Second QPointsArray for blocking the region outside the sky circle -// QPointArray bpts( 100 ); //need 90 points along sky circle, plus 4 to complete polygon +// TQPointArray bpts( 100 ); //need 90 points along sky circle, plus 4 to complete polygon // uint bpCount(0); if ( dx > r0 ) { //sky edge is visible @@ -892,12 +892,12 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) // bpts.setPoint( bpCount++, -100, Height + 100 ); // bpts.setPoint( bpCount++, Width + 100, Height + 100 ); // bpts.setPoint( bpCount++, Width + 100, Height/2 ); -// psky.setPen( QColor ( data->colorScheme()->colorNamed( "SkyColor" ) ) ); -// psky.setBrush( QColor ( data->colorScheme()->colorNamed( "SkyColor" ) ) ); +// psky.setPen( TQColor ( data->colorScheme()->colorNamed( "SkyColor" ) ) ); +// psky.setBrush( TQColor ( data->colorScheme()->colorNamed( "SkyColor" ) ) ); // psky.drawPolygon( bpts, false, 0, bpCount ); // //Reset colors for Horizon polygon -// psky.setPen( QColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); -// psky.setBrush( QColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); +// psky.setPen( TQColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); +// psky.setBrush( TQColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); } else { pts->setPoint( ptsCount++, Width+100, Height+100 ); //bottom right corner @@ -905,7 +905,7 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) } //Draw the Horizon polygon - psky.drawPolygon( ( const QPointArray ) *pts, false, 0, ptsCount ); + psky.drawPolygon( ( const TQPointArray ) *pts, false, 0, ptsCount ); //remove all items in points list for ( register unsigned int i=0; icolorScheme()->colorNamed( "CompassColor" ) ) ); + psky.setPen( TQColor ( data->colorScheme()->colorNamed( "CompassColor" ) ) ); else - psky.setPen( QColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); + psky.setPen( TQColor ( data->colorScheme()->colorNamed( "HorzColor" ) ) ); //North c->setAz( 359.99 ); @@ -1025,8 +1025,8 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) if ( data->Horizon.count() && index2 > data->Horizon.count() - 1 ) index2 -= data->Horizon.count(); SkyPoint *p2 = data->Horizon.at(index2); - QPoint o1 = getXY( p, Options::useAltAz(), false, scale ); - QPoint o2 = getXY( p2, Options::useAltAz(), false, scale ); + TQPoint o1 = getXY( p, Options::useAltAz(), false, scale ); + TQPoint o2 = getXY( p2, Options::useAltAz(), false, scale ); double x1, x2; //there are 3 possibilities: (o2.x() > width()); (o2.y() < 0); (o2.y() > height()) @@ -1100,17 +1100,17 @@ void SkyMap::drawHorizon( QPainter& psky, double scale ) } //endif drawing horizon } -void SkyMap::drawConstellationLines( QPainter& psky, double scale ) +void SkyMap::drawConstellationLines( TQPainter& psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); //Draw Constellation Lines - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "CLineColor" ) ), 1, SolidLine ) ); //change to colorGrid + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "CLineColor" ) ), 1, SolidLine ) ); //change to colorGrid int iLast = -1; for ( SkyPoint *p = data->clineList.first(); p; p = data->clineList.next() ) { - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); if ( ( o.x() >= -1000 && o.x() <= Width+1000 && o.y() >=-1000 && o.y() <= Height+1000 ) ) { if ( data->clineModeList.at(data->clineList.at())->latin1()=='M' ) { @@ -1127,23 +1127,23 @@ void SkyMap::drawConstellationLines( QPainter& psky, double scale ) } } -void SkyMap::drawConstellationBoundaries( QPainter &psky, double scale ) { +void SkyMap::drawConstellationBoundaries( TQPainter &psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); - psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "CBoundColor" ) ), 1, SolidLine ) ); + psky.setPen( TQPen( TQColor( data->colorScheme()->colorNamed( "CBoundColor" ) ), 1, SolidLine ) ); for ( CSegment *seg = data->csegmentList.first(); seg; seg = data->csegmentList.next() ) { bool started( false ); SkyPoint *p = seg->firstNode(); - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); if ( ( o.x() >= -1000 && o.x() <= Width+1000 && o.y() >=-1000 && o.y() <= Height+1000 ) ) { psky.moveTo( o.x(), o.y() ); started = true; } for ( p = seg->nextNode(); p; p = seg->nextNode() ) { - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); if ( ( o.x() >= -1000 && o.x() <= Width+1000 && o.y() >=-1000 && o.y() <= Height+1000 ) ) { if ( started ) { @@ -1159,15 +1159,15 @@ void SkyMap::drawConstellationBoundaries( QPainter &psky, double scale ) { } } -void SkyMap::drawConstellationNames( QPainter& psky, double scale ) { +void SkyMap::drawConstellationNames( TQPainter& psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); //Draw Constellation Names - psky.setPen( QColor( data->colorScheme()->colorNamed( "CNameColor" ) ) ); + psky.setPen( TQColor( data->colorScheme()->colorNamed( "CNameColor" ) ) ); for ( SkyObject *p = data->cnameList.first(); p; p = data->cnameList.next() ) { if ( checkVisibility( p, fov(), XRange ) ) { - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); if (o.x() >= 0 && o.x() <= Width && o.y() >=0 && o.y() <= Height ) { if ( Options::useLatinConstellNames() ) { int dx = 5*p->name().length(); @@ -1185,7 +1185,7 @@ void SkyMap::drawConstellationNames( QPainter& psky, double scale ) { } } -void SkyMap::drawStars( QPainter& psky, double scale ) { +void SkyMap::drawStars( TQPainter& psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); @@ -1210,15 +1210,15 @@ void SkyMap::drawStars( QPainter& psky, double scale ) { if ( curStar->mag() > maglim || ( hideFaintStars && curStar->mag() > Options::magLimitHideStar() ) ) break; if ( checkVisibility( curStar, fov(), XRange ) ) { - QPoint o = getXY( curStar, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( curStar, Options::useAltAz(), Options::useRefraction(), scale ); // draw star if currently on screen if (o.x() >= 0 && o.x() <= Width && o.y() >=0 && o.y() <= Height ) { int size = int( scale * ( sizeFactor*( maglim - curStar->mag())/maglim ) + 1 ); if ( size > 0 ) { - QChar c = curStar->color(); - QPixmap *spixmap = starpix->getPixmap( &c, size ); + TQChar c = curStar->color(); + TQPixmap *spixmap = starpix->getPixmap( &c, size ); curStar->draw( psky, sky, spixmap, o.x(), o.y(), true, scale ); // now that we have drawn the star, we can display some extra info @@ -1227,9 +1227,9 @@ void SkyMap::drawStars( QPainter& psky, double scale ) { if ( !checkSlewing && (curStar->mag() <= Options::magLimitDrawStarInfo() ) && ( drawName || Options::showStarMagnitudes() ) ) { - psky.setPen( QColor( data->colorScheme()->colorNamed( "SNameColor" ) ) ); - QFont stdFont( psky.font() ); - QFont smallFont( stdFont ); + psky.setPen( TQColor( data->colorScheme()->colorNamed( "SNameColor" ) ) ); + TQFont stdFont( psky.font() ); + TQFont smallFont( stdFont ); smallFont.setPointSize( stdFont.pointSize() - 2 ); if ( Options::zoomFactor() < 10.*MINZOOM ) { psky.setFont( smallFont ); @@ -1250,7 +1250,7 @@ void SkyMap::drawStars( QPainter& psky, double scale ) { } } -void SkyMap::drawDeepSkyCatalog( QPainter& psky, QPtrList& catalog, QColor& color, +void SkyMap::drawDeepSkyCatalog( TQPainter& psky, TQPtrList& catalog, TQColor& color, bool drawObject, bool drawImage, double scale ) { if ( drawObject || drawImage ) { //don't do anything if nothing is to be drawn! @@ -1260,7 +1260,7 @@ void SkyMap::drawDeepSkyCatalog( QPainter& psky, QPtrList& catalo // Set color once psky.setPen( color ); psky.setBrush( NoBrush ); - QColor colorHST = data->colorScheme()->colorNamed( "HSTColor" ); + TQColor colorHST = data->colorScheme()->colorNamed( "HSTColor" ); double maglim = Options::magLimitDrawDeepSky(); @@ -1279,7 +1279,7 @@ void SkyMap::drawDeepSkyCatalog( QPainter& psky, QPtrList& catalo float mag = obj->mag(); //only draw objects if flags set and its brighter than maglim (unless mag is undefined (=99.9) if ( mag > 90.0 || mag < (float)maglim ) { - QPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction(), scale ); if ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) { double PositionAngle = findPA( obj, o.x(), o.y(), scale ); @@ -1320,12 +1320,12 @@ void SkyMap::drawDeepSkyCatalog( QPainter& psky, QPtrList& catalo } } -void SkyMap::drawDeepSkyObjects( QPainter& psky, double scale ) +void SkyMap::drawDeepSkyObjects( TQPainter& psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); - QImage ScaledImage; + TQImage ScaledImage; bool checkSlewing = ( ( slewing || ( clockSlewing && data->clock()->isActive() ) ) && Options::hideOnSlew() ); @@ -1338,9 +1338,9 @@ void SkyMap::drawDeepSkyObjects( QPainter& psky, double scale ) bool drawImages( Options::showMessierImages() ); // calculate color objects once, outside the loop - QColor colorMess = data->colorScheme()->colorNamed( "MessColor" ); - QColor colorIC = data->colorScheme()->colorNamed( "ICColor" ); - QColor colorNGC = data->colorScheme()->colorNamed( "NGCColor" ); + TQColor colorMess = data->colorScheme()->colorNamed( "MessColor" ); + TQColor colorIC = data->colorScheme()->colorNamed( "ICColor" ); + TQColor colorNGC = data->colorScheme()->colorNamed( "NGCColor" ); // draw Messier catalog if ( drawMess ) { @@ -1366,12 +1366,12 @@ void SkyMap::drawDeepSkyObjects( QPainter& psky, double scale ) //Draw Custom Catalogs for ( register unsigned int i=0; iCustomCatalogs.count(); ++i ) { if ( Options::showCatalog()[i] ) { - QPtrList cat = data->CustomCatalogs.at(i)->objList(); + TQPtrList cat = data->CustomCatalogs.at(i)->objList(); for ( SkyObject *obj = cat.first(); obj; obj = cat.next() ) { if ( checkVisibility( obj, fov(), XRange ) ) { - QPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction(), scale ); if ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) { @@ -1383,11 +1383,11 @@ void SkyMap::drawDeepSkyObjects( QPainter& psky, double scale ) int size = int( sizeFactor*(zoomlim - mag) ) + 1; if (size>23) size=23; if ( size > 0 ) { - QChar c = starobj->color(); - QPixmap *spixmap = starpix->getPixmap( &c, size ); + TQChar c = starobj->color(); + TQPixmap *spixmap = starpix->getPixmap( &c, size ); // Try to paint with the selected color - spixmap->fill(QColor( data->CustomCatalogs.at(i)->color() )); + spixmap->fill(TQColor( data->CustomCatalogs.at(i)->color() )); starobj->draw( psky, sky, spixmap, o.x(), o.y(), true, scale ); // After drawing the star we display some extra info like // the name ... @@ -1395,9 +1395,9 @@ void SkyMap::drawDeepSkyObjects( QPainter& psky, double scale ) if ( !checkSlewing && (starobj->mag() <= Options::magLimitDrawStarInfo() ) && ( drawName || Options::showStarMagnitudes() ) ) { - psky.setPen( QColor( data->colorScheme()->colorNamed( "SNameColor" ) ) ); - QFont stdFont( psky.font() ); - QFont smallFont( stdFont ); + psky.setPen( TQColor( data->colorScheme()->colorNamed( "SNameColor" ) ) ); + TQFont stdFont( psky.font() ); + TQFont smallFont( stdFont ); smallFont.setPointSize( stdFont.pointSize() - 2 ); if ( Options::zoomFactor() < 10.*MINZOOM ) { psky.setFont( smallFont ); @@ -1417,7 +1417,7 @@ void SkyMap::drawDeepSkyObjects( QPainter& psky, double scale ) dso->drawImage( psky, o.x(), o.y(), pa, Options::zoomFactor() ); psky.setBrush( NoBrush ); - psky.setPen( QColor( data->CustomCatalogs.at(i)->color() ) ); + psky.setPen( TQColor( data->CustomCatalogs.at(i)->color() ) ); dso->drawSymbol( psky, o.x(), o.y(), pa, Options::zoomFactor() ); } @@ -1428,7 +1428,7 @@ void SkyMap::drawDeepSkyObjects( QPainter& psky, double scale ) } } -void SkyMap::drawAttachedLabels( QPainter &psky, double scale ) { +void SkyMap::drawAttachedLabels( TQPainter &psky, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); @@ -1476,7 +1476,7 @@ void SkyMap::drawAttachedLabels( QPainter &psky, double scale ) { if ( obj->type() == SkyObject::ASTEROID && ! drawAsteroids ) return; if ( checkVisibility( obj, fov(), XRange ) ) { - QPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( obj, Options::useAltAz(), Options::useRefraction(), scale ); if ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) { drawNameLabel( psky, obj, o.x(), o.y(), scale ); } @@ -1485,17 +1485,17 @@ void SkyMap::drawAttachedLabels( QPainter &psky, double scale ) { //Attach a label to the centered object if ( focusObject() != NULL && Options::useAutoLabel() ) { - QPoint o = getXY( focusObject(), Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( focusObject(), Options::useAltAz(), Options::useRefraction(), scale ); if ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) drawNameLabel( psky, focusObject(), o.x(), o.y(), scale ); } } -void SkyMap::drawNameLabel( QPainter &psky, SkyObject *obj, int x, int y, double scale ) { +void SkyMap::drawNameLabel( TQPainter &psky, SkyObject *obj, int x, int y, double scale ) { int size(0); - QFont stdFont( psky.font() ); - QFont smallFont( stdFont ); + TQFont stdFont( psky.font() ); + TQFont smallFont( stdFont ); smallFont.setPointSize( stdFont.pointSize() - 2 ); if ( Options::zoomFactor() < 10.*MINZOOM ) { psky.setFont( smallFont ); @@ -1540,18 +1540,18 @@ void SkyMap::drawNameLabel( QPainter &psky, SkyObject *obj, int x, int y, double psky.setFont( stdFont ); } -void SkyMap::drawPlanetTrail( QPainter& psky, KSPlanetBase *ksp, double scale ) +void SkyMap::drawPlanetTrail( TQPainter& psky, KSPlanetBase *ksp, double scale ) { if ( ksp->hasTrail() ) { int Width = int( scale * width() ); int Height = int( scale * height() ); - QColor tcolor1 = QColor( data->colorScheme()->colorNamed( "PlanetTrailColor" ) ); - QColor tcolor2 = QColor( data->colorScheme()->colorNamed( "SkyColor" ) ); + TQColor tcolor1 = TQColor( data->colorScheme()->colorNamed( "PlanetTrailColor" ) ); + TQColor tcolor2 = TQColor( data->colorScheme()->colorNamed( "SkyColor" ) ); SkyPoint *p = ksp->trail()->first(); - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); - QPoint cur( o ); + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint cur( o ); bool doDrawLine(false); int i = 0; @@ -1562,16 +1562,16 @@ void SkyMap::drawPlanetTrail( QPainter& psky, KSPlanetBase *ksp, double scale ) doDrawLine = true; } - psky.setPen( QPen( tcolor1, 1 ) ); + psky.setPen( TQPen( tcolor1, 1 ) ); for ( p = ksp->trail()->next(); p; p = ksp->trail()->next() ) { if ( Options::fadePlanetTrails() ) { //Define interpolated color - QColor tcolor = QColor( + TQColor tcolor = TQColor( (i*tcolor1.red() + (n-i)*tcolor2.red())/n, (i*tcolor1.green() + (n-i)*tcolor2.green())/n, (i*tcolor1.blue() + (n-i)*tcolor2.blue())/n ); ++i; - psky.setPen( QPen( tcolor, 1 ) ); + psky.setPen( TQPen( tcolor, 1 ) ); } o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); @@ -1592,7 +1592,7 @@ void SkyMap::drawPlanetTrail( QPainter& psky, KSPlanetBase *ksp, double scale ) } } -void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) +void SkyMap::drawSolarSystem( TQPainter& psky, bool drawPlanets, double scale ) { int Width = int( scale * width() ); int Height = int( scale * height() ); @@ -1629,9 +1629,9 @@ void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) if ( ast->mag() > Options::magLimitAsteroid() ) break; if ( checkVisibility( ast, fov(), XRange ) ) { - psky.setPen( QPen( QColor( "gray" ) ) ); - psky.setBrush( QBrush( QColor( "gray" ) ) ); - QPoint o = getXY( ast, Options::useAltAz(), Options::useRefraction(), scale ); + psky.setPen( TQPen( TQColor( "gray" ) ) ); + psky.setBrush( TQBrush( TQColor( "gray" ) ) ); + TQPoint o = getXY( ast, Options::useAltAz(), Options::useRefraction(), scale ); if ( ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) ) { int size = int( ast->angSize() * scale * dms::PI * Options::zoomFactor()/10800.0 ); @@ -1642,7 +1642,7 @@ void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) //draw Name if ( Options::showAsteroidNames() && ast->mag() < Options::magLimitAsteroidName() ) { - psky.setPen( QColor( data->colorScheme()->colorNamed( "PNameColor" ) ) ); + psky.setPen( TQColor( data->colorScheme()->colorNamed( "PNameColor" ) ) ); drawNameLabel( psky, ast, o.x(), o.y(), scale ); } } @@ -1654,9 +1654,9 @@ void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) if ( Options::showComets() ) { for ( KSComet *com = data->cometList.first(); com; com = data->cometList.next() ) { if ( checkVisibility( com, fov(), XRange ) ) { - psky.setPen( QPen( QColor( "cyan4" ) ) ); - psky.setBrush( QBrush( QColor( "cyan4" ) ) ); - QPoint o = getXY( com, Options::useAltAz(), Options::useRefraction(), scale ); + psky.setPen( TQPen( TQColor( "cyan4" ) ) ); + psky.setBrush( TQBrush( TQColor( "cyan4" ) ) ); + TQPoint o = getXY( com, Options::useAltAz(), Options::useRefraction(), scale ); if ( ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) ) { int size = int( com->angSize() * scale * dms::PI * Options::zoomFactor()/10800.0 ); @@ -1667,7 +1667,7 @@ void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) //draw Name if ( Options::showCometNames() && com->rsun() < Options::maxRadCometName() ) { - psky.setPen( QColor( data->colorScheme()->colorNamed( "PNameColor" ) ) ); + psky.setPen( TQColor( data->colorScheme()->colorNamed( "PNameColor" ) ) ); drawNameLabel( psky, com, o.x(), o.y(), scale ); } } @@ -1677,50 +1677,50 @@ void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) //Draw Pluto if ( Options::showPluto() ) { - drawPlanet(psky, data->PCat->findByName("Pluto"), QColor( "gray" ), 50.*MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Pluto"), TQColor( "gray" ), 50.*MINZOOM, 1, scale ); } //Draw Neptune if ( Options::showNeptune() ) { - drawPlanet(psky, data->PCat->findByName("Neptune"), QColor( "SkyBlue" ), 20.*MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Neptune"), TQColor( "SkyBlue" ), 20.*MINZOOM, 1, scale ); } //Draw Uranus if ( Options::showUranus() ) { - drawPlanet(psky, data->PCat->findByName("Uranus"), QColor( "LightSeaGreen" ), 20.*MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Uranus"), TQColor( "LightSeaGreen" ), 20.*MINZOOM, 1, scale ); } //Draw Saturn if ( Options::showSaturn() ) { - drawPlanet(psky, data->PCat->findByName("Saturn"), QColor( "LightYellow2" ), 20.*MINZOOM, 2, scale ); + drawPlanet(psky, data->PCat->findByName("Saturn"), TQColor( "LightYellow2" ), 20.*MINZOOM, 2, scale ); } //Draw Jupiter and its moons. //Draw all moons first, then Jupiter, then redraw moons that are in front of Jupiter. if ( Options::showJupiter() ) { //Draw Jovian moons - psky.setPen( QPen( QColor( "white" ) ) ); + psky.setPen( TQPen( TQColor( "white" ) ) ); if ( Options::zoomFactor() > 10.*MINZOOM ) { for ( unsigned int i=0; i<4; ++i ) { - QPoint o = getXY( data->jmoons->pos(i), Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( data->jmoons->pos(i), Options::useAltAz(), Options::useRefraction(), scale ); if ( ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) ) { psky.drawEllipse( o.x()-1, o.y()-1, 2, 2 ); } } } - drawPlanet(psky, data->PCat->findByName("Jupiter"), QColor( "Goldenrod" ), 20.*MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Jupiter"), TQColor( "Goldenrod" ), 20.*MINZOOM, 1, scale ); //Re-draw Jovian moons which are in front of Jupiter, also draw all 4 moon labels. - psky.setPen( QPen( QColor( "white" ) ) ); + psky.setPen( TQPen( TQColor( "white" ) ) ); if ( Options::zoomFactor() > 10.*MINZOOM ) { - QFont pfont = psky.font(); - QFont moonFont = psky.font(); + TQFont pfont = psky.font(); + TQFont moonFont = psky.font(); moonFont.setPointSize( pfont.pointSize() - 2 ); psky.setFont( moonFont ); for ( unsigned int i=0; i<4; ++i ) { - QPoint o = getXY( data->jmoons->pos(i), Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( data->jmoons->pos(i), Options::useAltAz(), Options::useRefraction(), scale ); if ( ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) ) { if ( data->jmoons->z(i) < 0.0 ) //Moon is nearer than Jupiter psky.drawEllipse( o.x()-1, o.y()-1, 2, 2 ); @@ -1740,7 +1740,7 @@ void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) //Draw Mars if ( Options::showMars() ) { - drawPlanet(psky, data->PCat->findByName("Mars"), QColor( "Red" ), 20.*MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Mars"), TQColor( "Red" ), 20.*MINZOOM, 1, scale ); } //For the inner planets, we need to determine the distance-order @@ -1760,29 +1760,29 @@ void SkyMap::drawSolarSystem( QPainter& psky, bool drawPlanets, double scale ) if ( i==is ) { //Draw Sun if ( Options::showSun() ) { - drawPlanet(psky, data->PCat->findByName("Sun"), QColor( "Yellow" ), MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Sun"), TQColor( "Yellow" ), MINZOOM, 1, scale ); } } else if ( i==im ) { //Draw Mercury if ( Options::showMercury() ) { - drawPlanet(psky, data->PCat->findByName("Mercury"), QColor( "SlateBlue1" ), 20.*MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Mercury"), TQColor( "SlateBlue1" ), 20.*MINZOOM, 1, scale ); } } else if ( i==iv ) { //Draw Venus if ( Options::showVenus() ) { - drawPlanet(psky, data->PCat->findByName("Venus"), QColor( "LightGreen" ), 20.*MINZOOM, 1, scale ); + drawPlanet(psky, data->PCat->findByName("Venus"), TQColor( "LightGreen" ), 20.*MINZOOM, 1, scale ); } } } //Draw Moon if ( Options::showMoon() ) { - drawPlanet(psky, data->Moon, QColor( "White" ), MINZOOM, 1, scale ); + drawPlanet(psky, data->Moon, TQColor( "White" ), MINZOOM, 1, scale ); } } } -void SkyMap::drawPlanet( QPainter &psky, KSPlanetBase *p, QColor c, +void SkyMap::drawPlanet( TQPainter &psky, KSPlanetBase *p, TQColor c, double zoommin, int resize_mult, double scale ) { if ( checkVisibility( p, fov(), XRange ) ) { @@ -1795,7 +1795,7 @@ void SkyMap::drawPlanet( QPainter &psky, KSPlanetBase *p, QColor c, psky.setPen( c ); psky.setBrush( c ); - QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); + TQPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale ); //Is planet onscreen? if ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) { @@ -1841,15 +1841,15 @@ void SkyMap::drawPlanet( QPainter &psky, KSPlanetBase *p, QColor c, //draw Name if ( Options::showPlanetNames() ) { - psky.setPen( QColor( data->colorScheme()->colorNamed( "PNameColor" ) ) ); + psky.setPen( TQColor( data->colorScheme()->colorNamed( "PNameColor" ) ) ); drawNameLabel( psky, p, o.x(), o.y(), scale ); } } } } -void SkyMap::exportSkyImage( const QPaintDevice *pd ) { - QPainter p; +void SkyMap::exportSkyImage( const TQPaintDevice *pd ) { + TQPainter p; //shortcuts to inform wheter to draw different objects bool drawPlanets( Options::showPlanets() ); @@ -1860,7 +1860,7 @@ void SkyMap::exportSkyImage( const QPaintDevice *pd ) { bool drawGrid( Options::showGrid() ); p.begin( pd ); - QPaintDeviceMetrics pdm( p.device() ); + TQPaintDeviceMetrics pdm( p.device() ); //scale image such that it fills 90% of the x or y dimension on the paint device double xscale = double(pdm.width()) / double(width()); @@ -1872,11 +1872,11 @@ void SkyMap::exportSkyImage( const QPaintDevice *pd ) { int x1 = int( 0.5*(pdm.width() - pdWidth) ); int y1 = int( 0.5*(pdm.height() - pdHeight) ); - p.setClipRect( QRect( x1, y1, pdWidth, pdHeight ) ); + p.setClipRect( TQRect( x1, y1, pdWidth, pdHeight ) ); p.setClipping( true ); //Fill background with sky color - p.fillRect( x1, y1, pdWidth, pdHeight, QBrush( data->colorScheme()->colorNamed( "SkyColor" ) ) ); + p.fillRect( x1, y1, pdWidth, pdHeight, TQBrush( data->colorScheme()->colorNamed( "SkyColor" ) ) ); if ( x1 || y1 ) p.translate( x1, y1 ); diff --git a/kstars/kstars/skymapevents.cpp b/kstars/kstars/skymapevents.cpp index c35f3672..26b04a5f 100644 --- a/kstars/kstars/skymapevents.cpp +++ b/kstars/kstars/skymapevents.cpp @@ -20,9 +20,9 @@ #include #include //using fabs() -#include -#include -#include +#include +#include +#include #include #include @@ -39,7 +39,7 @@ #include "kspopupmenu.h" #include "ksmoon.h" -void SkyMap::resizeEvent( QResizeEvent * ) +void SkyMap::resizeEvent( TQResizeEvent * ) { computeSkymap = true; // skymap must be new computed if ( testWState(WState_AutoMask) ) updateMask(); @@ -52,8 +52,8 @@ void SkyMap::resizeEvent( QResizeEvent * ) sky2->resize( width(), height() ); } -void SkyMap::keyPressEvent( QKeyEvent *e ) { - QString s; +void SkyMap::keyPressEvent( TQKeyEvent *e ) { + TQString s; bool arrowKeyPressed( false ); bool shiftPressed( false ); float step = 1.0; @@ -274,7 +274,7 @@ void SkyMap::keyPressEvent( QKeyEvent *e ) { case Key_P: //Show Popup menu for Clicked/Centered object if ( shiftPressed ) setClickedObject( focusObject() ); if ( clickedObject() ) - clickedObject()->showPopupMenu( pmenu, QCursor::pos() ); + clickedObject()->showPopupMenu( pmenu, TQCursor::pos() ); break; case Key_O: //Add object to Observing List @@ -310,67 +310,67 @@ void SkyMap::keyPressEvent( QKeyEvent *e ) { case Key_G: //loop through all cities { - QFile file; + TQFile file; if ( KSUtils::openDataFile( file, "Cities.dat" ) ) { KSFileReader fileReader( file ); int nCount = 0; while (fileReader.hasMoreLines()) { - QString line = fileReader.readLine(); + TQString line = fileReader.readLine(); nCount++; kdDebug() << "Line " << nCount << " : " << line; } } - QTime t1; + TQTime t1; t1.start(); for (int i=0;i<10;i++) { if ( KSUtils::openDataFile( file, "Cities.dat" ) ) { - QString sAll( file.readAll() ); - QStringList lines = QStringList::split( "\n", sAll ); + TQString sAll( file.readAll() ); + TQStringList lines = TQStringList::split( "\n", sAll ); int nSize = lines.size(); for ( int i=0; islotTrack(); } -void SkyMap::keyReleaseEvent( QKeyEvent *e ) { +void SkyMap::keyReleaseEvent( TQKeyEvent *e ) { switch ( e->key() ) { case Key_Left : //no break; continue to Key_Down case Key_Right : //no break; continue to Key_Down @@ -429,7 +429,7 @@ void SkyMap::keyReleaseEvent( QKeyEvent *e ) { } } -void SkyMap::mouseMoveEvent( QMouseEvent *e ) { +void SkyMap::mouseMoveEvent( TQMouseEvent *e ) { if ( Options::useHoverLabel() ) { //First of all, if the transientObject() pointer is not NULL, then //we just moved off of a hovered object. Begin fading the label. @@ -453,11 +453,11 @@ void SkyMap::mouseMoveEvent( QMouseEvent *e ) { if ( ZoomRect.center().x() > 0 && ZoomRect.center().y() > 0 ) { //cancel operation if the user let go of CTRL if ( !( e->state() & ControlButton ) ) { - ZoomRect = QRect(); //invalidate ZoomRect + ZoomRect = TQRect(); //invalidate ZoomRect update(); } else { //Resize the rectangle so that it passes through the cursor position - QPoint pcenter = ZoomRect.center(); + TQPoint pcenter = ZoomRect.center(); int dx = abs(e->x() - pcenter.x()); int dy = abs(e->y() - pcenter.y()); if ( dx == 0 || float(dy)/float(dx) > float(height())/float(width()) ) { @@ -554,7 +554,7 @@ void SkyMap::mouseMoveEvent( QMouseEvent *e ) { } else { if ( ksw ) { - QString sX, sY, s; + TQString sX, sY, s; sX = mousePoint()->az()->toDMSString(true); //true = force +/- symbol sY = mousePoint()->alt()->toDMSString(true); //true=force +/- symbol if ( Options::useAltAz() && Options::useRefraction() ) @@ -571,12 +571,12 @@ void SkyMap::mouseMoveEvent( QMouseEvent *e ) { } } -void SkyMap::wheelEvent( QWheelEvent *e ) { +void SkyMap::wheelEvent( TQWheelEvent *e ) { if ( ksw && e->delta() > 0 ) ksw->slotZoomIn(); else if ( ksw ) ksw->slotZoomOut(); } -void SkyMap::mouseReleaseEvent( QMouseEvent * ) { +void SkyMap::mouseReleaseEvent( TQMouseEvent * ) { if ( infoBoxes()->unGrabBox() ) { update(); return; @@ -600,11 +600,11 @@ void SkyMap::mouseReleaseEvent( QMouseEvent * ) { ksw->zoom( Options::zoomFactor() * factor ); setDefaultMouseCursor(); - ZoomRect = QRect(); //invalidate ZoomRect + ZoomRect = TQRect(); //invalidate ZoomRect forceUpdate(); } else { setDefaultMouseCursor(); - ZoomRect = QRect(); //just in case user Ctrl+clicked + released w/o dragging... + ZoomRect = TQRect(); //just in case user Ctrl+clicked + released w/o dragging... } if (mouseMoveCursor) setDefaultMouseCursor(); // set default cursor @@ -627,7 +627,7 @@ void SkyMap::mouseReleaseEvent( QMouseEvent * ) { scrollCount = 0; } -void SkyMap::mousePressEvent( QMouseEvent *e ) { +void SkyMap::mousePressEvent( TQMouseEvent *e ) { //did we Grab an infoBox? if ( e->button() == LeftButton && infoBoxes()->grabBox( e ) ) { update(); //refresh without redrawing skymap @@ -642,8 +642,8 @@ void SkyMap::mousePressEvent( QMouseEvent *e ) { } // if button is down and cursor is not moved set the move cursor after 500 ms - QTimer t; - t.singleShot (500, this, SLOT (setMouseMoveCursor())); + TQTimer t; + t.singleShot (500, this, TQT_SLOT (setMouseMoveCursor())); double dx = ( 0.5*width() - e->x() )/Options::zoomFactor(); double dy = ( 0.5*height() - e->y() )/Options::zoomFactor(); @@ -672,7 +672,7 @@ void SkyMap::mousePressEvent( QMouseEvent *e ) { setClickedPoint( clickedObject() ); if ( e->button() == RightButton ) { - clickedObject()->showPopupMenu( pmenu, QCursor::pos() ); + clickedObject()->showPopupMenu( pmenu, TQCursor::pos() ); } if ( ksw && e->button() == LeftButton ) { @@ -693,7 +693,7 @@ void SkyMap::mousePressEvent( QMouseEvent *e ) { pmenu->createEmptyMenu( nullObj ); delete nullObj; - pmenu->popup( QCursor::pos() ); + pmenu->popup( TQCursor::pos() ); break; } @@ -704,7 +704,7 @@ void SkyMap::mousePressEvent( QMouseEvent *e ) { } } -void SkyMap::mouseDoubleClickEvent( QMouseEvent *e ) { +void SkyMap::mouseDoubleClickEvent( TQMouseEvent *e ) { //Was the event inside an infoBox? If so, shade the box. if ( e->button() == LeftButton ) { if ( infoBoxes()->shadeBox( e ) ) { @@ -721,7 +721,7 @@ void SkyMap::mouseDoubleClickEvent( QMouseEvent *e ) { } } -void SkyMap::paintEvent( QPaintEvent * ) +void SkyMap::paintEvent( TQPaintEvent * ) { //If computeSkymap is false, then we just refresh the window using the stored sky pixmap //and draw the "overlays" on top. This lets us update the overlay information rapidly @@ -736,7 +736,7 @@ void SkyMap::paintEvent( QPaintEvent * ) return ; // exit because the pixmap is repainted and that's all what we want } - QPainter psky; + TQPainter psky; setMapGeometry(); //checkSlewing combines the slewing flag (which is true when the display is actually in motion), @@ -754,7 +754,7 @@ void SkyMap::paintEvent( QPaintEvent * ) bool drawGrid( Options::showGrid() && !(checkSlewing && Options::hideGrid() ) ); psky.begin( sky ); - psky.fillRect( 0, 0, width(), height(), QBrush( data->colorScheme()->colorNamed( "SkyColor" ) ) ); + psky.fillRect( 0, 0, width(), height(), TQBrush( data->colorScheme()->colorNamed( "SkyColor" ) ) ); if ( drawMW ) drawMilkyWay( psky ); if ( drawGrid ) drawCoordinateGrid( psky ); diff --git a/kstars/kstars/skyobject.cpp b/kstars/kstars/skyobject.cpp index b523be3b..5ea5036d 100644 --- a/kstars/kstars/skyobject.cpp +++ b/kstars/kstars/skyobject.cpp @@ -19,10 +19,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "skyobject.h" #include "starobject.h" //needed in saveUserLog() @@ -31,10 +31,10 @@ #include "geolocation.h" #include "kstarsdatetime.h" -QString SkyObject::emptyString = QString(""); -QString SkyObject::unnamedString = QString(i18n("unnamed")); -QString SkyObject::unnamedObjectString = QString(i18n("unnamed object")); -QString SkyObject::starString = QString("star"); +TQString SkyObject::emptyString = TQString(""); +TQString SkyObject::unnamedString = TQString(i18n("unnamed")); +TQString SkyObject::unnamedObjectString = TQString(i18n("unnamed object")); +TQString SkyObject::starString = TQString("star"); SkyObject::SkyObject( SkyObject &o ) : SkyPoint( o ) { setType( o.type() ); @@ -49,7 +49,7 @@ SkyObject::SkyObject( SkyObject &o ) : SkyPoint( o ) { } SkyObject::SkyObject( int t, dms r, dms d, float m, - QString n, QString n2, QString lname ) : SkyPoint( r, d) { + TQString n, TQString n2, TQString lname ) : SkyPoint( r, d) { setType( t ); Magnitude = m; Name = 0; @@ -61,7 +61,7 @@ SkyObject::SkyObject( int t, dms r, dms d, float m, } SkyObject::SkyObject( int t, double r, double d, float m, - QString n, QString n2, QString lname ) : SkyPoint( r, d) { + TQString n, TQString n2, TQString lname ) : SkyPoint( r, d) { setType( t ); Magnitude = m; Name = 0; @@ -78,24 +78,24 @@ SkyObject::~SkyObject() { delete LongName; } -void SkyObject::setLongName( const QString &longname ) { +void SkyObject::setLongName( const TQString &longname ) { delete LongName; if ( longname.isEmpty() ) { if ( hasName() ) - LongName = new QString(translatedName()); + LongName = new TQString(translatedName()); else if ( hasName2() ) - LongName = new QString(*Name2); + LongName = new TQString(*Name2); else LongName = 0; } else { - LongName = new QString(longname); + LongName = new TQString(longname); } } -QTime SkyObject::riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst ) { +TQTime SkyObject::riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst ) { //this object does not rise or set; return an invalid time if ( checkCircumpolar(geo->lat()) ) - return QTime( 25, 0, 0 ); + return TQTime( 25, 0, 0 ); //First of all, if the object is below the horizon at date/time dt, adjust the time //to bring it above the horizon @@ -113,9 +113,9 @@ QTime SkyObject::riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, return geo->UTtoLT( KStarsDateTime( dt2.date(), riseSetTimeUT( dt2, geo, rst ) ) ).time(); } -QTime SkyObject::riseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, bool riseT ) { +TQTime SkyObject::riseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, bool riseT ) { // First trial to calculate UT - QTime UT = auxRiseSetTimeUT( dt, geo, ra(), dec(), riseT ); + TQTime UT = auxRiseSetTimeUT( dt, geo, ra(), dec(), riseT ); // We iterate once more using the calculated UT to compute again // the ra and dec for that time and hence the rise/set time. @@ -144,7 +144,7 @@ dms SkyObject::riseSetTimeLST( const KStarsDateTime &dt, const GeoLocation *geo, return geo->GSTtoLST( rst.gst() ); } -QTime SkyObject::auxRiseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, +TQTime SkyObject::auxRiseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, const dms *righta, const dms *decl, bool riseT) { dms LST = auxRiseSetTimeLST( geo->lat(), righta, decl, riseT ); return dt.GSTtoUT( geo->LSTtoGST( LST ) ); @@ -170,7 +170,7 @@ dms SkyObject::riseSetTimeAz( const KStarsDateTime &dt, const GeoLocation *geo, double sindec, cosdec, sinlat, coslat, sinHA, cosHA; double sinAlt, cosAlt; - QTime UT = riseSetTimeUT( dt, geo, riseT ); + TQTime UT = riseSetTimeUT( dt, geo, riseT ); KStarsDateTime dt0 = dt; dt0.setTime( UT ); SkyPoint sp = recomputeCoords( dt0, geo ); @@ -195,7 +195,7 @@ dms SkyObject::riseSetTimeAz( const KStarsDateTime &dt, const GeoLocation *geo, return Azimuth; } -QTime SkyObject::transitTimeUT( const KStarsDateTime &dt, const GeoLocation *geo ) { +TQTime SkyObject::transitTimeUT( const KStarsDateTime &dt, const GeoLocation *geo ) { dms LST = geo->GSTtoLST( dt.gst() ); //dSec is the number of seconds until the object transits. @@ -216,13 +216,13 @@ QTime SkyObject::transitTimeUT( const KStarsDateTime &dt, const GeoLocation *geo return dt.addSecs( dSec ).time(); } -QTime SkyObject::transitTime( const KStarsDateTime &dt, const GeoLocation *geo ) { +TQTime SkyObject::transitTime( const KStarsDateTime &dt, const GeoLocation *geo ) { return geo->UTtoLT( KStarsDateTime( dt.date(), transitTimeUT( dt, geo ) ) ).time(); } dms SkyObject::transitAltitude( const KStarsDateTime &dt, const GeoLocation *geo ) { KStarsDateTime dt0 = dt; - QTime UT = transitTimeUT( dt, geo ); + TQTime UT = transitTimeUT( dt, geo ); dt0.setTime( UT ); SkyPoint sp = recomputeCoords( dt0, geo ); const dms *decm = sp.dec0(); @@ -307,7 +307,7 @@ bool SkyObject::checkCircumpolar( const dms *gLat ) { return false; } -QString SkyObject::typeName( void ) const { +TQString SkyObject::typeName( void ) const { if ( Type==0 ) return i18n( "Star" ); else if ( Type==1 ) return i18n( "Catalog Star" ); else if ( Type==2 ) return i18n( "Planet" ); @@ -321,25 +321,25 @@ QString SkyObject::typeName( void ) const { else if ( Type==10 ) return i18n( "Asteroid" ); else return i18n( "Unknown Type" ); } -void SkyObject::setName( const QString &name ) { +void SkyObject::setName( const TQString &name ) { // if (name == "star" ) kdDebug() << "name == star" << endl; delete Name; if (!name.isEmpty()) - Name = new QString(name); + Name = new TQString(name); else { Name = 0; /*kdDebug() << "name saved" << endl;*/ } } -void SkyObject::setName2( const QString &name2 ) { +void SkyObject::setName2( const TQString &name2 ) { delete Name2; if (!name2.isEmpty()) - Name2 = new QString(name2); + Name2 = new TQString(name2); else { Name2 = 0; /*kdDebug() << "name2 saved" << endl;*/ } } -QString SkyObject::messageFromTitle( const QString &imageTitle ) { - QString message = imageTitle; +TQString SkyObject::messageFromTitle( const TQString &imageTitle ) { + TQString message = imageTitle; //HST Image if ( imageTitle == i18n( "Show HST Image" ) || imageTitle.contains("HST") ) { @@ -377,9 +377,9 @@ QString SkyObject::messageFromTitle( const QString &imageTitle ) { //New saveUserLog, moved from DetailDialog. //Should create a special UserLog widget that encapsulates the "default" //message in the widget when no log exists (much like we do with dmsBox now) -void SkyObject::saveUserLog( const QString &newLog ) { - QFile file; - QString logs; //existing logs +void SkyObject::saveUserLog( const TQString &newLog ) { + TQFile file; + TQString logs; //existing logs //Do nothing if new log is the "default" message //(keep going if new log is empty; we'll want to delete its current entry) @@ -387,7 +387,7 @@ void SkyObject::saveUserLog( const QString &newLog ) { return; // header label - QString KSLabel ="[KSLABEL:" + name() + "]"; + TQString KSLabel ="[KSLABEL:" + name() + "]"; //However, we can't accept a star name if it has a greek letter in it: if ( type() == STAR ) { StarObject *star = (StarObject*)this; @@ -397,7 +397,7 @@ void SkyObject::saveUserLog( const QString &newLog ) { file.setName( locateLocal( "appdata", "userlog.dat" ) ); //determine filename in local user KDE directory tree. if ( file.open( IO_ReadOnly)) { - QTextStream instream(&file); + TQTextStream instream(&file); // read all data into memory logs = instream.read(); file.close(); @@ -406,7 +406,7 @@ void SkyObject::saveUserLog( const QString &newLog ) { //Remove old log entry from the logs text if ( ! userLog.isEmpty() ) { int startIndex, endIndex; - QString sub; + TQString sub; startIndex = logs.find(KSLabel); sub = logs.mid (startIndex); @@ -428,7 +428,7 @@ void SkyObject::saveUserLog( const QString &newLog ) { } //Write new logs text - QTextStream outstream(&file); + TQTextStream outstream(&file); outstream << logs; //Set the log text in the object itself. diff --git a/kstars/kstars/skyobject.h b/kstars/kstars/skyobject.h index 214e62c4..a8376d45 100644 --- a/kstars/kstars/skyobject.h +++ b/kstars/kstars/skyobject.h @@ -18,8 +18,8 @@ #ifndef SKYOBJECT_H #define SKYOBJECT_H -#include -#include +#include +#include #include @@ -52,7 +52,7 @@ public: *@param lname Long name (common name) */ SkyObject( int t=TYPE_UNKNOWN, dms r=dms(0.0), dms d=dms(0.0), - float m=0.0, QString n="", QString n2="", QString lname="" ); + float m=0.0, TQString n="", TQString n2="", TQString lname="" ); /** *Constructor. Set SkyObject data according to arguments. Differs from *above function only in data type of RA and Dec. @@ -65,7 +65,7 @@ public: *@param lname Long name (common name) */ SkyObject( int t, double r, double d, float m=0.0, - QString n="", QString n2="", QString lname="" ); + TQString n="", TQString n2="", TQString lname="" ); /**Copy constructor. *@param o SkyObject from which to copy data @@ -86,42 +86,42 @@ public: /**@return object's primary name. */ - virtual QString name( void ) const { return hasName() ? *Name : unnamedString;} + virtual TQString name( void ) const { return hasName() ? *Name : unnamedString;} /**@return object's primary name, translated to local language. */ - QString translatedName() const { return i18n( name().utf8() );} + TQString translatedName() const { return i18n( name().utf8() );} /**Set the object's primary name. *@param name the object's primary name */ - void setName( const QString &name ); + void setName( const TQString &name ); /**@return object's secondary name */ - QString name2( void ) const { return hasName2() ? *Name2 : emptyString; } + TQString name2( void ) const { return hasName2() ? *Name2 : emptyString; } /**@return object's secondary name, translated to local language. */ - QString translatedName2() const { return i18n( name2().utf8() );} + TQString translatedName2() const { return i18n( name2().utf8() );} /**Set the object's secondary name. *@param name2 the object's secondary name. */ - void setName2( const QString &name2="" ); + void setName2( const TQString &name2="" ); /**@return object's common (long) name */ - virtual QString longname( void ) const { return hasLongName() ? *LongName : unnamedObjectString; } + virtual TQString longname( void ) const { return hasLongName() ? *LongName : unnamedObjectString; } /**@return object's common (long) name, translated to local language. */ - QString translatedLongName() const { return i18n( longname().utf8() );} + TQString translatedLongName() const { return i18n( longname().utf8() );} /**Set the object's long name. *@param longname the object's long name. */ - void setLongName( const QString &longname="" ); + void setLongName( const TQString &longname="" ); /**@return object's type identifier (int) *@see enum TYPE @@ -136,7 +136,7 @@ public: /**@return a string describing object's type. */ - QString typeName( void ) const; + TQString typeName( void ) const; /**@return object's magnitude */ @@ -161,7 +161,7 @@ public: *function gets called. By overloading the function, we don't have to check the *object type when we need the menu. */ - virtual void showPopupMenu( KSPopupMenu *pmenu, QPoint pos ) { pmenu->createEmptyMenu( this ); pmenu->popup( pos ); } + virtual void showPopupMenu( KSPopupMenu *pmenu, TQPoint pos ) { pmenu->createEmptyMenu( this ); pmenu->popup( pos ); } /**Determine the time at which the point will rise or set. Because solar system *objects move across the sky, it is necessary to iterate on the solution. @@ -174,7 +174,7 @@ public: *@param geo current geographic location *@param rst If TRUE, compute rise time. If FALSE, compute set time. */ - QTime riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst ); + TQTime riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst ); /**@return the UT time when the object will rise or set *@param dt target date/time @@ -182,7 +182,7 @@ public: *@param rst Boolean. If TRUE will compute rise time. If FALSE * will compute set time. */ - QTime riseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, bool rst); + TQTime riseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, bool rst); /**@return the LST time when the object will rise or set *@param dt target date/time @@ -206,13 +206,13 @@ public: *@param dt target date/time *@param geo pointer to the geographic location */ - QTime transitTime( const KStarsDateTime &dt, const GeoLocation *geo ); + TQTime transitTime( const KStarsDateTime &dt, const GeoLocation *geo ); /**@return the universal time that the object will transit the meridian. *@param dt target date/time *@param geo pointer to the geographic location */ - QTime transitTimeUT( const KStarsDateTime &dt, const GeoLocation *geo ); + TQTime transitTimeUT( const KStarsDateTime &dt, const GeoLocation *geo ); /**@return the altitude of the object at the moment it transits the meridian. *@param dt target date/time @@ -242,15 +242,15 @@ public: /**@short Given the Image title from a URL file, try to convert it to an image credit string. */ - QString messageFromTitle( const QString &imageTitle ); + TQString messageFromTitle( const TQString &imageTitle ); /**@short Save new user log text */ - void saveUserLog( const QString &newLog ); + void saveUserLog( const TQString &newLog ); - QStringList ImageList, ImageTitle; - QStringList InfoList, InfoTitle; - QString userLog; + TQStringList ImageList, ImageTitle; + TQStringList InfoList, InfoTitle; + TQString userLog; private: @@ -266,7 +266,7 @@ private: * will compute set time. *@return the time at which the given position will rise or set. */ - QTime auxRiseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, + TQTime auxRiseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, const dms *righta, const dms *decl, bool riseT); /**Compute the LST time when the object will rise or set. It is an auxiliary @@ -311,13 +311,13 @@ private: protected: - QString *Name, *Name2, *LongName; + TQString *Name, *Name2, *LongName; // store often used name strings in static variables - static QString emptyString; - static QString unnamedString; - static QString unnamedObjectString; - static QString starString; + static TQString emptyString; + static TQString unnamedString; + static TQString unnamedObjectString; + static TQString starString; }; #endif diff --git a/kstars/kstars/skyobjectname.cpp b/kstars/kstars/skyobjectname.cpp index c714488e..696803b5 100644 --- a/kstars/kstars/skyobjectname.cpp +++ b/kstars/kstars/skyobjectname.cpp @@ -18,13 +18,13 @@ #include "skyobjectname.h" #include "skyobject.h" -SkyObjectName::SkyObjectName( const QString &str, SkyObject *obj ) +SkyObjectName::SkyObjectName( const TQString &str, SkyObject *obj ) : skyobject ( obj ), Text ( str ) { } -SkyObjectNameListItem::SkyObjectNameListItem ( QListBox *parent, SkyObjectName *obj ) - : QListBoxText ( parent ), object ( obj ) +SkyObjectNameListItem::SkyObjectNameListItem ( TQListBox *parent, SkyObjectName *obj ) + : TQListBoxText ( parent ), object ( obj ) { setText( obj->text() ); } diff --git a/kstars/kstars/skyobjectname.h b/kstars/kstars/skyobjectname.h index f7eb95d6..580671c7 100644 --- a/kstars/kstars/skyobjectname.h +++ b/kstars/kstars/skyobjectname.h @@ -18,7 +18,7 @@ #ifndef SKYOBJECTNAME_H #define SKYOBJECTNAME_H -#include +#include #include #include @@ -37,16 +37,16 @@ class SkyObjectName { public: /**Constructor*/ - SkyObjectName (const QString &str = QString::null, SkyObject *obj = 0); + SkyObjectName (const TQString &str = TQString::null, SkyObject *obj = 0); /**Destructor (empty)*/ ~SkyObjectName() {} /**@return the name of the SkyObject*/ - QString text() { return Text; } + TQString text() { return Text; } /**@return translated version of the SkyObject's name*/ - QString translatedText() { return i18n( Text.local8Bit().data()); } + TQString translatedText() { return i18n( Text.local8Bit().data()); } /**@return pointer to the SkyObject*/ SkyObject *skyObject() { return skyobject; } @@ -62,24 +62,24 @@ class SkyObjectName { private: SkyObject *skyobject; - QString Text; + TQString Text; }; /**Class for filling list of named objects in the Find Object dialog (FindDialog). - *The class is derived from QListBoxText, and adds a SkyObjectName* member variable, + *The class is derived from TQListBoxText, and adds a SkyObjectName* member variable, *and a method to retrieve this variable (a pointer). This makes it very easy - *to add these items to the FindDialog's QListBox, and to sort and filter them. - *@short Derivative of QListBoxItem specifically for SkyObjects + *to add these items to the FindDialog's TQListBox, and to sort and filter them. + *@short Derivative of TQListBoxItem specifically for SkyObjects *@author Thomas Kabelmann *@version 0.9 */ -class SkyObjectNameListItem : public QListBoxText { +class SkyObjectNameListItem : public TQListBoxText { public: /**Constructor */ - SkyObjectNameListItem (QListBox *parent, SkyObjectName *name ); + SkyObjectNameListItem (TQListBox *parent, SkyObjectName *name ); /**Destructor (empty)*/ ~SkyObjectNameListItem() {} diff --git a/kstars/kstars/skypoint.cpp b/kstars/kstars/skypoint.cpp index 03df8926..c5ea55a8 100644 --- a/kstars/kstars/skypoint.cpp +++ b/kstars/kstars/skypoint.cpp @@ -537,7 +537,7 @@ dms SkyPoint::angularDistanceTo(SkyPoint *sp) { return angDist; } -QString SkyPoint::constellation( QPtrList &csegmentList, QPtrList &cnameList ) const { +TQString SkyPoint::constellation( TQPtrList &csegmentList, TQPtrList &cnameList ) const { //Identify the constellation that contains point p. //First, find all CSegments that bracket the RA of p. //Then, identify the pair of these bracketing segments which bracket p in the Dec direction. @@ -548,9 +548,9 @@ QString SkyPoint::constellation( QPtrList &csegmentList, QPtrList p1List, p2List; - QStringList name1List, name2List; - QString abbrev(""); + TQPtrList p1List, p2List; + TQStringList name1List, name2List; + TQString abbrev(""); double pdc = dec()->Degrees(); double pra(0.0); //defined in the loop, because we may modify it there @@ -768,7 +768,7 @@ QString SkyPoint::constellation( QPtrList &csegmentList, QPtrListname2().lower() ) { - QString r = i18n( "Constellation name (optional)", o->name().local8Bit().data() ); + TQString r = i18n( "Constellation name (optional)", o->name().local8Bit().data() ); r = r.left(1) + r.mid(1).lower(); //lowercase letters (except first letter) int i = r.find(" "); i++; diff --git a/kstars/kstars/skypoint.h b/kstars/kstars/skypoint.h index ee3cf09c..11ad9b26 100644 --- a/kstars/kstars/skypoint.h +++ b/kstars/kstars/skypoint.h @@ -20,8 +20,8 @@ #ifndef SKYPOINT_H #define SKYPOINT_H -#include -#include +#include +#include #include "dms.h" @@ -478,7 +478,7 @@ public: //// 6. Constellation Identification //// ===================================== - QString constellation( QPtrList &seglist, QPtrList &cnames ) const; + TQString constellation( TQPtrList &seglist, TQPtrList &cnames ) const; protected: diff --git a/kstars/kstars/stardatasink.cpp b/kstars/kstars/stardatasink.cpp index 45b3d983..e77b3820 100644 --- a/kstars/kstars/stardatasink.cpp +++ b/kstars/kstars/stardatasink.cpp @@ -20,7 +20,7 @@ #include "dms.h" #include "kstarsdata.h" -StarDataSink::StarDataSink(KStarsData *parent, const char *name) : QObject(parent, name) { +StarDataSink::StarDataSink(KStarsData *parent, const char *name) : TQObject(parent, name) { ksData = parent; receivedBlocks = 0; nameListCount = ksData->ObjNames.count(); @@ -45,8 +45,8 @@ void StarDataSink::eof() { void StarDataSink::receive( const uchar *data, int entries ) { receivedBlocks++; - // Pointer was send as const uchar* so it must be converted explicitly to QString* - QString *line = (QString *) data; + // Pointer was send as const uchar* so it must be converted explicitly to TQString* + TQString *line = (TQString *) data; int counter = -1; while (++counter < entries) { // run counter from 0 to entries -1 ksData->processStar(line, true); diff --git a/kstars/kstars/stardatasink.h b/kstars/kstars/stardatasink.h index 0cb97749..81b55d5e 100644 --- a/kstars/kstars/stardatasink.h +++ b/kstars/kstars/stardatasink.h @@ -26,14 +26,14 @@ *@version 1.0 */ -#include -#include +#include +#include -#include +#include class KStarsData; -class StarDataSink : public QObject, public QDataSink { +class StarDataSink : public TQObject, public TQDataSink { /** *class needs signals */ diff --git a/kstars/kstars/starobject.cpp b/kstars/kstars/starobject.cpp index 3120b88a..8e46b0db 100644 --- a/kstars/kstars/starobject.cpp +++ b/kstars/kstars/starobject.cpp @@ -19,8 +19,8 @@ #include "kspopupmenu.h" #include "ksnumbers.h" -#include -#include +#include +#include #include StarObject::StarObject( StarObject &o ) @@ -36,12 +36,12 @@ StarObject::StarObject( StarObject &o ) Variability = o.isVariable(); } -StarObject::StarObject( dms r, dms d, float m, QString n, QString n2, QString sptype, +StarObject::StarObject( dms r, dms d, float m, TQString n, TQString n2, TQString sptype, double pmra, double pmdec, double par, bool mult, bool var ) : SkyObject (SkyObject::STAR, r, d, m, n, n2, ""), SpType(sptype), PM_RA(pmra), PM_Dec(pmdec), Parallax(par), Multiplicity(mult), Variability(var) // SONAME deprecated //, soName( 0 ) { - QString lname; + TQString lname; if ( hasName() ) { lname = n; if ( hasName2() ) lname += " (" + gname() + ")"; @@ -56,12 +56,12 @@ StarObject::StarObject( dms r, dms d, float m, QString n, QString n2, QString sp setLongName(lname); } -StarObject::StarObject( double r, double d, float m, QString n, QString n2, QString sptype, +StarObject::StarObject( double r, double d, float m, TQString n, TQString n2, TQString sptype, double pmra, double pmdec, double par, bool mult, bool var ) : SkyObject (SkyObject::STAR, r, d, m, n, n2, ""), SpType(sptype), PM_RA(pmra), PM_Dec(pmdec), Parallax(par), Multiplicity(mult), Variability(var) // SONAME deprecated //, soName( 0 ) { - QString lname; + TQString lname; if ( hasName() ) { lname = n; if ( hasName2() )lname += n + " (" + gname() + ")"; @@ -82,45 +82,45 @@ void StarObject::updateCoords( KSNumbers *num, bool , const dms*, const dms* ) { setDec( dec()->Degrees() + pmDec()*num->julianMillenia()/3600. ); } -QString StarObject::sptype( void ) const { +TQString StarObject::sptype( void ) const { return SpType; } -QString StarObject::gname( bool useGreekChars ) const { +TQString StarObject::gname( bool useGreekChars ) const { return greekLetter( useGreekChars ) + " " + constell(); } -QString StarObject::greekLetter( bool gchar ) const { - QString code = name2().left(3); - QString letter = code; //in case genitive name is *not* a Greek letter +TQString StarObject::greekLetter( bool gchar ) const { + TQString code = name2().left(3); + TQString letter = code; //in case genitive name is *not* a Greek letter int alpha = 0x03B1; - if ( code == "alp" ) gchar ? letter = QString( QChar(alpha + 0) ) : letter = i18n("alpha"); - if ( code == "bet" ) gchar ? letter = QString( QChar(alpha + 1) ) : letter = i18n("beta"); - if ( code == "gam" ) gchar ? letter = QString( QChar(alpha + 2) ) : letter = i18n("gamma"); - if ( code == "del" ) gchar ? letter = QString( QChar(alpha + 3) ) : letter = i18n("delta"); - if ( code == "eps" ) gchar ? letter = QString( QChar(alpha + 4) ) : letter = i18n("epsilon"); - if ( code == "zet" ) gchar ? letter = QString( QChar(alpha + 5) ) : letter = i18n("zeta"); - if ( code == "eta" ) gchar ? letter = QString( QChar(alpha + 6) ) : letter = i18n("eta"); - if ( code == "the" ) gchar ? letter = QString( QChar(alpha + 7) ) : letter = i18n("theta"); - if ( code == "iot" ) gchar ? letter = QString( QChar(alpha + 8) ) : letter = i18n("iota"); - if ( code == "kap" ) gchar ? letter = QString( QChar(alpha + 9) ) : letter = i18n("kappa"); - if ( code == "lam" ) gchar ? letter = QString( QChar(alpha +10) ) : letter = i18n("lambda"); - if ( code == "mu " ) gchar ? letter = QString( QChar(alpha +11) ) : letter = i18n("mu"); - if ( code == "nu " ) gchar ? letter = QString( QChar(alpha +12) ) : letter = i18n("nu"); - if ( code == "xi " ) gchar ? letter = QString( QChar(alpha +13) ) : letter = i18n("xi"); - if ( code == "omi" ) gchar ? letter = QString( QChar(alpha +14) ) : letter = i18n("omicron"); - if ( code == "pi " ) gchar ? letter = QString( QChar(alpha +15) ) : letter = i18n("pi"); - if ( code == "rho" ) gchar ? letter = QString( QChar(alpha +16) ) : letter = i18n("rho"); + if ( code == "alp" ) gchar ? letter = TQString( TQChar(alpha + 0) ) : letter = i18n("alpha"); + if ( code == "bet" ) gchar ? letter = TQString( TQChar(alpha + 1) ) : letter = i18n("beta"); + if ( code == "gam" ) gchar ? letter = TQString( TQChar(alpha + 2) ) : letter = i18n("gamma"); + if ( code == "del" ) gchar ? letter = TQString( TQChar(alpha + 3) ) : letter = i18n("delta"); + if ( code == "eps" ) gchar ? letter = TQString( TQChar(alpha + 4) ) : letter = i18n("epsilon"); + if ( code == "zet" ) gchar ? letter = TQString( TQChar(alpha + 5) ) : letter = i18n("zeta"); + if ( code == "eta" ) gchar ? letter = TQString( TQChar(alpha + 6) ) : letter = i18n("eta"); + if ( code == "the" ) gchar ? letter = TQString( TQChar(alpha + 7) ) : letter = i18n("theta"); + if ( code == "iot" ) gchar ? letter = TQString( TQChar(alpha + 8) ) : letter = i18n("iota"); + if ( code == "kap" ) gchar ? letter = TQString( TQChar(alpha + 9) ) : letter = i18n("kappa"); + if ( code == "lam" ) gchar ? letter = TQString( TQChar(alpha +10) ) : letter = i18n("lambda"); + if ( code == "mu " ) gchar ? letter = TQString( TQChar(alpha +11) ) : letter = i18n("mu"); + if ( code == "nu " ) gchar ? letter = TQString( TQChar(alpha +12) ) : letter = i18n("nu"); + if ( code == "xi " ) gchar ? letter = TQString( TQChar(alpha +13) ) : letter = i18n("xi"); + if ( code == "omi" ) gchar ? letter = TQString( TQChar(alpha +14) ) : letter = i18n("omicron"); + if ( code == "pi " ) gchar ? letter = TQString( TQChar(alpha +15) ) : letter = i18n("pi"); + if ( code == "rho" ) gchar ? letter = TQString( TQChar(alpha +16) ) : letter = i18n("rho"); //there are two unicode symbols for sigma; //skip the first one, the second is more widely used - if ( code == "sig" ) gchar ? letter = QString( QChar(alpha +18) ) : letter = i18n("sigma"); - if ( code == "tau" ) gchar ? letter = QString( QChar(alpha +19) ) : letter = i18n("tau"); - if ( code == "ups" ) gchar ? letter = QString( QChar(alpha +20) ) : letter = i18n("upsilon"); - if ( code == "phi" ) gchar ? letter = QString( QChar(alpha +21) ) : letter = i18n("phi"); - if ( code == "chi" ) gchar ? letter = QString( QChar(alpha +22) ) : letter = i18n("chi"); - if ( code == "psi" ) gchar ? letter = QString( QChar(alpha +23) ) : letter = i18n("psi"); - if ( code == "ome" ) gchar ? letter = QString( QChar(alpha +24) ) : letter = i18n("omega"); + if ( code == "sig" ) gchar ? letter = TQString( TQChar(alpha +18) ) : letter = i18n("sigma"); + if ( code == "tau" ) gchar ? letter = TQString( TQChar(alpha +19) ) : letter = i18n("tau"); + if ( code == "ups" ) gchar ? letter = TQString( TQChar(alpha +20) ) : letter = i18n("upsilon"); + if ( code == "phi" ) gchar ? letter = TQString( TQChar(alpha +21) ) : letter = i18n("phi"); + if ( code == "chi" ) gchar ? letter = TQString( TQChar(alpha +22) ) : letter = i18n("chi"); + if ( code == "psi" ) gchar ? letter = TQString( TQChar(alpha +23) ) : letter = i18n("psi"); + if ( code == "ome" ) gchar ? letter = TQString( TQChar(alpha +24) ) : letter = i18n("omega"); if ( name2().length() && name2().mid(3,1) != " " ) letter += "[" + name2().mid(3,1) + "]"; @@ -128,101 +128,101 @@ QString StarObject::greekLetter( bool gchar ) const { return letter; } -QString StarObject::constell( void ) const { - QString code = name2().mid(4,3); - if ( code == "And" ) return QString("Andromedae"); - if ( code == "Ant" ) return QString("Antliae"); - if ( code == "Aps" ) return QString("Apodis"); - if ( code == "Aqr" ) return QString("Aquarii"); - if ( code == "Aql" ) return QString("Aquilae"); - if ( code == "Ara" ) return QString("Arae"); - if ( code == "Ari" ) return QString("Arietis"); - if ( code == "Aur" ) return QString("Aurigae"); - if ( code == "Boo" ) return QString("Bootis"); - if ( code == "Cae" ) return QString("Caeli"); - if ( code == "Cam" ) return QString("Camelopardalis"); - if ( code == "Cnc" ) return QString("Cancri"); - if ( code == "CVn" ) return QString("Canum Venaticorum"); - if ( code == "CMa" ) return QString("Canis Majoris"); - if ( code == "CMi" ) return QString("Canis Minoris"); - if ( code == "Cap" ) return QString("Capricorni"); - if ( code == "Car" ) return QString("Carinae"); - if ( code == "Cas" ) return QString("Cassiopeiae"); - if ( code == "Cen" ) return QString("Centauri"); - if ( code == "Cep" ) return QString("Cephei"); - if ( code == "Cet" ) return QString("Ceti"); - if ( code == "Cha" ) return QString("Chamaeleontis"); - if ( code == "Cir" ) return QString("Circini"); - if ( code == "Col" ) return QString("Columbae"); - if ( code == "Com" ) return QString("Comae Berenices"); - if ( code == "CrA" ) return QString("Coronae Austrinae"); - if ( code == "CrB" ) return QString("Coronae Borealis"); - if ( code == "Crv" ) return QString("Corvi"); - if ( code == "Crt" ) return QString("Crateris"); - if ( code == "Cru" ) return QString("Crucis"); - if ( code == "Cyg" ) return QString("Cygni"); - if ( code == "Del" ) return QString("Delphini"); - if ( code == "Dor" ) return QString("Doradus"); - if ( code == "Dra" ) return QString("Draconis"); - if ( code == "Equ" ) return QString("Equulei"); - if ( code == "Eri" ) return QString("Eridani"); - if ( code == "For" ) return QString("Fornacis"); - if ( code == "Gem" ) return QString("Geminorum"); - if ( code == "Gru" ) return QString("Gruis"); - if ( code == "Her" ) return QString("Herculis"); - if ( code == "Hor" ) return QString("Horologii"); - if ( code == "Hya" ) return QString("Hydrae"); - if ( code == "Hyi" ) return QString("Hydri"); - if ( code == "Ind" ) return QString("Indi"); - if ( code == "Lac" ) return QString("Lacertae"); - if ( code == "Leo" ) return QString("Leonis"); - if ( code == "LMi" ) return QString("Leonis Minoris"); - if ( code == "Lep" ) return QString("Leporis"); - if ( code == "Lib" ) return QString("Librae"); - if ( code == "Lup" ) return QString("Lupi"); - if ( code == "Lyn" ) return QString("Lyncis"); - if ( code == "Lyr" ) return QString("Lyrae"); - if ( code == "Men" ) return QString("Mensae"); - if ( code == "Mic" ) return QString("Microscopii"); - if ( code == "Mon" ) return QString("Monocerotis"); - if ( code == "Mus" ) return QString("Muscae"); - if ( code == "Nor" ) return QString("Normae"); - if ( code == "Oct" ) return QString("Octantis"); - if ( code == "Oph" ) return QString("Ophiuchi"); - if ( code == "Ori" ) return QString("Orionis"); - if ( code == "Pav" ) return QString("Pavonis"); - if ( code == "Peg" ) return QString("Pegasi"); - if ( code == "Per" ) return QString("Persei"); - if ( code == "Phe" ) return QString("Phoenicis"); - if ( code == "Pic" ) return QString("Pictoris"); - if ( code == "Psc" ) return QString("Piscium"); - if ( code == "PsA" ) return QString("Piscis Austrini"); - if ( code == "Pup" ) return QString("Puppis"); - if ( code == "Pyx" ) return QString("Pyxidis"); - if ( code == "Ret" ) return QString("Reticuli"); - if ( code == "Sge" ) return QString("Sagittae"); - if ( code == "Sgr" ) return QString("Sagittarii"); - if ( code == "Sco" ) return QString("Scorpii"); - if ( code == "Scl" ) return QString("Sculptoris"); - if ( code == "Sct" ) return QString("Scuti"); - if ( code == "Ser" ) return QString("Serpentis"); - if ( code == "Sex" ) return QString("Sextantis"); - if ( code == "Tau" ) return QString("Tauri"); - if ( code == "Tel" ) return QString("Telescopii"); - if ( code == "Tri" ) return QString("Trianguli"); - if ( code == "TrA" ) return QString("Trianguli Australis"); - if ( code == "Tuc" ) return QString("Tucanae"); - if ( code == "UMa" ) return QString("Ursae Majoris"); - if ( code == "UMi" ) return QString("Ursae Minoris"); - if ( code == "Vel" ) return QString("Velorum"); - if ( code == "Vir" ) return QString("Virginis"); - if ( code == "Vol" ) return QString("Volantis"); - if ( code == "Vul" ) return QString("Vulpeculae"); +TQString StarObject::constell( void ) const { + TQString code = name2().mid(4,3); + if ( code == "And" ) return TQString("Andromedae"); + if ( code == "Ant" ) return TQString("Antliae"); + if ( code == "Aps" ) return TQString("Apodis"); + if ( code == "Aqr" ) return TQString("Aquarii"); + if ( code == "Aql" ) return TQString("Aquilae"); + if ( code == "Ara" ) return TQString("Arae"); + if ( code == "Ari" ) return TQString("Arietis"); + if ( code == "Aur" ) return TQString("Aurigae"); + if ( code == "Boo" ) return TQString("Bootis"); + if ( code == "Cae" ) return TQString("Caeli"); + if ( code == "Cam" ) return TQString("Camelopardalis"); + if ( code == "Cnc" ) return TQString("Cancri"); + if ( code == "CVn" ) return TQString("Canum Venaticorum"); + if ( code == "CMa" ) return TQString("Canis Majoris"); + if ( code == "CMi" ) return TQString("Canis Minoris"); + if ( code == "Cap" ) return TQString("Capricorni"); + if ( code == "Car" ) return TQString("Carinae"); + if ( code == "Cas" ) return TQString("Cassiopeiae"); + if ( code == "Cen" ) return TQString("Centauri"); + if ( code == "Cep" ) return TQString("Cephei"); + if ( code == "Cet" ) return TQString("Ceti"); + if ( code == "Cha" ) return TQString("Chamaeleontis"); + if ( code == "Cir" ) return TQString("Circini"); + if ( code == "Col" ) return TQString("Columbae"); + if ( code == "Com" ) return TQString("Comae Berenices"); + if ( code == "CrA" ) return TQString("Coronae Austrinae"); + if ( code == "CrB" ) return TQString("Coronae Borealis"); + if ( code == "Crv" ) return TQString("Corvi"); + if ( code == "Crt" ) return TQString("Crateris"); + if ( code == "Cru" ) return TQString("Crucis"); + if ( code == "Cyg" ) return TQString("Cygni"); + if ( code == "Del" ) return TQString("Delphini"); + if ( code == "Dor" ) return TQString("Doradus"); + if ( code == "Dra" ) return TQString("Draconis"); + if ( code == "Equ" ) return TQString("Equulei"); + if ( code == "Eri" ) return TQString("Eridani"); + if ( code == "For" ) return TQString("Fornacis"); + if ( code == "Gem" ) return TQString("Geminorum"); + if ( code == "Gru" ) return TQString("Gruis"); + if ( code == "Her" ) return TQString("Herculis"); + if ( code == "Hor" ) return TQString("Horologii"); + if ( code == "Hya" ) return TQString("Hydrae"); + if ( code == "Hyi" ) return TQString("Hydri"); + if ( code == "Ind" ) return TQString("Indi"); + if ( code == "Lac" ) return TQString("Lacertae"); + if ( code == "Leo" ) return TQString("Leonis"); + if ( code == "LMi" ) return TQString("Leonis Minoris"); + if ( code == "Lep" ) return TQString("Leporis"); + if ( code == "Lib" ) return TQString("Librae"); + if ( code == "Lup" ) return TQString("Lupi"); + if ( code == "Lyn" ) return TQString("Lyncis"); + if ( code == "Lyr" ) return TQString("Lyrae"); + if ( code == "Men" ) return TQString("Mensae"); + if ( code == "Mic" ) return TQString("Microscopii"); + if ( code == "Mon" ) return TQString("Monocerotis"); + if ( code == "Mus" ) return TQString("Muscae"); + if ( code == "Nor" ) return TQString("Normae"); + if ( code == "Oct" ) return TQString("Octantis"); + if ( code == "Oph" ) return TQString("Ophiuchi"); + if ( code == "Ori" ) return TQString("Orionis"); + if ( code == "Pav" ) return TQString("Pavonis"); + if ( code == "Peg" ) return TQString("Pegasi"); + if ( code == "Per" ) return TQString("Persei"); + if ( code == "Phe" ) return TQString("Phoenicis"); + if ( code == "Pic" ) return TQString("Pictoris"); + if ( code == "Psc" ) return TQString("Piscium"); + if ( code == "PsA" ) return TQString("Piscis Austrini"); + if ( code == "Pup" ) return TQString("Puppis"); + if ( code == "Pyx" ) return TQString("Pyxidis"); + if ( code == "Ret" ) return TQString("Reticuli"); + if ( code == "Sge" ) return TQString("Sagittae"); + if ( code == "Sgr" ) return TQString("Sagittarii"); + if ( code == "Sco" ) return TQString("Scorpii"); + if ( code == "Scl" ) return TQString("Sculptoris"); + if ( code == "Sct" ) return TQString("Scuti"); + if ( code == "Ser" ) return TQString("Serpentis"); + if ( code == "Sex" ) return TQString("Sextantis"); + if ( code == "Tau" ) return TQString("Tauri"); + if ( code == "Tel" ) return TQString("Telescopii"); + if ( code == "Tri" ) return TQString("Trianguli"); + if ( code == "TrA" ) return TQString("Trianguli Australis"); + if ( code == "Tuc" ) return TQString("Tucanae"); + if ( code == "UMa" ) return TQString("Ursae Majoris"); + if ( code == "UMi" ) return TQString("Ursae Minoris"); + if ( code == "Vel" ) return TQString("Velorum"); + if ( code == "Vir" ) return TQString("Virginis"); + if ( code == "Vol" ) return TQString("Volantis"); + if ( code == "Vul" ) return TQString("Vulpeculae"); - return QString(""); + return TQString(""); } -void StarObject::draw( QPainter &psky, QPixmap *sky, QPixmap *starpix, int x, int y, bool /*showMultiple*/, double /*scale*/ ) { +void StarObject::draw( TQPainter &psky, TQPixmap *sky, TQPixmap *starpix, int x, int y, bool /*showMultiple*/, double /*scale*/ ) { //Indicate multiple stars with a short horizontal line //(only draw this for stars larger than 3 pixels) //Commenting out for now... @@ -233,23 +233,23 @@ void StarObject::draw( QPainter &psky, QPixmap *sky, QPixmap *starpix, int x, in //Only bitBlt() if we are drawing to the sky pixmap if ( psky.device() == sky ) - bitBlt ((QPaintDevice *) sky, x - starpix->width()/2, y - starpix->height()/2, starpix ); + bitBlt ((TQPaintDevice *) sky, x - starpix->width()/2, y - starpix->height()/2, starpix ); else psky.drawPixmap( x - starpix->width()/2, y - starpix->height()/2, *starpix ); } -void StarObject::drawLabel( QPainter &psky, int x, int y, double zoom, bool drawName, bool drawMag, double scale ) { - QString sName( i18n("star") + " " ); +void StarObject::drawLabel( TQPainter &psky, int x, int y, double zoom, bool drawName, bool drawMag, double scale ) { + TQString sName( i18n("star") + " " ); if ( drawName ) { if ( name() != "star" ) sName = translatedName() + " "; else if ( longname() != "star" ) sName = translatedLongName() + " "; } if ( drawMag ) { if ( drawName ) - sName += QString().sprintf("%.1f", mag() ); + sName += TQString().sprintf("%.1f", mag() ); else - sName = QString().sprintf("%.1f", mag() ); + sName = TQString().sprintf("%.1f", mag() ); } int offset = int( scale * (6 + int(0.5*(5.0-mag())) + int(0.01*( zoom/500. )) )); diff --git a/kstars/kstars/starobject.h b/kstars/kstars/starobject.h index 7143ee03..f4ca1bd9 100644 --- a/kstars/kstars/starobject.h +++ b/kstars/kstars/starobject.h @@ -18,7 +18,7 @@ #ifndef STAROBJECT_H #define STAROBJECT_H -#include +#include #include "skyobject.h" @@ -59,8 +59,8 @@ class StarObject : public SkyObject { *@param mult Multiplicity flag (false=dingle star; true=multiple star) *@param var Variability flag (true if star is a known periodic variable) */ - StarObject( dms r=dms(0.0), dms d=dms(0.0), float m=0.0, QString n="", - QString n2="", QString sptype="--", double pmra=0.0, double pmdec=0.0, + StarObject( dms r=dms(0.0), dms d=dms(0.0), float m=0.0, TQString n="", + TQString n2="", TQString sptype="--", double pmra=0.0, double pmdec=0.0, double par=0.0, bool mult=false, bool var=false ); /** *Constructor. Sets sky coordinates, magnitude, latin name, genetive name, and @@ -77,8 +77,8 @@ class StarObject : public SkyObject { *@param mult Multiplicity flag (false=dingle star; true=multiple star) *@param var Variability flag (true if star is a known periodic variable) */ - StarObject( double r, double d, float m=0.0, QString n="", - QString n2="", QString sptype="--", double pmra=0.0, double pmdec=0.0, + StarObject( double r, double d, float m=0.0, TQString n="", + TQString n2="", TQString sptype="--", double pmra=0.0, double pmdec=0.0, double par=0.0, bool mult=false, bool var=false ); /** @@ -89,41 +89,41 @@ class StarObject : public SkyObject { /** *If star is unnamed return "star" otherwise return the name */ - virtual QString name( void ) const { return hasName() ? *Name : starString;} + virtual TQString name( void ) const { return hasName() ? *Name : starString;} /** *If star is unnamed return "star" otherwise return the longname */ - virtual QString longname( void ) const { return hasLongName() ? *LongName : starString; } + virtual TQString longname( void ) const { return hasLongName() ? *LongName : starString; } /** *Returns first character of Spectral Type string, which is used to *select the temperature-color of the star. *@return first character of Spectral Type string */ - QChar color( void ) const { return SpType.at(0); } + TQChar color( void ) const { return SpType.at(0); } /** *Returns entire spectral type string *@return Spectral Type string */ - QString sptype( void ) const; + TQString sptype( void ) const; /** *Returns the genetive name of the star. *@return genetive name of the star */ - QString gname( bool useGreekChars=true ) const; + TQString gname( bool useGreekChars=true ) const; /** *Returns the greek letter portion of the star's genetive name. *Returns empty string if star has no genetive name defined. *@return greek letter portion of genetive name */ - QString greekLetter( bool useGreekChars=true ) const; + TQString greekLetter( bool useGreekChars=true ) const; /**@return the genitive form of the star's constellation. */ - QString constell( void ) const; + TQString constell( void ) const; /**Determine the current coordinates (RA, Dec) from the catalog *coordinates (RA0, Dec0), accounting for both precession and nutation. @@ -198,20 +198,20 @@ class StarObject : public SkyObject { // */ // double vperiod() const { return VPeriod; } - void draw( QPainter &psky, QPixmap *sky, QPixmap *starpix, int x, int y, bool drawMultiple=true, double scale=1.0 ); + void draw( TQPainter &psky, TQPixmap *sky, TQPixmap *starpix, int x, int y, bool drawMultiple=true, double scale=1.0 ); //overloaded from SkyObject - void drawLabel( QPainter &psky, int x, int y, double zoom, bool drawName, bool drawMag, double scale ); + void drawLabel( TQPainter &psky, int x, int y, double zoom, bool drawName, bool drawMag, double scale ); /**Show star object popup menu. Overloaded from virtual *SkyObject::showPopupMenu() *@param pmenu pointer to the KSPopupMenu object *@param pos QPojnt holding the x,y coordinates for the menu */ - virtual void showPopupMenu( KSPopupMenu *pmenu, QPoint pos ) { pmenu->createStarMenu( this ); pmenu->popup( pos ); } + virtual void showPopupMenu( KSPopupMenu *pmenu, TQPoint pos ) { pmenu->createStarMenu( this ); pmenu->popup( pos ); } private: - QString SpType; + TQString SpType; double PM_RA, PM_Dec, Parallax; //, VRange, VPeriod; bool Multiplicity, Variability; diff --git a/kstars/kstars/starpixmap.cpp b/kstars/kstars/starpixmap.cpp index 1c1e9269..59e21fe5 100644 --- a/kstars/kstars/starpixmap.cpp +++ b/kstars/kstars/starpixmap.cpp @@ -19,9 +19,9 @@ #include "starpixmap.h" #include -#include -#include -#include +#include +#include +#include #define STARSIZE 24 @@ -31,7 +31,7 @@ StarPixmap::StarPixmap (int starColorMode, int starColorIntensity) loadPixmaps (starColorMode, starColorIntensity); } -QPixmap* StarPixmap::getPixmap (QChar *color, int size) { +TQPixmap* StarPixmap::getPixmap (TQChar *color, int size) { int c; // the colors from blue to red +, O, B, A, F, G, K, M, N, P // if *color is '+' use white star @@ -68,22 +68,22 @@ void StarPixmap::loadPixmaps (int newColorMode, int newColorIntensity) { if (colorIntensity < 0) colorIntensity = 0; // min - QPixmap pix (STARSIZE, STARSIZE); - QBitmap mask (STARSIZE, STARSIZE); - QImage image; - QPainter p; - QMemArray starColor; + TQPixmap pix (STARSIZE, STARSIZE); + TQBitmap mask (STARSIZE, STARSIZE); + TQImage image; + TQPainter p; + TQMemArray starColor; starColor.resize( 8 ); image.setAlphaBuffer(true); - starColor[0] = QColor( 255, 255, 255 ); //default to white - starColor[1] = QColor( 0, 0, 255 ); //type O - starColor[2] = QColor( 0, 200, 255 ); //type B - starColor[3] = QColor( 0, 255, 255 ); //type A - starColor[4] = QColor( 200, 255, 100 ); //type F - starColor[5] = QColor( 255, 255, 0 ); //type G - starColor[6] = QColor( 255, 100, 0 ); //type K - starColor[7] = QColor( 255, 0, 0 ); //type M + starColor[0] = TQColor( 255, 255, 255 ); //default to white + starColor[1] = TQColor( 0, 0, 255 ); //type O + starColor[2] = TQColor( 0, 200, 255 ); //type B + starColor[3] = TQColor( 0, 255, 255 ); //type A + starColor[4] = TQColor( 200, 255, 100 ); //type F + starColor[5] = TQColor( 255, 255, 0 ); //type G + starColor[6] = TQColor( 255, 100, 0 ); //type K + starColor[7] = TQColor( 255, 0, 0 ); //type M // background of the star if ( colorMode==1 ) // night colors (fill red, no temperature colors) @@ -99,7 +99,7 @@ void StarPixmap::loadPixmaps (int newColorMode, int newColorIntensity) { if (colorMode==0) { p.begin (&pix); - p.setPen (QPen (starColor[ic], colorIntensity)); // the intensity of color determines the width of the pen + p.setPen (TQPen (starColor[ic], colorIntensity)); // the intensity of color determines the width of the pen p.drawEllipse (0, 0, STARSIZE, STARSIZE); p.end(); } @@ -107,14 +107,14 @@ void StarPixmap::loadPixmaps (int newColorMode, int newColorIntensity) { mask.fill (Qt::color0); p.begin (&mask); - p.setPen (QPen ( Qt::color1, 1)); - p.setBrush( QBrush( Qt::color1 ) ); + p.setPen (TQPen ( Qt::color1, 1)); + p.setBrush( TQBrush( Qt::color1 ) ); p.drawEllipse(0, 0, STARSIZE, STARSIZE); p.end(); //BLUR!! ugliness-- requires temporary conversion to pixmap, then back again. // if we defer the blur until the end, we lose the transparency. Bleh. - QImage tmp = pix.convertToImage(); + TQImage tmp = pix.convertToImage(); pix.convertFromImage( KImageEffect::blur( tmp, 100.0 ) ); pix.setMask (mask); // set the mask diff --git a/kstars/kstars/starpixmap.h b/kstars/kstars/starpixmap.h index e37bb18e..70b64679 100644 --- a/kstars/kstars/starpixmap.h +++ b/kstars/kstars/starpixmap.h @@ -18,13 +18,13 @@ #ifndef STARPIXMAP_H #define STARPIXMAP_H -#include +#include /**@class StarPixmap *Stores a two-dimensional array of star images, indexed by both size and color. *Based on a star's spectral type, brightness, and the current zoom level, the appropriate *image is selected from the array in the SkyMap::drawSymbol() function. - *A two-dimensional array of QPixmap star images + *A two-dimensional array of TQPixmap star images *@author Thomas Kabelmann *@version 1.0 */ @@ -45,7 +45,7 @@ class StarPixmap { *@param color the spectral type (one of O,B,A,F,G,K,M,N,P) *@param s the size index */ - QPixmap* getPixmap (QChar *color, int s); + TQPixmap* getPixmap (TQChar *color, int s); /**Change the Color mode. Regenerate the star image array. *@param newMode the new Color Mode to use. @@ -65,7 +65,7 @@ class StarPixmap { private: - QPixmap starPixmaps[10][26]; // the preloaded starpixmaps 10 colors/ 24 sizes + TQPixmap starPixmaps[10][26]; // the preloaded starpixmaps 10 colors/ 24 sizes int size, colorMode, colorIntensity; /**Construct the array of star images*/ diff --git a/kstars/kstars/streamwg.cpp b/kstars/kstars/streamwg.cpp index a78013f2..80998c07 100644 --- a/kstars/kstars/streamwg.cpp +++ b/kstars/kstars/streamwg.cpp @@ -24,12 +24,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -40,7 +40,7 @@ FILE *wfp; - StreamWG::StreamWG(INDIStdDevice *inStdDev, QWidget * parent, const char * name) : streamForm(parent, name) + StreamWG::StreamWG(INDIStdDevice *inStdDev, TQWidget * parent, const char * name) : streamForm(parent, name) { stdDev = inStdDev; @@ -49,7 +49,7 @@ FILE *wfp; // streamFD = -1; processStream = colorFrame = false; - //videoFrameLayout = new QVBoxLayout(videoFrame, 0, 0); + //videoFrameLayout = new TQVBoxLayout(videoFrame, 0, 0); streamFrame = new VideoWG(videoFrame); KIconLoader *icons = KGlobal::iconLoader(); @@ -61,10 +61,10 @@ FILE *wfp; playB->setPixmap(pausePix); captureB->setPixmap(capturePix); - imgFormatCombo->insertStrList(QImage::outputFormats()); + imgFormatCombo->insertStrList(TQImage::outputFormats()); - connect(playB, SIGNAL(clicked()), this, SLOT(playPressed())); - connect(captureB, SIGNAL(clicked()), this, SLOT(captureImage())); + connect(playB, TQT_SIGNAL(clicked()), this, TQT_SLOT(playPressed())); + connect(captureB, TQT_SIGNAL(clicked()), this, TQT_SLOT(captureImage())); } @@ -73,7 +73,7 @@ StreamWG::~StreamWG() // delete streamBuffer; } -void StreamWG::closeEvent ( QCloseEvent * e ) +void StreamWG::closeEvent ( TQCloseEvent * e ) { stdDev->streamDisabled(); processStream = false; @@ -85,12 +85,12 @@ void StreamWG::setColorFrame(bool color) colorFrame = color; } -/*void StreamWG::establishDataChannel(QString host, int port) +/*void StreamWG::establishDataChannel(TQString host, int port) { - QString errMsg; + TQString errMsg; struct sockaddr_in pin; struct hostent *serverHostName = gethostbyname(host.ascii()); - errMsg = QString("Connection to INDI host at %1 on port %2 failed.").arg(host).arg(port); + errMsg = TQString("Connection to INDI host at %1 on port %2 failed.").arg(host).arg(port); memset(&pin, 0, sizeof(pin)); pin.sin_family = AF_INET; @@ -111,8 +111,8 @@ void StreamWG::setColorFrame(bool color) } // callback notified - sNotifier = new QSocketNotifier( streamFD, QSocketNotifier::Read, this); - QObject::connect( sNotifier, SIGNAL(activated(int)), this, SLOT(streamReceived())); + sNotifier = new TQSocketNotifier( streamFD, TQSocketNotifier::Read, this); + TQObject::connect( sNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(streamReceived())); }*/ void StreamWG::enableStream(bool enable) @@ -142,7 +142,7 @@ void StreamWG::setSize(int wd, int ht) streamFrame->resize(wd, ht); } -void StreamWG::resizeEvent(QResizeEvent *ev) +void StreamWG::resizeEvent(TQResizeEvent *ev) { streamFrame->resize(ev->size().width() - layout()->margin() * 2, ev->size().height() - playB->height() - layout()->margin() * 2 - layout()->spacing()); @@ -186,7 +186,7 @@ void StreamWG::streamReceived() stdDev->sNotifier->disconnect(); close(stdDev->streamFD); - KMessageBox::error(0, QString(msg)); + KMessageBox::error(0, TQString(msg)); return; } } @@ -216,10 +216,10 @@ void StreamWG::playPressed() void StreamWG::captureImage() { - QString fname; - QString fmt; + TQString fname; + TQString fmt; KURL currentFileURL; - QString currentDir = Options::fitsSaveDirectory(); + TQString currentDir = Options::fitsSaveDirectory(); KTempFile tmpfile; tmpfile.setAutoDelete(true); @@ -252,23 +252,23 @@ void StreamWG::captureImage() if ( tmpfile.name() == fname ) { //need to upload to remote location - if ( ! KIO::NetAccess::upload( tmpfile.name(), currentFileURL, (QWidget*) 0 ) ) + if ( ! KIO::NetAccess::upload( tmpfile.name(), currentFileURL, (TQWidget*) 0 ) ) { - QString message = i18n( "Could not upload image to remote location: %1" ).arg( currentFileURL.prettyURL() ); + TQString message = i18n( "Could not upload image to remote location: %1" ).arg( currentFileURL.prettyURL() ); KMessageBox::sorry( 0, message, i18n( "Could not upload file" ) ); } } } else { - QString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); + TQString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); KMessageBox::sorry( 0, message, i18n( "Invalid URL" ) ); } } -VideoWG::VideoWG(QWidget * parent, const char * name) : QFrame(parent, name, Qt::WNoAutoErase) +VideoWG::VideoWG(TQWidget * parent, const char * name) : TQFrame(parent, name, Qt::WNoAutoErase) { streamImage = NULL; grayTable=new QRgb[256]; @@ -289,16 +289,16 @@ void VideoWG::newFrame(unsigned char *buffer, int buffSiz, int w, int h) //if (color) if (buffSiz > totalBaseCount) - streamImage = new QImage(buffer, w, h, 32, 0, 0, QImage::BigEndian); + streamImage = new TQImage(buffer, w, h, 32, 0, 0, TQImage::BigEndian); else - streamImage = new QImage(buffer, w, h, 8, grayTable, 256, QImage::IgnoreEndian); + streamImage = new TQImage(buffer, w, h, 8, grayTable, 256, TQImage::IgnoreEndian); update(); } -void VideoWG::paintEvent(QPaintEvent */*ev*/) +void VideoWG::paintEvent(TQPaintEvent */*ev*/) { if (streamImage) diff --git a/kstars/kstars/streamwg.h b/kstars/kstars/streamwg.h index 27d24fc7..7fa14988 100644 --- a/kstars/kstars/streamwg.h +++ b/kstars/kstars/streamwg.h @@ -12,11 +12,11 @@ #ifndef STREAMWG_H #define STREAMWG_H - #include + #include #include #include "streamformui.h" - #include "qframe.h" + #include "tqframe.h" class QImage; @@ -31,7 +31,7 @@ Q_OBJECT public: - StreamWG(INDIStdDevice *inStdDev, QWidget * parent =0, const char * name =0); + StreamWG(INDIStdDevice *inStdDev, TQWidget * parent =0, const char * name =0); ~StreamWG(); friend class VideoWG; @@ -48,12 +48,12 @@ private: INDIStdDevice *stdDev; - QPixmap playPix, pausePix, capturePix; - QVBoxLayout *videoFrameLayout; + TQPixmap playPix, pausePix, capturePix; + TQVBoxLayout *videoFrameLayout; protected: - void closeEvent ( QCloseEvent * e ); - void resizeEvent(QResizeEvent *ev); + void closeEvent ( TQCloseEvent * e ); + void resizeEvent(TQResizeEvent *ev); public slots: @@ -68,7 +68,7 @@ Q_OBJECT public: - VideoWG(QWidget * parent =0, const char * name =0); + VideoWG(TQWidget * parent =0, const char * name =0); ~VideoWG(); friend class StreamWG; @@ -83,7 +83,7 @@ KPixmapIO kPixIO; protected: - void paintEvent(QPaintEvent *ev); + void paintEvent(TQPaintEvent *ev); }; diff --git a/kstars/kstars/telescopeprop.cpp b/kstars/kstars/telescopeprop.cpp index 2e260941..b2f17009 100644 --- a/kstars/kstars/telescopeprop.cpp +++ b/kstars/kstars/telescopeprop.cpp @@ -29,7 +29,7 @@ #include "indimenu.h" #include "indidriver.h" -telescopeProp::telescopeProp(QWidget* parent, const char* name, bool modal, WFlags fl) +telescopeProp::telescopeProp(TQWidget* parent, const char* name, bool modal, WFlags fl) : scopeProp(parent,name, modal,fl) { @@ -39,11 +39,11 @@ telescopeProp::telescopeProp(QWidget* parent, const char* name, bool modal, WFla indi_driver = ksw->getINDIDriver(); newScopePending = false; - connect (newB, SIGNAL(clicked()), this, SLOT(newScope())); - connect (saveB, SIGNAL(clicked()), this, SLOT(saveScope())); - connect (removeB, SIGNAL(clicked()), this, SLOT(removeScope())); - connect (telescopeListBox, SIGNAL(highlighted(int)),this, SLOT(updateScopeDetails(int))); - connect(closeB, SIGNAL(clicked()), this, SLOT(close())); + connect (newB, TQT_SIGNAL(clicked()), this, TQT_SLOT(newScope())); + connect (saveB, TQT_SIGNAL(clicked()), this, TQT_SLOT(saveScope())); + connect (removeB, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeScope())); + connect (telescopeListBox, TQT_SIGNAL(highlighted(int)),this, TQT_SLOT(updateScopeDetails(int))); + connect(closeB, TQT_SIGNAL(clicked()), this, TQT_SLOT(close())); // Fill the combo box with drivers driverCombo->insertStringList(indi_driver->driversList); @@ -213,10 +213,10 @@ void telescopeProp::updateScopeDetails(int index) versionEdit->setText(indi_driver->devices[finalIndex]->version); if (indi_driver->devices[finalIndex]->focal_length != -1) - focalEdit->setText(QString("%1").arg(indi_driver->devices[finalIndex]->focal_length)); + focalEdit->setText(TQString("%1").arg(indi_driver->devices[finalIndex]->focal_length)); if (indi_driver->devices[finalIndex]->aperture != -1) - apertureEdit->setText(QString("%1").arg(indi_driver->devices[finalIndex]->aperture)); + apertureEdit->setText(TQString("%1").arg(indi_driver->devices[finalIndex]->aperture)); } diff --git a/kstars/kstars/telescopeprop.h b/kstars/kstars/telescopeprop.h index ce7347f9..3c036bdc 100644 --- a/kstars/kstars/telescopeprop.h +++ b/kstars/kstars/telescopeprop.h @@ -28,7 +28,7 @@ class telescopeProp : public scopeProp Q_OBJECT public: - telescopeProp(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + telescopeProp(TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~telescopeProp(); /*$PUBLIC_FUNCTIONS$*/ diff --git a/kstars/kstars/telescopewizardprocess.cpp b/kstars/kstars/telescopewizardprocess.cpp index cffb2cf4..664a4749 100644 --- a/kstars/kstars/telescopewizardprocess.cpp +++ b/kstars/kstars/telescopewizardprocess.cpp @@ -7,16 +7,16 @@ version 2 of the License, or (at your option) any later version. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -40,7 +40,7 @@ #define TIMEOUT_THRESHHOLD 20 -telescopeWizardProcess::telescopeWizardProcess( QWidget* parent, const char* name ) : telescopeWizard(parent, name) +telescopeWizardProcess::telescopeWizardProcess( TQWidget* parent, const char* name ) : telescopeWizard(parent, name) { currentPort = -1; timeOutCount = 0; @@ -48,11 +48,11 @@ telescopeWizardProcess::telescopeWizardProcess( QWidget* parent, const char* nam progressScan = NULL; linkRejected = false; - QString locStr; - QFile sideIMG; + TQString locStr; + TQFile sideIMG; if (KSUtils::openDataFile(sideIMG, "wizardside.png")) - wizardPix->setPixmap(QPixmap(sideIMG.name())); + wizardPix->setPixmap(TQPixmap(sideIMG.name())); backB->hide(); currentPage = INTRO_P; @@ -67,16 +67,16 @@ telescopeWizardProcess::telescopeWizardProcess( QWidget* parent, const char* nam INDIMessageBar = Options::indiMessages(); Options::setIndiMessages( false ); - QTime newTime( ksw->data()->lt().time() ); + TQTime newTime( ksw->data()->lt().time() ); ExtDate newDate( ksw->data()->lt().date() ); - timeOut->setText( QString().sprintf("%02d:%02d:%02d", newTime.hour(), newTime.minute(), newTime.second())); - dateOut->setText( QString().sprintf("%d-%02d-%02d", newDate.year(), newDate.month(), newDate.day())); + timeOut->setText( TQString().sprintf("%02d:%02d:%02d", newTime.hour(), newTime.minute(), newTime.second())); + dateOut->setText( TQString().sprintf("%d-%02d-%02d", newDate.year(), newDate.month(), newDate.day())); if (ksw->geo()->translatedProvince().isEmpty()) - locationOut->setText( QString("%1, %2").arg(ksw->geo()->translatedName()).arg(ksw->geo()->translatedCountry())); + locationOut->setText( TQString("%1, %2").arg(ksw->geo()->translatedName()).arg(ksw->geo()->translatedCountry())); else - locationOut->setText( QString("%1, %2, %3").arg(ksw->geo()->translatedName()) + locationOut->setText( TQString("%1, %2, %3").arg(ksw->geo()->translatedName()) .arg(ksw->geo()->translatedProvince()) .arg(ksw->geo()->translatedCountry())); @@ -91,14 +91,14 @@ telescopeWizardProcess::telescopeWizardProcess( QWidget* parent, const char* nam portList << "/dev/ttyS0" << "/dev/ttyS1" << "/dev/ttyS2" << "/dev/ttyS3" << "/dev/ttyS4" << "/dev/ttyUSB0" << "/dev/ttyUSB1" << "/dev/ttyUSB2" << "/dev/ttyUSB3";// << "/dev/ttyUSB4"; - connect(helpB, SIGNAL(clicked()), parent, SLOT(appHelpActivated())); - connect(nextB, SIGNAL(clicked()), this, SLOT(processNext())); - connect(backB, SIGNAL(clicked()), this, SLOT(processBack())); - connect(setTimeB, SIGNAL(clicked()), this, SLOT(newTime())); - connect(setLocationB, SIGNAL(clicked()), this, SLOT(newLocation())); + connect(helpB, TQT_SIGNAL(clicked()), parent, TQT_SLOT(appHelpActivated())); + connect(nextB, TQT_SIGNAL(clicked()), this, TQT_SLOT(processNext())); + connect(backB, TQT_SIGNAL(clicked()), this, TQT_SLOT(processBack())); + connect(setTimeB, TQT_SIGNAL(clicked()), this, TQT_SLOT(newTime())); + connect(setLocationB, TQT_SIGNAL(clicked()), this, TQT_SLOT(newLocation())); - newDeviceTimer = new QTimer(this); - QObject::connect( newDeviceTimer, SIGNAL(timeout()), this, SLOT(processPort()) ); + newDeviceTimer = new TQTimer(this); + TQObject::connect( newDeviceTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(processPort()) ); } @@ -196,13 +196,13 @@ void telescopeWizardProcess::newTime() { TimeDialog timedialog (ksw->data()->lt(), ksw); - if ( timedialog.exec() == QDialog::Accepted ) + if ( timedialog.exec() == TQDialog::Accepted ) { KStarsDateTime dt( timedialog.selectedDate(), timedialog.selectedTime() ); ksw->data()->changeDateTime( dt ); - timeOut->setText( QString().sprintf("%02d:%02d:%02d", dt.time().hour(), dt.time().minute(), dt.time().second())); - dateOut->setText( QString().sprintf("%d-%02d-%02d", dt.date().year(), dt.date().month(), dt.date().day())); + timeOut->setText( TQString().sprintf("%02d:%02d:%02d", dt.time().hour(), dt.time().minute(), dt.time().second())); + dateOut->setText( TQString().sprintf("%d-%02d-%02d", dt.date().year(), dt.date().month(), dt.date().day())); } } @@ -211,12 +211,12 @@ void telescopeWizardProcess::newLocation() ksw->slotGeoLocator(); - locationOut->setText( QString("%1, %2, %3").arg(ksw->geo()->translatedName()) + locationOut->setText( TQString("%1, %2, %3").arg(ksw->geo()->translatedName()) .arg(ksw->geo()->translatedProvince()) .arg(ksw->geo()->translatedCountry())); - timeOut->setText( QString().sprintf("%02d:%02d:%02d", ksw->data()->lt().time().hour(), ksw->data()->lt().time().minute(), ksw->data()->lt().time().second())); + timeOut->setText( TQString().sprintf("%02d:%02d:%02d", ksw->data()->lt().time().hour(), ksw->data()->lt().time().minute(), ksw->data()->lt().time().second())); - dateOut->setText( QString().sprintf("%d-%02d-%02d", ksw->data()->lt().date().year(), + dateOut->setText( TQString().sprintf("%d-%02d-%02d", ksw->data()->lt().date().year(), ksw->data()->lt().date().month() ,ksw->data()->lt().date().day())); @@ -229,7 +229,7 @@ int telescopeWizardProcess::establishLink() if (!indidriver || !indimenu) return (0); - QListViewItem *driverItem = NULL; + TQListViewItem *driverItem = NULL; driverItem = indidriver->localListView->findItem(telescopeCombo->currentText(), 0); if (driverItem == NULL) return -1; @@ -289,8 +289,8 @@ void telescopeWizardProcess::processPort() { newDeviceTimer->stop(); linkRejected = false; - connect(indiDev->stdDev, SIGNAL(linkRejected()), this, SLOT(scanPorts())); - connect(indiDev->stdDev, SIGNAL(linkAccepted()), this, SLOT(linkSuccess())); + connect(indiDev->stdDev, TQT_SIGNAL(linkRejected()), this, TQT_SLOT(scanPorts())); + connect(indiDev->stdDev, TQT_SIGNAL(linkAccepted()), this, TQT_SLOT(linkSuccess())); scanPorts(); return; } diff --git a/kstars/kstars/telescopewizardprocess.h b/kstars/kstars/telescopewizardprocess.h index 2fc5b911..3f19523f 100644 --- a/kstars/kstars/telescopewizardprocess.h +++ b/kstars/kstars/telescopewizardprocess.h @@ -10,7 +10,7 @@ #ifndef TELESCOPEWIZARDPROCESS_H #define TELESCOPEWIZARDPROCESS_H -#include +#include #include "telescopewizard.h" @@ -28,7 +28,7 @@ class telescopeWizardProcess : public telescopeWizard Q_OBJECT public: - telescopeWizardProcess( QWidget* parent = 0, const char* name = 0); + telescopeWizardProcess( TQWidget* parent = 0, const char* name = 0); ~telescopeWizardProcess(); unsigned int currentPage; @@ -38,14 +38,14 @@ private: KStars * ksw; INDIMenu *indimenu; INDIDriver *indidriver; - QTimer *newDeviceTimer; + TQTimer *newDeviceTimer; INDI_D *indiDev; KProgressDialog *progressScan; - QStringList portList; - QString currentDevice; + TQStringList portList; + TQString currentDevice; int currentPort; int timeOutCount; diff --git a/kstars/kstars/thumbnaileditor.cpp b/kstars/kstars/thumbnaileditor.cpp index 5a34d8c8..5e2301eb 100644 --- a/kstars/kstars/thumbnaileditor.cpp +++ b/kstars/kstars/thumbnaileditor.cpp @@ -15,11 +15,11 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -29,13 +29,13 @@ #include "thumbnaileditorui.h" #include "thumbnailpicker.h" -ThumbnailEditor::ThumbnailEditor( QWidget *parent, const char *name ) +ThumbnailEditor::ThumbnailEditor( TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Plain, i18n( "Edit Thumbnail Image" ), Ok|Cancel, Ok, parent, name ) { tp = (ThumbnailPicker*)parent; - QFrame *page = plainPage(); - QHBoxLayout *hlay = new QHBoxLayout( page, 0, 0 ); + TQFrame *page = plainPage(); + TQHBoxLayout *hlay = new TQHBoxLayout( page, 0, 0 ); ui = new ThumbnailEditorUI( page ); hlay->addWidget( ui ); @@ -43,7 +43,7 @@ ThumbnailEditor::ThumbnailEditor( QWidget *parent, const char *name ) tp->imageRect()->width(), tp->imageRect()->height() ); ui->ImageCanvas->setImage( tp->currentListImage() ); - connect( ui->ImageCanvas, SIGNAL(cropRegionModified()), SLOT( slotUpdateCropLabel() ) ); + connect( ui->ImageCanvas, TQT_SIGNAL(cropRegionModified()), TQT_SLOT( slotUpdateCropLabel() ) ); slotUpdateCropLabel(); update(); @@ -52,22 +52,22 @@ ThumbnailEditor::ThumbnailEditor( QWidget *parent, const char *name ) ThumbnailEditor::~ThumbnailEditor() {} -QPixmap ThumbnailEditor::thumbnail() { - QImage im = ui->ImageCanvas->croppedImage().convertToImage(); +TQPixmap ThumbnailEditor::thumbnail() { + TQImage im = ui->ImageCanvas->croppedImage().convertToImage(); im = im.smoothScale( 200, 200 ); - QPixmap pm; + TQPixmap pm; pm.convertFromImage( im ); return pm; } void ThumbnailEditor::slotUpdateCropLabel() { - QRect *r = ui->ImageCanvas->cropRect(); + TQRect *r = ui->ImageCanvas->cropRect(); ui->CropLabel->setText( i18n( "Crop region: [%1,%2 %3x%4]" ) .arg( r->left() ).arg( r->top() ).arg( r->width() ).arg( r->height() ) ); } -QPixmap ThumbImage::croppedImage() { - QPixmap result( CropRect->width(), CropRect->height() ); +TQPixmap ThumbImage::croppedImage() { + TQPixmap result( CropRect->width(), CropRect->height() ); bitBlt( &result, 0, 0, Image, CropRect->left(), CropRect->top(), CropRect->width(), CropRect->height() ); @@ -75,9 +75,9 @@ QPixmap ThumbImage::croppedImage() { return result; } -ThumbImage::ThumbImage( QWidget *parent, const char *name ) : QLabel( parent, name ) +ThumbImage::ThumbImage( TQWidget *parent, const char *name ) : TQLabel( parent, name ) { - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); bMouseButtonDown = false; bTopLeftGrab = false; bTopRightGrab = false; @@ -85,51 +85,51 @@ ThumbImage::ThumbImage( QWidget *parent, const char *name ) : QLabel( parent, na bBottomRightGrab = false; HandleSize = 10; - CropRect = new QRect(); - Anchor = new QPoint(); - Image = new QPixmap(); + CropRect = new TQRect(); + Anchor = new TQPoint(); + Image = new TQPixmap(); } ThumbImage::~ThumbImage() {} -void ThumbImage::paintEvent( QPaintEvent* ) { - QPixmap c( *Image ); - QPainter p; +void ThumbImage::paintEvent( TQPaintEvent* ) { + TQPixmap c( *Image ); + TQPainter p; p.begin( &c ); - p.setPen( QPen( QColor( "Grey" ), 2 ) ); + p.setPen( TQPen( TQColor( "Grey" ), 2 ) ); p.drawRect( *CropRect ); - p.setPen( QPen( QColor( "Grey" ), 0 ) ); - p.drawRect( QRect( CropRect->left(), CropRect->top(), + p.setPen( TQPen( TQColor( "Grey" ), 0 ) ); + p.drawRect( TQRect( CropRect->left(), CropRect->top(), HandleSize, HandleSize ) ); - p.drawRect( QRect( CropRect->right() - HandleSize, CropRect->top(), + p.drawRect( TQRect( CropRect->right() - HandleSize, CropRect->top(), HandleSize, HandleSize ) ); - p.drawRect( QRect( CropRect->left(), CropRect->bottom() - HandleSize, + p.drawRect( TQRect( CropRect->left(), CropRect->bottom() - HandleSize, HandleSize, HandleSize ) ); - p.drawRect( QRect( CropRect->right() - HandleSize, CropRect->bottom() - HandleSize, + p.drawRect( TQRect( CropRect->right() - HandleSize, CropRect->bottom() - HandleSize, HandleSize, HandleSize ) ); if ( CropRect->x() > 0 ) p.fillRect( 0, 0, CropRect->x(), c.height(), - QBrush( QColor("white"), Dense3Pattern ) ); + TQBrush( TQColor("white"), Dense3Pattern ) ); if ( CropRect->right() < c.width() ) p.fillRect( CropRect->right(), 0, (c.width() - CropRect->right()), c.height(), - QBrush( QColor("white"), Dense3Pattern ) ); + TQBrush( TQColor("white"), Dense3Pattern ) ); if ( CropRect->y() > 0 ) p.fillRect( 0, 0, c.width(), CropRect->y(), - QBrush( QColor("white"), Dense3Pattern ) ); + TQBrush( TQColor("white"), Dense3Pattern ) ); if ( CropRect->bottom() < c.height() ) p.fillRect( 0, CropRect->bottom(), c.width(), (c.height() - CropRect->bottom()), - QBrush( QColor("white"), Dense3Pattern ) ); + TQBrush( TQColor("white"), Dense3Pattern ) ); p.end(); bitBlt( this, 0, 0, &c ); } -void ThumbImage::mousePressEvent( QMouseEvent *e ) { +void ThumbImage::mousePressEvent( TQMouseEvent *e ) { if ( e->button() == LeftButton && CropRect->contains( e->pos() ) ) { bMouseButtonDown = true; @@ -156,7 +156,7 @@ void ThumbImage::mousePressEvent( QMouseEvent *e ) { } } -void ThumbImage::mouseReleaseEvent( QMouseEvent *e ) { +void ThumbImage::mouseReleaseEvent( TQMouseEvent *e ) { if ( bMouseButtonDown ) bMouseButtonDown = false; if ( bTopLeftGrab ) bTopLeftGrab = false; if ( bTopRightGrab ) bTopRightGrab = false; @@ -164,7 +164,7 @@ void ThumbImage::mouseReleaseEvent( QMouseEvent *e ) { if ( bBottomRightGrab ) bBottomRightGrab = false; } -void ThumbImage::mouseMoveEvent( QMouseEvent *e ) { +void ThumbImage::mouseMoveEvent( TQMouseEvent *e ) { if ( bMouseButtonDown ) { //If a corner was grabbed, we are resizing the box @@ -197,7 +197,7 @@ void ThumbImage::mouseMoveEvent( QMouseEvent *e ) { if ( CropRect->width() < 200 ) CropRect->setRight( CropRect->right() + 200 - CropRect->width() ); if ( CropRect->height() < 200 ) CropRect->setBottom( CropRect->bottom() + 200 - CropRect->height() ); } else { //no corner grabbed; move croprect - CropRect->moveTopLeft( QPoint( e->x() - Anchor->x(), e->y() - Anchor->y() ) ); + CropRect->moveTopLeft( TQPoint( e->x() - Anchor->x(), e->y() - Anchor->y() ) ); if ( CropRect->left() < 0 ) CropRect->moveLeft( 0 ); if ( CropRect->right() > width() ) CropRect->moveRight( width() ); if ( CropRect->top() < 0 ) CropRect->moveTop( 0 ); diff --git a/kstars/kstars/thumbnaileditor.h b/kstars/kstars/thumbnaileditor.h index d6da8d85..d7646bc0 100644 --- a/kstars/kstars/thumbnaileditor.h +++ b/kstars/kstars/thumbnaileditor.h @@ -19,7 +19,7 @@ #define THUMBNAILEDITOR_H #include -#include +#include class ThumbnailEditorUI; class ThumbnailPicker; @@ -29,30 +29,30 @@ class ThumbImage : public QLabel { Q_OBJECT public: - ThumbImage( QWidget *parent, const char *name = 0 ); + ThumbImage( TQWidget *parent, const char *name = 0 ); ~ThumbImage(); - void setImage( QPixmap *pm ) { Image = pm; setFixedSize( Image->width(), Image->height() ); } - QPixmap* image() { return Image; } - QPixmap croppedImage(); + void setImage( TQPixmap *pm ) { Image = pm; setFixedSize( Image->width(), Image->height() ); } + TQPixmap* image() { return Image; } + TQPixmap croppedImage(); void setCropRect( int x, int y, int w, int h ) { CropRect->setRect( x, y, w, h ); } - QRect* cropRect() const { return CropRect; } + TQRect* cropRect() const { return CropRect; } signals: void cropRegionModified(); protected: -// void resizeEvent( QResizeEvent *e); - void paintEvent( QPaintEvent *); - void mousePressEvent( QMouseEvent *e ); - void mouseReleaseEvent( QMouseEvent *e ); - void mouseMoveEvent( QMouseEvent *e ); +// void resizeEvent( TQResizeEvent *e); + void paintEvent( TQPaintEvent *); + void mousePressEvent( TQMouseEvent *e ); + void mouseReleaseEvent( TQMouseEvent *e ); + void mouseMoveEvent( TQMouseEvent *e ); private: - QRect *CropRect; - QPoint *Anchor; - QPixmap *Image; + TQRect *CropRect; + TQPoint *Anchor; + TQPixmap *Image; bool bMouseButtonDown; bool bTopLeftGrab, bBottomLeftGrab, bTopRightGrab, bBottomRightGrab; @@ -63,9 +63,9 @@ class ThumbnailEditor : public KDialogBase { Q_OBJECT public: - ThumbnailEditor( QWidget *parent, const char *name=0 ); + ThumbnailEditor( TQWidget *parent, const char *name=0 ); ~ThumbnailEditor(); - QPixmap thumbnail(); + TQPixmap thumbnail(); private slots: void slotUpdateCropLabel(); diff --git a/kstars/kstars/thumbnailpicker.cpp b/kstars/kstars/thumbnailpicker.cpp index ded0326f..c9460480 100644 --- a/kstars/kstars/thumbnailpicker.cpp +++ b/kstars/kstars/thumbnailpicker.cpp @@ -15,14 +15,14 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -43,15 +43,15 @@ #include "detaildialog.h" #include "skyobject.h" -ThumbnailPicker::ThumbnailPicker( SkyObject *o, const QPixmap ¤t, QWidget *parent, const char *name ) +ThumbnailPicker::ThumbnailPicker( SkyObject *o, const TQPixmap ¤t, TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Plain, i18n( "Choose Thumbnail Image" ), Ok|Cancel, Ok, parent, name ), SelectedImageIndex(-1), dd((DetailDialog*)parent), Object(o), bImageFound( false ) { - Image = new QPixmap( current ); - ImageRect = new QRect( 0, 0, 200, 200 ); + Image = new TQPixmap( current ); + ImageRect = new TQRect( 0, 0, 200, 200 ); - QFrame *page = plainPage(); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, 0 ); + TQFrame *page = plainPage(); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, 0 ); ui = new ThumbnailPickerUI( page ); vlay->addWidget( ui ); @@ -59,14 +59,14 @@ ThumbnailPicker::ThumbnailPicker( SkyObject *o, const QPixmap ¤t, QWidget PixList.setAutoDelete( true ); - connect( ui->EditButton, SIGNAL( clicked() ), this, SLOT( slotEditImage() ) ); - connect( ui->UnsetButton, SIGNAL( clicked() ), this, SLOT( slotUnsetImage() ) ); - connect( ui->ImageList, SIGNAL( highlighted( int ) ), - this, SLOT( slotSetFromList( int ) ) ); - connect( ui->ImageURLBox, SIGNAL( urlSelected( const QString& ) ), - this, SLOT( slotSetFromURL() ) ); - connect( ui->ImageURLBox, SIGNAL( returnPressed() ), - this, SLOT( slotSetFromURL() ) ); + connect( ui->EditButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotEditImage() ) ); + connect( ui->UnsetButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotUnsetImage() ) ); + connect( ui->ImageList, TQT_SIGNAL( highlighted( int ) ), + this, TQT_SLOT( slotSetFromList( int ) ) ); + connect( ui->ImageURLBox, TQT_SIGNAL( urlSelected( const TQString& ) ), + this, TQT_SLOT( slotSetFromURL() ) ); + connect( ui->ImageURLBox, TQT_SIGNAL( returnPressed() ), + this, TQT_SLOT( slotSetFromURL() ) ); ui->ImageURLBox->lineEdit()->setTrapReturnKey( true ); ui->EditButton->setEnabled( false ); @@ -80,14 +80,14 @@ ThumbnailPicker::~ThumbnailPicker() //Query online sources for images of the object void ThumbnailPicker::slotFillList() { //Preload list with object's ImageList: - QStringList ImageList( Object->ImageList ); + TQStringList ImageList( Object->ImageList ); //Query Google Image Search: KURL gURL( "http://images.google.com/images" ); //Search for the primary name, or longname and primary name - QString sName = QString("\"%1\"").arg( Object->name() ); + TQString sName = TQString("\"%1\"").arg( Object->name() ); if ( Object->longname() != Object->name() ) { - sName = QString("\"%1\" ").arg( Object->longname() ) + sName; + sName = TQString("\"%1\" ").arg( Object->longname() ) + sName; } gURL.addQueryItem( "q", sName ); //add the Google-image query string @@ -102,34 +102,34 @@ void ThumbnailPicker::slotFillList() { } //Add images from the ImageList - QStringList::Iterator itList = ImageList.begin(); - QStringList::Iterator itListEnd = ImageList.end(); + TQStringList::Iterator itList = ImageList.begin(); + TQStringList::Iterator itListEnd = ImageList.end(); for ( ; itList != itListEnd; ++itList ) { - QString s( *itList ); + TQString s( *itList ); KURL u( s ); if ( u.isValid() && KIO::NetAccess::exists(u, true, this) ) { KTempFile ktf; - QFile *tmpFile = ktf.file(); + TQFile *tmpFile = ktf.file(); ktf.unlink(); //just need filename JobList.append( KIO::copy( u, KURL( tmpFile->name() ), false ) ); //false = no progress window #if KDE_IS_VERSION( 3, 3, 90 ) ((KIO::CopyJob*)JobList.current())->setInteractive( false ); // suppress error dialogs #endif - connect (JobList.current(), SIGNAL (result(KIO::Job *)), SLOT (downloadReady (KIO::Job *))); + connect (JobList.current(), TQT_SIGNAL (result(KIO::Job *)), TQT_SLOT (downloadReady (KIO::Job *))); } } } -void ThumbnailPicker::parseGooglePage( QStringList &ImList, QString URL ) { - QString tmpFile; - QString PageHTML; +void ThumbnailPicker::parseGooglePage( TQStringList &ImList, TQString URL ) { + TQString tmpFile; + TQString PageHTML; - //Read the google image page's HTML into the PageHTML QString: + //Read the google image page's HTML into the PageHTML TQString: if ( KIO::NetAccess::exists(URL, true, this) && KIO::NetAccess::download( URL, tmpFile ) ) { - QFile file( tmpFile ); + TQFile file( tmpFile ); if ( file.open( IO_ReadOnly ) ) { - QTextStream instream(&file); + TQTextStream instream(&file); PageHTML = instream.read(); file.close(); } else { @@ -171,16 +171,16 @@ void ThumbnailPicker::downloadReady(KIO::Job *job) { } KIO::CopyJob *cjob = (KIO::CopyJob*)job; - QFile tmp( cjob->destURL().path() ); + TQFile tmp( cjob->destURL().path() ); tmp.close(); // to get the newest information of the file //Add image to list //If image is taller than desktop, rescale it. - //I tried to use kapp->style().pixelMetric( QStyle::PM_TitleBarHeight ) + //I tried to use kapp->style().pixelMetric( TQStyle::PM_TitleBarHeight ) //for the titlebar height, but this returned zero. //Hard-coding 25 instead :( if ( tmp.exists() ) { - QImage im( tmp.name() ); + TQImage im( tmp.name() ); if ( im.isNull() ) { //KMessageBox::sorry( 0, i18n("Failed to load image"), @@ -195,12 +195,12 @@ void ThumbnailPicker::downloadReady(KIO::Job *job) { // this returns zero... // //DEBUG -// kdDebug() << "Title bar height: " << kapp->style().pixelMetric( QStyle::PM_TitleBarHeight ) << endl; +// kdDebug() << "Title bar height: " << kapp->style().pixelMetric( TQStyle::PM_TitleBarHeight ) << endl; if ( h > hDesk ) im = im.smoothScale( w*hDesk/h, hDesk ); - PixList.append( new QPixmap( im ) ); + PixList.append( new TQPixmap( im ) ); //Add 50x50 image and URL to listbox ui->ImageList->insertItem( shrinkImage( PixList.current(), 50 ), @@ -208,11 +208,11 @@ void ThumbnailPicker::downloadReady(KIO::Job *job) { } } -QPixmap ThumbnailPicker::shrinkImage( QPixmap *pm, int size, bool setImage ) { +TQPixmap ThumbnailPicker::shrinkImage( TQPixmap *pm, int size, bool setImage ) { int w( pm->width() ), h( pm->height() ); int bigSize( w ); int rx(0), ry(0), sx(0), sy(0), bx(0), by(0); - if ( size == 0 ) return QPixmap(); + if ( size == 0 ) return TQPixmap(); //Prepare variables for rescaling image (if it is larger than 'size') if ( w > size && w >= h ) { @@ -229,12 +229,12 @@ QPixmap ThumbnailPicker::shrinkImage( QPixmap *pm, int size, bool setImage ) { if ( setImage ) bigSize = int( 200.*float(pm->width())/float(w) ); - QPixmap result( size, size ); - result.fill( QColor( "white" ) ); //in case final image is smaller than 'size' + TQPixmap result( size, size ); + result.fill( TQColor( "white" ) ); //in case final image is smaller than 'size' if ( pm->width() > size || pm->height() > size ) { //image larger than 'size'? - //convert to QImage so we can smoothscale it - QImage im( pm->convertToImage() ); + //convert to TQImage so we can smoothscale it + TQImage im( pm->convertToImage() ); im = im.smoothScale( w, h ); //bitBlt sizexsize square section of image @@ -259,8 +259,8 @@ QPixmap ThumbnailPicker::shrinkImage( QPixmap *pm, int size, bool setImage ) { void ThumbnailPicker::slotEditImage() { ThumbnailEditor te( this ); - if ( te.exec() == QDialog::Accepted ) { - QPixmap pm = te.thumbnail(); + if ( te.exec() == TQDialog::Accepted ) { + TQPixmap pm = te.thumbnail(); *Image = pm; ui->CurrentImage->setPixmap( pm ); ui->CurrentImage->update(); @@ -268,7 +268,7 @@ void ThumbnailPicker::slotEditImage() { } void ThumbnailPicker::slotUnsetImage() { - QFile file; + TQFile file; if ( KSUtils::openDataFile( file, "noimage.png" ) ) { file.close(); Image->load( file.name(), "PNG" ); @@ -286,7 +286,7 @@ void ThumbnailPicker::slotUnsetImage() { void ThumbnailPicker::slotSetFromList( int i ) { //Display image in preview pane - QPixmap pm; + TQPixmap pm; pm = shrinkImage( PixList.at(i), 200, true ); //scale image SelectedImageIndex = i; @@ -305,11 +305,11 @@ void ThumbnailPicker::slotSetFromURL() { if ( u.isValid() ) { if ( u.isLocalFile() ) { - QFile localFile( u.path() ); + TQFile localFile( u.path() ); //Add image to list //If image is taller than desktop, rescale it. - QImage im( localFile.name() ); + TQImage im( localFile.name() ); if ( im.isNull() ) { KMessageBox::sorry( 0, @@ -327,7 +327,7 @@ void ThumbnailPicker::slotSetFromURL() { im = im.smoothScale( w*hDesk/h, hDesk ); //Add Image to top of list and 50x50 thumbnail image and URL to top of listbox - PixList.insert( 0, new QPixmap( im ) ); + PixList.insert( 0, new TQPixmap( im ) ); ui->ImageList->insertItem( shrinkImage( PixList.current(), 50 ), u.prettyURL(), 0 ); @@ -337,13 +337,13 @@ void ThumbnailPicker::slotSetFromURL() { } else if ( KIO::NetAccess::exists(u, true, this) ) { KTempFile ktf; - QFile *tmpFile = ktf.file(); + TQFile *tmpFile = ktf.file(); ktf.unlink(); //just need filename JobList.append( KIO::copy( u, KURL( tmpFile->name() ), false ) ); //false = no progress window #if KDE_IS_VERSION( 3, 3, 90 ) ((KIO::CopyJob*)JobList.current())->setInteractive( false ); // suppress error dialogs #endif - connect (JobList.current(), SIGNAL (result(KIO::Job *)), SLOT (downloadReady (KIO::Job *))); + connect (JobList.current(), TQT_SIGNAL (result(KIO::Job *)), TQT_SLOT (downloadReady (KIO::Job *))); // } diff --git a/kstars/kstars/thumbnailpicker.h b/kstars/kstars/thumbnailpicker.h index 1f7c112b..20dc5739 100644 --- a/kstars/kstars/thumbnailpicker.h +++ b/kstars/kstars/thumbnailpicker.h @@ -38,13 +38,13 @@ class ThumbnailPicker : public KDialogBase { Q_OBJECT public: - ThumbnailPicker( SkyObject *o, const QPixmap ¤t, QWidget *parent=0, const char *name=0 ); + ThumbnailPicker( SkyObject *o, const TQPixmap ¤t, TQWidget *parent=0, const char *name=0 ); ~ThumbnailPicker(); - QPixmap* image() { return Image; } - QPixmap* currentListImage() { return PixList.at( SelectedImageIndex ); } + TQPixmap* image() { return Image; } + TQPixmap* currentListImage() { return PixList.at( SelectedImageIndex ); } bool imageFound() const { return bImageFound; } - QRect* imageRect() const { return ImageRect; } + TQRect* imageRect() const { return ImageRect; } private slots: void slotEditImage(); @@ -57,18 +57,18 @@ private slots: void downloadReady (KIO::Job *); private: - QPixmap shrinkImage( QPixmap *original, int newSize, bool setImage=false ); - void parseGooglePage( QStringList &ImList, QString URL ); + TQPixmap shrinkImage( TQPixmap *original, int newSize, bool setImage=false ); + void parseGooglePage( TQStringList &ImList, TQString URL ); int SelectedImageIndex; ThumbnailPickerUI *ui; - QPixmap *Image; + TQPixmap *Image; DetailDialog *dd; SkyObject *Object; - QPtrList JobList; - QPtrList PixList; + TQPtrList JobList; + TQPtrList PixList; bool bImageFound; - QRect *ImageRect; + TQRect *ImageRect; }; #endif diff --git a/kstars/kstars/timebox.cpp b/kstars/kstars/timebox.cpp index 9aa513a3..5040cf1f 100644 --- a/kstars/kstars/timebox.cpp +++ b/kstars/kstars/timebox.cpp @@ -17,14 +17,14 @@ #include "timebox.h" #include "libkdeedu/extdate/extdatetime.h" -#include //needed for QTime -#include +#include //needed for QTime +#include #include #include #include #include -timeBox::timeBox(QWidget *parent, const char *name, bool tt) : QLineEdit(parent,name) +timeBox::timeBox(TQWidget *parent, const char *name, bool tt) : TQLineEdit(parent,name) { if (tt) { @@ -39,7 +39,7 @@ timeBox::timeBox(QWidget *parent, const char *name, bool tt) : QLineEdit(parent, timet = tt; } -void timeBox::showTime (QTime t) +void timeBox::showTime (TQTime t) { setEntry( t.toString("hh:mm:ss") ); } @@ -50,26 +50,26 @@ void timeBox::showDate (ExtDate t) } -QTime timeBox::createTime ( bool *ok ) +TQTime timeBox::createTime ( bool *ok ) { -// QString entry; +// TQString entry; int h = 0, m = 0, is = 0; double s = 0.0; - QTime qt; + TQTime qt; bool valueFound = false, badEntry = false , checkValue = false; //Initialize bool for result if ( ok != NULL ) *ok = false; -// QString errMsg = i18n( "Unable to parse %1 entry. Specify a %1 value as a simple integer, a floating-point number, or a triplet of values using colons or spaces as separators." ); +// TQString errMsg = i18n( "Unable to parse %1 entry. Specify a %1 value as a simple integer, a floating-point number, or a triplet of values using colons or spaces as separators." ); - QString entry = text().stripWhiteSpace(); + TQString entry = text().stripWhiteSpace(); //Try simplest cases: integer or double representation h = entry.toInt( &checkValue ); if ( checkValue ) { - qt = QTime( h, 0, 0 ); + qt = TQTime( h, 0, 0 ); valueFound = true; if ( ok != NULL ) *ok = true; return qt; @@ -77,7 +77,7 @@ QTime timeBox::createTime ( bool *ok ) double x = entry.toDouble( &checkValue ); if ( checkValue ) { int seconds = int(x * 3600); - QTime qt(0,0,0); + TQTime qt(0,0,0); qt.addSecs(seconds); valueFound = true; if ( ok != NULL ) *ok = true; @@ -88,12 +88,12 @@ QTime timeBox::createTime ( bool *ok ) //no success yet...try assuming multiple fields if ( !valueFound ) { - QStringList fields; + TQStringList fields; //check for colon-delimiters or space-delimiters if ( entry.contains(':') ) - fields = QStringList::split( ':', entry ); - else fields = QStringList::split( " ", entry ); + fields = TQStringList::split( ':', entry ); + else fields = TQStringList::split( " ", entry ); // If two fields we will add a third one, and then parse with // the 3-field code block. If field[1] is a double, convert @@ -102,10 +102,10 @@ QTime timeBox::createTime ( bool *ok ) if ( fields.count() == 2 ) { double mx = fields[1].toDouble( &checkValue ); if ( checkValue ) { - fields[1] = QString("%1").arg( int(mx) ); - fields.append( QString("%1").arg( int( 60.0*(mx - int(mx)) ) ) ); + fields[1] = TQString("%1").arg( int(mx) ); + fields.append( TQString("%1").arg( int( 60.0*(mx - int(mx)) ) ) ); } else { - fields.append( QString( "0" ) ); + fields.append( TQString( "0" ) ); } } @@ -113,9 +113,9 @@ QTime timeBox::createTime ( bool *ok ) // ignore all after 3rd field if ( fields.count() >= 3 ) { - fields[0].replace( QRegExp("h"), "" ); - fields[1].replace( QRegExp("m"), "" ); - fields[2].replace( QRegExp("s"), "" ); + fields[0].replace( TQRegExp("h"), "" ); + fields[1].replace( TQRegExp("m"), "" ); + fields[2].replace( TQRegExp("s"), "" ); } //See if first two fields parse as integers. // @@ -132,7 +132,7 @@ QTime timeBox::createTime ( bool *ok ) if ( ok != NULL ) *ok = true; - QTime qt(h,m,is); + TQTime qt(h,m,is); return qt; } else { @@ -151,7 +151,7 @@ QTime timeBox::createTime ( bool *ok ) ExtDate timeBox::createDate (bool */*ok*/) { - QString entry = text().stripWhiteSpace(); + TQString entry = text().stripWhiteSpace(); // if entry is an empty string or invalid date use current date diff --git a/kstars/kstars/timebox.h b/kstars/kstars/timebox.h index 2e81385b..cc6b19fa 100644 --- a/kstars/kstars/timebox.h +++ b/kstars/kstars/timebox.h @@ -18,15 +18,15 @@ #ifndef TIMEBOX_H #define TIMEBOX_H -#include -#include -#include +#include +#include +#include class QTime; class ExtDate; /**@class timeBox - * This class creates a QHBox with 3 QLineEdit Fields which will contain + * This class creates a TQHBox with 3 TQLineEdit Fields which will contain * either Time (Hour, Minute, Second) or Date (Day, Month, Year). * * Inherits QHBox @@ -34,7 +34,7 @@ class ExtDate; *@version 1.0 */ -class timeBox : public QLineEdit { +class timeBox : public TQLineEdit { public: /** * Constructor for the timeBox object. @@ -43,28 +43,28 @@ public: * @param tt boolean. true means that the object will hold a Time. * false means that the object will hold a Date. */ - timeBox(QWidget *parent, const char *n, bool tt=TRUE); + timeBox(TQWidget *parent, const char *n, bool tt=TRUE); ~timeBox(); /** - * Fills the QLineEdit fields of the timebox object from a QTime object + * Fills the TQLineEdit fields of the timebox object from a TQTime object * showing hours, minutes and seconds. - * @param t QTime object from which to fill the entry fields + * @param t TQTime object from which to fill the entry fields */ - void showTime(QTime t); + void showTime(TQTime t); /** - * Fills the QLineEdit fields of the timebox object from a QTime object + * Fills the TQLineEdit fields of the timebox object from a TQTime object * showing hours, minutes and seconds. - * @param t QTime object from which to fill the entry fields + * @param t TQTime object from which to fill the entry fields */ void showDate(ExtDate t); /** - * returns a QTime object constructed from the fields of the timebox + * returns a TQTime object constructed from the fields of the timebox */ - QTime createTime(bool *ok=0); + TQTime createTime(bool *ok=0); /** * returns a ExtDate object constructed from the fields of the timebox @@ -75,7 +75,7 @@ public: /** * Fills the degrees entry field with string @p s * */ - void setEntry(QString s) { setText(s); } + void setEntry(TQString s) { setText(s); } /** * returns a boolean. True indicates that the object holds a diff --git a/kstars/kstars/timedialog.cpp b/kstars/kstars/timedialog.cpp index 2f621876..f4d1449f 100644 --- a/kstars/kstars/timedialog.cpp +++ b/kstars/kstars/timedialog.cpp @@ -18,10 +18,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include "timedialog.h" #include "kstars.h" @@ -29,49 +29,49 @@ #include "simclock.h" #include "libkdeedu/extdate/extdatepicker.h" -TimeDialog::TimeDialog( const KStarsDateTime &now, QWidget* parent ) +TimeDialog::TimeDialog( const KStarsDateTime &now, TQWidget* parent ) : KDialogBase( KDialogBase::Plain, i18n( "set clock to a new time", "Set Time" ), Ok|Cancel, Ok, parent ) { ksw = (KStars*) parent; - QFrame *page = plainPage(); + TQFrame *page = plainPage(); - vlay = new QVBoxLayout( page, 2, 2 ); - hlay = new QHBoxLayout( 2 ); //this layout will be added to the VLayout + vlay = new TQVBoxLayout( page, 2, 2 ); + hlay = new TQHBoxLayout( 2 ); //this layout will be added to the VLayout dPicker = new ExtDatePicker( page ); dPicker->setDate( now.date() ); - HourBox = new QSpinBox( page, "HourBox" ); - QFont Box_font( HourBox->font() ); + HourBox = new TQSpinBox( page, "HourBox" ); + TQFont Box_font( HourBox->font() ); Box_font.setBold( TRUE ); HourBox->setFont( Box_font ); HourBox->setWrapping( TRUE ); HourBox->setMaxValue( 23 ); - HourBox->setButtonSymbols( QSpinBox::PlusMinus ); + HourBox->setButtonSymbols( TQSpinBox::PlusMinus ); HourBox->setValue( now.time().hour() ); - TextLabel1 = new QLabel( page, "TextLabel1" ); + TextLabel1 = new TQLabel( page, "TextLabel1" ); TextLabel1->setText( " :" ); TextLabel1->setFont( Box_font ); - MinuteBox = new QSpinBox( page, "MinuteBox" ); - QFont MinuteBox_font( MinuteBox->font() ); + MinuteBox = new TQSpinBox( page, "MinuteBox" ); + TQFont MinuteBox_font( MinuteBox->font() ); MinuteBox->setFont( Box_font ); MinuteBox->setWrapping( TRUE ); MinuteBox->setMaxValue( 59 ); - MinuteBox->setButtonSymbols( QSpinBox::PlusMinus ); + MinuteBox->setButtonSymbols( TQSpinBox::PlusMinus ); MinuteBox->setValue( now.time().minute() ); - TextLabel1_2 = new QLabel( page, "TextLabel1_2" ); + TextLabel1_2 = new TQLabel( page, "TextLabel1_2" ); TextLabel1_2->setFont( Box_font ); - SecondBox = new QSpinBox( page, "SecondBox" ); + SecondBox = new TQSpinBox( page, "SecondBox" ); SecondBox->setFont( Box_font ); SecondBox->setMaxValue( 59 ); SecondBox->setWrapping( TRUE ); - SecondBox->setButtonSymbols( QSpinBox::PlusMinus ); + SecondBox->setButtonSymbols( TQSpinBox::PlusMinus ); SecondBox->setValue( now.time().second() ); - NowButton = new QPushButton( page, "NowButton" ); + NowButton = new TQPushButton( page, "NowButton" ); NowButton->setText( i18n( "Now" ) ); NowButton->setFont( Box_font ); @@ -87,18 +87,18 @@ TimeDialog::TimeDialog( const KStarsDateTime &now, QWidget* parent ) vlay->activate(); - QObject::connect( this, SIGNAL( okClicked() ), this, SLOT( accept() )); - QObject::connect( this, SIGNAL( cancelClicked() ), this, SLOT( reject() )); - QObject::connect( NowButton, SIGNAL( clicked() ), this, SLOT( setNow() )); - QObject::connect( HourBox, SIGNAL( valueChanged( int ) ), this, SLOT( HourPrefix( int ) )); - QObject::connect( MinuteBox, SIGNAL( valueChanged( int ) ), this, SLOT( MinutePrefix( int ) )); - QObject::connect( SecondBox, SIGNAL( valueChanged( int ) ), this, SLOT( SecondPrefix( int ) )); + TQObject::connect( this, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( accept() )); + TQObject::connect( this, TQT_SIGNAL( cancelClicked() ), this, TQT_SLOT( reject() )); + TQObject::connect( NowButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( setNow() )); + TQObject::connect( HourBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( HourPrefix( int ) )); + TQObject::connect( MinuteBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( MinutePrefix( int ) )); + TQObject::connect( SecondBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( SecondPrefix( int ) )); } //Add handler for Escape key to close window //Use keyReleaseEvent because keyPressEvents are already consumed //by the ExtDatePicker. -void TimeDialog::keyReleaseEvent( QKeyEvent *kev ) { +void TimeDialog::keyReleaseEvent( TQKeyEvent *kev ) { switch( kev->key() ) { case Key_Escape: { @@ -115,7 +115,7 @@ void TimeDialog::setNow( void ) KStarsDateTime dt( KStarsDateTime::currentDateTime() ); dPicker->setDate( dt.date() ); - QTime t = dt.time(); + TQTime t = dt.time(); HourBox->setValue( t.hour() ); MinuteBox->setValue( t.minute() ); @@ -137,8 +137,8 @@ void TimeDialog::SecondPrefix( int value ) { if ( value < 10 ) SecondBox->setPrefix( "0" ); } -QTime TimeDialog::selectedTime( void ) { - QTime t( HourBox->value(), MinuteBox->value(), SecondBox->value() ); +TQTime TimeDialog::selectedTime( void ) { + TQTime t( HourBox->value(), MinuteBox->value(), SecondBox->value() ); return t; } diff --git a/kstars/kstars/timedialog.h b/kstars/kstars/timedialog.h index cc8a05ac..d7e94f36 100644 --- a/kstars/kstars/timedialog.h +++ b/kstars/kstars/timedialog.h @@ -19,7 +19,7 @@ #define TIMEDIALOG_H #include -#include +#include #include "kstarsdatetime.h" @@ -48,16 +48,16 @@ public: *Constructor. Creates widgets and packs them into QLayouts. *Connects Signals and Slots. */ - TimeDialog( const KStarsDateTime &now, QWidget* parent = 0 ); + TimeDialog( const KStarsDateTime &now, TQWidget* parent = 0 ); /** *Destructor (empty) */ ~TimeDialog() {} -/**@returns a QTime object with the selected time +/**@returns a TQTime object with the selected time */ - QTime selectedTime( void ); + TQTime selectedTime( void ); /**@returns a ExtDate object with the selected date */ @@ -69,7 +69,7 @@ public: public slots: /** - *When the "Now" QPushButton is pressed, read the time and date + *When the "Now" TQPushButton is pressed, read the time and date *from the system clock. Change the selected date in the ExtDatePicker *to the system's date, and the displayed Hour, Minute and Second *to the system time. @@ -77,7 +77,7 @@ public slots: void setNow( void ); /** - *When the value of the HourBox QSpinBox is changed, prefix a "0" to + *When the value of the HourBox TQSpinBox is changed, prefix a "0" to *the displayed text, if the value is less than 10. * *It would be nice if I could use one slot for these three widgets; @@ -87,32 +87,32 @@ public slots: void HourPrefix( int value ); /** - *When the value of the MinuteBox QSpinBox is changed, prefix a "0" to + *When the value of the MinuteBox TQSpinBox is changed, prefix a "0" to *the displayed text, if the value is less than 10. */ void MinutePrefix( int value ); /** - *When the value of the SecondBox QSpinBox is changed, prefix a "0" to + *When the value of the SecondBox TQSpinBox is changed, prefix a "0" to *the displayed text, if the value is less than 10. */ void SecondPrefix( int value ); protected: - void keyReleaseEvent( QKeyEvent* ); + void keyReleaseEvent( TQKeyEvent* ); private: KStars *ksw; bool UTCNow; - QHBoxLayout *hlay; - QVBoxLayout *vlay; + TQHBoxLayout *hlay; + TQVBoxLayout *vlay; ExtDatePicker *dPicker; - QSpinBox* HourBox; - QLabel* TextLabel1; - QSpinBox* MinuteBox; - QLabel* TextLabel1_2; - QSpinBox* SecondBox; - QPushButton* NowButton; + TQSpinBox* HourBox; + TQLabel* TextLabel1; + TQSpinBox* MinuteBox; + TQLabel* TextLabel1_2; + TQSpinBox* SecondBox; + TQPushButton* NowButton; }; #endif diff --git a/kstars/kstars/timespinbox.cpp b/kstars/kstars/timespinbox.cpp index dcf721f5..72549f9b 100644 --- a/kstars/kstars/timespinbox.cpp +++ b/kstars/kstars/timespinbox.cpp @@ -24,8 +24,8 @@ //27-32: 1 month, 2, 3, 4, 6, 9 months //33-41: 1 year, 2, 3, 4, 5, 10, 25, 50, 100 years -#include -#include +#include +#include #include #include #include @@ -37,17 +37,17 @@ #define SIDEREAL_YEAR 31558149.77 #define TROPICAL_YEAR 31556925.19 -TimeSpinBox::TimeSpinBox( QWidget *parent, const char *name, bool _daysonly ) - : QSpinBox ( -41, 41, 1 /* step */, parent, name ) +TimeSpinBox::TimeSpinBox( TQWidget *parent, const char *name, bool _daysonly ) + : TQSpinBox ( -41, 41, 1 /* step */, parent, name ) { setValidator( 0 ); - setButtonSymbols( QSpinBox::PlusMinus ); + setButtonSymbols( TQSpinBox::PlusMinus ); editor()->setReadOnly( true ); setValue( 4 ); //1 second (real time) setDaysOnly( _daysonly ); //Set width: - QFontMetrics fm( font() ); + TQFontMetrics fm( font() ); int extra = width() - editor()->width(); uint wmax = 0; for ( int i=0; i < maxValue(); ++i ) { @@ -56,7 +56,7 @@ TimeSpinBox::TimeSpinBox( QWidget *parent, const char *name, bool _daysonly ) } setFixedWidth( wmax + extra ); - connect( this, SIGNAL( valueChanged( int ) ), this, SLOT( reportChange() ) ); + connect( this, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( reportChange() ) ); updateDisplay(); } @@ -176,8 +176,8 @@ int TimeSpinBox::mapTextToValue( bool *ok ) { return 0; } -QString TimeSpinBox::mapValueToText( int value ) { - QString neg("-"), result; +TQString TimeSpinBox::mapValueToText( int value ) { + TQString neg("-"), result; int posval( abs( value ) ); result = TimeString[ posval ]; diff --git a/kstars/kstars/timespinbox.h b/kstars/kstars/timespinbox.h index 3b52eba3..16c23fb5 100644 --- a/kstars/kstars/timespinbox.h +++ b/kstars/kstars/timespinbox.h @@ -18,8 +18,8 @@ #ifndef TIMESPINBOX_H #define TIMESPINBOX_H -#include -#include +#include +#include /**@class TimeSpinBox *Custom spinbox to handle selection of timestep values with variable units. @@ -28,11 +28,11 @@ *@version 1.0 */ -class TimeSpinBox : public QSpinBox { +class TimeSpinBox : public TQSpinBox { Q_OBJECT public: /**Constructor */ - TimeSpinBox( QWidget *parent, const char* name=0, bool daysOnly = false ); + TimeSpinBox( TQWidget *parent, const char* name=0, bool daysOnly = false ); /**Destructor (empty)*/ ~TimeSpinBox() {} @@ -41,7 +41,7 @@ public: *@p value the internal value to convert to a display string *@return the display string */ - virtual QString mapValueToText( int value ); + virtual TQString mapValueToText( int value ); /**Convert the displayed string to an internal value. *@note reimplemented from QSpinBox @@ -68,7 +68,7 @@ protected slots: private: bool DaysOnly; float TimeScale[42]; - QStringList TimeString; + TQStringList TimeString; }; #endif diff --git a/kstars/kstars/timestepbox.cpp b/kstars/kstars/timestepbox.cpp index c5bef036..6b661592 100644 --- a/kstars/kstars/timestepbox.cpp +++ b/kstars/kstars/timestepbox.cpp @@ -16,35 +16,35 @@ ***************************************************************************/ #include -#include -#include +#include +#include #include #include #include "timestepbox.h" -TimeStepBox::TimeStepBox( QWidget *parent, const char* name, bool daysonly ) - : QFrame( parent, name ) { +TimeStepBox::TimeStepBox( TQWidget *parent, const char* name, bool daysonly ) + : TQFrame( parent, name ) { timeBox = new TimeSpinBox( this, "timebox", daysonly ); unitBox = new TimeUnitBox( this, "unitbox", daysonly ); - QToolTip::add( timeBox, i18n( "Adjust time step" ) ); - QToolTip::add( unitBox, i18n( "Adjust time step units" ) ); + TQToolTip::add( timeBox, i18n( "Adjust time step" ) ); + TQToolTip::add( unitBox, i18n( "Adjust time step units" ) ); - QWhatsThis::add( this, i18n( "Set the timescale for the simulation clock. A setting of \"1 sec\" means the clock advances in real-time, keeping up perfectly with your CPU clock. Higher values make the simulation clock run faster, lower values make it run slower. Negative values make it run backwards." + TQWhatsThis::add( this, i18n( "Set the timescale for the simulation clock. A setting of \"1 sec\" means the clock advances in real-time, keeping up perfectly with your CPU clock. Higher values make the simulation clock run faster, lower values make it run slower. Negative values make it run backwards." "\n\n" "There are two pairs of up/down buttons. The left pair will cycle through all available timesteps in sequence. Since there are a large number of timesteps, the right pair is provided to skip to the next higher/lower unit of time. For example, if the timescale is currently \"1 min\", the right up button will make it \"1 hour\", and the right down button will make it \"1 sec\"" ) ); - hlay = new QHBoxLayout( this, 2, 0 ); + hlay = new TQHBoxLayout( this, 2, 0 ); hlay->addWidget( timeBox ); hlay->addWidget( unitBox ); hlay->activate(); timeBox->setValue( 4 ); //real-time - connect( unitBox, SIGNAL( valueChanged( int ) ), this, SLOT( changeUnits() ) ); - connect( timeBox, SIGNAL( valueChanged( int ) ), this, SLOT( syncUnits( int ) ) ); - connect( timeBox, SIGNAL( scaleChanged( float ) ), this, SIGNAL( scaleChanged( float ) ) ); + connect( unitBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( changeUnits() ) ); + connect( timeBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( syncUnits( int ) ) ); + connect( timeBox, TQT_SIGNAL( scaleChanged( float ) ), this, TQT_SIGNAL( scaleChanged( float ) ) ); } @@ -58,9 +58,9 @@ void TimeStepBox::syncUnits( int tstep ) { if ( abs(tstep) >= unitBox->getUnitValue( i ) ) break; //don't want setValue to trigger changeUnits()... - disconnect( unitBox, SIGNAL( valueChanged( int ) ), this, SLOT( changeUnits() ) ); + disconnect( unitBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( changeUnits() ) ); unitBox->setValue( tstep < 0 ? -i : i ); - connect( unitBox, SIGNAL( valueChanged( int ) ), this, SLOT( changeUnits() ) ); + connect( unitBox, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( changeUnits() ) ); } void TimeStepBox::setDaysOnly( bool daysonly ) { diff --git a/kstars/kstars/timestepbox.h b/kstars/kstars/timestepbox.h index 73d9160f..c1bc8fc2 100644 --- a/kstars/kstars/timestepbox.h +++ b/kstars/kstars/timestepbox.h @@ -18,13 +18,13 @@ #ifndef TIMESTEPBOX_H #define TIMESTEPBOX_H -#include -#include +#include +#include #include "timespinbox.h" #include "timeunitbox.h" /**@class TimeStepBox - *This composite widget consists of a TimeSpinBox (a QSpinBox), coupled with a + *This composite widget consists of a TimeSpinBox (a TQSpinBox), coupled with a *TimeUnitBox (a second pair of up/down buttons). *The second set of buttons makes larger steps through the 82 possible *time-step values, skipping to the next even unit of time. @@ -33,11 +33,11 @@ *@version 1.0 */ -class TimeStepBox : public QFrame { +class TimeStepBox : public TQFrame { Q_OBJECT public: /**Constructor. */ - TimeStepBox( QWidget *parent=0, const char* name=0, bool daysonly=false ); + TimeStepBox( TQWidget *parent=0, const char* name=0, bool daysonly=false ); /**Destructor. (empty)*/ ~TimeStepBox() {} @@ -63,7 +63,7 @@ private slots: void syncUnits( int ); private: bool DaysOnly; - QHBoxLayout *hlay; + TQHBoxLayout *hlay; TimeSpinBox *timeBox; TimeUnitBox *unitBox; }; diff --git a/kstars/kstars/timeunitbox.cpp b/kstars/kstars/timeunitbox.cpp index 27538320..0b89f057 100644 --- a/kstars/kstars/timeunitbox.cpp +++ b/kstars/kstars/timeunitbox.cpp @@ -19,23 +19,23 @@ #include #include "timeunitbox.h" #include "timeunitbox.moc" -#include +#include -TimeUnitBox::TimeUnitBox(QWidget *parent, const char *name, bool daysonly ) - : QVBox( parent, name ) { +TimeUnitBox::TimeUnitBox(TQWidget *parent, const char *name, bool daysonly ) + : TQVBox( parent, name ) { - UpButton = new QPushButton( "+", this ); + UpButton = new TQPushButton( "+", this ); UpButton->setMaximumWidth( 22 ); UpButton->setMaximumHeight( 10 ); - DownButton = new QPushButton( "-", this ); + DownButton = new TQPushButton( "-", this ); DownButton->setMaximumWidth( 22 ); DownButton->setMaximumHeight( 10 ); setDaysOnly( daysonly ); - connect( UpButton, SIGNAL( clicked() ), this, SLOT( increase() ) ); - connect( DownButton, SIGNAL( clicked() ), this, SLOT( decrease() ) ); + connect( UpButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( increase() ) ); + connect( DownButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( decrease() ) ); } TimeUnitBox::~TimeUnitBox(){ diff --git a/kstars/kstars/timeunitbox.h b/kstars/kstars/timeunitbox.h index c38894c2..a245c55b 100644 --- a/kstars/kstars/timeunitbox.h +++ b/kstars/kstars/timeunitbox.h @@ -18,8 +18,8 @@ #ifndef TIMEUNITBOX_H #define TIMEUNITBOX_H -#include -#include +#include +#include #define ALLUNITS 8 #define DAYUNITS 5 @@ -43,11 +43,11 @@ class QPushButton; -class TimeUnitBox : public QVBox { +class TimeUnitBox : public TQVBox { Q_OBJECT public: /**Constructor*/ - TimeUnitBox(QWidget *parent=0, const char *name=0, bool daysonly = false); + TimeUnitBox(TQWidget *parent=0, const char *name=0, bool daysonly = false); /**Destructor (empty)*/ ~TimeUnitBox(); /**@return the value of UnitStep for the current spinbox value() */ @@ -96,7 +96,7 @@ private slots: private: bool DaysOnly; - QPushButton *UpButton, *DownButton; + TQPushButton *UpButton, *DownButton; int MinimumValue, MaximumValue, Value, UnitStep[ ALLUNITS ]; }; diff --git a/kstars/kstars/timezonerule.cpp b/kstars/kstars/timezonerule.cpp index 20ac8c45..0a711f57 100644 --- a/kstars/kstars/timezonerule.cpp +++ b/kstars/kstars/timezonerule.cpp @@ -29,14 +29,14 @@ TimeZoneRule::TimeZoneRule() { RevertDay = 0; StartWeek = -1; RevertWeek = -1; - StartTime = QTime(); - RevertTime = QTime(); + StartTime = TQTime(); + RevertTime = TQTime(); HourOffset = 0.0; dTZ = 0.0; } -TimeZoneRule::TimeZoneRule( const QString &smonth, const QString &sday, const QTime &stime, - const QString &rmonth, const QString &rday, const QTime &rtime, const double &dh ) { +TimeZoneRule::TimeZoneRule( const TQString &smonth, const TQString &sday, const TQTime &stime, + const TQString &rmonth, const TQString &rday, const TQTime &rtime, const double &dh ) { dTZ = 0.0; if ( smonth != "0" ) { StartMonth = initMonth( smonth ); @@ -55,8 +55,8 @@ TimeZoneRule::TimeZoneRule( const QString &smonth, const QString &sday, const QT RevertDay = 0; StartWeek = -1; RevertWeek = -1; - StartTime = QTime(); - RevertTime = QTime(); + StartTime = TQTime(); + RevertTime = TQTime(); HourOffset = 0.0; } } else { //Empty rule @@ -66,8 +66,8 @@ TimeZoneRule::TimeZoneRule( const QString &smonth, const QString &sday, const QT RevertDay = 0; StartWeek = -1; RevertWeek = -1; - StartTime = QTime(); - RevertTime = QTime(); + StartTime = TQTime(); + RevertTime = TQTime(); HourOffset = 0.0; } } @@ -85,9 +85,9 @@ void TimeZoneRule::setDST( bool activate ) { } } -int TimeZoneRule::initMonth( const QString &mn ) { +int TimeZoneRule::initMonth( const TQString &mn ) { //Check whether the argument is a three-letter English month code. - QString ml = mn.lower(); + TQString ml = mn.lower(); if ( ml == "jan" ) return 1; else if ( ml == "feb" ) return 2; else if ( ml == "mar" ) return 3; @@ -105,7 +105,7 @@ int TimeZoneRule::initMonth( const QString &mn ) { return false; } -bool TimeZoneRule::initDay( const QString &dy, int &Day, int &Week ) { +bool TimeZoneRule::initDay( const TQString &dy, int &Day, int &Week ) { //Three possible ways to express a day. //1. simple integer; the calendar date...set Week=0 to indicate that Date is not the day of the week bool ok; @@ -116,7 +116,7 @@ bool TimeZoneRule::initDay( const QString &dy, int &Day, int &Week ) { return true; } - QString dl = dy.lower(); + TQString dl = dy.lower(); //2. 3-letter day of week string, indicating the last of that day of the month // ...set Week to 5 to indicate the last weekday of the month if ( dl == "mon" ) { Day = 1; Week = 5; return true; } @@ -131,7 +131,7 @@ bool TimeZoneRule::initDay( const QString &dy, int &Day, int &Week ) { // the (1st/2nd/3rd) weekday of the month. int wn = dl.left(1).toInt(); if ( wn >0 && wn <4 ) { - QString dm = dl.mid( 1, dl.length() ).lower(); + TQString dm = dl.mid( 1, dl.length() ).lower(); if ( dm == "mon" ) { Day = 1; Week = wn; return true; } else if ( dm == "tue" ) { Day = 2; Week = wn; return true; } else if ( dm == "wed" ) { Day = 3; Week = wn; return true; } diff --git a/kstars/kstars/timezonerule.h b/kstars/kstars/timezonerule.h index c24f7243..75ae5d2d 100644 --- a/kstars/kstars/timezonerule.h +++ b/kstars/kstars/timezonerule.h @@ -29,7 +29,7 @@ *on startup; each line in the file creates a TimeZoneRule object. * *TimeZoneRule consists of QStrings identifying the months and days on which - *DST starts and ends, QTime objects identifying the time at which the + *DST starts and ends, TQTime objects identifying the time at which the *changes occur, and a double indicating the size of the offset in hours *(probably always 1.00). * @@ -50,7 +50,7 @@ *@version 1.0 */ -#include +#include #include "kstarsdatetime.h" class TimeZoneRule { @@ -67,8 +67,8 @@ public: *@p rtime the time at which DST reverts *@p offset the offset between normal time and DS time (always 1.00?) */ - TimeZoneRule( const QString &smonth, const QString &sday, const QTime &stime, - const QString &rmonth, const QString &rday, const QTime &rtime, const double &offset=1.00 ); + TimeZoneRule( const TQString &smonth, const TQString &sday, const TQTime &stime, + const TQString &rmonth, const TQString &rday, const TQTime &rtime, const double &offset=1.00 ); /**Destructor. (empty)*/ ~TimeZoneRule(); @@ -137,7 +137,7 @@ private: /**Interpret the string as a month of the year; *@return the month integer (1=jan ... 12=dec) */ - int initMonth( const QString &m ); + int initMonth( const TQString &m ); /**Interpret the day string as a week ID and a day-of-week ID. The day-of-week *is an integer between 1 (sunday) and 7 (saturday); the week integer can @@ -146,7 +146,7 @@ private: *@p week the week integer is returned by reference through this value *@return TRUE if the day string was successfully parsed */ - bool initDay( const QString &d, int &day, int &week ); + bool initDay( const TQString &d, int &day, int &week ); /**Find the calendar date on which DST starts for the calendar year *of the given KStarsDateTime. @@ -162,7 +162,7 @@ private: int StartDay, RevertDay; int StartWeek, RevertWeek; - QTime StartTime, RevertTime; + TQTime StartTime, RevertTime; KStarsDateTime next_change_utc, next_change_ltime; double dTZ, HourOffset; diff --git a/kstars/kstars/toggleaction.cpp b/kstars/kstars/toggleaction.cpp index 3c1b2adc..a0b59a64 100644 --- a/kstars/kstars/toggleaction.cpp +++ b/kstars/kstars/toggleaction.cpp @@ -17,9 +17,9 @@ #include "toggleaction.h" -ToggleAction::ToggleAction(const QString& ontext, const QIconSet& onpix, - const QString& offtext, const QIconSet& offpix, - int accel, const QObject* receiver, const char* slot, QObject* parent, const char* name ) : +ToggleAction::ToggleAction(const TQString& ontext, const TQIconSet& onpix, + const TQString& offtext, const TQIconSet& offpix, + int accel, const TQObject* receiver, const char* slot, TQObject* parent, const char* name ) : KAction(ontext, onpix, accel, receiver, slot, parent, name), officon(offpix), onicon(onpix), @@ -28,8 +28,8 @@ ToggleAction::ToggleAction(const QString& ontext, const QIconSet& onpix, state(true) {} -ToggleAction::ToggleAction(const QString& ontext, const QString& offtext, - int accel, const QObject* receiver, const char* slot, QObject* parent, const char* name ) : +ToggleAction::ToggleAction(const TQString& ontext, const TQString& offtext, + int accel, const TQObject* receiver, const char* slot, TQObject* parent, const char* name ) : KAction(ontext, accel, receiver, slot, parent, name), officon(), onicon(), @@ -52,13 +52,13 @@ void ToggleAction::turnOn() { state = true; } -void ToggleAction::setOnToolTip(QString tip) { +void ToggleAction::setOnToolTip(TQString tip) { onTip = tip; if (state) setToolTip(tip); } -void ToggleAction::setOffToolTip(QString tip) { +void ToggleAction::setOffToolTip(TQString tip) { offTip = tip; if (!state) setToolTip(tip); diff --git a/kstars/kstars/toggleaction.h b/kstars/kstars/toggleaction.h index b195a78d..5eef8d04 100644 --- a/kstars/kstars/toggleaction.h +++ b/kstars/kstars/toggleaction.h @@ -26,7 +26,7 @@ *@version 1.0 */ -#include +#include #include class ToggleAction : public KAction { @@ -34,19 +34,19 @@ class ToggleAction : public KAction { public: /**Constructor. */ - ToggleAction(const QString& ontext, const QIconSet& onpix, const QString& offtext, const QIconSet& offpix, int accel, const QObject* receiver, const char* slot, QObject* parent = 0, const char* name = 0 ) ; + ToggleAction(const TQString& ontext, const TQIconSet& onpix, const TQString& offtext, const TQIconSet& offpix, int accel, const TQObject* receiver, const char* slot, TQObject* parent = 0, const char* name = 0 ) ; /**Constructor. Same as above, but without icons. */ - ToggleAction(const QString& ontext, const QString& offtext, int accel, const QObject* receiver, const char* slot, QObject* parent = 0, const char* name = 0 ) ; + ToggleAction(const TQString& ontext, const TQString& offtext, int accel, const TQObject* receiver, const char* slot, TQObject* parent = 0, const char* name = 0 ) ; /**Sets the ToolTip text for the "on" state. *@p tip the tooltip string */ - void setOnToolTip(QString tip); + void setOnToolTip(TQString tip); /**Sets the ToolTip text for the "off" state. *@p tip the tooltip string */ - void setOffToolTip(QString tip); + void setOffToolTip(TQString tip); public slots: /**Put the Action in the "off" state. Update the icon and tooltip. */ @@ -55,12 +55,12 @@ class ToggleAction : public KAction { void turnOn(); private: - QIconSet officon; - QIconSet onicon; - QString offcap; - QString oncap; - QString onTip; - QString offTip; + TQIconSet officon; + TQIconSet onicon; + TQString offcap; + TQString oncap; + TQString onTip; + TQString offTip; bool state; }; diff --git a/kstars/kstars/tools/altvstime.cpp b/kstars/kstars/tools/altvstime.cpp index 1ce505ff..458b467f 100644 --- a/kstars/kstars/tools/altvstime.cpp +++ b/kstars/kstars/tools/altvstime.cpp @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include #include @@ -41,19 +41,19 @@ #include "kstarsdatetime.h" #include "libkdeedu/extdate/extdatetimeedit.h" -AltVsTime::AltVsTime( QWidget* parent) : +AltVsTime::AltVsTime( TQWidget* parent) : KDialogBase( KDialogBase::Plain, i18n( "Altitude vs. Time" ), Close, Close, parent ) { ks = (KStars*) parent; - QFrame *page = plainPage(); + TQFrame *page = plainPage(); setMainWidget(page); - topLayout = new QVBoxLayout( page, 0, spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, spacingHint() ); View = new AVTPlotWidget( -12.0, 12.0, -90.0, 90.0, page ); View->setMinimumSize( 400, 400 ); - View->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ); + View->setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding ); View->setXAxisType( KStarsPlotWidget::TIME ); View->setYAxisType( KStarsPlotWidget::ANGLE ); View->setShowGrid( false ); @@ -87,18 +87,18 @@ AltVsTime::AltVsTime( QWidget* parent) : setLSTLimits(); View->updateTickmarks(); - connect( avtUI->browseButton, SIGNAL( clicked() ), this, SLOT( slotBrowseObject() ) ); - connect( avtUI->cityButton, SIGNAL( clicked() ), this, SLOT( slotChooseCity() ) ); - connect( avtUI->updateButton, SIGNAL( clicked() ), this, SLOT( slotUpdateDateLoc() ) ); - connect( avtUI->clearButton, SIGNAL( clicked() ), this, SLOT( slotClear() ) ); - connect( avtUI->addButton, SIGNAL( clicked() ), this, SLOT( slotAddSource() ) ); - connect( avtUI->nameBox, SIGNAL( returnPressed() ), this, SLOT( slotAddSource() ) ); - connect( avtUI->raBox, SIGNAL( returnPressed() ), this, SLOT( slotAddSource() ) ); - connect( avtUI->decBox, SIGNAL( returnPressed() ), this, SLOT( slotAddSource() ) ); - connect( avtUI->clearFieldsButton, SIGNAL( clicked() ), this, SLOT( slotClearBoxes() ) ); - connect( avtUI->longBox, SIGNAL( returnPressed() ), this, SLOT( slotAdvanceFocus() ) ); - connect( avtUI->latBox, SIGNAL( returnPressed() ), this, SLOT( slotAdvanceFocus() ) ); - connect( avtUI->PlotList, SIGNAL( highlighted(int) ), this, SLOT( slotHighlight() ) ); + connect( avtUI->browseButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotBrowseObject() ) ); + connect( avtUI->cityButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChooseCity() ) ); + connect( avtUI->updateButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotUpdateDateLoc() ) ); + connect( avtUI->clearButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotClear() ) ); + connect( avtUI->addButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddSource() ) ); + connect( avtUI->nameBox, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotAddSource() ) ); + connect( avtUI->raBox, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotAddSource() ) ); + connect( avtUI->decBox, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotAddSource() ) ); + connect( avtUI->clearFieldsButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotClearBoxes() ) ); + connect( avtUI->longBox, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotAdvanceFocus() ) ); + connect( avtUI->latBox, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotAdvanceFocus() ) ); + connect( avtUI->PlotList, TQT_SIGNAL( highlighted(int) ), this, TQT_SLOT( slotHighlight() ) ); pList.setAutoDelete(FALSE); deleteList.setAutoDelete(TRUE); //needed for skypoints which may be created in this class @@ -122,7 +122,7 @@ void AltVsTime::slotAddSource(void) { //First, attempt to find the object name in the list of known objects if ( ! avtUI->nameBox->text().isEmpty() ) { ObjectNameList &ObjNames = ks->data()->ObjNames; - QString text = avtUI->nameBox->text().lower(); + TQString text = avtUI->nameBox->text().lower(); for( SkyObjectName *name = ObjNames.first( text ); name; name = ObjNames.next() ) { if ( name->text().lower() == text ) { @@ -181,13 +181,13 @@ void AltVsTime::slotAddSource(void) { //If the Ra and Dec boxes are filled, but the name field is empty, //move input focus to nameBox` } else if ( avtUI->nameBox->text().isEmpty() && ! avtUI->raBox->text().isEmpty() && ! avtUI->decBox->text().isEmpty() ) { - avtUI->nameBox->QWidget::setFocus(); + avtUI->nameBox->TQWidget::setFocus(); //nameBox is empty, and one of the ra or dec fields is empty. Move input focus to empty coord box } else if ( avtUI->raBox->text().isEmpty() ) { - avtUI->raBox->QWidget::setFocus(); + avtUI->raBox->TQWidget::setFocus(); } else if ( avtUI->decBox->text().isEmpty() ) { - avtUI->decBox->QWidget::setFocus(); + avtUI->decBox->TQWidget::setFocus(); } View->repaint(false); @@ -196,7 +196,7 @@ void AltVsTime::slotAddSource(void) { //Use find dialog to choose an object void AltVsTime::slotBrowseObject(void) { FindDialog fd(ks); - if ( fd.exec() == QDialog::Accepted ) { + if ( fd.exec() == TQDialog::Accepted ) { SkyObject *o = fd.currentItem()->objName()->skyObject(); processObject( o ); } @@ -252,7 +252,7 @@ void AltVsTime::processObject( SkyObject *o, bool forceAdd ) { avtUI->nameBox->setText(o->translatedName() ); //Set epochName to epoch shown in date tab - avtUI->epochName->setText( QString().setNum( getDate().epoch() ) ); + avtUI->epochName->setText( TQString().setNum( getDate().epoch() ) ); } kdDebug() << "Currently, there are " << View->objectCount() << " objects displayed." << endl; @@ -307,11 +307,11 @@ void AltVsTime::slotHighlight(void) { //move input focus to the next logical widget void AltVsTime::slotAdvanceFocus(void) { - if ( sender()->name() == QString( "nameBox" ) ) avtUI->addButton->setFocus(); - if ( sender()->name() == QString( "raBox" ) ) avtUI->decBox->setFocus(); - if ( sender()->name() == QString( "decbox" ) ) avtUI->addButton->setFocus(); - if ( sender()->name() == QString( "longBox" ) ) avtUI->latBox->setFocus(); - if ( sender()->name() == QString( "latBox" ) ) avtUI->updateButton->setFocus(); + if ( sender()->name() == TQString( "nameBox" ) ) avtUI->addButton->setFocus(); + if ( sender()->name() == TQString( "raBox" ) ) avtUI->decBox->setFocus(); + if ( sender()->name() == TQString( "decbox" ) ) avtUI->addButton->setFocus(); + if ( sender()->name() == TQString( "longBox" ) ) avtUI->latBox->setFocus(); + if ( sender()->name() == TQString( "latBox" ) ) avtUI->updateButton->setFocus(); } void AltVsTime::slotClear(void) { @@ -339,8 +339,8 @@ void AltVsTime::computeSunRiseSetTimes() { KStarsDateTime today = getDate(); SkyObject *oSun = (SkyObject*) ks->data()->PCat->planetSun(); - double sunRise = -1.0 * oSun->riseSetTime( today.djd() + 1.0, geo, true ).secsTo(QTime()) / 86400.0; - double sunSet = -1.0 * oSun->riseSetTime( today.djd(), geo, false ).secsTo(QTime()) / 86400.0; + double sunRise = -1.0 * oSun->riseSetTime( today.djd() + 1.0, geo, true ).secsTo(TQTime()) / 86400.0; + double sunSet = -1.0 * oSun->riseSetTime( today.djd(), geo, false ).secsTo(TQTime()) / 86400.0; //check to see if Sun is circumpolar //requires temporary repositioning of Sun to target date @@ -381,7 +381,7 @@ void AltVsTime::slotUpdateDateLoc(void) { computeSunRiseSetTimes(); for ( unsigned int i = 0; i < avtUI->PlotList->count(); ++i ) { - QString oName = avtUI->PlotList->text( i ).lower(); + TQString oName = avtUI->PlotList->text( i ).lower(); ObjectNameList &ObjNames = ks->data()->ObjNames; bool objFound(false); @@ -444,7 +444,7 @@ void AltVsTime::slotUpdateDateLoc(void) { void AltVsTime::slotChooseCity(void) { LocationDialog ld(ks); - if ( ld.exec() == QDialog::Accepted ) { + if ( ld.exec() == TQDialog::Accepted ) { GeoLocation *newGeo = ld.selectedCity(); if ( newGeo ) { geo = newGeo; @@ -469,19 +469,19 @@ void AltVsTime::setLSTLimits(void) { void AltVsTime::showCurrentDate (void) { KStarsDateTime dt = KStarsDateTime::currentDateTime(); - if ( dt.time() > QTime( 12, 0, 0 ) ) dt = dt.addDays( 1 ); + if ( dt.time() > TQTime( 12, 0, 0 ) ) dt = dt.addDays( 1 ); avtUI->dateBox->setDate( dt.date() ); } KStarsDateTime AltVsTime::getDate (void) { //convert midnight local time to UT: - KStarsDateTime dt( avtUI->dateBox->date(), QTime() ); + KStarsDateTime dt( avtUI->dateBox->date(), TQTime() ); dt = geo->LTtoUT( dt ); return dt; } -double AltVsTime::getEpoch (QString eName) +double AltVsTime::getEpoch (TQString eName) { //If Epoch field not a double, assume J2000 bool ok(false); @@ -495,7 +495,7 @@ double AltVsTime::getEpoch (QString eName) return epoch; } -AVTPlotWidget::AVTPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent, const char* name ) +AVTPlotWidget::AVTPlotWidget( double x1, double x2, double y1, double y2, TQWidget *parent, const char* name ) : KStarsPlotWidget( x1, x2, y1, y2, parent, name ) { //Default SunRise/SunSet values @@ -503,12 +503,12 @@ AVTPlotWidget::AVTPlotWidget( double x1, double x2, double y1, double y2, QWidge SunSet = 0.75; } -void AVTPlotWidget::mousePressEvent( QMouseEvent *e ) { +void AVTPlotWidget::mousePressEvent( TQMouseEvent *e ) { mouseMoveEvent( e ); } -void AVTPlotWidget::mouseMoveEvent( QMouseEvent *e ) { - QRect checkRect( leftPadding(), topPadding(), PixRect.width(), PixRect.height() ); +void AVTPlotWidget::mouseMoveEvent( TQMouseEvent *e ) { + TQRect checkRect( leftPadding(), topPadding(), PixRect.width(), PixRect.height() ); int Xcursor = e->x(); int Ycursor = e->y(); @@ -522,19 +522,19 @@ void AVTPlotWidget::mouseMoveEvent( QMouseEvent *e ) { Xcursor -= leftPadding(); Ycursor -= topPadding(); - QPixmap buffer2( *buffer ); - QPainter p; + TQPixmap buffer2( *buffer ); + TQPainter p; p.begin( &buffer2 ); p.translate( leftPadding(), topPadding() ); - p.setPen( QPen( "grey", 1, SolidLine ) ); + p.setPen( TQPen( "grey", 1, SolidLine ) ); p.drawLine( Xcursor, 0, Xcursor, PixRect.height() ); p.drawLine( 0, Ycursor, PixRect.width(), Ycursor ); p.end(); bitBlt( this, 0, 0, &buffer2 ); } -void AVTPlotWidget::paintEvent( QPaintEvent */*e*/ ) { - QPainter p; +void AVTPlotWidget::paintEvent( TQPaintEvent */*e*/ ) { + TQPainter p; p.begin( buffer ); p.fillRect( 0, 0, width(), height(), bgColor() ); @@ -549,18 +549,18 @@ void AVTPlotWidget::paintEvent( QPaintEvent */*e*/ ) { if ( SunSet != -1.0 ) { //If Sun does not set, then just fill the daytime sky color if ( SunSet == 1.0 ) { - p.fillRect( 0, 0, pW, int(0.5*pH), QColor( 0, 100, 200 ) ); + p.fillRect( 0, 0, pW, int(0.5*pH), TQColor( 0, 100, 200 ) ); } else { //Display centered on midnight, so need to modulate dawn/dusk by 0.5 int dawn = int(pW*(0.5 + SunRise)); int dusk = int(pW*(SunSet - 0.5)); - p.fillRect( 0, 0, dusk, int(0.5*pH), QColor( 0, 100, 200 ) ); - p.fillRect( dawn, 0, pW - dawn, int(0.5*pH), QColor( 0, 100, 200 ) ); + p.fillRect( 0, 0, dusk, int(0.5*pH), TQColor( 0, 100, 200 ) ); + p.fillRect( dawn, 0, pW - dawn, int(0.5*pH), TQColor( 0, 100, 200 ) ); //draw twilight gradients unsigned short int W = 40; for ( unsigned short int i=0; i 24.0 ) x -= 24.0; int ix = int(x*pW/24.0); //convert to screen pixel coords - p.setPen( QPen( "white", 2, DotLine ) ); + p.setPen( TQPen( "white", 2, DotLine ) ); p.drawLine( ix, 0, ix, pH ); p.end(); diff --git a/kstars/kstars/tools/altvstime.h b/kstars/kstars/tools/altvstime.h index 1f07b05f..7bf738f7 100644 --- a/kstars/kstars/tools/altvstime.h +++ b/kstars/kstars/tools/altvstime.h @@ -51,7 +51,7 @@ class AVTPlotWidget : public KStarsPlotWidget public: /**Constructor */ - AVTPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0, const char* name=0 ); + AVTPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, TQWidget *parent=0, const char* name=0 ); /**Set the fractional positions of the Sunrise and Sunset positions, *in units where last midnight was 0.0, and next midnight is 1.0. @@ -68,15 +68,15 @@ protected: *draw crosshair lines centered at the cursor position. This *allows the user to pinpoint specific position sin the plot. */ - void mouseMoveEvent( QMouseEvent *e ); + void mouseMoveEvent( TQMouseEvent *e ); /**Simply calls mouseMoveEvent(). */ - void mousePressEvent( QMouseEvent *e ); + void mousePressEvent( TQMouseEvent *e ); /**Redraw the plot. */ - void paintEvent( QPaintEvent *e ); + void paintEvent( TQPaintEvent *e ); private: double SunRise, SunSet; @@ -97,7 +97,7 @@ class AltVsTime : public KDialogBase public: /**Constructor */ - AltVsTime( QWidget* parent = 0); + AltVsTime( TQWidget* parent = 0); /**Destructor */ @@ -133,7 +133,7 @@ public: *@param eName the epoch string to be parsed *@return the epoch number */ - double getEpoch (QString eName); + double getEpoch (TQString eName); /**@short Add a SkyObject to the display. *Constructs a PLotObject representing the Alt-vs-time curve for the object. @@ -162,7 +162,7 @@ public: /**@return a pointer to the list of SkyPoints representing the *objects being displayed. */ - QPtrList* skyPointList() { return &pList; } + TQPtrList* skyPointList() { return &pList; } public slots: /**@short Update the plot to reflec new Date and Location settings. @@ -207,12 +207,12 @@ public slots: private: AVTPlotWidget *View; AltVsTimeUI *avtUI; - QVBoxLayout *topLayout; + TQVBoxLayout *topLayout; GeoLocation *geo; KStars *ks; - QPtrList pList; - QPtrList deleteList; + TQPtrList pList; + TQPtrList deleteList; int DayOffset; bool dirtyFlag; diff --git a/kstars/kstars/tools/astrocalc.cpp b/kstars/kstars/tools/astrocalc.cpp index 5deec02f..3b87826b 100644 --- a/kstars/kstars/tools/astrocalc.cpp +++ b/kstars/kstars/tools/astrocalc.cpp @@ -34,21 +34,21 @@ #include "modcalcvlsr.h" #include -#include -#include +#include +#include -AstroCalc::AstroCalc( QWidget* parent ) : +AstroCalc::AstroCalc( TQWidget* parent ) : KDialogBase( parent, "starscalculator", true, i18n("Calculator"), Close ), JDFrame(0), GeodCoordFrame(0), GalFrame(0), SidFrame(0), PrecFrame(0), AppFrame(0), DayFrame(0), AzelFrame(0), PlanetsFrame(0), EquinoxFrame(0), EclFrame(0), AngDistFrame(0) { - split = new QSplitter ( this ); + split = new TQSplitter ( this ); setMainWidget(split); - navigationPanel = new QListView (split,"NavigationPanel"); - splashScreen = new QTextView (i18n("

KStars Astrocalculator

"),"",split); + navigationPanel = new TQListView (split,"NavigationPanel"); + splashScreen = new TQTextView (i18n("

KStars Astrocalculator

"),"",split); splashScreen->setMaximumWidth(550); splashScreen->setMinimumWidth(400); @@ -58,51 +58,51 @@ AstroCalc::AstroCalc( QWidget* parent ) : navigationPanel->addColumn("Section"); navigationPanel->setRootIsDecorated(1); - QPixmap jdIcon = QPixmap ("jd.png"); - QPixmap geodIcon = QPixmap ("geodetic.png"); - QPixmap solarIcon = QPixmap ("geodetic.png"); - QPixmap sunsetIcon = QPixmap ("sunset.png"); - QPixmap timeIcon = QPixmap ("sunclock.png"); + TQPixmap jdIcon = TQPixmap ("jd.png"); + TQPixmap geodIcon = TQPixmap ("geodetic.png"); + TQPixmap solarIcon = TQPixmap ("geodetic.png"); + TQPixmap sunsetIcon = TQPixmap ("sunset.png"); + TQPixmap timeIcon = TQPixmap ("sunclock.png"); - QListViewItem * timeItem = new QListViewItem(navigationPanel,i18n("Time Calculators")); + TQListViewItem * timeItem = new TQListViewItem(navigationPanel,i18n("Time Calculators")); timeItem->setPixmap(0,timeIcon); - QListViewItem * jdItem = new QListViewItem(timeItem,i18n("Julian Day")); + TQListViewItem * jdItem = new TQListViewItem(timeItem,i18n("Julian Day")); jdItem->setPixmap(0,jdIcon); - new QListViewItem(timeItem,i18n("Sidereal Time")); - new QListViewItem(timeItem,i18n("Day Duration")); - new QListViewItem(timeItem,i18n("Equinoxes & Solstices")); + new TQListViewItem(timeItem,i18n("Sidereal Time")); + new TQListViewItem(timeItem,i18n("Day Duration")); + new TQListViewItem(timeItem,i18n("Equinoxes & Solstices")); // dayItem->setPixmap(0,sunsetIcon); - QListViewItem * coordItem = new QListViewItem(navigationPanel,i18n("Celestial Coordinates")); - new QListViewItem(coordItem,i18n("Galactic Coordinates")); - new QListViewItem(coordItem,i18n("Precession")); - new QListViewItem(coordItem,i18n("Apparent Coordinates")); - new QListViewItem(coordItem,i18n("Horizontal Coordinates")); - new QListViewItem(coordItem,i18n("Ecliptic Coordinates")); - new QListViewItem(coordItem,i18n("Angular Distance")); - new QListViewItem(coordItem,i18n("LSR Velocity")); + TQListViewItem * coordItem = new TQListViewItem(navigationPanel,i18n("Celestial Coordinates")); + new TQListViewItem(coordItem,i18n("Galactic Coordinates")); + new TQListViewItem(coordItem,i18n("Precession")); + new TQListViewItem(coordItem,i18n("Apparent Coordinates")); + new TQListViewItem(coordItem,i18n("Horizontal Coordinates")); + new TQListViewItem(coordItem,i18n("Ecliptic Coordinates")); + new TQListViewItem(coordItem,i18n("Angular Distance")); + new TQListViewItem(coordItem,i18n("LSR Velocity")); - QListViewItem * geoItem = new QListViewItem(navigationPanel,i18n("Earth Coordinates")); + TQListViewItem * geoItem = new TQListViewItem(navigationPanel,i18n("Earth Coordinates")); geoItem->setPixmap(0,geodIcon); - /*QListViewItem * cartItem = */new QListViewItem(geoItem,i18n("Geodetic Coordinates")); + /*TQListViewItem * cartItem = */new TQListViewItem(geoItem,i18n("Geodetic Coordinates")); - QListViewItem * solarItem = new QListViewItem(navigationPanel,i18n("Solar System")); + TQListViewItem * solarItem = new TQListViewItem(navigationPanel,i18n("Solar System")); solarItem->setPixmap(0,solarIcon); - /*QListViewItem * planetsItem = */new QListViewItem(solarItem,i18n("Planets Coordinates")); + /*TQListViewItem * planetsItem = */new TQListViewItem(solarItem,i18n("Planets Coordinates")); - connect(navigationPanel, SIGNAL(clicked(QListViewItem *)), this, - SLOT(slotItemSelection(QListViewItem *))); + connect(navigationPanel, TQT_SIGNAL(clicked(TQListViewItem *)), this, + TQT_SLOT(slotItemSelection(TQListViewItem *))); } AstroCalc::~AstroCalc() { } -void AstroCalc::slotItemSelection(QListViewItem *item) +void AstroCalc::slotItemSelection(TQListViewItem *item) { - QString election; + TQString election; if (item==0L) return; @@ -150,7 +150,7 @@ void AstroCalc::genTimeText(void) { delRightPanel(); - splashScreen = new QTextView ("","",split); + splashScreen = new TQTextView ("","",split); splashScreen->setMaximumWidth(550); splashScreen->setMinimumWidth(400); splashScreen->show(); @@ -177,7 +177,7 @@ void AstroCalc::genTimeText(void) void AstroCalc::genCoordText(void) { delRightPanel(); - splashScreen = new QTextView ("","",split); + splashScreen = new TQTextView ("","",split); splashScreen->setMaximumWidth(550); splashScreen->setMinimumWidth(400); splashScreen->show(); @@ -213,7 +213,7 @@ void AstroCalc::genCoordText(void) void AstroCalc::genGeodText(void) { delRightPanel(); - splashScreen = new QTextView ("","",split); + splashScreen = new TQTextView ("","",split); splashScreen->setMaximumWidth(550); splashScreen->setMinimumWidth(400); splashScreen->show(); @@ -232,7 +232,7 @@ void AstroCalc::genGeodText(void) void AstroCalc::genSolarText(void) { delRightPanel(); - splashScreen = new QTextView ("","",split); + splashScreen = new TQTextView ("","",split); splashScreen->setMaximumWidth(550); splashScreen->setMinimumWidth(400); splashScreen->show(); @@ -374,7 +374,7 @@ void AstroCalc::genVlsrFrame(void) rightPanel = Vlsr; } -QSize AstroCalc::sizeHint() const +TQSize AstroCalc::sizeHint() const { - return QSize(640,430); + return TQSize(640,430); } diff --git a/kstars/kstars/tools/astrocalc.h b/kstars/kstars/tools/astrocalc.h index 84604103..95051f2b 100644 --- a/kstars/kstars/tools/astrocalc.h +++ b/kstars/kstars/tools/astrocalc.h @@ -22,7 +22,7 @@ #include #endif -#include +#include #include #include @@ -60,7 +60,7 @@ class AstroCalc : public KDialogBase Q_OBJECT public: /** construtor */ - AstroCalc(QWidget *parent = 0); + AstroCalc(TQWidget *parent = 0); /** destructor */ ~AstroCalc(); @@ -120,22 +120,22 @@ Q_OBJECT void delRightPanel(void); /**@returns suggested size of calculator window. */ - QSize sizeHint() const; + TQSize sizeHint() const; public slots: - /**Determine which item is selected in the function menu QListBox. + /**Determine which item is selected in the function menu TQListBox. *Generate the corresponding calculator module. */ - void slotItemSelection(QListViewItem *it); + void slotItemSelection(TQListViewItem *it); private: - QSplitter *split; - QListView *navigationPanel, *auxiliar; - QTextView *splashScreen; -// QListViewItem *timeItem, *coordItem, *jdItem, *stItem, *dayItem; - QVBox *vbox, *rightBox; - QString previousElection; + TQSplitter *split; + TQListView *navigationPanel, *auxiliar; + TQTextView *splashScreen; +// TQListViewItem *timeItem, *coordItem, *jdItem, *stItem, *dayItem; + TQVBox *vbox, *rightBox; + TQString previousElection; enum typeOfPanel {GenText, TimeText, GeoText, SolarText, CoordText, JD, SidTime, DayLength, Equinox, GeoCoord, Galactic, Precessor, Apparent, Azel, Planets, Ecliptic, AngDist, Vlsr}; typeOfPanel rightPanel; diff --git a/kstars/kstars/tools/jmoontool.cpp b/kstars/kstars/tools/jmoontool.cpp index 76d4aa67..7d7add93 100644 --- a/kstars/kstars/tools/jmoontool.cpp +++ b/kstars/kstars/tools/jmoontool.cpp @@ -14,8 +14,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -30,13 +30,13 @@ #include "dms.h" #include "ksnumbers.h" -JMoonTool::JMoonTool(QWidget *parent, const char *name) +JMoonTool::JMoonTool(TQWidget *parent, const char *name) : KDialogBase( KDialogBase::Plain, i18n("Jupiter Moons Tool"), Close, Close, parent, name ) { ksw = (KStars*)parent; - QFrame *page = plainPage(); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, 0 ); + TQFrame *page = plainPage(); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, 0 ); colJp = "White"; colIo = "Red"; @@ -44,15 +44,15 @@ JMoonTool::JMoonTool(QWidget *parent, const char *name) colGn = "Orange"; colCa = "YellowGreen"; - QLabel *labIo = new QLabel( "Io", page ); - QLabel *labEu = new QLabel( "Europa", page ); - QLabel *labGn = new QLabel( "Ganymede", page ); - QLabel *labCa = new QLabel( "Callisto", page ); + TQLabel *labIo = new TQLabel( "Io", page ); + TQLabel *labEu = new TQLabel( "Europa", page ); + TQLabel *labGn = new TQLabel( "Ganymede", page ); + TQLabel *labCa = new TQLabel( "Callisto", page ); - labIo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - labEu->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - labGn->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - labCa->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + labIo->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); + labEu->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); + labGn->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); + labCa->setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); labIo->setAlignment( AlignHCenter ); labEu->setAlignment( AlignHCenter ); labGn->setAlignment( AlignHCenter ); @@ -67,7 +67,7 @@ JMoonTool::JMoonTool(QWidget *parent, const char *name) labGn->setPaletteBackgroundColor( "Black" ); labCa->setPaletteBackgroundColor( "Black" ); - QGridLayout *glay = new QGridLayout( 2, 2, 0 ); + TQGridLayout *glay = new TQGridLayout( 2, 2, 0 ); glay->addWidget( labIo, 0, 0 ); glay->addWidget( labEu, 1, 0 ); glay->addWidget( labGn, 0, 1 ); @@ -128,7 +128,7 @@ void JMoonTool::initPlotObjects() { pw->addObject( jpath ); } -void JMoonTool::keyPressEvent( QKeyEvent *e ) { +void JMoonTool::keyPressEvent( TQKeyEvent *e ) { switch ( e->key() ) { case Key_BracketRight: { diff --git a/kstars/kstars/tools/jmoontool.h b/kstars/kstars/tools/jmoontool.h index 57ba53ab..70c33e79 100644 --- a/kstars/kstars/tools/jmoontool.h +++ b/kstars/kstars/tools/jmoontool.h @@ -31,17 +31,17 @@ class JMoonTool : public KDialogBase { Q_OBJECT public: - JMoonTool(QWidget *parent = 0, const char *name = 0); + JMoonTool(TQWidget *parent = 0, const char *name = 0); ~JMoonTool(); protected: - virtual void keyPressEvent( QKeyEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); private: void initPlotObjects(); KStarsPlotWidget *pw; KStars *ksw; - QString colJp, colIo, colEu, colGn, colCa; + TQString colJp, colIo, colEu, colGn, colCa; }; #endif diff --git a/kstars/kstars/tools/kstarsplotwidget.cpp b/kstars/kstars/tools/kstarsplotwidget.cpp index 5e66e2a6..dcbe36b7 100644 --- a/kstars/kstars/tools/kstarsplotwidget.cpp +++ b/kstars/kstars/tools/kstarsplotwidget.cpp @@ -19,16 +19,16 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "kstarsplotwidget.h" -KStarsPlotWidget::KStarsPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent, const char* name ) +KStarsPlotWidget::KStarsPlotWidget( double x1, double x2, double y1, double y2, TQWidget *parent, const char* name ) : KPlotWidget( x1, x2, y1, y2, parent, name ), dXtick2(0.0), dYtick2(0.0), nmajX2(0), nminX2(0), nmajY2(0), nminY2(0), @@ -280,7 +280,7 @@ void KStarsPlotWidget::updateTickmarks() { } //end for iaxis } -void KStarsPlotWidget::drawBox( QPainter *p ) { +void KStarsPlotWidget::drawBox( TQPainter *p ) { int pW = PixRect.width(), pH = PixRect.height(); //First, fill in padding region with bgColor() to mask out-of-bounds plot data @@ -334,7 +334,7 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { if ( dataHeight2() > 0.0 && ( yb() != y() || yb2() != y2() ) ) secondaryYLimits = true; //set small font for tick labels - QFont f = p->font(); + TQFont f = p->font(); int s = f.pointSize(); f.setPointSize( s - 2 ); p->setFont( f ); @@ -358,13 +358,13 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { switch ( xAxisType() ) { case DOUBLE : { - QString str = QString( "%1" ).arg( lab, 0, 'g', 2 ); + TQString str = TQString( "%1" ).arg( lab, 0, 'g', 2 ); int idot = str.find( '.' ); if ( idot >= 0 ) str = str.replace( idot, 1, KGlobal::locale()->decimalSymbol() ); if ( px > 0 && px < pW ) { - QRect r( px - BIGTICKSIZE, pH+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); + TQRect r( px - BIGTICKSIZE, pH+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -376,18 +376,18 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { while ( h > 24 ) { h -= 24; } while ( h < 0 ) { h += 24; } - QString str = QString().sprintf( "%02d:%02d", h, m ); + TQString str = TQString().sprintf( "%02d:%02d", h, m ); if ( px > 0 && px < pW ) { - QRect r( px - BIGTICKSIZE, pH+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); + TQRect r( px - BIGTICKSIZE, pH+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; } case ANGLE : { - QString str = QString().sprintf( "%d%c", int(lab), 176 ); + TQString str = TQString().sprintf( "%d%c", int(lab), 176 ); if ( px > 0 && px < pW ) { - QRect r( px - BIGTICKSIZE, pH+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); + TQRect r( px - BIGTICKSIZE, pH+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -426,13 +426,13 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { switch ( yAxisType() ) { case DOUBLE : { - QString str = QString( "%1" ).arg( lab, 0, 'g', 2 ); + TQString str = TQString( "%1" ).arg( lab, 0, 'g', 2 ); int idot = str.find( '.' ); if ( idot >= 0 ) str = str.replace( idot, 1, KGlobal::locale()->decimalSymbol() ); if ( py > 0 && py < pH ) { - QRect r( -2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); + TQRect r( -2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -444,18 +444,18 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { while ( h > 24 ) { h -= 24; } while ( h < 0 ) { h += 24; } - QString str = QString().sprintf( "%02d:%02d", h, m ); + TQString str = TQString().sprintf( "%02d:%02d", h, m ); if ( py > 0 && py < pH ) { - QRect r( -3*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); + TQRect r( -3*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; } case ANGLE : { - QString str = QString().sprintf( "%d%c", int(lab), 176 ); + TQString str = TQString().sprintf( "%d%c", int(lab), 176 ); if ( py > 0 && py < pH ) { - QRect r( -3*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); + TQRect r( -3*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -492,13 +492,13 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { switch ( xAxisType() ) { case DOUBLE : { - QString str = QString( "%1" ).arg( lab, 0, 'g', 2 ); + TQString str = TQString( "%1" ).arg( lab, 0, 'g', 2 ); int idot = str.find( '.' ); if ( idot >= 0 ) str = str.replace( idot, 1, KGlobal::locale()->decimalSymbol() ); if ( px > 0 && px < pW ) { - QRect r( px - BIGTICKSIZE, -2*BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); + TQRect r( px - BIGTICKSIZE, -2*BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -510,18 +510,18 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { while ( h > 24 ) { h -= 24; } while ( h < 0 ) { h += 24; } - QString str = QString().sprintf( "%02d:%02d", h, m ); + TQString str = TQString().sprintf( "%02d:%02d", h, m ); if ( px > 0 && px < pW ) { - QRect r( px - BIGTICKSIZE, -2*BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); + TQRect r( px - BIGTICKSIZE, -2*BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; } case ANGLE : { - QString str = QString().sprintf( "%d%c", int(lab), 176 ); + TQString str = TQString().sprintf( "%d%c", int(lab), 176 ); if ( px > 0 && px < pW ) { - QRect r( px - BIGTICKSIZE, -2*BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); + TQRect r( px - BIGTICKSIZE, -2*BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -556,13 +556,13 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { switch ( yAxisType() ) { case DOUBLE : { - QString str = QString( "%1" ).arg( lab, 0, 'g', 2 ); + TQString str = TQString( "%1" ).arg( lab, 0, 'g', 2 ); int idot = str.find( '.' ); if ( idot >= 0 ) str = str.replace( idot, 1, KGlobal::locale()->decimalSymbol() ); if ( py > 0 && py < pH ) { - QRect r( pW + 2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); + TQRect r( pW + 2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -574,18 +574,18 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { while ( h > 24 ) { h -= 24; } while ( h < 0 ) { h += 24; } - QString str = QString().sprintf( "%02d:%02d", h, m ); + TQString str = TQString().sprintf( "%02d:%02d", h, m ); if ( py > 0 && py < pH ) { - QRect r( pW + 2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); + TQRect r( pW + 2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; } case ANGLE : { - QString str = QString().sprintf( "%d%c", int(lab), 176 ); + TQString str = TQString().sprintf( "%d%c", int(lab), 176 ); if ( py > 0 && py < pH ) { - QRect r( pW + 3*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); + TQRect r( pW + 3*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } break; @@ -610,11 +610,11 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { //Draw X Axis Label(s) if ( ! BottomAxis.label().isEmpty() ) { - QRect r( 0, PixRect.height() + 2*YPADDING, PixRect.width(), YPADDING ); + TQRect r( 0, PixRect.height() + 2*YPADDING, PixRect.width(), YPADDING ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, BottomAxis.label() ); } if ( ! XAxisLabel2.isEmpty() ) { - QRect r( 0, -3*YPADDING, PixRect.width(), YPADDING ); + TQRect r( 0, -3*YPADDING, PixRect.width(), YPADDING ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, XAxisLabel2 ); } @@ -627,7 +627,7 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { p->translate( -3*XPADDING, PixRect.height() ); p->rotate( -90.0 ); - QRect r( 0, 0, PixRect.height(), XPADDING ); + TQRect r( 0, 0, PixRect.height(), XPADDING ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, LeftAxis.label() ); //draw the label, now that we are sideways p->restore(); //restore translation/rotation state @@ -640,7 +640,7 @@ void KStarsPlotWidget::drawBox( QPainter *p ) { p->translate( PixRect.width() + 2*XPADDING, PixRect.height() ); p->rotate( -90.0 ); - QRect r( 0, 0, PixRect.height(), XPADDING ); + TQRect r( 0, 0, PixRect.height(), XPADDING ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, YAxisLabel2 ); //draw the label, now that we are sideways p->restore(); //restore translation/rotation state diff --git a/kstars/kstars/tools/kstarsplotwidget.h b/kstars/kstars/tools/kstarsplotwidget.h index 554f4a80..dd28f195 100644 --- a/kstars/kstars/tools/kstarsplotwidget.h +++ b/kstars/kstars/tools/kstarsplotwidget.h @@ -18,7 +18,7 @@ #ifndef _KSTARSPLOTWIDGET_H_ #define _KSTARSPLOTWIDGET_H_ -#include +#include #include #define BIGTICKSIZE 10 @@ -41,7 +41,7 @@ class KStarsPlotWidget : public KPlotWidget { public: /**Constructor */ - KStarsPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0, const char* name=0 ); + KStarsPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, TQWidget *parent=0, const char* name=0 ); /**Destructor (empty) */ @@ -95,12 +95,12 @@ public: *@param xlabel a short string describing the data plotted on the x-axis. *Set the label to an empty string to omit the axis label. */ - virtual void setXAxisLabel2( QString xlabel ) { XAxisLabel2 = xlabel; } + virtual void setXAxisLabel2( TQString xlabel ) { XAxisLabel2 = xlabel; } /**@short set the secondary Y-axis label *@param ylabel a short string describing the data plotted on the y-axis. *Set the label to an empty string to omit the axis label. */ - virtual void setYAxisLabel2( QString ylabel ) { YAxisLabel2 = ylabel; } + virtual void setYAxisLabel2( TQString ylabel ) { YAxisLabel2 = ylabel; } /**@returns the number of pixels to the right of the plot area. *Padding values are set to -1 by default; if unchanged, this function will try to guess @@ -114,7 +114,7 @@ public: int topPadding() const; protected: - void drawBox( QPainter *p ); + void drawBox( TQPainter *p ); double dXtick2, dYtick2; int nmajX2, nminX2, nmajY2, nminY2; @@ -122,7 +122,7 @@ protected: double XScaleFactor, YScaleFactor; DRect DataRect2; - QString XAxisLabel2, YAxisLabel2; + TQString XAxisLabel2, YAxisLabel2; }; #endif diff --git a/kstars/kstars/tools/lcgenerator.cpp b/kstars/kstars/tools/lcgenerator.cpp index 39a535f2..bc682bbb 100644 --- a/kstars/kstars/tools/lcgenerator.cpp +++ b/kstars/kstars/tools/lcgenerator.cpp @@ -15,18 +15,18 @@ * * ***************************************************************************/ -#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -39,7 +39,7 @@ #include -LCGenerator::LCGenerator( QWidget* parent) +LCGenerator::LCGenerator( TQWidget* parent) : KDialogBase( parent, "lcgenerator", false, i18n( "AAVSO Light Curve Generator"),0) , Hostprefix("http://www.aavso.org/cgi-bin/kstar.pl"), JDCutOff(2437600) { @@ -48,7 +48,7 @@ LCGenerator::LCGenerator( QWidget* parent) downloadJob = 0; - file = new QFile(); + file = new TQFile(); } LCGenerator::~LCGenerator() @@ -60,24 +60,24 @@ LCGenerator::~LCGenerator() void LCGenerator::createGUI() { - QWidget *page = new QWidget(this); + TQWidget *page = new TQWidget(this); setMainWidget(page); - LCGeneratorDialogLayout = new QVBoxLayout( page, 11, 6, "LCGeneratorDialogLayout"); + LCGeneratorDialogLayout = new TQVBoxLayout( page, 11, 6, "LCGeneratorDialogLayout"); - SDLayout = new QHBoxLayout( 0, 0, 6, "SDLayout"); + SDLayout = new TQHBoxLayout( 0, 0, 6, "SDLayout"); - StarInfoBox = new QGroupBox( page, "StarInfoBox" ); + StarInfoBox = new TQGroupBox( page, "StarInfoBox" ); StarInfoBox->setColumnLayout(0, Qt::Vertical ); StarInfoBox->layout()->setSpacing( 6 ); StarInfoBox->layout()->setMargin( 11 ); - StarInfoBoxLayout = new QVBoxLayout( StarInfoBox->layout() ); + StarInfoBoxLayout = new TQVBoxLayout( StarInfoBox->layout() ); StarInfoBoxLayout->setAlignment( Qt::AlignTop ); - DesignHLayout = new QHBoxLayout( 0, 0, 6, "DesignHLayout"); + DesignHLayout = new TQHBoxLayout( 0, 0, 6, "DesignHLayout"); - desigLabel = new QLabel( StarInfoBox, "desigLabel" ); - desigLabel->setMinimumSize( QSize( 70, 0 ) ); + desigLabel = new TQLabel( StarInfoBox, "desigLabel" ); + desigLabel->setMinimumSize( TQSize( 70, 0 ) ); DesignHLayout->addWidget( desigLabel ); DesignationIn = new KListBox( StarInfoBox, "DesignationIn" ); @@ -88,10 +88,10 @@ void LCGenerator::createGUI() for (uint i=0; i< (ksw->data()->VariableStarsList.count()); i++) DesignationIn->insertItem(ksw->data()->VariableStarsList.at(i)->Designation); - NameHLayout = new QHBoxLayout( 0, 0, 6, "NameHLayout"); + NameHLayout = new TQHBoxLayout( 0, 0, 6, "NameHLayout"); - nameLabel = new QLabel( StarInfoBox, "nameLabel" ); - nameLabel->setMinimumSize( QSize( 70, 0 ) ); + nameLabel = new TQLabel( StarInfoBox, "nameLabel" ); + nameLabel->setMinimumSize( TQSize( 70, 0 ) ); NameHLayout->addWidget( nameLabel ); NameIn = new KListBox( StarInfoBox, "NameIn" ); @@ -102,20 +102,20 @@ void LCGenerator::createGUI() for (uint i=0; idata()->VariableStarsList.count(); i++) NameIn->insertItem(ksw->data()->VariableStarsList.at(i)->Name); - StartHLayout = new QHBoxLayout( 0, 0, 6, "StartHLayout"); + StartHLayout = new TQHBoxLayout( 0, 0, 6, "StartHLayout"); - startLabel = new QLabel( StarInfoBox, "startLabel" ); - startLabel->setMinimumSize( QSize( 70, 0 ) ); + startLabel = new TQLabel( StarInfoBox, "startLabel" ); + startLabel->setMinimumSize( TQSize( 70, 0 ) ); StartHLayout->addWidget( startLabel ); StartDateIn = new KLineEdit( StarInfoBox, "StartDateIn" ); StartHLayout->addWidget( StartDateIn ); StarInfoBoxLayout->addLayout( StartHLayout ); - EndHLayout = new QHBoxLayout( 0, 0, 6, "EndHLayout"); + EndHLayout = new TQHBoxLayout( 0, 0, 6, "EndHLayout"); - endLabel = new QLabel( StarInfoBox, "endLabel" ); - endLabel->setMinimumSize( QSize( 70, 0 ) ); + endLabel = new TQLabel( StarInfoBox, "endLabel" ); + endLabel->setMinimumSize( TQSize( 70, 0 ) ); EndHLayout->addWidget( endLabel ); EndDateIn = new KLineEdit( StarInfoBox, "EndDateIn" ); @@ -123,62 +123,62 @@ void LCGenerator::createGUI() StarInfoBoxLayout->addLayout( EndHLayout ); SDLayout->addWidget( StarInfoBox ); - DataSelectBox = new QGroupBox( page, "DataSelectBox" ); + DataSelectBox = new TQGroupBox( page, "DataSelectBox" ); DataSelectBox->setColumnLayout(0, Qt::Vertical ); DataSelectBox->layout()->setSpacing( 6 ); DataSelectBox->layout()->setMargin( 11 ); - DataSelectBoxLayout = new QVBoxLayout( DataSelectBox->layout() ); + DataSelectBoxLayout = new TQVBoxLayout( DataSelectBox->layout() ); DataSelectBoxLayout->setAlignment( Qt::AlignTop ); - VisualCheck = new QCheckBox( DataSelectBox, "VisualCheck" ); + VisualCheck = new TQCheckBox( DataSelectBox, "VisualCheck" ); VisualCheck->setChecked( TRUE ); DataSelectBoxLayout->addWidget( VisualCheck ); - FainterCheck = new QCheckBox( DataSelectBox, "FainterCheck" ); + FainterCheck = new TQCheckBox( DataSelectBox, "FainterCheck" ); FainterCheck->setChecked( TRUE ); DataSelectBoxLayout->addWidget( FainterCheck ); - DiscrepantCheck = new QCheckBox( DataSelectBox, "DiscrepantCheck" ); + DiscrepantCheck = new TQCheckBox( DataSelectBox, "DiscrepantCheck" ); DataSelectBoxLayout->addWidget( DiscrepantCheck ); - CCDBCheck = new QCheckBox( DataSelectBox, "CCDBCheck" ); + CCDBCheck = new TQCheckBox( DataSelectBox, "CCDBCheck" ); CCDBCheck->setChecked( TRUE ); DataSelectBoxLayout->addWidget( CCDBCheck ); - CCDVCheck = new QCheckBox( DataSelectBox, "CCDVCheck" ); + CCDVCheck = new TQCheckBox( DataSelectBox, "CCDVCheck" ); CCDVCheck->setChecked( TRUE ); DataSelectBoxLayout->addWidget( CCDVCheck ); - CCDRCheck = new QCheckBox( DataSelectBox, "CCDRCheck" ); + CCDRCheck = new TQCheckBox( DataSelectBox, "CCDRCheck" ); CCDRCheck->setChecked( TRUE ); DataSelectBoxLayout->addWidget( CCDRCheck ); - CCDICheck = new QCheckBox( DataSelectBox, "CCDICheck" ); + CCDICheck = new TQCheckBox( DataSelectBox, "CCDICheck" ); CCDICheck->setChecked( TRUE ); DataSelectBoxLayout->addWidget( CCDICheck ); - PlotHLayout = new QHBoxLayout( 0, 0, 6, "PlotHLayout"); + PlotHLayout = new TQHBoxLayout( 0, 0, 6, "PlotHLayout"); - plotLabel = new QLabel( DataSelectBox, "plotLabel" ); + plotLabel = new TQLabel( DataSelectBox, "plotLabel" ); PlotHLayout->addWidget( plotLabel ); AverageDayIn = new KLineEdit( DataSelectBox, "AverageDayIn" ); PlotHLayout->addWidget( AverageDayIn ); - daysLabel = new QLabel( DataSelectBox, "daysLabel" ); + daysLabel = new TQLabel( DataSelectBox, "daysLabel" ); PlotHLayout->addWidget( daysLabel ); DataSelectBoxLayout->addLayout( PlotHLayout ); SDLayout->addWidget( DataSelectBox ); LCGeneratorDialogLayout->addLayout( SDLayout ); - ButtonHLayout = new QHBoxLayout( 0, 0, 6, "ButtonHLayout"); + ButtonHLayout = new TQHBoxLayout( 0, 0, 6, "ButtonHLayout"); GetCurveButton = new KPushButton( page, "GetCurveButton" ); ButtonHLayout->addWidget( GetCurveButton ); UpdateListButton = new KPushButton( page, "UpdateListButton" ); ButtonHLayout->addWidget( UpdateListButton ); - QSpacerItem* spacer = new QSpacerItem( 128, 16, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 128, 16, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); ButtonHLayout->addItem( spacer ); CloseButton = new KPushButton( page, "closeButton" ); @@ -190,9 +190,9 @@ void LCGenerator::createGUI() desigLabel->setText( i18n( "Designation:" ) ); nameLabel->setText( i18n( "Or name:" ) ); startLabel->setText( i18n( "Start date:" ) ); - QWhatsThis::add( startLabel, i18n( "Start date for the light curve plot in mm/dd/yy or JD" ) ); + TQWhatsThis::add( startLabel, i18n( "Start date for the light curve plot in mm/dd/yy or JD" ) ); endLabel->setText( i18n( "End date:" ) ); - QWhatsThis::add( endLabel, i18n( "End date for the light curve plot in mm/dd/yy or JD" ) ); + TQWhatsThis::add( endLabel, i18n( "End date for the light curve plot in mm/dd/yy or JD" ) ); StartDateIn->setText( i18n( "default" ) ); EndDateIn->setText( i18n( "default" ) ); DataSelectBox->setTitle( i18n( "Data Selection" ) ); @@ -209,22 +209,22 @@ void LCGenerator::createGUI() UpdateListButton->setText( i18n( "Update List" ) ); CloseButton->setText( i18n( "Close" ) ); - resize( QSize(500, 360) ); + resize( TQSize(500, 360) ); // Signals/Slots - QObject::connect(CloseButton, SIGNAL(clicked()), this, SLOT(close())); - QObject::connect(GetCurveButton, SIGNAL(clicked()), this, SLOT(VerifyData())); - QObject::connect(UpdateListButton, SIGNAL(clicked()), this, SLOT(updateStarList())); - QObject::connect(DesignationIn, SIGNAL(highlighted(int)), this, SLOT(updateNameList(int))); - QObject::connect(NameIn, SIGNAL(highlighted(int)), this, SLOT(updateDesigList(int))); + TQObject::connect(CloseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(close())); + TQObject::connect(GetCurveButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(VerifyData())); + TQObject::connect(UpdateListButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateStarList())); + TQObject::connect(DesignationIn, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(updateNameList(int))); + TQObject::connect(NameIn, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(updateDesigList(int))); } void LCGenerator::VerifyData() { - QString InitialStartDate, InitialEndDate; - QString FinalDesignation, FinalStartDate, FinalEndDate, AverageDays; + TQString InitialStartDate, InitialEndDate; + TQString FinalDesignation, FinalStartDate, FinalEndDate, AverageDays; bool AverageDaysOK; // Get initial user input @@ -266,14 +266,14 @@ void LCGenerator::VerifyData() } } - else AverageDays = QString("default"); + else AverageDays = TQString("default"); //Download the curve! DownloadCurve(FinalStartDate, FinalEndDate, FinalDesignation, AverageDays); } -bool LCGenerator::setJD(QString Date, QString *JD, int JDType) +bool LCGenerator::setJD(TQString Date, TQString *JD, int JDType) { uint i=0; int TempJD=0; @@ -283,9 +283,9 @@ bool LCGenerator::setJD(QString Date, QString *JD, int JDType) int dateFormat[3]; bool isNumber; - const QString invalidFormatStartJD(i18n("Invalid date format. Correct format is mm/dd/yyyy or JD, leave 'default' to generate light curves for the past 500 days.")); - const QString invalidFormatENDJD(i18n("Invalid date format. Correct format is mm/dd/yyyy or JD, leave 'default' to generate light curves until today.")); - QString invalidFormatMsg(JDType ? invalidFormatENDJD : invalidFormatStartJD); + const TQString invalidFormatStartJD(i18n("Invalid date format. Correct format is mm/dd/yyyy or JD, leave 'default' to generate light curves for the past 500 days.")); + const TQString invalidFormatENDJD(i18n("Invalid date format. Correct format is mm/dd/yyyy or JD, leave 'default' to generate light curves until today.")); + TQString invalidFormatMsg(JDType ? invalidFormatENDJD : invalidFormatStartJD); // check for "default" date @@ -325,7 +325,7 @@ bool LCGenerator::setJD(QString Date, QString *JD, int JDType) else { const char* invalidJD = I18N_NOOP("No data available for JD prior to %d"); - KMessageBox::error(this, QString().sprintf(invalidJD, JDCutOff)); + KMessageBox::error(this, TQString().sprintf(invalidJD, JDCutOff)); return false; } } @@ -361,18 +361,18 @@ bool LCGenerator::setJD(QString Date, QString *JD, int JDType) else { const char* invalidJD = I18N_NOOP("No data available for JD prior to %d"); - KMessageBox::error(this, QString().sprintf(invalidJD, JDCutOff)); + KMessageBox::error(this, TQString().sprintf(invalidJD, JDCutOff)); return false; } } -void LCGenerator::DownloadCurve(QString FinalStartDate, QString FinalEndDate, QString FinalDesignation, QString AverageDay) +void LCGenerator::DownloadCurve(TQString FinalStartDate, TQString FinalEndDate, TQString FinalDesignation, TQString AverageDay) { - QString buf(Hostprefix); - QString Yes("yes"); - QString No("no"); + TQString buf(Hostprefix); + TQString Yes("yes"); + TQString No("no"); //FainterCheck; //CCDVCheck; @@ -397,7 +397,7 @@ void LCGenerator::DownloadCurve(QString FinalStartDate, QString FinalEndDate, QS KURL url(buf); - QString message = i18n( "Light Curve produced by the American Amateur Variable Star Observers" ); + TQString message = i18n( "Light Curve produced by the American Amateur Variable Star Observers" ); // parent of imageview is KStars new ImageViewer(&url, message, ksw, "lightcurve"); @@ -427,7 +427,7 @@ void LCGenerator::updateStarList() KURL saveFile (file->name()); downloadJob = KIO::file_copy (AAVSOFile, saveFile, -1, true); - connect (downloadJob, SIGNAL (result (KIO::Job *)), SLOT (downloadReady (KIO::Job *))); + connect (downloadJob, TQT_SIGNAL (result (KIO::Job *)), TQT_SLOT (downloadReady (KIO::Job *))); } void LCGenerator::downloadReady(KIO::Job * job) @@ -468,7 +468,7 @@ downloadJob = 0; } -void LCGenerator::closeEvent (QCloseEvent *ev) +void LCGenerator::closeEvent (TQCloseEvent *ev) { if (ev) // not if closeEvent (0) is called, because segfault ev->accept(); // parent-widgets should not get this event, so it will be filtered diff --git a/kstars/kstars/tools/lcgenerator.h b/kstars/kstars/tools/lcgenerator.h index 0aeb177f..0e676be6 100644 --- a/kstars/kstars/tools/lcgenerator.h +++ b/kstars/kstars/tools/lcgenerator.h @@ -27,7 +27,7 @@ #ifndef LCGENERATOR_H #define LCGENERATOR_H -#include +#include #include #include @@ -47,8 +47,8 @@ class KStars; struct VariableStarInfo { - QString Name; - QString Designation; + TQString Name; + TQString Designation; }; class LCGenerator : public KDialogBase @@ -59,7 +59,7 @@ public: /**Constructor *@p parent pointer to the parent widget */ - LCGenerator( QWidget* parent = 0); + LCGenerator( TQWidget* parent = 0); /**Destructor */ ~LCGenerator(); @@ -74,7 +74,7 @@ private: *@param JDType start or end JD *@returns true if conversion is successful */ - bool setJD(QString date, QString * JD, int JDType); + bool setJD(TQString date, TQString * JD, int JDType); /** Parses star information and connects to the AAVSO server with the information embedded in the URL *@param FinalStartDate The start date in Julian days @@ -82,57 +82,57 @@ private: *@param FinalDesignation The AAVSO star designation *@param AverageDay Number of average days for binning the light curve */ - void DownloadCurve(QString FinalStartDate, QString FinalEndDate, QString FinalDesignation, QString AverageDay); + void DownloadCurve(TQString FinalStartDate, TQString FinalEndDate, TQString FinalDesignation, TQString AverageDay); KStars *ksw; - const QString Hostprefix; + const TQString Hostprefix; const int JDCutOff; - QGroupBox* StarInfoBox; - QLabel* desigLabel; + TQGroupBox* StarInfoBox; + TQLabel* desigLabel; KListBox* DesignationIn; - QLabel* nameLabel; + TQLabel* nameLabel; KListBox* NameIn; - QLabel* startLabel; + TQLabel* startLabel; KLineEdit* StartDateIn; - QLabel* endLabel; + TQLabel* endLabel; KLineEdit* EndDateIn; - QGroupBox* DataSelectBox; - QCheckBox* VisualCheck; - QCheckBox* FainterCheck; - QCheckBox* DiscrepantCheck; - QCheckBox* CCDBCheck; - QCheckBox* CCDVCheck; - QCheckBox* CCDRCheck; - QCheckBox* CCDICheck; - QLabel* plotLabel; + TQGroupBox* DataSelectBox; + TQCheckBox* VisualCheck; + TQCheckBox* FainterCheck; + TQCheckBox* DiscrepantCheck; + TQCheckBox* CCDBCheck; + TQCheckBox* CCDVCheck; + TQCheckBox* CCDRCheck; + TQCheckBox* CCDICheck; + TQLabel* plotLabel; KLineEdit* AverageDayIn; - QLabel* daysLabel; + TQLabel* daysLabel; KPushButton* GetCurveButton; KPushButton* UpdateListButton; KPushButton* CloseButton; - QVBoxLayout* LCGeneratorDialogLayout; - QHBoxLayout* SDLayout; - QVBoxLayout* StarInfoBoxLayout; - QHBoxLayout* DesignHLayout; - QHBoxLayout* NameHLayout; - QHBoxLayout* StartHLayout; - QHBoxLayout* EndHLayout; - QVBoxLayout* DataSelectBoxLayout; - QHBoxLayout* PlotHLayout; - QHBoxLayout* ButtonHLayout; + TQVBoxLayout* LCGeneratorDialogLayout; + TQHBoxLayout* SDLayout; + TQVBoxLayout* StarInfoBoxLayout; + TQHBoxLayout* DesignHLayout; + TQHBoxLayout* NameHLayout; + TQHBoxLayout* StartHLayout; + TQHBoxLayout* EndHLayout; + TQVBoxLayout* DataSelectBoxLayout; + TQHBoxLayout* PlotHLayout; + TQHBoxLayout* ButtonHLayout; KIO::Job *downloadJob; // download job of image -> 0 == no job is running - QFile *file; + TQFile *file; /**Make sure all events have been processed before closing the dialog - *@p ev pointer to the QCloseEvent object + *@p ev pointer to the TQCloseEvent object */ - void closeEvent (QCloseEvent *ev); + void closeEvent (TQCloseEvent *ev); public slots: /** Checks if a star name or designation exists in the database, diff --git a/kstars/kstars/tools/modcalcangdist.cpp b/kstars/kstars/tools/modcalcangdist.cpp index 40969152..750ae6d6 100644 --- a/kstars/kstars/tools/modcalcangdist.cpp +++ b/kstars/kstars/tools/modcalcangdist.cpp @@ -21,16 +21,16 @@ #include "dmsbox.h" #include "skypoint.h" -#include -#include -#include +#include +#include +#include #include #include #include //#include ..already included in modcalcapcoord.h -modCalcAngDist::modCalcAngDist(QWidget *parentSplit, const char *name) : modCalcAngDistDlg(parentSplit,name) { +modCalcAngDist::modCalcAngDist(TQWidget *parentSplit, const char *name) : modCalcAngDistDlg(parentSplit,name) { ra0Box->setDegType(FALSE); ra1Box->setDegType(FALSE); @@ -76,41 +76,41 @@ void modCalcAngDist::slotComputeDist(){ } void modCalcAngDist::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcAngDist::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcAngDist::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -118,20 +118,20 @@ void modCalcAngDist::slotRunBatch() { } } -//void modCalcAngDist::processLines( const QFile * fIn ) { -void modCalcAngDist::processLines( QTextStream &istream ) { +//void modCalcAngDist::processLines( const TQFile * fIn ) { +void modCalcAngDist::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; SkyPoint sp0, sp1; dms ra0B, dec0B, ra1B, dec1B, dist; @@ -142,7 +142,7 @@ void modCalcAngDist::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; diff --git a/kstars/kstars/tools/modcalcangdist.h b/kstars/kstars/tools/modcalcangdist.h index 27176945..ee13374a 100644 --- a/kstars/kstars/tools/modcalcangdist.h +++ b/kstars/kstars/tools/modcalcangdist.h @@ -36,7 +36,7 @@ class modCalcAngDist : public modCalcAngDistDlg { Q_OBJECT public: /**Constructor. */ - modCalcAngDist(QWidget *p, const char *n); + modCalcAngDist(TQWidget *p, const char *n); /**Destructor. */ ~modCalcAngDist(); @@ -49,7 +49,7 @@ public slots: private: /** Process Lines **/ - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); /**@returns a SkyPoint constructed from the coordinates in the RA and Dec dmsBoxes. */ SkyPoint getCoords(dmsBox * rBox, dmsBox* dBox); diff --git a/kstars/kstars/tools/modcalcapcoord.cpp b/kstars/kstars/tools/modcalcapcoord.cpp index 1c9a4578..27f4bc0c 100644 --- a/kstars/kstars/tools/modcalcapcoord.cpp +++ b/kstars/kstars/tools/modcalcapcoord.cpp @@ -26,18 +26,18 @@ #include "kstarsdatetime.h" #include "libkdeedu/extdate/extdatetimeedit.h" -#include -#include -#include //needed for QTimeEdit +#include +#include +#include //needed for QTimeEdit #include -#include +#include #include #include #include //#include ..already included in modcalcapcoord.h -modCalcApCoord::modCalcApCoord(QWidget *parentSplit, const char *name) : modCalcApCoordDlg(parentSplit,name) { +modCalcApCoord::modCalcApCoord(TQWidget *parentSplit, const char *name) : modCalcApCoordDlg(parentSplit,name) { showCurrentTime(); ra0Box->setDegType(FALSE); @@ -74,7 +74,7 @@ KStarsDateTime modCalcApCoord::getDateTime (void) return KStarsDateTime( datBox->date() , timBox->time() ); } -double modCalcApCoord::getEpoch (QString eName) { +double modCalcApCoord::getEpoch (TQString eName) { bool ok = false; double epoch = eName.toDouble(&ok); @@ -99,7 +99,7 @@ void modCalcApCoord::slotClearCoords(){ decfBox->clearFields(); epoch0Name->setText(""); datBox->setDate(ExtDate::currentDate()); - timBox->setTime(QTime(0,0,0)); + timBox->setTime(TQTime(0,0,0)); } void modCalcApCoord::slotComputeCoords(){ @@ -160,41 +160,41 @@ void modCalcApCoord::slotEpochCheckedBatch(){ } void modCalcApCoord::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcApCoord::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcApCoord::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -202,24 +202,24 @@ void modCalcApCoord::slotRunBatch() { } } -//void modCalcApCoord::processLines( const QFile * fIn ) { -void modCalcApCoord::processLines( QTextStream &istream ) { +//void modCalcApCoord::processLines( const TQFile * fIn ) { +void modCalcApCoord::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; long double jd, jd0; SkyPoint sp; - QTime utB; + TQTime utB; ExtDate dtB; dms raB, decB; double epoch0B; @@ -230,14 +230,14 @@ void modCalcApCoord::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; // Read Ut and write in ostream if corresponds if(utCheckBatch->isChecked() ) { - utB = QTime::fromString( fields[i] ); + utB = TQTime::fromString( fields[i] ); i++; } else utB = utBoxBatch->time(); diff --git a/kstars/kstars/tools/modcalcapcoord.h b/kstars/kstars/tools/modcalcapcoord.h index dae968fe..4ac09b38 100644 --- a/kstars/kstars/tools/modcalcapcoord.h +++ b/kstars/kstars/tools/modcalcapcoord.h @@ -38,7 +38,7 @@ class modCalcApCoord : public modCalcApCoordDlg { Q_OBJECT public: /**Constructor. */ - modCalcApCoord(QWidget *p, const char *n); + modCalcApCoord(TQWidget *p, const char *n); /**Destructor. */ ~modCalcApCoord(); @@ -49,8 +49,8 @@ public: SkyPoint apparentCoordinates (dms r0, dms d0, long double j0, long double jf); /** Process Lines **/ -// void processLines( const QFile * f ); - void processLines( QTextStream &istream ); +// void processLines( const TQFile * f ); + void processLines( TQTextStream &istream ); public slots: @@ -78,7 +78,7 @@ private: KStarsDateTime getDateTime (void); /**Parse the string argument as a double */ - double getEpoch (QString eName); + double getEpoch (TQString eName); /**Fill the RA and Dec dmsBoxes with values of the SkyPoint argument. */ void showEquCoords ( SkyPoint sp ); diff --git a/kstars/kstars/tools/modcalcazel.cpp b/kstars/kstars/tools/modcalcazel.cpp index a9ba9881..a2dee393 100644 --- a/kstars/kstars/tools/modcalcazel.cpp +++ b/kstars/kstars/tools/modcalcazel.cpp @@ -27,16 +27,16 @@ #include "kstarsdatetime.h" #include "libkdeedu/extdate/extdatetimeedit.h" -#include //need for QTimeEdit -#include -#include -#include -#include +#include //need for QTimeEdit +#include +#include +#include +#include #include #include -modCalcAzel::modCalcAzel(QWidget *parentSplit, const char *name) : modCalcAzelDlg (parentSplit,name) { +modCalcAzel::modCalcAzel(TQWidget *parentSplit, const char *name) : modCalcAzelDlg (parentSplit,name) { showCurrentDateTime(); initGeo(); @@ -94,7 +94,7 @@ KStarsDateTime modCalcAzel::getDateTime (void) return KStarsDateTime( datBox->date() , timBox->time() ); } -double modCalcAzel::getEpoch (QString eName) +double modCalcAzel::getEpoch (TQString eName) { bool ok = false; double epoch = eName.toDouble(&ok); @@ -180,7 +180,7 @@ void modCalcAzel::slotClearCoords() epochName->setText(""); datBox->setDate(ExtDate::currentDate()); - timBox->setTime(QTime(0,0,0)); + timBox->setTime(TQTime(0,0,0)); } @@ -307,40 +307,40 @@ void modCalcAzel::equNoCheck() { void modCalcAzel::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcAzel::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcAzel::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -348,26 +348,26 @@ void modCalcAzel::slotRunBatch() { } } -void modCalcAzel::processLines( QTextStream &istream ) { +void modCalcAzel::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; long double jd0, jdf; dms LST; SkyPoint sp; dms raB, decB, latB, longB, azB, elB; double epoch0B; - QTime utB; + TQTime utB; ExtDate dtB; while ( ! istream.eof() ) { @@ -376,14 +376,14 @@ void modCalcAzel::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; // Read Ut and write in ostream if corresponds if(utCheckBatch->isChecked() ) { - utB = QTime::fromString( fields[i] ); + utB = TQTime::fromString( fields[i] ); i++; } else utB = utBoxBatch->time(); diff --git a/kstars/kstars/tools/modcalcazel.h b/kstars/kstars/tools/modcalcazel.h index 9bbe0546..9ef67f6f 100644 --- a/kstars/kstars/tools/modcalcazel.h +++ b/kstars/kstars/tools/modcalcazel.h @@ -19,7 +19,7 @@ #define MODCALCAZEL_H #include -#include +#include #include "modcalcazeldlg.h" class QWidget; @@ -37,7 +37,7 @@ class modCalcAzel : public modCalcAzelDlg { Q_OBJECT public: - modCalcAzel(QWidget *p, const char *n); + modCalcAzel(TQWidget *p, const char *n); ~modCalcAzel(); public slots: @@ -80,7 +80,7 @@ private: * @param eName String from which the epoch is to be constructed * once it is converted to a double */ - double getEpoch (QString eName); + double getEpoch (TQString eName); /**Fill the Az and El dmsBoxes with values of the SkyPoint argument. * @param sp SkypPoint object which contains the coordinates to @@ -114,7 +114,7 @@ private: void horNoCheck(); void equNoCheck(); - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); GeoLocation *geoPlace; bool horInputCoords; diff --git a/kstars/kstars/tools/modcalcdaylength.cpp b/kstars/kstars/tools/modcalcdaylength.cpp index 9a31dfe2..dcfba7bd 100644 --- a/kstars/kstars/tools/modcalcdaylength.cpp +++ b/kstars/kstars/tools/modcalcdaylength.cpp @@ -30,7 +30,7 @@ #include -modCalcDayLength::modCalcDayLength(QWidget *parentSplit, const char *name) : modCalcDayLengthDlg(parentSplit,name) { +modCalcDayLength::modCalcDayLength(TQWidget *parentSplit, const char *name) : modCalcDayLengthDlg(parentSplit,name) { showCurrentDate(); initGeo(); show(); @@ -61,7 +61,7 @@ void modCalcDayLength::getGeoLocation (void) KStarsDateTime modCalcDayLength::getDateTime (void) { - return KStarsDateTime( datBox->date() , QTime(8,0,0) ); + return KStarsDateTime( datBox->date() , TQTime(8,0,0) ); } void modCalcDayLength::slotClearCoords(){ @@ -82,10 +82,10 @@ void modCalcDayLength::slotClearCoords(){ dayLBox->clearFields(); } -QTime modCalcDayLength::lengthOfDay(QTime setQTime, QTime riseQTime){ - QTime dL(0,0,0); +TQTime modCalcDayLength::lengthOfDay(TQTime setQTime, TQTime riseQTime){ + TQTime dL(0,0,0); int dds = riseQTime.secsTo(setQTime); - QTime dLength = dL.addSecs( dds ); + TQTime dLength = dL.addSecs( dds ); return dLength; } @@ -99,9 +99,9 @@ void modCalcDayLength::slotComputePosTime() KSSun *Sun = new KSSun(((KStars*) parent()->parent()->parent())->data()); Sun->findPosition(num); - QTime setQtime = Sun->riseSetTime( jd0 , geoPlace, false ); - QTime riseQtime = Sun->riseSetTime( jd0 , geoPlace, true ); - QTime transitQtime = Sun->transitTime(jd0 , geoPlace); + TQTime setQtime = Sun->riseSetTime( jd0 , geoPlace, false ); + TQTime riseQtime = Sun->riseSetTime( jd0 , geoPlace, true ); + TQTime transitQtime = Sun->transitTime(jd0 , geoPlace); dms setAz = Sun->riseSetTimeAz(jd0, geoPlace, false); dms riseAz = Sun->riseSetTimeAz(jd0, geoPlace, true); @@ -116,7 +116,7 @@ void modCalcDayLength::slotComputePosTime() riseTimeBox->showTime( riseQtime ); transitTimeBox->showTime( transitQtime ); - QTime dayLQtime = lengthOfDay (setQtime,riseQtime); + TQTime dayLQtime = lengthOfDay (setQtime,riseQtime); dayLBox->showTime( dayLQtime ); } else if (transAlt.Degrees() > 0. ) { @@ -139,7 +139,7 @@ void modCalcDayLength::slotComputePosTime() riseTimeBox->clearFields(); transitTimeBox->clearFields(); - dayLBox->showTime( QTime(0,0,0) ); + dayLBox->showTime( TQTime(0,0,0) ); } delete num; diff --git a/kstars/kstars/tools/modcalcdaylength.h b/kstars/kstars/tools/modcalcdaylength.h index 1c644157..4ad88142 100644 --- a/kstars/kstars/tools/modcalcdaylength.h +++ b/kstars/kstars/tools/modcalcdaylength.h @@ -32,7 +32,7 @@ class modCalcDayLength : public modCalcDayLengthDlg { Q_OBJECT public: /**Constructor. */ - modCalcDayLength(QWidget *p, const char *n); + modCalcDayLength(TQWidget *p, const char *n); /**Destructor. */ ~modCalcDayLength(); @@ -44,7 +44,7 @@ public slots: private: /**@returns a SkyPoint constructed from the coordinates in the RA and Dec dmsBoxes. */ - QTime lengthOfDay(QTime setQTime, QTime riseQTime); + TQTime lengthOfDay(TQTime setQTime, TQTime riseQTime); /**Fills the Date fields with the current values from the current date. */ void showCurrentDate(void); diff --git a/kstars/kstars/tools/modcalceclipticcoords.cpp b/kstars/kstars/tools/modcalceclipticcoords.cpp index 36a7e75b..c2873aa1 100644 --- a/kstars/kstars/tools/modcalceclipticcoords.cpp +++ b/kstars/kstars/tools/modcalceclipticcoords.cpp @@ -23,11 +23,11 @@ #include "ksutils.h" #include "ksnumbers.h" #include "kstarsdatetime.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -35,7 +35,7 @@ #include -modCalcEclCoords::modCalcEclCoords(QWidget *parentSplit, const char *name) : modCalcEclCoordsDlg(parentSplit,name) { +modCalcEclCoords::modCalcEclCoords(TQWidget *parentSplit, const char *name) : modCalcEclCoordsDlg(parentSplit,name) { equRadio->setChecked(TRUE); raBox->setDegType(FALSE); @@ -59,7 +59,7 @@ void modCalcEclCoords::getEquCoords (void) { epoch = getEpoch( epochName->text() ); } -double modCalcEclCoords::getEpoch (QString eName) { +double modCalcEclCoords::getEpoch (TQString eName) { double epoch = eName.toDouble(); @@ -201,41 +201,41 @@ void modCalcEclCoords::slotEclLongCheckedBatch(){ } void modCalcEclCoords::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcEclCoords::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcEclCoords::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -243,19 +243,19 @@ void modCalcEclCoords::slotRunBatch() { } } -void modCalcEclCoords::processLines( QTextStream &istream ) { +void modCalcEclCoords::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; SkyPoint sp; dms raB, decB, eclLatB, eclLongB; @@ -267,7 +267,7 @@ void modCalcEclCoords::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; diff --git a/kstars/kstars/tools/modcalceclipticcoords.h b/kstars/kstars/tools/modcalceclipticcoords.h index 809928c9..30757201 100644 --- a/kstars/kstars/tools/modcalceclipticcoords.h +++ b/kstars/kstars/tools/modcalceclipticcoords.h @@ -37,12 +37,12 @@ Q_OBJECT public: - modCalcEclCoords(QWidget *p, const char *n); + modCalcEclCoords(TQWidget *p, const char *n); ~modCalcEclCoords(); void getEclCoords (void); void getEquCoords (void); - double getEpoch( QString t ); + double getEpoch( TQString t ); void showEquCoords(void); void showEclCoords(void); void EclToEqu(void); @@ -64,7 +64,7 @@ public slots: private: void equCheck(void); void eclCheck(void); - void processLines( QTextStream &is ); + void processLines( TQTextStream &is ); dms eclipLong, eclipLat, raCoord, decCoord; double epoch; diff --git a/kstars/kstars/tools/modcalcequinox.cpp b/kstars/kstars/tools/modcalcequinox.cpp index 01d89447..ba749698 100644 --- a/kstars/kstars/tools/modcalcequinox.cpp +++ b/kstars/kstars/tools/modcalcequinox.cpp @@ -25,15 +25,15 @@ #include "kssun.h" #include "libkdeedu/extdate/extdatetimeedit.h" -#include -#include -#include +#include +#include +#include #include #include -#include -#include +#include +#include -modCalcEquinox::modCalcEquinox(QWidget *parentSplit, const char *name) +modCalcEquinox::modCalcEquinox(TQWidget *parentSplit, const char *name) : modCalcEquinoxDlg (parentSplit,name) { showCurrentYear(); show(); @@ -42,7 +42,7 @@ modCalcEquinox::modCalcEquinox(QWidget *parentSplit, const char *name) modCalcEquinox::~modCalcEquinox(){ } -int modCalcEquinox::getYear (QString eName) +int modCalcEquinox::getYear (TQString eName) { bool ok = FALSE; int equinoxYear = eName.toInt(&ok); @@ -57,7 +57,7 @@ int modCalcEquinox::getYear (QString eName) void modCalcEquinox::showCurrentYear (void) { KStarsDateTime dt( KStarsDateTime::currentDateTime() ); - yearEdit->setText( QString( "%1").arg( dt.date().year() ) ); + yearEdit->setText( TQString( "%1").arg( dt.date().year() ) ); } void modCalcEquinox::slotComputeEquinoxesAndSolstices (void) @@ -104,7 +104,7 @@ void modCalcEquinox::showStartDateTime(long double jd) void modCalcEquinox::showSeasonDuration(float deltaJd) { - seasonDuration->setText( QString( "%1").arg( deltaJd ) ); + seasonDuration->setText( TQString( "%1").arg( deltaJd ) ); } void modCalcEquinox::slotYearCheckedBatch(){ @@ -116,41 +116,41 @@ void modCalcEquinox::slotYearCheckedBatch(){ } void modCalcEquinox::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcEquinox::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcEquinox::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -158,19 +158,19 @@ void modCalcEquinox::slotRunBatch() { } } -void modCalcEquinox::processLines( QTextStream &istream ) { +void modCalcEquinox::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int yearB; int i = 0; long double jdsp = 0., jdsu = 0., jdau = 0., jdwin = 0., jdsp1 = 0.; @@ -183,7 +183,7 @@ void modCalcEquinox::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; diff --git a/kstars/kstars/tools/modcalcequinox.h b/kstars/kstars/tools/modcalcequinox.h index 25645202..14e664a2 100644 --- a/kstars/kstars/tools/modcalcequinox.h +++ b/kstars/kstars/tools/modcalcequinox.h @@ -19,7 +19,7 @@ #define MODCALCEQUINOX_H #include -#include +#include #include "modcalcequinoxdlg.h" class QWidget; @@ -34,7 +34,7 @@ class modCalcEquinox : public modCalcEquinoxDlg { Q_OBJECT public: - modCalcEquinox(QWidget *p, const char *n); + modCalcEquinox(TQWidget *p, const char *n); ~modCalcEquinox(); public slots: @@ -48,11 +48,11 @@ public slots: private: - int getYear (QString eName); + int getYear (TQString eName); void showCurrentYear (void); void showStartDateTime(long double jd); void showSeasonDuration(float deltaJd); - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); }; diff --git a/kstars/kstars/tools/modcalcgalcoord.cpp b/kstars/kstars/tools/modcalcgalcoord.cpp index 0ec896db..18638a6c 100644 --- a/kstars/kstars/tools/modcalcgalcoord.cpp +++ b/kstars/kstars/tools/modcalcgalcoord.cpp @@ -22,11 +22,11 @@ #include "modcalcgalcoord.moc" #include "kstarsdatetime.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -34,7 +34,7 @@ #include -modCalcGalCoord::modCalcGalCoord(QWidget *parentSplit, const char *name) : modCalcGalCoordDlg(parentSplit,name) { +modCalcGalCoord::modCalcGalCoord(TQWidget *parentSplit, const char *name) : modCalcGalCoordDlg(parentSplit,name) { equRadio->setChecked(TRUE); raBox->setDegType(FALSE); @@ -58,7 +58,7 @@ void modCalcGalCoord::getEquCoords (void) { epoch = getEpoch( epochName->text() ); } -double modCalcGalCoord::getEpoch (QString eName) { +double modCalcGalCoord::getEpoch (TQString eName) { double epoch = eName.toDouble(); @@ -203,41 +203,41 @@ void modCalcGalCoord::slotGalLongCheckedBatch(){ } void modCalcGalCoord::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcGalCoord::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcGalCoord::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -245,19 +245,19 @@ void modCalcGalCoord::slotRunBatch() { } } -void modCalcGalCoord::processLines( QTextStream &istream ) { +void modCalcGalCoord::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; SkyPoint sp; dms raB, decB, galLatB, galLongB; @@ -270,7 +270,7 @@ void modCalcGalCoord::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; diff --git a/kstars/kstars/tools/modcalcgalcoord.h b/kstars/kstars/tools/modcalcgalcoord.h index 94acd572..b8b918b5 100644 --- a/kstars/kstars/tools/modcalcgalcoord.h +++ b/kstars/kstars/tools/modcalcgalcoord.h @@ -36,7 +36,7 @@ Q_OBJECT public: - modCalcGalCoord(QWidget *p, const char *n); + modCalcGalCoord(TQWidget *p, const char *n); ~modCalcGalCoord(); /** * Obtains the galactic coords. from the Box. @@ -44,7 +44,7 @@ public: void getGalCoords (void); void getEquCoords (void); void getEpoch (void); - double getEpoch( QString t ); + double getEpoch( TQString t ); void showEquCoords(void); void showGalCoords(void); void GalToEqu(void); @@ -66,7 +66,7 @@ public slots: private: void equCheck(void); void galCheck(void); - void processLines( QTextStream &is ); + void processLines( TQTextStream &is ); dms galLong, galLat, raCoord, decCoord; double epoch; diff --git a/kstars/kstars/tools/modcalcgeodcoord.cpp b/kstars/kstars/tools/modcalcgeodcoord.cpp index dd913ef6..dd03ccd2 100644 --- a/kstars/kstars/tools/modcalcgeodcoord.cpp +++ b/kstars/kstars/tools/modcalcgeodcoord.cpp @@ -22,10 +22,10 @@ #include "geolocation.h" #include "kstars.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -37,7 +37,7 @@ #include -modCalcGeodCoord::modCalcGeodCoord(QWidget *parentSplit, const char *name) : modCalcGeodCoordDlg(parentSplit,name) { +modCalcGeodCoord::modCalcGeodCoord(TQWidget *parentSplit, const char *name) : modCalcGeodCoordDlg(parentSplit,name) { static const char *ellipsoidList[] = { "IAU76", "GRS80", "MERIT83", "WGS84", "IERS89"}; @@ -61,7 +61,7 @@ void modCalcGeodCoord::showLongLat(void) KStars *ks = (KStars*) parent()->parent()->parent(); // QSplitter->AstroCalc->KStars lonGeoBox->show( ks->geo()->lng() ); latGeoBox->show( ks->geo()->lat() ); - altGeoBox->setText( QString("0.0") ); + altGeoBox->setText( TQString("0.0") ); } void modCalcGeodCoord::setEllipsoid(int index) { @@ -213,42 +213,42 @@ void modCalcGeodCoord::slotZCheckedBatch(){ } void modCalcGeodCoord::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcGeodCoord::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcGeodCoord::slotRunBatch(void) { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -256,19 +256,19 @@ void modCalcGeodCoord::slotRunBatch(void) { } } -void modCalcGeodCoord::processLines( QTextStream &istream ) { +void modCalcGeodCoord::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; GeoLocation *geoPl = new GeoLocation(); geoPl->setEllipsoid(0); @@ -283,7 +283,7 @@ void modCalcGeodCoord::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; diff --git a/kstars/kstars/tools/modcalcgeodcoord.h b/kstars/kstars/tools/modcalcgeodcoord.h index e4ae86e2..9cad095a 100644 --- a/kstars/kstars/tools/modcalcgeodcoord.h +++ b/kstars/kstars/tools/modcalcgeodcoord.h @@ -40,7 +40,7 @@ class modCalcGeodCoord : public modCalcGeodCoordDlg { Q_OBJECT public: - modCalcGeodCoord(QWidget *p, const char *n); + modCalcGeodCoord(TQWidget *p, const char *n); ~modCalcGeodCoord(); void genGeoCoords(void); @@ -67,12 +67,12 @@ class modCalcGeodCoord : public modCalcGeodCoordDlg { void geoCheck(void); void xyzCheck(void); void showLongLat(void); - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); void slotRunBatch(void); -// QRadioButton *cartRadio, *spheRadio; -// QVBox *vbox, *rightBox; -// QLineEdit *xGeoName, *yGeoName, *zGeoName, *altGeoName; +// TQRadioButton *cartRadio, *spheRadio; +// TQVBox *vbox, *rightBox; +// TQLineEdit *xGeoName, *yGeoName, *zGeoName, *altGeoName; // dmsBox *timeBox, *dateBox, *lonGeoBox, *latGeoBox; GeoLocation *geoPlace; diff --git a/kstars/kstars/tools/modcalcjd.cpp b/kstars/kstars/tools/modcalcjd.cpp index 68434f39..99271d34 100644 --- a/kstars/kstars/tools/modcalcjd.cpp +++ b/kstars/kstars/tools/modcalcjd.cpp @@ -22,8 +22,8 @@ #include "geolocation.h" #include "libkdeedu/extdate/extdatetimeedit.h" -#include //need for QTimeEdit -#include +#include //need for QTimeEdit +#include #include #include #include @@ -32,7 +32,7 @@ #define MJD0 2400000.5 -modCalcJD::modCalcJD(QWidget *parentSplit, const char *name) : modCalcJdDlg(parentSplit,name) { +modCalcJD::modCalcJD(TQWidget *parentSplit, const char *name) : modCalcJdDlg(parentSplit,name) { showCurrentTime(); show(); @@ -96,7 +96,7 @@ void modCalcJD::slotClearTime (void) JdName->setText (""); MjdName->setText (""); datBox->setDate( ExtDate::currentDate() ); - timBox->setTime(QTime(0,0,0)); + timBox->setTime(TQTime(0,0,0)); } void modCalcJD::showCurrentTime (void) diff --git a/kstars/kstars/tools/modcalcjd.h b/kstars/kstars/tools/modcalcjd.h index 054e2156..321e61e8 100644 --- a/kstars/kstars/tools/modcalcjd.h +++ b/kstars/kstars/tools/modcalcjd.h @@ -18,7 +18,7 @@ #ifndef MODCALCJD_H #define MODCALCJD_H -#include +#include #include #include "modcalcjddlg.h" @@ -40,7 +40,7 @@ class modCalcJD : public modCalcJdDlg { Q_OBJECT public: - modCalcJD(QWidget *p, const char *n); + modCalcJD(TQWidget *p, const char *n); ~modCalcJD(); void computeFromCalendar (void); diff --git a/kstars/kstars/tools/modcalcplanets.cpp b/kstars/kstars/tools/modcalcplanets.cpp index c927d71e..e9053bd5 100644 --- a/kstars/kstars/tools/modcalcplanets.cpp +++ b/kstars/kstars/tools/modcalcplanets.cpp @@ -28,17 +28,17 @@ #include "libkdeedu/extdate/extdatetimeedit.h" #include "ksnumbers.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include -modCalcPlanets::modCalcPlanets(QWidget *parentSplit, const char *name) : modCalcPlanetsDlg (parentSplit,name) { +modCalcPlanets::modCalcPlanets(TQWidget *parentSplit, const char *name) : modCalcPlanetsDlg (parentSplit,name) { showCurrentDateTime(); showLongLat(); raBox->setDegType(FALSE); @@ -288,39 +288,39 @@ void modCalcPlanets::slotLatCheckedBatch(){ } void modCalcPlanets::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcPlanets::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcPlanets::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -346,23 +346,23 @@ unsigned int modCalcPlanets::requiredBatchFields(void) { } -void modCalcPlanets::processLines( QTextStream &istream ) { +void modCalcPlanets::processLines( TQTextStream &istream ) { // we open the output file - QString outputFileName, lineToWrite; + TQString outputFileName, lineToWrite; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); bool lineIsValid = true; - QString message; + TQString message; - QString line; - QString space = " "; - QString planetB; + TQString line; + TQString space = " "; + TQString planetB; unsigned int i = 0, nline = 0; - QTime utB; + TQTime utB; ExtDate dtB; dms longB, latB, hlongB, hlatB, glongB, glatB, raB, decB, azmB, altB; double rSunB(0.0), rEarthB(0.0); @@ -370,7 +370,7 @@ void modCalcPlanets::processLines( QTextStream &istream ) { PlanetCatalog PCat( kd ); PCat.initialize(); - QString pName[11], pNamei18n[11]; + TQString pName[11], pNamei18n[11]; pName[0] = "Mercury"; pNamei18n[0]= i18n("Mercury"); pName[1] = "Venus"; pNamei18n[1]= i18n("Venus"); @@ -393,7 +393,7 @@ void modCalcPlanets::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); if (fields.count() != numberOfRequiredFields ) { lineIsValid = false; @@ -411,7 +411,7 @@ void modCalcPlanets::processLines( QTextStream &istream ) { int j = 0; while (j < 11) { //while (result != 0 && j < 11) { - result = QString::compare( pNamei18n[j] , planetB ); + result = TQString::compare( pNamei18n[j] , planetB ); if (result == 0) break; j++; @@ -439,7 +439,7 @@ void modCalcPlanets::processLines( QTextStream &istream ) { // Read Ut and write in ostream if corresponds if(utCheckBatch->isChecked() ) { - utB = QTime::fromString( fields[i] ); + utB = TQTime::fromString( fields[i] ); if ( !utB.isValid() ) { kdWarning() << i18n( "Line %1 contains an invalid time" ).arg(nline) << endl; lineIsValid=false; @@ -522,7 +522,7 @@ void modCalcPlanets::processLines( QTextStream &istream ) { int jp = -1; while (result != 0 && jp < 10) { jp++; - result = QString::compare( pNamei18n[jp] , planetB ); + result = TQString::compare( pNamei18n[jp] , planetB ); } if (jp < 11) { @@ -583,7 +583,7 @@ void modCalcPlanets::processLines( QTextStream &istream ) { } if (!lineIsValid) { - QString message = i18n("Errors found while parsing some lines in the input file"); + TQString message = i18n("Errors found while parsing some lines in the input file"); KMessageBox::sorry( 0, message, i18n( "Errors in lines" ) ); } diff --git a/kstars/kstars/tools/modcalcplanets.h b/kstars/kstars/tools/modcalcplanets.h index c3d6bceb..51451763 100644 --- a/kstars/kstars/tools/modcalcplanets.h +++ b/kstars/kstars/tools/modcalcplanets.h @@ -19,7 +19,7 @@ #define MODCALCPLANETS_H #include -#include +#include #include "modcalcplanetsdlg.h" #include "geolocation.h" #include "kstarsdatetime.h" @@ -40,7 +40,7 @@ class modCalcPlanets : public modCalcPlanetsDlg { Q_OBJECT public: - modCalcPlanets(QWidget *p, const char *n); + modCalcPlanets(TQWidget *p, const char *n); ~modCalcPlanets(); public slots: @@ -55,7 +55,7 @@ public slots: void slotInputFile(); void slotOutputFile(); void slotRunBatch(); - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); //void slotInputFile(); //void slotOutputFile(); //void slotRunBatch(); @@ -76,7 +76,7 @@ private: void showTopocentricCoords( const dms *az, const dms *el); unsigned int requiredBatchFields(void); - // void processLines( QTextStream &istream ); + // void processLines( TQTextStream &istream ); }; diff --git a/kstars/kstars/tools/modcalcprec.cpp b/kstars/kstars/tools/modcalcprec.cpp index 236bad05..ddf71e2e 100644 --- a/kstars/kstars/tools/modcalcprec.cpp +++ b/kstars/kstars/tools/modcalcprec.cpp @@ -22,16 +22,16 @@ #include "dms.h" #include "kstarsdatetime.h" -#include -#include -#include +#include +#include +#include #include #include #include #include #include -modCalcPrec::modCalcPrec(QWidget *parentSplit, const char *name) : modCalcPrecDlg(parentSplit,name) { +modCalcPrec::modCalcPrec(TQWidget *parentSplit, const char *name) : modCalcPrecDlg(parentSplit,name) { ra0Box->setDegType(FALSE); rafBox->setDegType(FALSE); @@ -54,10 +54,10 @@ SkyPoint modCalcPrec::getEquCoords (void) { return sp; } -QString modCalcPrec:: showCurrentEpoch () { +TQString modCalcPrec:: showCurrentEpoch () { double epoch = setCurrentEpoch(); - QString eName = QString("%1").arg(epoch,7,'f',2); + TQString eName = TQString("%1").arg(epoch,7,'f',2); return eName; } @@ -66,7 +66,7 @@ double modCalcPrec::setCurrentEpoch () { return KStarsDateTime::currentDateTime().epoch(); } -double modCalcPrec::getEpoch (QString eName) { +double modCalcPrec::getEpoch (TQString eName) { bool ok = false; double epoch = eName.toDouble(&ok); @@ -152,13 +152,13 @@ void modCalcPrec::slotTargetEpochCheckedBatch(){ } void modCalcPrec::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcPrec::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); @@ -167,28 +167,28 @@ void modCalcPrec::slotOutputFile() { void modCalcPrec::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -196,19 +196,19 @@ void modCalcPrec::slotRunBatch() { } } -void modCalcPrec::processLines( QTextStream &istream ) { +void modCalcPrec::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; long double jd0, jdf; SkyPoint sp; @@ -222,7 +222,7 @@ void modCalcPrec::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; diff --git a/kstars/kstars/tools/modcalcprec.h b/kstars/kstars/tools/modcalcprec.h index f5b28078..bd70a44d 100644 --- a/kstars/kstars/tools/modcalcprec.h +++ b/kstars/kstars/tools/modcalcprec.h @@ -39,7 +39,7 @@ class modCalcPrec : public modCalcPrecDlg { Q_OBJECT public: - modCalcPrec(QWidget *p, const char *n); + modCalcPrec(TQWidget *p, const char *n); ~modCalcPrec(); SkyPoint precess (dms ra0, dms dec0, double e0, double ef); @@ -56,11 +56,11 @@ public slots: private: SkyPoint getEquCoords(void); - QString showCurrentEpoch(void); + TQString showCurrentEpoch(void); double setCurrentEpoch(void); - double getEpoch (QString eName); + double getEpoch (TQString eName); void showEquCoords ( SkyPoint sp ); - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); }; diff --git a/kstars/kstars/tools/modcalcsidtime.cpp b/kstars/kstars/tools/modcalcsidtime.cpp index b8eccfe5..33cc03c9 100644 --- a/kstars/kstars/tools/modcalcsidtime.cpp +++ b/kstars/kstars/tools/modcalcsidtime.cpp @@ -15,11 +15,11 @@ * * ***************************************************************************/ -#include //need for QTimeEdit -#include -#include -#include -#include +#include //need for QTimeEdit +#include +#include +#include +#include #include #include @@ -32,7 +32,7 @@ #include "simclock.h" #include "libkdeedu/extdate/extdatetimeedit.h" -modCalcSidTime::modCalcSidTime(QWidget *parentSplit, const char *name) : modCalcSidTimeDlg (parentSplit,name) { +modCalcSidTime::modCalcSidTime(TQWidget *parentSplit, const char *name) : modCalcSidTimeDlg (parentSplit,name) { showCurrentTimeAndLong(); show(); @@ -53,37 +53,37 @@ void modCalcSidTime::showCurrentTimeAndLong (void) longBox->show( ks->geo()->lng() ); } -QTime modCalcSidTime::computeUTtoST (QTime ut, ExtDate dt, dms longitude) +TQTime modCalcSidTime::computeUTtoST (TQTime ut, ExtDate dt, dms longitude) { KStarsDateTime utdt = KStarsDateTime( dt, ut); dms st = longitude.Degrees() + utdt.gst().Degrees(); - return QTime( st.hour(), st.minute(), st.second() ); + return TQTime( st.hour(), st.minute(), st.second() ); } -QTime modCalcSidTime::computeSTtoUT (QTime st, ExtDate dt, dms longitude) +TQTime modCalcSidTime::computeSTtoUT (TQTime st, ExtDate dt, dms longitude) { - KStarsDateTime dtt = KStarsDateTime( dt, QTime()); + KStarsDateTime dtt = KStarsDateTime( dt, TQTime()); dms lst(st.hour(), st.minute(), st.second()); dms gst( lst.Degrees() - longitude.Degrees() ); return dtt.GSTtoUT( gst ); } -void modCalcSidTime::showUT( QTime dt ) +void modCalcSidTime::showUT( TQTime dt ) { UtBox->setTime( dt ); } -void modCalcSidTime::showST( QTime st ) +void modCalcSidTime::showST( TQTime st ) { StBox->setTime( st ); } -QTime modCalcSidTime::getUT( void ) +TQTime modCalcSidTime::getUT( void ) { return UtBox->time(); } -QTime modCalcSidTime::getST( void ) +TQTime modCalcSidTime::getST( void ) { return StBox->time(); } @@ -100,13 +100,13 @@ dms modCalcSidTime::getLongitude( void ) void modCalcSidTime::slotClearFields(){ datBox->setDate(ExtDate::currentDate()); - QTime time(0,0,0); + TQTime time(0,0,0); UtBox->setTime(time); StBox->setTime(time); } void modCalcSidTime::slotComputeTime(){ - QTime ut, st; + TQTime ut, st; ExtDate dt = getDate(); dms longitude = getLongitude(); @@ -169,13 +169,13 @@ void modCalcSidTime::utNoCheck() { } void modCalcSidTime::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcSidTime::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } @@ -183,28 +183,28 @@ void modCalcSidTime::slotOutputFile() { void modCalcSidTime::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -212,24 +212,24 @@ void modCalcSidTime::slotRunBatch() { } } -void modCalcSidTime::processLines( QTextStream &istream ) { +void modCalcSidTime::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; long double jd0, jdf; dms longB, LST; double epoch0B(0.0); - QTime utB, stB; + TQTime utB, stB; ExtDate dtB; while ( ! istream.eof() ) { @@ -238,7 +238,7 @@ void modCalcSidTime::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; @@ -284,7 +284,7 @@ void modCalcSidTime::processLines( QTextStream &istream ) { // Read Ut and write in ostream if corresponds if(utCheckBatch->isChecked() ) { - utB = QTime::fromString( fields[i] ); + utB = TQTime::fromString( fields[i] ); i++; } else utB = utBoxBatch->time(); @@ -304,7 +304,7 @@ void modCalcSidTime::processLines( QTextStream &istream ) { } else { if(stCheckBatch->isChecked() ) { - stB = QTime::fromString( fields[i] ); + stB = TQTime::fromString( fields[i] ); i++; } else stB = stBoxBatch->time(); diff --git a/kstars/kstars/tools/modcalcsidtime.h b/kstars/kstars/tools/modcalcsidtime.h index 8e0f3842..30caf7a7 100644 --- a/kstars/kstars/tools/modcalcsidtime.h +++ b/kstars/kstars/tools/modcalcsidtime.h @@ -40,11 +40,11 @@ Q_OBJECT public: - modCalcSidTime(QWidget *p, const char *n); + modCalcSidTime(TQWidget *p, const char *n); ~modCalcSidTime(); - QTime computeUTtoST (QTime u, ExtDate d, dms l); - QTime computeSTtoUT (QTime s, ExtDate d, dms l); + TQTime computeUTtoST (TQTime u, ExtDate d, dms l); + TQTime computeSTtoUT (TQTime s, ExtDate d, dms l); public slots: @@ -62,12 +62,12 @@ public slots: void slotInputFile(); void slotOutputFile(); void slotRunBatch(); - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); private: - void showUT ( QTime ut ); - void showST ( QTime st ); + void showUT ( TQTime ut ); + void showST ( TQTime st ); /* Fills the UT, Date boxes with the current time * and date and the longitude box with the current Geo location @@ -77,8 +77,8 @@ private: void sidNoCheck(); void utNoCheck(); - QTime getUT (void); - QTime getST (void); + TQTime getUT (void); + TQTime getST (void); ExtDate getDate (void); dms getLongitude (void); bool stInputTime; diff --git a/kstars/kstars/tools/modcalcvlsr.cpp b/kstars/kstars/tools/modcalcvlsr.cpp index 601f9e77..412e1d72 100644 --- a/kstars/kstars/tools/modcalcvlsr.cpp +++ b/kstars/kstars/tools/modcalcvlsr.cpp @@ -28,16 +28,16 @@ #include "kstarsdatetime.h" #include "libkdeedu/extdate/extdatetimeedit.h" -#include //need for QTimeEdit -#include -#include -#include -#include +#include //need for QTimeEdit +#include +#include +#include +#include #include #include -modCalcVlsr::modCalcVlsr(QWidget *parentSplit, const char *name) : modCalcVlsrDlg (parentSplit,name) { +modCalcVlsr::modCalcVlsr(TQWidget *parentSplit, const char *name) : modCalcVlsrDlg (parentSplit,name) { showCurrentDateTime(); initGeo(); @@ -92,7 +92,7 @@ KStarsDateTime modCalcVlsr::getDateTime (void) return KStarsDateTime( datBox->date() , timBox->time() ); } -double modCalcVlsr::getEpoch (QString eName) +double modCalcVlsr::getEpoch (TQString eName) { bool ok = false; double epoch = eName.toDouble(&ok); @@ -213,7 +213,7 @@ void modCalcVlsr::slotClearCoords() vTopoBox->setText(""); datBox->setDate(ExtDate::currentDate()); - timBox->setTime(QTime(0,0,0)); + timBox->setTime(TQTime(0,0,0)); } @@ -352,40 +352,40 @@ void modCalcVlsr::slotVlsrChecked(){ } void modCalcVlsr::slotInputFile() { - QString inputFileName; + TQString inputFileName; inputFileName = KFileDialog::getOpenFileName( ); InputLineEditBatch->setText( inputFileName ); } void modCalcVlsr::slotOutputFile() { - QString outputFileName; + TQString outputFileName; outputFileName = KFileDialog::getSaveFileName( ); OutputLineEditBatch->setText( outputFileName ); } void modCalcVlsr::slotRunBatch() { - QString inputFileName; + TQString inputFileName; inputFileName = InputLineEditBatch->text(); // We open the input file and read its content - if ( QFile::exists(inputFileName) ) { - QFile f( inputFileName ); + if ( TQFile::exists(inputFileName) ) { + TQFile f( inputFileName ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1.").arg( f.name() ); + TQString message = i18n( "Could not open file %1.").arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); inputFileName = ""; return; } // processLines(&f); - QTextStream istream(&f); + TQTextStream istream(&f); processLines(istream); // readFile( istream ); f.close(); } else { - QString message = i18n( "Invalid file: %1" ).arg( inputFileName ); + TQString message = i18n( "Invalid file: %1" ).arg( inputFileName ); KMessageBox::sorry( 0, message, i18n( "Invalid file" ) ); inputFileName = ""; InputLineEditBatch->setText( inputFileName ); @@ -393,19 +393,19 @@ void modCalcVlsr::slotRunBatch() { } } -void modCalcVlsr::processLines( QTextStream &istream ) { +void modCalcVlsr::processLines( TQTextStream &istream ) { // we open the output file -// QTextStream istream(&fIn); - QString outputFileName; +// TQTextStream istream(&fIn); + TQString outputFileName; outputFileName = OutputLineEditBatch->text(); - QFile fOut( outputFileName ); + TQFile fOut( outputFileName ); fOut.open(IO_WriteOnly); - QTextStream ostream(&fOut); + TQTextStream ostream(&fOut); - QString line; - QString space = " "; + TQString line; + TQString space = " "; int i = 0; long double jd0; SkyPoint spB; @@ -413,7 +413,7 @@ void modCalcVlsr::processLines( QTextStream &istream ) { dms raB, decB, latB, longB; double epoch0B, vhB, vgB, vtB, vlsrB, heightB; double vtopo[3]; - QTime utB; + TQTime utB; ExtDate dtB; KStarsDateTime dt0B; @@ -423,14 +423,14 @@ void modCalcVlsr::processLines( QTextStream &istream ) { //Go through the line, looking for parameters - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); i = 0; // Read Ut and write in ostream if corresponds if(utCheckBatch->isChecked() ) { - utB = QTime::fromString( fields[i] ); + utB = TQTime::fromString( fields[i] ); i++; } else utB = utBoxBatch->time(); diff --git a/kstars/kstars/tools/modcalcvlsr.h b/kstars/kstars/tools/modcalcvlsr.h index 2320bd19..ea12d7ca 100644 --- a/kstars/kstars/tools/modcalcvlsr.h +++ b/kstars/kstars/tools/modcalcvlsr.h @@ -19,7 +19,7 @@ #define MODCALCVLSR_H #include -#include +#include #include "modcalcvlsrdlg.h" class QWidget; @@ -40,7 +40,7 @@ class modCalcVlsr : public modCalcVlsrDlg { Q_OBJECT public: - modCalcVlsr(QWidget *p, const char *n); + modCalcVlsr(TQWidget *p, const char *n); ~modCalcVlsr(); public slots: @@ -89,7 +89,7 @@ private: * @param eName String from which the epoch is to be constructed * once it is converted to a double */ - double getEpoch (QString eName); + double getEpoch (TQString eName); /* Creates a dms object from the latitude box */ dms getLatitude (void); @@ -141,7 +141,7 @@ private: /* Method to process the lines from a file */ - void processLines( QTextStream &istream ); + void processLines( TQTextStream &istream ); GeoLocation *geoPlace; diff --git a/kstars/kstars/tools/observinglist.cpp b/kstars/kstars/tools/observinglist.cpp index dae78bc0..fbd1702c 100644 --- a/kstars/kstars/tools/observinglist.cpp +++ b/kstars/kstars/tools/observinglist.cpp @@ -16,12 +16,12 @@ ***************************************************************************/ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -53,13 +53,13 @@ #include "devicemanager.h" #include "indistd.h" -ObservingList::ObservingList( KStars *_ks, QWidget* parent ) +ObservingList::ObservingList( KStars *_ks, TQWidget* parent ) : KDialogBase( KDialogBase::Plain, i18n( "Observing List" ), Close, Close, parent, "observinglist", false ), ks( _ks ), LogObject(0), oCurrent(0), noNameStars(0), isModified(false), bIsLarge(true) { - QFrame *page = plainPage(); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, 0 ); + TQFrame *page = plainPage(); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, 0 ); ui = new ObservingListUI( page ); vlay->addWidget( ui ); @@ -67,40 +67,40 @@ ObservingList::ObservingList( KStars *_ks, QWidget* parent ) ui->MiniButton->hide(); //Connections - connect( this, SIGNAL( closeClicked() ), this, SLOT( slotClose() ) ); - connect( ui->TableStack, SIGNAL( aboutToShow( QWidget* ) ), - this, SLOT( slotPrepTable( QWidget* ) ) ); - connect( ui->FullTable, SIGNAL( selectionChanged() ), - this, SLOT( slotNewSelection() ) ); - connect( ui->TinyTable, SIGNAL( selectionChanged() ), - this, SLOT( slotNewSelection() ) ); - connect( ui->FullTable, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int) ), - this, SLOT( slotCenterObject() ) ); - connect( ui->TinyTable, SIGNAL( doubleClicked( QListBoxItem* ) ), - this, SLOT( slotCenterObject() ) ); - connect( ui->RemoveButton, SIGNAL( clicked() ), - this, SLOT( slotRemoveObjects() ) ); - connect( ui->CenterButton, SIGNAL( clicked() ), - this, SLOT( slotCenterObject() ) ); - connect( ui->ScopeButton, SIGNAL( clicked() ), - this, SLOT( slotSlewToObject() ) ); - connect( ui->DetailsButton, SIGNAL( clicked() ), - this, SLOT( slotDetails() ) ); - connect( ui->AVTButton, SIGNAL( clicked() ), - this, SLOT( slotAVT() ) ); - - connect( ui->OpenButton, SIGNAL( clicked() ), - this, SLOT( slotOpenList() ) ); - connect( ui->SaveButton, SIGNAL( clicked() ), - this, SLOT( slotSaveList() ) ); - connect( ui->SaveAsButton, SIGNAL( clicked() ), - this, SLOT( slotSaveListAs() ) ); - connect( ui->WizardButton, SIGNAL( clicked() ), - this, SLOT( slotWizard() ) ); + connect( this, TQT_SIGNAL( closeClicked() ), this, TQT_SLOT( slotClose() ) ); + connect( ui->TableStack, TQT_SIGNAL( aboutToShow( TQWidget* ) ), + this, TQT_SLOT( slotPrepTable( TQWidget* ) ) ); + connect( ui->FullTable, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotNewSelection() ) ); + connect( ui->TinyTable, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotNewSelection() ) ); + connect( ui->FullTable, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int) ), + this, TQT_SLOT( slotCenterObject() ) ); + connect( ui->TinyTable, TQT_SIGNAL( doubleClicked( TQListBoxItem* ) ), + this, TQT_SLOT( slotCenterObject() ) ); + connect( ui->RemoveButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotRemoveObjects() ) ); + connect( ui->CenterButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotCenterObject() ) ); + connect( ui->ScopeButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotSlewToObject() ) ); + connect( ui->DetailsButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotDetails() ) ); + connect( ui->AVTButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotAVT() ) ); + + connect( ui->OpenButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotOpenList() ) ); + connect( ui->SaveButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotSaveList() ) ); + connect( ui->SaveAsButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotSaveListAs() ) ); + connect( ui->WizardButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotWizard() ) ); //FIXME: enable MiniButton -// connect( ui->MiniButton, SIGNAL( clicked() ), -// this, SLOT( slotToggleSize() ) ); +// connect( ui->MiniButton, TQT_SIGNAL( clicked() ), +// this, TQT_SLOT( slotToggleSize() ) ); obsList.setAutoDelete( false ); //do NOT delete removed pointers! @@ -131,7 +131,7 @@ bool ObservingList::contains( const SkyObject *q ) { //SLOTS -void ObservingList::slotPrepTable( QWidget *tab ) { +void ObservingList::slotPrepTable( TQWidget *tab ) { if ( tab == ui->FullTable ) { } else { } @@ -154,8 +154,8 @@ void ObservingList::slotAddObject( SkyObject *obj ) { if ( ! isModified ) isModified = true; //Insert object entry in FullTable and TinyTable - QString smag("--"); - if ( obj->mag() < 90.0 ) smag = QString::number( obj->mag(), 'g', 2 ); + TQString smag("--"); + if ( obj->mag() < 90.0 ) smag = TQString::number( obj->mag(), 'g', 2 ); new KListViewItem( ui->FullTable, obj->translatedName(), obj->ra()->toHMSString(), obj->dec()->toDMSString(), @@ -179,9 +179,9 @@ void ObservingList::slotRemoveObject( SkyObject *o ) { //Remove entry from FullTable bool objectFound = false; - QListViewItemIterator it( ui->FullTable ); + TQListViewItemIterator it( ui->FullTable ); while ( it.current() ) { - QListViewItem *item = it.current(); + TQListViewItem *item = it.current(); //If the object is named "star" then match coordinates instead of name if ( o->translatedName() == i18n( "star" ) ) { @@ -227,7 +227,7 @@ void ObservingList::slotNewSelection() { //Construct list of selected objects SelectedObjects.clear(); - QListViewItemIterator it( ui->FullTable, QListViewItemIterator::Selected ); //loop over selected items + TQListViewItemIterator it( ui->FullTable, TQListViewItemIterator::Selected ); //loop over selected items while ( it.current() ) { for ( SkyObject *o = obsList.first(); o; o = obsList.next() ) { if ( it.current()->text(0) == i18n("star") ) { @@ -246,8 +246,8 @@ void ObservingList::slotNewSelection() { //Enable widgets when one object selected if ( SelectedObjects.count() == 1 ) { - QString newName( SelectedObjects.first()->translatedName() ); - QString oldName( obsList.current()->translatedName() ); + TQString newName( SelectedObjects.first()->translatedName() ); + TQString oldName( obsList.current()->translatedName() ); //Enable buttons ui->CenterButton->setEnabled( true ); @@ -432,8 +432,8 @@ void ObservingList::slotSlewToObject() if (useJ2000) sp.apparentCoord(ks->data()->ut().djd(), (long double) J2000); - RAEle->write_w->setText(QString("%1:%2:%3").arg(sp.ra()->hour()).arg(sp.ra()->minute()).arg(sp.ra()->second())); - DecEle->write_w->setText(QString("%1:%2:%3").arg(sp.dec()->degree()).arg(sp.dec()->arcmin()).arg(sp.dec()->arcsec())); + RAEle->write_w->setText(TQString("%1:%2:%3").arg(sp.ra()->hour()).arg(sp.ra()->minute()).arg(sp.ra()->second())); + DecEle->write_w->setText(TQString("%1:%2:%3").arg(sp.dec()->degree()).arg(sp.dec()->arcmin()).arg(sp.dec()->arcsec())); break; @@ -449,8 +449,8 @@ void ObservingList::slotSlewToObject() sp.setAlt(*ks->map()->clickedPoint()->alt()); } - AzEle->write_w->setText(QString("%1:%2:%3").arg(sp.az()->degree()).arg(sp.az()->arcmin()).arg(sp.az()->arcsec())); - AltEle->write_w->setText(QString("%1:%2:%3").arg(sp.alt()->degree()).arg(sp.alt()->arcmin()).arg(sp.alt()->arcsec())); + AzEle->write_w->setText(TQString("%1:%2:%3").arg(sp.az()->degree()).arg(sp.az()->arcmin()).arg(sp.az()->arcsec())); + AltEle->write_w->setText(TQString("%1:%2:%3").arg(sp.alt()->degree()).arg(sp.alt()->arcmin()).arg(sp.alt()->arcsec())); break; } @@ -510,8 +510,8 @@ void ObservingList::saveCurrentUserLog() { } void ObservingList::slotOpenList() { - KURL fileURL = KFileDialog::getOpenURL( QDir::homeDirPath(), "*.obslist|KStars Observing List (*.obslist)" ); - QFile f; + KURL fileURL = KFileDialog::getOpenURL( TQDir::homeDirPath(), "*.obslist|KStars Observing List (*.obslist)" ); + TQFile f; if ( fileURL.isValid() ) { if ( ! fileURL.isLocalFile() ) { @@ -528,7 +528,7 @@ void ObservingList::slotOpenList() { } if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1" ).arg( f.name() ); + TQString message = i18n( "Could not open file %1" ).arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); return; } @@ -536,8 +536,8 @@ void ObservingList::slotOpenList() { saveCurrentList(); //First line is the name of the list. The rest of the file should //be object names, one per line. - QTextStream istream(&f); - QString line; + TQTextStream istream(&f); + TQString line; ListName = istream.readLine(); while ( ! istream.eof() ) { @@ -548,7 +548,7 @@ void ObservingList::slotOpenList() { //If the object is named "star", add it by coordinates SkyObject *o = 0; if ( line.startsWith( "star" ) ) { - QStringList fields = QStringList::split( " ", line ); + TQStringList fields = TQStringList::split( " ", line ); //DEBUG kdDebug() << fields << endl; @@ -579,7 +579,7 @@ void ObservingList::slotOpenList() { f.close(); } else if ( fileURL.path() != "" ) { - QString message = i18n( "The specified file is invalid. Try another file?" ); + TQString message = i18n( "The specified file is invalid. Try another file?" ); if ( KMessageBox::warningYesNo( this, message, i18n("Invalid File"), i18n("Try Another"), i18n("Do Not Try") ) == KMessageBox::Yes ) { slotOpenList(); } @@ -591,7 +591,7 @@ void ObservingList::saveCurrentList() { //Assume that if the list is empty, then there's no need to save if ( obsList.count() ) { if ( isModified ) { - QString message = i18n( "Do you want to save the current list before opening a new list?" ); + TQString message = i18n( "Do you want to save the current list before opening a new list?" ); if ( KMessageBox::questionYesNo( this, message, i18n( "Save Current List?" ), KStdGuiItem::save(), KStdGuiItem::discard() ) == KMessageBox::Yes ) slotSaveList(); @@ -610,7 +610,7 @@ void ObservingList::slotSaveListAs() { i18n( "List name:" ), "", &ok ); if ( ok ) { - KURL fileURL = KFileDialog::getSaveURL( QDir::homeDirPath(), "*.obslist|KStars Observing List (*.obslist)" ); + KURL fileURL = KFileDialog::getSaveURL( TQDir::homeDirPath(), "*.obslist|KStars Observing List (*.obslist)" ); if ( fileURL.isValid() ) FileName = fileURL.path(); @@ -625,9 +625,9 @@ void ObservingList::slotSaveList() { return; } - QFile f( FileName ); + TQFile f( FileName ); if ( !f.open( IO_WriteOnly) ) { - QString message = i18n( "Could not open file %1. Try a different filename?" ).arg( f.name() ); + TQString message = i18n( "Could not open file %1. Try a different filename?" ).arg( f.name() ); if ( KMessageBox::warningYesNo( 0, message, i18n( "Could Not Open File" ), i18n("Try Different"), i18n("Do Not Try") ) == KMessageBox::Yes ) { FileName == ""; @@ -636,7 +636,7 @@ void ObservingList::slotSaveList() { return; } - QTextStream ostream(&f); + TQTextStream ostream(&f); ostream << ListName << endl; //Save objects to the list using their name. If it's a star with a genetive name @@ -664,7 +664,7 @@ void ObservingList::slotSaveList() { void ObservingList::slotWizard() { ObsListWizard wizard( ks ); - if ( wizard.exec() == QDialog::Accepted ) { + if ( wizard.exec() == TQDialog::Accepted ) { //Make sure current list is saved saveCurrentList(); @@ -722,14 +722,14 @@ void ObservingList::slotToggleSize() { void ObservingList::syncTableSelection( bool syncFullTable ) { if ( syncFullTable ) { int i=0; - QListViewItem *it = ui->FullTable->firstChild(); + TQListViewItem *it = ui->FullTable->firstChild(); while ( it ) { it->setSelected( ui->TinyTable->isSelected( i++ ) ); it->nextSibling(); } } else { int i=0; - QListViewItem *it = ui->FullTable->firstChild(); + TQListViewItem *it = ui->FullTable->firstChild(); while ( it ) { ui->TinyTable->setSelected( i++, it->isSelected() ); it->nextSibling(); diff --git a/kstars/kstars/tools/observinglist.h b/kstars/kstars/tools/observinglist.h index dd60dc8c..2acc6ca1 100644 --- a/kstars/kstars/tools/observinglist.h +++ b/kstars/kstars/tools/observinglist.h @@ -62,7 +62,7 @@ class ObservingList : public KDialogBase public: /**@short Cunstructor */ - ObservingList( KStars *_ks, QWidget* parent = 0 ); + ObservingList( KStars *_ks, TQWidget* parent = 0 ); /**@short Destuctor (empty) */ ~ObservingList() {} @@ -89,7 +89,7 @@ public slots: /**@short about to switch the visible table in the widget stack *@p tab pointer to the table which is about to be shown */ - void slotPrepTable( QWidget *tab ); + void slotPrepTable( TQWidget *tab ); /**@short add a new object to list *@p o pointer to the object to add to the list @@ -163,13 +163,13 @@ private: KStars *ks; ObservingListUI *ui; - QPtrList obsList; - QPtrList SelectedObjects; + TQPtrList obsList; + TQPtrList SelectedObjects; SkyObject *LogObject, *oCurrent; uint noNameStars; bool isModified, bIsLarge; - QString ListName, FileName; + TQString ListName, FileName; }; #endif // OBSERVINGLIST_H diff --git a/kstars/kstars/tools/obslistwizard.cpp b/kstars/kstars/tools/obslistwizard.cpp index 12eb2416..7dbbbc3d 100644 --- a/kstars/kstars/tools/obslistwizard.cpp +++ b/kstars/kstars/tools/obslistwizard.cpp @@ -14,10 +14,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -34,45 +34,45 @@ #include "obslistwizard.h" -ObsListWizard::ObsListWizard( QWidget *parent, const char *name ) +ObsListWizard::ObsListWizard( TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Plain, i18n("Observing List Wizard"), Ok|Cancel, Ok, parent, name ) { ksw = (KStars*)parent; - QFrame *page = plainPage(); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, 0 ); + TQFrame *page = plainPage(); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, 0 ); olw = new ObsListWizardUI( page ); vlay->addWidget( olw ); - connect( olw->AllButton, SIGNAL( clicked() ), this, SLOT( slotAllButton() ) ); - connect( olw->NoneButton, SIGNAL( clicked() ), this, SLOT( slotNoneButton() ) ); - connect( olw->DeepSkyButton, SIGNAL( clicked() ), this, SLOT( slotDeepSkyButton() ) ); - connect( olw->SolarSystemButton, SIGNAL( clicked() ), this, SLOT( slotSolarSystemButton() ) ); - connect( olw->LocationButton, SIGNAL( clicked() ), this, SLOT( slotChangeLocation() ) ); + connect( olw->AllButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAllButton() ) ); + connect( olw->NoneButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotNoneButton() ) ); + connect( olw->DeepSkyButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotDeepSkyButton() ) ); + connect( olw->SolarSystemButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSolarSystemButton() ) ); + connect( olw->LocationButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChangeLocation() ) ); - connect( olw->FilterList, SIGNAL( clicked(QListViewItem*) ), this, SLOT( slotShowStackWidget(QListViewItem*) ) ); + connect( olw->FilterList, TQT_SIGNAL( clicked(TQListViewItem*) ), this, TQT_SLOT( slotShowStackWidget(TQListViewItem*) ) ); //Update the selected observing list when certain UI elements are modified - connect( olw->TypeList, SIGNAL( selectionChanged() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->ConstellationList, SIGNAL( selectionChanged() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->RAMin, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->RAMax, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->DecMin, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->DecMax, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->RA, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->Dec, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->Radius, SIGNAL( valueChanged(double) ), this, SLOT( slotUpdateObjectCount() ) ); -// connect( olw->Date, SIGNAL( valueChanged( const ExtDate& ) ), this, SLOT( slotApplyFilters() ) ); - connect( olw->Mag, SIGNAL( valueChanged( double ) ), this, SLOT( slotUpdateObjectCount() ) ); - connect( olw->ExcludeNoMag, SIGNAL( clicked() ), this, SLOT( slotUpdateObjectCount() ) ); - - connect( olw->SelectByConstellation, SIGNAL( toggled(bool) ), this, SLOT( slotEnableConstellationPage(bool) ) ); - connect( olw->SelectByRect, SIGNAL( toggled(bool) ), this, SLOT( slotEnableRectPage(bool) ) ); - connect( olw->SelectByCirc, SIGNAL( toggled(bool) ), this, SLOT( slotEnableCircPage(bool) ) ); -// connect( olw->SelectByDate, SIGNAL( toggled(bool) ), this, SLOT( slotEnableDatePage(bool) ) ); - connect( olw->SelectByMag, SIGNAL( toggled(bool) ), this, SLOT( slotEnableMagPage(bool) ) ); - - connect( this, SIGNAL( okClicked() ), this, SLOT( slotApplyFilters() ) ); + connect( olw->TypeList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->ConstellationList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->RAMin, TQT_SIGNAL( lostFocus() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->RAMax, TQT_SIGNAL( lostFocus() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->DecMin, TQT_SIGNAL( lostFocus() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->DecMax, TQT_SIGNAL( lostFocus() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->RA, TQT_SIGNAL( lostFocus() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->Dec, TQT_SIGNAL( lostFocus() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->Radius, TQT_SIGNAL( valueChanged(double) ), this, TQT_SLOT( slotUpdateObjectCount() ) ); +// connect( olw->Date, TQT_SIGNAL( valueChanged( const ExtDate& ) ), this, TQT_SLOT( slotApplyFilters() ) ); + connect( olw->Mag, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + connect( olw->ExcludeNoMag, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotUpdateObjectCount() ) ); + + connect( olw->SelectByConstellation, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotEnableConstellationPage(bool) ) ); + connect( olw->SelectByRect, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotEnableRectPage(bool) ) ); + connect( olw->SelectByCirc, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotEnableCircPage(bool) ) ); +// connect( olw->SelectByDate, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotEnableDatePage(bool) ) ); + connect( olw->SelectByMag, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotEnableMagPage(bool) ) ); + + connect( this, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( slotApplyFilters() ) ); initialize(); } @@ -190,10 +190,10 @@ void ObsListWizard::slotEnableMagPage( bool t ) { slotUpdateObjectCount(); } -void ObsListWizard::slotShowStackWidget( QListViewItem *i ) +void ObsListWizard::slotShowStackWidget( TQListViewItem *i ) { if ( i ) { - QString t = i->text(0); + TQString t = i->text(0); if ( t.contains( i18n( "Object type(s)" ) ) ) olw->FilterStack->raiseWidget( olw->ObjTypePage ); if ( t.contains( i18n( "Region" ) ) ) olw->FilterStack->raiseWidget( olw->RegionPage ); @@ -227,7 +227,7 @@ void ObsListWizard::slotChangeLocation() { LocationDialog ld( ksw ); - if ( ld.exec() == QDialog::Accepted ) { + if ( ld.exec() == TQDialog::Accepted ) { //set geographic location } } @@ -417,8 +417,8 @@ void ObsListWizard::applyFilters( bool doBuildList ) void ObsListWizard::applyRegionFilter( SkyObject *o, bool doBuildList, bool doAdjustCount ) { //select by constellation if ( olw->SelectByConstellation->isChecked() ) { - QString c( o->constellation( ksw->data()->csegmentList, ksw->data()->cnameList ) ); - QListBoxItem *it = olw->ConstellationList->findItem( c ); + TQString c( o->constellation( ksw->data()->csegmentList, ksw->data()->cnameList ) ); + TQListBoxItem *it = olw->ConstellationList->findItem( c ); if ( it && it->isSelected() ) { if ( doBuildList ) obsList().append ( o ); diff --git a/kstars/kstars/tools/obslistwizard.h b/kstars/kstars/tools/obslistwizard.h index 5c04b93f..dd6c9230 100644 --- a/kstars/kstars/tools/obslistwizard.h +++ b/kstars/kstars/tools/obslistwizard.h @@ -34,14 +34,14 @@ class ObsListWizard : public KDialogBase public: /**@short Constructor */ - ObsListWizard( QWidget *parent = 0, const char *name = 0 ); + ObsListWizard( TQWidget *parent = 0, const char *name = 0 ); /**@short Destructor */ ~ObsListWizard(); - /**@return reference to QPtrList of objects selected by the wizard + /**@return reference to TQPtrList of objects selected by the wizard */ - QPtrList& obsList() { return ObsList; } + TQPtrList& obsList() { return ObsList; } private slots: void slotAllButton(); @@ -49,7 +49,7 @@ class ObsListWizard : public KDialogBase void slotDeepSkyButton(); void slotSolarSystemButton(); void slotChangeLocation(); - void slotShowStackWidget(QListViewItem*); + void slotShowStackWidget(TQListViewItem*); void slotEnableConstellationPage(bool); void slotEnableRectPage(bool); void slotEnableCircPage(bool); @@ -66,7 +66,7 @@ class ObsListWizard : public KDialogBase void applyFilters( bool doBuildList ); void applyRegionFilter( SkyObject *o, bool doBuildList, bool doAdjustCount=true ); - QPtrList ObsList; + TQPtrList ObsList; KStars *ksw; ObsListWizardUI *olw; uint ObjectCount, StarCount, PlanetCount, CometCount, AsteroidCount; diff --git a/kstars/kstars/tools/planetviewer.cpp b/kstars/kstars/tools/planetviewer.cpp index 725e5318..cd0aba3d 100644 --- a/kstars/kstars/tools/planetviewer.cpp +++ b/kstars/kstars/tools/planetviewer.cpp @@ -16,8 +16,8 @@ #include //needed for abs() on some platforms -#include -#include +#include +#include #include #include #include @@ -35,11 +35,11 @@ #define AUMAX 48 -PlanetViewer::PlanetViewer(QWidget *parent, const char *name) +PlanetViewer::PlanetViewer(TQWidget *parent, const char *name) : KDialogBase( KDialogBase::Plain, i18n("Solar System Viewer"), Close, Close, parent, name ), PCat( ((KStars*)parent)->data() ), scale(1.0), isClockRunning(false), tmr(this) { - QFrame *page = plainPage(); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, spacingHint() ); + TQFrame *page = plainPage(); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, spacingHint() ); pw = new PlanetViewerUI( page ); pw->map->setLimits( -48.0, 48.0, -48.0, 48.0 ); pw->map->setXAxisLabel( i18n( "axis label for x-coordinate of solar system viewer. AU means astronomical unit.", "X-position (AU)" ) ); @@ -53,7 +53,7 @@ PlanetViewer::PlanetViewer(QWidget *parent, const char *name) vlay->addWidget( pw ); resize( 500, 500 ); - pw->map->QWidget::setFocus(); //give keyboard focus to the plot widget for key and mouse events + pw->map->TQWidget::setFocus(); //give keyboard focus to the plot widget for key and mouse events pName[0] = "Mercury"; pColor[0] = "SlateBlue1"; pName[1] = "Venus"; pColor[1] = "LightGreen"; @@ -86,13 +86,13 @@ PlanetViewer::PlanetViewer(QWidget *parent, const char *name) UpdateInterval[7] = 75; UpdateInterval[8] = 113; - QTimer::singleShot( 0, this, SLOT( initPlotObjects() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( initPlotObjects() ) ); - connect( &tmr, SIGNAL( timeout() ), SLOT( tick() ) ); - connect( pw->timeStep, SIGNAL( scaleChanged(float) ), SLOT( setTimeScale(float) ) ); - connect( pw->RunButton, SIGNAL( clicked() ), SLOT( slotRunClock() ) ); - connect( pw->dateBox, SIGNAL( valueChanged( const ExtDate & ) ), SLOT( slotChangeDate( const ExtDate & ) ) ); - connect( pw->TodayButton, SIGNAL( clicked() ), SLOT( slotToday() ) ); + connect( &tmr, TQT_SIGNAL( timeout() ), TQT_SLOT( tick() ) ); + connect( pw->timeStep, TQT_SIGNAL( scaleChanged(float) ), TQT_SLOT( setTimeScale(float) ) ); + connect( pw->RunButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotRunClock() ) ); + connect( pw->dateBox, TQT_SIGNAL( valueChanged( const ExtDate & ) ), TQT_SLOT( slotChangeDate( const ExtDate & ) ) ); + connect( pw->TodayButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotToday() ) ); } PlanetViewer::~PlanetViewer() @@ -172,7 +172,7 @@ void PlanetViewer::slotToday() { pw->dateBox->setDate( ks->data()->lt().date() ); } -void PlanetViewer::paintEvent( QPaintEvent* ) { +void PlanetViewer::paintEvent( TQPaintEvent* ) { pw->map->update(); } @@ -187,9 +187,9 @@ void PlanetViewer::initPlotObjects() { for ( unsigned int i=0; i<9; ++i ) { orbit[i] = new KPlotObject( "", "white", KPlotObject::CURVE, 1, KPlotObject::SOLID ); - QFile orbitFile; + TQFile orbitFile; if ( KSUtils::openDataFile( orbitFile, pName[i].lower() + ".orbit" ) ) { - QTextStream orbitStream( &orbitFile ); + TQTextStream orbitStream( &orbitFile ); double x, y, z; while ( !orbitStream.eof() ) { orbitStream >> x >> y >> z; @@ -217,7 +217,7 @@ void PlanetViewer::initPlotObjects() { update(); } -void PlanetViewer::keyPressEvent( QKeyEvent *e ) { +void PlanetViewer::keyPressEvent( TQKeyEvent *e ) { switch ( e->key() ) { case Key_Escape: close(); @@ -228,25 +228,25 @@ void PlanetViewer::keyPressEvent( QKeyEvent *e ) { } } -PVPlotWidget::PVPlotWidget( double x1, double x2, double y1, double y2, QWidget *par, const char *name ) : +PVPlotWidget::PVPlotWidget( double x1, double x2, double y1, double y2, TQWidget *par, const char *name ) : KStarsPlotWidget( x1, x2, y1, y2, par, name ), mouseButtonDown(false), oldx(0), oldy(0) { - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( TQWidget::StrongFocus ); setMouseTracking (true); pv = (PlanetViewer*)topLevelWidget(); } -PVPlotWidget::PVPlotWidget( QWidget *parent, const char *name ) : +PVPlotWidget::PVPlotWidget( TQWidget *parent, const char *name ) : KStarsPlotWidget( 0.0, 1.0, 0.0, 1.0, parent, name ), mouseButtonDown(false), oldx(0), oldy(0) { - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( TQWidget::StrongFocus ); setMouseTracking (true); pv = (PlanetViewer*)topLevelWidget(); } PVPlotWidget::~ PVPlotWidget() {} -void PVPlotWidget::keyPressEvent( QKeyEvent *e ) { +void PVPlotWidget::keyPressEvent( TQKeyEvent *e ) { double xc = (x2() + x())*0.5; double yc = (y2() + y())*0.5; double xstep = 0.01*(x2() - x()); @@ -390,18 +390,18 @@ void PVPlotWidget::keyPressEvent( QKeyEvent *e ) { } } -void PVPlotWidget::mousePressEvent( QMouseEvent *e ) { +void PVPlotWidget::mousePressEvent( TQMouseEvent *e ) { mouseButtonDown = true; oldx = e->x(); oldy = e->y(); } -void PVPlotWidget::mouseReleaseEvent( QMouseEvent * ) { +void PVPlotWidget::mouseReleaseEvent( TQMouseEvent * ) { mouseButtonDown = false; update(); } -void PVPlotWidget::mouseMoveEvent( QMouseEvent *e ) { +void PVPlotWidget::mouseMoveEvent( TQMouseEvent *e ) { if ( mouseButtonDown ) { //Determine how far we've moved double xc = (x2() + x())*0.5; @@ -424,7 +424,7 @@ void PVPlotWidget::mouseMoveEvent( QMouseEvent *e ) { } } -void PVPlotWidget::mouseDoubleClickEvent( QMouseEvent *e ) { +void PVPlotWidget::mouseDoubleClickEvent( TQMouseEvent *e ) { double xscale = dataWidth()/( width() - leftPadding() - rightPadding() ); double yscale = dataHeight()/( height() - topPadding() - bottomPadding() ); @@ -449,7 +449,7 @@ void PVPlotWidget::mouseDoubleClickEvent( QMouseEvent *e ) { } } -void PVPlotWidget::wheelEvent( QWheelEvent *e ) { +void PVPlotWidget::wheelEvent( TQWheelEvent *e ) { if ( e->delta() > 0 ) slotZoomIn(); else slotZoomOut(); } diff --git a/kstars/kstars/tools/planetviewer.h b/kstars/kstars/tools/planetviewer.h index 6df052a8..b212a630 100644 --- a/kstars/kstars/tools/planetviewer.h +++ b/kstars/kstars/tools/planetviewer.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include "kstarsplotwidget.h" #include "planetviewerui.h" @@ -35,18 +35,18 @@ class PlanetViewer : public KDialogBase { Q_OBJECT public: - PlanetViewer(QWidget *parent = 0, const char *name = 0); + PlanetViewer(TQWidget *parent = 0, const char *name = 0); ~PlanetViewer(); - QString centerPlanet() const { return CenterPlanet; } - void setCenterPlanet( const QString &cp ) { CenterPlanet = cp; } + TQString centerPlanet() const { return CenterPlanet; } + void setCenterPlanet( const TQString &cp ) { CenterPlanet = cp; } KPlotObject* planetObject(uint i) const { return planet[i]; } - QString planetName(uint i) const { return pName[i]; } + TQString planetName(uint i) const { return pName[i]; } protected: - virtual void keyPressEvent( QKeyEvent *e ); - virtual void paintEvent( QPaintEvent* ); + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void paintEvent( TQPaintEvent* ); private slots: void initPlotObjects(); @@ -64,10 +64,10 @@ private: PlanetCatalog PCat; double scale; bool isClockRunning; - QTimer tmr; + TQTimer tmr; int UpdateInterval[9], LastUpdate[9]; - QString pName[9], pColor[9]; - QString CenterPlanet; + TQString pName[9], pColor[9]; + TQString CenterPlanet; KPlotObject *ksun; KPlotObject *planet[9]; @@ -79,8 +79,8 @@ class PVPlotWidget : public KStarsPlotWidget Q_OBJECT public: PVPlotWidget( double x1, double x2, double y1, double y2, - QWidget *parent=0, const char *name=0 ); - PVPlotWidget( QWidget *parent=0, const char *name=0 ); + TQWidget *parent=0, const char *name=0 ); + PVPlotWidget( TQWidget *parent=0, const char *name=0 ); ~PVPlotWidget(); public slots: @@ -91,12 +91,12 @@ signals: void doubleClicked( double, double ); protected: - virtual void keyPressEvent( QKeyEvent *e ); - virtual void mousePressEvent( QMouseEvent *e ); - virtual void mouseMoveEvent( QMouseEvent *e ); - virtual void mouseReleaseEvent( QMouseEvent * ); - virtual void mouseDoubleClickEvent( QMouseEvent *e ); - virtual void wheelEvent( QWheelEvent *e ); + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void mousePressEvent( TQMouseEvent *e ); + virtual void mouseMoveEvent( TQMouseEvent *e ); + virtual void mouseReleaseEvent( TQMouseEvent * ); + virtual void mouseDoubleClickEvent( TQMouseEvent *e ); + virtual void wheelEvent( TQWheelEvent *e ); private: bool mouseButtonDown; diff --git a/kstars/kstars/tools/scriptbuilder.cpp b/kstars/kstars/tools/scriptbuilder.cpp index 51922785..b7538432 100644 --- a/kstars/kstars/tools/scriptbuilder.cpp +++ b/kstars/kstars/tools/scriptbuilder.cpp @@ -40,15 +40,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "scriptfunction.h" #include "scriptbuilderui.h" @@ -100,15 +100,15 @@ #include "timestepbox.h" #include "libkdeedu/extdate/extdatewidget.h" -ScriptBuilder::ScriptBuilder( QWidget *parent, const char *name ) +ScriptBuilder::ScriptBuilder( TQWidget *parent, const char *name ) : KDialogBase( KDialogBase::Plain, i18n( "Script Builder" ), Close, Close, parent, name ), - UnsavedChanges(false), currentFileURL(), currentDir( QDir::homeDirPath() ), + UnsavedChanges(false), currentFileURL(), currentDir( TQDir::homeDirPath() ), currentScriptName(), currentAuthor() { - QFrame *page = plainPage(); + TQFrame *page = plainPage(); ks = (KStars*)parent; - QVBoxLayout *vlay = new QVBoxLayout( page, 0, 0 ); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, 0 ); sb = new ScriptBuilderUI( page ); vlay->addWidget( sb ); @@ -118,7 +118,7 @@ ScriptBuilder::ScriptBuilder( QWidget *parent, const char *name ) //Initialize function templates and descriptions KStarsFunctionList.append( new ScriptFunction( "lookTowards", i18n( "Point the display at the specified location. %1 can be the name of an object, a cardinal point on the compass, or 'zenith'." ), - false, "QString", "dir" ) ); + false, "TQString", "dir" ) ); KStarsFunctionList.append( new ScriptFunction( "setRaDec", i18n( "Point the display at the specified RA/Dec coordinates. %1 is expressed in Hours; %2 is expressed in Degrees." ), false, "double", "ra", "double", "dec" ) ); KStarsFunctionList.append( new ScriptFunction( "setAltAz", i18n( "Point the display at the specified Alt/Az coordinates. %1 and %2 are expressed in Degrees." ), @@ -131,14 +131,14 @@ ScriptBuilder::ScriptBuilder( QWidget *parent, const char *name ) false, "int", "year", "int", "month", "int", "day", "int", "hour", "int", "minute", "int", "second" ) ); KStarsFunctionList.append( new ScriptFunction( "waitFor", i18n( "Pause script execution for %1 seconds." ), false, "double", "sec" ) ); KStarsFunctionList.append( new ScriptFunction( "waitForKey", i18n( "Halt script execution until the key %1 is pressed. Only single-key strokes are possible; use 'space' for the spacebar." ), - false, "QString", "key" ) ); + false, "TQString", "key" ) ); KStarsFunctionList.append( new ScriptFunction( "setTracking", i18n( "Set whether the display is tracking the current location." ), false, "bool", "track" ) ); - KStarsFunctionList.append( new ScriptFunction( "changeViewOption", i18n( "Change view option named %1 to value %2." ), false, "QString", "opName", "QString", "opValue" ) ); + KStarsFunctionList.append( new ScriptFunction( "changeViewOption", i18n( "Change view option named %1 to value %2." ), false, "TQString", "opName", "TQString", "opValue" ) ); KStarsFunctionList.append( new ScriptFunction( "setGeoLocation", i18n( "Set the geographic location to the city specified by %1, %2 and %3." ), - false, "QString", "cityName", "QString", "provinceName", "QString", "countryName" ) ); - KStarsFunctionList.append( new ScriptFunction( "setColor", i18n( "Set the color named %1 to the value %2." ), false, "QString", "colorName", "QString", "value" ) ); - KStarsFunctionList.append( new ScriptFunction( "loadColorScheme", i18n( "Load the color scheme named %1." ), false, "QString", "name" ) ); - KStarsFunctionList.append( new ScriptFunction( "exportImage", i18n( "Export the sky image to the file %1, with width %2 and height %3." ), false, "QString", "fileName", "int", "width", "int", "height" ) ); + false, "TQString", "cityName", "TQString", "provinceName", "TQString", "countryName" ) ); + KStarsFunctionList.append( new ScriptFunction( "setColor", i18n( "Set the color named %1 to the value %2." ), false, "TQString", "colorName", "TQString", "value" ) ); + KStarsFunctionList.append( new ScriptFunction( "loadColorScheme", i18n( "Load the color scheme named %1." ), false, "TQString", "name" ) ); + KStarsFunctionList.append( new ScriptFunction( "exportImage", i18n( "Export the sky image to the file %1, with width %2 and height %3." ), false, "TQString", "fileName", "int", "width", "int", "height" ) ); KStarsFunctionList.append( new ScriptFunction( "printImage", i18n( "Print the sky image to a printer or file. If %1 is true, it will show the print dialog. If %2 is true, it will use the Star Chart color scheme for printing." ), false, "bool", "usePrintDialog", "bool", "useChartColors" ) ); KStarsFunctionList.append( new ScriptFunction( "stop", i18n( "Halt the simulation clock." ), true ) ); KStarsFunctionList.append( new ScriptFunction( "start", i18n( "Start the simulation clock." ), true ) ); @@ -147,71 +147,71 @@ ScriptBuilder::ScriptBuilder( QWidget *parent, const char *name ) // INDI fuctions ScriptFunction *startINDIFunc(NULL), *shutdownINDIFunc(NULL), *switchINDIFunc(NULL), *setINDIPortFunc(NULL), *setINDIScopeActionFunc(NULL), *setINDITargetCoordFunc(NULL), *setINDITargetNameFunc(NULL), *setINDIGeoLocationFunc(NULL), *setINDIUTCFunc(NULL), *setINDIActionFunc(NULL), *waitForINDIActionFunc(NULL), *setINDIFocusSpeedFunc(NULL), *startINDIFocusFunc(NULL), *setINDIFocusTimeoutFunc(NULL), *setINDICCDTempFunc(NULL), *setINDIFilterNumFunc(NULL), *setINDIFrameTypeFunc(NULL), *startINDIExposureFunc(NULL); - startINDIFunc = new ScriptFunction( "startINDI", i18n("Establish an INDI device either in local mode or server mode."), false, "QString", "deviceName", "bool", "useLocal"); + startINDIFunc = new ScriptFunction( "startINDI", i18n("Establish an INDI device either in local mode or server mode."), false, "TQString", "deviceName", "bool", "useLocal"); INDIFunctionList.append ( startINDIFunc ); - shutdownINDIFunc = new ScriptFunction( "shutdownINDI", i18n("Shutdown an INDI device."), false, "QString", "deviceName"); + shutdownINDIFunc = new ScriptFunction( "shutdownINDI", i18n("Shutdown an INDI device."), false, "TQString", "deviceName"); INDIFunctionList.append ( shutdownINDIFunc); - switchINDIFunc = new ScriptFunction( "switchINDI", i18n("Connect or Disconnect an INDI device."), false, "QString", "deviceName", "bool", "turnOn"); + switchINDIFunc = new ScriptFunction( "switchINDI", i18n("Connect or Disconnect an INDI device."), false, "TQString", "deviceName", "bool", "turnOn"); switchINDIFunc->setINDIProperty("CONNECTION"); INDIFunctionList.append ( switchINDIFunc); - setINDIPortFunc = new ScriptFunction( "setINDIPort", i18n("Set INDI's device connection port."), false, "QString", "deviceName", "QString", "port"); + setINDIPortFunc = new ScriptFunction( "setINDIPort", i18n("Set INDI's device connection port."), false, "TQString", "deviceName", "TQString", "port"); setINDIPortFunc->setINDIProperty("DEVICE_PORT"); INDIFunctionList.append ( setINDIPortFunc); - setINDIScopeActionFunc = new ScriptFunction( "setINDIScopeAction", i18n("Set the telescope action. Available actions are SLEW, TRACK, SYNC, PARK, and ABORT."), false, "QString", "deviceName", "QString", "action"); + setINDIScopeActionFunc = new ScriptFunction( "setINDIScopeAction", i18n("Set the telescope action. Available actions are SLEW, TRACK, SYNC, PARK, and ABORT."), false, "TQString", "deviceName", "TQString", "action"); setINDIScopeActionFunc->setINDIProperty("CHECK"); INDIFunctionList.append( setINDIScopeActionFunc); - setINDITargetCoordFunc = new ScriptFunction ( "setINDITargetCoord", i18n( "Set the telescope target coordinates to the RA/Dec coordinates. RA is expressed in Hours; DEC is expressed in Degrees." ), false, "QString", "deviceName", "double", "RA", "double", "DEC" ); + setINDITargetCoordFunc = new ScriptFunction ( "setINDITargetCoord", i18n( "Set the telescope target coordinates to the RA/Dec coordinates. RA is expressed in Hours; DEC is expressed in Degrees." ), false, "TQString", "deviceName", "double", "RA", "double", "DEC" ); setINDITargetCoordFunc->setINDIProperty("EQUATORIAL_EOD_COORD"); INDIFunctionList.append ( setINDITargetCoordFunc ); - setINDITargetNameFunc = new ScriptFunction( "setINDITargetName", i18n("Set the telescope target coorinates to the RA/Dec coordinates of the selected object."), false, "QString", "deviceName", "QString", "objectName"); + setINDITargetNameFunc = new ScriptFunction( "setINDITargetName", i18n("Set the telescope target coorinates to the RA/Dec coordinates of the selected object."), false, "TQString", "deviceName", "TQString", "objectName"); setINDITargetNameFunc->setINDIProperty("EQUATORIAL_EOD_COORD"); INDIFunctionList.append( setINDITargetNameFunc); - setINDIGeoLocationFunc = new ScriptFunction ( "setINDIGeoLocation", i18n("Set the telescope longitude and latitude. The longitude is E of N."), false, "QString", "deviceName", "double", "long", "double", "lat"); + setINDIGeoLocationFunc = new ScriptFunction ( "setINDIGeoLocation", i18n("Set the telescope longitude and latitude. The longitude is E of N."), false, "TQString", "deviceName", "double", "long", "double", "lat"); setINDIGeoLocationFunc->setINDIProperty("GEOGRAPHIC_COORD"); INDIFunctionList.append( setINDIGeoLocationFunc); - setINDIUTCFunc = new ScriptFunction ( "setINDIUTC", i18n("Set the device UTC time in ISO 8601 format YYYY/MM/DDTHH:MM:SS."), false, "QString", "deviceName", "QString", "UTCDateTime"); + setINDIUTCFunc = new ScriptFunction ( "setINDIUTC", i18n("Set the device UTC time in ISO 8601 format YYYY/MM/DDTHH:MM:SS."), false, "TQString", "deviceName", "TQString", "UTCDateTime"); setINDIUTCFunc->setINDIProperty("TIME"); INDIFunctionList.append( setINDIUTCFunc); - setINDIActionFunc = new ScriptFunction( "setINDIAction", i18n("Activate an INDI action. The action is the name of any INDI switch property element supported by the device."), false, "QString", "deviceName", "QString", "actionName"); + setINDIActionFunc = new ScriptFunction( "setINDIAction", i18n("Activate an INDI action. The action is the name of any INDI switch property element supported by the device."), false, "TQString", "deviceName", "TQString", "actionName"); INDIFunctionList.append( setINDIActionFunc); - waitForINDIActionFunc = new ScriptFunction ("waitForINDIAction", i18n("Pause script execution until action returns with OK status. The action can be the name of any INDI property supported by the device."), false, "QString", "deviceName", "QString", "actionName"); + waitForINDIActionFunc = new ScriptFunction ("waitForINDIAction", i18n("Pause script execution until action returns with OK status. The action can be the name of any INDI property supported by the device."), false, "TQString", "deviceName", "TQString", "actionName"); INDIFunctionList.append( waitForINDIActionFunc ); - setINDIFocusSpeedFunc = new ScriptFunction ("setINDIFocusSpeed", i18n("Set the telescope focuser speed. Set speed to 0 to halt the focuser. 1-3 correspond to slow, medium, and fast speeds respectively."), false, "QString", "deviceName", "unsigned int", "speed"); + setINDIFocusSpeedFunc = new ScriptFunction ("setINDIFocusSpeed", i18n("Set the telescope focuser speed. Set speed to 0 to halt the focuser. 1-3 correspond to slow, medium, and fast speeds respectively."), false, "TQString", "deviceName", "unsigned int", "speed"); setINDIFocusSpeedFunc->setINDIProperty("FOCUS_SPEED"); INDIFunctionList.append( setINDIFocusSpeedFunc ); - startINDIFocusFunc = new ScriptFunction ("startINDIFocus", i18n("Start moving the focuser in the direction Dir, and for the duration specified by setINDIFocusTimeout."), false, "QString", "deviceName", "QString", "Dir"); + startINDIFocusFunc = new ScriptFunction ("startINDIFocus", i18n("Start moving the focuser in the direction Dir, and for the duration specified by setINDIFocusTimeout."), false, "TQString", "deviceName", "TQString", "Dir"); startINDIFocusFunc->setINDIProperty("FOCUS_MOTION"); INDIFunctionList.append( startINDIFocusFunc); - setINDIFocusTimeoutFunc = new ScriptFunction ( "setINDIFocusTimeout", i18n("Set the telescope focuser timer in seconds. This is the duration of any focusing procedure performed by calling startINDIFocus."), false, "QString", "deviceName", "int", "timeout"); + setINDIFocusTimeoutFunc = new ScriptFunction ( "setINDIFocusTimeout", i18n("Set the telescope focuser timer in seconds. This is the duration of any focusing procedure performed by calling startINDIFocus."), false, "TQString", "deviceName", "int", "timeout"); setINDIFocusTimeoutFunc->setINDIProperty("FOCUS_TIMER"); INDIFunctionList.append( setINDIFocusTimeoutFunc); - setINDICCDTempFunc = new ScriptFunction( "setINDICCDTemp", i18n("Set the target CCD chip temperature."), false, "QString", "deviceName", "int", "temp"); + setINDICCDTempFunc = new ScriptFunction( "setINDICCDTemp", i18n("Set the target CCD chip temperature."), false, "TQString", "deviceName", "int", "temp"); setINDICCDTempFunc->setINDIProperty("CCD_TEMPERATURE"); INDIFunctionList.append( setINDICCDTempFunc); - setINDIFilterNumFunc = new ScriptFunction( "setINDIFilterNum", i18n("Set the target filter position."), false, "QString", "deviceName", "int", "filter_num"); + setINDIFilterNumFunc = new ScriptFunction( "setINDIFilterNum", i18n("Set the target filter position."), false, "TQString", "deviceName", "int", "filter_num"); setINDIFilterNumFunc->setINDIProperty("FILTER_SLOT"); INDIFunctionList.append ( setINDIFilterNumFunc); - setINDIFrameTypeFunc = new ScriptFunction( "setINDIFrameType", i18n("Set the CCD camera frame type. Available options are FRAME_LIGHT, FRAME_BIAS, FRAME_DARK, and FRAME_FLAT."), false, "QString", "deviceName", "QString", "type"); + setINDIFrameTypeFunc = new ScriptFunction( "setINDIFrameType", i18n("Set the CCD camera frame type. Available options are FRAME_LIGHT, FRAME_BIAS, FRAME_DARK, and FRAME_FLAT."), false, "TQString", "deviceName", "TQString", "type"); setINDIFrameTypeFunc->setINDIProperty("FRAME_TYPE"); INDIFunctionList.append( setINDIFrameTypeFunc); - startINDIExposureFunc = new ScriptFunction ( "startINDIExposure", i18n("Start Camera/CCD exposure. The duration is in seconds."), false, "QString", "deviceName", "int", "timeout"); + startINDIExposureFunc = new ScriptFunction ( "startINDIExposure", i18n("Start Camera/CCD exposure. The duration is in seconds."), false, "TQString", "deviceName", "int", "timeout"); startINDIExposureFunc->setINDIProperty("CCD_EXPOSE_DURATION"); INDIFunctionList.append( startINDIExposureFunc); @@ -223,46 +223,46 @@ ScriptBuilder::ScriptBuilder( QWidget *parent, const char *name ) sb->FunctionListView->addColumn(i18n("Functions")); sb->FunctionListView->setSorting(-1); - QListViewItem *INDI_tree = new QListViewItem( sb->FunctionListView, "INDI"); - QListViewItem *INDI_filter = new QListViewItem( INDI_tree, "Filter"); - QListViewItem *INDI_focuser = new QListViewItem( INDI_tree, "Focuser"); - QListViewItem *INDI_ccd = new QListViewItem( INDI_tree, "Camera/CCD"); - QListViewItem *INDI_telescope = new QListViewItem( INDI_tree, "Telescope"); - QListViewItem *INDI_general = new QListViewItem( INDI_tree, "General"); + TQListViewItem *INDI_tree = new TQListViewItem( sb->FunctionListView, "INDI"); + TQListViewItem *INDI_filter = new TQListViewItem( INDI_tree, "Filter"); + TQListViewItem *INDI_focuser = new TQListViewItem( INDI_tree, "Focuser"); + TQListViewItem *INDI_ccd = new TQListViewItem( INDI_tree, "Camera/CCD"); + TQListViewItem *INDI_telescope = new TQListViewItem( INDI_tree, "Telescope"); + TQListViewItem *INDI_general = new TQListViewItem( INDI_tree, "General"); - QListViewItem *kstars_tree = new QListViewItem( sb->FunctionListView, "KStars"); + TQListViewItem *kstars_tree = new TQListViewItem( sb->FunctionListView, "KStars"); for ( ScriptFunction *sf = KStarsFunctionList.last(); sf; sf = KStarsFunctionList.prev() ) - new QListViewItem (kstars_tree, sf->prototype()); + new TQListViewItem (kstars_tree, sf->prototype()); // General - new QListViewItem(INDI_general, waitForINDIActionFunc->prototype()); - new QListViewItem(INDI_general, setINDIActionFunc->prototype()); - new QListViewItem(INDI_general, setINDIPortFunc->prototype()); - new QListViewItem(INDI_general, switchINDIFunc->prototype()); - new QListViewItem(INDI_general, shutdownINDIFunc->prototype()); - new QListViewItem(INDI_general, startINDIFunc->prototype()); + new TQListViewItem(INDI_general, waitForINDIActionFunc->prototype()); + new TQListViewItem(INDI_general, setINDIActionFunc->prototype()); + new TQListViewItem(INDI_general, setINDIPortFunc->prototype()); + new TQListViewItem(INDI_general, switchINDIFunc->prototype()); + new TQListViewItem(INDI_general, shutdownINDIFunc->prototype()); + new TQListViewItem(INDI_general, startINDIFunc->prototype()); // Telescope - new QListViewItem(INDI_telescope, setINDIUTCFunc->prototype()); - new QListViewItem(INDI_telescope, setINDIGeoLocationFunc->prototype()); - new QListViewItem(INDI_telescope, setINDITargetNameFunc->prototype()); - new QListViewItem(INDI_telescope, setINDITargetCoordFunc->prototype()); - new QListViewItem(INDI_telescope, setINDIScopeActionFunc->prototype()); + new TQListViewItem(INDI_telescope, setINDIUTCFunc->prototype()); + new TQListViewItem(INDI_telescope, setINDIGeoLocationFunc->prototype()); + new TQListViewItem(INDI_telescope, setINDITargetNameFunc->prototype()); + new TQListViewItem(INDI_telescope, setINDITargetCoordFunc->prototype()); + new TQListViewItem(INDI_telescope, setINDIScopeActionFunc->prototype()); // CCD - new QListViewItem(INDI_ccd, startINDIExposureFunc->prototype()); - new QListViewItem(INDI_ccd, setINDIFrameTypeFunc->prototype()); - new QListViewItem(INDI_ccd, setINDICCDTempFunc->prototype()); + new TQListViewItem(INDI_ccd, startINDIExposureFunc->prototype()); + new TQListViewItem(INDI_ccd, setINDIFrameTypeFunc->prototype()); + new TQListViewItem(INDI_ccd, setINDICCDTempFunc->prototype()); // Focuser - new QListViewItem(INDI_focuser, startINDIFocusFunc->prototype()); - new QListViewItem(INDI_focuser, setINDIFocusTimeoutFunc->prototype()); - new QListViewItem(INDI_focuser, setINDIFocusSpeedFunc->prototype()); + new TQListViewItem(INDI_focuser, startINDIFocusFunc->prototype()); + new TQListViewItem(INDI_focuser, setINDIFocusTimeoutFunc->prototype()); + new TQListViewItem(INDI_focuser, setINDIFocusSpeedFunc->prototype()); // Filter - new QListViewItem(INDI_filter, setINDIFilterNumFunc->prototype()); + new TQListViewItem(INDI_filter, setINDIFilterNumFunc->prototype()); //Add icons to Push Buttons KIconLoader *icons = KGlobal::iconLoader(); @@ -278,7 +278,7 @@ ScriptBuilder::ScriptBuilder( QWidget *parent, const char *name ) sb->DownButton->setIconSet( icons->loadIconSet( "down", KIcon::Toolbar ) ); //Prepare the widget stack - argBlank = new QWidget( sb->ArgStack ); + argBlank = new TQWidget( sb->ArgStack ); argLookToward = new ArgLookToward( sb->ArgStack ); argSetRaDec = new ArgSetRaDec( sb->ArgStack ); argSetAltAz = new ArgSetAltAz( sb->ArgStack ); @@ -371,129 +371,129 @@ ScriptBuilder::ScriptBuilder( QWidget *parent, const char *name ) initViewOptions(); //connect widgets in ScriptBuilderUI - connect( sb->FunctionListView, SIGNAL( doubleClicked(QListViewItem *, const QPoint &, int )), this, SLOT( slotAddFunction() ) ); - connect( sb->FunctionListView, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( slotShowDoc() ) ); - connect( sb->UpButton, SIGNAL( clicked() ), this, SLOT( slotMoveFunctionUp() ) ); - connect( sb->ScriptListBox, SIGNAL( currentChanged(QListBoxItem*) ), this, SLOT( slotArgWidget() ) ); - connect( sb->DownButton, SIGNAL( clicked() ), this, SLOT( slotMoveFunctionDown() ) ); - connect( sb->CopyButton, SIGNAL( clicked() ), this, SLOT( slotCopyFunction() ) ); - connect( sb->RemoveButton, SIGNAL( clicked() ), this, SLOT( slotRemoveFunction() ) ); - connect( sb->NewButton, SIGNAL( clicked() ), this, SLOT( slotNew() ) ); - connect( sb->OpenButton, SIGNAL( clicked() ), this, SLOT( slotOpen() ) ); - connect( sb->SaveButton, SIGNAL( clicked() ), this, SLOT( slotSave() ) ); - connect( sb->SaveAsButton, SIGNAL( clicked() ), this, SLOT( slotSaveAs() ) ); - connect( sb->AddButton, SIGNAL( clicked() ), this, SLOT( slotAddFunction() ) ); - connect( sb->RunButton, SIGNAL( clicked() ), this, SLOT( slotRunScript() ) ); + connect( sb->FunctionListView, TQT_SIGNAL( doubleClicked(TQListViewItem *, const TQPoint &, int )), this, TQT_SLOT( slotAddFunction() ) ); + connect( sb->FunctionListView, TQT_SIGNAL( currentChanged(TQListViewItem*) ), this, TQT_SLOT( slotShowDoc() ) ); + connect( sb->UpButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveFunctionUp() ) ); + connect( sb->ScriptListBox, TQT_SIGNAL( currentChanged(TQListBoxItem*) ), this, TQT_SLOT( slotArgWidget() ) ); + connect( sb->DownButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotMoveFunctionDown() ) ); + connect( sb->CopyButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotCopyFunction() ) ); + connect( sb->RemoveButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRemoveFunction() ) ); + connect( sb->NewButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotNew() ) ); + connect( sb->OpenButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotOpen() ) ); + connect( sb->SaveButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSave() ) ); + connect( sb->SaveAsButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotSaveAs() ) ); + connect( sb->AddButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAddFunction() ) ); + connect( sb->RunButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotRunScript() ) ); //Connections for Arg Widgets - connect( argSetGeoLocation->FindCityButton, SIGNAL( clicked() ), this, SLOT( slotFindCity() ) ); - connect( argLookToward->FindButton, SIGNAL( clicked() ), this, SLOT( slotFindObject() ) ); - connect( argChangeViewOption->TreeButton, SIGNAL( clicked() ), this, SLOT( slotShowOptions() ) ); - - connect( argLookToward->FocusEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( slotLookToward() ) ); - connect( argSetRaDec->RaBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotRa() ) ); - connect( argSetRaDec->DecBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotDec() ) ); - connect( argSetAltAz->AltBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotAlt() ) ); - connect( argSetAltAz->AzBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotAz() ) ); - connect( argSetLocalTime->DateBox, SIGNAL( changed(ExtDate) ), this, SLOT( slotChangeDate() ) ); - connect( argSetLocalTime->TimeBox, SIGNAL( valueChanged(const QTime&) ), this, SLOT( slotChangeTime() ) ); - connect( argWaitFor->DelayBox, SIGNAL( valueChanged(int) ), this, SLOT( slotWaitFor() ) ); - connect( argWaitForKey->WaitKeyEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( slotWaitForKey() ) ); - connect( argSetTracking->CheckTrack, SIGNAL( stateChanged(int) ), this, SLOT( slotTracking() ) ); - connect( argChangeViewOption->OptionName, SIGNAL( activated(const QString &) ), this, SLOT( slotViewOption() ) ); - connect( argChangeViewOption->OptionValue, SIGNAL( textChanged(const QString &) ), this, SLOT( slotViewOption() ) ); - connect( argSetGeoLocation->CityName, SIGNAL( textChanged(const QString &) ), this, SLOT( slotChangeCity() ) ); - connect( argSetGeoLocation->ProvinceName, SIGNAL( textChanged(const QString &) ), this, SLOT( slotChangeProvince() ) ); - connect( argSetGeoLocation->CountryName, SIGNAL( textChanged(const QString &) ), this, SLOT( slotChangeCountry() ) ); - connect( argTimeScale->TimeScale, SIGNAL( scaleChanged(float) ), this, SLOT( slotTimeScale() ) ); - connect( argZoom->ZoomBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotZoom() ) ); - connect( argExportImage->ExportFileName, SIGNAL( textChanged(const QString &) ), this, SLOT( slotExportImage() ) ); - connect( argExportImage->ExportWidth, SIGNAL( valueChanged(int) ), this, SLOT( slotExportImage() ) ); - connect( argExportImage->ExportHeight, SIGNAL( valueChanged(int) ), this, SLOT( slotExportImage() ) ); - connect( argPrintImage->UsePrintDialog, SIGNAL( toggled(bool) ), this, SLOT( slotPrintImage() ) ); - connect( argPrintImage->UseChartColors, SIGNAL( toggled(bool) ), this, SLOT( slotPrintImage() ) ); - connect( argSetColor->ColorName, SIGNAL( activated(const QString &) ), this, SLOT( slotChangeColorName() ) ); - connect( argSetColor->ColorValue, SIGNAL( changed(const QColor &) ), this, SLOT( slotChangeColor() ) ); - connect( argLoadColorScheme->SchemeList, SIGNAL( clicked( QListBoxItem* ) ), this, SLOT( slotLoadColorScheme( QListBoxItem* ) ) ); - connect( snd->ScriptName, SIGNAL( textChanged(const QString &) ), this, SLOT( slotEnableScriptNameOK() ) ); + connect( argSetGeoLocation->FindCityButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotFindCity() ) ); + connect( argLookToward->FindButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotFindObject() ) ); + connect( argChangeViewOption->TreeButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotShowOptions() ) ); + + connect( argLookToward->FocusEdit, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotLookToward() ) ); + connect( argSetRaDec->RaBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotRa() ) ); + connect( argSetRaDec->DecBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotDec() ) ); + connect( argSetAltAz->AltBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotAlt() ) ); + connect( argSetAltAz->AzBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotAz() ) ); + connect( argSetLocalTime->DateBox, TQT_SIGNAL( changed(ExtDate) ), this, TQT_SLOT( slotChangeDate() ) ); + connect( argSetLocalTime->TimeBox, TQT_SIGNAL( valueChanged(const TQTime&) ), this, TQT_SLOT( slotChangeTime() ) ); + connect( argWaitFor->DelayBox, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( slotWaitFor() ) ); + connect( argWaitForKey->WaitKeyEdit, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotWaitForKey() ) ); + connect( argSetTracking->CheckTrack, TQT_SIGNAL( stateChanged(int) ), this, TQT_SLOT( slotTracking() ) ); + connect( argChangeViewOption->OptionName, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT( slotViewOption() ) ); + connect( argChangeViewOption->OptionValue, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotViewOption() ) ); + connect( argSetGeoLocation->CityName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotChangeCity() ) ); + connect( argSetGeoLocation->ProvinceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotChangeProvince() ) ); + connect( argSetGeoLocation->CountryName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotChangeCountry() ) ); + connect( argTimeScale->TimeScale, TQT_SIGNAL( scaleChanged(float) ), this, TQT_SLOT( slotTimeScale() ) ); + connect( argZoom->ZoomBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotZoom() ) ); + connect( argExportImage->ExportFileName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotExportImage() ) ); + connect( argExportImage->ExportWidth, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( slotExportImage() ) ); + connect( argExportImage->ExportHeight, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( slotExportImage() ) ); + connect( argPrintImage->UsePrintDialog, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotPrintImage() ) ); + connect( argPrintImage->UseChartColors, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( slotPrintImage() ) ); + connect( argSetColor->ColorName, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT( slotChangeColorName() ) ); + connect( argSetColor->ColorValue, TQT_SIGNAL( changed(const TQColor &) ), this, TQT_SLOT( slotChangeColor() ) ); + connect( argLoadColorScheme->SchemeList, TQT_SIGNAL( clicked( TQListBoxItem* ) ), this, TQT_SLOT( slotLoadColorScheme( TQListBoxItem* ) ) ); + connect( snd->ScriptName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotEnableScriptNameOK() ) ); - connect( sb->AppendINDIWait, SIGNAL ( toggled(bool) ), this, SLOT(slotINDIWaitCheck(bool))); + connect( sb->AppendINDIWait, TQT_SIGNAL ( toggled(bool) ), this, TQT_SLOT(slotINDIWaitCheck(bool))); // Connections for INDI's Arg widgets // INDI Start Device - connect (argStartINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDIStartDeviceName())); - connect (argStartINDI->INDIMode, SIGNAL ( clicked( int)), this, SLOT (slotINDIStartDeviceMode())); + connect (argStartINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIStartDeviceName())); + connect (argStartINDI->INDIMode, TQT_SIGNAL ( clicked( int)), this, TQT_SLOT (slotINDIStartDeviceMode())); // INDI Shutdown Device - connect (argShutdownINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDIShutdown())); + connect (argShutdownINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIShutdown())); // INDI Swtich Device - connect (argSwitchINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISwitchDeviceName())); - connect (argSwitchINDI->INDIConnection, SIGNAL ( clicked( int)), this, SLOT (slotINDISwitchDeviceConnection())); + connect (argSwitchINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISwitchDeviceName())); + connect (argSwitchINDI->INDIConnection, TQT_SIGNAL ( clicked( int)), this, TQT_SLOT (slotINDISwitchDeviceConnection())); // INDI Set Device Port - connect (argSetPortINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetPortDeviceName())); - connect (argSetPortINDI->devicePort, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetPortDevicePort())); + connect (argSetPortINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetPortDeviceName())); + connect (argSetPortINDI->devicePort, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetPortDevicePort())); // INDI Set Target Coord - connect (argSetTargetCoordINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetTargetCoordDeviceName())); - connect( argSetTargetCoordINDI->RaBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotINDISetTargetCoordDeviceRA() ) ); - connect( argSetTargetCoordINDI->DecBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotINDISetTargetCoordDeviceDEC() ) ); + connect (argSetTargetCoordINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetTargetCoordDeviceName())); + connect( argSetTargetCoordINDI->RaBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetTargetCoordDeviceRA() ) ); + connect( argSetTargetCoordINDI->DecBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetTargetCoordDeviceDEC() ) ); // INDI Set Target Name - connect( argSetTargetNameINDI->FindButton, SIGNAL( clicked() ), this, SLOT( slotINDIFindObject() ) ); - connect (argSetTargetNameINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetTargetNameDeviceName())); - connect (argSetTargetNameINDI->objectName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetTargetNameObjectName())); + connect( argSetTargetNameINDI->FindButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotINDIFindObject() ) ); + connect (argSetTargetNameINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetTargetNameDeviceName())); + connect (argSetTargetNameINDI->objectName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetTargetNameObjectName())); // INDI Set Action - connect (argSetActionINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetActionDeviceName())); - connect (argSetActionINDI->actionName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetActionName())); + connect (argSetActionINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetActionDeviceName())); + connect (argSetActionINDI->actionName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetActionName())); // INDI Wait For Action - connect (argWaitForActionINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDIWaitForActionDeviceName())); - connect (argWaitForActionINDI->actionName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDIWaitForActionName())); + connect (argWaitForActionINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIWaitForActionDeviceName())); + connect (argWaitForActionINDI->actionName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIWaitForActionName())); // INDI Set Focus Speed - connect (argSetFocusSpeedINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetFocusSpeedDeviceName())); - connect (argSetFocusSpeedINDI->speedIN, SIGNAL( valueChanged(int) ), this, SLOT(slotINDISetFocusSpeed())); + connect (argSetFocusSpeedINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFocusSpeedDeviceName())); + connect (argSetFocusSpeedINDI->speedIN, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetFocusSpeed())); // INDI Start Focus - connect (argStartFocusINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDIStartFocusDeviceName())); - connect (argStartFocusINDI->directionCombo, SIGNAL( activated(const QString &) ), this, SLOT(slotINDIStartFocusDirection())); + connect (argStartFocusINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIStartFocusDeviceName())); + connect (argStartFocusINDI->directionCombo, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT(slotINDIStartFocusDirection())); // INDI Set Focus Timeout - connect (argSetFocusTimeoutINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetFocusTimeoutDeviceName())); - connect (argSetFocusTimeoutINDI->timeOut, SIGNAL( valueChanged(int) ), this, SLOT(slotINDISetFocusTimeout())); + connect (argSetFocusTimeoutINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFocusTimeoutDeviceName())); + connect (argSetFocusTimeoutINDI->timeOut, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetFocusTimeout())); // INDI Set Geo Location - connect (argSetGeoLocationINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetGeoLocationDeviceName())); - connect( argSetGeoLocationINDI->longBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotINDISetGeoLocationDeviceLong() ) ); - connect( argSetGeoLocationINDI->latBox, SIGNAL( textChanged(const QString &) ), this, SLOT( slotINDISetGeoLocationDeviceLat() ) ); + connect (argSetGeoLocationINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetGeoLocationDeviceName())); + connect( argSetGeoLocationINDI->longBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetGeoLocationDeviceLong() ) ); + connect( argSetGeoLocationINDI->latBox, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT( slotINDISetGeoLocationDeviceLat() ) ); // INDI Start Exposure - connect (argStartExposureINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDIStartExposureDeviceName())); - connect (argStartExposureINDI->timeOut, SIGNAL( valueChanged(int) ), this, SLOT(slotINDIStartExposureTimeout())); + connect (argStartExposureINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDIStartExposureDeviceName())); + connect (argStartExposureINDI->timeOut, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDIStartExposureTimeout())); // INDI Set UTC - connect (argSetUTCINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetUTCDeviceName())); - connect (argSetUTCINDI->UTC, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetUTC())); + connect (argSetUTCINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetUTCDeviceName())); + connect (argSetUTCINDI->UTC, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetUTC())); // INDI Set Scope Action - connect (argSetScopeActionINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetScopeActionDeviceName())); - connect (argSetScopeActionINDI->actionCombo, SIGNAL( activated(const QString &) ), this, SLOT(slotINDISetScopeAction())); + connect (argSetScopeActionINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetScopeActionDeviceName())); + connect (argSetScopeActionINDI->actionCombo, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT(slotINDISetScopeAction())); // INDI Set Frame type - connect (argSetFrameTypeINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetFrameTypeDeviceName())); - connect (argSetFrameTypeINDI->typeCombo, SIGNAL( activated(const QString &) ), this, SLOT(slotINDISetFrameType())); + connect (argSetFrameTypeINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFrameTypeDeviceName())); + connect (argSetFrameTypeINDI->typeCombo, TQT_SIGNAL( activated(const TQString &) ), this, TQT_SLOT(slotINDISetFrameType())); // INDI Set CCD Temp - connect (argSetCCDTempINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetCCDTempDeviceName())); - connect (argSetCCDTempINDI->temp, SIGNAL( valueChanged(int) ), this, SLOT(slotINDISetCCDTemp())); + connect (argSetCCDTempINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetCCDTempDeviceName())); + connect (argSetCCDTempINDI->temp, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetCCDTemp())); // INDI Set Filter Num - connect (argSetFilterNumINDI->deviceName, SIGNAL( textChanged(const QString &) ), this, SLOT(slotINDISetFilterNumDeviceName())); - connect (argSetFilterNumINDI->filter_num, SIGNAL( valueChanged(int) ), this, SLOT(slotINDISetFilterNum())); + connect (argSetFilterNumINDI->deviceName, TQT_SIGNAL( textChanged(const TQString &) ), this, TQT_SLOT(slotINDISetFilterNumDeviceName())); + connect (argSetFilterNumINDI->filter_num, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT(slotINDISetFilterNum())); //disbale some buttons @@ -515,14 +515,14 @@ void ScriptBuilder::initViewOptions() { otv->OptionsList->setRootIsDecorated( true ); //InfoBoxes - opsGUI = new QListViewItem( otv->OptionsList, i18n( "InfoBoxes" ) ); - new QListViewItem( opsGUI, "ShowInfoBoxes", i18n( "Toggle display of all InfoBoxes" ), i18n( "bool" ) ); - new QListViewItem( opsGUI, "ShowTimeBox", i18n( "Toggle display of Time InfoBox" ), i18n( "bool" ) ); - new QListViewItem( opsGUI, "ShowGeoBox", i18n( "Toggle display of Geographic InfoBox" ), i18n( "bool" ) ); - new QListViewItem( opsGUI, "ShowFocusBox", i18n( "Toggle display of Focus InfoBox" ), i18n( "bool" ) ); - new QListViewItem( opsGUI, "ShadeTimeBox", i18n( "(un)Shade Time InfoBox" ), i18n( "bool" ) ); - new QListViewItem( opsGUI, "ShadeGeoBox", i18n( "(un)Shade Geographic InfoBox" ), i18n( "bool" ) ); - new QListViewItem( opsGUI, "ShadeFocusBox", i18n( "(un)Shade Focus InfoBox" ), i18n( "bool" ) ); + opsGUI = new TQListViewItem( otv->OptionsList, i18n( "InfoBoxes" ) ); + new TQListViewItem( opsGUI, "ShowInfoBoxes", i18n( "Toggle display of all InfoBoxes" ), i18n( "bool" ) ); + new TQListViewItem( opsGUI, "ShowTimeBox", i18n( "Toggle display of Time InfoBox" ), i18n( "bool" ) ); + new TQListViewItem( opsGUI, "ShowGeoBox", i18n( "Toggle display of Geographic InfoBox" ), i18n( "bool" ) ); + new TQListViewItem( opsGUI, "ShowFocusBox", i18n( "Toggle display of Focus InfoBox" ), i18n( "bool" ) ); + new TQListViewItem( opsGUI, "ShadeTimeBox", i18n( "(un)Shade Time InfoBox" ), i18n( "bool" ) ); + new TQListViewItem( opsGUI, "ShadeGeoBox", i18n( "(un)Shade Geographic InfoBox" ), i18n( "bool" ) ); + new TQListViewItem( opsGUI, "ShadeFocusBox", i18n( "(un)Shade Focus InfoBox" ), i18n( "bool" ) ); argChangeViewOption->OptionName->insertItem( "ShowInfoBoxes" ); argChangeViewOption->OptionName->insertItem( "ShowTimeBox" ); argChangeViewOption->OptionName->insertItem( "ShowGeoBox" ); @@ -532,33 +532,33 @@ void ScriptBuilder::initViewOptions() { argChangeViewOption->OptionName->insertItem( "ShadeFocusBox" ); //Toolbars - opsToolbar = new QListViewItem( otv->OptionsList, i18n( "Toolbars" ) ); - new QListViewItem( opsToolbar, "ShowMainToolBar", i18n( "Toggle display of main toolbar" ), i18n( "bool" ) ); - new QListViewItem( opsToolbar, "ShowViewToolBar", i18n( "Toggle display of view toolbar" ), i18n( "bool" ) ); + opsToolbar = new TQListViewItem( otv->OptionsList, i18n( "Toolbars" ) ); + new TQListViewItem( opsToolbar, "ShowMainToolBar", i18n( "Toggle display of main toolbar" ), i18n( "bool" ) ); + new TQListViewItem( opsToolbar, "ShowViewToolBar", i18n( "Toggle display of view toolbar" ), i18n( "bool" ) ); argChangeViewOption->OptionName->insertItem( "ShowMainToolBar" ); argChangeViewOption->OptionName->insertItem( "ShowViewToolBar" ); //Show Objects - opsShowObj = new QListViewItem( otv->OptionsList, i18n( "Show Objects" ) ); - new QListViewItem( opsShowObj, "ShowStars", i18n( "Toggle display of Stars" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowDeepSky", i18n( "Toggle display of all deep-sky objects" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowMessier", i18n( "Toggle display of Messier object symbols" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowMessierImages", i18n( "Toggle display of Messier object images" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowNGC", i18n( "Toggle display of NGC objects" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowIC", i18n( "Toggle display of IC objects" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowPlanets", i18n( "Toggle display of all solar system bodies" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowSun", i18n( "Toggle display of Sun" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowMoon", i18n( "Toggle display of Moon" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowMercury", i18n( "Toggle display of Mercury" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowVenus", i18n( "Toggle display of Venus" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowMars", i18n( "Toggle display of Mars" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowJupiter", i18n( "Toggle display of Jupiter" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowSaturn", i18n( "Toggle display of Saturn" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowUranus", i18n( "Toggle display of Uranus" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowNeptune", i18n( "Toggle display of Neptune" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowPluto", i18n( "Toggle display of Pluto" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowAsteroids", i18n( "Toggle display of Asteroids" ), i18n( "bool" ) ); - new QListViewItem( opsShowObj, "ShowComets", i18n( "Toggle display of Comets" ), i18n( "bool" ) ); + opsShowObj = new TQListViewItem( otv->OptionsList, i18n( "Show Objects" ) ); + new TQListViewItem( opsShowObj, "ShowStars", i18n( "Toggle display of Stars" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowDeepSky", i18n( "Toggle display of all deep-sky objects" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowMessier", i18n( "Toggle display of Messier object symbols" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowMessierImages", i18n( "Toggle display of Messier object images" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowNGC", i18n( "Toggle display of NGC objects" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowIC", i18n( "Toggle display of IC objects" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowPlanets", i18n( "Toggle display of all solar system bodies" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowSun", i18n( "Toggle display of Sun" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowMoon", i18n( "Toggle display of Moon" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowMercury", i18n( "Toggle display of Mercury" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowVenus", i18n( "Toggle display of Venus" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowMars", i18n( "Toggle display of Mars" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowJupiter", i18n( "Toggle display of Jupiter" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowSaturn", i18n( "Toggle display of Saturn" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowUranus", i18n( "Toggle display of Uranus" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowNeptune", i18n( "Toggle display of Neptune" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowPluto", i18n( "Toggle display of Pluto" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowAsteroids", i18n( "Toggle display of Asteroids" ), i18n( "bool" ) ); + new TQListViewItem( opsShowObj, "ShowComets", i18n( "Toggle display of Comets" ), i18n( "bool" ) ); argChangeViewOption->OptionName->insertItem( "ShowSAO" ); argChangeViewOption->OptionName->insertItem( "ShowDeepSky" ); argChangeViewOption->OptionName->insertItem( "ShowMess" ); @@ -579,22 +579,22 @@ void ScriptBuilder::initViewOptions() { argChangeViewOption->OptionName->insertItem( "ShowAsteroids" ); argChangeViewOption->OptionName->insertItem( "ShowComets" ); - opsShowOther = new QListViewItem( otv->OptionsList, i18n( "Show Other" ) ); - new QListViewItem( opsShowOther, "ShowCLines", i18n( "Toggle display of constellation lines" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowCBounds", i18n( "Toggle display of constellation boundaries" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowCNames", i18n( "Toggle display of constellation names" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowMilkyWay", i18n( "Toggle display of Milky Way" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowGrid", i18n( "Toggle display of the coordinate grid" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowEquator", i18n( "Toggle display of the celestial equator" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowEcliptic", i18n( "Toggle display of the ecliptic" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowHorizon", i18n( "Toggle display of the horizon line" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowGround", i18n( "Toggle display of the opaque ground" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowStarNames", i18n( "Toggle display of star name labels" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowStarMagnitudes", i18n( "Toggle display of star magnitude labels" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowAsteroidNames", i18n( "Toggle display of asteroid name labels" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowCometNames", i18n( "Toggle display of comet name labels" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowPlanetNames", i18n( "Toggle display of planet name labels" ), i18n( "bool" ) ); - new QListViewItem( opsShowOther, "ShowPlanetImages", i18n( "Toggle display of planet images" ), i18n( "bool" ) ); + opsShowOther = new TQListViewItem( otv->OptionsList, i18n( "Show Other" ) ); + new TQListViewItem( opsShowOther, "ShowCLines", i18n( "Toggle display of constellation lines" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowCBounds", i18n( "Toggle display of constellation boundaries" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowCNames", i18n( "Toggle display of constellation names" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowMilkyWay", i18n( "Toggle display of Milky Way" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowGrid", i18n( "Toggle display of the coordinate grid" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowEquator", i18n( "Toggle display of the celestial equator" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowEcliptic", i18n( "Toggle display of the ecliptic" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowHorizon", i18n( "Toggle display of the horizon line" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowGround", i18n( "Toggle display of the opaque ground" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowStarNames", i18n( "Toggle display of star name labels" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowStarMagnitudes", i18n( "Toggle display of star magnitude labels" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowAsteroidNames", i18n( "Toggle display of asteroid name labels" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowCometNames", i18n( "Toggle display of comet name labels" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowPlanetNames", i18n( "Toggle display of planet name labels" ), i18n( "bool" ) ); + new TQListViewItem( opsShowOther, "ShowPlanetImages", i18n( "Toggle display of planet images" ), i18n( "bool" ) ); argChangeViewOption->OptionName->insertItem( "ShowCLines" ); argChangeViewOption->OptionName->insertItem( "ShowCBounds" ); argChangeViewOption->OptionName->insertItem( "ShowCNames" ); @@ -611,27 +611,27 @@ void ScriptBuilder::initViewOptions() { argChangeViewOption->OptionName->insertItem( "ShowPlanetNames" ); argChangeViewOption->OptionName->insertItem( "ShowPlanetImages" ); - opsCName = new QListViewItem( otv->OptionsList, i18n( "Constellation Names" ) ); - new QListViewItem( opsCName, "UseLatinConstellNames", i18n( "Show Latin constellation names" ), i18n( "bool" ) ); - new QListViewItem( opsCName, "UseLocalConstellNames", i18n( "Show constellation names in local language" ), i18n( "bool" ) ); - new QListViewItem( opsCName, "UseAbbrevConstellNames", i18n( "Show IAU-standard constellation abbreviations" ), i18n( "bool" ) ); + opsCName = new TQListViewItem( otv->OptionsList, i18n( "Constellation Names" ) ); + new TQListViewItem( opsCName, "UseLatinConstellNames", i18n( "Show Latin constellation names" ), i18n( "bool" ) ); + new TQListViewItem( opsCName, "UseLocalConstellNames", i18n( "Show constellation names in local language" ), i18n( "bool" ) ); + new TQListViewItem( opsCName, "UseAbbrevConstellNames", i18n( "Show IAU-standard constellation abbreviations" ), i18n( "bool" ) ); argChangeViewOption->OptionName->insertItem( "UseLatinConstellNames" ); argChangeViewOption->OptionName->insertItem( "UseLocalConstellNames" ); argChangeViewOption->OptionName->insertItem( "UseAbbrevConstellNames" ); - opsHide = new QListViewItem( otv->OptionsList, i18n( "Hide Items" ) ); - new QListViewItem( opsHide, "HideOnSlew", i18n( "Toggle whether objects hidden while slewing display" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "SlewTimeScale", i18n( "Timestep threshold (in seconds) for hiding objects" ), i18n( "double" ) ); - new QListViewItem( opsHide, "HideStars", i18n( "Hide faint stars while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HidePlanets", i18n( "Hide solar system bodies while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideMessier", i18n( "Hide Messier objects while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideNGC", i18n( "Hide NGC objects while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideIC", i18n( "Hide IC objects while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideMilkyWay", i18n( "Hide Milky Way while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideCNames", i18n( "Hide constellation names while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideCLines", i18n( "Hide constellation lines while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideCBounds", i18n( "Hide constellation boundaries while slewing?" ), i18n( "bool" ) ); - new QListViewItem( opsHide, "HideGrid", i18n( "Hide coordinate grid while slewing?" ), i18n( "bool" ) ); + opsHide = new TQListViewItem( otv->OptionsList, i18n( "Hide Items" ) ); + new TQListViewItem( opsHide, "HideOnSlew", i18n( "Toggle whether objects hidden while slewing display" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "SlewTimeScale", i18n( "Timestep threshold (in seconds) for hiding objects" ), i18n( "double" ) ); + new TQListViewItem( opsHide, "HideStars", i18n( "Hide faint stars while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HidePlanets", i18n( "Hide solar system bodies while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideMessier", i18n( "Hide Messier objects while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideNGC", i18n( "Hide NGC objects while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideIC", i18n( "Hide IC objects while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideMilkyWay", i18n( "Hide Milky Way while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideCNames", i18n( "Hide constellation names while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideCLines", i18n( "Hide constellation lines while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideCBounds", i18n( "Hide constellation boundaries while slewing?" ), i18n( "bool" ) ); + new TQListViewItem( opsHide, "HideGrid", i18n( "Hide coordinate grid while slewing?" ), i18n( "bool" ) ); argChangeViewOption->OptionName->insertItem( "HideOnSlew" ); argChangeViewOption->OptionName->insertItem( "SlewTimeScale" ); argChangeViewOption->OptionName->insertItem( "HideStars" ); @@ -645,18 +645,18 @@ void ScriptBuilder::initViewOptions() { argChangeViewOption->OptionName->insertItem( "HideCBounds" ); argChangeViewOption->OptionName->insertItem( "HideGrid" ); - opsSkymap = new QListViewItem( otv->OptionsList, i18n( "Skymap Options" ) ); - new QListViewItem( opsSkymap, "UseAltAz", i18n( "Use Horizontal coordinates? (otherwise, use Equatorial)" ), i18n( "bool" ) ); - new QListViewItem( opsSkymap, "ZoomFactor", i18n( "Set the Zoom Factor" ), i18n( "double" ) ); - new QListViewItem( opsSkymap, "FOV Size", i18n( "Select angular size for the FOV symbol (in arcmin)" ), i18n( "double" ) ); - new QListViewItem( opsSkymap, "FOV Shape", i18n( "Select shape for the FOV symbol (0=Square, 1=Circle, 2=Crosshairs, 4=Bullseye)" ), i18n( "int" ) ); - new QListViewItem( opsSkymap, "FOV Color", i18n( "Select color for the FOV symbol" ), i18n( "string" ) ); - new QListViewItem( opsSkymap, "AnimateSlewing", i18n( "Use animated slewing? (otherwise, \"snap\" to new focus)" ), i18n( "bool" ) ); - new QListViewItem( opsSkymap, "UseRefraction", i18n( "Correct for atmospheric refraction?" ), i18n( "bool" ) ); - new QListViewItem( opsSkymap, "UseAutoLabel", i18n( "Automatically attach name label to centered object?" ), i18n( "bool" ) ); - new QListViewItem( opsSkymap, "UseHoverLabel", i18n( "Attach temporary name label when hovering mouse over an object?" ), i18n( "bool" ) ); - new QListViewItem( opsSkymap, "UseAutoTrail", i18n( "Automatically add trail to centered solar system body?" ), i18n( "bool" ) ); - new QListViewItem( opsSkymap, "FadePlanetTrails", i18n( "Planet trails fade to sky color? (otherwise color is constant)" ), i18n( "bool" ) ); + opsSkymap = new TQListViewItem( otv->OptionsList, i18n( "Skymap Options" ) ); + new TQListViewItem( opsSkymap, "UseAltAz", i18n( "Use Horizontal coordinates? (otherwise, use Equatorial)" ), i18n( "bool" ) ); + new TQListViewItem( opsSkymap, "ZoomFactor", i18n( "Set the Zoom Factor" ), i18n( "double" ) ); + new TQListViewItem( opsSkymap, "FOV Size", i18n( "Select angular size for the FOV symbol (in arcmin)" ), i18n( "double" ) ); + new TQListViewItem( opsSkymap, "FOV Shape", i18n( "Select shape for the FOV symbol (0=Square, 1=Circle, 2=Crosshairs, 4=Bullseye)" ), i18n( "int" ) ); + new TQListViewItem( opsSkymap, "FOV Color", i18n( "Select color for the FOV symbol" ), i18n( "string" ) ); + new TQListViewItem( opsSkymap, "AnimateSlewing", i18n( "Use animated slewing? (otherwise, \"snap\" to new focus)" ), i18n( "bool" ) ); + new TQListViewItem( opsSkymap, "UseRefraction", i18n( "Correct for atmospheric refraction?" ), i18n( "bool" ) ); + new TQListViewItem( opsSkymap, "UseAutoLabel", i18n( "Automatically attach name label to centered object?" ), i18n( "bool" ) ); + new TQListViewItem( opsSkymap, "UseHoverLabel", i18n( "Attach temporary name label when hovering mouse over an object?" ), i18n( "bool" ) ); + new TQListViewItem( opsSkymap, "UseAutoTrail", i18n( "Automatically add trail to centered solar system body?" ), i18n( "bool" ) ); + new TQListViewItem( opsSkymap, "FadePlanetTrails", i18n( "Planet trails fade to sky color? (otherwise color is constant)" ), i18n( "bool" ) ); argChangeViewOption->OptionName->insertItem( "UseAltAz" ); argChangeViewOption->OptionName->insertItem( "ZoomFactor" ); argChangeViewOption->OptionName->insertItem( "FOVName" ); @@ -670,16 +670,16 @@ void ScriptBuilder::initViewOptions() { argChangeViewOption->OptionName->insertItem( "AnimateSlewing" ); argChangeViewOption->OptionName->insertItem( "FadePlanetTrails" ); - opsLimit = new QListViewItem( otv->OptionsList, i18n( "Limits" ) ); - new QListViewItem( opsLimit, "magLimitDrawStar", i18n( "magnitude of faintest star drawn on map when zoomed in" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "magLimitDrawStarZoomOut", i18n( "magnitude of faintest star drawn on map when zoomed out" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "magLimitDrawDeepSky", i18n( "magnitude of faintest nonstellar object drawn on map when zoomed in" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "magLimitDrawDeepSkyZoomOut", i18n( "magnitude of faintest nonstellar object drawn on map when zoomed out" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "magLimitDrawStarInfo", i18n( "magnitude of faintest star labeled on map" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "magLimitHideStar", i18n( "magnitude of brightest star hidden while slewing" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "magLimitAsteroid", i18n( "magnitude of faintest asteroid drawn on map" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "magLimitAsteroidName", i18n( "magnitude of faintest asteroid labeled on map" ), i18n( "double" ) ); - new QListViewItem( opsLimit, "maxRadCometName", i18n( "comets nearer to the Sun than this (in AU) are labeled on map" ), i18n( "double" ) ); + opsLimit = new TQListViewItem( otv->OptionsList, i18n( "Limits" ) ); + new TQListViewItem( opsLimit, "magLimitDrawStar", i18n( "magnitude of faintest star drawn on map when zoomed in" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "magLimitDrawStarZoomOut", i18n( "magnitude of faintest star drawn on map when zoomed out" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "magLimitDrawDeepSky", i18n( "magnitude of faintest nonstellar object drawn on map when zoomed in" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "magLimitDrawDeepSkyZoomOut", i18n( "magnitude of faintest nonstellar object drawn on map when zoomed out" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "magLimitDrawStarInfo", i18n( "magnitude of faintest star labeled on map" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "magLimitHideStar", i18n( "magnitude of brightest star hidden while slewing" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "magLimitAsteroid", i18n( "magnitude of faintest asteroid drawn on map" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "magLimitAsteroidName", i18n( "magnitude of faintest asteroid labeled on map" ), i18n( "double" ) ); + new TQListViewItem( opsLimit, "maxRadCometName", i18n( "comets nearer to the Sun than this (in AU) are labeled on map" ), i18n( "double" ) ); argChangeViewOption->OptionName->insertItem( "magLimitDrawStar" ); argChangeViewOption->OptionName->insertItem( "magLimitDrawStarZoomOut" ); argChangeViewOption->OptionName->insertItem( "magLimitDrawDeepSky" ); @@ -701,11 +701,11 @@ void ScriptBuilder::initViewOptions() { argLoadColorScheme->SchemeList->insertItem( i18n( "use 'night vision' color scheme", "Night Vision" ) ); argLoadColorScheme->SchemeList->insertItem( i18n( "use 'moonless night' color scheme", "Moonless Night" ) ); - QFile file; - QString line; + TQFile file; + TQString line; file.setName( locate( "appdata", "colors.dat" ) ); //determine filename in local user KDE directory tree. if ( file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); while ( !stream.eof() ) { line = stream.readLine(); @@ -735,7 +735,7 @@ void ScriptBuilder::slotNew() { void ScriptBuilder::slotOpen() { saveWarning(); - QString fname; + TQString fname; KTempFile tmpfile; tmpfile.setAutoDelete(true); @@ -753,24 +753,24 @@ void ScriptBuilder::slotOpen() { fname = currentFileURL.path(); } else { fname = tmpfile.name(); - if ( ! KIO::NetAccess::download( currentFileURL, fname, (QWidget*) 0 ) ) + if ( ! KIO::NetAccess::download( currentFileURL, fname, (TQWidget*) 0 ) ) KMessageBox::sorry( 0, i18n( "Could not download remote file." ), i18n( "Download Error" ) ); } - QFile f( fname ); + TQFile f( fname ); if ( !f.open( IO_ReadOnly) ) { - QString message = i18n( "Could not open file %1." ).arg( f.name() ); + TQString message = i18n( "Could not open file %1." ).arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); currentFileURL = ""; return; } - QTextStream istream(&f); + TQTextStream istream(&f); readScript( istream ); f.close(); } else if ( ! currentFileURL.url().isEmpty() ) { - QString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); + TQString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); KMessageBox::sorry( 0, message, i18n( "Invalid URL" ) ); currentFileURL = ""; } @@ -778,13 +778,13 @@ void ScriptBuilder::slotOpen() { } void ScriptBuilder::slotSave() { - QString fname; + TQString fname; KTempFile tmpfile; tmpfile.setAutoDelete(true); if ( currentScriptName.isEmpty() ) { //Get Script Name and Author info - if ( snd->exec() == QDialog::Accepted ) { + if ( snd->exec() == TQDialog::Accepted ) { currentScriptName = snd->ScriptName->text(); currentAuthor = snd->AuthorName->text(); } else { @@ -802,8 +802,8 @@ void ScriptBuilder::slotSave() { fname = currentFileURL.path(); //Warn user if file exists - if (QFile::exists(currentFileURL.path())) { - int r=KMessageBox::warningContinueCancel(static_cast(parent()), + if (TQFile::exists(currentFileURL.path())) { + int r=KMessageBox::warningContinueCancel(static_cast(parent()), i18n( "A file named \"%1\" already exists. " "Overwrite it?" ).arg(currentFileURL.fileName()), i18n( "Overwrite File?" ), @@ -817,15 +817,15 @@ void ScriptBuilder::slotSave() { if ( fname.right( 7 ).lower() != ".kstars" ) fname += ".kstars"; - QFile f( fname ); + TQFile f( fname ); if ( !f.open( IO_WriteOnly) ) { - QString message = i18n( "Could not open file %1." ).arg( f.name() ); + TQString message = i18n( "Could not open file %1." ).arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); currentFileURL = ""; return; } - QTextStream ostream(&f); + TQTextStream ostream(&f); writeScript( ostream ); f.close(); @@ -833,8 +833,8 @@ void ScriptBuilder::slotSave() { chmod( fname.ascii(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH ); if ( tmpfile.name() == fname ) { //need to upload to remote location - if ( ! KIO::NetAccess::upload( tmpfile.name(), currentFileURL, (QWidget*) 0 ) ) { - QString message = i18n( "Could not upload image to remote location: %1" ).arg( currentFileURL.prettyURL() ); + if ( ! KIO::NetAccess::upload( tmpfile.name(), currentFileURL, (TQWidget*) 0 ) ) { + TQString message = i18n( "Could not upload image to remote location: %1" ).arg( currentFileURL.prettyURL() ); KMessageBox::sorry( 0, message, i18n( "Could not upload file" ) ); } } @@ -842,7 +842,7 @@ void ScriptBuilder::slotSave() { setUnsavedChanges( false ); } else { - QString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); + TQString message = i18n( "Invalid URL: %1" ).arg( currentFileURL.url() ); KMessageBox::sorry( 0, message, i18n( "Invalid URL" ) ); currentFileURL = ""; } @@ -856,8 +856,8 @@ void ScriptBuilder::slotSaveAs() { void ScriptBuilder::saveWarning() { if ( UnsavedChanges ) { - QString caption = i18n( "Save Changes to Script?" ); - QString message = i18n( "The current script has unsaved changes. Would you like to save before closing it?" ); + TQString caption = i18n( "Save Changes to Script?" ); + TQString message = i18n( "The current script has unsaved changes. Would you like to save before closing it?" ); int ans = KMessageBox::warningYesNoCancel( 0, message, caption, KStdGuiItem::save(), KStdGuiItem::discard() ); if ( ans == KMessageBox::Yes ) { slotSave(); @@ -879,19 +879,19 @@ void ScriptBuilder::slotRunScript() { //For some reason, I can't use KTempFile here! If I do, then the temporary script //is not executable. Bizarre... //KTempFile tmpfile; - //QString fname = tmpfile.name(); - QString fname = locateLocal( "tmp", "kstars-tempscript" ); + //TQString fname = tmpfile.name(); + TQString fname = locateLocal( "tmp", "kstars-tempscript" ); - QFile f( fname ); + TQFile f( fname ); if ( f.exists() ) f.remove(); if ( !f.open( IO_WriteOnly) ) { - QString message = i18n( "Could not open file %1." ).arg( f.name() ); + TQString message = i18n( "Could not open file %1." ).arg( f.name() ); KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) ); currentFileURL = ""; return; } - QTextStream ostream(&f); + TQTextStream ostream(&f); writeScript( ostream ); f.close(); @@ -912,9 +912,9 @@ void ScriptBuilder::slotRunScript() { // show(); } -void ScriptBuilder::writeScript( QTextStream &ostream ) { - QString mainpre = "dcop $KSTARS $MAIN "; - QString clockpre = "dcop $KSTARS $CLOCK "; +void ScriptBuilder::writeScript( TQTextStream &ostream ) { + TQString mainpre = "dcop $KSTARS $MAIN "; + TQString clockpre = "dcop $KSTARS $CLOCK "; //Write script header ostream << "#!/bin/bash" << endl; @@ -958,8 +958,8 @@ void ScriptBuilder::writeScript( QTextStream &ostream ) { ostream << "##" << endl; } -void ScriptBuilder::readScript( QTextStream &istream ) { - QString line; +void ScriptBuilder::readScript( TQTextStream &istream ) { + TQString line; while ( ! istream.eof() ) { line = istream.readLine(); @@ -983,7 +983,7 @@ void ScriptBuilder::readScript( QTextStream &istream ) { line = line.mid( 20 ); //construct a stringlist that is fcn name and its arg name/value pairs - QStringList fn = QStringList::split( " ", line ); + TQStringList fn = TQStringList::split( " ", line ); if ( parseFunction( fn ) ) { sb->ScriptListBox->insertItem( ScriptList.current()->name() ); @@ -1002,14 +1002,14 @@ void ScriptBuilder::readScript( QTextStream &istream ) { } } -bool ScriptBuilder::parseFunction( QStringList &fn ) +bool ScriptBuilder::parseFunction( TQStringList &fn ) { // clean up the string list first if needed // We need to perform this in case we havea quoted string "NGC 3000" because this will counted // as two arguments, and it should be counted as one. bool foundQuote(false), quoteProcessed(false); - QString cur, arg; - QStringList::iterator it; + TQString cur, arg; + TQStringList::iterator it; for (it = fn.begin(); it != fn.end(); ++it) { @@ -1041,7 +1041,7 @@ bool ScriptBuilder::parseFunction( QStringList &fn ) } if (quoteProcessed) - fn = QStringList::split( "'", arg ); + fn = TQStringList::split( "'", arg ); //loop over known functions to find a name match for ( ScriptFunction *sf = KStarsFunctionList.first(); sf; sf = KStarsFunctionList.next() ) @@ -1049,7 +1049,7 @@ bool ScriptBuilder::parseFunction( QStringList &fn ) if ( fn[0] == sf->name() ) { if ( fn[0] == "setGeoLocation" ) { - QString city( fn[1] ), prov( "" ), cntry( fn[2] ); + TQString city( fn[1] ), prov( "" ), cntry( fn[2] ); if ( fn.count() == 4 ) { prov = fn[2]; cntry = fn[3]; } if ( fn.count() == 3 || fn.count() == 4 ) { ScriptList.append( new ScriptFunction( sf ) ); @@ -1130,7 +1130,7 @@ void ScriptBuilder::slotRemoveFunction() { void ScriptBuilder::slotAddFunction() { ScriptFunction *sc = NULL; - QListViewItem *currentItem = sb->FunctionListView->currentItem(); + TQListViewItem *currentItem = sb->FunctionListView->currentItem(); if ( currentItem == NULL || currentItem->depth() == 0) return; @@ -1162,7 +1162,7 @@ void ScriptBuilder::slotMoveFunctionUp() { if ( sb->ScriptListBox->currentItem() > 0 ) { setUnsavedChanges( true ); - QString t = sb->ScriptListBox->currentText(); + TQString t = sb->ScriptListBox->currentText(); unsigned int n = sb->ScriptListBox->currentItem(); ScriptFunction *tmp = ScriptList.take( n ); @@ -1179,7 +1179,7 @@ void ScriptBuilder::slotMoveFunctionDown() { sb->ScriptListBox->currentItem() < ((int) sb->ScriptListBox->count())-1 ) { setUnsavedChanges( true ); - QString t = sb->ScriptListBox->currentText(); + TQString t = sb->ScriptListBox->currentText(); unsigned int n = sb->ScriptListBox->currentItem(); ScriptFunction *tmp = ScriptList.take( n ); @@ -1231,13 +1231,13 @@ void ScriptBuilder::slotArgWidget() { //Display the function's arguments widget if ( sb->ScriptListBox->currentItem() > -1 && sb->ScriptListBox->currentItem() < ((int) sb->ScriptListBox->count()) ) { - QString t = sb->ScriptListBox->currentText(); + TQString t = sb->ScriptListBox->currentText(); unsigned int n = sb->ScriptListBox->currentItem(); ScriptFunction *sf = ScriptList.at( n ); if ( sf->name() == "lookTowards" ) { sb->ArgStack->raiseWidget( argLookToward ); - QString s = sf->argVal(0); + TQString s = sf->argVal(0); argLookToward->FocusEdit->setCurrentText( s ); } else if ( sf->name() == "setRaDec" ) { @@ -1328,8 +1328,8 @@ void ScriptBuilder::slotArgWidget() { if ( sf->argVal(3).isEmpty() ) ok = false; if (ok) min = sf->argVal(4).toInt(&ok); if (ok) sec = sf->argVal(5).toInt(&ok); - if (ok) argSetLocalTime->TimeBox->setTime( QTime( hour, min, sec ) ); - else argSetLocalTime->TimeBox->setTime( QTime( QTime::currentTime() ) ); + if (ok) argSetLocalTime->TimeBox->setTime( TQTime( hour, min, sec ) ); + else argSetLocalTime->TimeBox->setTime( TQTime( TQTime::currentTime() ) ); } else if ( sf->name() == "waitFor" ) { sb->ArgStack->raiseWidget( argWaitFor ); @@ -1365,7 +1365,7 @@ void ScriptBuilder::slotArgWidget() { sb->ArgStack->raiseWidget( argSetColor ); if ( sf->argVal(0).isEmpty() ) sf->setArg( 0, "SkyColor" ); //initialize default value argSetColor->ColorName->setCurrentItem( ks->data()->colorScheme()->nameFromKey( sf->argVal(0) ) ); - argSetColor->ColorValue->setColor( QColor( sf->argVal(1).remove('\\') ) ); + argSetColor->ColorValue->setColor( TQColor( sf->argVal(1).remove('\\') ) ); } else if ( sf->name() == "loadColorScheme" ) { sb->ArgStack->raiseWidget( argLoadColorScheme ); @@ -1774,7 +1774,7 @@ void ScriptBuilder::slotArgWidget() { void ScriptBuilder::slotShowDoc() { ScriptFunction *sc = NULL; - QListViewItem *currentItem = sb->FunctionListView->currentItem(); + TQListViewItem *currentItem = sb->FunctionListView->currentItem(); if ( currentItem == NULL || currentItem->depth() == 0) return; @@ -1805,7 +1805,7 @@ void ScriptBuilder::slotShowDoc() { void ScriptBuilder::slotFindCity() { LocationDialog ld( ks ); - if ( ld.exec() == QDialog::Accepted ) { + if ( ld.exec() == TQDialog::Accepted ) { if ( ld.selectedCity() ) { // set new location names argSetGeoLocation->CityName->setText( ld.selectedCityName() ); @@ -1829,7 +1829,7 @@ void ScriptBuilder::slotFindCity() { void ScriptBuilder::slotFindObject() { FindDialog fd( ks ); - if ( fd.exec() == QDialog::Accepted && fd.currentItem() ) { + if ( fd.exec() == TQDialog::Accepted && fd.currentItem() ) { setUnsavedChanges( true ); argLookToward->FocusEdit->setCurrentText( fd.currentItem()->objName()->text() ); @@ -1839,7 +1839,7 @@ void ScriptBuilder::slotFindObject() { void ScriptBuilder::slotINDIFindObject() { FindDialog fd( ks ); - if ( fd.exec() == QDialog::Accepted && fd.currentItem() ) { + if ( fd.exec() == TQDialog::Accepted && fd.currentItem() ) { setUnsavedChanges( true ); argSetTargetNameINDI->objectName->setText( fd.currentItem()->objName()->text() ); @@ -1855,7 +1855,7 @@ void ScriptBuilder::slotINDIWaitCheck(bool /*toggleState*/) void ScriptBuilder::slotShowOptions() { //Show tree-view of view options - if ( otv->exec() == QDialog::Accepted ) { + if ( otv->exec() == TQDialog::Accepted ) { argChangeViewOption->OptionName->setCurrentItem( otv->OptionsList->currentItem()->text(0) ); } } @@ -1885,7 +1885,7 @@ void ScriptBuilder::slotRa() { if ( ok ) { setUnsavedChanges( true ); - sf->setArg( 0, QString( "%1" ).arg( ra.Hours() ) ); + sf->setArg( 0, TQString( "%1" ).arg( ra.Hours() ) ); if ( ! sf->argVal(1).isEmpty() ) sf->setValid( true ); } else { @@ -1909,7 +1909,7 @@ void ScriptBuilder::slotDec() { if ( ok ) { setUnsavedChanges( true ); - sf->setArg( 1, QString( "%1" ).arg( dec.Degrees() ) ); + sf->setArg( 1, TQString( "%1" ).arg( dec.Degrees() ) ); if ( ! sf->argVal(0).isEmpty() ) sf->setValid( true ); } else { @@ -1932,7 +1932,7 @@ void ScriptBuilder::slotAz() { dms az = argSetAltAz->AzBox->createDms(true, &ok); if ( ok ) { setUnsavedChanges( true ); - sf->setArg( 1, QString( "%1" ).arg( az.Degrees() ) ); + sf->setArg( 1, TQString( "%1" ).arg( az.Degrees() ) ); if ( ! sf->argVal(0).isEmpty() ) sf->setValid( true ); } else { sf->setArg( 1, "" ); @@ -1955,7 +1955,7 @@ void ScriptBuilder::slotAlt() { if ( ok ) { setUnsavedChanges( true ); - sf->setArg( 0, QString( "%1" ).arg( alt.Degrees() ) ); + sf->setArg( 0, TQString( "%1" ).arg( alt.Degrees() ) ); if ( ! sf->argVal(1).isEmpty() ) sf->setValid( true ); } else { sf->setArg( 0, "" ); @@ -1974,9 +1974,9 @@ void ScriptBuilder::slotChangeDate() { ExtDate date = argSetLocalTime->DateBox->date(); - sf->setArg( 0, QString( "%1" ).arg( date.year() ) ); - sf->setArg( 1, QString( "%1" ).arg( date.month() ) ); - sf->setArg( 2, QString( "%1" ).arg( date.day() ) ); + sf->setArg( 0, TQString( "%1" ).arg( date.year() ) ); + sf->setArg( 1, TQString( "%1" ).arg( date.month() ) ); + sf->setArg( 2, TQString( "%1" ).arg( date.day() ) ); if ( ! sf->argVal(3).isEmpty() ) sf->setValid( true ); } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setLocalTime" ) << endl; @@ -1989,11 +1989,11 @@ void ScriptBuilder::slotChangeTime() { if ( sf->name() == "setLocalTime" ) { setUnsavedChanges( true ); - QTime time = argSetLocalTime->TimeBox->time(); + TQTime time = argSetLocalTime->TimeBox->time(); - sf->setArg( 3, QString( "%1" ).arg( time.hour() ) ); - sf->setArg( 4, QString( "%1" ).arg( time.minute() ) ); - sf->setArg( 5, QString( "%1" ).arg( time.second() ) ); + sf->setArg( 3, TQString( "%1" ).arg( time.hour() ) ); + sf->setArg( 4, TQString( "%1" ).arg( time.minute() ) ); + sf->setArg( 5, TQString( "%1" ).arg( time.second() ) ); if ( ! sf->argVal(0).isEmpty() ) sf->setValid( true ); } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setLocalTime" ) << endl; @@ -2010,7 +2010,7 @@ void ScriptBuilder::slotWaitFor() { if ( ok ) { setUnsavedChanges( true ); - sf->setArg( 0, QString( "%1" ).arg( delay ) ); + sf->setArg( 0, TQString( "%1" ).arg( delay ) ); sf->setValid( true ); } else { sf->setValid( false ); @@ -2024,7 +2024,7 @@ void ScriptBuilder::slotWaitForKey() { ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "waitForKey" ) { - QString sKey = argWaitForKey->WaitKeyEdit->text().stripWhiteSpace(); + TQString sKey = argWaitForKey->WaitKeyEdit->text().stripWhiteSpace(); //DCOP script can only use single keystrokes; make sure entry is either one character, //or the word 'space' @@ -2077,7 +2077,7 @@ void ScriptBuilder::slotChangeCity() { ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setGeoLocation" ) { - QString city = argSetGeoLocation->CityName->text(); + TQString city = argSetGeoLocation->CityName->text(); if ( city.length() ) { setUnsavedChanges( true ); @@ -2097,7 +2097,7 @@ void ScriptBuilder::slotChangeProvince() { ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setGeoLocation" ) { - QString province = argSetGeoLocation->ProvinceName->text(); + TQString province = argSetGeoLocation->ProvinceName->text(); if ( province.length() ) { setUnsavedChanges( true ); @@ -2117,7 +2117,7 @@ void ScriptBuilder::slotChangeCountry() { ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "setGeoLocation" ) { - QString country = argSetGeoLocation->CountryName->text(); + TQString country = argSetGeoLocation->CountryName->text(); if ( country.length() ) { setUnsavedChanges( true ); @@ -2139,7 +2139,7 @@ void ScriptBuilder::slotTimeScale() { if ( sf->name() == "setClockScale" ) { setUnsavedChanges( true ); - sf->setArg( 0, QString( "%1" ).arg( argTimeScale->TimeScale->tsbox()->timeScale() ) ); + sf->setArg( 0, TQString( "%1" ).arg( argTimeScale->TimeScale->tsbox()->timeScale() ) ); sf->setValid( true ); } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "setClockScale" ) << endl; @@ -2170,8 +2170,8 @@ void ScriptBuilder::slotExportImage() { setUnsavedChanges( true ); sf->setArg( 0, argExportImage->ExportFileName->url() ); - sf->setArg( 1, QString("%1").arg( argExportImage->ExportWidth->value() ) ); - sf->setArg( 2, QString("%1").arg( argExportImage->ExportHeight->value() ) ); + sf->setArg( 1, TQString("%1").arg( argExportImage->ExportWidth->value() ) ); + sf->setArg( 2, TQString("%1").arg( argExportImage->ExportHeight->value() ) ); sf->setValid( true ); } else { kdWarning() << i18n( "Mismatch between function and Arg widget (expected %1.)" ).arg( "exportImage" ) << endl; @@ -2200,7 +2200,7 @@ void ScriptBuilder::slotChangeColorName() { argSetColor->ColorValue->setColor( ks->data()->colorScheme()->colorAt( argSetColor->ColorName->currentItem() ) ); sf->setArg( 0, ks->data()->colorScheme()->keyAt( argSetColor->ColorName->currentItem() ) ); - QString cname( argSetColor->ColorValue->color().name() ); + TQString cname( argSetColor->ColorValue->color().name() ); if ( cname.at(0) == '#' ) cname = "\\" + cname; //prepend a "\" so bash doesn't think we have a comment sf->setArg( 1, cname ); sf->setValid( true ); @@ -2216,7 +2216,7 @@ void ScriptBuilder::slotChangeColor() { setUnsavedChanges( true ); sf->setArg( 0, ks->data()->colorScheme()->keyAt( argSetColor->ColorName->currentItem() ) ); - QString cname( argSetColor->ColorValue->color().name() ); + TQString cname( argSetColor->ColorValue->color().name() ); if ( cname.at(0) == '#' ) cname = "\\" + cname; //prepend a "\" so bash doesn't think we have a comment sf->setArg( 1, cname ); sf->setValid( true ); @@ -2225,7 +2225,7 @@ void ScriptBuilder::slotChangeColor() { } } -void ScriptBuilder::slotLoadColorScheme(QListBoxItem */*i*/) { +void ScriptBuilder::slotLoadColorScheme(TQListBoxItem */*i*/) { ScriptFunction *sf = ScriptList.at( sb->ScriptListBox->currentItem() ); if ( sf->name() == "loadColorScheme" ) { @@ -2459,10 +2459,10 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceRA() dms ra = argSetTargetCoordINDI->RaBox->createDms(false, &ok); if ( ok ) { - if (sf->argVal(1) != QString( "%1" ).arg( ra.Hours() )) + if (sf->argVal(1) != TQString( "%1" ).arg( ra.Hours() )) setUnsavedChanges( true ); - sf->setArg( 1, QString( "%1" ).arg( ra.Hours() ) ); + sf->setArg( 1, TQString( "%1" ).arg( ra.Hours() ) ); if ( ( ! sf->argVal(0).isEmpty() ) && ( ! sf->argVal(2).isEmpty() )) sf->setValid( true ); else sf->setValid(false); @@ -2492,10 +2492,10 @@ void ScriptBuilder::slotINDISetTargetCoordDeviceDEC() dms dec = argSetTargetCoordINDI->DecBox->createDms(true, &ok); if ( ok ) { - if (sf->argVal(2) != QString( "%1" ).arg( dec.Degrees() )) + if (sf->argVal(2) != TQString( "%1" ).arg( dec.Degrees() )) setUnsavedChanges( true ); - sf->setArg( 2, QString( "%1" ).arg( dec.Degrees() ) ); + sf->setArg( 2, TQString( "%1" ).arg( dec.Degrees() ) ); if ( ( ! sf->argVal(0).isEmpty() ) && ( ! sf->argVal(1).isEmpty() )) sf->setValid( true ); else sf->setValid(false); @@ -2685,7 +2685,7 @@ void ScriptBuilder::slotINDISetFocusSpeedDeviceName() setUnsavedChanges( true ); sf->setArg(0, argSetFocusSpeedINDI->deviceName->text()); - sf->setArg(1, QString("%1").arg(argSetFocusSpeedINDI->speedIN->value())); + sf->setArg(1, TQString("%1").arg(argSetFocusSpeedINDI->speedIN->value())); sf->setValid(true); } else @@ -2705,7 +2705,7 @@ void ScriptBuilder::slotINDISetFocusSpeed() if (sf->argVal(1).toInt() != argSetFocusSpeedINDI->speedIN->value()) setUnsavedChanges( true ); - sf->setArg(1, QString("%1").arg(argSetFocusSpeedINDI->speedIN->value())); + sf->setArg(1, TQString("%1").arg(argSetFocusSpeedINDI->speedIN->value())); if ((! sf->argVal(0).isEmpty())) sf->setValid(true); else sf->setValid(false); } @@ -2779,7 +2779,7 @@ void ScriptBuilder::slotINDISetFocusTimeoutDeviceName() setUnsavedChanges( true ); sf->setArg(0, argSetFocusTimeoutINDI->deviceName->text()); - sf->setArg(1, QString("%1").arg(argSetFocusTimeoutINDI->timeOut->value())); + sf->setArg(1, TQString("%1").arg(argSetFocusTimeoutINDI->timeOut->value())); sf->setValid(true); } else @@ -2798,7 +2798,7 @@ void ScriptBuilder::slotINDISetFocusTimeout() if (sf->argVal(1).toInt() != argSetFocusTimeoutINDI->timeOut->value()) setUnsavedChanges( true ); - sf->setArg(1, QString("%1").arg(argSetFocusTimeoutINDI->timeOut->value())); + sf->setArg(1, TQString("%1").arg(argSetFocusTimeoutINDI->timeOut->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); } @@ -2851,10 +2851,10 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceLong() dms longitude = argSetGeoLocationINDI->longBox->createDms(true, &ok); if ( ok ) { - if (sf->argVal(1) != QString( "%1" ).arg( longitude.Degrees())) + if (sf->argVal(1) != TQString( "%1" ).arg( longitude.Degrees())) setUnsavedChanges( true ); - sf->setArg( 1, QString( "%1" ).arg( longitude.Degrees() ) ); + sf->setArg( 1, TQString( "%1" ).arg( longitude.Degrees() ) ); if ( ( ! sf->argVal(0).isEmpty() ) && ( ! sf->argVal(2).isEmpty() )) sf->setValid( true ); else sf->setValid(false); @@ -2884,10 +2884,10 @@ void ScriptBuilder::slotINDISetGeoLocationDeviceLat() dms latitude = argSetGeoLocationINDI->latBox->createDms(true, &ok); if ( ok ) { - if (sf->argVal(2) != QString( "%1" ).arg( latitude.Degrees())) + if (sf->argVal(2) != TQString( "%1" ).arg( latitude.Degrees())) setUnsavedChanges( true ); - sf->setArg( 2, QString( "%1" ).arg( latitude.Degrees() ) ); + sf->setArg( 2, TQString( "%1" ).arg( latitude.Degrees() ) ); if ( ( ! sf->argVal(0).isEmpty() ) && ( ! sf->argVal(1).isEmpty() )) sf->setValid( true ); else sf->setValid(false); @@ -2917,7 +2917,7 @@ void ScriptBuilder::slotINDIStartExposureDeviceName() setUnsavedChanges( true ); sf->setArg(0, argStartExposureINDI->deviceName->text()); - sf->setArg(1, QString("%1").arg(argStartExposureINDI->timeOut->value())); + sf->setArg(1, TQString("%1").arg(argStartExposureINDI->timeOut->value())); sf->setValid(true); } else @@ -2937,7 +2937,7 @@ void ScriptBuilder::slotINDIStartExposureTimeout() if (sf->argVal(1).toInt() != argStartExposureINDI->timeOut->value()) setUnsavedChanges( true ); - sf->setArg(1, QString("%1").arg(argStartExposureINDI->timeOut->value())); + sf->setArg(1, TQString("%1").arg(argStartExposureINDI->timeOut->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); } @@ -3117,7 +3117,7 @@ void ScriptBuilder::slotINDISetCCDTempDeviceName() setUnsavedChanges( true ); sf->setArg(0, argSetCCDTempINDI->deviceName->text()); - sf->setArg(1, QString("%1").arg(argSetCCDTempINDI->temp->value())); + sf->setArg(1, TQString("%1").arg(argSetCCDTempINDI->temp->value())); sf->setValid(true); } else @@ -3137,7 +3137,7 @@ void ScriptBuilder::slotINDISetCCDTemp() if (sf->argVal(1).toInt() != argSetCCDTempINDI->temp->value()) setUnsavedChanges( true ); - sf->setArg(1, QString("%1").arg(argSetCCDTempINDI->temp->value())); + sf->setArg(1, TQString("%1").arg(argSetCCDTempINDI->temp->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); } @@ -3165,7 +3165,7 @@ void ScriptBuilder::slotINDISetFilterNumDeviceName() setUnsavedChanges( true ); sf->setArg(0, argSetFilterNumINDI->deviceName->text()); - sf->setArg(1, QString("%1").arg(argSetFilterNumINDI->filter_num->value())); + sf->setArg(1, TQString("%1").arg(argSetFilterNumINDI->filter_num->value())); sf->setValid(true); } else @@ -3185,7 +3185,7 @@ void ScriptBuilder::slotINDISetFilterNum() if (sf->argVal(1).toInt() != argSetFilterNumINDI->filter_num->value()) setUnsavedChanges( true ); - sf->setArg(1, QString("%1").arg(argSetFilterNumINDI->filter_num->value())); + sf->setArg(1, TQString("%1").arg(argSetFilterNumINDI->filter_num->value())); if (! sf->argVal(0).isEmpty()) sf->setValid(true); else sf->setValid(false); } diff --git a/kstars/kstars/tools/scriptbuilder.h b/kstars/kstars/tools/scriptbuilder.h index 7b78bc1c..521bdbdb 100644 --- a/kstars/kstars/tools/scriptbuilder.h +++ b/kstars/kstars/tools/scriptbuilder.h @@ -69,15 +69,15 @@ class ScriptBuilder : public KDialogBase { Q_OBJECT public: - ScriptBuilder( QWidget *parent, const char *name=0 ); + ScriptBuilder( TQWidget *parent, const char *name=0 ); ~ScriptBuilder(); bool unsavedChanges() const { return UnsavedChanges; } void setUnsavedChanges( bool b=true ); void saveWarning(); - void readScript( QTextStream &istream ); - void writeScript( QTextStream &ostream ); - bool parseFunction( QStringList &fn ); + void readScript( TQTextStream &istream ); + void writeScript( TQTextStream &ostream ); + bool parseFunction( TQStringList &fn ); public slots: void slotAddFunction(); @@ -119,7 +119,7 @@ public slots: void slotPrintImage(); void slotChangeColor(); void slotChangeColorName(); - void slotLoadColorScheme(QListBoxItem*); + void slotLoadColorScheme(TQListBoxItem*); void slotEnableScriptNameOK(); @@ -169,12 +169,12 @@ private: ScriptBuilderUI *sb; KStars *ks; //parent needed for sub-dialogs - QPtrList KStarsFunctionList; - QPtrList INDIFunctionList; - QPtrList ScriptList; - QVBoxLayout *vlay; + TQPtrList KStarsFunctionList; + TQPtrList INDIFunctionList; + TQPtrList ScriptList; + TQVBoxLayout *vlay; - QWidget *argBlank; + TQWidget *argBlank; ArgLookToward *argLookToward; ArgSetRaDec *argSetRaDec; ArgSetAltAz *argSetAltAz; @@ -212,13 +212,13 @@ private: ScriptNameDialog *snd; OptionsTreeView *otv; - QListViewItem *opsGUI, *opsToolbar, *opsShowObj, *opsShowOther, *opsCName, *opsHide, *opsSkymap, *opsLimit; + TQListViewItem *opsGUI, *opsToolbar, *opsShowObj, *opsShowOther, *opsCName, *opsHide, *opsSkymap, *opsLimit; bool UnsavedChanges; KURL currentFileURL; - QString currentDir; - QString currentScriptName, currentAuthor; - QString lastINDIDeviceName; + TQString currentDir; + TQString currentScriptName, currentAuthor; + TQString lastINDIDeviceName; }; #endif diff --git a/kstars/kstars/tools/scriptfunction.cpp b/kstars/kstars/tools/scriptfunction.cpp index d87942ee..c95594f5 100644 --- a/kstars/kstars/tools/scriptfunction.cpp +++ b/kstars/kstars/tools/scriptfunction.cpp @@ -20,9 +20,9 @@ #include "scriptfunction.h" -ScriptFunction::ScriptFunction( QString name, QString desc, bool clockfcn, - QString at1, QString an1, QString at2, QString an2, QString at3, QString an3, - QString at4, QString an4, QString at5, QString an5, QString at6, QString an6 ) : INDIProp("") { +ScriptFunction::ScriptFunction( TQString name, TQString desc, bool clockfcn, + TQString at1, TQString an1, TQString at2, TQString an2, TQString at3, TQString an3, + TQString at4, TQString an4, TQString at5, TQString an5, TQString at6, TQString an6 ) : INDIProp("") { Name = name; ClockFunction = clockfcn; @@ -34,9 +34,9 @@ ScriptFunction::ScriptFunction( QString name, QString desc, bool clockfcn, ArgType[5] = at6; ArgName[5] = an6; //Construct a richtext description of the function - QString nameStyle = "%1"; //bold - QString typeStyle = "%1"; //green - QString paramStyle = "%1"; //blue + TQString nameStyle = "%1"; //bold + TQString typeStyle = "%1"; //green + TQString paramStyle = "%1"; //blue Description = ""; Description += ""; @@ -160,8 +160,8 @@ ScriptFunction::~ScriptFunction() { } -QString ScriptFunction::prototype() const { - QString p = Name + "("; +TQString ScriptFunction::prototype() const { + TQString p = Name + "("; bool args( false ); if ( ! ArgType[0].isEmpty() && ! ArgName[0].isEmpty() ) { @@ -201,8 +201,8 @@ QString ScriptFunction::prototype() const { return p; } -QString ScriptFunction::scriptLine() const { - QString out( Name ); +TQString ScriptFunction::scriptLine() const { + TQString out( Name ); unsigned int i=0; while ( ! ArgName[i].isEmpty() && i < 6 ) { // Wrap arg in quotes if it contains a space diff --git a/kstars/kstars/tools/scriptfunction.h b/kstars/kstars/tools/scriptfunction.h index abb63707..b25612c8 100644 --- a/kstars/kstars/tools/scriptfunction.h +++ b/kstars/kstars/tools/scriptfunction.h @@ -18,7 +18,7 @@ #ifndef SCRIPTFUNCTION_H #define SCRIPTFUNCTION_H -#include +#include /** * @@ -27,23 +27,23 @@ class ScriptFunction { public: - ScriptFunction( QString name, QString desc, bool clockfcn=false, - QString at1="", QString an1="", - QString at2="", QString an2="", - QString at3="", QString an3="", - QString at4="", QString an4="", - QString at5="", QString an5="", - QString at6="", QString an6="" + ScriptFunction( TQString name, TQString desc, bool clockfcn=false, + TQString at1="", TQString an1="", + TQString at2="", TQString an2="", + TQString at3="", TQString an3="", + TQString at4="", TQString an4="", + TQString at5="", TQString an5="", + TQString at6="", TQString an6="" ); ScriptFunction( ScriptFunction *sf ); ~ScriptFunction(); - QString name() const { return Name; } - QString prototype() const; - QString description() const { return Description; } - QString argType( unsigned int n ) const { return ArgType[n]; } - QString argName( unsigned int n ) const { return ArgName[n]; } - QString argVal( unsigned int n ) const { return ArgVal[n]; } + TQString name() const { return Name; } + TQString prototype() const; + TQString description() const { return Description; } + TQString argType( unsigned int n ) const { return ArgType[n]; } + TQString argName( unsigned int n ) const { return ArgName[n]; } + TQString argVal( unsigned int n ) const { return ArgVal[n]; } void setValid( bool b ) { Valid = b; } bool valid() const { return Valid; } @@ -51,21 +51,21 @@ public: void setClockFunction( bool b=true ) { ClockFunction = b; } bool isClockFunction() const { return ClockFunction; } - void setArg( unsigned int n, QString newVal ) { ArgVal[n] = newVal; } + void setArg( unsigned int n, TQString newVal ) { ArgVal[n] = newVal; } bool checkArgs(); unsigned int numArgs() const { return NumArgs; } - QString scriptLine() const; + TQString scriptLine() const; - void setINDIProperty(QString prop) { INDIProp = prop; } - QString INDIProperty() const { return INDIProp; } + void setINDIProperty(TQString prop) { INDIProp = prop; } + TQString INDIProperty() const { return INDIProp; } private: - QString Name, Description; - QString ArgType[6]; - QString ArgName[6]; - QString ArgVal[6]; - QString INDIProp; + TQString Name, Description; + TQString ArgType[6]; + TQString ArgName[6]; + TQString ArgVal[6]; + TQString INDIProp; bool Valid, ClockFunction; unsigned int NumArgs; }; diff --git a/kstars/kstars/tools/wutdialog.cpp b/kstars/kstars/tools/wutdialog.cpp index b046a550..584c7dfc 100644 --- a/kstars/kstars/tools/wutdialog.cpp +++ b/kstars/kstars/tools/wutdialog.cpp @@ -36,21 +36,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include WUTDialog::WUTDialog(KStars *ks) : - KDialogBase (KDialogBase::Plain, i18n("What's up Tonight"), Close, Close, (QWidget*)ks), + KDialogBase (KDialogBase::Plain, i18n("What's up Tonight"), Close, Close, (TQWidget*)ks), kstars(ks), EveningFlag(0) { - QFrame *page = plainPage(); + TQFrame *page = plainPage(); setMainWidget(page); - QVBoxLayout *vlay = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *vlay = new TQVBoxLayout( page, 0, spacingHint() ); WUT = new WUTDialogUI( page ); vlay->addWidget( WUT ); @@ -66,7 +66,7 @@ WUTDialog::WUTDialog(KStars *ks) : T0 = T0.addDays( -1 ); //Now, set time T0 to midnight (of the following day) - T0.setTime( QTime( 0, 0, 0 ) ); + T0.setTime( TQTime( 0, 0, 0 ) ); T0 = T0.addDays( 1 ); UT0 = geo->LTtoUT( T0 ); @@ -78,7 +78,7 @@ WUTDialog::WUTDialog(KStars *ks) : Evening = T0.addSecs( -6*3600 ); EveningUT = geo->LTtoUT( Evening ); - QString sGeo = geo->translatedName(); + TQString sGeo = geo->translatedName(); if ( ! geo->translatedProvince().isEmpty() ) sGeo += ", " + geo->translatedProvince(); sGeo += ", " + geo->translatedCountry(); WUT->LocationLabel->setText( i18n( "at %1" ).arg( sGeo ) ); @@ -88,21 +88,21 @@ WUTDialog::WUTDialog(KStars *ks) : makeConnections(); - QTimer::singleShot(0, this, SLOT(init())); + TQTimer::singleShot(0, this, TQT_SLOT(init())); } WUTDialog::~WUTDialog(){ } void WUTDialog::makeConnections() { - connect( WUT->DateButton, SIGNAL( clicked() ), SLOT( slotChangeDate() ) ); - connect( WUT->LocationButton, SIGNAL( clicked() ), SLOT( slotChangeLocation() ) ); - connect( WUT->CenterButton, SIGNAL( clicked() ), SLOT( slotCenter() ) ); - connect( WUT->DetailButton, SIGNAL( clicked() ), SLOT( slotDetails() ) ); - connect( WUT->CategoryListBox, SIGNAL( highlighted(int) ), SLOT( slotLoadList(int) ) ); - connect( WUT->ObjectListBox, SIGNAL( selectionChanged(QListBoxItem*) ), - SLOT( slotDisplayObject(QListBoxItem*) ) ); - connect( WUT->EveningMorningBox, SIGNAL( activated(int) ), SLOT( slotEveningMorning(int) ) ); + connect( WUT->DateButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotChangeDate() ) ); + connect( WUT->LocationButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotChangeLocation() ) ); + connect( WUT->CenterButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotCenter() ) ); + connect( WUT->DetailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotDetails() ) ); + connect( WUT->CategoryListBox, TQT_SIGNAL( highlighted(int) ), TQT_SLOT( slotLoadList(int) ) ); + connect( WUT->ObjectListBox, TQT_SIGNAL( selectionChanged(TQListBoxItem*) ), + TQT_SLOT( slotDisplayObject(TQListBoxItem*) ) ); + connect( WUT->EveningMorningBox, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotEveningMorning(int) ) ); } void WUTDialog::initCategories() { @@ -118,7 +118,7 @@ void WUTDialog::initCategories() { } void WUTDialog::init() { - QString sRise, sSet, sDuration; + TQString sRise, sSet, sDuration; // reset all lists for (int i=0; iSunSetLabel->setText( i18n( "Sunset: %1" ).arg(sSet) ); @@ -192,7 +192,7 @@ void WUTDialog::init() { WUT->MoonRiseLabel->setText( i18n( "Moon rises at: %1" ).arg( sRise ) ); WUT->MoonSetLabel->setText( i18n( "Moon sets at: %1" ).arg( sSet ) ); oMoon->findPhase( oSun ); - WUT->MoonIllumLabel->setText( oMoon->phaseName() + QString( " (%1%)" ).arg( + WUT->MoonIllumLabel->setText( oMoon->phaseName() + TQString( " (%1%)" ).arg( int(100.0*oMoon->illum() ) ) ); //Restore Sun's and Moon's coordinates, and recompute Moon's original Phase @@ -242,8 +242,8 @@ void WUTDialog::appendToList(SkyObjectName *o) { void WUTDialog::slotLoadList(int i) { WUT->ObjectListBox->clear(); - setCursor(QCursor(Qt::WaitCursor)); - QPtrList invisibleList; + setCursor(TQCursor(Qt::WaitCursor)); + TQPtrList invisibleList; for (SkyObjectName *oname=lists.visibleList[i].first(); oname; oname=lists.visibleList[i].next()) { bool visible = true; if (lists.initialized[i] == false) { @@ -265,7 +265,7 @@ void WUTDialog::slotLoadList(int i) { lists.visibleList[i].removeRef(o); } } - setCursor(QCursor(Qt::ArrowCursor)); + setCursor(TQCursor(Qt::ArrowCursor)); lists.initialized[i] = true; // highlight first item @@ -310,9 +310,9 @@ bool WUTDialog::checkVisibility(SkyObjectName *oname) { return visible; } -void WUTDialog::slotDisplayObject(QListBoxItem *item) { - QTime tRise, tSet, tTransit; - QString sRise, sTransit, sSet; +void WUTDialog::slotDisplayObject(TQListBoxItem *item) { + TQTime tRise, tSet, tTransit; + TQString sRise, sTransit, sSet; if ( item==0 ) { //no object selected WUT->ObjectBox->setTitle( i18n( "No Object Selected" ) ); @@ -339,15 +339,15 @@ void WUTDialog::slotDisplayObject(QListBoxItem *item) { // if ( tSet < tRise ) // tSet = o->riseSetTime( JDTomorrow, geo, false ); - sRise = QString().sprintf( "%02d:%02d", tRise.hour(), tRise.minute() ); - sSet = QString().sprintf( "%02d:%02d", tSet.hour(), tSet.minute() ); + sRise = TQString().sprintf( "%02d:%02d", tRise.hour(), tRise.minute() ); + sSet = TQString().sprintf( "%02d:%02d", tSet.hour(), tSet.minute() ); } tTransit = o->transitTime( T0, geo ); // if ( tTransit < tRise ) // tTransit = o->transitTime( JDTomorrow, geo ); - sTransit = QString().sprintf( "%02d:%02d", tTransit.hour(), tTransit.minute() ); + sTransit = TQString().sprintf( "%02d:%02d", tTransit.hour(), tTransit.minute() ); WUT->DetailButton->setEnabled( true ); } @@ -384,14 +384,14 @@ void WUTDialog::slotDetails() { void WUTDialog::slotChangeDate() { TimeDialog td( T0, this ); - if ( td.exec() == QDialog::Accepted ) { + if ( td.exec() == TQDialog::Accepted ) { T0 = td.selectedDateTime(); //If the Time is earlier than 6:00 am, assume the user wants the night of the previous date if ( T0.time().hour() < 6 ) T0 = T0.addDays( -1 ); //Now, set time T0 to midnight (of the following day) - T0.setTime( QTime( 0, 0, 0 ) ); + T0.setTime( TQTime( 0, 0, 0 ) ); T0 = T0.addDays( 1 ); UT0 = geo->LTtoUT( T0 ); @@ -413,7 +413,7 @@ void WUTDialog::slotChangeDate() { void WUTDialog::slotChangeLocation() { LocationDialog ld( kstars ); - if ( ld.exec() == QDialog::Accepted ) { + if ( ld.exec() == TQDialog::Accepted ) { GeoLocation *newGeo = ld.selectedCity(); if ( newGeo ) { geo = newGeo; diff --git a/kstars/kstars/tools/wutdialog.h b/kstars/kstars/tools/wutdialog.h index 3423ace0..452c4e9a 100644 --- a/kstars/kstars/tools/wutdialog.h +++ b/kstars/kstars/tools/wutdialog.h @@ -18,7 +18,7 @@ #ifndef WUTDIALOG_H #define WUTDIALOG_H -#include +#include #include #include "kstarsdatetime.h" @@ -64,7 +64,7 @@ class WUTDialog : public KDialogBase { /**@short display the rise/transit/set times for selected object */ - void slotDisplayObject(QListBoxItem *item); + void slotDisplayObject(TQListBoxItem *item); /**@short Apply user's choice of what part of the night should *be examined: @@ -96,7 +96,7 @@ class WUTDialog : public KDialogBase { KStars *kstars; WUTDialogUI *WUT; - /**@short Initialize all SIGNAL/SLOT connections, used in constructor */ + /**@short Initialize all SIGNAL/TQT_SLOT connections, used in constructor */ void makeConnections(); /**@short Initialize catgory list, used in constructor */ @@ -116,14 +116,14 @@ class WUTDialog : public KDialogBase { ObjectNameList *objectList; - QTime sunRiseTomorrow, sunSetToday, sunRiseToday, moonRise, moonSet; + TQTime sunRiseTomorrow, sunSetToday, sunRiseToday, moonRise, moonSet; KStarsDateTime T0, UT0, Tomorrow, TomorrowUT, Evening, EveningUT; GeoLocation *geo; int EveningFlag; struct List { - QPtrList visibleList[NCATEGORY]; + TQPtrList visibleList[NCATEGORY]; bool initialized[NCATEGORY]; } lists; diff --git a/ktouch/src/ktouch.cpp b/ktouch/src/ktouch.cpp index 231bc402..632aabe1 100644 --- a/ktouch/src/ktouch.cpp +++ b/ktouch/src/ktouch.cpp @@ -17,11 +17,11 @@ #include // QT Header -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include //#include // KDE Header @@ -75,7 +75,7 @@ KTouch::KTouch() setupActions(); // create the GUI reading the ui.rc file if (!initialGeometrySet()) - resize( QSize(700, 510).expandedTo(minimumSizeHint())); + resize( TQSize(700, 510).expandedTo(minimumSizeHint())); setupGUI(ToolBar | Keys | StatusBar | Create); setAutoSaveSettings(); // Read user statistics @@ -107,7 +107,7 @@ KTouch::KTouch() if (Prefs::currentLectureFile().isNull() || !m_lecture.loadXML(this, Prefs::currentLectureFile() )) { - Prefs::setCurrentLectureFile(QString::null); + Prefs::setCurrentLectureFile(TQString::null); m_defaultLectureAction->setCurrentItem(-1); } else { @@ -168,7 +168,7 @@ void KTouch::applyPreferences() { } // ---------------------------------------------------------------------------- -void KTouch::keyPressEvent(QKeyEvent *keyEvent) { +void KTouch::keyPressEvent(TQKeyEvent *keyEvent) { if (keyEvent->text().isEmpty()) return; // if we the training session is paused, continue training now @@ -179,18 +179,18 @@ void KTouch::keyPressEvent(QKeyEvent *keyEvent) { if (keyEvent->text().length() > 1) { kdDebug() << "[KTouch::keyPressEvent] text = '" << keyEvent->text() << "'" << endl; } - QChar key = keyEvent->text().at(0); // get first unicode character + TQChar key = keyEvent->text().at(0); // get first unicode character // HACK : manually filter out known dead keys // bool has_dead_key = true; switch (key.unicode()) { - case 94 : m_lastDeadKey = QChar(uint(94)); break; - case 176 : m_lastDeadKey = QChar(uint(176)); break; - case 180 : m_lastDeadKey = QChar(uint(180)); break; - case 96 : m_lastDeadKey = QChar(uint(96)); break; - case 126 : m_lastDeadKey = QChar(uint(126)); break; - default : m_lastDeadKey = QChar(uint(0)); + case 94 : m_lastDeadKey = TQChar(uint(94)); break; + case 176 : m_lastDeadKey = TQChar(uint(176)); break; + case 180 : m_lastDeadKey = TQChar(uint(180)); break; + case 96 : m_lastDeadKey = TQChar(uint(96)); break; + case 126 : m_lastDeadKey = TQChar(uint(126)); break; + default : m_lastDeadKey = TQChar(uint(0)); } - if (m_lastDeadKey != QChar(uint(0)) && key == m_lastDeadKey) { + if (m_lastDeadKey != TQChar(uint(0)) && key == m_lastDeadKey) { // kdDebug() << "Got dead key = " << m_lastDeadKey << endl; //keyEvent->accept(); // return; @@ -198,9 +198,9 @@ void KTouch::keyPressEvent(QKeyEvent *keyEvent) { if (key.isPrint()) m_trainer->keyPressed(key); - else if (key==QChar(8)) + else if (key==TQChar(8)) m_trainer->backspacePressed(); - else if (key==QChar(13)) + else if (key==TQChar(13)) m_trainer->enterPressed(); else return; // unrecognised char -> don't accept it! Maybe the key is for somebody else? @@ -209,7 +209,7 @@ void KTouch::keyPressEvent(QKeyEvent *keyEvent) { // ---------------------------------------------------------------------------- -void KTouch::imEndEvent ( QIMEvent * e ){ +void KTouch::imEndEvent ( TQIMEvent * e ){ m_trainer->keyPressed(e->text().at(0)); e->accept(); } @@ -285,7 +285,7 @@ void KTouch::configCommonColorsToggled(bool on) { // The action File->Open lecture... void KTouch::fileOpenLecture() { trainingPause(); - KURL tmp = KFileDialog::getOpenURL(QString::null, QString::null, this, i18n("Select Training Lecture File") ); + KURL tmp = KFileDialog::getOpenURL(TQString::null, TQString::null, this, i18n("Select Training Lecture File") ); if (!tmp.isEmpty()) { // first store training statistics m_trainer->storeTrainingStatistics(); @@ -323,9 +323,9 @@ void KTouch::fileEditLecture() { void KTouch::fileEditColors() { trainingPause(); // Create a copy of the currently editable color schemes. - QValueList tmp_list; + TQValueList tmp_list; int default_schemes = 0; - for (QValueVector::const_iterator it = KTouchColorScheme::m_colorSchemes.constBegin(); + for (TQValueVector::const_iterator it = KTouchColorScheme::m_colorSchemes.constBegin(); it != KTouchColorScheme::m_colorSchemes.constEnd(); ++it) { if (!it->m_default) tmp_list.append(*it); @@ -337,13 +337,13 @@ void KTouch::fileEditColors() { int selected; dlg.startEditor( tmp_list, Prefs::currentColorScheme() - default_schemes, selected); KTouchColorScheme::createDefaults(); - for (QValueList::const_iterator it = tmp_list.constBegin(); + for (TQValueList::const_iterator it = tmp_list.constBegin(); it != tmp_list.constEnd(); ++it) { KTouchColorScheme::m_colorSchemes.append(*it); } // update the quick select menu - QStringList schemes_list; + TQStringList schemes_list; for (unsigned int i=0; isetItems(schemes_list); @@ -431,16 +431,16 @@ void KTouch::optionsPreferences() { dialog->addPage(m_pageKeyboard, i18n("Keyboard Settings"), "keyboard_layout"); m_pageColors = new KTouchPrefColorsLayout(0, "Colors"); dialog->addPage(m_pageColors, i18n("Color Settings"), "package_graphics"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(applyPreferences())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(applyPreferences())); // TODO : Connect some other buttons/check boxes of the dialog - connect(m_pageGeneral->kcfg_OverrideLectureFont, SIGNAL(toggled(bool)), - this, SLOT(configOverrideLectureFontToggled(bool))); - connect(m_pageKeyboard->kcfg_OverrideKeyboardFont, SIGNAL(toggled(bool)), - this, SLOT(configOverrideKeyboardFontToggled(bool))); - connect(m_pageTraining->kcfg_AutoLevelChange, SIGNAL(toggled(bool)), - this, SLOT(configAutoLevelChangeToggled(bool))); - connect(m_pageColors->kcfg_CommonTypingLineColors, SIGNAL(toggled(bool)), - this, SLOT(configCommonColorsToggled(bool))); + connect(m_pageGeneral->kcfg_OverrideLectureFont, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(configOverrideLectureFontToggled(bool))); + connect(m_pageKeyboard->kcfg_OverrideKeyboardFont, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(configOverrideKeyboardFontToggled(bool))); + connect(m_pageTraining->kcfg_AutoLevelChange, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(configAutoLevelChangeToggled(bool))); + connect(m_pageColors->kcfg_CommonTypingLineColors, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(configCommonColorsToggled(bool))); // call the functions to enable/disable controls depending on settings configOverrideLectureFontToggled(Prefs::overrideLectureFont()); configOverrideKeyboardFontToggled(Prefs::overrideKeyboardFont()); @@ -450,7 +450,7 @@ void KTouch::optionsPreferences() { } // ---------------------------------------------------------------------------- -void KTouch::changeStatusbarMessage(const QString& text) { +void KTouch::changeStatusbarMessage(const TQString& text) { statusBar()->message(text); } // ---------------------------------------------------------------------------- @@ -487,7 +487,7 @@ void KTouch::changeLecture(int num) { if (static_cast(num)>=m_lectureFiles.count()) return; trainingPause(); KTouchLecture l; - QString fileName = m_lectureFiles[num]; + TQString fileName = m_lectureFiles[num]; if (!l.loadXML(this, KURL::fromPathOrURL(fileName))) { KMessageBox::sorry(0, i18n("Could not find/open the lecture file '%1'.").arg(fileName) ); m_defaultLectureAction->setCurrentItem(-1); @@ -527,7 +527,7 @@ bool KTouch::queryExit() { } // ---------------------------------------------------------------------------- -void KTouch::resizeEvent(QResizeEvent * event) { +void KTouch::resizeEvent(TQResizeEvent * event) { changeStatusbarStats(m_trainer->m_levelStats.m_correctChars, m_trainer->m_levelStats.m_totalChars, m_trainer->m_levelStats.m_words, m_trainer->m_sessionStats.m_correctChars, m_trainer->m_sessionStats.m_totalChars, m_trainer->m_sessionStats.m_words); KMainWindow::resizeEvent(event); @@ -550,7 +550,7 @@ void KTouch::readProperties(KConfig *config) { /* // The application is about to be restored due to session management. // Let's read all the stuff that was set when the application was terminated (during KDE logout). - QString session = config->readEntry("Session"); + TQString session = config->readEntry("Session"); if (!session.isEmpty()) m_trainer->m_session = KTouchTrainingSession(session); m_trainer->m_level = config->readNumEntry("Level", 0); @@ -612,9 +612,9 @@ void KTouch::init() { //kdDebug() << "[KTouch::init] " << m_examinationFiles.count() << " examination files available" << endl; if (Prefs::currentLectureFile() == "default") { - Prefs::setCurrentLectureFile(QString::null); + Prefs::setCurrentLectureFile(TQString::null); // /// \todo look up a lecture in the language of the KDE locale -/* QString default_lecture = "default"; +/* TQString default_lecture = "default"; if (m_lectureFiles.count() > 0) default_lecture = m_lectureFiles[0]; Prefs::setCurrentLectureFile( default_lecture ); */ @@ -623,12 +623,12 @@ void KTouch::init() { // if keyboard layout (loaded by Prefs is not available (e.g. the // layout file has been deleted) switch to default keyboard if (m_keyboardFiles.contains(Prefs::currentKeyboardFile() )==0) { - QString default_keyboard; + TQString default_keyboard; // determine locale - QString lang = KGlobal::locale()->language(); - QString fname = lang + ".keyboard"; + TQString lang = KGlobal::locale()->language(); + TQString fname = lang + ".keyboard"; // try to find keyboard with current locale - QStringList::const_iterator it = m_keyboardFiles.constBegin(); + TQStringList::const_iterator it = m_keyboardFiles.constBegin(); while (it != m_keyboardFiles.constEnd() && (*it).find(fname) == -1) ++it; if (it == m_keyboardFiles.constEnd()) { fname = lang.left(2) + ".keyboard"; @@ -657,13 +657,13 @@ void KTouch::initTrainingSession() { //kdDebug() << "[KTouch::initTrainingSession] setting up layouts and widgets for new training session..." << endl; // Build the training area. The status widget has a fixed vertical size, the slide line and the // keyboard grow according to their vertical stretch factors (see last argument in the constructors - // of QSizePolicy) - QVBox * mainLayout = new QVBox( this ); + // of TQSizePolicy) + TQVBox * mainLayout = new TQVBox( this ); m_statusWidget = new KTouchStatus( mainLayout ); m_slideLineWidget = new KTouchSlideLine( mainLayout ); - m_slideLineWidget->setSizePolicy( QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding, 0, 1) ); + m_slideLineWidget->setSizePolicy( TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding, 0, 1) ); m_keyboardWidget = new KTouchKeyboardWidget( mainLayout ); - m_keyboardWidget->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding, 0, 3) ); + m_keyboardWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding, 0, 3) ); setCentralWidget(mainLayout); // apply the settings to the widgets m_slideLineWidget->applyPreferences(); @@ -684,41 +684,41 @@ void KTouch::initTrainingSession() { void KTouch::setupActions() { // *** File menu *** new KAction(i18n("&Open lecture..."), "open_lecture", 0, - this, SLOT(fileOpenLecture()), actionCollection(), "file_openlecture"); + this, TQT_SLOT(fileOpenLecture()), actionCollection(), "file_openlecture"); new KAction(i18n("&Edit lecture..."), "edit_lecture", 0, - this, SLOT(fileEditLecture()), actionCollection(), "file_editlecture"); + this, TQT_SLOT(fileEditLecture()), actionCollection(), "file_editlecture"); new KAction(i18n("&Edit color scheme..."), "edit_colors", 0, - this, SLOT(fileEditColors()), actionCollection(), "file_editcolors"); + this, TQT_SLOT(fileEditColors()), actionCollection(), "file_editcolors"); // new KAction(i18n("&Edit Keyboard..."), "edit_keyboard", 0, -// this, SLOT(fileEditKeyboard()), actionCollection(), "file_editkeyboard"); - KStdAction::quit(this, SLOT(fileQuit()), actionCollection()); +// this, TQT_SLOT(fileEditKeyboard()), actionCollection(), "file_editkeyboard"); + KStdAction::quit(this, TQT_SLOT(fileQuit()), actionCollection()); // *** Training menu *** new KAction(i18n("&Start New Session"), "launch", 0, - this, SLOT(trainingNewSession()), actionCollection(), "training_newsession"); + this, TQT_SLOT(trainingNewSession()), actionCollection(), "training_newsession"); m_trainingPause = new KAction(i18n("&Pause Session"), "player_pause", 0, - this, SLOT(trainingPause()), actionCollection(), "training_pause"); + this, TQT_SLOT(trainingPause()), actionCollection(), "training_pause"); new KAction(i18n("&Lecture Statistics"), "kalarm", 0, - this, SLOT(trainingStatistics()), actionCollection(), "training_stats"); + this, TQT_SLOT(trainingStatistics()), actionCollection(), "training_stats"); // Setup menu entries for the training lectures m_defaultLectureAction = new KSelectAction(i18n("Default &Lectures"), 0, this, 0, actionCollection(), "default_lectures"); m_defaultLectureAction->setMenuAccelsEnabled(false); m_defaultLectureAction->setItems(m_lectureTitles); m_defaultLectureAction->setCurrentItem(0); - connect (m_defaultLectureAction, SIGNAL(activated(int)), this, SLOT(changeLecture(int))); + connect (m_defaultLectureAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changeLecture(int))); // *** Settings menu *** - KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(optionsPreferences()), actionCollection()); // Setup menu entries for keyboard layouts m_keyboardLayoutAction= new KSelectAction(i18n("&Keyboard Layouts"), 0, this, 0, actionCollection(), "keyboard_layouts"); m_keyboardLayoutAction->setMenuAccelsEnabled(false); m_keyboardLayoutAction->setItems(m_keyboardTitles); - connect (m_keyboardLayoutAction, SIGNAL(activated(int)), this, SLOT(changeKeyboard(int))); + connect (m_keyboardLayoutAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changeKeyboard(int))); // Setup menu entries for colour schemes m_keyboardColorAction = new KSelectAction(i18n("&Color Schemes"), 0, this, 0, actionCollection(), "keyboard_schemes"); - QStringList schemes_list; + TQStringList schemes_list; for (unsigned int i=0; isetMenuAccelsEnabled(false); @@ -726,7 +726,7 @@ void KTouch::setupActions() { if (static_cast(Prefs::currentColorScheme()) >= schemes_list.count()) Prefs::setCurrentColorScheme(1); m_keyboardColorAction->setCurrentItem(Prefs::currentColorScheme()); - connect (m_keyboardColorAction, SIGNAL(activated(int)), this, SLOT(changeColor(int))); + connect (m_keyboardColorAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changeColor(int))); } // ---------------------------------------------------------------------------- @@ -735,7 +735,7 @@ void KTouch::setupActions() { void KTouch::updateFontFromLecture() { // if the lecture requires a font, try this if (!m_lecture.m_fontSuggestions.isEmpty()) { - QFont f; + TQFont f; // TODO : if multiple font suggestions are given, try one after another until a // suggested font is found if (f.fromString(m_lecture.m_fontSuggestions)) m_slideLineWidget->setFont(f); @@ -755,24 +755,24 @@ void KTouch::updateFileLists() { // remove the number layout, since this is the necessary default layout and will be // added anyway - QStringList::iterator it = m_keyboardFiles.find("number.keyboard"); + TQStringList::iterator it = m_keyboardFiles.find("number.keyboard"); if (it!=m_keyboardFiles.end()) m_keyboardFiles.remove(it); m_keyboardTitles.clear(); - for (QStringList::const_iterator cit = m_keyboardFiles.constBegin(); + for (TQStringList::const_iterator cit = m_keyboardFiles.constBegin(); cit != m_keyboardFiles.constEnd(); ++cit) { // extract titles from keyboard files and store them in the // m_keyboardTitles string list // get the filename alone - QString fname = KURL(*cit).fileName(); + TQString fname = KURL(*cit).fileName(); // get the filename without the .keyboard fname.truncate(fname.length() - 9); // get everything in front of the first . - QString lang_iso = fname.section('.',0,0); + TQString lang_iso = fname.section('.',0,0); // get language description of file names - QString lang_name = KGlobal::locale()->twoAlphaToLanguageName(lang_iso); + TQString lang_name = KGlobal::locale()->twoAlphaToLanguageName(lang_iso); // kdDebug() << fname << " | " << lang_iso << " | " << lang_name << endl; if (lang_name.isEmpty()) lang_name = KGlobal::locale()->twoAlphaToCountryName(lang_iso); @@ -792,13 +792,13 @@ void KTouch::updateFileLists() { // Now lets find the lecture files. // TODO : search in i18n() directories - QStringList lectureFiles = dirs->findAllResources("data","ktouch/*.ktouch.xml"); + TQStringList lectureFiles = dirs->findAllResources("data","ktouch/*.ktouch.xml"); // Now extract the titles of the lecture files and populate the string lists used in the program m_lectureFiles.clear(); m_lectureTitles.clear(); if (!lectureFiles.isEmpty()) { // extract the prefixes - for (QStringList::iterator it=lectureFiles.begin(); it!=lectureFiles.end(); ++it) { + for (TQStringList::iterator it=lectureFiles.begin(); it!=lectureFiles.end(); ++it) { KURL url(*it); KTouchLecture l; // only add lecture if we can actually load it @@ -816,16 +816,16 @@ void KTouch::updateFileLists() { } // Now find predefined files with colour schemes - QStringList colour_schemes = dirs->findAllResources("data","ktouch/*.colour_scheme"); - // TODO : read in colour schemes and populate QValueList + TQStringList colour_schemes = dirs->findAllResources("data","ktouch/*.colour_scheme"); + // TODO : read in colour schemes and populate TQValueList } // ---------------------------------------------------------------------------- void KTouch::updateLectureActionCheck() { int num = 0; - QStringList::iterator it = m_lectureFiles.begin(); - QString fname = Prefs::currentLectureFile(); + TQStringList::iterator it = m_lectureFiles.begin(); + TQString fname = Prefs::currentLectureFile(); while (it != m_lectureFiles.end() && (*it).find(fname) == -1) { ++it; ++num; @@ -837,8 +837,8 @@ void KTouch::updateLectureActionCheck() { void KTouch::updateKeyboardActionCheck() { int num = 0; - QStringList::iterator it = m_keyboardFiles.begin(); - QString fname = Prefs::currentKeyboardFile(); + TQStringList::iterator it = m_keyboardFiles.begin(); + TQString fname = Prefs::currentKeyboardFile(); while (it != m_keyboardFiles.end() && (*it).find(fname) == -1) { ++it; ++num; @@ -849,25 +849,25 @@ void KTouch::updateKeyboardActionCheck() { // ---------------------------------------------------------------------------- /* -void KTouch::imStartEvent(QIMEvent *e) { +void KTouch::imStartEvent(TQIMEvent *e) { kdDebug() << "[KTouch::imStartEvent] text = '" << e->text() << "'" << endl; e->accept(); } // ---------------------------------------------------------------------------- -void KTouch::imComposeEvent(QIMEvent *e) { +void KTouch::imComposeEvent(TQIMEvent *e) { kdDebug() << "[KTouch::imComposeEvent] text = '" << e->text() << "'" << endl; e->accept(); } // ---------------------------------------------------------------------------- -void KTouch::imEndEvent(QIMEvent *e) { +void KTouch::imEndEvent(TQIMEvent *e) { kdDebug() << "[KTouch::imEndEvent] text = '" << e->text() << "'" << endl; if (!e->text().isEmpty()) { if (e->text() == "^") { - QKeyEvent *ev = new QKeyEvent (QEvent::KeyPress, + TQKeyEvent *ev = new TQKeyEvent (TQEvent::KeyPress, Qt::Key_AsciiCircum, '^', 0, - QString("^")); + TQString("^")); keyPressEvent(ev); delete ev; } diff --git a/ktouch/src/ktouch.h b/ktouch/src/ktouch.h index 9ebdcfc8..6bbe4325 100644 --- a/ktouch/src/ktouch.h +++ b/ktouch/src/ktouch.h @@ -17,9 +17,9 @@ #include #endif -#include -#include -#include +#include +#include +#include #include #include @@ -65,13 +65,13 @@ class KTouch : public KMainWindow { ~KTouch(); /// Returns the available lecture files - const QStringList& lectureFiles() const { return m_lectureFiles; } + const TQStringList& lectureFiles() const { return m_lectureFiles; } /// Returns the statistics object for the current lecture (as reference) KTouchLectureStats& getCurrentLectureStats(); /// Clears the statistics data. void clearStatistics(); /// Updates the status bar text. - void changeStatusbarMessage(const QString& text); + void changeStatusbarMessage(const TQString& text); /// Updates the status bar statistics. void changeStatusbarStats(unsigned int level_correct, unsigned int level_total, unsigned int level_words, unsigned int session_correct, unsigned int session_total, unsigned int session_words); @@ -111,11 +111,11 @@ class KTouch : public KMainWindow { /// Reimplementated to save preferences and bool queryExit(); /// Some layout fixes here... - void resizeEvent(QResizeEvent *); + void resizeEvent(TQResizeEvent *); /// Accepts a typed char. - void keyPressEvent(QKeyEvent *keyEvent); + void keyPressEvent(TQKeyEvent *keyEvent); - void imEndEvent (QIMEvent *e); + void imEndEvent (TQIMEvent *e); private: // *** BEGIN - Session management *** @@ -164,14 +164,14 @@ class KTouch : public KMainWindow { KTouchPrefKeyboardLayout * m_pageKeyboard; ///< The keyboard configuration page. KTouchPrefColorsLayout * m_pageColors; ///< The color scheme configuration page. - QStringList m_lectureFiles; ///< A list of all default lecture files. - QStringList m_lectureTitles; ///< A list of the titles of all default lecture files. + TQStringList m_lectureFiles; ///< A list of all default lecture files. + TQStringList m_lectureTitles; ///< A list of the titles of all default lecture files. - QStringList m_examinationFiles; ///< A list of all default examination files. - QStringList m_examinationTitles; ///< A list of the titles of all default examination files. + TQStringList m_examinationFiles; ///< A list of all default examination files. + TQStringList m_examinationTitles; ///< A list of the titles of all default examination files. - QStringList m_keyboardFiles; ///< A list of all default keyboard layout files. - QStringList m_keyboardTitles; ///< A list of the titles of all default keyboard layout files. + TQStringList m_keyboardFiles; ///< A list of all default keyboard layout files. + TQStringList m_keyboardTitles; ///< A list of the titles of all default keyboard layout files. KTouchStatisticsData m_stats; ///< All user statistics are kept here. diff --git a/ktouch/src/ktouchchartwidget.cpp b/ktouch/src/ktouchchartwidget.cpp index aba87f28..43e3642a 100644 --- a/ktouch/src/ktouchchartwidget.cpp +++ b/ktouch/src/ktouchchartwidget.cpp @@ -13,19 +13,19 @@ #include "ktouchchartwidget.h" #include "ktouchchartwidget.moc" -#include +#include #include #include // for mathematical functions #include -KTouchChartWidget::KTouchChartWidget(QWidget* parent, const char *name) +KTouchChartWidget::KTouchChartWidget(TQWidget* parent, const char *name) : KPlotWidget(0.0, 1.0, 0.0, 1.0, parent, name) { setShowGrid( false ); // no grid please - setBGColor( QColor( "white" ) ); - setFGColor( QColor( "black" ) ); + setBGColor( TQColor( "white" ) ); + setFGColor( TQColor( "black" ) ); setLimits( 0.0, 120.0, 0.0, 240.0 ); setXAxisLabel( i18n( "Progress" ) ); setYAxisLabel( i18n( "Words per second" ) ); diff --git a/ktouch/src/ktouchchartwidget.h b/ktouch/src/ktouchchartwidget.h index 223705b0..799a5a38 100644 --- a/ktouch/src/ktouchchartwidget.h +++ b/ktouch/src/ktouchchartwidget.h @@ -26,7 +26,7 @@ class KTouchChartWidget : public KPlotWidget { Q_OBJECT public: /// Constructor. - KTouchChartWidget(QWidget* parent, const char *name=0); + KTouchChartWidget(TQWidget* parent, const char *name=0); /// Destructor. ~KTouchChartWidget(); }; diff --git a/ktouch/src/ktouchcoloreditor.cpp b/ktouch/src/ktouchcoloreditor.cpp index 1341366d..e9bdb829 100644 --- a/ktouch/src/ktouchcoloreditor.cpp +++ b/ktouch/src/ktouchcoloreditor.cpp @@ -13,8 +13,8 @@ #include "ktouchcoloreditor.h" #include "ktouchcoloreditor.moc" -#include -#include +#include +#include #include #include @@ -23,7 +23,7 @@ #include #include -KTouchColorEditor::KTouchColorEditor(QWidget* parent, const char* name, bool modal, WFlags fl) +KTouchColorEditor::KTouchColorEditor(TQWidget* parent, const char* name, bool modal, WFlags fl) : KTouchColorEditorDlg(parent,name, modal,fl) { } @@ -34,7 +34,7 @@ KTouchColorEditor::~KTouchColorEditor() } // ---------------------------------------------------------------------------- -void KTouchColorEditor::startEditor(QValueList& schemes, int active, int & selected) { +void KTouchColorEditor::startEditor(TQValueList& schemes, int active, int & selected) { m_schemes = schemes; m_currentItem = QMAX(0, active); updateListBox(); @@ -54,14 +54,14 @@ void KTouchColorEditor::startEditor(QValueList& schemes, int } // ---------------------------------------------------------------------------- -void KTouchColorEditor::colorSchemeChanged(QListBoxItem *) { +void KTouchColorEditor::colorSchemeChanged(TQListBoxItem *) { // kdDebug() << "[KTouchColorEditor::colorSchemeChanged]" << endl; int num = schemeListBox->currentItem(); if (num < 0 || num >= static_cast(m_schemes.count())) { updateControls(NULL); return; } - QValueList::const_iterator it = m_schemes.begin(); + TQValueList::const_iterator it = m_schemes.begin(); while (--num >= 0) ++it; updateControls(&(*it)); } @@ -75,7 +75,7 @@ void KTouchColorEditor::updateClicked() { updateListBox(); return; } - QValueList::iterator it = m_schemes.begin(); + TQValueList::iterator it = m_schemes.begin(); while (--num >= 0) ++it; (*it).m_name = nameEdit->text(); if ((*it).m_name.isEmpty()) @@ -116,7 +116,7 @@ void KTouchColorEditor::removeBtnClicked() { int num = schemeListBox->currentItem(); int old_num = num; if (num >=0 && num < static_cast(m_schemes.count())) { - QValueList::iterator it = m_schemes.begin(); + TQValueList::iterator it = m_schemes.begin(); while (--num >= 0) ++it; m_schemes.erase(it); } @@ -136,7 +136,7 @@ void KTouchColorEditor::addBtnClicked() { } // ---------------------------------------------------------------------------- -void KTouchColorEditor::closeEvent( QCloseEvent* ce ) { +void KTouchColorEditor::closeEvent( TQCloseEvent* ce ) { int result = KMessageBox::questionYesNoCancel(this, i18n("Save modified color schemes?")); switch (result) { @@ -154,7 +154,7 @@ void KTouchColorEditor::closeEvent( QCloseEvent* ce ) { void KTouchColorEditor::updateListBox() { // kdDebug() << "[KTouchColorEditor::updateListBox]" << endl; schemeListBox->clear(); - for (QValueList::const_iterator it = m_schemes.constBegin(); + for (TQValueList::const_iterator it = m_schemes.constBegin(); it != m_schemes.constEnd(); ++it) { schemeListBox->insertItem( (*it).m_name ); diff --git a/ktouch/src/ktouchcoloreditor.h b/ktouch/src/ktouchcoloreditor.h index 3d5a0e11..9e826e94 100644 --- a/ktouch/src/ktouchcoloreditor.h +++ b/ktouch/src/ktouchcoloreditor.h @@ -19,7 +19,7 @@ #include "ktouchcoloreditor_dlg.h" -#include +#include #include "ktouchcolorscheme.h" @@ -30,7 +30,7 @@ class KTouchColorEditor : public KTouchColorEditorDlg public: /// Constructor - KTouchColorEditor(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + KTouchColorEditor(TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); /// Destructor ~KTouchColorEditor(); @@ -38,16 +38,16 @@ public: /// @param schemes List with user defined color schemes. /// @param active Index with active color scheme (negative if predefined scheme is active). /// @param selected Here the index of the currently selected scheme is stored. - void startEditor(QValueList& schemes, int active, int & selected); + void startEditor(TQValueList& schemes, int active, int & selected); public slots: - virtual void colorSchemeChanged(QListBoxItem * item); + virtual void colorSchemeChanged(TQListBoxItem * item); virtual void updateClicked(); virtual void removeBtnClicked(); virtual void addBtnClicked(); protected: - virtual void closeEvent( QCloseEvent* ce ); + virtual void closeEvent( TQCloseEvent* ce ); private: /// Updates the list box with values from m_schemes. @@ -57,7 +57,7 @@ private: void updateControls(const KTouchColorScheme * cs); int m_currentItem; - QValueList m_schemes; + TQValueList m_schemes; bool m_saveChanges; }; diff --git a/ktouch/src/ktouchcolorscheme.cpp b/ktouch/src/ktouchcolorscheme.cpp index 0092fb07..9a20d2e9 100644 --- a/ktouch/src/ktouchcolorscheme.cpp +++ b/ktouch/src/ktouchcolorscheme.cpp @@ -11,9 +11,9 @@ #include "ktouchcolorscheme.h" -#include -#include -#include +#include +#include +#include #include #include @@ -26,24 +26,24 @@ z.appendChild(e); #define READ_COLOR(x,y) c = n.namedItem(x); \ - if (!c.isNull()) y = QColor(c.firstChild().nodeValue()); + if (!c.isNull()) y = TQColor(c.firstChild().nodeValue()); -QValueVector KTouchColorScheme::m_colorSchemes; +TQValueVector KTouchColorScheme::m_colorSchemes; void KTouchColorScheme::clear() { // the default scheme is the classic one - m_teacherTextColor = QColor("#000032"); - m_teacherBackground = QColor("#BEBEFF"); - m_studentTextColor = QColor("#003200"); - m_studentBackground = QColor("#9FFF9F"); + m_teacherTextColor = TQColor("#000032"); + m_teacherBackground = TQColor("#BEBEFF"); + m_studentTextColor = TQColor("#003200"); + m_studentBackground = TQColor("#9FFF9F"); m_errorTextColor = Qt::white; - m_errorBackground = QColor("#AC0000"); + m_errorBackground = TQColor("#AC0000"); m_frame = Qt::black; - m_background[0] = QColor(255,238, 7); m_background[4] = QColor(247,138,247); - m_background[1] = QColor( 14,164,239); m_background[5] = QColor(158,255,155); - m_background[2] = QColor(158,255,155); m_background[6] = QColor( 14,164,239); - m_background[3] = QColor(252,138,138); m_background[7] = QColor(255,238, 7); + m_background[0] = TQColor(255,238, 7); m_background[4] = TQColor(247,138,247); + m_background[1] = TQColor( 14,164,239); m_background[5] = TQColor(158,255,155); + m_background[2] = TQColor(158,255,155); m_background[6] = TQColor( 14,164,239); + m_background[3] = TQColor(252,138,138); m_background[7] = TQColor(255,238, 7); m_text = Qt::black; m_backgroundH = Qt::darkBlue; m_textH = Qt::white; @@ -56,18 +56,18 @@ void KTouchColorScheme::clear() { } // ---------------------------------------------------------------------------- -bool KTouchColorScheme::read(const QDomNode& node) { +bool KTouchColorScheme::read(const TQDomNode& node) { // kdDebug() << "[KTouchColorScheme::read] " << endl; - QDomNode name = node.namedItem("Name"); + TQDomNode name = node.namedItem("Name"); if (name.isNull()) m_name = i18n("untitled color scheme"); else m_name = name.firstChild().nodeValue(); // kdDebug() << " Reading scheme = " << m_name << endl; - QDomNode n = node.namedItem("LineColors"); + TQDomNode n = node.namedItem("LineColors"); if (!n.isNull()) { - QDomNode c; + TQDomNode c; READ_COLOR("TeacherTextColor", m_teacherTextColor); READ_COLOR("TeacherBackground", m_teacherBackground); READ_COLOR("StudentTextColor", m_studentTextColor); @@ -78,10 +78,10 @@ bool KTouchColorScheme::read(const QDomNode& node) { n = node.namedItem("KeyboardColors"); if (!n.isNull()) { - QDomNode c; + TQDomNode c; READ_COLOR("KeyFrame", m_frame); for (unsigned int i=0; i<8; ++i) { - READ_COLOR(QString("KeyBack_%1").arg(i), m_background[i]); + READ_COLOR(TQString("KeyBack_%1").arg(i), m_background[i]); } READ_COLOR("KeyText", m_text); READ_COLOR("KeyBackHigh", m_backgroundH); @@ -95,20 +95,20 @@ bool KTouchColorScheme::read(const QDomNode& node) { } // ---------------------------------------------------------------------------- -void KTouchColorScheme::write(QDomDocument& doc, QDomElement& root) const { +void KTouchColorScheme::write(TQDomDocument& doc, TQDomElement& root) const { //kdDebug() << "[KTouchColorScheme::write] " << endl; - QDomElement element = doc.createElement("KTouchColorScheme"); + TQDomElement element = doc.createElement("KTouchColorScheme"); // append name of color scheme - QDomElement name = doc.createElement("Name"); - QDomText name_text; + TQDomElement name = doc.createElement("Name"); + TQDomText name_text; if (m_name.isEmpty()) name_text = doc.createTextNode( i18n("untitled color scheme") ); else name_text = doc.createTextNode(m_name); name.appendChild(name_text); element.appendChild(name); // store slide line colors - QDomElement line_colors = doc.createElement("LineColors"); - QDomElement e; - QDomText n; + TQDomElement line_colors = doc.createElement("LineColors"); + TQDomElement e; + TQDomText n; WRITE_COLOR(line_colors, "TeacherTextColor", m_teacherTextColor); WRITE_COLOR(line_colors, "TeacherBackground", m_teacherBackground); @@ -121,11 +121,11 @@ void KTouchColorScheme::write(QDomDocument& doc, QDomElement& root) const { // done with slide line colors // write key drawing colors - QDomElement key_colors = doc.createElement("KeyboardColors"); + TQDomElement key_colors = doc.createElement("KeyboardColors"); WRITE_COLOR(key_colors, "KeyFrame", m_frame); for (unsigned int i=0; i<8; ++i) { - WRITE_COLOR(key_colors, QString("KeyBack_%1").arg(i), m_background[i]); + WRITE_COLOR(key_colors, TQString("KeyBack_%1").arg(i), m_background[i]); } WRITE_COLOR(key_colors, "KeyText", m_text); WRITE_COLOR(key_colors, "KeyBackHigh", m_backgroundH); @@ -142,23 +142,23 @@ void KTouchColorScheme::write(QDomDocument& doc, QDomElement& root) const { } // ---------------------------------------------------------------------------- -bool KTouchColorScheme::readList(QWidget * window, const KURL& url) { +bool KTouchColorScheme::readList(TQWidget * window, const KURL& url) { if (url.isEmpty()) return false; //kdDebug() << "[KTouchColorScheme::readList] " << endl; //kdDebug() << " url = '" << url.url() << "'" << endl; - QString tmp_file; + TQString tmp_file; bool result = KIO::NetAccess::download(url, tmp_file, window); if (result) { // Ok, that was successful, try to parse the XML doc now - QFile infile(tmp_file); + TQFile infile(tmp_file); if ( !infile.open( IO_ReadOnly ) ) { KIO::NetAccess::removeTempFile(tmp_file); return false; // Bugger it... couldn't open it... } - QDomDocument doc; + TQDomDocument doc; doc.setContent( &infile ); // read the document - QDomNodeList schemes = doc.elementsByTagName("KTouchColorScheme"); + TQDomNodeList schemes = doc.elementsByTagName("KTouchColorScheme"); int num = schemes.count(); if (num > 0) { //kdDebug() << " reading " << schemes.count() << " color maps..." << endl; @@ -176,20 +176,20 @@ bool KTouchColorScheme::readList(QWidget * window, const KURL& url) { } // ---------------------------------------------------------------------------- -bool KTouchColorScheme::writeList(QWidget * window, const KURL& url) { +bool KTouchColorScheme::writeList(TQWidget * window, const KURL& url) { // create the XML document and root node - QDomDocument doc; - QDomElement root = doc.createElement( "KTouchColorSchemeCollection" ); + TQDomDocument doc; + TQDomElement root = doc.createElement( "KTouchColorSchemeCollection" ); doc.appendChild(root); // write all the non-default color schemes - for (QValueVector::const_iterator it = m_colorSchemes.constBegin(); + for (TQValueVector::const_iterator it = m_colorSchemes.constBegin(); it != m_colorSchemes.constEnd(); ++it) { if (!it->m_default) it->write(doc, root); } // and save it - QString tmp_file; + TQString tmp_file; KTempFile *temp=0; if (url.isLocalFile()) tmp_file=url.path(); // for local files the path is sufficient @@ -199,14 +199,14 @@ bool KTouchColorScheme::writeList(QWidget * window, const KURL& url) { tmp_file=temp->name(); } - QFile outfile(tmp_file); + TQFile outfile(tmp_file); if ( !outfile.open( IO_WriteOnly ) ) { if (temp) delete temp; kdDebug() << "Error creating tmp file '"+tmp_file+"' for writing color map!" << endl; return false; } - QTextStream out( &outfile ); + TQTextStream out( &outfile ); out << doc.toString(); outfile.close(); // if we have a temporary file, we still need to upload it @@ -243,17 +243,17 @@ void KTouchColorScheme::createDefaults() { m_colorSchemes.push_back(color); color.m_name = i18n("Classic"); - color.m_teacherTextColor = QColor("#000032"); - color.m_teacherBackground = QColor("#BEBEFF"); - color.m_studentTextColor = QColor("#003200"); - color.m_studentBackground = QColor("#9FFF9F"); + color.m_teacherTextColor = TQColor("#000032"); + color.m_teacherBackground = TQColor("#BEBEFF"); + color.m_studentTextColor = TQColor("#003200"); + color.m_studentBackground = TQColor("#9FFF9F"); color.m_errorTextColor = Qt::white; - color.m_errorBackground = QColor("#AC0000"); + color.m_errorBackground = TQColor("#AC0000"); color.m_frame = Qt::black; - color.m_background[0] = QColor(255,238, 7); color.m_background[4] = QColor(247,138,247); - color.m_background[1] = QColor( 14,164,239); color.m_background[5] = QColor(158,255,155); - color.m_background[2] = QColor(158,255,155); color.m_background[6] = QColor( 14,164,239); - color.m_background[3] = QColor(252,138,138); color.m_background[7] = QColor(255,238, 7); + color.m_background[0] = TQColor(255,238, 7); color.m_background[4] = TQColor(247,138,247); + color.m_background[1] = TQColor( 14,164,239); color.m_background[5] = TQColor(158,255,155); + color.m_background[2] = TQColor(158,255,155); color.m_background[6] = TQColor( 14,164,239); + color.m_background[3] = TQColor(252,138,138); color.m_background[7] = TQColor(255,238, 7); color.m_text = Qt::black; color.m_backgroundH = Qt::darkBlue; color.m_textH = Qt::white; @@ -265,43 +265,43 @@ void KTouchColorScheme::createDefaults() { color.m_name = i18n("Deep Blue"); color.m_teacherTextColor = Qt::white; - color.m_teacherBackground = QColor( 0, 39, 80); + color.m_teacherBackground = TQColor( 0, 39, 80); color.m_studentTextColor = Qt::white; - color.m_studentBackground = QColor( 39, 59,127); - color.m_errorTextColor = QColor("#B5CFFF"); - color.m_errorBackground = QColor("#640000"); - color.m_frame = QColor(220,220,220); - color.m_background[0] = QColor( 0, 39, 80); color.m_background[4] = QColor( 24, 19, 72); - color.m_background[1] = QColor( 39, 59,127); color.m_background[5] = QColor( 8, 44,124); - color.m_background[2] = QColor( 4, 39, 53); color.m_background[6] = QColor( 10, 82,158); - color.m_background[3] = QColor( 40, 32,121); color.m_background[7] = QColor( 43, 60,124); + color.m_studentBackground = TQColor( 39, 59,127); + color.m_errorTextColor = TQColor("#B5CFFF"); + color.m_errorBackground = TQColor("#640000"); + color.m_frame = TQColor(220,220,220); + color.m_background[0] = TQColor( 0, 39, 80); color.m_background[4] = TQColor( 24, 19, 72); + color.m_background[1] = TQColor( 39, 59,127); color.m_background[5] = TQColor( 8, 44,124); + color.m_background[2] = TQColor( 4, 39, 53); color.m_background[6] = TQColor( 10, 82,158); + color.m_background[3] = TQColor( 40, 32,121); color.m_background[7] = TQColor( 43, 60,124); color.m_text = Qt::white; - color.m_backgroundH = QColor(125,180,255); + color.m_backgroundH = TQColor(125,180,255); color.m_textH = Qt::darkBlue; color.m_cBackground = Qt::black; color.m_cText = Qt::white; - color.m_cBackgroundH = QColor(111,121,73); + color.m_cBackgroundH = TQColor(111,121,73); color.m_cTextH = Qt::white; m_colorSchemes.push_back(color); color.m_name = i18n("Stripy"); color.m_teacherTextColor = Qt::white; - color.m_teacherBackground = QColor( 39, 70, 227); + color.m_teacherBackground = TQColor( 39, 70, 227); color.m_studentTextColor = Qt::white; - color.m_studentBackground = QColor( 39, 70, 127); + color.m_studentBackground = TQColor( 39, 70, 127); color.m_errorTextColor = Qt::white; color.m_errorBackground = Qt::darkGray; color.m_frame = Qt::black; for (int i=0; i<8; i=i+2) - color.m_background[i] = QColor( 39, 70, 127); + color.m_background[i] = TQColor( 39, 70, 127); for (int i=1; i<8; i=i+2) color.m_background[i] = Qt::darkGray; color.m_text = Qt::black; - color.m_backgroundH = QColor( 39, 70, 227); + color.m_backgroundH = TQColor( 39, 70, 227); color.m_textH = Qt::white; color.m_cBackground = Qt::gray; color.m_cText = Qt::black; - color.m_cBackgroundH = QColor( 39, 70, 227); + color.m_cBackgroundH = TQColor( 39, 70, 227); color.m_cTextH = Qt::black; m_colorSchemes.push_back(color); } diff --git a/ktouch/src/ktouchcolorscheme.h b/ktouch/src/ktouchcolorscheme.h index 47e28813..471dbe55 100644 --- a/ktouch/src/ktouchcolorscheme.h +++ b/ktouch/src/ktouchcolorscheme.h @@ -16,8 +16,8 @@ #include #endif -#include -#include +#include +#include #include @@ -36,29 +36,29 @@ class KTouchColorScheme { void clear(); /// Loads a color map (in XML format) from XML node (returns true if successful) - bool read(const QDomNode& node); + bool read(const TQDomNode& node); /// Saves a color map to XML document (returns true if successful). - void write(QDomDocument& doc, QDomElement& root) const; + void write(TQDomDocument& doc, TQDomElement& root) const; - QString m_name; ///< The name of the colour scheme. + TQString m_name; ///< The name of the colour scheme. - QColor m_teacherTextColor; ///< The text colour for the teachers line. - QColor m_teacherBackground; ///< The background colour for the teachers line. - QColor m_studentTextColor; ///< The text colour for the students line. - QColor m_studentBackground; ///< The background colour for the students line. - QColor m_errorTextColor; ///< The text colour for wrong text (students line). - QColor m_errorBackground; ///< The background colour for wrong text (students line). + TQColor m_teacherTextColor; ///< The text colour for the teachers line. + TQColor m_teacherBackground; ///< The background colour for the teachers line. + TQColor m_studentTextColor; ///< The text colour for the students line. + TQColor m_studentBackground; ///< The background colour for the students line. + TQColor m_errorTextColor; ///< The text colour for wrong text (students line). + TQColor m_errorBackground; ///< The background colour for wrong text (students line). - QColor m_frame; ///< The colour for the key frames. - QColor m_background[8]; ///< The background colour of the finger keys and the associated normal keys. - QColor m_text; ///< The colour for the text on the keys. - QColor m_backgroundH; ///< The background colour for highlighted (next) normal keys. - QColor m_textH; ///< The text/pen colour for highlighted (next) normal keys. - QColor m_cBackground; ///< The background colour for the control keys. - QColor m_cText; ///< The text/pen colour for the control keys. - QColor m_cBackgroundH; ///< The background colour for activated control keys. - QColor m_cTextH; ///< The text/pen colour for activated control keys. + TQColor m_frame; ///< The colour for the key frames. + TQColor m_background[8]; ///< The background colour of the finger keys and the associated normal keys. + TQColor m_text; ///< The colour for the text on the keys. + TQColor m_backgroundH; ///< The background colour for highlighted (next) normal keys. + TQColor m_textH; ///< The text/pen colour for highlighted (next) normal keys. + TQColor m_cBackground; ///< The background colour for the control keys. + TQColor m_cText; ///< The text/pen colour for the control keys. + TQColor m_cBackgroundH; ///< The background colour for activated control keys. + TQColor m_cTextH; ///< The text/pen colour for activated control keys. bool m_default; ///< If true, this color map is marked as default and will not /// be saved in the XML file. @@ -68,14 +68,14 @@ class KTouchColorScheme { /// Loads several color maps (in XML format) from file (returns true if successful) /// and _adds_ them to the current color maps. This function shall be called /// directly after createDefaultColorSchemes(). - static bool readList(QWidget * window, const KURL& url); + static bool readList(TQWidget * window, const KURL& url); /// Saves several color maps to file (returns true if successful). /// Only non-default color maps are written to file. - static bool writeList(QWidget * window, const KURL& url); + static bool writeList(TQWidget * window, const KURL& url); /// Creates some default color schemes (erases m_colorSchemes before). static void createDefaults(); /// Contains all color schemes available in the program. - static QValueVector m_colorSchemes; + static TQValueVector m_colorSchemes; }; #endif // KTOUCHCOLORSCHEME_H diff --git a/ktouch/src/ktouchkey.cpp b/ktouch/src/ktouchkey.cpp index cb68b214..befc1675 100644 --- a/ktouch/src/ktouchkey.cpp +++ b/ktouch/src/ktouchkey.cpp @@ -14,7 +14,7 @@ #include #include // for std::min -KTouchKey::KTouchKey(keytype_t type, int x, int y, int w, int h, QChar ch) +KTouchKey::KTouchKey(keytype_t type, int x, int y, int w, int h, TQChar ch) : m_type(type), m_x(x), m_y(y), m_w(w), m_h(h) { m_chars[0].m_ch = ch; @@ -23,7 +23,7 @@ KTouchKey::KTouchKey(keytype_t type, int x, int y, int w, int h, QChar ch) } // ---------------------------------------------------------------------------- -KTouchKey::KTouchKey(int x, int y, int w, int h, QString text) : +KTouchKey::KTouchKey(int x, int y, int w, int h, TQString text) : m_x(x), m_y(y), m_w(w), m_h(h) { m_type = OTHER; @@ -44,16 +44,16 @@ void KTouchKey::resize(double scale) { // Reads the key data from the DomElement -bool KTouchKey::read(QDomNode node) { +bool KTouchKey::read(TQDomNode node) { /* if (node.isNull()) return false; // TODO : Error message - QString primaryCharText = node.firstChild().nodeValue(); + TQString primaryCharText = node.firstChild().nodeValue(); if (primaryCharText.length() >= 1) m_primaryChar = primaryCharText[0]; else return false; // TODO : Error message - QDomNamedNodeMap nmap = node.attributes(); + TQDomNamedNodeMap nmap = node.attributes(); // Get height, widht, x and y node = nmap.namedItem("Height"); if (node.isNull()) @@ -75,7 +75,7 @@ bool KTouchKey::read(QDomNode node) { node = nmap.namedItem("Type"); if (node.isNull()) return false; // TODO : Error message - QString typetext = node.nodeValue(); + TQString typetext = node.nodeValue(); if (typetext=="NORMAL") m_type = NORMAL; else if (typetext=="FINGER") m_type = FINGER; else if (typetext=="ENTER") m_type = ENTER; @@ -92,13 +92,13 @@ bool KTouchKey::read(QDomNode node) { return false; // TODO : Error message // read optional secondary character node = nmap.namedItem("SecondaryChar"); - QString charvalue; + TQString charvalue; if (!node.isNull()) charvalue = node.nodeValue(); if (charvalue.length() >= 1) m_secondaryChar = charvalue[0]; else - m_secondaryChar = QChar(0); + m_secondaryChar = TQChar(0); kdDebug() << "H:" << m_h << " W:" << m_w << " X:" << m_x << " Y:" << m_y << " Type:" << m_type << " SecondaryChar:" << m_secondaryChar << "' PrimaryChar:" << m_primaryChar << "'" << endl; @@ -108,9 +108,9 @@ bool KTouchKey::read(QDomNode node) { // ---------------------------------------------------------------------------- // Writes the key data into the DomElement -void KTouchKey::write(QDomDocument& doc, QDomElement& root) const { +void KTouchKey::write(TQDomDocument& doc, TQDomElement& root) const { /* - QDomElement element = doc.createElement("KeyDefinition"); + TQDomElement element = doc.createElement("KeyDefinition"); switch (m_type) { case NORMAL : element.setAttribute("Type", "NORMAL"); break; case FINGER : element.setAttribute("Type", "FINGER"); break; @@ -123,11 +123,11 @@ void KTouchKey::write(QDomDocument& doc, QDomElement& root) const { element.setAttribute("OtherKeyText", m_otherKeyText); break; } - QDomText charnode = doc.createTextNode(QString(m_primaryChar)); + TQDomText charnode = doc.createTextNode(TQString(m_primaryChar)); element.appendChild(charnode); -// element.setAttribute("PrimaryChar", QString(m_primaryChar)); - if (m_secondaryChar!=QChar(0)) - element.setAttribute("SecondaryChar", QString(m_secondaryChar)); +// element.setAttribute("PrimaryChar", TQString(m_primaryChar)); + if (m_secondaryChar!=TQChar(0)) + element.setAttribute("SecondaryChar", TQString(m_secondaryChar)); element.setAttribute("X", m_x); element.setAttribute("Y", m_y); element.setAttribute("Width", m_w); diff --git a/ktouch/src/ktouchkey.h b/ktouch/src/ktouchkey.h index f27fd80f..011f4e4b 100644 --- a/ktouch/src/ktouchkey.h +++ b/ktouch/src/ktouchkey.h @@ -17,8 +17,8 @@ #include #endif -#include -#include +#include +#include /// This class contains information about one character on a key. class KTouchKeyChar { @@ -34,10 +34,10 @@ class KTouchKeyChar { /// Constructor. KTouchKeyChar() {} /// Constructor. - KTouchKeyChar(QChar ch, position_t p, bool bold = false) : + KTouchKeyChar(TQChar ch, position_t p, bool bold = false) : m_ch(ch), m_pos(p), m_bold(bold) {} - QChar m_ch; ///< The character to draw. + TQChar m_ch; ///< The character to draw. position_t m_pos; ///< The position of the character. bool m_bold; ///< Whether this is a bold character. @@ -65,17 +65,17 @@ class KTouchKey { /// Default constructor KTouchKey() : m_type(NORMAL), m_x(0), m_y(0), m_w(0), m_h(0) {} /// Convenience constructor for a key with a single character (like before). - KTouchKey(keytype_t type, int x, int y, int w, int h, QChar ch); + KTouchKey(keytype_t type, int x, int y, int w, int h, TQChar ch); /// Convenience constructor for a key with a text on it (type will be OTHER). - KTouchKey(int x, int y, int w, int h, QString text); + KTouchKey(int x, int y, int w, int h, TQString text); /// Resizes the key (this function will be obsolete soon) void resize(double scale); /// Reads the key data from the DomElement - bool read(QDomNode node); + bool read(TQDomNode node); /// Creates a new DomElement, writes the key data into it and appends it to the root object. - void write(QDomDocument& doc, QDomElement& root) const; + void write(TQDomDocument& doc, TQDomElement& root) const; unsigned int m_number; ///< The number of the key. keytype_t m_type; ///< The type of the key. diff --git a/ktouch/src/ktouchkeyboard.cpp b/ktouch/src/ktouchkeyboard.cpp index a9650f9e..1e7440a5 100644 --- a/ktouch/src/ktouchkeyboard.cpp +++ b/ktouch/src/ktouchkeyboard.cpp @@ -12,7 +12,7 @@ #include "ktouchkeyboard.h" -#include +#include #include #include @@ -27,26 +27,26 @@ void KTouchKeyboard::clear() { m_keys.clear(); m_connectors.clear(); - m_title = QString::null; - m_comment = QString::null; - m_language = QString::null; - m_fontSuggestions = QString::null; + m_title = TQString::null; + m_comment = TQString::null; + m_language = TQString::null; + m_fontSuggestions = TQString::null; } // ---------------------------------------------------------------------------- // Loads a keyboard layout (old format) from file (returns true if successful). -bool KTouchKeyboard::load(QWidget * window, const KURL& url) { +bool KTouchKeyboard::load(TQWidget * window, const KURL& url) { // Ok, first download the contents as usual using the KIO lib // File is only downloaded if not local, otherwise it's just opened - QString target; + TQString target; bool result = false; //kdDebug() << "[KTouchKeyboard::load] " << url << endl; if (KIO::NetAccess::download(url, target, window)) { // Ok, that was successful, store the lectureURL and read the file - QFile infile(target); + TQFile infile(target); if ( !infile.open( IO_ReadOnly ) ) return false; // Bugger it... couldn't open it... - QTextStream in( &infile ); + TQTextStream in( &infile ); result = read(in); }; KIO::NetAccess::removeTempFile(target); @@ -55,17 +55,17 @@ bool KTouchKeyboard::load(QWidget * window, const KURL& url) { // ---------------------------------------------------------------------------- // Loads a lecture (in XML format) from file (returns true if successful). -bool KTouchKeyboard::loadXML(QWidget * window, const KURL& url) { +bool KTouchKeyboard::loadXML(TQWidget * window, const KURL& url) { // Ok, first download the contents as usual using the KIO lib // File is only downloaded if not local, otherwise it's just opened - QString target; + TQString target; bool result = false; if (KIO::NetAccess::download(url, target, window)) { // Ok, that was successful, store the lectureURL and read the file - QFile infile(target); + TQFile infile(target); if ( !infile.open( IO_ReadOnly ) ) return false; // Bugger it... couldn't open it... - QDomDocument doc; + TQDomDocument doc; doc.setContent( &infile ); result = read(doc); } @@ -75,13 +75,13 @@ bool KTouchKeyboard::loadXML(QWidget * window, const KURL& url) { // ---------------------------------------------------------------------------- // Saves the lecture data to file (returns true if successful). -bool KTouchKeyboard::saveXML(QWidget * window, const KURL& url) const { +bool KTouchKeyboard::saveXML(TQWidget * window, const KURL& url) const { // create the XML document - QDomDocument doc; + TQDomDocument doc; write(doc); // and save it - QString tmpFile; + TQString tmpFile; KTempFile *temp=0; if (url.isLocalFile()) tmpFile=url.path(); // for local files the path is sufficient @@ -91,14 +91,14 @@ bool KTouchKeyboard::saveXML(QWidget * window, const KURL& url) const { tmpFile=temp->name(); } - QFile outfile(tmpFile); + TQFile outfile(tmpFile); if ( !outfile.open( IO_WriteOnly ) ) { if (temp) delete temp; // kdDebug() << "Error creating lecture file!" << endl; return false; }; - QTextStream out( &outfile ); + TQTextStream out( &outfile ); out << doc.toString(); outfile.close(); // if we have a temporary file, we still need to upload it @@ -111,9 +111,9 @@ bool KTouchKeyboard::saveXML(QWidget * window, const KURL& url) const { // ---------------------------------------------------------------------------- // Loads keyboard data from file, preserved for compatibility -bool KTouchKeyboard::read(QTextStream& in) { - in.setEncoding(QTextStream::UnicodeUTF8); - QString line; +bool KTouchKeyboard::read(TQTextStream& in) { + in.setEncoding(TQTextStream::UnicodeUTF8); + TQString line; clear(); // empty the keyboard // now loop until end of file is reached do { @@ -124,10 +124,10 @@ bool KTouchKeyboard::read(QTextStream& in) { if (line.isNull()) continue; // 'line' should now contain a key specification - QTextStream lineStream(line, IO_ReadOnly); - QString keyType; + TQTextStream lineStream(line, IO_ReadOnly); + TQString keyType; int keyAscII; - QString keyText; + TQString keyText; int x(0), y(0), w(0), h(0); lineStream >> keyType >> keyAscII; if (keyType=="FingerKey") { @@ -174,14 +174,14 @@ bool KTouchKeyboard::read(QTextStream& in) { // ---------------------------------------------------------------------------- // Loads keyboard data from file into an XML document -bool KTouchKeyboard::read(const QDomDocument& doc) { +bool KTouchKeyboard::read(const TQDomDocument& doc) { // clean current data kdDebug() << "Reading new keyboard layout" << endl; m_keys.clear(); m_connectors.clear(); - m_title = QString::null; + m_title = TQString::null; // retrieve the title - QDomNodeList entries = doc.elementsByTagName("Title"); + TQDomNodeList entries = doc.elementsByTagName("Title"); if (entries.count() >= 1) m_title = entries.item(0).firstChild().nodeValue(); else m_title = i18n("untitled keyboard layout"); kdDebug() << "Title: " << m_title << endl; @@ -199,7 +199,7 @@ bool KTouchKeyboard::read(const QDomDocument& doc) { m_language = entries.item(0).firstChild().nodeValue(); // retrieve the key definitions entries = doc.elementsByTagName("KeyDefinitions"); - QDomNode node = entries.item(0).firstChild(); + TQDomNode node = entries.item(0).firstChild(); while (!node.isNull()) { KTouchKey key; if (key.read(node)) @@ -229,46 +229,46 @@ bool KTouchKeyboard::read(const QDomDocument& doc) { // ---------------------------------------------------------------------------- // Saves keyboard data in the XML document -void KTouchKeyboard::write(QDomDocument& doc) const { - QDomElement root = doc.createElement( "KTouchKeyboard" ); +void KTouchKeyboard::write(TQDomDocument& doc) const { + TQDomElement root = doc.createElement( "KTouchKeyboard" ); doc.appendChild(root); // Store title and ensure that the file contains a title! - QDomElement title = doc.createElement("Title"); - QDomText titleText; + TQDomElement title = doc.createElement("Title"); + TQDomText titleText; if (m_title.isEmpty()) titleText = doc.createTextNode( i18n("untitled keyboard layout") ); else titleText = doc.createTextNode(m_title); title.appendChild(titleText); root.appendChild(title); // Store comment if given if (!m_comment.isEmpty()) { - QDomElement e = doc.createElement("Comment"); - QDomText t = doc.createTextNode(m_comment); + TQDomElement e = doc.createElement("Comment"); + TQDomText t = doc.createTextNode(m_comment); e.appendChild(t); root.appendChild(e); } // Store font suggestion if given if (!m_fontSuggestions.isEmpty()) { - QDomElement e = doc.createElement("FontSuggestions"); - QDomText t = doc.createTextNode(m_fontSuggestions); + TQDomElement e = doc.createElement("FontSuggestions"); + TQDomText t = doc.createTextNode(m_fontSuggestions); e.appendChild(t); root.appendChild(e); } // Store language idif given if (!m_language.isEmpty()) { - QDomElement e = doc.createElement("Language"); - QDomText t = doc.createTextNode(m_language); + TQDomElement e = doc.createElement("Language"); + TQDomText t = doc.createTextNode(m_language); e.appendChild(t); root.appendChild(e); } // Store keys - QDomElement keys = doc.createElement("KeyDefinitions"); + TQDomElement keys = doc.createElement("KeyDefinitions"); root.appendChild(keys); - for (QValueVector::const_iterator it=m_keys.begin(); it!=m_keys.end(); ++it) + for (TQValueVector::const_iterator it=m_keys.begin(); it!=m_keys.end(); ++it) it->write(doc, keys); // Store connectors - QDomElement conns = doc.createElement("KeyConnections"); + TQDomElement conns = doc.createElement("KeyConnections"); root.appendChild(conns); - for (QValueVector::const_iterator it=m_connectors.begin(); it!=m_connectors.end(); ++it) + for (TQValueVector::const_iterator it=m_connectors.begin(); it!=m_connectors.end(); ++it) it->write(doc, conns); } // ---------------------------------------------------------------------------- @@ -328,7 +328,7 @@ void KTouchKeyboard::createDefault() { m_title = "Number keypad"; m_comment = "Predefined keyboard layout"; - m_language = QString::null; + m_language = TQString::null; // language does not apply to numbers... that's one of the nice things with math :-) m_fontSuggestions = "Monospace"; m_width = 8*col; @@ -337,7 +337,7 @@ void KTouchKeyboard::createDefault() { // ---------------------------------------------------------------------------- void KTouchKeyboard::updateConnections() { - for (QValueVector::iterator it = m_connectors.begin(); it != m_connectors.end(); ++it) + for (TQValueVector::iterator it = m_connectors.begin(); it != m_connectors.end(); ++it) (*it).updateConnections(m_keys); } // ---------------------------------------------------------------------------- @@ -345,10 +345,10 @@ void KTouchKeyboard::updateConnections() { /* -bool KTouchKeyboard::loadKeyboard(QWidget * window, const KURL& url, QString* errorMsg) { - QString target; +bool KTouchKeyboard::loadKeyboard(TQWidget * window, const KURL& url, TQString* errorMsg) { + TQString target; if (KIO::NetAccess::download(url, target, window)) { - QString msg; + TQString msg; bool result = readKeyboard(target, msg); KIO::NetAccess::removeTempFile(target); if (!result && errorMsg!=NULL) @@ -363,8 +363,8 @@ bool KTouchKeyboard::loadKeyboard(QWidget * window, const KURL& url, QString* er } -void KTouchKeyboard::saveKeyboard(QWidget * window, const KURL& url) { - QString tmpFile; +void KTouchKeyboard::saveKeyboard(TQWidget * window, const KURL& url) { + TQString tmpFile; KTempFile *temp=0; if (url.isLocalFile()) tmpFile=url.path(); // for local files the path is sufficient @@ -373,13 +373,13 @@ void KTouchKeyboard::saveKeyboard(QWidget * window, const KURL& url) { tmpFile=temp->name(); } - QFile outfile(tmpFile); + TQFile outfile(tmpFile); if ( !outfile.open( IO_WriteOnly ) ) { if (temp) delete temp; return; } - QTextStream out( &outfile ); + TQTextStream out( &outfile ); out << "########################################## \n"; out << "# # \n"; out << "# Keyboard layout file for KTouch # \n"; @@ -395,7 +395,7 @@ void KTouchKeyboard::saveKeyboard(QWidget * window, const KURL& url) { case KTouchKey::CONTROL_KEY : out << "ControlKey "; break; default : out << "NormalKey "; break; } - QRect rect=key->frame(); + TQRect rect=key->frame(); out << key->m_keyChar.unicode() << '\t' << key->m_keyText << '\t' << rect.left() << '\t' << rect.top() << '\t' << rect.width() << '\t' << rect.height() << endl; } @@ -407,7 +407,7 @@ void KTouchKeyboard::saveKeyboard(QWidget * window, const KURL& url) { } } -void KTouchKeyboard::applyPreferences(QWidget * window, bool silent) { +void KTouchKeyboard::applyPreferences(TQWidget * window, bool silent) { // let's check whether the keyboard layout has changed if (KTouchConfig().m_currentKeyboardFile!=m_currentLayout) { // if the layout is the number layout just create it and we're done @@ -425,7 +425,7 @@ void KTouchKeyboard::applyPreferences(QWidget * window, bool silent) { m_currentLayout=KTouchConfig().m_currentKeyboardFile; } else { - QString errorMsg; + TQString errorMsg; if (!loadKeyboard(window, KURL::fromPathOrURL( KTouchConfig().m_currentKeyboardFile ), &errorMsg)) { KMessageBox::error( 0, i18n("Error reading the keyboard layout; the default number keypad will " "be created instead. You can choose another keyboard layout in the preferences dialog."), @@ -443,8 +443,8 @@ void KTouchKeyboard::applyPreferences(QWidget * window, bool silent) { } -void KTouchKeyboard::newKey(const QChar& nextChar) { - QPainter painter(this); +void KTouchKeyboard::newKey(const TQChar& nextChar) { + TQPainter painter(this); painter.translate(m_shift, MARGIN); // first clean the markings on all keys for (KTouchKey * key = m_keyList.first(); key; key = m_keyList.next()) { @@ -456,16 +456,16 @@ void KTouchKeyboard::newKey(const QChar& nextChar) { if (Prefs::showAnimation()){ // only do this if we want to show animation. // find the key in the key connector list - QValueList::iterator keyIt = m_connectorList.begin(); + TQValueList::iterator keyIt = m_connectorList.begin(); while (keyIt!=m_connectorList.end() && (*keyIt).m_keyChar!=nextChar) ++keyIt; // if found mark the appropriate keys if (keyIt!=m_connectorList.end()) { - QChar targetChar = (*keyIt).m_targetKeyChar; - QChar fingerChar = (*keyIt).m_fingerKeyChar; - QChar controlChar = (*keyIt).m_controlKeyChar; + TQChar targetChar = (*keyIt).m_targetKeyChar; + TQChar fingerChar = (*keyIt).m_fingerKeyChar; + TQChar controlChar = (*keyIt).m_controlKeyChar; // find the keys in the keylist for (KTouchKey * key = m_keyList.first(); key; key = m_keyList.next()) { - if (key->m_keyChar==QChar(0)) continue; // skip decorative keys + if (key->m_keyChar==TQChar(0)) continue; // skip decorative keys if (key->m_keyChar==targetChar) key->m_isNextKey=true; else if (key->m_keyChar==fingerChar) key->m_isActive=true; else if (key->m_keyChar==controlChar) key->m_isActive=true; @@ -478,8 +478,8 @@ void KTouchKeyboard::newKey(const QChar& nextChar) { } -void KTouchKeyboard::paintEvent(QPaintEvent *) { - QPainter painter(this); +void KTouchKeyboard::paintEvent(TQPaintEvent *) { + TQPainter painter(this); painter.translate(m_shift, MARGIN); // just print all visible keys for (KTouchKey * key = m_keyList.first(); key; key = m_keyList.next()) @@ -487,7 +487,7 @@ void KTouchKeyboard::paintEvent(QPaintEvent *) { } -void KTouchKeyboard::resizeEvent(QResizeEvent *) { +void KTouchKeyboard::resizeEvent(TQResizeEvent *) { double hScale = static_cast(width()-2*MARGIN)/m_keyboardWidth; double vScale = static_cast(height()-2*MARGIN)/m_keyboardHeight; double scale = std::min(hScale, vScale); @@ -554,15 +554,15 @@ void KTouchKeyboard::createDefaultKeyboard() { } -bool KTouchKeyboard::readKeyboard(const QString& fileName, QString& errorMsg) { - QFile infile(fileName); +bool KTouchKeyboard::readKeyboard(const TQString& fileName, TQString& errorMsg) { + TQFile infile(fileName); if ( !infile.open( IO_ReadOnly ) ) { errorMsg = i18n("Could not open file."); return false; } - QTextStream in( &infile ); - in.setEncoding(QTextStream::UnicodeUTF8); - QString line; + TQTextStream in( &infile ); + in.setEncoding(TQTextStream::UnicodeUTF8); + TQString line; m_keyList.clear(); // empty the keyboard m_connectorList.clear(); // clear the connections m_keyboardWidth=0; @@ -576,10 +576,10 @@ bool KTouchKeyboard::readKeyboard(const QString& fileName, QString& errorMsg) { if (line.isNull()) continue; // 'line' should now contain a key specification - QTextStream lineStream(line, IO_ReadOnly); - QString keyType; + TQTextStream lineStream(line, IO_ReadOnly); + TQString keyType; int keyAscII; - QString keyText; + TQString keyText; int x(0), y(0), w(0), h(0); lineStream >> keyType >> keyAscII; if (keyType=="FingerKey") { @@ -621,10 +621,10 @@ bool KTouchKeyboard::readKeyboard(const QString& fileName, QString& errorMsg) { void KTouchKeyboard::updateColours() { // loop over all key connections - for (QValueList::iterator it = m_connectorList.begin(); it!=m_connectorList.end(); ++it) { - QChar fingerChar = (*it).m_fingerKeyChar; - if (fingerChar == QChar(0)) continue; - QChar targetChar = (*it).m_targetKeyChar; + for (TQValueList::iterator it = m_connectorList.begin(); it!=m_connectorList.end(); ++it) { + TQChar fingerChar = (*it).m_fingerKeyChar; + if (fingerChar == TQChar(0)) continue; + TQChar targetChar = (*it).m_targetKeyChar; KTouchKey * self=NULL; KTouchKey * colorSource=NULL; // loop over all keys to find the key pointers diff --git a/ktouch/src/ktouchkeyboard.h b/ktouch/src/ktouchkeyboard.h index 88949537..5334c49b 100644 --- a/ktouch/src/ktouchkeyboard.h +++ b/ktouch/src/ktouchkeyboard.h @@ -17,7 +17,7 @@ #include #endif -#include +#include #include "ktouchkeyconnector.h" #include "ktouchkey.h" @@ -33,18 +33,18 @@ class KTouchKeyboard { /// Clears the keyboard (resets all data) void clear(); /// Loads a keyboard layout (old format) from file (returns true if successful). - bool load(QWidget * window, const KURL& url); + bool load(TQWidget * window, const KURL& url); /// Loads a lecture (in XML format) from file (returns true if successful). - bool loadXML(QWidget * window, const KURL& url); + bool loadXML(TQWidget * window, const KURL& url); /// Saves the lecture data to file (returns true if successful). - bool saveXML(QWidget * window, const KURL& url) const; + bool saveXML(TQWidget * window, const KURL& url) const; /// Creates the default number keyboard. void createDefault(); /// Updates the indices in the KTouchKeyConnector objects for faster access. void updateConnections(); - QValueVector m_keys; ///< Vector with key definitions. - QValueVector m_connectors; ///< Vector with connectivity data. + TQValueVector m_keys; ///< Vector with key definitions. + TQValueVector m_connectors; ///< Vector with connectivity data. QString m_title; ///< Title of the keyboard (to appear in the menu). QString m_comment; ///< Comments about the creator of the keyboard layout. @@ -57,11 +57,11 @@ class KTouchKeyboard { private: /// Loads keyboard data from file - bool read(QTextStream& in); + bool read(TQTextStream& in); /// Loads keyboard data from file into an XML document - bool read(const QDomDocument& doc); + bool read(const TQDomDocument& doc); /// Saves keyboard data in the XML document - void write(QDomDocument& doc) const; + void write(TQDomDocument& doc) const; }; #endif // KTOUCHKEYBOARD_H diff --git a/ktouch/src/ktouchkeyboardeditor.cpp b/ktouch/src/ktouchkeyboardeditor.cpp index c3aa93d2..54f026bb 100644 --- a/ktouch/src/ktouchkeyboardeditor.cpp +++ b/ktouch/src/ktouchkeyboardeditor.cpp @@ -13,8 +13,8 @@ #include "ktouchkeyboardeditor.h" #include "ktouchkeyboardeditor.moc" -#include -#include +#include +#include #include #include @@ -34,7 +34,7 @@ // ***** Public functions *** // ************************** -KTouchKeyboardEditor::KTouchKeyboardEditor(QWidget* parent, const char* name, bool modal, WFlags fl) +KTouchKeyboardEditor::KTouchKeyboardEditor(TQWidget* parent, const char* name, bool modal, WFlags fl) : KTouchKeyboardEditorDlg(parent,name, modal,fl) { } @@ -43,7 +43,7 @@ KTouchKeyboardEditor::KTouchKeyboardEditor(QWidget* parent, const char* name, bo bool KTouchKeyboardEditor::startEditor(const KURL& url) { // call open request dialog and load a keyboard and start the dialogs event loop if // the user did not cancel the open request dialog - if (openKeyboardFile(url)==QDialog::Accepted) { + if (openKeyboardFile(url)==TQDialog::Accepted) { exec(); return true; } @@ -59,8 +59,8 @@ bool KTouchKeyboardEditor::startEditor(const KURL& url) { void KTouchKeyboardEditor::fontBtnClicked() { //kdDebug() << "Fontbutton clicked" << endl; - QFont f; - if (KFontDialog::getFont(f, false, this, true)==QDialog::Accepted) { + TQFont f; + if (KFontDialog::getFont(f, false, this, true)==TQDialog::Accepted) { m_keyboard.m_fontSuggestions = f.toString(); // update font and keyboard display titleEdit->setFont(f); @@ -89,7 +89,7 @@ void KTouchKeyboardEditor::saveBtnClicked() { // ----------------------------------------------------------------------------- void KTouchKeyboardEditor::saveAsBtnClicked() { - QString tmp = KFileDialog::getSaveFileName(QString::null, + TQString tmp = KFileDialog::getSaveFileName(TQString::null, i18n("*.keyboard.xml|KTouch Keyboard Files (*.keyboard.xml)\n*.*|All Files"), this, i18n("Save Keyboard Layout") ); if (!tmp.isEmpty()) { transfer_from_dialog(); @@ -116,13 +116,13 @@ void KTouchKeyboardEditor::removeBtnClicked() { // ----------------------------------------------------------------------------- /// Called when the selection in the key list box has changed -void KTouchKeyboardEditor::keySelectionChanged(QListBoxItem * item) { +void KTouchKeyboardEditor::keySelectionChanged(TQListBoxItem * item) { } // ----------------------------------------------------------------------------- -void KTouchKeyboardEditor::paintEvent(QPaintEvent *) { +void KTouchKeyboardEditor::paintEvent(TQPaintEvent *) { } // ----------------------------------------------------------------------------- @@ -143,7 +143,7 @@ void KTouchKeyboardEditor::transfer_to_dialog() { languageEdit->setText(m_keyboard.m_language); kdDebug() << "Setting font '"<< m_keyboard.m_fontSuggestions <<"'" << endl; if (!m_keyboard.m_fontSuggestions.isEmpty()) { - QFont f; + TQFont f; f.fromString(m_keyboard.m_fontSuggestions); titleEdit->setFont(f); keyboardCommentEdit->setFont(f); @@ -151,15 +151,15 @@ void KTouchKeyboardEditor::transfer_to_dialog() { } kdDebug() << "Adding key definitions to key list" << endl; keyListBox->clear(); - QValueVector::iterator it; + TQValueVector::iterator it; unsigned int min_x = 100000; unsigned int max_x = 0; unsigned int min_y = 100000; unsigned int max_y = 0; for( it = m_keyboard.m_keys.begin(); it != m_keyboard.m_keys.end(); ++it ) { switch (it->m_type) { - case KTouchKey::NORMAL : keyListBox->insertItem("N '" + QString(it->m_primaryChar) + "'"); break; - case KTouchKey::FINGER : keyListBox->insertItem("F '" + QString(it->m_primaryChar) + "'"); break; + case KTouchKey::NORMAL : keyListBox->insertItem("N '" + TQString(it->m_primaryChar) + "'"); break; + case KTouchKey::FINGER : keyListBox->insertItem("F '" + TQString(it->m_primaryChar) + "'"); break; default : keyListBox->insertItem("O '" + it->m_otherKeyText + "'"); break; } min_x = std::min(min_x, it->m_x); @@ -193,7 +193,7 @@ int KTouchKeyboardEditor::openKeyboardFile(const KURL& url) { i18n("Create new keyboard!"), url, KTouchPtr->lectureFiles(), i18n("")); - if (result == QDialog::Accepted) { + if (result == TQDialog::Accepted) { // Ok, user confirmed the dialog, now lets get the url m_currentURL = new_url; // Try to load the keyboard, if that fails, we create a new keyboard instead @@ -201,7 +201,7 @@ int KTouchKeyboardEditor::openKeyboardFile(const KURL& url) { !m_keyboard.load(this, m_currentURL) && !m_keyboard.loadXML(this, m_currentURL)) { KMessageBox::sorry(this, i18n("Could not open the keyboard file, creating a new one instead!")); - m_currentURL = QString::null; // new keyboards haven't got a URL + m_currentURL = TQString::null; // new keyboards haven't got a URL m_keyboard.clear(); } // If we have no URL, we create a new keyboard - can happen if either the user @@ -213,9 +213,9 @@ int KTouchKeyboardEditor::openKeyboardFile(const KURL& url) { else setModified(false); // newly read keyboards are not modified in the begin transfer_to_dialog(); // Update our editor with the keyboard data - return QDialog::Accepted; + return TQDialog::Accepted; } - else return QDialog::Rejected; + else return TQDialog::Rejected; } // ----------------------------------------------------------------------------- @@ -234,7 +234,7 @@ bool KTouchKeyboardEditor::saveModified() { if (!m_modified) return true; // ok, ask the user to save the changes int result = KMessageBox::questionYesNoCancel(this, - i18n("The keyboard has been changed. Do you want to save the changes?"),QString::null,KStdGuiItem::save(),KStdGuiItem::discard()); + i18n("The keyboard has been changed. Do you want to save the changes?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::discard()); if (result == KMessageBox::Cancel) return false; // User aborted if (result == KMessageBox::Yes) saveBtnClicked(); // if successfully saved the modified flag will be resetted in the saveBtnClicked() function diff --git a/ktouch/src/ktouchkeyboardeditor.h b/ktouch/src/ktouchkeyboardeditor.h index 2c42a3a9..48c6e4f6 100644 --- a/ktouch/src/ktouchkeyboardeditor.h +++ b/ktouch/src/ktouchkeyboardeditor.h @@ -44,7 +44,7 @@ class KTouchKeyboardEditor : public KTouchKeyboardEditorDlg { public: /// Constructor. - KTouchKeyboardEditor(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + KTouchKeyboardEditor(TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); /// Default destructor. ~KTouchKeyboardEditor() {} /// Shows and executes the dialog (argument is the url to the default or @@ -72,7 +72,7 @@ class KTouchKeyboardEditor : public KTouchKeyboardEditorDlg { /// Called when the "Remove" button was clicked virtual void removeBtnClicked(); /// Called when the selection in the key list box has changed - virtual void keySelectionChanged(QListBoxItem * item); + virtual void keySelectionChanged(TQListBoxItem * item); /// Will be called whenever some changes are made. void setModified() { setModified(true); } @@ -83,7 +83,7 @@ class KTouchKeyboardEditor : public KTouchKeyboardEditorDlg { protected: /// Draws the keyboard in the keyboardPreviewLabel. - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); private: /// Transfers data from the keyboard object to the dialog. diff --git a/ktouch/src/ktouchkeyboardwidget.cpp b/ktouch/src/ktouchkeyboardwidget.cpp index 6e92c99d..99cc63cc 100644 --- a/ktouch/src/ktouchkeyboardwidget.cpp +++ b/ktouch/src/ktouchkeyboardwidget.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -31,12 +31,12 @@ // the margin between keyboard and widget frame const int MARGIN = 10; -QMap KTouchKeyboardWidget::m_keyCharMap; +TQMap KTouchKeyboardWidget::m_keyCharMap; // -------------------------------------------------------------------------- -KTouchKeyboardWidget::KTouchKeyboardWidget(QWidget *parent) - : QWidget(parent), m_keyboardWidth(100), m_keyboardHeight(60), m_currentLayout(""), +KTouchKeyboardWidget::KTouchKeyboardWidget(TQWidget *parent) + : TQWidget(parent), m_keyboardWidth(100), m_keyboardHeight(60), m_currentLayout(""), m_hideKeyboard(false) { setMinimumHeight(100); // when it's smaller you won't see anything @@ -44,10 +44,10 @@ KTouchKeyboardWidget::KTouchKeyboardWidget(QWidget *parent) } -bool KTouchKeyboardWidget::loadKeyboard(QWidget * window, const KURL& url, QString* errorMsg) { - QString target; +bool KTouchKeyboardWidget::loadKeyboard(TQWidget * window, const KURL& url, TQString* errorMsg) { + TQString target; if (KIO::NetAccess::download(url, target, window)) { - QString msg; + TQString msg; bool result = readKeyboard(target, msg); KIO::NetAccess::removeTempFile(target); if (!result && errorMsg!=NULL) @@ -62,8 +62,8 @@ bool KTouchKeyboardWidget::loadKeyboard(QWidget * window, const KURL& url, QStri } -void KTouchKeyboardWidget::saveKeyboard(QWidget * window, const KURL& url) { - QString tmpFile; +void KTouchKeyboardWidget::saveKeyboard(TQWidget * window, const KURL& url) { + TQString tmpFile; KTempFile *temp=0; if (url.isLocalFile()) tmpFile=url.path(); // for local files the path is sufficient @@ -72,13 +72,13 @@ void KTouchKeyboardWidget::saveKeyboard(QWidget * window, const KURL& url) { tmpFile=temp->name(); } - QFile outfile(tmpFile); + TQFile outfile(tmpFile); if ( !outfile.open( IO_WriteOnly ) ) { if (temp) delete temp; return; } - QTextStream out( &outfile ); + TQTextStream out( &outfile ); out << "########################################## \n"; out << "# # \n"; out << "# Keyboard layout file for KTouch # \n"; @@ -94,7 +94,7 @@ void KTouchKeyboardWidget::saveKeyboard(QWidget * window, const KURL& url) { case KTouchBaseKey::CONTROL_KEY : out << "ControlKey "; break; default : out << "NormalKey "; break; } - QRect rect=key->frame(); + TQRect rect=key->frame(); out << key->m_keyChar.unicode() << '\t' << key->m_keyText << '\t' << rect.left() << '\t' << rect.top() << '\t' << rect.width() << '\t' << rect.height() << endl; } @@ -106,7 +106,7 @@ void KTouchKeyboardWidget::saveKeyboard(QWidget * window, const KURL& url) { } } -void KTouchKeyboardWidget::applyPreferences(QWidget * window, bool silent) { +void KTouchKeyboardWidget::applyPreferences(TQWidget * window, bool silent) { m_hideKeyboard = Prefs::hideKeyboard(); if (m_hideKeyboard) setMaximumHeight(100); @@ -130,7 +130,7 @@ void KTouchKeyboardWidget::applyPreferences(QWidget * window, bool silent) { m_currentLayout=Prefs::currentKeyboardFile(); } else { - QString errorMsg; + TQString errorMsg; if (!loadKeyboard(window, KURL::fromPathOrURL( Prefs::currentKeyboardFile() ), &errorMsg)) { KMessageBox::error( 0, i18n("Error reading the keyboard layout; the default number keypad will " "be created instead. You can choose another keyboard layout in the preferences dialog."), @@ -155,9 +155,9 @@ void KTouchKeyboardWidget::applyPreferences(QWidget * window, bool silent) { } -void KTouchKeyboardWidget::newKey(const QChar& nextChar) { +void KTouchKeyboardWidget::newKey(const TQChar& nextChar) { if (m_hideKeyboard) return; - QPainter painter(this); + TQPainter painter(this); painter.translate(m_shift, MARGIN); // first clean the markings on all keys for (KTouchBaseKey * key = m_keyList.first(); key; key = m_keyList.next()) { @@ -169,16 +169,16 @@ void KTouchKeyboardWidget::newKey(const QChar& nextChar) { if (Prefs::showAnimation()){ // only do this if we want to show animation. // find the key in the key connector list - QValueList::iterator keyIt = m_connectorList.begin(); + TQValueList::iterator keyIt = m_connectorList.begin(); while (keyIt!=m_connectorList.end() && (*keyIt).m_keyChar!=nextChar) ++keyIt; // if found mark the appropriate keys if (keyIt!=m_connectorList.end()) { - QChar targetChar = (*keyIt).m_targetKeyChar; - QChar fingerChar = (*keyIt).m_fingerKeyChar; - QChar controlChar = (*keyIt).m_controlKeyChar; + TQChar targetChar = (*keyIt).m_targetKeyChar; + TQChar fingerChar = (*keyIt).m_fingerKeyChar; + TQChar controlChar = (*keyIt).m_controlKeyChar; // find the keys in the keylist for (KTouchBaseKey * key = m_keyList.first(); key; key = m_keyList.next()) { - if (key->m_keyChar==QChar(0)) continue; // skip decorative keys + if (key->m_keyChar==TQChar(0)) continue; // skip decorative keys if (key->m_keyChar==targetChar) key->m_isNextKey=true; else if (key->m_keyChar==fingerChar) key->m_isActive=true; else if (key->m_keyChar==controlChar) key->m_isActive=true; @@ -191,9 +191,9 @@ void KTouchKeyboardWidget::newKey(const QChar& nextChar) { } -void KTouchKeyboardWidget::paintEvent(QPaintEvent *) { +void KTouchKeyboardWidget::paintEvent(TQPaintEvent *) { if (m_hideKeyboard) return; - QPainter p(this); + TQPainter p(this); p.translate(m_shift, MARGIN); // just print all visible keys for (KTouchBaseKey * key = m_keyList.first(); key; key = m_keyList.next()) @@ -202,9 +202,9 @@ void KTouchKeyboardWidget::paintEvent(QPaintEvent *) { /* // TODO : later const KTouchColorScheme& colorScheme = KTouchColorScheme::m_colorSchemes[Prefs::colorScheme()]; - for (QValueVector::iterator it = m_keys.begin(); it != m_keys.end(); ++it) { + for (TQValueVector::iterator it = m_keys.begin(); it != m_keys.end(); ++it) { // determine colors - QColor textColor; + TQColor textColor; if (it->m_type == KTouchKey::NORMAL || it->m_type == KTouchKey::FINGER) { if (is_next_key) { // mark the key as "next" @@ -229,14 +229,14 @@ void KTouchKeyboardWidget::paintEvent(QPaintEvent *) { p.setFont( m_font ); p.drawText(it->m_xS, it->m_yS, it->m_wS, it->m_hS, - QPainter::AlignCenter, m_keyText); + TQPainter::AlignCenter, m_keyText); } */ // TODO : later copy pre-rendered and pre-scaled characters to screen } -void KTouchKeyboardWidget::resizeEvent(QResizeEvent *) { +void KTouchKeyboardWidget::resizeEvent(TQResizeEvent *) { // kdDebug() << "[KTouchKeyboard::resizeEvent] Window = " << width() << "x" << height() << endl; // kdDebug() << "[KTouchKeyboard::resizeEvent] Keyboard = " << m_keyboardWidth << "x" << m_keyboardHeight << endl; double hScale = static_cast(width()-2*MARGIN)/m_keyboardWidth; @@ -246,7 +246,7 @@ void KTouchKeyboardWidget::resizeEvent(QResizeEvent *) { m_shift = (width() - static_cast(m_keyboardWidth*scale))/2; for (KTouchBaseKey * key = m_keyList.first(); key; key = m_keyList.next()) key->resize(scale); // resize all keys - for (QValueVector::iterator it = m_keys.begin(); it != m_keys.end(); ++it) { + for (TQValueVector::iterator it = m_keys.begin(); it != m_keys.end(); ++it) { it->resize(scale); // resize all keys } update(); // and finally redraw the keyboard @@ -318,7 +318,7 @@ void KTouchKeyboardWidget::createDefaultKeyboard() { row = h+sp; m_keys.clear(); - m_keys.append( KTouchKey( 0, 0, w, h, QString("Num")) ); // 0 + m_keys.append( KTouchKey( 0, 0, w, h, TQString("Num")) ); // 0 m_keys.append( KTouchKey(KTouchKey::NORMAL, col, 0, w, h, '/') ); // 1 m_keys.append( KTouchKey(KTouchKey::NORMAL, 2*col, 0, w, h, '*') ); // 2 m_keys.append( KTouchKey(KTouchKey::NORMAL, 3*col, 0, w, h, '-') ); // 3 @@ -357,25 +357,25 @@ void KTouchKeyboardWidget::createDefaultKeyboard() { m_keyConnections.append( KTouchKeyConnector('3', 13, 9, 0) ); m_keyConnections.append( KTouchKeyConnector('0', 14, 7, 0) ); m_keyConnections.append( KTouchKeyConnector('.', 15, 9, 0) ); - m_keyConnections.append( KTouchKeyConnector(QChar(13), 16, 10, 0) ); - m_keyConnections.append( KTouchKeyConnector(QChar(8), 17, 0, 0) ); + m_keyConnections.append( KTouchKeyConnector(TQChar(13), 16, 10, 0) ); + m_keyConnections.append( KTouchKeyConnector(TQChar(8), 17, 0, 0) ); } -bool KTouchKeyboardWidget::readKeyboard(const QString& fileName, QString& errorMsg) { - QFile infile(fileName); +bool KTouchKeyboardWidget::readKeyboard(const TQString& fileName, TQString& errorMsg) { + TQFile infile(fileName); if ( !infile.open( IO_ReadOnly ) ) { errorMsg = i18n("Could not open file."); return false; } - QTextStream in( &infile ); - in.setEncoding(QTextStream::UnicodeUTF8); - QString line; + TQTextStream in( &infile ); + in.setEncoding(TQTextStream::UnicodeUTF8); + TQString line; m_keyList.clear(); // empty the keyboard m_connectorList.clear(); // clear the connections m_keyboardWidth=0; m_keyboardHeight=0; - std::set keys; + std::set keys; // now loop until end of file is reached do { // skip all empty lines or lines containing a comment (starting with '#') @@ -385,10 +385,10 @@ bool KTouchKeyboardWidget::readKeyboard(const QString& fileName, QString& errorM if (line.isNull()) continue; // 'line' should now contain a key specification - QTextStream lineStream(line, IO_ReadOnly); - QString keyType; + TQTextStream lineStream(line, IO_ReadOnly); + TQString keyType; int keyAscII; - QString keyText; + TQString keyText; int x(0), y(0), w(0), h(0); lineStream >> keyType >> keyAscII; if (keyType=="FingerKey") { @@ -397,7 +397,7 @@ bool KTouchKeyboardWidget::readKeyboard(const QString& fileName, QString& errorM w=h=8; // default values for old keyboard files m_keyList.append( new KTouchFingerKey(keyAscII, keyText, x+1, y+1, w, h) ); m_connectorList.append( KTouchKeyConnection(keyAscII, keyAscII, 0, 0) ); -// kdDebug() << "read : F : unicode = " << keyAscII << " char = " << QChar(keyAscII) << endl; +// kdDebug() << "read : F : unicode = " << keyAscII << " char = " << TQChar(keyAscII) << endl; } else if (keyType=="ControlKey") { lineStream >> keyText >> x >> y >> w >> h; @@ -412,12 +412,12 @@ bool KTouchKeyboardWidget::readKeyboard(const QString& fileName, QString& errorM // retrieve the finger key with the matching char m_keyList.append( new KTouchNormalKey(keyAscII, keyText, x+1, y+1, w, h) ); m_connectorList.append( KTouchKeyConnection(keyAscII, keyAscII, fingerCharCode, 0) ); -// kdDebug() << "read : N : unicode = " << keyAscII << " char = " << QChar(keyAscII) << endl; +// kdDebug() << "read : N : unicode = " << keyAscII << " char = " << TQChar(keyAscII) << endl; } else if (keyType=="HiddenKey") { int targetChar, fingerChar, controlChar; lineStream >> targetChar >> fingerChar >> controlChar; m_connectorList.append( KTouchKeyConnection(keyAscII, targetChar, fingerChar, controlChar) ); -// kdDebug() << "read : H : unicode = " << keyAscII << " char = " << QChar(keyAscII) << " target = " << targetChar << " finger = " << fingerChar << " control = " << controlChar << endl; +// kdDebug() << "read : H : unicode = " << keyAscII << " char = " << TQChar(keyAscII) << " target = " << targetChar << " finger = " << fingerChar << " control = " << controlChar << endl; } else { @@ -438,7 +438,7 @@ bool KTouchKeyboardWidget::readKeyboard(const QString& fileName, QString& errorM m_keyboardHeight = std::max(m_keyboardHeight, y+h); } while (!in.atEnd() && !line.isNull()); // kdDebug() << "showing all unicode numbers in this file" << endl; -/* for (std::set::iterator it = keys.begin(); it != keys.end(); ++it) +/* for (std::set::iterator it = keys.begin(); it != keys.end(); ++it) kdDebug() << *it << endl; */ // kdDebug() << "num chars = " << keys.size() << endl; @@ -454,11 +454,11 @@ void KTouchKeyboardWidget::updateColours() { // old functionality : loop over all key connections m_keyCharMap.clear(); unsigned int counter = 0; - for (QValueList::iterator it = m_connectorList.begin(); it!=m_connectorList.end(); ++it) { + for (TQValueList::iterator it = m_connectorList.begin(); it!=m_connectorList.end(); ++it) { // store finger and target characters - QChar fingerChar = (*it).m_fingerKeyChar; - QChar targetChar = (*it).m_targetKeyChar; // this is the _base_ character of the key that needs to be highlighted - QChar ch = (*it).m_keyChar; + TQChar fingerChar = (*it).m_fingerKeyChar; + TQChar targetChar = (*it).m_targetKeyChar; // this is the _base_ character of the key that needs to be highlighted + TQChar ch = (*it).m_keyChar; /* kdDebug() << "Key #"<<++counter<<": " << ch << "(" << ch.unicode() << ") " << "target = " << targetChar << "(" << targetChar.unicode() << ") " @@ -466,7 +466,7 @@ void KTouchKeyboardWidget::updateColours() { */ m_keyCharMap[ch] = -1; - if (fingerChar == QChar(0)) { + if (fingerChar == TQChar(0)) { // kdDebug() << "skipped char = " << targetChar << endl; continue; // skips keys that don't have finger keys assigned } @@ -514,7 +514,7 @@ void KTouchKeyboardWidget::updateColours() { for (unsigned int i=0; i::iterator it = m_keyConnections.begin(); + for (TQValueVector::iterator it = m_keyConnections.begin(); it!=m_keyConnections.end(); ++it) { if (it->m_targetKeyIndex == -1) continue; diff --git a/ktouch/src/ktouchkeyboardwidget.h b/ktouch/src/ktouchkeyboardwidget.h index 9ba71d8f..047a7575 100644 --- a/ktouch/src/ktouchkeyboardwidget.h +++ b/ktouch/src/ktouchkeyboardwidget.h @@ -17,9 +17,9 @@ #include #endif -#include -#include -#include +#include +#include +#include #include "ktouchkeys.h" #include "ktouchkey.h" // new class @@ -39,58 +39,58 @@ class KURL; * and the newKey() slot is called the state changes (and thus the * activated keys and finger key animations etc.) */ -class KTouchKeyboardWidget : public QWidget { +class KTouchKeyboardWidget : public TQWidget { Q_OBJECT public: /// Constructor - KTouchKeyboardWidget(QWidget *parent); + KTouchKeyboardWidget(TQWidget *parent); /// Reads a keyboard layout from the given URL. /// The function returns 'true' when the reading was successful or 'false' if not. In this /// case the optional parameter errorMsg contains the error message. - bool loadKeyboard(QWidget * window, const KURL& url, QString* errorMsg=NULL); + bool loadKeyboard(TQWidget * window, const KURL& url, TQString* errorMsg=NULL); /// Saves the keyboard layout to the URL. - void saveKeyboard(QWidget * window, const KURL& url); + void saveKeyboard(TQWidget * window, const KURL& url); /// Applies preferences to the keyboard layout and the keys. /// This means that the layout is basically recreated and if the layout type/language /// changed it will be reloaded. - void applyPreferences(QWidget * window, bool silent); + void applyPreferences(TQWidget * window, bool silent); public slots: /// This function displays the next key (or key combination) the user has to press. - void newKey(const QChar& nextChar); + void newKey(const TQChar& nextChar); protected: /// Draws the keyboard. - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); /// Resizes (recalculates m_shift and m_scale) and redraws the keyboard. - void resizeEvent(QResizeEvent *); + void resizeEvent(TQResizeEvent *); private: /// Does what the name says (create a default keyboard which is a number keypad). /// This function is needed in case there no keyboard file could be found. void createDefaultKeyboard(); /// Does the actual reading. - bool readKeyboard(const QString& fileName, QString& errorMsg); + bool readKeyboard(const TQString& fileName, TQString& errorMsg); /// Assigns the background colours to the normal keys, which have a finger key assigned. void updateColours(); // *** new data storage classes *** - QValueVector m_keys; ///< The geometrical key data. - QValueVector m_keyConnections; ///< Contains the character - key associations. - QMap m_keyMap; ///< Links target keys with finger keys: m_keyMap[target_key] = finger_key - QMap m_colorMap; ///< Links finger keys with color indices: m_colorMap[finger_key] = color_index in color scheme + TQValueVector m_keys; ///< The geometrical key data. + TQValueVector m_keyConnections; ///< Contains the character - key associations. + TQMap m_keyMap; ///< Links target keys with finger keys: m_keyMap[target_key] = finger_key + TQMap m_colorMap; ///< Links finger keys with color indices: m_colorMap[finger_key] = color_index in color scheme // *** old data storage classes *** - QPtrList m_keyList; ///< The pointer list with base class pointers to the keys. - QValueList m_connectorList; ///< Contains the character - key associations. + TQPtrList m_keyList; ///< The pointer list with base class pointers to the keys. + TQValueList m_connectorList; ///< Contains the character - key associations. - static QMap m_keyCharMap; ///< Links target keys with finger keys: m_keyCharMap[target_key_char] = color_index + static TQMap m_keyCharMap; ///< Links target keys with finger keys: m_keyCharMap[target_key_char] = color_index int m_keyboardWidth; ///< The width of the keyboard (maximum of the sums of all keywidths in each line). int m_keyboardHeight; ///< The height of the keyboard (sum of all key row heights). double m_shift; ///< The horizontal shift for the keyboard. - QString m_currentLayout; ///< The name of the currently used layout. - QChar m_nextKey; ///< The next to be pressed character. + TQString m_currentLayout; ///< The name of the currently used layout. + TQChar m_nextKey; ///< The next to be pressed character. bool m_hideKeyboard; ///< If true, the keyboard won't be shown. }; diff --git a/ktouch/src/ktouchkeyconnector.cpp b/ktouch/src/ktouchkeyconnector.cpp index 2546400f..6a51764f 100644 --- a/ktouch/src/ktouchkeyconnector.cpp +++ b/ktouch/src/ktouchkeyconnector.cpp @@ -13,14 +13,14 @@ #include "ktouchkeyconnector.h" // Reads the key connector data from the DomElement -bool KTouchKeyConnector::read(QDomNode node) { -/* QDomNode newChars = in.namedItem("NewCharacters"); +bool KTouchKeyConnector::read(TQDomNode node) { +/* TQDomNode newChars = in.namedItem("NewCharacters"); if (newChars.isNull()) m_newChars = i18n("basically all characters on the keyboard","abcdefghijklmnopqrstuvwxyz"); else m_newChars = newChars.firstChild().nodeValue(); - QDomNode levelComment = in.namedItem("LevelComment"); + TQDomNode levelComment = in.namedItem("LevelComment"); if (!levelComment.isNull()) m_comment = levelComment.firstChild().nodeValue(); m_lines.clear(); - QDomNode line = in.namedItem("Line"); + TQDomNode line = in.namedItem("Line"); while ( !line.isNull() ) { m_lines.push_back( line.firstChild().nodeValue() ); line = line.nextSibling(); @@ -34,13 +34,13 @@ bool KTouchKeyConnector::read(QDomNode node) { } // Creates a new DomElement, writes the key connector data into it and appends it to the root object. -void KTouchKeyConnector::write(QDomDocument& doc, QDomElement& root) const { -/* QDomElement element = doc.createElement("KeyConnector"); - QDomText textnode = doc.createTextNode(QString(m_keyChar)); +void KTouchKeyConnector::write(TQDomDocument& doc, TQDomElement& root) const { +/* TQDomElement element = doc.createElement("KeyConnector"); + TQDomText textnode = doc.createTextNode(TQString(m_keyChar)); element.appendChild(textnode); - element.setAttribute("TargetKeyChar", QString(m_targetKeyChar)); - if (m_fingerKeyChar != QChar(0)) - element.setAttribute("FingerKeyChar", QString(m_fingerKeyChar)); + element.setAttribute("TargetKeyChar", TQString(m_targetKeyChar)); + if (m_fingerKeyChar != TQChar(0)) + element.setAttribute("FingerKeyChar", TQString(m_fingerKeyChar)); if (!m_controlKeyId.isEmpty()) element.setAttribute("ControlKeyId", m_controlKeyId); root.appendChild(element); diff --git a/ktouch/src/ktouchkeyconnector.h b/ktouch/src/ktouchkeyconnector.h index a8d20dea..12793465 100644 --- a/ktouch/src/ktouchkeyconnector.h +++ b/ktouch/src/ktouchkeyconnector.h @@ -17,8 +17,8 @@ #include #endif -#include -#include +#include +#include #include "ktouchkey.h" /// The KTouchKeyConnector class contains the information about the character that has to @@ -28,18 +28,18 @@ class KTouchKeyConnector { public: KTouchKeyConnector() {} /// Constructor - KTouchKeyConnector(QChar keyChar, unsigned int target_key, unsigned int finger_key, + KTouchKeyConnector(TQChar keyChar, unsigned int target_key, unsigned int finger_key, unsigned int modifier_key) : m_keyChar(keyChar), m_targetKeyIndex(target_key), m_fingerKeyIndex(finger_key), m_modifierKeyIndex(modifier_key) {} /// Reads the key connector data from the DomElement - bool read(QDomNode node); + bool read(TQDomNode node); /// Creates a new DomElement, writes the key connector data into it and appends it to the root object. - void write(QDomDocument& doc, QDomElement& root) const; + void write(TQDomDocument& doc, TQDomElement& root) const; - QChar m_keyChar; ///< This is the character that has to be pressed to access this key. + TQChar m_keyChar; ///< This is the character that has to be pressed to access this key. int m_targetKeyIndex; ///< Index of the target key (-1 if none). int m_fingerKeyIndex; ///< Index of the finger key (-1 if none). int m_modifierKeyIndex; ///< Index of the modifier key (-1 if none). diff --git a/ktouch/src/ktouchkeys.cpp b/ktouch/src/ktouchkeys.cpp index c254682b..83efa572 100644 --- a/ktouch/src/ktouchkeys.cpp +++ b/ktouch/src/ktouchkeys.cpp @@ -25,7 +25,7 @@ int KTouchFingerKey::m_fingerKeyCount = 0; // ***** Implementation of class KTouchKey **** -void KTouchBaseKey::paint(QPainter& p) const { +void KTouchBaseKey::paint(TQPainter& p) const { // We simply paint the key using the current brush and pen, so the derived classes // will have to care about that p.fillRect(m_xS, m_yS, m_wS, m_hS, p.brush()); @@ -47,16 +47,16 @@ void KTouchBaseKey::resize(double scale) { // **** Implementation of class KTouchNormalKey **** -KTouchNormalKey::KTouchNormalKey(const QChar& keyChar, const QString& keyText, int x, int y, int w, int h) +KTouchNormalKey::KTouchNormalKey(const TQChar& keyChar, const TQString& keyText, int x, int y, int w, int h) : KTouchBaseKey(keyChar, keyText, x, y, w, h), m_colorIndex(0) { m_type = NORMAL_KEY; m_font_scale =2; } -void KTouchNormalKey::paint(QPainter& p) const { +void KTouchNormalKey::paint(TQPainter& p) const { const KTouchColorScheme& colorScheme = KTouchColorScheme::m_colorSchemes[Prefs::currentColorScheme()]; - QColor textColor; + TQColor textColor; if (m_isNextKey) { // mark the key as "next" p.setBrush( colorScheme.m_backgroundH ); @@ -72,7 +72,7 @@ void KTouchNormalKey::paint(QPainter& p) const { p.setPen(textColor); p.setFont( m_font ); - p.drawText(m_xS, m_yS, m_wS, m_hS, QPainter::AlignCenter, m_keyText); + p.drawText(m_xS, m_yS, m_wS, m_hS, TQPainter::AlignCenter, m_keyText); } // -------------------------------------------------------------- @@ -80,7 +80,7 @@ void KTouchNormalKey::paint(QPainter& p) const { // **** Implementation of class KTouchFingerKey **** -KTouchFingerKey::KTouchFingerKey(const QChar& keyChar, const QString& keyText, int x, int y, int w, int h) +KTouchFingerKey::KTouchFingerKey(const TQChar& keyChar, const TQString& keyText, int x, int y, int w, int h) : KTouchNormalKey(keyChar, keyText, x, y, w, h) { m_colorIndex = m_fingerKeyCount++; @@ -93,24 +93,24 @@ KTouchFingerKey::KTouchFingerKey(const QChar& keyChar, const QString& keyText, i m_font_scale =2; } -void KTouchFingerKey::paint(QPainter& p) const { +void KTouchFingerKey::paint(TQPainter& p) const { const KTouchColorScheme& colorScheme = KTouchColorScheme::m_colorSchemes[Prefs::currentColorScheme()]; p.setFont( m_font ); if (m_isActive) { p.setBrush( colorScheme.m_background[m_colorIndex] ); p.setPen( colorScheme.m_frame ); KTouchBaseKey::paint(p); // draw background and frame - p.setPen( QPen(colorScheme.m_frame,3) ); + p.setPen( TQPen(colorScheme.m_frame,3) ); p.drawRect(m_xS+2, m_yS+2, m_wS-4, m_hS-4); // mark it as "active" p.setPen( colorScheme.m_text ); - p.drawText(m_xS, m_yS, m_wS, m_hS, QPainter::AlignCenter, m_keyText); + p.drawText(m_xS, m_yS, m_wS, m_hS, TQPainter::AlignCenter, m_keyText); } else if (m_isNextKey) { p.setBrush( colorScheme.m_backgroundH ); p.setPen( colorScheme.m_frame ); KTouchBaseKey::paint(p); p.setPen( colorScheme.m_textH ); - p.drawText(m_xS, m_yS, m_wS, m_hS, QPainter::AlignCenter, m_keyText); + p.drawText(m_xS, m_yS, m_wS, m_hS, TQPainter::AlignCenter, m_keyText); } else { p.setBrush( colorScheme.m_background[m_colorIndex] ); @@ -118,7 +118,7 @@ void KTouchFingerKey::paint(QPainter& p) const { KTouchBaseKey::paint(p); p.drawRoundRect(m_xS+2, m_yS+2, m_wS-4, m_hS-4); p.setPen( colorScheme.m_text ); - p.drawText(m_xS, m_yS, m_wS, m_hS, QPainter::AlignCenter, m_keyText); + p.drawText(m_xS, m_yS, m_wS, m_hS, TQPainter::AlignCenter, m_keyText); }; } // -------------------------------------------------------------- @@ -127,17 +127,17 @@ void KTouchFingerKey::paint(QPainter& p) const { // **** Implementation of class KTouchControlKey **** -KTouchControlKey::KTouchControlKey(const QChar& keyChar, const QString& keyText, int x, int y, int w, int h) +KTouchControlKey::KTouchControlKey(const TQChar& keyChar, const TQString& keyText, int x, int y, int w, int h) : KTouchBaseKey(keyChar, keyText, x, y, w, h) { m_type = CONTROL_KEY; m_font_scale = 4; } -void KTouchControlKey::paint(QPainter& p) const { +void KTouchControlKey::paint(TQPainter& p) const { const KTouchColorScheme& colorScheme = KTouchColorScheme::m_colorSchemes[Prefs::currentColorScheme()]; p.setFont( m_font ); - QColor textColor; + TQColor textColor; if (m_isActive) { p.setBrush( colorScheme.m_cBackgroundH ); p.setPen( colorScheme.m_frame ); @@ -213,10 +213,10 @@ void KTouchControlKey::paint(QPainter& p) const { p.drawLine(xleft, y, xleft+ch/3, y+static_cast(ch*0.15)); } else if (m_keyText=="AltGr") { - p.drawText(m_xS, m_yS, m_wS, m_hS, QPainter::AlignCenter | QPainter::AlignVCenter, "Alt Gr"); + p.drawText(m_xS, m_yS, m_wS, m_hS, TQPainter::AlignCenter | TQPainter::AlignVCenter, "Alt Gr"); } else - p.drawText(m_xS, m_yS, m_wS, m_hS, QPainter::AlignCenter | QPainter::AlignVCenter, m_keyText); + p.drawText(m_xS, m_yS, m_wS, m_hS, TQPainter::AlignCenter | TQPainter::AlignVCenter, m_keyText); } diff --git a/ktouch/src/ktouchkeys.h b/ktouch/src/ktouchkeys.h index 90d4222d..68ffa959 100644 --- a/ktouch/src/ktouchkeys.h +++ b/ktouch/src/ktouchkeys.h @@ -17,7 +17,7 @@ #include #endif -#include +#include class KTouchFingerKey; class KTouchNormalKey; @@ -34,25 +34,25 @@ class KTouchBaseKey { enum KeyType { FINGER_KEY, NORMAL_KEY, CONTROL_KEY }; /// Constructor - KTouchBaseKey(const QChar& keyChar, const QString& keyText, int x, int y, int w, int h) + KTouchBaseKey(const TQChar& keyChar, const TQString& keyText, int x, int y, int w, int h) : m_keyChar(keyChar), m_keyText(keyText), m_isActive(false), m_isNextKey(false), m_x(x), m_y(y), m_w(w), m_h(h), m_type(NORMAL_KEY) {} /// Destructor. virtual ~KTouchBaseKey() {} /// Paints the basic key shape using the painter p. - virtual void paint(QPainter& p) const; + virtual void paint(TQPainter& p) const; /// Recalculates the scaled position and size properties of the key. void resize(double scale); /// Returns the boundary frame of the key. - QRect frame() const { return QRect(m_x, m_y, m_w, m_h); } + TQRect frame() const { return TQRect(m_x, m_y, m_w, m_h); } /// Returns the key type. KeyType type() const { return m_type; } - QChar m_keyChar; ///< The character that needs to be pressed to access this char. - QString m_keyText; ///< The text on the key (may be a single char only). + TQChar m_keyChar; ///< The character that needs to be pressed to access this char. + TQString m_keyText; ///< The text on the key (may be a single char only). bool m_isActive; ///< Indicates whether the key is active (finger and control keys). bool m_isNextKey; ///< Indicates whether this is the next to be pressed key (normal and finger keys). - QFont m_font; + TQFont m_font; float m_font_scale; protected: @@ -79,11 +79,11 @@ class KTouchBaseKey { class KTouchNormalKey : public KTouchBaseKey { public: /// Constructor - KTouchNormalKey(const QChar& keyChar, const QString& keyText, int x, int y, int w, int h); + KTouchNormalKey(const TQChar& keyChar, const TQString& keyText, int x, int y, int w, int h); /// Destructor virtual ~KTouchNormalKey() {} /// Extends the painting routine of KTouchKey (adds the text). - void paint(QPainter& p) const; + void paint(TQPainter& p) const; /// Indicates the colour index in the colour scheme, that has to be used for this key /// and will be set in KTouchKeyboard::updateColors(). unsigned int m_colorIndex; @@ -101,11 +101,11 @@ class KTouchNormalKey : public KTouchBaseKey { class KTouchFingerKey : public KTouchNormalKey { public: /// Constructor - KTouchFingerKey(const QChar& keyChar, const QString& keyText, int x, int y, int w, int h); + KTouchFingerKey(const TQChar& keyChar, const TQString& keyText, int x, int y, int w, int h); /// Destructor ~KTouchFingerKey() { --m_fingerKeyCount; } /// Extends the painting algoritm of KTouchNormalKey when marked. - void paint(QPainter& p) const; + void paint(TQPainter& p) const; private: static int m_fingerKeyCount; ///< Contains the number of created finger keys (for colour generation). @@ -122,9 +122,9 @@ class KTouchFingerKey : public KTouchNormalKey { class KTouchControlKey : public KTouchBaseKey { public: /// Constructor - KTouchControlKey(const QChar& keyChar, const QString& keyText, int x, int y, int w, int h); + KTouchControlKey(const TQChar& keyChar, const TQString& keyText, int x, int y, int w, int h); /// Extends the parents paint routine (draws the text or other fancy stuff). - void paint(QPainter& p) const; + void paint(TQPainter& p) const; }; // ------------------------------------------------------------------------------------ @@ -136,16 +136,16 @@ class KTouchKeyConnection { /// Default constructor KTouchKeyConnection() : m_keyChar(0), m_targetKeyChar(0), m_fingerKeyChar(0), m_controlKeyChar(0) {} /// Constructor provided for convenience. - KTouchKeyConnection(const QChar& keyChar, const QChar& targetKeyChar, const QChar& fingerKeyChar, - const QChar& controlKeyChar) + KTouchKeyConnection(const TQChar& keyChar, const TQChar& targetKeyChar, const TQChar& fingerKeyChar, + const TQChar& controlKeyChar) : m_keyChar(keyChar), m_targetKeyChar(targetKeyChar), m_fingerKeyChar(fingerKeyChar), m_controlKeyChar(controlKeyChar) {} /// This is the character that has to be pressed to access this key. - QChar m_keyChar; + TQChar m_keyChar; - QChar m_targetKeyChar; ///< The target character (the key the user has to press). - QChar m_fingerKeyChar; ///< The finger key (where the used finger normally rests). - QChar m_controlKeyChar; ///< The modifier key the user has to press also (for example LeftShift). + TQChar m_targetKeyChar; ///< The target character (the key the user has to press). + TQChar m_fingerKeyChar; ///< The finger key (where the used finger normally rests). + TQChar m_controlKeyChar; ///< The modifier key the user has to press also (for example LeftShift). }; #endif // KTOUCHKEYS_H diff --git a/ktouch/src/ktouchlecture.cpp b/ktouch/src/ktouchlecture.cpp index 70195977..5f5d57de 100644 --- a/ktouch/src/ktouchlecture.cpp +++ b/ktouch/src/ktouchlecture.cpp @@ -12,29 +12,29 @@ #include "ktouchlecture.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -bool KTouchLecture::load(QWidget * window, const KURL& url) { +bool KTouchLecture::load(TQWidget * window, const KURL& url) { // Ok, first download the contents as usual using the KIO lib // File is only downloaded if not local, otherwise it's just opened - QString target; + TQString target; bool result = false; if (KIO::NetAccess::download(url, target, window)) { // Ok, that was successful, store the lectureURL and read the file - QFile infile(target); + TQFile infile(target); if ( !infile.open( IO_ReadOnly ) ) { KIO::NetAccess::removeTempFile(target); return false; // Bugger it... couldn't open it... } - QTextStream in( &infile ); + TQTextStream in( &infile ); result = readLecture(in); }; KIO::NetAccess::removeTempFile(target); @@ -42,19 +42,19 @@ bool KTouchLecture::load(QWidget * window, const KURL& url) { } // ---------------------------------------------------------------------------- -bool KTouchLecture::loadXML(QWidget * window, const KURL& url) { +bool KTouchLecture::loadXML(TQWidget * window, const KURL& url) { // Ok, first download the contents as usual using the KIO lib // File is only downloaded if not local, otherwise it's just opened - QString target; + TQString target; bool result = false; if (KIO::NetAccess::download(url, target, window)) { // Ok, that was successful, store the lectureURL and read the file - QFile infile(target); + TQFile infile(target); if ( !infile.open( IO_ReadOnly ) ) { KIO::NetAccess::removeTempFile(target); return false; // Bugger it... couldn't open it... } - QDomDocument doc; + TQDomDocument doc; doc.setContent( &infile ); result = readLecture(doc); } @@ -64,13 +64,13 @@ bool KTouchLecture::loadXML(QWidget * window, const KURL& url) { // ---------------------------------------------------------------------------- -bool KTouchLecture::saveXML(QWidget * window, const KURL& url) const { +bool KTouchLecture::saveXML(TQWidget * window, const KURL& url) const { // create the XML document - QDomDocument doc; + TQDomDocument doc; writeLecture(doc); // and save it - QString tmpFile; + TQString tmpFile; KTempFile *temp=0; if (url.isLocalFile()) tmpFile=url.path(); // for local files the path is sufficient @@ -80,14 +80,14 @@ bool KTouchLecture::saveXML(QWidget * window, const KURL& url) const { tmpFile=temp->name(); } - QFile outfile(tmpFile); + TQFile outfile(tmpFile); if ( !outfile.open( IO_WriteOnly ) ) { if (temp) delete temp; // kdDebug() << "Error creating lecture file!" << endl; return false; }; - QTextStream out( &outfile ); + TQTextStream out( &outfile ); out << doc.toString(); outfile.close(); // if we have a temporary file, we still need to upload it @@ -115,14 +115,14 @@ const KTouchLevelData& KTouchLecture::level(unsigned int levelNum) const { } // ---------------------------------------------------------------------------- -bool KTouchLecture::readLecture(QTextStream& in) { +bool KTouchLecture::readLecture(TQTextStream& in) { //kdDebug() << "[KTouchLecture::loadLecture] Reading lecture file '" << lectureURL.url() << "'!" << endl; - QString line; + TQString line; // remove everything else m_lectureData.clear(); // now loop until end of file is reached and break down the textfile into several strings containing the levels - QStringList slist; - QString current_level = QString::null; // used to store the current level data + TQStringList slist; + TQString current_level = TQString::null; // used to store the current level data line = in.readLine(); bool in_level = false; while (!in.atEnd() && !line.isNull()) { @@ -139,7 +139,7 @@ bool KTouchLecture::readLecture(QTextStream& in) { else if (in_level) { // ok, a new comment found, if we were reading a level, store it slist.append(current_level); - current_level = QString::null; + current_level = TQString::null; in_level = false; } } @@ -151,10 +151,10 @@ bool KTouchLecture::readLecture(QTextStream& in) { //kdDebug() << "Levels read = " << slist.count() << endl; // now read all the levels - for (QStringList::Iterator it = slist.begin(); it!=slist.end(); ++it) { + for (TQStringList::Iterator it = slist.begin(); it!=slist.end(); ++it) { // create new level KTouchLevelData level; - QTextStream t(&(*it), IO_ReadOnly); + TQTextStream t(&(*it), IO_ReadOnly); // try to read it if (!level.readLevel(t)) { // uh oh, error while reading level data @@ -175,11 +175,11 @@ bool KTouchLecture::readLecture(QTextStream& in) { } // ---------------------------------------------------------------------------- -bool KTouchLecture::readLecture(QDomDocument& doc) { - QString line; +bool KTouchLecture::readLecture(TQDomDocument& doc) { + TQString line; m_lectureData.clear(); // clean current data // retrieve the title - QDomNodeList entries = doc.elementsByTagName("Title"); + TQDomNodeList entries = doc.elementsByTagName("Title"); if (entries.count() >= 1) m_title = entries.item(0).firstChild().nodeValue(); else m_title = i18n("untitled lecture"); // retrieve the comment @@ -207,34 +207,34 @@ bool KTouchLecture::readLecture(QDomDocument& doc) { } // ---------------------------------------------------------------------------- -void KTouchLecture::writeLecture(QDomDocument& doc) const { - QDomElement root = doc.createElement( "KTouchLecture" ); +void KTouchLecture::writeLecture(TQDomDocument& doc) const { + TQDomElement root = doc.createElement( "KTouchLecture" ); doc.appendChild(root); // Store title and ensure that the file contains a title! - QDomElement title = doc.createElement("Title"); - QDomText titleText; + TQDomElement title = doc.createElement("Title"); + TQDomText titleText; if (m_title.isEmpty()) titleText = doc.createTextNode( i18n("untitled lecture") ); else titleText = doc.createTextNode(m_title); title.appendChild(titleText); root.appendChild(title); // Store comment if given if (!m_comment.isEmpty()) { - QDomElement comment = doc.createElement("Comment"); - QDomText commentText = doc.createTextNode(m_comment); + TQDomElement comment = doc.createElement("Comment"); + TQDomText commentText = doc.createTextNode(m_comment); comment.appendChild(commentText); root.appendChild(comment); } // Store font suggestion if given if (!m_fontSuggestions.isEmpty()) { - QDomElement font = doc.createElement("FontSuggestions"); - QDomText fontText = doc.createTextNode(m_fontSuggestions); + TQDomElement font = doc.createElement("FontSuggestions"); + TQDomText fontText = doc.createTextNode(m_fontSuggestions); font.appendChild(fontText); root.appendChild(font); } // Store levels - QDomElement levels = doc.createElement("Levels"); + TQDomElement levels = doc.createElement("Levels"); root.appendChild(levels); - for (QValueVector::const_iterator it=m_lectureData.begin(); + for (TQValueVector::const_iterator it=m_lectureData.begin(); it!=m_lectureData.end(); ++it) { it->writeLevel(doc, levels); @@ -247,8 +247,8 @@ void KTouchLecture::writeLecture(QDomDocument& doc) const { // OLD and deprecated stuff /* -bool KTouchLecture::save(QWidget * window, const KURL& url) const { - QString tmpFile; +bool KTouchLecture::save(TQWidget * window, const KURL& url) const { + TQString tmpFile; KTempFile *temp=0; if (url.isLocalFile()) tmpFile=url.path(); // for local files the path is sufficient @@ -258,13 +258,13 @@ bool KTouchLecture::save(QWidget * window, const KURL& url) const { tmpFile=temp->name(); } - QFile outfile(tmpFile); + TQFile outfile(tmpFile); if ( !outfile.open( IO_WriteOnly ) ) { if (temp) delete temp; // kdDebug() << "Error creating lecture file!" << endl; return false; }; - QTextStream out( &outfile ); + TQTextStream out( &outfile ); writeLecture(out); // TODO : check stream status to see if save worked outfile.close(); @@ -277,7 +277,7 @@ bool KTouchLecture::save(QWidget * window, const KURL& url) const { } // ---------------------------------------------------------------------------- -void KTouchLecture::writeLecture(QTextStream& out) const { +void KTouchLecture::writeLecture(TQTextStream& out) const { out << "###################################### " << endl; out << "# # " << endl; out << "# Training lecture file for KTouch # " << endl; @@ -287,7 +287,7 @@ void KTouchLecture::writeLecture(QTextStream& out) const { out << endl; int levelCounter=0; - for (QValueVector::const_iterator it=m_lectureData.begin(); it!=m_lectureData.end(); ++it) { + for (TQValueVector::const_iterator it=m_lectureData.begin(); it!=m_lectureData.end(); ++it) { out << "################################" << endl; out << "# Level: " << ++levelCounter << endl; out << "# " << endl; diff --git a/ktouch/src/ktouchlecture.h b/ktouch/src/ktouchlecture.h index 3c59ee08..3eb6ba54 100644 --- a/ktouch/src/ktouchlecture.h +++ b/ktouch/src/ktouchlecture.h @@ -21,7 +21,7 @@ class QWidget; class QDomDocument; class KURL; -#include +#include #include "ktouchleveldata.h" /// This class handles the lecture data and provides the lines to type. @@ -41,13 +41,13 @@ class KTouchLecture { /// Creates a default mini-lecture. void createDefault(); /// Loads a lecture from file (returns true if successful). - bool load(QWidget * window, const KURL& url); + bool load(TQWidget * window, const KURL& url); /// Loads a lecture (in XML format) from file (returns true if successful). - bool loadXML(QWidget * window, const KURL& url); + bool loadXML(TQWidget * window, const KURL& url); // /// Saves the lecture data to file (returns true if successful). - // bool save(QWidget * window, const KURL& url) const; + // bool save(TQWidget * window, const KURL& url) const; /// Saves the lecture data to file (returns true if successful). - bool saveXML(QWidget * window, const KURL& url) const; + bool saveXML(TQWidget * window, const KURL& url) const; /// Returns the number of levels in the lecture. unsigned int levelCount() const { return m_lectureData.size(); } /// Returns a reference to the data of the level. @@ -55,25 +55,25 @@ class KTouchLecture { /// the level 0. const KTouchLevelData& level(unsigned int levelNum) const; /// Returns the title of the lecture. - const QString& title() const { return m_title; } + const TQString& title() const { return m_title; } /// Sets the title of the lecture. - void setTitle(const QString& title) { m_title = title; } + void setTitle(const TQString& title) { m_title = title; } - QString m_title; ///< The title of the lecture. - QString m_comment; ///< A comment. - QString m_fontSuggestions; ///< Font suggestions for this lecture. + TQString m_title; ///< The title of the lecture. + TQString m_comment; ///< A comment. + TQString m_fontSuggestions; ///< Font suggestions for this lecture. private: /// Loads a lecture from file - bool readLecture(QTextStream& in); + bool readLecture(TQTextStream& in); /// Loads a lecture from file into an XML document - bool readLecture(QDomDocument& doc); + bool readLecture(TQDomDocument& doc); /// Saves the lecture data to the current lecture URL - void writeLecture(QTextStream& out) const; + void writeLecture(TQTextStream& out) const; /// Saves the lecture data in the XML document - void writeLecture(QDomDocument& doc) const; + void writeLecture(TQDomDocument& doc) const; - QValueVector m_lectureData; ///< The lecture data. + TQValueVector m_lectureData; ///< The lecture data. /// The editor should be able to handle the internal lecture data (it's for convenience actually). friend class KTouchLectureEditor; diff --git a/ktouch/src/ktouchlectureeditor.cpp b/ktouch/src/ktouchlectureeditor.cpp index ce433d8c..e274732b 100644 --- a/ktouch/src/ktouchlectureeditor.cpp +++ b/ktouch/src/ktouchlectureeditor.cpp @@ -11,9 +11,9 @@ ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -41,23 +41,23 @@ // ***** Public functions *** // ************************** -KTouchLectureEditor::KTouchLectureEditor(QWidget *parent, const char* name, bool modal, WFlags fl) +KTouchLectureEditor::KTouchLectureEditor(TQWidget *parent, const char* name, bool modal, WFlags fl) : KTouchLectureEditorDlg(parent, name, modal, fl) { levelListView->setSorting(-1); // don't sort my level list view! - connect(levelListView, SIGNAL(selectionChanged(QListViewItem*)),this, SLOT(newSelection(QListViewItem*)) ); - connect(newCharsEdit, SIGNAL(textChanged(const QString&)), this, SLOT(newCharsChanged(const QString&)) ); - connect(newBtn, SIGNAL(clicked()), this, SLOT(newLevel()) ); - connect(deleteBtn, SIGNAL(clicked()), this, SLOT(deleteLevel()) ); - connect(upBtn, SIGNAL(clicked()), this, SLOT(moveUp()) ); - connect(downBtn, SIGNAL(clicked()), this, SLOT(moveDown()) ); + connect(levelListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)),this, TQT_SLOT(newSelection(TQListViewItem*)) ); + connect(newCharsEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(newCharsChanged(const TQString&)) ); + connect(newBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(newLevel()) ); + connect(deleteBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteLevel()) ); + connect(upBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveUp()) ); + connect(downBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveDown()) ); // make the connections for making the lecture modified - connect(titleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setModified()) ); - connect(lectureCommentEdit, SIGNAL(textChanged()), this, SLOT(setModified()) ); - connect(levelCommentEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setModified()) ); - connect(linesTextEdit, SIGNAL(textChanged()), this, SLOT(setModified()) ); + connect(titleEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(setModified()) ); + connect(lectureCommentEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(setModified()) ); + connect(levelCommentEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(setModified()) ); + connect(linesTextEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(setModified()) ); // The font, open, save, saveas and close buttons are already connected } @@ -66,7 +66,7 @@ KTouchLectureEditor::KTouchLectureEditor(QWidget *parent, const char* name, bool bool KTouchLectureEditor::startEditor(const KURL& url) { // call open request dialog and load a lecture, and start the dialogs event loop if // the user did not cancel the open request dialog - if (openLectureFile(url)==QDialog::Accepted) { + if (openLectureFile(url)==TQDialog::Accepted) { exec(); return true; } @@ -80,8 +80,8 @@ bool KTouchLectureEditor::startEditor(const KURL& url) { // ************************* void KTouchLectureEditor::fontBtnClicked() { - QFont f(m_lecture.m_fontSuggestions); - if (KFontDialog::getFont(f, false, this, true)==QDialog::Accepted) { + TQFont f(m_lecture.m_fontSuggestions); + if (KFontDialog::getFont(f, false, this, true)==TQDialog::Accepted) { linesTextEdit->setFont(f); lectureCommentEdit->setFont(f); levelCommentEdit->setFont(f); @@ -111,7 +111,7 @@ void KTouchLectureEditor::saveBtnClicked() { // ----------------------------------------------------------------------------- void KTouchLectureEditor::saveAsBtnClicked() { - QString tmp = KFileDialog::getSaveFileName(QString::null, + TQString tmp = KFileDialog::getSaveFileName(TQString::null, "*.ktouch.xml|KTouch Lecture Files(*.ktouch.xml)\n*.*|All Files", this, i18n("Save Training Lecture") ); if (!tmp.isEmpty()) { transfer_from_dialog(); @@ -123,13 +123,13 @@ void KTouchLectureEditor::saveAsBtnClicked() { } // ----------------------------------------------------------------------------- -void KTouchLectureEditor::newSelection(QListViewItem* item) { +void KTouchLectureEditor::newSelection(TQListViewItem* item) { if (m_selecting) return; bool current_modified_flag = m_modified; // remember our current status // first store the current level data storeCurrentLevel(); // now we need to find the level which has been selected - QListViewItem *i = levelListView->firstChild(); + TQListViewItem *i = levelListView->firstChild(); unsigned int level=0; while (i!=0 && i!=item) { i = i->nextSibling(); @@ -158,7 +158,7 @@ void KTouchLectureEditor::newSelection(QListViewItem* item) { } // ----------------------------------------------------------------------------- -void KTouchLectureEditor::newCharsChanged(const QString& text) { +void KTouchLectureEditor::newCharsChanged(const TQString& text) { if (m_currentItem==0) return; // shouldn't happen, but a little bit of paranoia... m_currentItem->setText(0, text); setModified(); @@ -167,7 +167,7 @@ void KTouchLectureEditor::newCharsChanged(const QString& text) { void KTouchLectureEditor::newLevel() { createNewLevel(); - QListViewItem *newItem = new QListViewItem( levelListView, + TQListViewItem *newItem = new TQListViewItem( levelListView, levelListView->lastItem(), m_lecture.m_lectureData.back().m_newChars ); newSelection(newItem); upBtn->setEnabled(true); @@ -184,7 +184,7 @@ void KTouchLectureEditor::deleteLevel() { // first remove the item from the list view delete m_currentItem; // then remove the level data - QValueVector::iterator it=m_lecture.m_lectureData.begin(); + TQValueVector::iterator it=m_lecture.m_lectureData.begin(); std::advance(it, m_level); m_lecture.m_lectureData.erase(it); m_currentItem = levelListView->firstChild(); @@ -207,7 +207,7 @@ void KTouchLectureEditor::moveUp() { if (m_level==0) return; m_selecting=true; // again, I don't want to process changeSelection() signals now storeCurrentLevel(); - QListViewItem *upperItem = m_currentItem->itemAbove(); + TQListViewItem *upperItem = m_currentItem->itemAbove(); std::swap(m_lecture.m_lectureData[m_level], m_lecture.m_lectureData[m_level-1]); upperItem->setText(0, m_lecture.m_lectureData[m_level-1].m_newChars); m_currentItem->setText(0, m_lecture.m_lectureData[m_level].m_newChars); @@ -227,7 +227,7 @@ void KTouchLectureEditor::moveDown() { if (m_level>=m_lecture.m_lectureData.size()-1) return; m_selecting=true; // again, I don't want to process changeSelection() signals now storeCurrentLevel(); - QListViewItem *lowerItem = m_currentItem->itemBelow(); + TQListViewItem *lowerItem = m_currentItem->itemBelow(); std::swap(m_lecture.m_lectureData[m_level], m_lecture.m_lectureData[m_level+1]); m_currentItem->setText(0, m_lecture.m_lectureData[m_level].m_newChars); lowerItem->setText(0, m_lecture.m_lectureData[m_level+1].m_newChars); @@ -258,12 +258,12 @@ void KTouchLectureEditor::transfer_to_dialog() { else setCaption(i18n("KTouch Lecture Editor - ") + m_currentURL.fileName()); // copy the 'new char' strings of the lectures into the list view levelListView->clear(); - QValueVector::const_iterator it=m_lecture.m_lectureData.begin(); + TQValueVector::const_iterator it=m_lecture.m_lectureData.begin(); // add first item - QListViewItem *item=new QListViewItem( levelListView, (it++)->m_newChars ); + TQListViewItem *item=new TQListViewItem( levelListView, (it++)->m_newChars ); // add all the others for (;it!=m_lecture.m_lectureData.end(); ++it) - item = new QListViewItem( levelListView, item, it->m_newChars ); + item = new TQListViewItem( levelListView, item, it->m_newChars ); m_currentItem=levelListView->firstChild(); m_selecting = true; // prevent the selectionChanged() signal from interfering levelListView->setSelected(m_currentItem, true); @@ -283,7 +283,7 @@ void KTouchLectureEditor::transfer_to_dialog() { } // finally the font if (!m_lecture.m_fontSuggestions.isEmpty()) { - QFont f("Monospace"); + TQFont f("Monospace"); // TODO : multiple font suggestions f.fromString(m_lecture.m_fontSuggestions); linesTextEdit->setFont(f); @@ -310,8 +310,8 @@ void KTouchLectureEditor::showCurrentLevel() { levelLabel->setText(i18n("Data of Level %1").arg(m_level+1) ); levelCommentEdit->setText(m_lecture.m_lectureData[m_level].m_comment); newCharsEdit->setText(m_lecture.m_lectureData[m_level].m_newChars); - QString text; - for (QValueVector::const_iterator it=m_lecture.m_lectureData[m_level].m_lines.begin(); + TQString text; + for (TQValueVector::const_iterator it=m_lecture.m_lectureData[m_level].m_lines.begin(); it!=m_lecture.m_lectureData[m_level].m_lines.end(); ++it) { text += *it + '\n'; @@ -325,11 +325,11 @@ void KTouchLectureEditor::storeCurrentLevel() { m_lecture.m_lectureData[m_level].m_comment = levelCommentEdit->text(); m_lecture.m_lectureData[m_level].m_newChars = newCharsEdit->text(); m_lecture.m_lectureData[m_level].m_lines.clear(); - QString text = linesTextEdit->text(); - QStringList lines; - QString currentLine; + TQString text = linesTextEdit->text(); + TQStringList lines; + TQString currentLine; for (unsigned int i=0; ilectureFiles(), i18n("")); - if (result == QDialog::Accepted) { + if (result == TQDialog::Accepted) { // Ok, user confirmed the dialog, now lets get the url m_currentURL = new_url; // Try to load the lecture, if that failes, we create a new lecture instead @@ -379,7 +379,7 @@ int KTouchLectureEditor::openLectureFile(const KURL& url) { // try to read old format first then XML format if (!m_lecture.load(this, m_currentURL) && !m_lecture.loadXML(this, m_currentURL)) { KMessageBox::sorry(this, i18n("Could not open the lecture file, creating a new one instead.")); - m_currentURL = QString::null; // new lectures haven't got a URL + m_currentURL = TQString::null; // new lectures haven't got a URL } } // If we have no URL, we create a new lecture - can happen if either the user @@ -392,9 +392,9 @@ int KTouchLectureEditor::openLectureFile(const KURL& url) { m_modified = false; // newly read lectures are not modified in the begin // Update our editor with the lecture data transfer_to_dialog(); - return QDialog::Accepted; + return TQDialog::Accepted; } - else return QDialog::Rejected; + else return TQDialog::Rejected; } // ----------------------------------------------------------------------------- @@ -411,7 +411,7 @@ bool KTouchLectureEditor::saveModified() { if (!m_modified) return true; // ok, ask the user to save the changes int result = KMessageBox::questionYesNoCancel(this, - i18n("The lecture has been changed. Do you want to save the changes?"),QString::null,KStdGuiItem::save(),KStdGuiItem::discard()); + i18n("The lecture has been changed. Do you want to save the changes?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::discard()); if (result == KMessageBox::Cancel) return false; // User aborted if (result == KMessageBox::Yes) saveBtnClicked(); // if successfully saved the modified flag will be resetted in the saveBtnClicked() function diff --git a/ktouch/src/ktouchlectureeditor.h b/ktouch/src/ktouchlectureeditor.h index 49850b6b..46d944b2 100644 --- a/ktouch/src/ktouchlectureeditor.h +++ b/ktouch/src/ktouchlectureeditor.h @@ -17,8 +17,8 @@ #include #endif -#include -#include +#include +#include #include #include "ktouchlectureeditor_dlg.h" @@ -43,7 +43,7 @@ class KTouchLectureEditor : public KTouchLectureEditorDlg { Q_OBJECT public: /// Constructor - KTouchLectureEditor(QWidget *parent, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + KTouchLectureEditor(TQWidget *parent, const char* name = 0, bool modal = FALSE, WFlags fl = 0); /// Destructor ~KTouchLectureEditor() {} /// Shows and executes the dialog (argument is the url to the default or @@ -69,9 +69,9 @@ class KTouchLectureEditor : public KTouchLectureEditorDlg { /// Will be called whenever some changes are made. void setModified() { setModified(true); } /// Will be called whenever another level has been selected. - void newSelection(QListViewItem* item); + void newSelection(TQListViewItem* item); /// Will be called whenever the new chars description is changed. - void newCharsChanged(const QString& text); + void newCharsChanged(const TQString& text); /// Will be called when the "New Level" button has been clicked. void newLevel(); /// Will be called when the "Delete Level" button has been clicked. @@ -108,7 +108,7 @@ class KTouchLectureEditor : public KTouchLectureEditorDlg { KTouchLecture m_lecture; ///< The currently used lecture. unsigned int m_level; ///< The current level number. - QListViewItem *m_currentItem; ///< The currently selected item in the list view. + TQListViewItem *m_currentItem; ///< The currently selected item in the list view. bool m_selecting; ///< Flag to prevent the selection slot from selecting twice. bool m_modified; ///< Flag indicating whether the lecture has been modified. KURL m_currentURL; ///< URL of the current lecture. diff --git a/ktouch/src/ktouchleveldata.cpp b/ktouch/src/ktouchleveldata.cpp index c74c5d10..d0606442 100644 --- a/ktouch/src/ktouchleveldata.cpp +++ b/ktouch/src/ktouchleveldata.cpp @@ -11,13 +11,13 @@ ***************************************************************************/ #include "ktouchleveldata.h" -#include -#include +#include +#include #include #include -#include +#include -const QString& KTouchLevelData::line(unsigned int lineNumber) const { +const TQString& KTouchLevelData::line(unsigned int lineNumber) const { if (lineNumber>=m_lines.size()) lineNumber=0; return m_lines[lineNumber]; @@ -26,19 +26,19 @@ const QString& KTouchLevelData::line(unsigned int lineNumber) const { void KTouchLevelData::createDefault() { m_newChars = i18n("Quite a lot"); m_lines.clear(); - QString text = i18n("This is a small default text. If you want\n" + TQString text = i18n("This is a small default text. If you want\n" "to start practicing touch typing, open\n" "a lecture/training file from the main menu.\n" "If you press enter after the next line you have\n" "successfully completed the default lecture. Hurray!!!"); - QStringList l( QStringList::split(QChar('\n'), text) ); - for (QStringList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it) + TQStringList l( TQStringList::split(TQChar('\n'), text) ); + for (TQStringList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it) m_lines.push_back( *it ); } -bool KTouchLevelData::readLevel(QTextStream& in) { - QString line; - m_comment = m_newChars = QString::null; +bool KTouchLevelData::readLevel(TQTextStream& in) { + TQString line; + m_comment = m_newChars = TQString::null; m_lines.clear(); // now read all the lines of the level, until EOF or an empty line line = in.readLine(); @@ -62,16 +62,16 @@ bool KTouchLevelData::readLevel(QTextStream& in) { return true; } -bool KTouchLevelData::readLevel(QDomNode in) { - QDomNode newChars = in.namedItem("NewCharacters"); +bool KTouchLevelData::readLevel(TQDomNode in) { + TQDomNode newChars = in.namedItem("NewCharacters"); if (newChars.isNull()) m_newChars = i18n("basically all characters on the keyboard","abcdefghijklmnopqrstuvwxyz"); else m_newChars = newChars.firstChild().nodeValue(); - QDomNode levelComment = in.namedItem("LevelComment"); + TQDomNode levelComment = in.namedItem("LevelComment"); if (!levelComment.isNull()) m_comment = levelComment.firstChild().nodeValue(); m_lines.clear(); - QDomNode line = in.namedItem("Line"); + TQDomNode line = in.namedItem("Line"); while ( !line.isNull() ) { - QString l = line.firstChild().nodeValue(); + TQString l = line.firstChild().nodeValue(); m_lines.push_back( l.stripWhiteSpace() ); line = line.nextSibling(); } @@ -82,27 +82,27 @@ bool KTouchLevelData::readLevel(QDomNode in) { return true; } -void KTouchLevelData::writeLevel(QTextStream& out) const { +void KTouchLevelData::writeLevel(TQTextStream& out) const { out << "# Comment: " << m_comment << endl; // comment line out << m_newChars << endl; // new characters line - for (QValueVector::const_iterator it=m_lines.begin(); it!=m_lines.end(); ++it) + for (TQValueVector::const_iterator it=m_lines.begin(); it!=m_lines.end(); ++it) out << *it << endl; out << endl; } -void KTouchLevelData::writeLevel(QDomDocument& doc, QDomElement& root) const { - QDomElement level = doc.createElement("Level"); +void KTouchLevelData::writeLevel(TQDomDocument& doc, TQDomElement& root) const { + TQDomElement level = doc.createElement("Level"); root.appendChild(level); // comment (optional) if (!m_comment.isEmpty()) { - QDomElement comment = doc.createElement("LevelComment"); - QDomText commentText = doc.createTextNode(m_comment); + TQDomElement comment = doc.createElement("LevelComment"); + TQDomText commentText = doc.createTextNode(m_comment); comment.appendChild(commentText); level.appendChild(comment); } // new characters (must have that) - QDomElement newchars = doc.createElement("NewCharacters"); - QDomText newcharsText; + TQDomElement newchars = doc.createElement("NewCharacters"); + TQDomText newcharsText; if (m_newChars.isEmpty()) newcharsText = doc.createTextNode(i18n("basically all characters on the keyboard","abcdefghijklmnopqrstuvwxyz")); else @@ -110,9 +110,9 @@ void KTouchLevelData::writeLevel(QDomDocument& doc, QDomElement& root) const { newchars.appendChild(newcharsText); level.appendChild(newchars); // the lines - for (QValueVector::const_iterator it=m_lines.begin(); it!=m_lines.end(); ++it) { - QDomElement line = doc.createElement("Line"); - QDomText lineText = doc.createTextNode(*it); + for (TQValueVector::const_iterator it=m_lines.begin(); it!=m_lines.end(); ++it) { + TQDomElement line = doc.createElement("Line"); + TQDomText lineText = doc.createTextNode(*it); line.appendChild(lineText); level.appendChild(line); } diff --git a/ktouch/src/ktouchleveldata.h b/ktouch/src/ktouchleveldata.h index 8055824d..e7e0f5e1 100644 --- a/ktouch/src/ktouchleveldata.h +++ b/ktouch/src/ktouchleveldata.h @@ -17,10 +17,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include class QDomDocument; class QDomElement; @@ -41,16 +41,16 @@ class KTouchLevelData { /// Default constructor, creates a default level. KTouchLevelData() { createDefault(); } /// Constructor for creating a new level. - KTouchLevelData(const QString& comment, const QString& newChars) + KTouchLevelData(const TQString& comment, const TQString& newChars) : m_comment(comment), m_newChars(newChars) { createDefault(); } /// Returns the level description (comment). - const QString& comment() const { return m_comment; } + const TQString& comment() const { return m_comment; } /// Returns the new characters string. - const QString& newChars() const { return m_newChars; } + const TQString& newChars() const { return m_newChars; } /// Returns the line with number 'lineNumber' (0 means first line). /// /// If the line number is out of range, the first line will be returned. - const QString& line(unsigned int lineNumber) const; + const TQString& line(unsigned int lineNumber) const; /// Returns the number of lines. unsigned int count() const { return m_lines.size(); } @@ -59,18 +59,18 @@ class KTouchLevelData { void createDefault(); /// Reads a level from the input stream. /// @return Returns 'true', when a level could be read successfully, or 'false' otherwise. - bool readLevel(QTextStream& in); + bool readLevel(TQTextStream& in); /// Reads a level from a XML Dom Node. /// @return Returns 'true', when a level could be read successfully, or 'false' otherwise. - bool readLevel(QDomNode in); + bool readLevel(TQDomNode in); /// Writes the level data into the output stream. - void writeLevel(QTextStream& out) const; + void writeLevel(TQTextStream& out) const; /// Writes the level data into the output stream. - void writeLevel(QDomDocument& doc, QDomElement& root) const; + void writeLevel(TQDomDocument& doc, TQDomElement& root) const; - QString m_comment; ///< A comment for the level. - QString m_newChars; ///< Contains the newly introduced characters in this level. - QValueVector m_lines; ///< The lines of the level. + TQString m_comment; ///< A comment for the level. + TQString m_newChars; ///< Contains the newly introduced characters in this level. + TQValueVector m_lines; ///< The lines of the level. // so I don't have to allow access to read/write function to everybody :-) friend class KTouchLecture; diff --git a/ktouch/src/ktouchopenrequest.cpp b/ktouch/src/ktouchopenrequest.cpp index d4bc875b..eb82f3f8 100644 --- a/ktouch/src/ktouchopenrequest.cpp +++ b/ktouch/src/ktouchopenrequest.cpp @@ -10,9 +10,9 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -26,14 +26,14 @@ #include "ktouchopenrequest.h" #include "ktouchopenrequest.moc" -KTouchOpenRequest::KTouchOpenRequest(QWidget* parent, const char* name, bool modal, WFlags fl) +KTouchOpenRequest::KTouchOpenRequest(TQWidget* parent, const char* name, bool modal, WFlags fl) : KTouchOpenRequestDlg(parent,name, modal,fl) { } -int KTouchOpenRequest::requestFileToOpen(KURL& url, const QString& caption, const QString& title, - const QString& currentText, const QString& defaultText, const QString& openText, - const QString& newText, KURL current_url, QStringList defaultList, QString emptyListText) +int KTouchOpenRequest::requestFileToOpen(KURL& url, const TQString& caption, const TQString& title, + const TQString& currentText, const TQString& defaultText, const TQString& openText, + const TQString& newText, KURL current_url, TQStringList defaultList, TQString emptyListText) { setCaption(caption); openChoiceGroup->setTitle(title); @@ -60,7 +60,7 @@ int KTouchOpenRequest::requestFileToOpen(KURL& url, const QString& caption, cons presetRadioBtn->setEnabled(false); } else { - for (QStringList::Iterator it = defaultList.begin(); it != defaultList.end(); ++it ) + for (TQStringList::Iterator it = defaultList.begin(); it != defaultList.end(); ++it ) presetCombo->insertItem(*it); presetRadioBtn->setEnabled(true); } @@ -79,7 +79,7 @@ void KTouchOpenRequest::okBtnClicked() { if (presetRadioBtn->isChecked()) m_url = presetCombo->currentText(); if (newRadioBtn->isChecked()) - m_url = QString::null; + m_url = TQString::null; if (openFileRadioBtn->isChecked()) { if (openFileEdit->text().isEmpty()) { KMessageBox::error(this, i18n("Please select or enter a file name.")); @@ -92,7 +92,7 @@ void KTouchOpenRequest::okBtnClicked() { } m_url = tmp; }; - QDialog::accept(); + TQDialog::accept(); } @@ -113,7 +113,7 @@ void KTouchOpenRequest::radioBtnChanged() { void KTouchOpenRequest::browseBtnClicked() { - KURL tmp = KFileDialog::getOpenURL(QString::null, QString::null, this, i18n("Select Training Lecture File") ); + KURL tmp = KFileDialog::getOpenURL(TQString::null, TQString::null, this, i18n("Select Training Lecture File") ); if (!tmp.isEmpty()) openFileEdit->setText(tmp.url()); } diff --git a/ktouch/src/ktouchopenrequest.h b/ktouch/src/ktouchopenrequest.h index 5c7d78a3..8f1c31d0 100644 --- a/ktouch/src/ktouchopenrequest.h +++ b/ktouch/src/ktouchopenrequest.h @@ -20,7 +20,7 @@ #include "ktouchopenrequest_dlg.h" #include -#include +#include /// Dialog for selecting a file to open. /// @@ -35,14 +35,14 @@ /// KTouchOpenRequest dlg; /// KURL url; /// // current_lecture must hold the URL to the current/default lecture or "" -/// // default_lectures must be a QStringList with the default lecture files. +/// // default_lectures must be a TQStringList with the default lecture files. /// int result = dlg.requestFileToOpen(url, i18n("Open a lecture file"), /// i18n("Which lecture would you like to open?"), i18n("Current lecture:"), /// i18n("Open a default lecture:"), i18n("Open a lecture file:"), /// i18n("Create a new lecture!"), current_lecture, /// default_lectures, i18n("")); /// -/// if (result==QDialog::Accepted) { +/// if (result==TQDialog::Accepted) { /// doSomethingFancyWith(url); /// } /// @endcode @@ -55,14 +55,14 @@ class KTouchOpenRequest : public KTouchOpenRequestDlg { public: /// Default constructor. - KTouchOpenRequest(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + KTouchOpenRequest(TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); /// Default destructor. ~KTouchOpenRequest() {} /// Sets up the dialog and runs it. - /// @return Returns the dialogs return code, QDialog::Accepted or QDialog::Rejected. - int requestFileToOpen(KURL& url, const QString& caption, const QString& title, const QString& currentText, - const QString& defaultText, const QString& openText, const QString& newText, - KURL current_url = QString::null, QStringList defaultList = QStringList(), QString emptyListText = QString::null); + /// @return Returns the dialogs return code, TQDialog::Accepted or TQDialog::Rejected. + int requestFileToOpen(KURL& url, const TQString& caption, const TQString& title, const TQString& currentText, + const TQString& defaultText, const TQString& openText, const TQString& newText, + KURL current_url = TQString::null, TQStringList defaultList = TQStringList(), TQString emptyListText = TQString::null); /// After the dialog has been accepted the URL chosen by the user is stored herein. KURL m_url; diff --git a/ktouch/src/ktouchslideline.cpp b/ktouch/src/ktouchslideline.cpp index aa245b4b..3071cc52 100644 --- a/ktouch/src/ktouchslideline.cpp +++ b/ktouch/src/ktouchslideline.cpp @@ -13,8 +13,8 @@ #include "ktouchslideline.h" #include "ktouchslideline.moc" -#include -#include +#include +#include #include #include @@ -41,8 +41,8 @@ // --- don't touch the lines above --- -KTouchSlideLine::KTouchSlideLine(QWidget *parent) - : QWidget( parent ), +KTouchSlideLine::KTouchSlideLine(TQWidget *parent) + : TQWidget( parent ), m_teacherPixmap(NULL), m_studentPixmap(NULL), m_slideTimer(this), @@ -77,8 +77,8 @@ KTouchSlideLine::KTouchSlideLine(QWidget *parent) m_xFrameStudent = 0; m_xFrameStudentCurrent = 0; - connect( &m_cursorTimer, SIGNAL(timeout()), this, SLOT(toggleCursor()) ); - connect( &m_slideTimer, SIGNAL(timeout()), this, SLOT(slide()) ); + connect( &m_cursorTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(toggleCursor()) ); + connect( &m_slideTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slide()) ); } // ---------------------------------------------------------------------------- @@ -105,7 +105,7 @@ void KTouchSlideLine::applyPreferences() { } // ---------------------------------------------------------------------------- -void KTouchSlideLine::setNewText(const QString& teacher_text, const QString& student_text) { +void KTouchSlideLine::setNewText(const TQString& teacher_text, const TQString& student_text) { KD_DEBUG( "[KTouchSlideLine::setNewText]" << endl ); m_teacherText=teacher_text; @@ -117,14 +117,14 @@ void KTouchSlideLine::setNewText(const QString& teacher_text, const QString& stu } // ---------------------------------------------------------------------------- -void KTouchSlideLine::setStudentText(const QString& text) { +void KTouchSlideLine::setStudentText(const TQString& text) { KD_DEBUG( "[KTouchSlideLine::setStudentText]" << endl ); m_studentText=text; updateStudentLine(); } // ---------------------------------------------------------------------------- -void KTouchSlideLine::setFont(const QFont& font) { +void KTouchSlideLine::setFont(const TQFont& font) { KD_DEBUG( "[KTouchSlideLine::setFont]" << endl ); // set the font for the slide line, unless the configuration overrides it if (Prefs::overrideLectureFont()) m_font = Prefs::font(); @@ -136,8 +136,8 @@ void KTouchSlideLine::setFont(const QFont& font) { } // ---------------------------------------------------------------------------- -bool KTouchSlideLine::canAddCharacter(const QString& new_student_text) { - QFontMetrics fontMetrics( m_font ); +bool KTouchSlideLine::canAddCharacter(const TQString& new_student_text) { + TQFontMetrics fontMetrics( m_font ); int new_text_len = textLen(fontMetrics, new_student_text); int allowed_student_length = m_studentPixmap->width() - 2*m_marginCursor; return (new_text_len <= allowed_student_length); @@ -224,7 +224,7 @@ void KTouchSlideLine::slide() { // *** Protected member functions (event implementation) *** -void KTouchSlideLine::paintEvent(QPaintEvent*) { +void KTouchSlideLine::paintEvent(TQPaintEvent*) { KD_DEBUG( "[KTouchSlideLine::paintEvent]" << endl ); if (m_studentPixmap==NULL || m_teacherPixmap==NULL) updateSlidingLines(); @@ -233,7 +233,7 @@ void KTouchSlideLine::paintEvent(QPaintEvent*) { } // ---------------------------------------------------------------------------- -void KTouchSlideLine::resizeEvent ( QResizeEvent * ) { +void KTouchSlideLine::resizeEvent ( TQResizeEvent * ) { KD_DEBUG( "[KTouchSlideLine::resizeEvent]" << endl ); // required input member variables: none @@ -261,7 +261,7 @@ void KTouchSlideLine::resizeEvent ( QResizeEvent * ) { // *** Private member functions (event implementation) -int KTouchSlideLine::textLen(const QFontMetrics& fontMetrics, const QString& text) { +int KTouchSlideLine::textLen(const TQFontMetrics& fontMetrics, const TQString& text) { //KD_DEBUG( "[KTouchSlideLine::textLen]" << endl; // required input member variables: m_xCharWidth @@ -296,7 +296,7 @@ void KTouchSlideLine::resizeFont() { m_yCursorStudent = height() - m_marginVerWidget - m_slideLineHeight + y_line_margin; KD_DEBUG( " m_yCursorStudent = " << m_yCursorStudent << endl ); // get font infos - QFontMetrics fontMetrics( m_font ); + TQFontMetrics fontMetrics( m_font ); // width of a single x character m_xCharWidth = fontMetrics.boundingRect("x").width(); // width of a single space character @@ -313,13 +313,13 @@ void KTouchSlideLine::drawCursor() { // m_xFrameTeacher, m_xFrameTeacherCurrent, // m_xFrameStudent, m_xFrameStudentCurrent, - QPainter p(this); + TQPainter p(this); #ifdef DRAW_TEACHER_CURSOR - QColor col_tt = Prefs::commonTypingLineColors() ? + TQColor col_tt = Prefs::commonTypingLineColors() ? Prefs::teacherTextColor() : KTouchColorScheme::m_colorSchemes[Prefs::currentColorScheme()].m_teacherTextColor; - QColor col_tb = Prefs::commonTypingLineColors() ? + TQColor col_tb = Prefs::commonTypingLineColors() ? Prefs::teacherBackgroundColor() : KTouchColorScheme::m_colorSchemes[Prefs::currentColorScheme()].m_teacherBackground; @@ -352,7 +352,7 @@ void KTouchSlideLine::drawCursor() { } // ---------------------------------------------------------------------------- -void KTouchSlideLine::drawEnterChar(QPainter *painter, int cursorPos, int y, int enterWidth) { +void KTouchSlideLine::drawEnterChar(TQPainter *painter, int cursorPos, int y, int enterWidth) { // required input member variables: none int gap = std::min(2,static_cast(0.2*enterWidth)); @@ -377,7 +377,7 @@ void KTouchSlideLine::updateSlidingLines() { if (m_slideLineHeight == 0) return; // first update some variables - QFontMetrics fontMetrics( m_font ); + TQFontMetrics fontMetrics( m_font ); m_teacherTextLen = textLen(fontMetrics, m_teacherText); KD_DEBUG( " m_teacherTextLen = " << m_teacherTextLen << endl ); @@ -406,40 +406,40 @@ void KTouchSlideLine::updateSlidingLines() { // create the teacher pixmap int w = 2*m_marginCursor + m_teacherTextLen; // TODO : add size of enter character int h = m_slideLineHeight; - m_teacherPixmap = new QPixmap(w,h); + m_teacherPixmap = new TQPixmap(w,h); KD_DEBUG( " m_teacherPixmap = " << w << " x " << h << endl ); // draw the teacher pixmap text - QPainter painter; + TQPainter painter; painter.begin (m_teacherPixmap, this); painter.setFont( m_font ); - QColor col_tt = Prefs::commonTypingLineColors() ? + TQColor col_tt = Prefs::commonTypingLineColors() ? Prefs::teacherTextColor() : KTouchColorScheme::m_colorSchemes[Prefs::currentColorScheme()].m_teacherTextColor; - QColor col_tb = Prefs::commonTypingLineColors() ? + TQColor col_tb = Prefs::commonTypingLineColors() ? Prefs::teacherBackgroundColor() : KTouchColorScheme::m_colorSchemes[Prefs::currentColorScheme()].m_teacherBackground; - painter.fillRect( m_teacherPixmap->rect(), QBrush(col_tb) ); + painter.fillRect( m_teacherPixmap->rect(), TQBrush(col_tb) ); painter.setPen( col_tt ); // create a rectangle for the text drawing - QRect textRect(m_marginCursor, 0, w-2*m_marginCursor, h); + TQRect textRect(m_marginCursor, 0, w-2*m_marginCursor, h); // left aligned if (!Prefs::right2LeftTyping()) { - painter.drawText(textRect, QPainter::AlignLeft | QPainter::AlignVCenter, m_teacherText); + painter.drawText(textRect, TQPainter::AlignLeft | TQPainter::AlignVCenter, m_teacherText); // TODO : draw enter char after the text } // right aligned, e.g. for Hebrew text else { - painter.drawText(textRect, QPainter::AlignRight | QPainter::AlignVCenter, m_teacherText); + painter.drawText(textRect, TQPainter::AlignRight | TQPainter::AlignVCenter, m_teacherText); // TODO : draw enter character at left of text } painter.end(); // done with the teachers text which will not change so quickly again // create student line pixmap thats slightly longer than the teacher's pixmap - m_studentPixmap = new QPixmap(w+100,h); + m_studentPixmap = new TQPixmap(w+100,h); KD_DEBUG( " m_studentPixmap = " << w+100 << " x " << h << endl ); // update (draw) student line and calculate coordinates needed for sliding @@ -457,7 +457,7 @@ void KTouchSlideLine::updateStudentLine() { if (m_teacherTextLen == 0) return; - QFontMetrics fontMetrics( m_font ); + TQFontMetrics fontMetrics( m_font ); m_studentTextLen = textLen(fontMetrics, m_studentText); KD_DEBUG( " m_studentTextLen = " << m_studentTextLen << endl ); @@ -467,7 +467,7 @@ void KTouchSlideLine::updateStudentLine() { unsigned int min_len = QMIN(teacherLen, studentLen); - QString correctText; + TQString correctText; if (!Prefs::right2LeftTyping()) { // for text typed from left to right for (unsigned int i=0; i #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -34,19 +34,19 @@ #include "ktouch.h" #include "ktouchchartwidget.h" -KTouchStatistics::KTouchStatistics(QWidget* parent) +KTouchStatistics::KTouchStatistics(TQWidget* parent) : KTouchStatisticsDlg(parent) { sessionsRadio->setChecked(true); WPMRadio->setChecked(true); eventRadio->setChecked(true); - connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()) ); - connect(lectureCombo, SIGNAL(activated(int)), this, SLOT(lectureActivated(int)) ); - connect(clearButton, SIGNAL(clicked()), this, SLOT(clearHistory()) ); + connect(closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) ); + connect(lectureCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(lectureActivated(int)) ); + connect(clearButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clearHistory()) ); // connect the radio buttons with the chart update function - connect(buttonGroup1, SIGNAL(clicked(int)), this, SLOT(updateChartTab()) ); - connect(buttonGroup2, SIGNAL(clicked(int)), this, SLOT(updateChartTab()) ); - connect(buttonGroup3, SIGNAL(clicked(int)), this, SLOT(updateChartTab()) ); + connect(buttonGroup1, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(updateChartTab()) ); + connect(buttonGroup2, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(updateChartTab()) ); + connect(buttonGroup3, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(updateChartTab()) ); // TODO : temporarily remove detailed stats page and deactivate options levelsRadio->setEnabled(false); @@ -63,10 +63,10 @@ void KTouchStatistics::run(const KURL& currentLecture, const KTouchStatisticsDat // fill lecture combo with data // loop over all lecturestatistics lectureCombo->clear(); - QMapConstIterator it = stats.m_lectureStats.begin(); + TQMapConstIterator it = stats.m_lectureStats.begin(); m_currentIndex = 0; while (it != stats.m_lectureStats.end()) { - QString t = it.data().m_lectureTitle; + TQString t = it.data().m_lectureTitle; // if current lecture, remember index and adjust text if (it.key() == currentLecture || currentLecture.isEmpty() && it.key().url()=="default") @@ -122,13 +122,13 @@ void KTouchStatistics::lectureActivated(int index) { // ---------------------------------------------------------------------------- void KTouchStatistics::clearHistory() { - if (KMessageBox::warningContinueCancel(this, i18n("Erase all statistics data for the current user?"),QString::null,KStdGuiItem::del()) + if (KMessageBox::warningContinueCancel(this, i18n("Erase all statistics data for the current user?"),TQString::null,KStdGuiItem::del()) == KMessageBox::Continue) { KTouchPtr->clearStatistics(); // clear statistics data in KTouch // clear and reset local copy m_allStats.clear(); - QString s = lectureCombo->text(m_currentIndex); + TQString s = lectureCombo->text(m_currentIndex); lectureCombo->clear(); lectureCombo->insertItem(s); m_currentIndex = 0; @@ -142,7 +142,7 @@ void KTouchStatistics::clearHistory() { void KTouchStatistics::updateCurrentSessionTab() { // session/level/info - QString levelnums; + TQString levelnums; int last_level = -2; int levels_count = 0; std::set::iterator last_it = m_currSessionStats.m_levelNums.end(); @@ -161,7 +161,7 @@ void KTouchStatistics::updateCurrentSessionTab() { else levelnums += ","; } levels_count = 0; - levelnums += QString("%1").arg(*it+1); + levelnums += TQString("%1").arg(*it+1); } else { @@ -233,7 +233,7 @@ void KTouchStatistics::updateCurrentSessionTab() { void KTouchStatistics::updateCurrentLevelTab() { // level info - levelLabel2->setText( QString("%1").arg(m_currLevelStats.m_levelNum+1) ); + levelLabel2->setText( TQString("%1").arg(m_currLevelStats.m_levelNum+1) ); // general stats group elapsedTimeLCDLevel->display(static_cast(m_currLevelStats.m_elapsedTime)); totalCharsLCDLevel->display(static_cast(m_currLevelStats.m_totalChars) ); @@ -306,15 +306,15 @@ void KTouchStatistics::updateChartTab() { } else { // find correct lecture index - QMapConstIterator it = m_allStats.m_lectureStats.begin(); + TQMapConstIterator it = m_allStats.m_lectureStats.begin(); int index = m_lectureIndex; while (index-- > 0) ++it; std::vector< std::pair > data; - QString caption = "Session data"; + TQString caption = "Session data"; switch (buttonGroup2->selectedId()) { case 0 : // words per minute // loop over all session data entries in *it and store words per minute data - for (QValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); + for (TQValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); session_it != (*it).m_sessionStats.end(); ++session_it) { double t = (*session_it).m_elapsedTime; @@ -328,7 +328,7 @@ void KTouchStatistics::updateChartTab() { { double t = m_currSessionStats.m_elapsedTime; double wpm = m_currSessionStats.m_words/t*60.0; - double tp = QDateTime::currentDateTime().toTime_t()/(3600.0*24); + double tp = TQDateTime::currentDateTime().toTime_t()/(3600.0*24); data.push_back(std::make_pair(tp, wpm) ); } chartWidget->LeftAxis.setLabel( i18n("Words per minute") ); @@ -338,7 +338,7 @@ void KTouchStatistics::updateChartTab() { case 1 : // chars per minute // loop over all session data entries in *it and store chars per minute data - for (QValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); + for (TQValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); session_it != (*it).m_sessionStats.end(); ++session_it) { double t = (*session_it).m_elapsedTime; @@ -352,7 +352,7 @@ void KTouchStatistics::updateChartTab() { { double t = m_currSessionStats.m_elapsedTime; double cpm = m_currSessionStats.m_correctChars/t*60.0; - double tp = QDateTime::currentDateTime().toTime_t()/(3600.0*24); + double tp = TQDateTime::currentDateTime().toTime_t()/(3600.0*24); data.push_back(std::make_pair(tp, cpm) ); } chartWidget->LeftAxis.setLabel( i18n("Characters per minute") ); @@ -362,7 +362,7 @@ void KTouchStatistics::updateChartTab() { case 2 : // correctness // loop over all session data entries in *it and store correctness data - for (QValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); + for (TQValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); session_it != (*it).m_sessionStats.end(); ++session_it) { double tc = (*session_it).m_totalChars; @@ -376,7 +376,7 @@ void KTouchStatistics::updateChartTab() { { double tc = m_currSessionStats.m_totalChars; double corr = m_currSessionStats.m_correctChars/tc; - double tp = QDateTime::currentDateTime().toTime_t()/(3600.0*24); + double tp = TQDateTime::currentDateTime().toTime_t()/(3600.0*24); data.push_back(std::make_pair(tp, corr) ); } chartWidget->LeftAxis.setLabel( i18n("Correctness") ); @@ -386,7 +386,7 @@ void KTouchStatistics::updateChartTab() { case 3 : // skill // loop over all session data entries in *it and store correctness data - for (QValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); + for (TQValueVector::const_iterator session_it = (*it).m_sessionStats.begin(); session_it != (*it).m_sessionStats.end(); ++session_it) { double tc = (*session_it).m_totalChars; @@ -407,7 +407,7 @@ void KTouchStatistics::updateChartTab() { double t = m_currSessionStats.m_elapsedTime; double cpm = m_currSessionStats.m_correctChars/t*60.0; double skill = corr*cpm; - double tp = QDateTime::currentDateTime().toTime_t()/(3600.0*24); + double tp = TQDateTime::currentDateTime().toTime_t()/(3600.0*24); data.push_back(std::make_pair(tp, skill) ); } chartWidget->LeftAxis.setLabel( i18n("Skill") ); diff --git a/ktouch/src/ktouchstatistics.h b/ktouch/src/ktouchstatistics.h index 549dfc3c..8fa75c96 100644 --- a/ktouch/src/ktouchstatistics.h +++ b/ktouch/src/ktouchstatistics.h @@ -29,7 +29,7 @@ class KTouchStatistics : public KTouchStatisticsDlg { Q_OBJECT public: /// Constructor, takes a pointer to the trainer object. - KTouchStatistics(QWidget* parent); + KTouchStatistics(TQWidget* parent); /// Fills the statistics dialog with data and executes it. void run(const KURL& currentLecture, const KTouchStatisticsData& stats, diff --git a/ktouch/src/ktouchstatisticsdata.cpp b/ktouch/src/ktouchstatisticsdata.cpp index 42251df2..08fdff35 100644 --- a/ktouch/src/ktouchstatisticsdata.cpp +++ b/ktouch/src/ktouchstatisticsdata.cpp @@ -13,9 +13,9 @@ #include "config.h" #include "ktouchstatisticsdata.h" -#include -#include -#include +#include +#include +#include #include #include @@ -40,7 +40,7 @@ int KTouchCharStats::missHitRatio() const { } // ---------------------------------------------------------------------------- -QTextStream& operator<<(QTextStream &out, const KTouchCharStats &ch) { +TQTextStream& operator<<(TQTextStream &out, const KTouchCharStats &ch) { return (out << ch.m_char.unicode() << " " << ch.m_correctCount << " " << ch.m_wrongCount); } // ---------------------------------------------------------------------------- @@ -59,9 +59,9 @@ void KTouchLevelStats::clear() { } // ---------------------------------------------------------------------------- -bool KTouchLevelStats::read(QDomNode in) { +bool KTouchLevelStats::read(TQDomNode in) { // read the level number - QDomNode n = in.attributes().namedItem("Number"); + TQDomNode n = in.attributes().namedItem("Number"); bool ok; if (!n.isNull()) { m_levelNum = n.nodeValue().toInt(&ok); @@ -97,14 +97,14 @@ bool KTouchLevelStats::read(QDomNode in) { // done with attributes, read recording time n = in.namedItem("Time"); if (!n.isNull()) { - QString timestring = n.firstChild().nodeValue(); - if (timestring != QString::null) - m_timeRecorded = QDateTime::fromString(timestring, Qt::ISODate); + TQString timestring = n.firstChild().nodeValue(); + if (timestring != TQString::null) + m_timeRecorded = TQDateTime::fromString(timestring, Qt::ISODate); } // read characters n = in.namedItem("CharStats"); if (!n.isNull()) { - QString char_data = n.firstChild().nodeValue(); + TQString char_data = n.firstChild().nodeValue(); //kdDebug() << "'" << char_data << "'" << endl; #ifdef HAVE_SSTREAM std::stringstream strm(std::string(char_data.local8Bit())); @@ -113,15 +113,15 @@ bool KTouchLevelStats::read(QDomNode in) { #endif int ch, correct, wrong; while (strm >> ch >> correct >> wrong) - m_charStats.insert( KTouchCharStats(QChar(ch), correct, wrong) ); + m_charStats.insert( KTouchCharStats(TQChar(ch), correct, wrong) ); //kdDebug() << m_charStats.size() << endl; } return true; } // ---------------------------------------------------------------------------- -void KTouchLevelStats::write(QDomDocument& doc, QDomElement& root) const { - QDomElement level = doc.createElement("LevelStats"); +void KTouchLevelStats::write(TQDomDocument& doc, TQDomElement& root) const { + TQDomElement level = doc.createElement("LevelStats"); root.appendChild(level); level.setAttribute("Number", m_levelNum); level.setAttribute("Time", m_elapsedTime); @@ -129,15 +129,15 @@ void KTouchLevelStats::write(QDomDocument& doc, QDomElement& root) const { level.setAttribute("Corrects", m_correctChars); level.setAttribute("Words", m_words); // add time - QDomElement e = doc.createElement("Time"); - QDomText tn = doc.createTextNode(m_timeRecorded.toString(Qt::ISODate)); + TQDomElement e = doc.createElement("Time"); + TQDomText tn = doc.createTextNode(m_timeRecorded.toString(Qt::ISODate)); e.appendChild(tn); level.appendChild(e); // add char stats - QString char_data; + TQString char_data; // we append for each missed char the char-unicode and the counters for (std::set::const_iterator it=m_charStats.begin(); it!=m_charStats.end(); ++it) - char_data += QString(" %1 %2 %3").arg(it->m_char.unicode()) + char_data += TQString(" %1 %2 %3").arg(it->m_char.unicode()) .arg(it->m_correctCount).arg(it->m_wrongCount); e = doc.createElement("CharStats"); tn = doc.createTextNode(char_data); @@ -146,11 +146,11 @@ void KTouchLevelStats::write(QDomDocument& doc, QDomElement& root) const { } // ---------------------------------------------------------------------------- -void KTouchLevelStats::addCorrectChar(QChar key) { +void KTouchLevelStats::addCorrectChar(TQChar key) { ++m_correctChars; ++m_totalChars; // we only count non-space characters - if (key!=QChar(' ')) { + if (key!=TQChar(' ')) { std::set::iterator it = m_charStats.find( KTouchCharStats(key,0,0) ); if (it==m_charStats.end()) m_charStats.insert( KTouchCharStats(key,1,0) ); @@ -169,9 +169,9 @@ void KTouchLevelStats::removeCorrectChar() { } // ---------------------------------------------------------------------------- -void KTouchLevelStats::addWrongChar(QChar key) { +void KTouchLevelStats::addWrongChar(TQChar key) { ++m_totalChars; - if (key==QChar(8) || key==QChar(' ')) + if (key==TQChar(8) || key==TQChar(' ')) return; // don't remember wrong backspaces or spaces std::set::iterator it = m_charStats.find( KTouchCharStats(key,0,0) ); if (it==m_charStats.end()) @@ -214,9 +214,9 @@ void KTouchSessionStats::clear() { } // ---------------------------------------------------------------------------- -bool KTouchSessionStats::read(QDomNode in) { +bool KTouchSessionStats::read(TQDomNode in) { // read time - QDomNode n = in.attributes().namedItem("Time"); + TQDomNode n = in.attributes().namedItem("Time"); bool ok; if (!n.isNull()) { m_elapsedTime = n.nodeValue().toDouble(&ok); @@ -243,14 +243,14 @@ bool KTouchSessionStats::read(QDomNode in) { // done with attributes, read recording time n = in.namedItem("Time"); if (!n.isNull()) { - QString timestring = n.firstChild().nodeValue(); - if (timestring != QString::null) - m_timeRecorded = QDateTime::fromString(timestring, Qt::ISODate); + TQString timestring = n.firstChild().nodeValue(); + if (timestring != TQString::null) + m_timeRecorded = TQDateTime::fromString(timestring, Qt::ISODate); } // read level numbers n = in.namedItem("LevelNums"); if (!n.isNull()) { - QString str = n.firstChild().nodeValue(); + TQString str = n.firstChild().nodeValue(); #ifdef HAVE_SSTREAM std::stringstream strm(std::string(str.local8Bit())); #else @@ -263,7 +263,7 @@ bool KTouchSessionStats::read(QDomNode in) { // read characters n = in.namedItem("CharStats"); if (!n.isNull()) { - QString char_data = n.firstChild().nodeValue(); + TQString char_data = n.firstChild().nodeValue(); //kdDebug() << "'" << char_data << "'" << endl; #ifdef HAVE_SSTREAM std::stringstream strm(std::string(char_data.local8Bit())); @@ -272,7 +272,7 @@ bool KTouchSessionStats::read(QDomNode in) { #endif int ch, correct, wrong; while (strm >> ch >> correct >> wrong) - m_charStats.insert( KTouchCharStats(QChar(ch), correct, wrong) ); + m_charStats.insert( KTouchCharStats(TQChar(ch), correct, wrong) ); //kdDebug() << m_charStats.size() << endl; } @@ -280,31 +280,31 @@ bool KTouchSessionStats::read(QDomNode in) { } // ---------------------------------------------------------------------------- -void KTouchSessionStats::write(QDomDocument& doc, QDomElement& root) const { - QDomElement session = doc.createElement("SessionStats"); +void KTouchSessionStats::write(TQDomDocument& doc, TQDomElement& root) const { + TQDomElement session = doc.createElement("SessionStats"); root.appendChild(session); session.setAttribute("Time", m_elapsedTime); session.setAttribute("Chars", m_totalChars); session.setAttribute("Corrects", m_correctChars); session.setAttribute("Words", m_words); // add time - QDomElement e = doc.createElement("Time"); - QDomText tn = doc.createTextNode(m_timeRecorded.toString(Qt::ISODate)); + TQDomElement e = doc.createElement("Time"); + TQDomText tn = doc.createTextNode(m_timeRecorded.toString(Qt::ISODate)); e.appendChild(tn); session.appendChild(e); // add levels - QString level_nums; + TQString level_nums; for (std::set::const_iterator it = m_levelNums.begin(); it != m_levelNums.end(); ++it) - level_nums += QString( " %1").arg(*it); + level_nums += TQString( " %1").arg(*it); e = doc.createElement("LevelNums"); tn = doc.createTextNode(level_nums); e.appendChild(tn); session.appendChild(e); // add char data - QString char_data; + TQString char_data; // we append for each missed char the char-unicode and the counters for (std::set::const_iterator it=m_charStats.begin(); it!=m_charStats.end(); ++it) - char_data += QString(" %1 %2 %3").arg(it->m_char.unicode()) + char_data += TQString(" %1 %2 %3").arg(it->m_char.unicode()) .arg(it->m_correctCount).arg(it->m_wrongCount); e = doc.createElement("CharStats"); tn = doc.createTextNode(char_data); @@ -313,11 +313,11 @@ void KTouchSessionStats::write(QDomDocument& doc, QDomElement& root) const { } // ---------------------------------------------------------------------------- -void KTouchSessionStats::addCorrectChar(QChar key) { +void KTouchSessionStats::addCorrectChar(TQChar key) { ++m_correctChars; ++m_totalChars; // we only count non-space characters - if (key!=QChar(' ')) { + if (key!=TQChar(' ')) { std::set::iterator it = m_charStats.find( KTouchCharStats(key,0,0) ); if (it==m_charStats.end()) m_charStats.insert( KTouchCharStats(key,1,0) ); @@ -336,9 +336,9 @@ void KTouchSessionStats::removeCorrectChar() { } // ---------------------------------------------------------------------------- -void KTouchSessionStats::addWrongChar(QChar key) { +void KTouchSessionStats::addWrongChar(TQChar key) { ++m_totalChars; - if (key==QChar(8) || key==QChar(' ')) + if (key==TQChar(8) || key==TQChar(' ')) return; // don't remember wrong backspaces or spaces std::set::iterator it = m_charStats.find( KTouchCharStats(key,0,0) ); if (it==m_charStats.end()) @@ -357,17 +357,17 @@ void KTouchSessionStats::addWrongChar(QChar key) { // *** KTouchLectureStats *** void KTouchLectureStats::clear() { - m_lectureTitle = QString::null; - m_lectureURL = QString::null; + m_lectureTitle = TQString::null; + m_lectureURL = TQString::null; m_levelStats.clear(); m_sessionStats.clear(); } // ---------------------------------------------------------------------------- -bool KTouchLectureStats::read(QDomNode in) { +bool KTouchLectureStats::read(TQDomNode in) { clear(); // read the URL - QDomNode n = in.namedItem("URL"); + TQDomNode n = in.namedItem("URL"); if (!n.isNull()) m_lectureURL = n.firstChild().nodeValue(); else return false; // no URL, statistics useless // read the Title @@ -377,7 +377,7 @@ bool KTouchLectureStats::read(QDomNode in) { n = in.namedItem("AllLevelStats"); if (!n.isNull()) { // loop over all childs and read levels - QDomNode levelNode = n.firstChild(); + TQDomNode levelNode = n.firstChild(); while (!levelNode.isNull()) { //kdDebug() << "[KTouchLectureStats::read] Reading level stats" << endl; KTouchLevelStats tmp; @@ -389,7 +389,7 @@ bool KTouchLectureStats::read(QDomNode in) { n = in.namedItem("AllSessionStats"); if (!n.isNull()) { // loop over all childs and read sessions - QDomNode sessionNode = n.firstChild(); + TQDomNode sessionNode = n.firstChild(); while (!sessionNode.isNull()) { //kdDebug() << "[KTouchLectureStats::read] Reading session stats" << endl; KTouchSessionStats tmp; @@ -401,35 +401,35 @@ bool KTouchLectureStats::read(QDomNode in) { } // ---------------------------------------------------------------------------- -void KTouchLectureStats::write(QDomDocument& doc, QDomElement& root) const { +void KTouchLectureStats::write(TQDomDocument& doc, TQDomElement& root) const { if (m_lectureURL.isEmpty()) return; // Error here! - QDomElement lecture = doc.createElement("LectureStats"); + TQDomElement lecture = doc.createElement("LectureStats"); root.appendChild(lecture); // store lecture URL - QDomElement urlElement = doc.createElement("URL"); - QDomText urlText = doc.createTextNode(m_lectureURL.url()); + TQDomElement urlElement = doc.createElement("URL"); + TQDomText urlText = doc.createTextNode(m_lectureURL.url()); urlElement.appendChild(urlText); lecture.appendChild(urlElement); // store title - QString title = m_lectureTitle; + TQString title = m_lectureTitle; if (title.isEmpty()) title = m_lectureURL.fileName(); - QDomElement titleElement = doc.createElement("Title"); - QDomText titleText = doc.createTextNode(title); + TQDomElement titleElement = doc.createElement("Title"); + TQDomText titleText = doc.createTextNode(title); titleElement.appendChild(titleText); lecture.appendChild(titleElement); // store level stats - QDomElement levelStatsElement = doc.createElement("AllLevelStats"); + TQDomElement levelStatsElement = doc.createElement("AllLevelStats"); lecture.appendChild(levelStatsElement); - for (QValueVector::ConstIterator it = m_levelStats.begin(); + for (TQValueVector::ConstIterator it = m_levelStats.begin(); it != m_levelStats.end(); ++it) { it->write(doc, levelStatsElement); } // store session stats - QDomElement sessionStatsElement = doc.createElement("AllSessionStats"); + TQDomElement sessionStatsElement = doc.createElement("AllSessionStats"); lecture.appendChild(sessionStatsElement); - for (QValueVector::ConstIterator it = m_sessionStats.begin(); + for (TQValueVector::ConstIterator it = m_sessionStats.begin(); it != m_sessionStats.end(); ++it) { it->write(doc, sessionStatsElement); @@ -446,23 +446,23 @@ void KTouchStatisticsData::clear() { } // ---------------------------------------------------------------------------- -bool KTouchStatisticsData::read(QWidget * window, const KURL& url) { +bool KTouchStatisticsData::read(TQWidget * window, const KURL& url) { if (url.isEmpty()) return false; // Ok, first download the contents as usual using the KIO lib // File is only downloaded if not local, otherwise it's just opened - QString target; + TQString target; bool result = false; if (KIO::NetAccess::download(url, target, window)) { // Ok, that was successful, store the lectureURL and read the file - QFile infile(target); + TQFile infile(target); if ( !infile.open( IO_ReadOnly ) ) { KIO::NetAccess::removeTempFile(target); return false; // Bugger it... couldn't open it... } - QDomDocument doc; + TQDomDocument doc; #ifdef COMPRESSED_XML_STATISTICS - QByteArray array; + TQByteArray array; array = infile.readAll(); array = qUncompress(array); doc.setContent( array ); @@ -476,13 +476,13 @@ bool KTouchStatisticsData::read(QWidget * window, const KURL& url) { } // ---------------------------------------------------------------------------- -bool KTouchStatisticsData::write(QWidget * window, const KURL& url) const { +bool KTouchStatisticsData::write(TQWidget * window, const KURL& url) const { // create the XML document - QDomDocument doc; + TQDomDocument doc; writeStats(doc); // and save it - QString tmpFile; + TQString tmpFile; KTempFile *temp=0; if (url.isLocalFile()) tmpFile=url.path(); // for local files the path is sufficient @@ -492,7 +492,7 @@ bool KTouchStatisticsData::write(QWidget * window, const KURL& url) const { tmpFile=temp->name(); } - QFile outfile(tmpFile); + TQFile outfile(tmpFile); if ( !outfile.open( IO_WriteOnly ) ) { if (temp) delete temp; // kdDebug() << "Error creating lecture file!" << endl; @@ -500,13 +500,13 @@ bool KTouchStatisticsData::write(QWidget * window, const KURL& url) const { } #ifdef COMPRESSED_XML_STATISTICS - QByteArray array; - QTextStream out(array, IO_WriteOnly); + TQByteArray array; + TQTextStream out(array, IO_WriteOnly); out << doc.toString(); array = qCompress(array); outfile.writeBlock(array); #else - QTextStream out( &outfile ); + TQTextStream out( &outfile ); out << doc.toString(); #endif // COMPRESSED_XML_STATISTICS outfile.close(); @@ -520,10 +520,10 @@ bool KTouchStatisticsData::write(QWidget * window, const KURL& url) const { } // ---------------------------------------------------------------------------- -bool KTouchStatisticsData::readStats(QDomDocument& doc) { +bool KTouchStatisticsData::readStats(TQDomDocument& doc) { clear(); // clear current data // retrieve the KTouchStatistics statistics - QDomNodeList entries = doc.elementsByTagName("LectureStats"); + TQDomNodeList entries = doc.elementsByTagName("LectureStats"); bool result = true; unsigned int i=0; while (result && i < entries.count()) { @@ -539,8 +539,8 @@ bool KTouchStatisticsData::readStats(QDomDocument& doc) { } // ---------------------------------------------------------------------------- -void KTouchStatisticsData::writeStats(QDomDocument& doc) const { - QDomElement root = doc.createElement( "KTouchStatistics" ); +void KTouchStatisticsData::writeStats(TQDomDocument& doc) const { + TQDomElement root = doc.createElement( "KTouchStatistics" ); doc.appendChild(root); // Store Lecture statistics LectureStatsMap::ConstIterator it = m_lectureStats.begin(); diff --git a/ktouch/src/ktouchstatisticsdata.h b/ktouch/src/ktouchstatisticsdata.h index 9d3dae0b..c7655aca 100644 --- a/ktouch/src/ktouchstatisticsdata.h +++ b/ktouch/src/ktouchstatisticsdata.h @@ -17,11 +17,11 @@ #include #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -47,17 +47,17 @@ class KTouchCharStats { /// Default constructor. KTouchCharStats() : m_char(0), m_correctCount(0), m_wrongCount(0) {} /// Constructor with parameters. - KTouchCharStats(QChar ch, unsigned int correct, unsigned int wrong) + KTouchCharStats(TQChar ch, unsigned int correct, unsigned int wrong) : m_char(ch), m_correctCount(correct), m_wrongCount(wrong) {} /// Reads the character statistics from a XML Dom Node. /// @return Returns 'true', when reading was successful or 'false' otherwise. - bool read(QDomNode in); + bool read(TQDomNode in); /// Writes the character statistics to the XML document. - void write(QDomDocument& doc, QDomElement& root) const; + void write(TQDomDocument& doc, TQDomElement& root) const; /// Returns the miss-hit ratio (a value between 0-all correct and 100-all wrong). int missHitRatio() const; - QChar m_char; ///< The character for which statistics are kept. + TQChar m_char; ///< The character for which statistics are kept. unsigned int m_correctCount; ///< How often the character has been typed correctly. unsigned int m_wrongCount; ///< How often the character has been missed (not typed when it ought to be typed). }; @@ -73,7 +73,7 @@ inline bool operator>(const KTouchCharStats &lhs, const KTouchCharStats &rhs) { /// Comparison operator == : returns 'true' when the char-code of 'lhs' is equal to then the one of 'rhs' inline bool operator==(const KTouchCharStats &lhs, const KTouchCharStats &rhs) { return lhs.m_char==rhs.m_char; } /// Writes the content of a KTouchCharStats object into the text stream. -QTextStream& operator<<(QTextStream &out, const KTouchCharStats &ch); +TQTextStream& operator<<(TQTextStream &out, const KTouchCharStats &ch); // *** KTouchLevelStats *** @@ -91,15 +91,15 @@ class KTouchLevelStats { /// Reads the level statistics from a XML Dom Node. /// @return Returns 'true', when reading was successful or 'false' otherwise. - bool read(QDomNode in); + bool read(TQDomNode in); /// Writes the level statistics to the XML document. - void write(QDomDocument& doc, QDomElement& root) const; + void write(TQDomDocument& doc, TQDomElement& root) const; /// Adds a correct character count to the current statistics - void addCorrectChar(QChar key); + void addCorrectChar(TQChar key); /// Removes correct character count void removeCorrectChar(); /// Adds a wrong character count to the current statistics - void addWrongChar(QChar key); + void addWrongChar(TQChar key); /// Returns the typing accuracy or "correctness" as value between 0 and 1. double correctness() const; /// Returns the average typing speed in chars per minute. @@ -132,15 +132,15 @@ class KTouchSessionStats { /// Reads the session statistics from a XML Dom Node. /// @return Returns 'true', when reading was successful or 'false' otherwise. - bool read(QDomNode in); + bool read(TQDomNode in); /// Writes the session statistics to the XML document. - void write(QDomDocument& doc, QDomElement& root) const; + void write(TQDomDocument& doc, TQDomElement& root) const; /// Adds a correct character count to the current statistics - void addCorrectChar(QChar key); + void addCorrectChar(TQChar key); /// Removes a correct character count void removeCorrectChar(); /// Adds a wrong character count to the current statistics - void addWrongChar(QChar key); + void addWrongChar(TQChar key); std::set m_levelNums; ///< Numbers of the levels in this session. std::set m_charStats; ///< Holds the statistics for mistyped characters. @@ -167,15 +167,15 @@ class KTouchLectureStats { /// Reads a lecture statistics from a XML Dom Node. /// @return Returns 'true', when reading was successful or 'false' otherwise. - bool read(QDomNode in); + bool read(TQDomNode in); /// Writes the lecture statistics to the XML document. - void write(QDomDocument& doc, QDomElement& root) const; + void write(TQDomDocument& doc, TQDomElement& root) const; QString m_lectureTitle; ///< The descriptive title of the lecture. KURL m_lectureURL; ///< The descriptive title of the lecture. - QValueVector m_levelStats; ///< The statistics for all levels in this lecture. - QValueVector m_sessionStats; ///< The statistics for all session for in this lecture. + TQValueVector m_levelStats; ///< The statistics for all levels in this lecture. + TQValueVector m_sessionStats; ///< The statistics for all session for in this lecture. }; @@ -189,7 +189,7 @@ class KTouchLectureStats { /// session statistics is obtained by and stored in the KTouchTrainer object. class KTouchStatisticsData { public: - typedef QMap LectureStatsMap; + typedef TQMap LectureStatsMap; /// Default constructor KTouchStatisticsData() {} @@ -198,17 +198,17 @@ class KTouchStatisticsData { /// Reads the complete statistics from a XML file /// @return Returns 'true', when reading was successful or 'false' otherwise. - bool read(QWidget * window, const KURL& url); + bool read(TQWidget * window, const KURL& url); /// Writes the statistics data to the XML document. - bool write(QWidget * window, const KURL& url) const; + bool write(TQWidget * window, const KURL& url) const; LectureStatsMap m_lectureStats; ///< All statistics of all lectures, stored based on their URLs. private: /// Reads the statistics data from file into an XML document - bool readStats(QDomDocument& doc); + bool readStats(TQDomDocument& doc); /// Saves the statistics data in the XML document - void writeStats(QDomDocument& doc) const; + void writeStats(TQDomDocument& doc) const; }; #endif // KTOUCHSTATISTICSDATA_H diff --git a/ktouch/src/ktouchstatus.cpp b/ktouch/src/ktouchstatus.cpp index 2c0d8341..94d11894 100644 --- a/ktouch/src/ktouchstatus.cpp +++ b/ktouch/src/ktouchstatus.cpp @@ -13,14 +13,14 @@ #include "ktouchstatus.h" #include "ktouchstatus.moc" -#include -#include -#include +#include +#include +#include #include #include #include "prefs.h" -KTouchStatus::KTouchStatus(QWidget *parent) +KTouchStatus::KTouchStatus(TQWidget *parent) : KTouchStatusLayout(parent) { applyPreferences(); @@ -37,7 +37,7 @@ void KTouchStatus::applyPreferences() { } } -void KTouchStatus::setNewChars(const QString& newChars) { +void KTouchStatus::setNewChars(const TQString& newChars) { newCharsLabel->setText(newChars); } diff --git a/ktouch/src/ktouchstatus.h b/ktouch/src/ktouchstatus.h index 1782d3aa..72bb6acc 100644 --- a/ktouch/src/ktouchstatus.h +++ b/ktouch/src/ktouchstatus.h @@ -29,11 +29,11 @@ class KTouchStatus : public KTouchStatusLayout { Q_OBJECT public: /// Constructor - KTouchStatus(QWidget *parent); + KTouchStatus(TQWidget *parent); /// Called when the preferences have changed in the configuration dialog. void applyPreferences(); /// Sets the new characters text. - void setNewChars(const QString& newChars); + void setNewChars(const TQString& newChars); /// Updates the level LCD and the correctness progress bar void updateStatus(unsigned int level, double correctness); }; diff --git a/ktouch/src/ktouchtrainer.cpp b/ktouch/src/ktouchtrainer.cpp index 81c9da9e..7ed140ca 100644 --- a/ktouch/src/ktouchtrainer.cpp +++ b/ktouch/src/ktouchtrainer.cpp @@ -13,15 +13,15 @@ #include "ktouchtrainer.h" #include "ktouchtrainer.moc" -#include -#include +#include +#include #include #include #include #include #include -#include +#include #include "ktouch.h" #include "ktouchstatus.h" @@ -32,8 +32,8 @@ #include "prefs.h" KTouchTrainer::KTouchTrainer(KTouchStatus *status, KTouchSlideLine *slideLine, KTouchKeyboardWidget *keyboard, KTouchLecture *lecture) - : QObject(), - m_trainingTimer(new QTimer), + : TQObject(), + m_trainingTimer(new TQTimer), m_statusWidget(status), m_slideLineWidget(slideLine), m_keyboardWidget(keyboard), @@ -55,9 +55,9 @@ KTouchTrainer::KTouchTrainer(KTouchStatus *status, KTouchSlideLine *slideLine, K m_levelDownSound = KGlobal::dirs()->findResource("appdata","down.wav"); m_typeWriterSound = KGlobal::dirs()->findResource("appdata","typewriter.wav"); - connect(m_statusWidget->levelUpBtn, SIGNAL(clicked()), this, SLOT(levelUp()) ); - connect(m_statusWidget->levelDownBtn, SIGNAL(clicked()), this, SLOT(levelDown()) ); - connect(m_trainingTimer, SIGNAL(timeout()), this, SLOT(timerTick()) ); + connect(m_statusWidget->levelUpBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(levelUp()) ); + connect(m_statusWidget->levelDownBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(levelDown()) ); + connect(m_trainingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timerTick()) ); } // ---------------------------------------------------------------------------- @@ -73,7 +73,7 @@ void KTouchTrainer::gotoFirstLine() { } // ---------------------------------------------------------------------------- -void KTouchTrainer::keyPressed(QChar key) { +void KTouchTrainer::keyPressed(TQChar key) { // NOTE : In this function we need to distinguish between left and right // typing. Use the config setting Prefs::right2LeftTyping() for that. @@ -81,13 +81,13 @@ void KTouchTrainer::keyPressed(QChar key) { if (m_teacherText==m_studentText) { // if already at end of line, don't add more chars /// \todo Flash the line when line complete - if (Prefs::beepOnError()) QApplication::beep(); + if (Prefs::beepOnError()) TQApplication::beep(); return; } // remember length of student text without added character unsigned int old_student_text_len = m_studentText.length(); // compose new student text depending in typing direction - QString new_student_text = m_studentText; + TQString new_student_text = m_studentText; if (Prefs::right2LeftTyping()) new_student_text = key + new_student_text; else @@ -95,7 +95,7 @@ void KTouchTrainer::keyPressed(QChar key) { // don´t allow excessive amounts of characters per line if (!m_slideLineWidget->canAddCharacter(new_student_text)) { - if (Prefs::beepOnError()) QApplication::beep(); + if (Prefs::beepOnError()) TQApplication::beep(); return; } // store the new student text @@ -105,7 +105,7 @@ void KTouchTrainer::keyPressed(QChar key) { statsAddCorrectChar(key); // ok, all student text is correct else { // nope, the key was wrong : beep !!! - if (Prefs::beepOnError()) QApplication::beep(); + if (Prefs::beepOnError()) TQApplication::beep(); // check if the key is the first wrong key that was mistyped. Only then add it // to the wrong char statistics. if (Prefs::right2LeftTyping()) { @@ -149,11 +149,11 @@ void KTouchTrainer::backspacePressed() { if (m_teacherText.left(len)==m_studentText) m_keyboardWidget->newKey(m_teacherText[len]); else - m_keyboardWidget->newKey(QChar(8)); + m_keyboardWidget->newKey(TQChar(8)); } else { /// \todo Flash line when Backspace on empty line - QApplication::beep(); + TQApplication::beep(); } } // ---------------------------------------------------------------------------- @@ -161,7 +161,7 @@ void KTouchTrainer::backspacePressed() { void KTouchTrainer::enterPressed() { if (m_trainingPaused) continueTraining(); if (m_studentText!=m_teacherText) { - QApplication::beep(); + TQApplication::beep(); return; }; @@ -241,12 +241,12 @@ void KTouchTrainer::updateWidgets() { if (studentLineCorrect()) { // ok, all student text is correct if (m_teacherText.length()==m_studentText.length()) - m_keyboardWidget->newKey(QChar(13)); // we have reached the end of the line + m_keyboardWidget->newKey(TQChar(13)); // we have reached the end of the line else m_keyboardWidget->newKey(m_teacherText[m_studentText.length()]); } else { - m_keyboardWidget->newKey(QChar(8)); // wrong key, user must now press backspace + m_keyboardWidget->newKey(TQChar(8)); // wrong key, user must now press backspace } updateWordCount(); // here we first update the word count updateStatusBar(); // and then the status bar @@ -317,12 +317,12 @@ void KTouchTrainer::storeTrainingStatistics() { // are there level stats to be stored? if (m_levelStats.m_elapsedTime != 0) { //kdDebug() << "[KTouchTrainer::storeTrainingStatistics] Storing level statistics!" << endl; - m_levelStats.m_timeRecorded = QDateTime::currentDateTime(); + m_levelStats.m_timeRecorded = TQDateTime::currentDateTime(); data.m_levelStats.push_back( m_levelStats ); } if (m_sessionStats.m_elapsedTime != 0) { //kdDebug() << "[KTouchTrainer::storeTrainingStatistics] Storing session statistics!" << endl; - m_sessionStats.m_timeRecorded = QDateTime::currentDateTime(); + m_sessionStats.m_timeRecorded = TQDateTime::currentDateTime(); data.m_sessionStats.push_back( m_sessionStats ); } } @@ -388,7 +388,7 @@ void KTouchTrainer::timerTick() { // *** Private functions *** void KTouchTrainer::levelAllComplete() { - QMessageBox::information(0, i18n("You rock!"), + TQMessageBox::information(0, i18n("You rock!"), i18n("You have finished this training exercise.\n" "This training session will start from the beginning.")); statsChangeLevel(); @@ -419,7 +419,7 @@ void KTouchTrainer::updateStatusBar() const { } // ---------------------------------------------------------------------------- -void KTouchTrainer::updateStatusBarMessage(const QString& message) const { +void KTouchTrainer::updateStatusBarMessage(const TQString& message) const { KTouchPtr->changeStatusbarMessage(message); } // ---------------------------------------------------------------------------- @@ -430,7 +430,7 @@ void KTouchTrainer::updateWordCount() { int words = 0; bool space = true; for (unsigned int i=0; i #endif -#include +#include #include "ktouchstatisticsdata.h" @@ -57,7 +57,7 @@ class KTouchLecture; /// The member function updateWidgets() updates all training related widgets (status widget, slide line, /// and the statusbar of the main window). In this member function also the word count of the current line /// is updated. -class KTouchTrainer : public QObject { +class KTouchTrainer : public TQObject { Q_OBJECT public: /// Constructor. @@ -72,7 +72,7 @@ class KTouchTrainer : public QObject { void gotoFirstLevel() { m_level=0; gotoFirstLine(); } /// Processes the character 'key' and updates the widgets and statistics. /// If the training session was started and in waiting state the timer is started and the actuall training begins. - void keyPressed(QChar key); + void keyPressed(TQChar key); /// Will be called when a character has been removed (recalculates the variables and updates the widgets). void backspacePressed(); /// Will be called when "enter" has been pressed (displays next line). @@ -105,11 +105,11 @@ class KTouchTrainer : public QObject { unsigned int m_level; ///< Current level number (zero based). unsigned int m_line; ///< Current line number (zero based). - QString m_teacherText; ///< The currently displayed teacher text. - QString m_studentText; ///< The currently typed student text. + TQString m_teacherText; ///< The currently displayed teacher text. + TQString m_studentText; ///< The currently typed student text. bool m_trainingPaused; ///< Indicates whether we have paused the training session or not. - QTimer *m_trainingTimer; ///< The timer responsable for updating the speed LCD widget. + TQTimer *m_trainingTimer; ///< The timer responsable for updating the speed LCD widget. KTouchLevelStats m_levelStats; ///< Contains the statistics for the current level alone. KTouchSessionStats m_sessionStats; ///< Contains the statistics for the current session (multiple levels). @@ -133,15 +133,15 @@ class KTouchTrainer : public QObject { /// Updates the statusbar of the main window. void updateStatusBar() const; /// Updates the message in the statusbar of the main window. - void updateStatusBarMessage(const QString& message) const; + void updateStatusBarMessage(const TQString& message) const; /// Updates the word count in the current student text line. void updateWordCount(); /// Adds a correct character count to the current statistics. - void statsAddCorrectChar(QChar key); + void statsAddCorrectChar(TQChar key); /// Adds a wrong character count to the current statistics. - void statsAddWrongChar(QChar key); + void statsAddWrongChar(TQChar key); /// Removes a correctly typed character count. - void statsRemoveCorrectChar(QChar); + void statsRemoveCorrectChar(TQChar); /// Adds some elapsed time (in seconds) to the statistics. void statsAddTime(double dt); /// Stores level stats and resets level stats (this function is called from levelUp() and levelDown() diff --git a/ktouch/src/ktouchutils.cpp b/ktouch/src/ktouchutils.cpp index af039f2c..a59dbfd9 100644 --- a/ktouch/src/ktouchutils.cpp +++ b/ktouch/src/ktouchutils.cpp @@ -10,25 +10,25 @@ * (at your option) any later version. * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include "ktouchutils.h" -QString format_speed(double speed) { +TQString format_speed(double speed) { unsigned int mins = static_cast(speed); unsigned int secs = static_cast(speed*60) - mins*60; - return QString("%1' %2''").arg(mins).arg(secs); + return TQString("%1' %2''").arg(mins).arg(secs); } -void sort_lists(QStringList& text, QStringList& data) { +void sort_lists(TQStringList& text, TQStringList& data) { if (text.count() != data.count()) return; // invalid input, no sorting possible - QMap sort_map; - QStringList::const_iterator key_it = text.constBegin(); - QStringList::const_iterator val_it = data.constBegin(); + TQMap sort_map; + TQStringList::const_iterator key_it = text.constBegin(); + TQStringList::const_iterator val_it = data.constBegin(); while (key_it != text.constEnd()) { // kdDebug() << *key_it << " " << *val_it << endl; sort_map[*key_it++] = *val_it++; diff --git a/ktouch/src/ktouchutils.h b/ktouch/src/ktouchutils.h index 53b0daee..2a1c7801 100644 --- a/ktouch/src/ktouchutils.h +++ b/ktouch/src/ktouchutils.h @@ -17,12 +17,12 @@ #include #endif -#include +#include /// Formats the speed (given in chars/min) and creates a nice looking text. -QString format_speed(double speed); +TQString format_speed(double speed); /// Sorts both lists but uses only the values in "text" for sorting. -void sort_lists(QStringList& text, QStringList& data); +void sort_lists(TQStringList& text, TQStringList& data); #endif // KTOUCHUTILS_H diff --git a/ktouch/src/main.cpp b/ktouch/src/main.cpp index a5159ad1..6fc244ba 100644 --- a/ktouch/src/main.cpp +++ b/ktouch/src/main.cpp @@ -60,8 +60,8 @@ int main(int argc, char **argv) KTouchSplash splash; // create the splash screen splash.setHideEnabled( true ); // allow user to click the splash screen away splash.show(); // show it - QTimer splashTimer; - splashTimer.connect(&splashTimer, SIGNAL(timeout()), &splash, SLOT(hide())); + TQTimer splashTimer; + splashTimer.connect(&splashTimer, TQT_SIGNAL(timeout()), &splash, TQT_SLOT(hide())); splashTimer.start(2000, true); // start singleshot timer to hide the splashscreen */ diff --git a/kturtle/src/canvas.cpp b/kturtle/src/canvas.cpp index 871c1614..38281956 100644 --- a/kturtle/src/canvas.cpp +++ b/kturtle/src/canvas.cpp @@ -53,7 +53,7 @@ #include -#include +#include #include #include @@ -75,10 +75,10 @@ const double DEG2RAD = 3.14159265358979323846/180; // BEGIN public methods -Canvas::Canvas(QWidget *parent, const char *name) : QCanvasView(0, parent, name) +Canvas::Canvas(TQWidget *parent, const char *name) : TQCanvasView(0, parent, name) { // Create a new canvas for this view - canvas = new QCanvas(parent); + canvas = new TQCanvas(parent); canvas->setAdvancePeriod(250); // refresh-rate in [ms] // set initial values @@ -95,10 +95,10 @@ Canvas::~Canvas() } -QPixmap* Canvas::canvas2Pixmap() +TQPixmap* Canvas::canvas2Pixmap() { - pixmap = QPixmap( canvas->width(), canvas->height() ); - QPainter painter(&pixmap); + pixmap = TQPixmap( canvas->width(), canvas->height() ); + TQPainter painter(&pixmap); canvas->drawArea(canvas->rect(), &painter); return &pixmap; } @@ -111,8 +111,8 @@ QPixmap* Canvas::canvas2Pixmap() void Canvas::slotClear() { - QCanvasItemList list = canvas->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { // kill everything but the turtle (who lives on a seperate layer) @@ -122,8 +122,8 @@ void Canvas::slotClear() void Canvas::slotClearSpriteToo() { - QCanvasItemList list = canvas->allItems(); - QCanvasItemList::Iterator it = list.begin(); + TQCanvasItemList list = canvas->allItems(); + TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if (*it) delete *it; @@ -138,7 +138,7 @@ void Canvas::slotGo(double x, double y) if ( wrap && !canvas->onCanvas(intX, intY) ) { - QPoint offsetPoint = offset(intX, intY); + TQPoint offsetPoint = offset(intX, intY); posX = x - ( offsetPoint.x() * canvasWidth ); posY = y - ( offsetPoint.y() * canvasHeight ); } @@ -156,7 +156,7 @@ void Canvas::slotGoX(double x) int intPosY = ROUND2INT(posY); if ( wrap && !canvas->onCanvas(intX, intPosY) ) { - QPoint offsetPoint = offset(intX, intPosY); + TQPoint offsetPoint = offset(intX, intPosY); posX = x - ( offsetPoint.x() * canvasWidth ); } else posX = x; @@ -169,7 +169,7 @@ void Canvas::slotGoY(double y) int intPosX = ROUND2INT(posX); if ( wrap && !canvas->onCanvas(intPosX, intY) ) { - QPoint offsetPoint = offset(intPosX, intY); + TQPoint offsetPoint = offset(intPosX, intY); posY = y - ( offsetPoint.y() * canvasHeight ); } else posY = y; @@ -243,7 +243,7 @@ void Canvas::slotSetFgColor(int r, int g, int b) void Canvas::slotSetBgColor(int r, int g, int b) { - canvas->setBackgroundColor( QColor(r, g, b) ); + canvas->setBackgroundColor( TQColor(r, g, b) ); } void Canvas::slotResizeCanvas(int x, int y) @@ -285,16 +285,16 @@ void Canvas::slotSpriteChange(int x) sprite->move(ROUND2INT(posX - sprite->width()/2), ROUND2INT(posY - sprite->height()/2)); } -void Canvas::slotPrint(QString text) +void Canvas::slotPrint(TQString text) { - QCanvasText* t = new QCanvasText(text, font, canvas); + TQCanvasText* t = new TQCanvasText(text, font, canvas); // text does not do the wrapping, never... sorry - t->setColor( QColor(fgR, fgG, fgB) ); + t->setColor( TQColor(fgR, fgG, fgB) ); t->move(ROUND2INT(posX), ROUND2INT(posY)); t->show(); } -void Canvas::slotFontType(QString family, QString extra) +void Canvas::slotFontType(TQString family, TQString extra) { font.setFamily(family); font.setBold( extra.contains("bold") > 0 ); @@ -338,7 +338,7 @@ void Canvas::initValues() canvasWidth = Settings::canvasWidth(); canvasHeight = Settings::canvasHeight(); // colors - canvas->setBackgroundColor( QColor(255, 255, 255) ); // background + canvas->setBackgroundColor( TQColor(255, 255, 255) ); // background fgR = 0; // pencolor (forground) fgG = 0; fgB = 0; @@ -347,7 +347,7 @@ void Canvas::initValues() pen = true; wrap = true; direction = 0; - font = QFont("serif", 18); + font = TQFont("serif", 18); // the position posX = canvasWidth / 2; posY = canvasHeight / 2; @@ -364,26 +364,26 @@ void Canvas::lineShell(double xa, double ya, double xb, double yb) // line can fallback into this function in case of cutLoop == true cutLoop = false; // Reset the loop detection memory - prevStartPos3 = prevStartPos2 = prevStartPos1 = prevEndPos3 = prevEndPos2 = prevEndPos1 = QPoint(0, 0); + prevStartPos3 = prevStartPos2 = prevStartPos1 = prevEndPos3 = prevEndPos2 = prevEndPos1 = TQPoint(0, 0); // and go! line(xa, ya, xb, yb); } void Canvas::line(double xa, double ya, double xb, double yb) { - QCanvasLine* l = new QCanvasLine(canvas); + TQCanvasLine* l = new TQCanvasLine(canvas); int intXa = ROUND2INT(xa); int intYa = ROUND2INT(ya); int intXb = ROUND2INT(xb); int intYb = ROUND2INT(yb); l->setPoints(intXa, intYa, intXb, intYb); - l->setPen( QPen(QColor(fgR, fgG, fgB), penWidth, SolidLine) ); + l->setPen( TQPen(TQColor(fgR, fgG, fgB), penWidth, SolidLine) ); l->setZ(1); l->show(); // kdDebug(0)<<"Canvas::line(); xa:"<onCanvas( ROUND2INT(xb), ROUND2INT(yb) ) ) { - if (endlessLoop( QPoint(intXa, intYa), QPoint(intXb, intYb) ) == true) // detect for endless loop + if (endlessLoop( TQPoint(intXa, intYa), TQPoint(intXb, intYb) ) == true) // detect for endless loop { slotCenter(); kdDebug(0)<<"Canvas::line(): ENDLESS LOOP DETECTED, BROKE THE LOOP"< -0.00001 && (xb - xa) < 0.00001 ) // check for an infinite tangent (direction coefficient) { i++; - translate[i] = QPoint( 0, 1 ); - crossPoint[i] = QPoint( ROUND2INT(xa), 0 ); + translate[i] = TQPoint( 0, 1 ); + crossPoint[i] = TQPoint( ROUND2INT(xa), 0 ); i++; - translate[i] = QPoint(0,-1 ); - crossPoint[i] = QPoint( ROUND2INT(xa), canvasHeight ); + translate[i] = TQPoint(0,-1 ); + crossPoint[i] = TQPoint( ROUND2INT(xa), canvasHeight ); } else { @@ -487,32 +487,32 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) if ( 0 <= x_sT && x_sT <= canvasWidth && pointInRange(x_sT, 0, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint( 0, 1 ); - crossPoint[i] = QPoint( ROUND2INT(x_sT), 0 ); + translate[i] = TQPoint( 0, 1 ); + crossPoint[i] = TQPoint( ROUND2INT(x_sT), 0 ); } if ( 0 <= x_sB && x_sB <= canvasWidth && pointInRange(x_sB, canvasHeight, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint( 0,-1 ); - crossPoint[i] = QPoint( ROUND2INT(x_sB), ROUND2INT(canvasHeight) ); + translate[i] = TQPoint( 0,-1 ); + crossPoint[i] = TQPoint( ROUND2INT(x_sB), ROUND2INT(canvasHeight) ); } if ( 0 <= y_sL && y_sL <= canvasHeight && pointInRange(0, y_sL, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint( 1, 0 ); - crossPoint[i] = QPoint( 0, ROUND2INT(y_sL) ); + translate[i] = TQPoint( 1, 0 ); + crossPoint[i] = TQPoint( 0, ROUND2INT(y_sL) ); } if ( 0 <= y_sR && y_sR <= canvasHeight && pointInRange(canvasWidth, y_sR, xa, ya, xb, yb) ) { i++; - translate[i] = QPoint(-1, 0 ); - crossPoint[i] = QPoint( ROUND2INT(canvasWidth), ROUND2INT(y_sR) ); + translate[i] = TQPoint(-1, 0 ); + crossPoint[i] = TQPoint( ROUND2INT(canvasWidth), ROUND2INT(y_sR) ); } if ( i == 0 ) { // kdDebug(0)<<"Canvas::translationFactor: FIRST NO BORDER CROSSINGS DETECTED"< canvasWidth) returnValue = returnValue + QPoint(-1, 0); + returnValue = TQPoint(0, 0); + if (xb < 0) returnValue = returnValue + TQPoint( 1, 0); + else if (xb > canvasWidth) returnValue = returnValue + TQPoint(-1, 0); - if (yb < 0) returnValue = returnValue + QPoint( 0, 1); - else if (yb > canvasHeight) returnValue = returnValue + QPoint( 0,-1); + if (yb < 0) returnValue = returnValue + TQPoint( 0, 1); + else if (yb > canvasHeight) returnValue = returnValue + TQPoint( 0,-1); return returnValue; } @@ -595,14 +595,14 @@ QPoint Canvas::translationFactor(double xa, double ya, double xb, double yb) // Sprite related methods: -void Canvas::loadSpriteFrames(QString name) +void Canvas::loadSpriteFrames(TQString name) { // read the pixmaps name.0001.png, name.0002.png, ..., name.0035.png: the different rotations // #0000 for 0 or 360, #0001 for 10, #0002 for 20, ..., #0018 for 180, etc. // WARNING if the dir doesnt exists the app will crash!!! // This will be fixed in qt3.3 and in the current qt-copy - QPixmap turtlePix = QPixmap(locate("data","kturtle/pics/turtle.0000.png") ); + TQPixmap turtlePix = TQPixmap(locate("data","kturtle/pics/turtle.0000.png") ); if ( turtlePix.isNull() ) { KMessageBox::sorry( this, @@ -610,10 +610,10 @@ void Canvas::loadSpriteFrames(QString name) "Please check your installation."), i18n("Error") ); return; } - QString spritePath = locate("data","kturtle/pics/"+name+".0000.png"); + TQString spritePath = locate("data","kturtle/pics/"+name+".0000.png"); spritePath.remove(".0000.png"); - spriteFrames = new QCanvasPixmapArray(spritePath+".%1.png", 36); - sprite = new QCanvasSprite(spriteFrames, canvas); + spriteFrames = new TQCanvasPixmapArray(spritePath+".%1.png", 36); + sprite = new TQCanvasSprite(spriteFrames, canvas); sprite->setZ(250); } diff --git a/kturtle/src/canvas.h b/kturtle/src/canvas.h index 349e610d..0dd5bb13 100644 --- a/kturtle/src/canvas.h +++ b/kturtle/src/canvas.h @@ -19,7 +19,7 @@ #ifndef _CANVAS_H_ #define _CANVAS_H_ -#include +#include class Canvas : public QCanvasView @@ -27,10 +27,10 @@ class Canvas : public QCanvasView Q_OBJECT public: - Canvas(QWidget *parent = 0, const char *name = 0); + Canvas(TQWidget *parent = 0, const char *name = 0); ~Canvas(); - QPixmap* canvas2Pixmap(); + TQPixmap* canvas2Pixmap(); public slots: @@ -56,8 +56,8 @@ class Canvas : public QCanvasView void slotSpritePress(); void slotSpriteChange(int x); - void slotPrint(QString text); - void slotFontType(QString family, QString extra); + void slotPrint(TQString text); + void slotFontType(TQString family, TQString extra); void slotFontSize(int px); void slotWrapOn(); void slotWrapOff(); @@ -73,20 +73,20 @@ class Canvas : public QCanvasView void line(double xa, double ya, double xb, double yb); void lineShell(double xa, double ya, double xb, double yb); - bool endlessLoop(QPoint begin, QPoint end); + bool endlessLoop(TQPoint begin, TQPoint end); bool pointInRange(double px, double py, double xa, double ya, double xb, double yb); - QPoint offset(int x, int y); - QPoint translationFactor(double xa, double ya, double xb, double yb); + TQPoint offset(int x, int y); + TQPoint translationFactor(double xa, double ya, double xb, double yb); - void loadSpriteFrames(QString name); + void loadSpriteFrames(TQString name); void updateSpritePos(); void updateSpriteAngle(); - QCanvas *canvas; - QPixmap pixmap; - QCanvasSprite *sprite; - QCanvasPixmapArray *spriteFrames; - QFont font; + TQCanvas *canvas; + TQPixmap pixmap; + TQCanvasSprite *sprite; + TQCanvasPixmapArray *spriteFrames; + TQFont font; double posX, posY; int canvasWidth, canvasHeight; int penWidth; @@ -95,7 +95,7 @@ class Canvas : public QCanvasView bool pen; bool wrap; bool cutLoop; - QPoint prevStartPos3, prevStartPos2, prevStartPos1, prevEndPos3, prevEndPos2, prevEndPos1; + TQPoint prevStartPos3, prevStartPos2, prevStartPos1, prevEndPos3, prevEndPos2, prevEndPos1; }; #endif // _CANVAS_H_ diff --git a/kturtle/src/dialogs.cpp b/kturtle/src/dialogs.cpp index 044f36f4..fcc6322d 100644 --- a/kturtle/src/dialogs.cpp +++ b/kturtle/src/dialogs.cpp @@ -25,11 +25,11 @@ // BEGIN class ErrorMessage dialog -ErrorMessage::ErrorMessage (QWidget *parent) +ErrorMessage::ErrorMessage (TQWidget *parent) : KDialogBase (parent, "errorDialog", false, 0, KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true, i18n("Help on &Error") ) { - connect( this, SIGNAL( user1Clicked() ), this, SLOT( showHelpOnError() ) ); - connect( this, SIGNAL( helpClicked() ), this, SLOT( errorMessageHelp() ) ); + connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( showHelpOnError() ) ); + connect( this, TQT_SIGNAL( helpClicked() ), this, TQT_SLOT( errorMessageHelp() ) ); setCaption( i18n("Error Dialog") ); setButtonWhatsThis( KDialogBase::Close, i18n("Closes this error dialog") ); setButtonWhatsThis( KDialogBase::Help, i18n("Click here to read more on this error dialog in KTurtle's Handbook.") ); @@ -37,24 +37,24 @@ ErrorMessage::ErrorMessage (QWidget *parent) setButtonWhatsThis( KDialogBase::User1, i18n("Click here for help regarding the error you selected in the list. This button will not work when no error is selected.") ); setButtonTip( KDialogBase::User1, i18n("Click here for help regarding the error you selected.") ); - QWidget *baseWidget = new QWidget(this); + TQWidget *baseWidget = new TQWidget(this); setMainWidget(baseWidget); - baseLayout = new QVBoxLayout(baseWidget); + baseLayout = new TQVBoxLayout(baseWidget); - label = new QLabel(baseWidget); + label = new TQLabel(baseWidget); label->setText( i18n("In this list you find the error(s) that resulted from running your Logo code. \nGood luck!") ); // \nYou can select an error and click the 'Help on Error' button for help. label->setScaledContents(true); baseLayout->addWidget(label); - spacer = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed ); + spacer = new TQSpacerItem( 10, 10, TQSizePolicy::Minimum, TQSizePolicy::Fixed ); baseLayout->addItem(spacer); - errTable = new QTable(0, 3, baseWidget); - errTable->setSelectionMode(QTable::SingleRow); + errTable = new TQTable(0, 3, baseWidget); + errTable->setSelectionMode(TQTable::SingleRow); errTable->setReadOnly(true); errTable->setShowGrid(false); - errTable->setFocusStyle(QTable::FollowStyle); + errTable->setFocusStyle(TQTable::FollowStyle); errTable->setLeftMargin(0); errTable->horizontalHeader()->setLabel( 0, i18n("number") ); @@ -76,7 +76,7 @@ ErrorMessage::ErrorMessage (QWidget *parent) } -void ErrorMessage::slotAddError(Token& t, const QString& s, uint c) +void ErrorMessage::slotAddError(Token& t, const TQString& s, uint c) { errorData err; err.code = c; @@ -87,8 +87,8 @@ void ErrorMessage::slotAddError(Token& t, const QString& s, uint c) Token currentToken = err.tok; kdDebug(0)<<"ErrorMessage::slotAddError(); >> "<insertRows(0); - errTable->setText( 0, 0, QString::number(errCount) ); // put the count in a hidden field for reference - errTable->setText( 0, 1, QString::number(err.tok.start.row) ); + errTable->setText( 0, 0, TQString::number(errCount) ); // put the count in a hidden field for reference + errTable->setText( 0, 1, TQString::number(err.tok.start.row) ); errTable->setText( 0, 2, err.msg ); errCount++; @@ -107,7 +107,7 @@ void ErrorMessage::display() enableButton (KDialogBase::User1, false); errTable->sortColumn(0, true, true); show(); - connect( errTable, SIGNAL( selectionChanged() ), this, SLOT( updateSelection() ) ); + connect( errTable, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( updateSelection() ) ); } void ErrorMessage::updateSelection() @@ -140,29 +140,29 @@ void ErrorMessage::errorMessageHelp() // BEGIN class ColorPicker dialog -ColorPicker::ColorPicker(QWidget *parent) +ColorPicker::ColorPicker(TQWidget *parent) : KDialogBase(parent, "colorpicker", false, i18n("Color Picker"), KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true ) { // connect to help - connect( this, SIGNAL( helpClicked() ), SLOT( slotColorPickerHelp() ) ); + connect( this, TQT_SIGNAL( helpClicked() ), TQT_SLOT( slotColorPickerHelp() ) ); // for toggling convenience - connect( this, SIGNAL( finished() ), SLOT( slotEmitVisibility() ) ); + connect( this, TQT_SIGNAL( finished() ), TQT_SLOT( slotEmitVisibility() ) ); // Create the top level page and its layout - BaseWidget = new QWidget(this); + BaseWidget = new TQWidget(this); setMainWidget(BaseWidget); // the User1 button: setButtonText( KDialogBase::User1, i18n("Insert Color Code at Cursor") ); - connect( this, SIGNAL( user1Clicked() ), SLOT( slotEmitColorCode() ) ); + connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( slotEmitColorCode() ) ); - QVBoxLayout *vlayout = new QVBoxLayout(BaseWidget); + TQVBoxLayout *vlayout = new TQVBoxLayout(BaseWidget); vlayout->addSpacing(5); // spacing on top // the palette and value selector go into a H-box - QHBoxLayout *h1layout = new QHBoxLayout(BaseWidget); + TQHBoxLayout *h1layout = new TQHBoxLayout(BaseWidget); vlayout->addLayout(h1layout); h1layout->addSpacing(10); // space on the left border @@ -170,19 +170,19 @@ ColorPicker::ColorPicker(QWidget *parent) hsSelector = new KHSSelector(BaseWidget); // the color (SH) selector hsSelector->setMinimumSize(300, 150); h1layout->addWidget(hsSelector); - connect( hsSelector, SIGNAL( valueChanged(int, int) ), SLOT( slotSelectorChanged(int, int) ) ); + connect( hsSelector, TQT_SIGNAL( valueChanged(int, int) ), TQT_SLOT( slotSelectorChanged(int, int) ) ); h1layout->addSpacing(5); // space in between valuePal = new KValueSelector(BaseWidget); // the darkness (V) pal valuePal->setFixedWidth(30); h1layout->addWidget(valuePal); - connect( valuePal, SIGNAL( valueChanged(int) ), SLOT( slotPalChanged(int) ) ); + connect( valuePal, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotPalChanged(int) ) ); vlayout->addSpacing(15); // space in between the top and the bottom widgets // the patch and the codegenerator also go into a H-box - QHBoxLayout *h2layout = new QHBoxLayout(BaseWidget); + TQHBoxLayout *h2layout = new TQHBoxLayout(BaseWidget); vlayout->addLayout(h2layout); h2layout->addSpacing(10); // space on the left border @@ -194,16 +194,16 @@ ColorPicker::ColorPicker(QWidget *parent) h2layout->addSpacing(10); // space in between // the label and the codegenerator go in a V-box - QVBoxLayout *v2layout = new QVBoxLayout(BaseWidget); + TQVBoxLayout *v2layout = new TQVBoxLayout(BaseWidget); h2layout->addLayout(v2layout); - copyable = new QLabel(i18n("Color code:"), BaseWidget); // tha label + copyable = new TQLabel(i18n("Color code:"), BaseWidget); // tha label v2layout->addWidget(copyable); - colorcode = new QLineEdit(BaseWidget); // the code generator + colorcode = new TQLineEdit(BaseWidget); // the code generator colorcode->setReadOnly(true); v2layout->addWidget(colorcode); - connect( colorcode, SIGNAL( selectionChanged() ), SLOT( slotReselect() ) ); + connect( colorcode, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotReselect() ) ); h2layout->addSpacing(5); // spacing on the right border @@ -239,7 +239,7 @@ void ColorPicker::updatePatch() void ColorPicker::updateColorCode() { color.getRgb(&r, &g, &b); - colorcode->setText( QString("%1, %2, %3").arg(r).arg(g).arg(b) ); + colorcode->setText( TQString("%1, %2, %3").arg(r).arg(g).arg(b) ); colorcode->selectAll(); } @@ -269,9 +269,9 @@ void ColorPicker::slotPalChanged(int v_) void ColorPicker::slotReselect() { // reselect by selectAll(), but make sure no looping occurs - disconnect( colorcode, SIGNAL( selectionChanged() ), 0, 0 ); + disconnect( colorcode, TQT_SIGNAL( selectionChanged() ), 0, 0 ); colorcode->selectAll(); - connect( colorcode, SIGNAL( selectionChanged() ), SLOT( slotReselect() ) ); + connect( colorcode, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotReselect() ) ); } void ColorPicker::slotEmitVisibility() @@ -297,17 +297,17 @@ void ColorPicker::slotColorPickerHelp() // BEGIN class RestartOrBack dialog -RestartOrBack::RestartOrBack (QWidget *parent) +RestartOrBack::RestartOrBack (TQWidget *parent) : KDialogBase (parent, "rbDialog", true, 0, KDialogBase::User1 | KDialogBase::User2, KDialogBase::User2, false, i18n("&Restart"), i18n("&Back") ) { setPlainCaption( i18n("Finished Execution") ); setButtonWhatsThis( KDialogBase::User1, i18n("Click here to restart the current logo program.") ); setButtonWhatsThis( KDialogBase::User2, i18n("Click here to switch back to the edit mode.") ); - QWidget *baseWidget = new QWidget(this); + TQWidget *baseWidget = new TQWidget(this); setMainWidget(baseWidget); - baseLayout = new QVBoxLayout(baseWidget); + baseLayout = new TQVBoxLayout(baseWidget); - label = new QLabel(baseWidget); + label = new TQLabel(baseWidget); label->setText( i18n("Execution was finished without errors.\nWhat do you want to do next?") ); label->setScaledContents(true); baseLayout->addWidget(label); diff --git a/kturtle/src/dialogs.h b/kturtle/src/dialogs.h index dd4f2474..0a421d49 100644 --- a/kturtle/src/dialogs.h +++ b/kturtle/src/dialogs.h @@ -27,12 +27,12 @@ #define _DIALOGS_H_ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -46,7 +46,7 @@ struct errorData { uint code; Token tok; - QString msg; + TQString msg; }; @@ -55,7 +55,7 @@ class ErrorMessage : public KDialogBase Q_OBJECT public: - ErrorMessage(QWidget *parent); + ErrorMessage(TQWidget *parent); ~ErrorMessage() {} bool containsErrors(); @@ -63,7 +63,7 @@ class ErrorMessage : public KDialogBase void display(); public slots: - void slotAddError(Token&, const QString&, uint code); + void slotAddError(Token&, const TQString&, uint code); void updateSelection(); private slots: @@ -75,17 +75,17 @@ class ErrorMessage : public KDialogBase void setSelection(uint, uint, uint, uint); private: - typedef QValueList errorList; + typedef TQValueList errorList; errorList errList; - QTable *errTable; + TQTable *errTable; uint errCount; errorData currentError; protected: - QDialog *dialog; - QVBoxLayout *baseLayout; - QLabel *label; - QSpacerItem *spacer; + TQDialog *dialog; + TQVBoxLayout *baseLayout; + TQLabel *label; + TQSpacerItem *spacer; }; // END @@ -99,13 +99,13 @@ class ColorPicker : public KDialogBase Q_OBJECT public: - ColorPicker(QWidget *parent); + ColorPicker(TQWidget *parent); virtual ~ColorPicker() {} signals: void visible(bool); // for toggling convenience - void ColorCode(QString); + void ColorCode(TQString); private: @@ -114,16 +114,16 @@ class ColorPicker : public KDialogBase void updatePatch(); void updateColorCode(); - QWidget *BaseWidget; + TQWidget *BaseWidget; KHSSelector *hsSelector; KValueSelector *valuePal; - QVBoxLayout *vlayout; - QHBoxLayout *h1layout; - QHBoxLayout *h2layout; + TQVBoxLayout *vlayout; + TQHBoxLayout *h1layout; + TQHBoxLayout *h2layout; KColorPatch *patch; - QLabel *copyable; - QLineEdit *colorcode; - QColor color; + TQLabel *copyable; + TQLineEdit *colorcode; + TQColor color; int h, s, v, r, g, b; @@ -151,12 +151,12 @@ class RestartOrBack : public KDialogBase Q_OBJECT public: - RestartOrBack (QWidget *parent); + RestartOrBack (TQWidget *parent); ~RestartOrBack() {} protected: - QVBoxLayout *baseLayout; - QLabel *label; + TQVBoxLayout *baseLayout; + TQLabel *label; }; // END diff --git a/kturtle/src/executer.cpp b/kturtle/src/executer.cpp index f7058146..e50c64a5 100644 --- a/kturtle/src/executer.cpp +++ b/kturtle/src/executer.cpp @@ -23,7 +23,7 @@ #include // for usleep(); #include -#include +#include #include #include @@ -206,7 +206,7 @@ void Executer::execute(TreeNode* node) void Executer::createFunction(TreeNode* node) { - QString funcname = node->getLook(); + TQString funcname = node->getLook(); functionTable[funcname] = node; //store for later use } @@ -214,7 +214,7 @@ void Executer::createFunction(TreeNode* node) //execute a function void Executer::execFunction(TreeNode* node) { - QString funcname = node->getLook(); + TQString funcname = node->getLook(); // locate function node functable::iterator p = functionTable.find(funcname); @@ -249,7 +249,7 @@ void Executer::execFunction(TreeNode* node) // execute the parameters which can be expressions execute(*pfrom); - QString idname = (*pto)->getLook(); + TQString idname = (*pto)->getLook(); funcSymTable[idname] = (*pfrom)->getValue(); ++pto; } @@ -324,8 +324,8 @@ void Executer::execForEach(TreeNode* node) execute(expr1); execute(expr2); - QString expStr1 = expr1->getValue().String(); - QString expStr2 = expr2->getValue().String(); + TQString expStr1 = expr1->getValue().String(); + TQString expStr2 = expr2->getValue().String(); bBreak = false; @@ -351,7 +351,7 @@ void Executer::execFor(TreeNode* node) TreeNode* stopNode = node->thirdChild(); TreeNode* statements = node->fourthChild(); - QString name = id->getLook(); + TQString name = id->getLook(); execute(startNode); //assign startval to id @@ -636,13 +636,13 @@ void Executer::execMinus(TreeNode* node) } -QString Executer::runCommand(const QString& command) +TQString Executer::runCommand(const TQString& command) { FILE *pstream; if ( ( pstream = popen( command.ascii(), "r" ) ) == NULL ) return (""); - QString Line; + TQString Line; char buf[100]; while( fgets(buf, sizeof(buf), pstream) !=NULL) { @@ -658,7 +658,7 @@ QString Executer::runCommand(const QString& command) void Executer::execRun(TreeNode* node) { - QString cmd = exec2getValue( node->firstChild() ).String(); + TQString cmd = exec2getValue( node->firstChild() ).String(); node->setValue( runCommand(cmd) ); } @@ -958,7 +958,7 @@ void Executer::execInputWindow(TreeNode* node) { if ( !checkParameterQuantity(node, 1, 5060) ) return; - QString value = node->firstChild()->getValue().String(); + TQString value = node->firstChild()->getValue().String(); emit InputDialog(value); node->setType(constantNode); @@ -980,7 +980,7 @@ void Executer::execPrint(TreeNode* node) return; } TreeNode::iterator i; - QString str = ""; + TQString str = ""; for (i = node->begin(); i != node->end(); ++i) { execute(*i); // execute expression @@ -994,9 +994,9 @@ void Executer::execFontType(TreeNode* node) // if not 2 params go staight to the checkParam, diplay the error, and return to prevent a crash if ( !checkParameterQuantity(node, 2, 5060) && !checkParameterType(node, stringValue, 5060) ) return; - QString extra; - if (node->size() == 2) QString extra = node->secondChild()->getValue().String(); - QString family = node->firstChild()->getValue().String(); + TQString extra; + if (node->size() == 2) TQString extra = node->secondChild()->getValue().String(); + TQString family = node->firstChild()->getValue().String(); emit FontType(family, extra); } @@ -1015,7 +1015,7 @@ void Executer::startWaiting(int msec) { bStopWaiting = false; // call a timer that sets stopWaiting to true when it runs - QTimer::singleShot( msec, this, SLOT( slotStopWaiting() ) ); + TQTimer::singleShot( msec, this, TQT_SLOT( slotStopWaiting() ) ); while (bStopWaiting == false) { if (bAbort) return; // waits need to be interrupted by the stop action diff --git a/kturtle/src/executer.h b/kturtle/src/executer.h index ac9a1f1b..d4ecdb77 100644 --- a/kturtle/src/executer.h +++ b/kturtle/src/executer.h @@ -26,8 +26,8 @@ #include "treenode.h" -typedef map symtable; -typedef map functable; +typedef map symtable; +typedef map functable; typedef stack runstack; @@ -47,11 +47,11 @@ class Executer : public QObject signals: void Finished(); - void ErrorMsg(Token&, const QString&, uint code); + void ErrorMsg(Token&, const TQString&, uint code); void setSelection(uint, uint, uint, uint); - void InputDialog(QString& value); - void MessageDialog(QString text); + void InputDialog(TQString& value); + void MessageDialog(TQString text); void Clear(); void Go(double x, double y); @@ -73,8 +73,8 @@ class Executer : public QObject void SpriteHide(); void SpritePress(); void SpriteChange(int x); - void Print(QString text); - void FontType(QString family, QString extra); + void Print(TQString text); + void FontType(TQString family, TQString extra); void FontSize(int px); void WrapOn(); void WrapOff(); @@ -154,7 +154,7 @@ class Executer : public QObject Value exec2getValue (TreeNode*); - QString runCommand(const QString&); + TQString runCommand(const TQString&); bool checkParameterQuantity(TreeNode*, uint quantity, int errorCode); bool checkParameterType(TreeNode*, int valueType, int errorCode); diff --git a/kturtle/src/kturtle.cpp b/kturtle/src/kturtle.cpp index 2cc7c5ff..d90228a6 100644 --- a/kturtle/src/kturtle.cpp +++ b/kturtle/src/kturtle.cpp @@ -20,12 +20,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -123,59 +123,59 @@ void MainWindow::setupActions() KActionCollection *ac = actionCollection(); // abbreviation // File actions - KStdAction::openNew(this, SLOT(slotNewFile()), ac); - openExAction = new KAction(i18n("Open Exa&mples..."), "bookmark_folder", CTRL+Key_E, this, SLOT(slotOpenExample()), ac, "open_examples"); - KStdAction::open(this, SLOT(slotOpenFile()), ac); - m_recentFiles = KStdAction::openRecent(this, SLOT(slotOpenFile(const KURL&)), ac); - KStdAction::save(this, SLOT(slotSaveFile()), ac); - KStdAction::saveAs(this, SLOT(slotSaveAs()), ac); - new KAction(i18n("Save &Canvas..."), 0, 0, this, SLOT(slotSaveCanvas()), ac, "save_canvas"); - speed = new KSelectAction(i18n("Execution Speed"), 0, ALT+Key_S, this, SLOT( slotChangeSpeed() ), ac, "speed"); - QStringList speeds; speeds << i18n("Full Speed") << i18n("Slow") << i18n("Slower") << i18n("Slowest"); + KStdAction::openNew(this, TQT_SLOT(slotNewFile()), ac); + openExAction = new KAction(i18n("Open Exa&mples..."), "bookmark_folder", CTRL+Key_E, this, TQT_SLOT(slotOpenExample()), ac, "open_examples"); + KStdAction::open(this, TQT_SLOT(slotOpenFile()), ac); + m_recentFiles = KStdAction::openRecent(this, TQT_SLOT(slotOpenFile(const KURL&)), ac); + KStdAction::save(this, TQT_SLOT(slotSaveFile()), ac); + KStdAction::saveAs(this, TQT_SLOT(slotSaveAs()), ac); + new KAction(i18n("Save &Canvas..."), 0, 0, this, TQT_SLOT(slotSaveCanvas()), ac, "save_canvas"); + speed = new KSelectAction(i18n("Execution Speed"), 0, ALT+Key_S, this, TQT_SLOT( slotChangeSpeed() ), ac, "speed"); + TQStringList speeds; speeds << i18n("Full Speed") << i18n("Slow") << i18n("Slower") << i18n("Slowest"); speed->setItems(speeds); speed->setCurrentItem(0); - run = new KAction(i18n("&Execute Commands"), "gear", ALT+Key_Return, this, SLOT( slotExecute() ), ac, "run"); - pause = new KToggleAction(i18n("Pause E&xecution"), "player_pause", Key_Pause, this, SLOT( slotPauseExecution() ), ac, "pause"); + run = new KAction(i18n("&Execute Commands"), "gear", ALT+Key_Return, this, TQT_SLOT( slotExecute() ), ac, "run"); + pause = new KToggleAction(i18n("Pause E&xecution"), "player_pause", Key_Pause, this, TQT_SLOT( slotPauseExecution() ), ac, "pause"); pause->setChecked(false); pause->setEnabled(false); - stop = new KAction(i18n("Stop E&xecution"), "stop", Key_Escape, this, SLOT( slotAbortExecution() ), ac, "stop"); + stop = new KAction(i18n("Stop E&xecution"), "stop", Key_Escape, this, TQT_SLOT( slotAbortExecution() ), ac, "stop"); stop->setEnabled(false); - KStdAction::print(this, SLOT(slotPrint()), ac); - KStdAction::quit(this, SLOT(close()), ac); + KStdAction::print(this, TQT_SLOT(slotPrint()), ac); + KStdAction::quit(this, TQT_SLOT(close()), ac); // Edit actions - KStdAction::undo(this, SLOT(slotUndo()), ac); - KStdAction::redo(this, SLOT(slotRedo()), ac); - KStdAction::cut(this, SLOT(slotCut()), ac); - KStdAction::copy(this, SLOT(slotCopy()), ac); - KStdAction::paste(this, SLOT(slotPaste()), ac); - KStdAction::selectAll(this, SLOT(slotSelectAll()), ac); - KStdAction::deselect(this, SLOT(slotClearSelection()), ac); - new KToggleAction(i18n("Toggle Insert"), Key_Insert, this, SLOT(slotToggleInsert()), ac, "set_insert"); - KStdAction::find(this, SLOT(slotFind()), ac); - KStdAction::findNext(this, SLOT(slotFindNext()), ac); - KStdAction::findPrev(this, SLOT(slotFindPrevious()), ac); - KStdAction::replace(this, SLOT(slotReplace()), ac); + KStdAction::undo(this, TQT_SLOT(slotUndo()), ac); + KStdAction::redo(this, TQT_SLOT(slotRedo()), ac); + KStdAction::cut(this, TQT_SLOT(slotCut()), ac); + KStdAction::copy(this, TQT_SLOT(slotCopy()), ac); + KStdAction::paste(this, TQT_SLOT(slotPaste()), ac); + KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), ac); + KStdAction::deselect(this, TQT_SLOT(slotClearSelection()), ac); + new KToggleAction(i18n("Toggle Insert"), Key_Insert, this, TQT_SLOT(slotToggleInsert()), ac, "set_insert"); + KStdAction::find(this, TQT_SLOT(slotFind()), ac); + KStdAction::findNext(this, TQT_SLOT(slotFindNext()), ac); + KStdAction::findPrev(this, TQT_SLOT(slotFindPrevious()), ac); + KStdAction::replace(this, TQT_SLOT(slotReplace()), ac); // View actions - new KToggleAction(i18n("Show &Line Numbers"), 0, Key_F11, this, SLOT(slotToggleLineNumbers()), ac, "line_numbers"); - m_fullscreen = KStdAction::fullScreen(this, SLOT(slotToggleFullscreen()), ac, this, "full_screen"); + new KToggleAction(i18n("Show &Line Numbers"), 0, Key_F11, this, TQT_SLOT(slotToggleLineNumbers()), ac, "line_numbers"); + m_fullscreen = KStdAction::fullScreen(this, TQT_SLOT(slotToggleFullscreen()), ac, this, "full_screen"); m_fullscreen->setChecked(b_fullscreen); // Tools actions - colorpicker = new KToggleAction(i18n("&Color Picker"), "colorize", ALT+Key_C, this, SLOT(slotColorPicker()), ac, "color_picker"); - new KAction(i18n("&Indent"), "indent", CTRL+Key_I, this, SLOT(slotIndent()), ac, "edit_indent"); - new KAction(i18n("&Unindent"), "unindent", CTRL+SHIFT+Key_I, this, SLOT(slotUnIndent()), ac, "edit_unindent"); - new KAction(i18n("Cl&ean Indentation"), 0, 0, this, SLOT(slotCleanIndent()), ac, "edit_cleanIndent"); - new KAction(i18n("Co&mment"), 0, CTRL+Key_D, this, SLOT(slotComment()), ac, "edit_comment"); - new KAction(i18n("Unc&omment"), 0, CTRL+SHIFT+Key_D, this, SLOT(slotUnComment()), ac, "edit_uncomment"); + colorpicker = new KToggleAction(i18n("&Color Picker"), "colorize", ALT+Key_C, this, TQT_SLOT(slotColorPicker()), ac, "color_picker"); + new KAction(i18n("&Indent"), "indent", CTRL+Key_I, this, TQT_SLOT(slotIndent()), ac, "edit_indent"); + new KAction(i18n("&Unindent"), "unindent", CTRL+SHIFT+Key_I, this, TQT_SLOT(slotUnIndent()), ac, "edit_unindent"); + new KAction(i18n("Cl&ean Indentation"), 0, 0, this, TQT_SLOT(slotCleanIndent()), ac, "edit_cleanIndent"); + new KAction(i18n("Co&mment"), 0, CTRL+Key_D, this, TQT_SLOT(slotComment()), ac, "edit_comment"); + new KAction(i18n("Unc&omment"), 0, CTRL+SHIFT+Key_D, this, TQT_SLOT(slotUnComment()), ac, "edit_uncomment"); // Settings actions - KStdAction::preferences( this, SLOT(slotSettings()), ac ); - new KAction(i18n("&Configure Editor..."), "configure", 0, this, SLOT(slotEditor()), ac, "set_confdlg"); + KStdAction::preferences( this, TQT_SLOT(slotSettings()), ac ); + new KAction(i18n("&Configure Editor..."), "configure", 0, this, TQT_SLOT(slotEditor()), ac, "set_confdlg"); // Help actions - ContextHelp = new KAction(0, 0, Key_F2, this, SLOT(slotContextHelp()), ac, "context_help"); + ContextHelp = new KAction(0, 0, Key_F2, this, TQT_SLOT(slotContextHelp()), ac, "context_help"); slotContextHelpUpdate(); // this sets the label of this action // other @@ -185,13 +185,13 @@ void MainWindow::setupActions() void MainWindow::setupEditor() { - editorDock = new QDockWindow(this); + editorDock = new TQDockWindow(this); editorDock->setNewLine(true); editorDock->setFixedExtentWidth(250); editorDock->setFixedExtentHeight(150); editorDock->setResizeEnabled(true); - editorDock->setFrameShape(QFrame::ToolBarPanel); - QWhatsThis::add( editorDock, i18n( "This is the code editor, here you type the Logo commands to instruct the turtle. You can also open an existing Logo program with File->Open Examples... or File->Open." ) ); + editorDock->setFrameShape(TQFrame::ToolBarPanel); + TQWhatsThis::add( editorDock, i18n( "This is the code editor, here you type the Logo commands to instruct the turtle. You can also open an existing Logo program with File->Open Examples... or File->Open." ) ); moveDockWindow(editorDock, Qt::DockLeft); editor = doc->createView (editorDock, 0L); // editorInterface is the editor interface which allows us to access the text in the part @@ -204,9 +204,9 @@ void MainWindow::setupEditor() slotSetHighlightstyle( Settings::logoLanguage() ); // allow the cursor position to be indicated in the statusbar - connect( editor, SIGNAL(cursorPositionChanged()), this, SLOT(slotCursorStatusBar()) ); + connect( editor, TQT_SIGNAL(cursorPositionChanged()), this, TQT_SLOT(slotCursorStatusBar()) ); // and update the context help menu item - connect( editor, SIGNAL(cursorPositionChanged()), this, SLOT(slotContextHelpUpdate()) ); + connect( editor, TQT_SIGNAL(cursorPositionChanged()), this, TQT_SLOT(slotContextHelpUpdate()) ); translate = new Translate(); } @@ -227,16 +227,16 @@ void MainWindow::setupStatusBar() void MainWindow::setupCanvas() { - baseWidget = new QWidget(this); + baseWidget = new TQWidget(this); setCentralWidget(baseWidget); - baseLayout = new QGridLayout(baseWidget, 0, 0); + baseLayout = new TQGridLayout(baseWidget, 0, 0); canvasView = new Canvas(baseWidget); baseLayout->addWidget(canvasView, 0, 0, AlignCenter); baseLayout->setRowStretch(0, 1); // this apperntly fixes a pre-usefull scrollbars bug baseLayout->setColStretch(0, 1); - QWhatsThis::add( canvasView, i18n("This is the canvas, here the turtle draws a picture.") ); + TQWhatsThis::add( canvasView, i18n("This is the canvas, here the turtle draws a picture.") ); canvasView->show(); - connect( canvasView, SIGNAL( CanvasResized() ), this, SLOT( slotUpdateCanvas() ) ); + connect( canvasView, TQT_SIGNAL( CanvasResized() ), this, TQT_SLOT( slotUpdateCanvas() ) ); } // END @@ -245,7 +245,7 @@ void MainWindow::setupCanvas() // BEGIN staturbar related functions -void MainWindow::slotStatusBar(QString text, int id) +void MainWindow::slotStatusBar(TQString text, int id) { text = " " + text + " "; // help the layout statusBar()->changeItem(text, id); @@ -256,7 +256,7 @@ void MainWindow::slotCursorStatusBar() uint cursorLine; uint cursorCol; dynamic_cast(editor)->cursorPositionReal(&cursorLine, &cursorCol); - QString linenumber = i18n(" Line: %1 Column: %2 ").arg(cursorLine + 1).arg(cursorCol + 1); + TQString linenumber = i18n(" Line: %1 Column: %2 ").arg(cursorLine + 1).arg(cursorCol + 1); statusBar()->changeItem(linenumber, IDS_LINECOLUMN); } @@ -292,7 +292,7 @@ void MainWindow::slotOpenFile(const KURL &urlRef) KURL url = urlRef; if ( url.isEmpty() ) { - url = KFileDialog::getOpenURL( QString(":logo_dir"), QString("*.logo|") + i18n("Logo Files"), this, i18n("Open Logo File") ); + url = KFileDialog::getOpenURL( TQString(":logo_dir"), TQString("*.logo|") + i18n("Logo Files"), this, i18n("Open Logo File") ); } loadFile(url); } @@ -301,7 +301,7 @@ void MainWindow::slotOpenExample() { KURL url; url.setPath( locate("data", "kturtle/examples/" + Settings::logoLanguage() + "/") ); - url = KFileDialog::getOpenURL( url.path(), QString("*.logo|") + i18n("Logo Examples Files"), this, i18n("Open Logo Example File") ); + url = KFileDialog::getOpenURL( url.path(), TQString("*.logo|") + i18n("Logo Examples Files"), this, i18n("Open Logo Example File") ); loadFile(url); } @@ -309,7 +309,7 @@ void MainWindow::loadFile(const KURL &url) { if ( !url.isEmpty() ) { - QFile file( url.path() ); + TQFile file( url.path() ); if ( file.open(IO_ReadOnly) ) { if ( editor->document()->isModified() ) @@ -324,8 +324,8 @@ void MainWindow::loadFile(const KURL &url) return; } } - QTextStream stream(&file); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::UnicodeUTF8); editorInterface->setText( stream.read() ); file.close(); m_recentFiles->addURL(url); @@ -357,13 +357,13 @@ void MainWindow::slotSaveAs() KURL url; while (true) { - url = KFileDialog::getSaveURL( QString(":logo_dir"), QString("*.logo|") + i18n("Logo Files"), this, i18n("Save As") ); + url = KFileDialog::getSaveURL( TQString(":logo_dir"), TQString("*.logo|") + i18n("Logo Files"), this, i18n("Save As") ); if ( url.isEmpty() ) // cancelled the save dialog { slotStatusBar(i18n("Saving aborted."), IDS_STATUS); return; } - if ( QFile( url.path() ).exists() ) + if ( TQFile( url.path() ).exists() ) { int result = KMessageBox::warningContinueCancel ( this, i18n("A program named \"%1\" already exists in this folder. " @@ -398,10 +398,10 @@ void MainWindow::slotSaveCanvas() KURL url; while (true) { - url = KFileDialog::getSaveURL( QString(":logo_dir"), QString("*.png|") + + url = KFileDialog::getSaveURL( TQString(":logo_dir"), TQString("*.png|") + i18n("Pictures"), this, i18n("Save Canvas as Picture") ); if ( url.isEmpty() ) return; // when cancelled the KFiledialog? - if ( QFile( url.path() ).exists() ) + if ( TQFile( url.path() ).exists() ) { int result = KMessageBox::warningContinueCancel( this, i18n("A picture named \"%1\" already in this folder. " @@ -412,10 +412,10 @@ void MainWindow::slotSaveCanvas() break; } - QString type( KImageIO::type( url.path() ) ); + TQString type( KImageIO::type( url.path() ) ); if ( type.isNull() ) type = "PNG"; bool ok = false; - QPixmap* pixmap = canvasView->canvas2Pixmap(); + TQPixmap* pixmap = canvasView->canvas2Pixmap(); if ( url.isLocalFile() ) { KSaveFile saveFile( url.path() ); @@ -453,8 +453,8 @@ void MainWindow::slotPrint() KPrinter printer; if ( printer.setup(this) ) { - QPainter painter(&printer); - QPixmap *CanvasPic = canvasView->canvas2Pixmap(); + TQPainter painter(&printer); + TQPixmap *CanvasPic = canvasView->canvas2Pixmap(); painter.drawPixmap(0, 0, *CanvasPic); } return; @@ -522,13 +522,13 @@ void MainWindow::slotExecute() kdDebug(0)<<"############## PARSING STARTED ##############"<processEvents(); errMsg = new ErrorMessage(this); // create an empty errorDialog - QString txt = editorInterface->text() + "\x0a\x0a"; // parser expects input to have 2 delimiting newlines - QTextIStream in(&txt); // create the stream + TQString txt = editorInterface->text() + "\x0a\x0a"; // parser expects input to have 2 delimiting newlines + TQTextIStream in(&txt); // create the stream Parser parser(in); // pass the reference to the stream to the parse object - connect(&parser, SIGNAL( ErrorMsg(Token&, const QString&, uint) ), - errMsg, SLOT( slotAddError(Token&, const QString&, uint) ) ); - connect( errMsg, SIGNAL(setSelection(uint, uint, uint, uint) ), - this, SLOT(slotSetSelection(uint, uint, uint, uint) ) ); + connect(&parser, TQT_SIGNAL( ErrorMsg(Token&, const TQString&, uint) ), + errMsg, TQT_SLOT( slotAddError(Token&, const TQString&, uint) ) ); + connect( errMsg, TQT_SIGNAL(setSelection(uint, uint, uint, uint) ), + this, TQT_SLOT(slotSetSelection(uint, uint, uint, uint) ) ); parser.parse(); // and GO! TreeNode* root = parser.getTree(); // when finished parsing get the nodeTree kdDebug(0)<<"############## PARSING FINISHED ##############"<currentItem() == 0) slotClearSelection(); // if coming from fullscreen-mode show the editor, menu- and statusbar - if (b_fullscreen) QTimer::singleShot( 1000, this, SLOT( slotFinishedFullScreenExecution() ) ); + if (b_fullscreen) TQTimer::singleShot( 1000, this, TQT_SLOT( slotFinishedFullScreenExecution() ) ); } void MainWindow::slotChangeSpeed() @@ -636,12 +636,12 @@ void MainWindow::slotChangeSpeed() // slots for logo functions that need to use the MainWindow class: -void MainWindow::slotInputDialog(QString& value) +void MainWindow::slotInputDialog(TQString& value) { value = KInputDialog::getText(i18n("Input"), value); } -void MainWindow::slotMessageDialog(QString text) +void MainWindow::slotMessageDialog(TQString text) { KMessageBox::information( this, text, i18n("Message") ); } @@ -658,7 +658,7 @@ void MainWindow::slotEditor() a->activate(); } -void MainWindow::slotSetHighlightstyle(QString langCode) +void MainWindow::slotSetHighlightstyle(TQString langCode) { KTextEditor::HighlightingInterface *hli = dynamic_cast(doc); for (uint i = 0; i < hli->hlModeCount(); i++) @@ -781,7 +781,7 @@ void MainWindow::slotToggleLineNumbers() a->activate(); } -void MainWindow::slotInsertText(QString str) +void MainWindow::slotInsertText(TQString str) { uint StartLine, StartCol, EndLine, EndCol; dynamic_cast(editor)->cursorPositionReal(&StartLine, &StartCol); @@ -813,10 +813,10 @@ void MainWindow::slotToggleFullscreen() else if ( isFullScreen() ) showNormal(); } -bool MainWindow::event(QEvent* e) +bool MainWindow::event(TQEvent* e) { // executes updateFullScreen() after a ShowFullScreen or ShowNormal event got triggered - if (e->type() == QEvent::ShowFullScreen || e->type() == QEvent::ShowNormal) updateFullScreen(); + if (e->type() == TQEvent::ShowFullScreen || e->type() == TQEvent::ShowNormal) updateFullScreen(); return KMainWindow::event(e); } @@ -833,9 +833,9 @@ void MainWindow::slotFinishedFullScreenExecution() if ( errMsg->containsErrors() ) slotBackToFullScreen(); // straight back to edit if there where errors else { - connect( restartOrBackDialog, SIGNAL( user1Clicked() ), this, SLOT( slotRestartFullScreen() ) ); - connect( restartOrBackDialog, SIGNAL( user2Clicked() ), this, SLOT( slotBackToFullScreen() ) ); - connect( restartOrBackDialog, SIGNAL( finished() ), this, SLOT( slotBackToFullScreen() ) ); + connect( restartOrBackDialog, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( slotRestartFullScreen() ) ); + connect( restartOrBackDialog, TQT_SIGNAL( user2Clicked() ), this, TQT_SLOT( slotBackToFullScreen() ) ); + connect( restartOrBackDialog, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotBackToFullScreen() ) ); restartOrBackDialog->show(); restartOrBackDialog->move(50, 50); } @@ -870,21 +870,21 @@ void MainWindow::slotSettings() // Create a new dialog with the same name as the above checking code. KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self() ); // connect the help - connect( dialog, SIGNAL( helpClicked() ), this, SLOT( slotSettingsHelp() ) ); + connect( dialog, TQT_SIGNAL( helpClicked() ), this, TQT_SLOT( slotSettingsHelp() ) ); // making the filling for the 'General' settings dept. - general = new QWidget(); - QGridLayout *generalLayout = new QGridLayout( general, 1, 1, 11, 6, "generalLayout"); - WidthHeightBox = new QGroupBox( i18n("Initial Canvas Size"), general ); + general = new TQWidget(); + TQGridLayout *generalLayout = new TQGridLayout( general, 1, 1, 11, 6, "generalLayout"); + WidthHeightBox = new TQGroupBox( i18n("Initial Canvas Size"), general ); WidthHeightBox->setColumnLayout(0, Qt::Vertical ); WidthHeightBox->layout()->setSpacing( 6 ); WidthHeightBox->layout()->setMargin( 11 ); - QVBoxLayout *WidthHeightBoxLayout = new QVBoxLayout( WidthHeightBox->layout() ); + TQVBoxLayout *WidthHeightBoxLayout = new TQVBoxLayout( WidthHeightBox->layout() ); WidthHeightBoxLayout->setAlignment( Qt::AlignTop ); - QHBoxLayout *layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); - QVBoxLayout *layout2 = new QVBoxLayout( 0, 0, 6, "layout2"); + TQHBoxLayout *layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); + TQVBoxLayout *layout2 = new TQVBoxLayout( 0, 0, 6, "layout2"); - QVBoxLayout *layout1 = new QVBoxLayout( 0, 0, 6, "layout1"); + TQVBoxLayout *layout1 = new TQVBoxLayout( 0, 0, 6, "layout1"); kcfg_CanvasWidth = new KIntNumInput( WidthHeightBox, "kcfg_CanvasWidth" ); kcfg_CanvasWidth->setValue( 400 ); @@ -898,65 +898,65 @@ void MainWindow::slotSettings() kcfg_CanvasHeight->setReferencePoint( 1 ); layout1->addWidget( kcfg_CanvasHeight ); - WidthLabel = new QLabel( kcfg_CanvasWidth, i18n("Canvas &width:"), WidthHeightBox ); + WidthLabel = new TQLabel( kcfg_CanvasWidth, i18n("Canvas &width:"), WidthHeightBox ); layout2->addWidget( WidthLabel ); - HeightLabel = new QLabel( kcfg_CanvasHeight, i18n("Ca&nvas height:"), WidthHeightBox ); + HeightLabel = new TQLabel( kcfg_CanvasHeight, i18n("Ca&nvas height:"), WidthHeightBox ); layout2->addWidget( HeightLabel ); layout3->addLayout( layout2 ); layout3->addLayout( layout1 ); WidthHeightBoxLayout->addLayout( layout3 ); - QLabel* WidthHeightLabel = new QLabel(i18n("You need to restart before these settings have effect"), WidthHeightBox); + TQLabel* WidthHeightLabel = new TQLabel(i18n("You need to restart before these settings have effect"), WidthHeightBox); WidthHeightBoxLayout->addWidget( WidthHeightLabel ); generalLayout->addWidget( WidthHeightBox, 0, 0 ); - general->resize( QSize(234, 109).expandedTo(minimumSizeHint()) ); + general->resize( TQSize(234, 109).expandedTo(minimumSizeHint()) ); dialog->addPage( general, i18n("General"), "package_settings", i18n("General Settings") ); // making the filling for the 'Language' settings dept. - QWidget *language = new QWidget(); - QGridLayout *languageLayout = new QGridLayout( language, 1, 1, 11, 6, "Form1Layout"); - QGroupBox *groupBox1 = new QGroupBox( language, "groupBox1" ); + TQWidget *language = new TQWidget(); + TQGridLayout *languageLayout = new TQGridLayout( language, 1, 1, 11, 6, "Form1Layout"); + TQGroupBox *groupBox1 = new TQGroupBox( language, "groupBox1" ); groupBox1->setColumnLayout(0, Qt::Vertical ); groupBox1->layout()->setSpacing( 6 ); groupBox1->layout()->setMargin( 11 ); - QGridLayout *groupBox1Layout = new QGridLayout( groupBox1->layout() ); + TQGridLayout *groupBox1Layout = new TQGridLayout( groupBox1->layout() ); groupBox1Layout->setAlignment( Qt::AlignTop ); - QVBoxLayout *layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); + TQVBoxLayout *layout4 = new TQVBoxLayout( 0, 0, 6, "layout4"); kcfg_LanguageComboBox = new KComboBox(groupBox1, "kcfg_LanguageComboBox"); kcfg_LanguageComboBox->setEditable(false); - QStringList LogoLanguageList = Settings::logoLanguageList(); + TQStringList LogoLanguageList = Settings::logoLanguageList(); // Add the full language names to the items - for ( QStringList::Iterator it = LogoLanguageList.begin(); it != LogoLanguageList.end(); ++it ) { + for ( TQStringList::Iterator it = LogoLanguageList.begin(); it != LogoLanguageList.end(); ++it ) { *it = KGlobal::locale()->twoAlphaToLanguageName( (*it).left(2) ) + " (" + *it + ")"; } kcfg_LanguageComboBox->insertStringList(LogoLanguageList); - LanguageLabel = new QLabel(kcfg_LanguageComboBox, i18n("&Select the language for the Logo commands:"), groupBox1); + LanguageLabel = new TQLabel(kcfg_LanguageComboBox, i18n("&Select the language for the Logo commands:"), groupBox1); layout4->addWidget( LanguageLabel ); layout4->addWidget( kcfg_LanguageComboBox ); LanguageLabel->setBuddy( kcfg_LanguageComboBox ); groupBox1Layout->addLayout( layout4, 0, 0 ); languageLayout->addWidget( groupBox1, 0, 0 ); - language->resize( QSize(373, 80).expandedTo(minimumSizeHint()) ); + language->resize( TQSize(373, 80).expandedTo(minimumSizeHint()) ); dialog->addPage( language, i18n("Language"), "locale", i18n("Language Settings") ); // When the user clicks OK or Apply we want to update our settings. - connect( dialog, SIGNAL( settingsChanged() ), this, SLOT( slotUpdateSettings() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT( slotUpdateSettings() ) ); // Display the dialog is there where errors. - dialog->setInitialSize( QSize(550, 300) ); + dialog->setInitialSize( TQSize(550, 300) ); dialog->show(); } void MainWindow::slotUpdateSettings() { // get the selected language as a language code - QString selectedLogoLanguage = kcfg_LanguageComboBox->currentText().section( "(", -1, -1 ).remove(")"); + TQString selectedLogoLanguage = kcfg_LanguageComboBox->currentText().section( "(", -1, -1 ).remove(")"); // update the settings Settings::setLogoLanguage( selectedLogoLanguage ); Settings::setLanguageComboBox( kcfg_LanguageComboBox->currentItem() ); @@ -1012,7 +1012,7 @@ void MainWindow::slotContextHelp() kdDebug(0)<<"help requested on this text: "<") ) { KMessageBox::information( this, i18n("There is currently no text under the cursor to get help on."), i18n("Nothing Under Cursor") ); @@ -1042,7 +1042,7 @@ void MainWindow::slotContextHelp() kapp->invokeHelp(helpWord, "", ""); - QString help2statusBar; + TQString help2statusBar; if ( helpKeyword.startsWith("<") ) help2statusBar = helpKeyword; else help2statusBar = i18n("\"%1\"").arg(helpKeyword); slotStatusBar(i18n("Displaying help on %1").arg(help2statusBar), IDS_STATUS); @@ -1052,7 +1052,7 @@ void MainWindow::slotContextHelpUpdate() { uint row, col; dynamic_cast(editor)->cursorPositionReal(&row, &col); - QString line = dynamic_cast(doc)->textLine(row); + TQString line = dynamic_cast(doc)->textLine(row); // two shortcuts so we dont do all the CPU intensive regexp stuff when it not needed if ( line.stripWhiteSpace().startsWith("#") ) @@ -1073,7 +1073,7 @@ void MainWindow::slotContextHelpUpdate() pos = 0; if ( line.contains('"') ) { - QRegExp delimitedStrings("(\"[^\"\\\\\\r\\n]*(\\\\.[^\"\\\\\\r\\n]*)*\")"); + TQRegExp delimitedStrings("(\"[^\"\\\\\\r\\n]*(\\\\.[^\"\\\\\\r\\n]*)*\")"); while ( delimitedStrings.search(line, pos) != -1 ) { // kdDebug(0)<<"stringsearch: >>"<[!]|(?!==|<=|>=|!=))*)|(([ ,+\\-*/()=<>[!]|==|<=|>=|!=))"); + TQRegExp splitter("(([^ ,+\\-*/()=<>[!]|(?!==|<=|>=|!=))*)|(([ ,+\\-*/()=<>[!]|==|<=|>=|!=))"); pos = 0; while (splitter.search(line, pos) != -1) @@ -1101,7 +1101,7 @@ void MainWindow::slotContextHelpUpdate() if ( col < (uint)start ) break; if ( col >= (uint)start && col < (uint)(start+length) ) { - QString cursorWord = line.mid( (uint)start, (uint)length ); + TQString cursorWord = line.mid( (uint)start, (uint)length ); kdDebug(0)<<"cursorWord: '"<name2key( cursorWord.lower() )): '"<name2key( cursorWord.lower() )<<"'"<name2key( cursorWord.lower() ).isEmpty() ) helpKeyword = cursorWord; else if ( !translate->alias2key( cursorWord.lower() ).isEmpty() ) helpKeyword = cursorWord; - else if ( cursorWord.find( QRegExp("[\\d.]+") ) == 0 ) helpKeyword = i18n(""); + else if ( cursorWord.find( TQRegExp("[\\d.]+") ) == 0 ) helpKeyword = i18n(""); - else if ( cursorWord.find( QRegExp("[+\\-*/\\(\\)]") ) == 0 ) helpKeyword = i18n(""); + else if ( cursorWord.find( TQRegExp("[+\\-*/\\(\\)]") ) == 0 ) helpKeyword = i18n(""); - else if ( cursorWord == QString("=") ) helpKeyword = i18n(""); + else if ( cursorWord == TQString("=") ) helpKeyword = i18n(""); - else if ( cursorWord.find( QRegExp("==|<|>|<=|>=|!=") ) == 0 ) helpKeyword = i18n(""); + else if ( cursorWord.find( TQRegExp("==|<|>|<=|>=|!=") ) == 0 ) helpKeyword = i18n(""); // if we come here we either have an ID of some sort or an error // all we can do is try to catch some errors (TODO) and then... @@ -1150,8 +1150,8 @@ void MainWindow::slotColorPicker() { picker = new ColorPicker(this); if(picker == 0) return; // safety - connect( picker, SIGNAL( visible(bool) ), colorpicker, SLOT( setChecked(bool) ) ); - connect( picker, SIGNAL( ColorCode(QString) ), this, SLOT( slotInsertText(QString) ) ); + connect( picker, TQT_SIGNAL( visible(bool) ), colorpicker, TQT_SLOT( setChecked(bool) ) ); + connect( picker, TQT_SIGNAL( ColorCode(TQString) ), this, TQT_SLOT( slotInsertText(TQString) ) ); } // if picker is not 0, there is a colorpickerdialog which only needs to be shown OR hidden if ( picker->isHidden() ) diff --git a/kturtle/src/kturtle.h b/kturtle/src/kturtle.h index 8ffd55df..3e52215e 100644 --- a/kturtle/src/kturtle.h +++ b/kturtle/src/kturtle.h @@ -24,7 +24,7 @@ #endif -#include +#include #include #include @@ -70,11 +70,11 @@ class MainWindow : public KParts::MainWindow void slotPauseExecution(); void slotAbortExecution(); void slotChangeSpeed(); - void slotInputDialog(QString& value); - void slotMessageDialog(QString text); + void slotInputDialog(TQString& value); + void slotMessageDialog(TQString text); void slotEditor(); - void slotSetHighlightstyle(QString langCode); + void slotSetHighlightstyle(TQString langCode); void slotUndo(); void slotRedo(); void slotCut(); @@ -87,7 +87,7 @@ class MainWindow : public KParts::MainWindow void slotFindPrevious(); void slotReplace(); void slotToggleInsert(); - void slotInsertText(QString); + void slotInsertText(TQString); void slotToggleLineNumbers(); void slotIndent(); void slotUnIndent(); @@ -104,7 +104,7 @@ class MainWindow : public KParts::MainWindow void slotContextHelp(); void slotContextHelpUpdate(); - void slotStatusBar(QString text, int place); + void slotStatusBar(TQString text, int place); void slotCursorStatusBar(); void slotToggleFullscreen(); @@ -130,12 +130,12 @@ class MainWindow : public KParts::MainWindow void readConfig(KConfig *config); void updateFullScreen(); - virtual bool event(QEvent* e); + virtual bool event(TQEvent* e); Canvas *canvasView; - QWidget *baseWidget; - QGridLayout *baseLayout; - QDockWindow *editorDock; + TQWidget *baseWidget; + TQGridLayout *baseLayout; + TQDockWindow *editorDock; Executer *exe; ErrorMessage *errMsg; ColorPicker *picker; @@ -162,20 +162,20 @@ class MainWindow : public KParts::MainWindow bool b_fullscreen; bool b_editorShown; - QString helpKeyword; + TQString helpKeyword; Translate *translate; KURL CurrentFile; // configuration related - QWidget *general; - QWidget *language; - QGroupBox *WidthHeightBox; - QLabel *WidthLabel; - QLabel *HeightLabel; + TQWidget *general; + TQWidget *language; + TQGroupBox *WidthHeightBox; + TQLabel *WidthLabel; + TQLabel *HeightLabel; KIntNumInput *kcfg_CanvasWidth; KIntNumInput *kcfg_CanvasHeight; KComboBox *kcfg_LanguageComboBox; - QLabel *LanguageLabel; + TQLabel *LanguageLabel; }; diff --git a/kturtle/src/lexer.cpp b/kturtle/src/lexer.cpp index 1a480641..ae6f3d61 100644 --- a/kturtle/src/lexer.cpp +++ b/kturtle/src/lexer.cpp @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -27,7 +27,7 @@ #include "lexer.h" -Lexer::Lexer(QTextIStream& iStream) +Lexer::Lexer(TQTextIStream& iStream) { inputStream = &iStream; row = 1; @@ -48,7 +48,7 @@ Token Lexer::lex() currentToken.start.row = row; currentToken.start.col = col; - QChar currentChar = getChar(); + TQChar currentChar = getChar(); if ( inputStream->atEnd() ) { @@ -65,7 +65,7 @@ Token Lexer::lex() currentChar = getChar(); } - // if (currentChar.category() == QChar::Separator_Line) somehow doesnt work + // if (currentChar.category() == TQChar::Separator_Line) somehow doesnt work if (currentChar == '\x0a' || currentChar == '\n') { currentToken.type = tokEOL; @@ -198,14 +198,14 @@ Token Lexer::lex() // PRIVATEs -QChar Lexer::getChar() +TQChar Lexer::getChar() { - QChar c; + TQChar c; if ( !putBackChar.isNull() ) { c = putBackChar; // use the char that is stored to be put back // kdDebug(0)<<"Lexer::getChar(), restored: '"<> c; // take a QChar of the inputStream + *inputStream >> c; // take a TQChar of the inputStream // kdDebug(0)<<"Lexer::getChar(): '"<atEnd() ) { @@ -272,7 +272,7 @@ void Lexer::setTokenType(Token& currentToken) if (currentToken.type == tokUnknown) { // make lowercase copy of the word as it was found in the inputStream - QString k = currentToken.look.lower(); + TQString k = currentToken.look.lower(); // if the key is an alias translate that alias to a key if ( !translate->alias2key(k).isEmpty() ) k = translate->alias2key(k); @@ -343,8 +343,8 @@ void Lexer::setTokenType(Token& currentToken) void Lexer::skipSpaces() { // kdDebug(0)<<"Lexer::skipSpaces(), skipping SPACES."<atEnd() && ( currentChar.isSpace() && !(currentChar == '\x0a' || currentChar == '\n') ) ) { currentChar = getChar(); @@ -353,12 +353,12 @@ void Lexer::skipSpaces() } -int Lexer::getNumber(Value& num, QString& look) +int Lexer::getNumber(Value& num, TQString& look) { // by reference the value (Value) and look part are set // kdDebug(0)<<"Lexer::getNumber()"<atEnd() ) @@ -380,8 +380,8 @@ int Lexer::getNumber(Value& num, QString& look) void Lexer::getString(Token& currentToken) { - QString str = "\""; // start with a " cauz it just got lost - QChar currentChar = QChar(); // start empty + TQString str = "\""; // start with a " cauz it just got lost + TQChar currentChar = TQChar(); // start empty while ( currentChar != '"' && !(currentChar == '\x0a' || currentChar == '\n') && !inputStream->atEnd() ) { currentChar = getChar(); diff --git a/kturtle/src/lexer.h b/kturtle/src/lexer.h index 49317f8e..37dccf08 100644 --- a/kturtle/src/lexer.h +++ b/kturtle/src/lexer.h @@ -20,9 +20,9 @@ #ifndef _LEXER_H_ #define _LEXER_H_ -#include -#include -#include +#include +#include +#include #include "token.h" #include "translate.h" @@ -32,25 +32,25 @@ class Lexer { public: - Lexer(QTextIStream&); + Lexer(TQTextIStream&); ~Lexer() {} Token lex(); // returns the next Token, skipping spaces private: - QChar getChar(); - void ungetChar(QChar); - int getWord(QString&); + TQChar getChar(); + void ungetChar(TQChar); + int getWord(TQString&); void skipSpaces(); void setTokenType(Token&); - int getNumber(Value&, QString&); + int getNumber(Value&, TQString&); void getString(Token&); - QTextIStream *inputStream; + TQTextIStream *inputStream; Translate *translate; uint row, col, prevCol; - QChar putBackChar; + TQChar putBackChar; }; diff --git a/kturtle/src/parser.cpp b/kturtle/src/parser.cpp index ca1fafd7..07a33aea 100644 --- a/kturtle/src/parser.cpp +++ b/kturtle/src/parser.cpp @@ -20,7 +20,7 @@ // allmost every aspect of it is heavily changed by Cies Breijs. -#include +#include #include #include @@ -28,7 +28,7 @@ #include "parser.h" -Parser::Parser(QTextIStream& in) +Parser::Parser(TQTextIStream& in) { lexer = new Lexer(in); tree = new TreeNode(); @@ -198,8 +198,8 @@ TreeNode* Parser::Factor() case tokString: node = new TreeNode(currentToken, constantNode); - { // extra scope to localize the QString 'str' - QString str = currentToken.look; + { // extra scope to localize the TQString 'str' + TQString str = currentToken.look; if ( currentToken.look.endsWith("\"") ) { // cut off the quotes and store the value @@ -238,7 +238,7 @@ TreeNode* Parser::Factor() break; default: - QString s = currentToken.look; + TQString s = currentToken.look; if ( s.isEmpty() || currentToken.type == tokEOF ) { Error(currentToken, i18n("INTERNAL ERROR NR %1: please sent this Logo script to KTurtle developers").arg(1), 1020); @@ -1075,7 +1075,7 @@ TreeNode* Parser::Other() } -void Parser::Error(Token& t, const QString& s, uint code) +void Parser::Error(Token& t, const TQString& s, uint code) { emit ErrorMsg(t, s, code); } diff --git a/kturtle/src/parser.h b/kturtle/src/parser.h index 28be566f..68836221 100644 --- a/kturtle/src/parser.h +++ b/kturtle/src/parser.h @@ -20,7 +20,7 @@ #ifndef _PARSER_H_ #define _PARSER_H_ -#include +#include #include "lexer.h" #include "treenode.h" @@ -31,7 +31,7 @@ class Parser : public QObject Q_OBJECT public: - Parser(QTextIStream& in); + Parser(TQTextIStream& in); virtual ~Parser(); void parse(); @@ -39,7 +39,7 @@ class Parser : public QObject signals: - void ErrorMsg(Token&, const QString&, uint code); + void ErrorMsg(Token&, const TQString&, uint code); private: @@ -49,7 +49,7 @@ class Parser : public QObject void getToken(); void matchToken(int tokenType); void appendParameters(TreeNode* node); - void Error(Token&, const QString& s, uint code); + void Error(Token&, const TQString& s, uint code); TreeNode* Program(); TreeNode* ParamList(); @@ -120,7 +120,7 @@ class Parser : public QObject Token preservedToken; // to preserve the currentToken so it wont get lost uint row; uint col; - QStringList learnedFunctionList; + TQStringList learnedFunctionList; }; #endif // _PARSER_H_ diff --git a/kturtle/src/token.h b/kturtle/src/token.h index 2c0e7622..24eb400b 100644 --- a/kturtle/src/token.h +++ b/kturtle/src/token.h @@ -20,7 +20,7 @@ #ifndef _TOKEN_H_ #define _TOKEN_H_ -#include +#include #include "value.h" @@ -34,7 +34,7 @@ struct Pos // convenience, it codes a bit nicer with this, i.e.: "int row = tok. struct Token { int type; // filled with enumed tokenTypes - QString look; // the way the token looks in the text editor + TQString look; // the way the token looks in the text editor Value value; // if the token is a number it can be stored here Pos start; // row'n'col of the starting/ending point of the token Pos end; @@ -127,7 +127,7 @@ enum tokenTypes tokDo // a dummy command }; -// const QString tokenTypeNames[] = +// const TQString tokenTypeNames[] = // { // /* tokNotSet = 0 */ "", // /* tokError = 1 */ "", @@ -213,7 +213,7 @@ enum tokenTypes // /* tokDo */ "", // }; // -// // QString Token::tokenType2name(int tokenType) +// // TQString Token::tokenType2name(int tokenType) // // { // // if (tokenType >= 0) return tokenTypeNames[tokenType]; // // else return ""; diff --git a/kturtle/src/translate.cpp b/kturtle/src/translate.cpp index d2c43f16..10ad2b07 100644 --- a/kturtle/src/translate.cpp +++ b/kturtle/src/translate.cpp @@ -16,8 +16,8 @@ */ -#include -#include +#include +#include #include #include @@ -34,32 +34,32 @@ Translate::Translate() } -QString Translate::name2fuzzy(const QString &name) +TQString Translate::name2fuzzy(const TQString &name) { if ( !aliasMap[name].isEmpty() ) // translate the alias if any { - return QString( i18n("'%1' (%2)").arg(keyMap[name]).arg(reverseAliasMap[name]) ); + return TQString( i18n("'%1' (%2)").arg(keyMap[name]).arg(reverseAliasMap[name]) ); } - return QString( "'" + keyMap[name] + "'"); + return TQString( "'" + keyMap[name] + "'"); } -QString Translate::name2key(const QString &name) +TQString Translate::name2key(const TQString &name) { return keyMap[name]; } -QString Translate::alias2key(const QString &name) +TQString Translate::alias2key(const TQString &name) { return aliasMap[name]; } void Translate::loadTranslations() { - QDomDocument KeywordsXML; + TQDomDocument KeywordsXML; kdDebug(0) << "Loading translation dictionary: "<< locate("data", "kturtle/data/logokeywords." + Settings::logoLanguage() + ".xml") < tag) - QDomElement rootElement = KeywordsXML.documentElement(); - QDomNode n = rootElement.firstChild(); + TQDomElement rootElement = KeywordsXML.documentElement(); + TQDomNode n = rootElement.firstChild(); while ( !n.isNull() ) { - QString name, key, alias; + TQString name, key, alias; name = n.toElement().attribute("name"); // get the name attribute of - QDomNode m = n.firstChild(); // get into the first child of a + TQDomNode m = n.firstChild(); // get into the first child of a while (true) { if( !m.toElement().text().isEmpty() ) diff --git a/kturtle/src/translate.h b/kturtle/src/translate.h index b40cf133..788e11f3 100644 --- a/kturtle/src/translate.h +++ b/kturtle/src/translate.h @@ -19,8 +19,8 @@ #ifndef _TRANSLATE_H_ #define _TRANSLATE_H_ -#include -#include +#include +#include class Translate @@ -29,15 +29,15 @@ class Translate Translate(); ~Translate() {} - QString name2fuzzy(const QString&); - QString name2key(const QString&); - QString alias2key(const QString&); + TQString name2fuzzy(const TQString&); + TQString name2key(const TQString&); + TQString alias2key(const TQString&); private: void loadTranslations(); - typedef QMap StringMap; + typedef TQMap StringMap; StringMap keyMap; StringMap aliasMap; StringMap reverseAliasMap; diff --git a/kturtle/src/treenode.cpp b/kturtle/src/treenode.cpp index d27204ad..0b5619a5 100644 --- a/kturtle/src/treenode.cpp +++ b/kturtle/src/treenode.cpp @@ -31,7 +31,7 @@ TreeNode::TreeNode() fType = Unknown; } -TreeNode::TreeNode(Token t, NodeType nodeType, QString name) +TreeNode::TreeNode(Token t, NodeType nodeType, TQString name) { init(); fType = nodeType; @@ -59,7 +59,7 @@ void TreeNode::init() { clear(); parent = NULL; - // fTok.look (QString) and fTok.value (Value) are properly init'ed when constructed + // fTok.look (TQString) and fTok.value (Value) are properly init'ed when constructed fTok.start.row = 0; fTok.start.col = 0; fTok.end.row = 0; @@ -231,7 +231,7 @@ void TreeNode::showTree(TreeNode* node, int indent) const void TreeNode::show(int indent) { - QString s = ""; + TQString s = ""; for (int i = 0; i < indent; i++) { s += "> "; diff --git a/kturtle/src/treenode.h b/kturtle/src/treenode.h index 44d64d0a..f43260bf 100644 --- a/kturtle/src/treenode.h +++ b/kturtle/src/treenode.h @@ -25,7 +25,7 @@ #include -#include +#include #include "lexer.h" #include "token.h" @@ -214,7 +214,7 @@ class TreeNode : public list /*, public Value <-- maybe oneday */ public: TreeNode(); // used for creation of the first node called 'tree', in the contructor of the parser TreeNode( TreeNode* ); // give parent - TreeNode( Token, NodeType = Unknown, QString = QString() ); + TreeNode( Token, NodeType = Unknown, TQString = TQString() ); virtual ~TreeNode(); void init(); @@ -241,12 +241,12 @@ class TreeNode : public list /*, public Value <-- maybe oneday */ void setType(NodeType t) { fType = t; } NodeType getType() const { return fType; } - void setLook(const QString& s) { fTok.look = s; } - QString getLook() const { return fTok.look; } + void setLook(const TQString& s) { fTok.look = s; } + TQString getLook() const { return fTok.look; } void setValue(const Value& n) { fTok.value = n; } void setValue(double d) { fTok.value = d; } - void setValue(const QString& s) { fTok.value = s; } + void setValue(const TQString& s) { fTok.value = s; } void setValue(bool b) { fTok.value.setBool(b); } Value getValue() const { return fTok.value; } diff --git a/kturtle/src/value.cpp b/kturtle/src/value.cpp index b529452d..be0e0531 100644 --- a/kturtle/src/value.cpp +++ b/kturtle/src/value.cpp @@ -104,7 +104,7 @@ void Value::setNumber(double d) m_string.setNum(d); } -bool Value::setNumber(const QString &s) +bool Value::setNumber(const TQString &s) { type = numberValue; bool ok = true; @@ -119,16 +119,16 @@ bool Value::setNumber(const QString &s) } -QString Value::String() const +TQString Value::String() const { if (type == boolValue) { - if (m_bool) return QString( i18n("true") ); - else return QString( i18n("false") ); + if (m_bool) return TQString( i18n("true") ); + else return TQString( i18n("false") ); } else if (type == numberValue) { - QString s; + TQString s; s.setNum(m_double); return s; } @@ -142,7 +142,7 @@ void Value::setString(double d) m_string.setNum(d); } -void Value::setString(const QString &s) +void Value::setString(const TQString &s) { type = stringValue; m_string = s; @@ -182,7 +182,7 @@ Value& Value::operator=(const Value& n) } -Value& Value::operator=(const QString& s) +Value& Value::operator=(const TQString& s) { setString(s); return *this; diff --git a/kturtle/src/value.h b/kturtle/src/value.h index 8c61966e..0027d8e9 100644 --- a/kturtle/src/value.h +++ b/kturtle/src/value.h @@ -20,8 +20,8 @@ #ifndef _VALUE_H_ #define _VALUE_H_ -#include -#include +#include +#include enum valueType @@ -50,14 +50,14 @@ class Value double Number() const; void setNumber(double); - bool setNumber(const QString&); + bool setNumber(const TQString&); - QString String() const; + TQString String() const; void setString(double); - void setString(const QString&); + void setString(const TQString&); Value& operator=(const Value&); - Value& operator=(const QString&); + Value& operator=(const TQString&); Value& operator=(double); Value& operator+(const Value&); @@ -79,7 +79,7 @@ class Value int type; bool m_bool; double m_double; - QString m_string; + TQString m_string; }; #endif // _VALUE_H_ diff --git a/kverbos/kverbos/kerfassen.cpp b/kverbos/kverbos/kerfassen.cpp index ea646886..9ae8c2b7 100644 --- a/kverbos/kverbos/kerfassen.cpp +++ b/kverbos/kverbos/kerfassen.cpp @@ -17,12 +17,12 @@ #include "kerfassen.h" -#include -#include -#include -#include -#include -//#include +#include +#include +#include +#include +#include +//#include #include @@ -31,7 +31,7 @@ // Die Konstruktoren sollen sicherstellen, dass am Anfang die Karteikarten und // die Eingabefelder für Gerund und Partizip nicht aktiviert sind. // Das Dialogfeld in den Zustand nicht geändert versetzen. -KErfassen::KErfassen(spanishVerbList& l, int pos, QWidget* parent, const char* name, bool modal, WFlags fl) +KErfassen::KErfassen(spanishVerbList& l, int pos, TQWidget* parent, const char* name, bool modal, WFlags fl) : QErfassen(parent, name, modal, fl), liste(l) { formEdit[0][0] = EditYo2_1; @@ -352,42 +352,42 @@ void KErfassen::slotNewVerb() void KErfassen::slotN() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) pl->insert("ñ"); } void KErfassen::slotA() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) pl->insert("á"); } void KErfassen::slotE() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) pl->insert("é"); } void KErfassen::slotI() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) pl->insert("í"); } void KErfassen::slotO() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) pl->insert("ó"); } void KErfassen::slotU() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) pl->insert("ú"); } diff --git a/kverbos/kverbos/kerfassen.h b/kverbos/kverbos/kerfassen.h index 7a8f2fc6..15f0b526 100644 --- a/kverbos/kverbos/kerfassen.h +++ b/kverbos/kverbos/kerfassen.h @@ -38,7 +38,7 @@ public: * Verben in die Liste eingefügt werden können. Es wird auch ein Iterator übergeben, der * anzeigt, wo mit dem editieren begonnen werden soll. */ - KErfassen(spanishVerbList& l, int pos = -1, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + KErfassen(spanishVerbList& l, int pos = -1, TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); /** der Destruktor */ virtual ~KErfassen(); /** Gibt zurück, ob durch den Ablauf des Dialoges eine Änderung an der @@ -142,7 +142,7 @@ private: /** changed zeigt an, ob etwas geändert wurde. */ bool changed; /** Are pointers to the GUI elements for an easier use */ - QLineEdit* formEdit[6][MAX_TIEMPOS]; + TQLineEdit* formEdit[6][MAX_TIEMPOS]; }; #endif diff --git a/kverbos/kverbos/kfeedercontrol.cpp b/kverbos/kverbos/kfeedercontrol.cpp index daa4b9ab..8948a128 100644 --- a/kverbos/kverbos/kfeedercontrol.cpp +++ b/kverbos/kverbos/kfeedercontrol.cpp @@ -22,8 +22,8 @@ KFeederControl::KFeederControl(int ID, bool splash, bool automatic) { - QString f = KStandardDirs::findExe("kfeeder"); - QString s; + TQString f = KStandardDirs::findExe("kfeeder"); + TQString s; s.setNum(ID); childFeeder << f; if (splash) @@ -57,7 +57,7 @@ bool KFeederControl::reset() { if (active) { - QByteArray data; // "raw support" for data + TQByteArray data; // "raw support" for data QDataStream arg(data, IO_WriteOnly); // "container" provides // easy access to data int a_number = 1; @@ -77,7 +77,7 @@ bool KFeederControl::addOne() { if (active) { - QByteArray data; // "raw support" for data + TQByteArray data; // "raw support" for data QDataStream arg(data, IO_WriteOnly); // "container" provides // easy access to data int a_number = 1; @@ -97,7 +97,7 @@ bool KFeederControl::addN(int n) { if (active) { - QByteArray data; // "raw support" for data + TQByteArray data; // "raw support" for data QDataStream arg(data, IO_WriteOnly); // "container" provides // easy access to data int a_number = n; @@ -119,7 +119,7 @@ bool KFeederControl::setAutomatic(bool a) { if (active) { - QByteArray data; // "raw support" for data + TQByteArray data; // "raw support" for data QDataStream arg(data, IO_WriteOnly); // "container" provides // easy access to data int num; diff --git a/kverbos/kverbos/kfeedercontrol.h b/kverbos/kverbos/kfeedercontrol.h index 9617aa18..635a6311 100644 --- a/kverbos/kverbos/kfeedercontrol.h +++ b/kverbos/kverbos/kfeedercontrol.h @@ -47,11 +47,11 @@ public: bool getLastResult() { return lastResult; } private: KProcess childFeeder; - QCString feederID; + TQCString feederID; bool active; bool lastResult; - QCString appId; + TQCString appId; DCOPClient* dcop; }; diff --git a/kverbos/kverbos/kresult.cpp b/kverbos/kverbos/kresult.cpp index eeaedb6b..2eb5b6c1 100644 --- a/kverbos/kverbos/kresult.cpp +++ b/kverbos/kverbos/kresult.cpp @@ -16,21 +16,21 @@ ***************************************************************************/ #include "kresult.h" -#include -#include -#include -#include +#include +#include +#include +#include #include -KResult::KResult(KVerbosUser* pU, QWidget* parent, const char* name, bool modal, WFlags fl ) +KResult::KResult(KVerbosUser* pU, TQWidget* parent, const char* name, bool modal, WFlags fl ) : QResult(parent, name, modal, fl) { int sessions; - QString date[10]; + TQString date[10]; int result[10][2]; pU->getResults(sessions, date, result); - QString s; + TQString s; s.setNum(sessions); TextLabelSessions->setText(s); TextLabelUser->setText(pU->getName()); @@ -48,13 +48,13 @@ KResult::KResult(KVerbosUser* pU, QWidget* parent, const char* name, bool modal, TableResult->adjustColumn(2); // Die Spaltenbreiten anpassen - ListViewVerben->setColumnWidthMode(0, QListView::Maximum); - ListViewVerben->setColumnWidthMode(1, QListView::Maximum); + ListViewVerben->setColumnWidthMode(0, TQListView::Maximum); + ListViewVerben->setColumnWidthMode(1, TQListView::Maximum); verbenListe* pVL = pU->getListe(); verbenListe::Iterator it; - QValueStack right; - QValueStack wrong; + TQValueStack right; + TQValueStack wrong; for (it = pVL->begin(); it!=pVL->end(); ++it) { if ((*it).status == RICHTIGGEMACHT) @@ -65,20 +65,20 @@ KResult::KResult(KVerbosUser* pU, QWidget* parent, const char* name, bool modal, }; while (!right.isEmpty() && !wrong.isEmpty()) { - QListViewItem* pItem; - pItem = new QListViewItem( ListViewVerben, right.pop(), wrong.pop()); + TQListViewItem* pItem; + pItem = new TQListViewItem( ListViewVerben, right.pop(), wrong.pop()); ListViewVerben->insertItem(pItem); }; while (!right.isEmpty()) { - QListViewItem* pItem; - pItem = new QListViewItem( ListViewVerben, right.pop(), ""); + TQListViewItem* pItem; + pItem = new TQListViewItem( ListViewVerben, right.pop(), ""); ListViewVerben->insertItem(pItem); }; while (!wrong.isEmpty()) { - QListViewItem* pItem; - pItem = new QListViewItem( ListViewVerben, "", wrong.pop()); + TQListViewItem* pItem; + pItem = new TQListViewItem( ListViewVerben, "", wrong.pop()); ListViewVerben->insertItem(pItem); }; } diff --git a/kverbos/kverbos/kresult.h b/kverbos/kverbos/kresult.h index bcf54f97..e4aee250 100644 --- a/kverbos/kverbos/kresult.h +++ b/kverbos/kverbos/kresult.h @@ -28,7 +28,7 @@ class KResult : public QResult { public: - KResult(KVerbosUser* pU, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + KResult(KVerbosUser* pU, TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~KResult(); public slots: /** Wird durch den OK-Button aufgerufen und beendet den Dialog. diff --git a/kverbos/kverbos/kstartuplogo.cpp b/kverbos/kverbos/kstartuplogo.cpp index 40569b0b..b01088ec 100644 --- a/kverbos/kverbos/kstartuplogo.cpp +++ b/kverbos/kverbos/kstartuplogo.cpp @@ -20,13 +20,13 @@ #include #include -KStartupLogo::KStartupLogo(QWidget * parent, const char *name) -: QWidget(parent,name,WStyle_Customize | WStyle_NoBorder ) +KStartupLogo::KStartupLogo(TQWidget * parent, const char *name) +: TQWidget(parent,name,WStyle_Customize | WStyle_NoBorder ) { - QPixmap pm; + TQPixmap pm; pm.load(locate("appdata", "pics/startuplogo.png")); setBackgroundPixmap(pm); - QRect desk = KGlobalSettings::splashScreenDesktopGeometry(); + TQRect desk = KGlobalSettings::splashScreenDesktopGeometry(); setGeometry(desk.center().x()-pm.width()/2, desk.center().y()-pm.height()/2, pm.width(),pm.height()); } @@ -34,9 +34,9 @@ KStartupLogo::KStartupLogo(QWidget * parent, const char *name) KStartupLogo::~KStartupLogo(){ } -bool KStartupLogo::event(QEvent* ev){ +bool KStartupLogo::event(TQEvent* ev){ raise(); - return QWidget::event(ev); + return TQWidget::event(ev); } #include "kstartuplogo.moc" diff --git a/kverbos/kverbos/kstartuplogo.h b/kverbos/kverbos/kstartuplogo.h index 792e9272..c290cc0a 100644 --- a/kverbos/kverbos/kstartuplogo.h +++ b/kverbos/kverbos/kstartuplogo.h @@ -18,19 +18,19 @@ #ifndef KSTARTUPLOGO_H #define KSTARTUPLOGO_H -#include +#include /**This class creates the splash screen at the beginning of the program. *@author Arnold Kraschinski */ -class KStartupLogo : public QWidget { +class KStartupLogo : public TQWidget { Q_OBJECT public: - KStartupLogo(QWidget *parent=0, const char *name=0); + KStartupLogo(TQWidget *parent=0, const char *name=0); ~KStartupLogo(); protected: - virtual bool event(QEvent*); + virtual bool event(TQEvent*); }; diff --git a/kverbos/kverbos/kverbedit.cpp b/kverbos/kverbos/kverbedit.cpp index b0d4352e..7e7bcde8 100644 --- a/kverbos/kverbos/kverbedit.cpp +++ b/kverbos/kverbos/kverbedit.cpp @@ -15,23 +15,23 @@ * * ***************************************************************************/ -#include +#include #include "kverbedit.h" #include "kerfassen.h" /** An die Dialogklasse wird direkt der Zeiger auf die Verbliste bergeben, damit * die Liste der Verben bearbeitet werden kann. Zu Beginn mssen alle Verben - * aus der Liste in eine dialogeigene Liste und die QListView bertragen werden. + * aus der Liste in eine dialogeigene Liste und die TQListView bertragen werden. */ -KVerbEdit::KVerbEdit(spanishVerbList& l, QWidget* parent /*= 0*/, const char* name /*= 0*/, bool modal /*= FALSE*/, WFlags fl /*= 0*/) +KVerbEdit::KVerbEdit(spanishVerbList& l, TQWidget* parent /*= 0*/, const char* name /*= 0*/, bool modal /*= FALSE*/, WFlags fl /*= 0*/) : QVerbEdit(parent, name, modal, fl), list(l) { // Die Spaltenbreiten anpassen - ListView1->setColumnWidthMode(0, QListView::Manual); - ListView1->setColumnWidthMode(1, QListView::Manual); + ListView1->setColumnWidthMode(0, TQListView::Manual); + ListView1->setColumnWidthMode(1, TQListView::Manual); int br = width() / 20 * 9; - QString brstr; + TQString brstr; brstr.setNum(br); ListView1->setColumnWidth(0, br); ListView1->setColumnWidth(1, br); @@ -53,8 +53,8 @@ void KVerbEdit::listToView() spanishVerbList::Iterator it; for (it = list.begin(); it != list.end(); ++it) { - QListViewItem* pItem; - pItem = new QListViewItem( ListView1, (*it).getSpanish(), (*it).getForeign()); + TQListViewItem* pItem; + pItem = new TQListViewItem( ListView1, (*it).getSpanish(), (*it).getForeign()); ListView1->insertItem(pItem); }; }; @@ -82,7 +82,7 @@ void KVerbEdit::slotCancel() // An den Dialog wird ein Listeniterator bergeben. void KVerbEdit::slotEditVerb() { - QListViewItem* pi = ListView1->selectedItem(); + TQListViewItem* pi = ListView1->selectedItem(); // it's a sorted list, so binary search works. // v is not a real verb it is only used for the search. v doesn't have any forms but // that isn't important to compare. @@ -126,7 +126,7 @@ void KVerbEdit::slotEditVerb() // Das in der Listenansicht ausgew�lte Verb wird gel�cht. void KVerbEdit::slotDelete() { - QListViewItem* pi = ListView1->selectedItem(); + TQListViewItem* pi = ListView1->selectedItem(); if (0 != pi) { // Das Listenelement hersuchen diff --git a/kverbos/kverbos/kverbedit.h b/kverbos/kverbos/kverbedit.h index 23057ed1..e3b84d56 100644 --- a/kverbos/kverbos/kverbedit.h +++ b/kverbos/kverbos/kverbedit.h @@ -34,7 +34,7 @@ public: /** An die Dialogklasse wird direkt die Verbliste übergeben, damit * die Liste der Verben bearbeitet werden kann. */ - KVerbEdit(spanishVerbList& l, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + KVerbEdit(spanishVerbList& l, TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~KVerbEdit(); /** kopiert die Liste in die ListView. */ void listToView(); diff --git a/kverbos/kverbos/kverbos.cpp b/kverbos/kverbos/kverbos.cpp index 2a5198cf..96d6930a 100644 --- a/kverbos/kverbos/kverbos.cpp +++ b/kverbos/kverbos/kverbos.cpp @@ -16,9 +16,9 @@ ***************************************************************************/ // include files for QT -#include -#include -#include +#include +#include +#include // include files for KDE #include @@ -48,7 +48,7 @@ int KVerbosApp::kverbosCounter = 0; -KVerbosApp::KVerbosApp(QWidget* , const char* name):KMainWindow (0, name) +KVerbosApp::KVerbosApp(TQWidget* , const char* name):KMainWindow (0, name) { // als erstes das Logo starten KStartupLogo* start_logo = new KStartupLogo(0); @@ -108,7 +108,7 @@ KVerbosApp::~KVerbosApp() kverbosCounter--; if (kfeederControl) { - disconnect(view, SIGNAL(informKFeeder(int)), this, SLOT(slotFeedIt(int))); + disconnect(view, TQT_SIGNAL(informKFeeder(int)), this, TQT_SLOT(slotFeedIt(int))); delete kfeederControl; kfeederControl = 0; }; @@ -116,25 +116,25 @@ KVerbosApp::~KVerbosApp() void KVerbosApp::initActions() { - fileNewWindow = new KAction(i18n("New &Window"), "window_new.png", 0, this, SLOT(slotFileNewWindow()), actionCollection(),"file_new_window"); - fileNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); - fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); - fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); - fileOpenStandard = new KAction(i18n("Open &Standard Verb File"), "fileopen.png", 0, this, SLOT(slotFileOpenStandard()), actionCollection(),"file_open_standard"); - fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); - fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); - fileClose = KStdAction::close(this, SLOT(slotFileClose()), actionCollection()); - filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection()); - fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); - editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection()); - editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection()); - editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection()); - editErfassen = new KAction(i18n("E&nter New Verb..."), 0, 0, this, SLOT(slotEditErfassen()), actionCollection(),"edit_erfassen"); - editBearbeiten = new KAction(i18n("&Edit Verb List..."), 0, 0, this, SLOT(slotEditBearbeiten()), actionCollection(), "edit_bearbeiten"); - - settingOptions = new KAction(i18n("&Configure KVerbos..."), 0, 0, this, SLOT(slotSettingsOptions()), actionCollection(), "settings_options"); - userUsername = new KAction(i18n("&Username..."), 0, 0, this, SLOT(slotSettingsUsername()), actionCollection(), "user_username"); - userResults = new KAction(i18n("&Results"), 0, 0, this, SLOT(slotUserResults()), actionCollection(), "user_results"); + fileNewWindow = new KAction(i18n("New &Window"), "window_new.png", 0, this, TQT_SLOT(slotFileNewWindow()), actionCollection(),"file_new_window"); + fileNew = KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection()); + fileOpen = KStdAction::open(this, TQT_SLOT(slotFileOpen()), actionCollection()); + fileOpenRecent = KStdAction::openRecent(this, TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); + fileOpenStandard = new KAction(i18n("Open &Standard Verb File"), "fileopen.png", 0, this, TQT_SLOT(slotFileOpenStandard()), actionCollection(),"file_open_standard"); + fileSave = KStdAction::save(this, TQT_SLOT(slotFileSave()), actionCollection()); + fileSaveAs = KStdAction::saveAs(this, TQT_SLOT(slotFileSaveAs()), actionCollection()); + fileClose = KStdAction::close(this, TQT_SLOT(slotFileClose()), actionCollection()); + filePrint = KStdAction::print(this, TQT_SLOT(slotFilePrint()), actionCollection()); + fileQuit = KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection()); + editCut = KStdAction::cut(this, TQT_SLOT(slotEditCut()), actionCollection()); + editCopy = KStdAction::copy(this, TQT_SLOT(slotEditCopy()), actionCollection()); + editPaste = KStdAction::paste(this, TQT_SLOT(slotEditPaste()), actionCollection()); + editErfassen = new KAction(i18n("E&nter New Verb..."), 0, 0, this, TQT_SLOT(slotEditErfassen()), actionCollection(),"edit_erfassen"); + editBearbeiten = new KAction(i18n("&Edit Verb List..."), 0, 0, this, TQT_SLOT(slotEditBearbeiten()), actionCollection(), "edit_bearbeiten"); + + settingOptions = new KAction(i18n("&Configure KVerbos..."), 0, 0, this, TQT_SLOT(slotSettingsOptions()), actionCollection(), "settings_options"); + userUsername = new KAction(i18n("&Username..."), 0, 0, this, TQT_SLOT(slotSettingsUsername()), actionCollection(), "user_username"); + userResults = new KAction(i18n("&Results"), 0, 0, this, TQT_SLOT(slotUserResults()), actionCollection(), "user_results"); fileNewWindow->setToolTip(i18n("Opens a new application window")); fileOpenStandard->setToolTip(i18n("Opens the standard KVerbos verb file")); @@ -182,8 +182,8 @@ void KVerbosApp::initDocument() { doc = new KVerbosDoc(this); doc->newDocument(); - connect(doc, SIGNAL(anzahlVerbenGeaendert(int)), this, SLOT(slotStatusVerbMsg(int))); - connect(this, SIGNAL(testAnzahl(int)), this, SLOT(slotStatusVerbMsg(int))); + connect(doc, TQT_SIGNAL(anzahlVerbenGeaendert(int)), this, TQT_SLOT(slotStatusVerbMsg(int))); + connect(this, TQT_SIGNAL(testAnzahl(int)), this, TQT_SLOT(slotStatusVerbMsg(int))); } void KVerbosApp::initView() @@ -197,9 +197,9 @@ void KVerbosApp::initView() setCentralWidget(view); setCaption(doc->URL().fileName(),false); // - connect(view, SIGNAL(numberTrainedChanged(int)), this, SLOT(slotStatusTrainedMsg(int))); - connect(view, SIGNAL(numberCorrectChanged(int)), this, SLOT(slotStatusCorrectMsg(int))); - connect(view, SIGNAL(informKFeeder(int)), this, SLOT(slotFeedIt(int))); + connect(view, TQT_SIGNAL(numberTrainedChanged(int)), this, TQT_SLOT(slotStatusTrainedMsg(int))); + connect(view, TQT_SIGNAL(numberCorrectChanged(int)), this, TQT_SLOT(slotStatusCorrectMsg(int))); + connect(view, TQT_SIGNAL(informKFeeder(int)), this, TQT_SLOT(slotFeedIt(int))); } void KVerbosApp::openDocumentFile(const KURL& url) @@ -224,11 +224,11 @@ void KVerbosApp::saveOptions() // Meine eigenen Optionen // Die zum Lernen ausgewählten Zeiten config->setGroup("tiempos"); - QString key; + TQString key; for (int i = presente; iwriteEntry(key, options); @@ -252,11 +252,11 @@ void KVerbosApp::readOptions() // Meine eigenen Optionen // Die zum Lernen ausgewählten Zeiten config->setGroup("tiempos"); - QString key; + TQString key; for (int i = presente; ireadEntry ( key, "true false false"); + TQString options = config->readEntry ( key, "true false false"); int pos1 = 0; int pos2 = options.find (' ', pos1, false); timeOptions[i][0] = (options.left(pos2) == "true") ? true : false; @@ -295,8 +295,8 @@ void KVerbosApp::saveProperties(KConfig *_cfg) KURL url=doc->URL(); _cfg->writePathEntry("filename", url.url()); _cfg->writeEntry("modified", doc->isModified()); - QString tempname = kapp->tempSaveName(url.url()); - QString tempurl= KURL::encode_string(tempname); + TQString tempname = kapp->tempSaveName(url.url()); + TQString tempurl= KURL::encode_string(tempname); KURL _url(tempurl); doc->saveDocument(_url); } @@ -305,20 +305,20 @@ void KVerbosApp::saveProperties(KConfig *_cfg) void KVerbosApp::readProperties(KConfig* _cfg) { - QString filename = _cfg->readPathEntry("filename"); + TQString filename = _cfg->readPathEntry("filename"); KURL url(filename); bool modified = _cfg->readBoolEntry("modified", false); if(modified) { bool canRecover; - QString tempname = kapp->checkRecoverFile(filename, canRecover); + TQString tempname = kapp->checkRecoverFile(filename, canRecover); KURL _url(tempname); if(canRecover) { doc->openDocument(_url); doc->setModified(); setCaption(_url.fileName(),true); - QFile::remove(tempname); + TQFile::remove(tempname); } } else @@ -343,7 +343,7 @@ bool KVerbosApp::queryExit() } ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// void KVerbosApp::slotFileNewWindow() @@ -385,7 +385,7 @@ void KVerbosApp::slotFileOpen() } else { - KURL url=KFileDialog::getOpenURL(QString::null, + KURL url=KFileDialog::getOpenURL(TQString::null, i18n("*|All Files"), this, i18n("Open File")); if(!url.isEmpty()) { @@ -420,7 +420,7 @@ void KVerbosApp::slotFileOpenRecent(const KURL& url) void KVerbosApp::slotFileOpenStandard() { slotStatusMsg(i18n("Opening file...")); - QString userLanguage = Prefs::userLanguage(); + TQString userLanguage = Prefs::userLanguage(); if(!doc->saveModified()) { // here saving wasn't successful @@ -460,7 +460,7 @@ void KVerbosApp::slotFileSaveAs() { slotStatusMsg(i18n("Saving file with a new filename...")); - KURL url=KFileDialog::getSaveURL(QDir::currentDirPath(), + KURL url=KFileDialog::getSaveURL(TQDir::currentDirPath(), i18n("*|All Files"), this, i18n("Save As")); if(!url.isEmpty()) { @@ -485,7 +485,7 @@ void KVerbosApp::slotFilePrint() { slotStatusMsg(i18n("Printing...")); - QPrinter printer; + TQPrinter printer; if (printer.setup(this)) { view->print(&printer); @@ -536,7 +536,7 @@ void KVerbosApp::slotEditPaste() slotStatusMsg(i18n("Ready.")); } -void KVerbosApp::slotStatusMsg(const QString &text) +void KVerbosApp::slotStatusMsg(const TQString &text) { /////////////////////////////////////////////////////////////////// // change status message permanently @@ -547,7 +547,7 @@ void KVerbosApp::slotStatusMsg(const QString &text) // Gibt die Anzahl der Verben in der Statuszeile aus void KVerbosApp::slotStatusVerbMsg(int n) { - QString s; + TQString s; s.setNum(n,10); s = i18n("Number of verbs: ") + s; statusBar()->changeItem(s, ID_VERBS_MSG); @@ -556,7 +556,7 @@ void KVerbosApp::slotStatusVerbMsg(int n) // Gibt die Anzahl der geübten Verben in der Statuszeile aus. void KVerbosApp::slotStatusTrainedMsg(int n) { - QString s; + TQString s; s.setNum(n,10); s = i18n("Trained: ") + s; statusBar()->changeItem(s, ID_TRAINED_MSG); @@ -565,7 +565,7 @@ void KVerbosApp::slotStatusTrainedMsg(int n) // Gibt die Anzahl der richtig geübten Verben aus. void KVerbosApp::slotStatusCorrectMsg(int n) { - QString s; + TQString s; s.setNum(n,10); s = i18n("Correct: ") + s; statusBar()->changeItem(s, ID_CORRECT_MSG); @@ -710,7 +710,7 @@ void KVerbosApp::slotSettingsOptions() if ((pDlgEdit->CheckBoxKFeeder->isChecked() == false) && (useKFeeder)) { // kfeeder anhalten - disconnect(view, SIGNAL(informKFeeder(int)), this, SLOT(slotFeedIt(int))); + disconnect(view, TQT_SIGNAL(informKFeeder(int)), this, TQT_SLOT(slotFeedIt(int))); delete kfeederControl; kfeederControl = 0; }; @@ -730,8 +730,8 @@ void KVerbosApp::getTimeOptions(bool op[][3]) void KVerbosApp::slotSettingsUsername() { bool ok; - QString n = KInputDialog::getText(i18n("Enter User Name"), i18n("Please enter your name:"), - QString::null , &ok, this).simplifyWhiteSpace(); + TQString n = KInputDialog::getText(i18n("Enter User Name"), i18n("Please enter your name:"), + TQString::null , &ok, this).simplifyWhiteSpace(); if (ok) { statusBar()->changeItem(i18n("user: ") + n, ID_USERNAME_MSG); diff --git a/kverbos/kverbos/kverbos.h b/kverbos/kverbos/kverbos.h index b31bf12a..982ee0c1 100644 --- a/kverbos/kverbos/kverbos.h +++ b/kverbos/kverbos/kverbos.h @@ -63,7 +63,7 @@ class KVerbosApp : public KMainWindow public: /** construtor of KVerbosApp, calls all init functions to create the application. */ - KVerbosApp(QWidget* parent=0, const char* name=0); + KVerbosApp(TQWidget* parent=0, const char* name=0); ~KVerbosApp(); /** opens a file specified by commandline option */ @@ -164,7 +164,7 @@ class KVerbosApp : public KMainWindow * current actions. * @param text the text that is displayed in the statusbar */ - void slotStatusMsg(const QString &text); + void slotStatusMsg(const TQString &text); /** Gibt die Anzahl der Verben in der Statuszeile aus */ void slotStatusVerbMsg(int); /** Gibt die Anzahl der geübten Verben in der Statuszeile aus. diff --git a/kverbos/kverbos/kverbosdoc.cpp b/kverbos/kverbos/kverbosdoc.cpp index 9e4cc408..632f10b3 100644 --- a/kverbos/kverbos/kverbosdoc.cpp +++ b/kverbos/kverbos/kverbosdoc.cpp @@ -21,7 +21,7 @@ #include // include files for Qt -#include +#include // include files for KDE #include @@ -37,13 +37,13 @@ -QPtrList *KVerbosDoc::pViewList = 0L; +TQPtrList *KVerbosDoc::pViewList = 0L; -KVerbosDoc::KVerbosDoc(QWidget *parent, const char *name) : QObject(parent, name) +KVerbosDoc::KVerbosDoc(TQWidget *parent, const char *name) : TQObject(parent, name) { if(!pViewList) { - pViewList = new QPtrList(); + pViewList = new TQPtrList(); }; pViewList->setAutoDelete(true); // Zufallsgenerator mit einem seed-Wert versorgen @@ -68,7 +68,7 @@ KVerbosDoc::~KVerbosDoc() void KVerbosDoc::addView(KVerbosView *view) { pViewList->append(view); - connect(this, SIGNAL(changeView()), view, SLOT(zeigeVerb())); + connect(this, TQT_SIGNAL(changeView()), view, TQT_SLOT(zeigeVerb())); } void KVerbosDoc::removeView(KVerbosView *view) @@ -159,10 +159,10 @@ bool KVerbosDoc::newDocument() bool KVerbosDoc::openDocument(const KURL& url, const char *format /*=0*/) { bool b = false; - QString tmpfile; + TQString tmpfile; KIO::NetAccess::download( url, tmpfile ); - QFile file(url.path()); + TQFile file(url.path()); if ( file.open(IO_ReadOnly) ) { // file opened successfully deleteContents(); if ((url.fileName().right(4) == "html")||(url.fileName().right(3) == "htm")) @@ -213,15 +213,15 @@ bool KVerbosDoc::openDocument(const KURL& url, const char *format /*=0*/) } // Liesteine Datei als HTML-Dokument ein -bool KVerbosDoc::openDocHTML(QFile &f) +bool KVerbosDoc::openDocHTML(TQFile &f) { bool result = true; - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream int count1; int count2; - QString s; - QString v[3]; - QString forms[60]; + TQString s; + TQString v[3]; + TQString forms[60]; verbSpanish NewVerb; while (!f.atEnd()) { @@ -361,11 +361,11 @@ bool KVerbosDoc::openDocHTML(QFile &f) return result; } -bool KVerbosDoc::openDocVERBOS(QFile &f) +bool KVerbosDoc::openDocVERBOS(TQFile &f) { - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream int count; - QString v[3]; + TQString v[3]; while (!f.atEnd()) { count = 0; @@ -403,8 +403,8 @@ bool KVerbosDoc::openDocVERBOS(QFile &f) }; if (count < 54) { - QMessageBox mb("kverbos warning", "An uncomplete verb has been found in the file", - QMessageBox::Warning, 1, 0, 0, 0); + TQMessageBox mb("kverbos warning", "An uncomplete verb has been found in the file", + TQMessageBox::Warning, 1, 0, 0, 0); mb.exec(); //qWarning("Ein unvollständiges Verb kam vor!"); }; @@ -420,7 +420,7 @@ bool KVerbosDoc::openDocVERBOS(QFile &f) bool KVerbosDoc::saveDocument(const KURL& url, const char *format /*=0*/) { bool b = false; - QFile file(url.path()); + TQFile file(url.path()); if ( file.open(IO_WriteOnly) ) { // file opened successfully if ((url.fileName().right(4) == "html")||(url.fileName().right(3) == "htm")) @@ -440,10 +440,10 @@ bool KVerbosDoc::saveDocument(const KURL& url, const char *format /*=0*/) } // Die Verben als HTML-Datei abspeichern -bool KVerbosDoc::saveDocHTML(QFile &f) +bool KVerbosDoc::saveDocHTML(TQFile &f) { bool good = true; - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream // Den Anfang der HTML Datei schreiben t << "" << endl; t << "" << endl; @@ -616,9 +616,9 @@ bool KVerbosDoc::saveDocHTML(QFile &f) return good; } -bool KVerbosDoc::saveDocVERBOS(QFile &f) +bool KVerbosDoc::saveDocVERBOS(TQFile &f) { - QTextStream t( &f ); // use a text stream + TQTextStream t( &f ); // use a text stream // Die Verbenliste in die Datei schreiben. if (verbList2.isEmpty()) { @@ -682,7 +682,7 @@ spanishVerbList* KVerbosDoc::getList() // Reihenfolge in dem Stringfeld: yo, tu, el, nosotros, vosotros, ellos, aleman, espanol // Wird "- - - - - -" zurückgegeben, dann gibt es kein Verb in der Liste. Normalerweise // wird die spanische Verbform zurückgegeben. -QString KVerbosDoc::getAuswahl(QString s[][3], int &t) +TQString KVerbosDoc::getAuswahl(TQString s[][3], int &t) { bool verbOK = true; // feststellen, wie viele aktivierte Zeiten in den Optionen vorhanden sind @@ -732,8 +732,8 @@ QString KVerbosDoc::getAuswahl(QString s[][3], int &t) }; if (!verbOK) { - QMessageBox mb("kverbos warning", "There is a problem with the verb " + s[6][0] + - ".\nPlease check the verb in the edit dialog.", QMessageBox::Warning, 1, 0, 0, 0); + TQMessageBox mb("kverbos warning", "There is a problem with the verb " + s[6][0] + + ".\nPlease check the verb in the edit dialog.", TQMessageBox::Warning, 1, 0, 0, 0); mb.exec(); for (int i=0; i +#include // include files for KDE #include @@ -65,7 +65,7 @@ class KVerbosDoc : public QObject /** * Constructor for the fileclass of the application */ - KVerbosDoc(QWidget *parent, const char *name=0); + KVerbosDoc(TQWidget *parent, const char *name=0); /** * Destructor for the fileclass of the application */ @@ -92,21 +92,21 @@ class KVerbosDoc : public QObject * schieden */ bool openDocument(const KURL& url, const char *format=0); - bool openDocHTML(QFile &f); - bool openDocVERBOS(QFile &f); + bool openDocHTML(TQFile &f); + bool openDocVERBOS(TQFile &f); /** saves the document under filename and format. * Die Datei kann wahlweise im HTML-Format oder als normale Textdatei abgespeichert * werden. Die HTML-Datei ist umfangreicher, weil der formatierende HTML-Code * ergänzt werden muss. */ bool saveDocument(const KURL& url, const char *format=0); - bool saveDocHTML(QFile &f); - bool saveDocVERBOS(QFile &f); + bool saveDocHTML(TQFile &f); + bool saveDocVERBOS(TQFile &f); /** sets a new user name, and deletes the old one. If the old one is different from * the default name DEFAULTUSER then some information is stored about the user. The * Program look if some information about the user is stored. */ - void setNewUser(const QString n); + void setNewUser(const TQString n); /** returns a pointer to the actual user object */ KVerbosUser* getUser() { return benutzer; } /** returns the KURL of the document */ @@ -126,12 +126,12 @@ class KVerbosDoc : public QObject /** Gibt die gewählte Zeit, die Formen des Verbes dazu und den spanischen * und deutschen Infinitiv zurück */ - QString getAuswahl(QString s[][3], int &t); + TQString getAuswahl(TQString s[][3], int &t); /** feedback from the view class about the solution */ void solved(const bool b); private: /** searches the verb given as a string in the list and returns a pointer to the verb */ - spanishVerbList::Iterator findVerb(const QString& s); + spanishVerbList::Iterator findVerb(const TQString& s); signals: /** wird emittiert, wenn sich die Anzahl der Verben im Dokument verändert hat */ @@ -149,7 +149,7 @@ class KVerbosDoc : public QObject /** * the list of the views currently connected to the document */ - static QPtrList *pViewList; + static TQPtrList *pViewList; private: /** diff --git a/kverbos/kverbos/kverbosoptions.cpp b/kverbos/kverbos/kverbosoptions.cpp index 872888ea..381e058b 100644 --- a/kverbos/kverbos/kverbosoptions.cpp +++ b/kverbos/kverbos/kverbosoptions.cpp @@ -15,11 +15,11 @@ * * ***************************************************************************/ -#include "qlabel.h" -#include "qcheckbox.h" +#include "tqlabel.h" +#include "tqcheckbox.h" #include "kverbosoptions.h" -KVerbosOptions::KVerbosOptions( QWidget* parent /*= 0*/, const char* name /*= 0*/, bool modal /*= FALSE*/, WFlags fl /*= 0*/ ) +KVerbosOptions::KVerbosOptions( TQWidget* parent /*= 0*/, const char* name /*= 0*/, bool modal /*= FALSE*/, WFlags fl /*= 0*/ ) : QVerbosOptions(parent, name, modal, fl) { // some times are disabled because they aren't ready yet. diff --git a/kverbos/kverbos/kverbosoptions.h b/kverbos/kverbos/kverbosoptions.h index 2293fac4..25fc91bf 100644 --- a/kverbos/kverbos/kverbosoptions.h +++ b/kverbos/kverbos/kverbosoptions.h @@ -27,7 +27,7 @@ class KVerbosOptions : public QVerbosOptions { public: - KVerbosOptions( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + KVerbosOptions( TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~KVerbosOptions(); public slots: diff --git a/kverbos/kverbos/kverbosuser.cpp b/kverbos/kverbos/kverbosuser.cpp index 7d7d19d0..64d319af 100644 --- a/kverbos/kverbos/kverbosuser.cpp +++ b/kverbos/kverbos/kverbosuser.cpp @@ -18,8 +18,8 @@ #include "kverbosuser.h" #include -#include -#include +#include +#include #include @@ -29,18 +29,18 @@ bool eintrag::operator== (const eintrag& e) const return (verb == e.verb); } -KVerbosUser::KVerbosUser(spanishVerbList* pL, QString n/*=DEFAULTUSER*/) +KVerbosUser::KVerbosUser(spanishVerbList* pL, TQString n/*=DEFAULTUSER*/) : name(n), auswahl(""), sessions(0) { // try to read the user-information if there is one. int pos; while ((pos = n.find(' ')) != -1) n.replace(pos, 1, "_"); - QFile file(locateLocal("data", "/kverbos/data/"+name+".kverbos")); + TQFile file(locateLocal("data", "/kverbos/data/"+name+".kverbos")); if ( file.open(IO_ReadOnly) ) { - QString s; - QTextStream t( &file ); + TQString s; + TQTextStream t( &file ); name = t.readLine(); s = t.readLine(); sessions = s.toInt(); for (int i=0; i verbenListe; +typedef TQValueList verbenListe; /** This class holds information about an user of the program. It stores lists of * verbs. One list for the words that are in the opened verb file and aren't traines yet. @@ -65,12 +65,12 @@ typedef QValueList verbenListe; */ class KVerbosUser { public: - KVerbosUser(spanishVerbList* pL, QString n=DEFAULTUSER); + KVerbosUser(spanishVerbList* pL, TQString n=DEFAULTUSER); ~KVerbosUser(); /** fills the lists with the verbs that are in the verb list of the main program */ void fillList(spanishVerbList* pL); /** returns the user name */ - QString getName() { return name; } + TQString getName() { return name; } /** marks all verbs in the R(right) and the F(false) list as unused. That means they can't * be a suggestion. This are probably verbs that are stored user data but at the moment * they aren't in the used verb list. @@ -81,7 +81,7 @@ public: void updateKumulus(); /** selects a verb out of the verbs that are in the U and F list. That means a * verb that hasn't been studied yet or one that was wrong. */ -QString suggestVerb(); +TQString suggestVerb(); /** The solution for the suggested verb was right. Now the verb should be deleted from * the list of unstudied verbs but added to the list with the right verbs. */ @@ -93,17 +93,17 @@ QString suggestVerb(); /** Saves all the user information to the $KDEHOME/apps/kverbos/data/username.kverbos file */ bool saveUser(const int& res, const int& num); /** Retrieve the old results and the number of sessions */ - bool getResults(int& s, QString d[], int r[][2]); + bool getResults(int& s, TQString d[], int r[][2]); /** returns a pointer to the users verb list */ verbenListe* getListe() { return &liste; } private: /** name of the user */ - QString name; + TQString name; /** the list of the verbs that the user has workes with */ verbenListe liste; /** this is the latest selected verb of the list */ - QString auswahl; + TQString auswahl; /** die aufaddierte Summe der gewichteten Verben */ int kumulus; /** an Iterator for the verb list */ @@ -111,7 +111,7 @@ private: /** the number of training sessions that the user has made */ int sessions; /** The results of the last ten seccions */ - QString date[MAX_RESULTS]; + TQString date[MAX_RESULTS]; int result[MAX_RESULTS][2]; }; diff --git a/kverbos/kverbos/kverbosview.cpp b/kverbos/kverbos/kverbosview.cpp index a9bb236e..83f184df 100644 --- a/kverbos/kverbos/kverbosview.cpp +++ b/kverbos/kverbos/kverbosview.cpp @@ -18,12 +18,12 @@ #include // include files for Qt -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // application specific includes @@ -33,11 +33,11 @@ #include "verbspanish.h" -KVerbosView::KVerbosView(QWidget *parent, const char *name) : QLernen/*QWidget*/(parent, name) +KVerbosView::KVerbosView(TQWidget *parent, const char *name) : QLernen/*TQWidget*/(parent, name) { // Hier wird gesetzt, wie der Hintergrund des Fensters zu zeichnen ist. setBackgroundMode(PaletteBackground); - // Die gesamten Zeiger auf QLineEdit in ein Feld umwandeln + // Die gesamten Zeiger auf TQLineEdit in ein Feld umwandeln formEdit[0][0] = EditYo1; formEdit[1][0] = EditTu1; formEdit[2][0] = EditEl1; @@ -83,9 +83,9 @@ KVerbosDoc* KVerbosView::getDocument() const return theApp->getDocument(); } -void KVerbosView::print(QPrinter *pPrinter) +void KVerbosView::print(TQPrinter *pPrinter) { - QPainter printpainter; + TQPainter printpainter; printpainter.begin(pPrinter); // TODO: add your printing code here @@ -94,14 +94,14 @@ void KVerbosView::print(QPrinter *pPrinter) } // This funktion erases all accents from the letters of a string -QString KVerbosView::deleteAccents(const QString& s) const +TQString KVerbosView::deleteAccents(const TQString& s) const { - QString s2 = s.simplifyWhiteSpace(); + TQString s2 = s.simplifyWhiteSpace(); if (!s2.isEmpty()) { for (unsigned int i=0; i(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) { pl->insert("ñ"); @@ -124,7 +124,7 @@ void KVerbosView::slotN() void KVerbosView::slotA() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) { pl->insert("á"); @@ -133,7 +133,7 @@ void KVerbosView::slotA() void KVerbosView::slotE() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) { pl->insert("é"); @@ -142,7 +142,7 @@ void KVerbosView::slotE() void KVerbosView::slotI() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) { pl->insert("í"); @@ -151,7 +151,7 @@ void KVerbosView::slotI() void KVerbosView::slotO() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) { pl->insert("ó"); @@ -160,7 +160,7 @@ void KVerbosView::slotO() void KVerbosView::slotU() { - QLineEdit* pl = dynamic_cast(focusWidget()); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (pl) { pl->insert("ú"); @@ -171,8 +171,8 @@ void KVerbosView::slotU() // gesetzt werden, damit die korrigierten Felder wieder die normale Schrift erhalten. void KVerbosView::slotClearAll() { - QFont fontNormal = EditVerbo->font(); - QPalette palette = EditVerbo->palette(); + TQFont fontNormal = EditVerbo->font(); + TQPalette palette = EditVerbo->palette(); EditAleman->clear(); EditAleman->setFont(fontNormal); EditAleman->setPalette(palette); @@ -245,12 +245,12 @@ void KVerbosView::slotWeiter() void KVerbosView::slotCorregir() { bool richtig = true; - QFont fontNormal = EditVerbo->font(); - QFont fontBold = EditVerbo->font(); + TQFont fontNormal = EditVerbo->font(); + TQFont fontBold = EditVerbo->font(); fontBold.setUnderline(true); - QPalette palette = EditVerbo->palette(); - palette.setColor(QColorGroup::Text, red); - palette.setColor(QColorGroup::Base, white); + TQPalette palette = EditVerbo->palette(); + palette.setColor(TQColorGroup::Text, red); + palette.setColor(TQColorGroup::Base, white); if ( 0 > formen[6][1].find(EditAleman->text().simplifyWhiteSpace(), 0)) { EditAleman->setFont(fontBold); @@ -278,8 +278,8 @@ void KVerbosView::slotCorregir() } else { - QString s1 = formEdit[i][j]->text().simplifyWhiteSpace(); - QString s2 = formen[i][j]; + TQString s1 = formEdit[i][j]->text().simplifyWhiteSpace(); + TQString s2 = formen[i][j]; if (deleteAccents(s1) != deleteAccents(s2)) { formEdit[i][j]->setFont(fontBold); @@ -309,7 +309,7 @@ void KVerbosView::slotCorregir() // Die Lösung soll in dem Fenster präsentiert werden. void KVerbosView::slotSolution() { - QFont fontNormal = EditVerbo->font(); + TQFont fontNormal = EditVerbo->font(); EditAleman->setFont(fontNormal); EditAleman->setPalette(EditVerbo->palette()); EditAleman->setText(formen[6][1]); @@ -331,8 +331,8 @@ void KVerbosView::slotFont() { if (corrected) { - QFont fontNormal = EditVerbo->font(); - QLineEdit* pl = dynamic_cast(focusWidget()); + TQFont fontNormal = EditVerbo->font(); + TQLineEdit* pl = dynamic_cast(focusWidget()); if (0 != pl) { pl->setFont(fontNormal); @@ -356,7 +356,7 @@ void KVerbosView::slotCopyText() formEdit[i][2]->setText(s); if (corrected) { - QFont fontNormal = EditVerbo->font(); + TQFont fontNormal = EditVerbo->font(); formEdit[i][2]->setFont(fontNormal); }; }; diff --git a/kverbos/kverbos/kverbosview.h b/kverbos/kverbos/kverbosview.h index cfc4c702..3690c72a 100644 --- a/kverbos/kverbos/kverbosview.h +++ b/kverbos/kverbos/kverbosview.h @@ -34,7 +34,7 @@ //class KVerbosDoc; /** The KVerbosView class provides the view widget for the KVerbosApp instance. - * The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow. As KVerbosView is part of the + * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow. As KVerbosView is part of the * docuement-view model, it needs a reference to the document object connected with it by the KVerbosApp class to manipulate and display * the document structure provided by the KVerbosDoc class. * @@ -57,12 +57,12 @@ * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 0.4 code generation */ -class KVerbosView : public QLernen /*QWidget*/ +class KVerbosView : public QLernen /*TQWidget*/ { Q_OBJECT public: /** Constructor for the main view */ - KVerbosView(QWidget *parent = 0, const char *name=0); + KVerbosView(TQWidget *parent = 0, const char *name=0); /** Destructor for the main view */ ~KVerbosView(); @@ -74,10 +74,10 @@ public: KVerbosDoc* getDocument() const; /** contains the implementation for printing functionality */ - void print(QPrinter *pPrinter); + void print(TQPrinter *pPrinter); /** This funktion erases all accents from the letters of a string */ - QString deleteAccents(const QString& s) const; + TQString deleteAccents(const TQString& s) const; /** tell the view that the user has changed. Training results are deleted and set to the * initial values. A new verb is chosen. The function returns the training result of the * old user. r1 is the training results and r2 is the number of the trained verbs. @@ -131,14 +131,14 @@ private: /** the following variables store the information about the actual verb. The information * is obtained from the doc. */ - QString espanol; - QString aleman; + TQString espanol; + TQString aleman; int zeitAuswahl; - QString formen[7][3]; + TQString formen[7][3]; /** tells if the actual input already has been correced by using the button */ bool corrected; /** Are pointers to the GUI elements for an easier use */ - QLineEdit* formEdit[6][3]; + TQLineEdit* formEdit[6][3]; /** the number of verbs that habe been correct */ int enteredCorrect; /** the number of all verbs that have been trained */ diff --git a/kverbos/kverbos/verbspanish.cpp b/kverbos/kverbos/verbspanish.cpp index 8f292419..3fa76dc6 100644 --- a/kverbos/kverbos/verbspanish.cpp +++ b/kverbos/kverbos/verbspanish.cpp @@ -50,8 +50,8 @@ endingsArray verbSpanish::verbEndings = { { {"o", "as", "a", "amos", " {"+", "+", "+", "+", "+", "+"}} }; -QString verbSpanish::refPron[PERSONEN] = {"me", "te", "se", "nos", "os", "se"}; -QString verbSpanish::estar[MAX_TIEMPOS][PERSONEN] = +TQString verbSpanish::refPron[PERSONEN] = {"me", "te", "se", "nos", "os", "se"}; +TQString verbSpanish::estar[MAX_TIEMPOS][PERSONEN] = { {"estoy", "estás", "está", "estamos", "estáis", "están"}, {"estaba", "estabas", "estaba", "estábamos", "estabais", "estaban"}, {"estuve", "estuviste", "estuvo", "estuvimos", "estuvisteis", "estuvieron"}, @@ -64,7 +64,7 @@ QString verbSpanish::estar[MAX_TIEMPOS][PERSONEN] = {"", "está", "esté", "estemos", "estad", "estén"} }; -QString verbSpanish::haber[MAX_TIEMPOS][PERSONEN] = +TQString verbSpanish::haber[MAX_TIEMPOS][PERSONEN] = { {"he", "has", "ha", "hemos", "habéis", "han"}, {"había", "habías", "había", "habíamos", "habíais", "habían"}, {"hube", "hubiste", "hubo", "hubimos", "hubisteis", "hubieron"}, @@ -77,7 +77,7 @@ QString verbSpanish::haber[MAX_TIEMPOS][PERSONEN] = {"", "he", "haya", "hayamos", "habed", "hayan"} }; -QString verbSpanish::timeNames[MAX_TIEMPOS*MAX_SUBTYPES] = +TQString verbSpanish::timeNames[MAX_TIEMPOS*MAX_SUBTYPES] = {"presente", "imperfecto", "indefinido", "futuro", "condicional", "subjuntivo presente", "subjuntivo pasado", "subjuntivo futuro", "imperativo", "presente progresivo", "imperfecto progresivo", "indefinido progresivo", "futuro progresivo", "condicional progresivo", @@ -86,7 +86,7 @@ QString verbSpanish::timeNames[MAX_TIEMPOS*MAX_SUBTYPES] = "subjuntivo presente perfecto", "subjuntivo pasado perfecto", "subjuntivo futuro perfecto", "error:form doesn't exist", }; -QString verbSpanish::groupNames[MAX_GRUPPEN] = +TQString verbSpanish::groupNames[MAX_GRUPPEN] = {"regular", "irregular", "e > ie", "o > ue", "u > ue", "e > i", "c > qu", "g > gu", "z > c", "gu > gü", "c > z", "g > j", "gu > g", "qu > c", "accent like 'enviar'", @@ -196,8 +196,8 @@ bool verbSpanish::operator== (const verbSpanish& v) const return ((spanish == v.spanish) && vergleich(foreign, v.foreign)); } -// prüft ob der QString mit der spanischen Form übereinstimmt. -bool verbSpanish::operator== (const QString& s) const +// prüft ob der TQString mit der spanischen Form übereinstimmt. +bool verbSpanish::operator== (const TQString& s) const { return (spanish == s); } @@ -257,18 +257,18 @@ bool verbSpanish::isEmpty() const // Gibt den Verbstamm zurück. Dazu werden die letzten beiden Zeichen abgetrennt, // handelt es sich um ein reflexives Verb, dann sind es vier Zeichen. // Hier werden auch die Stammveränderungen der Gruppenverben durchgeführt. -QString verbSpanish::getStem() const +TQString verbSpanish::getStem() const { int ab = 2; if (isReflexiv()) ab += 2; - QString s = spanish; + TQString s = spanish; s.truncate(s.length()-ab); return s; } // gibt das Verb in der nicht spanischen Sprache zurück -QString verbSpanish::getForeign() const +TQString verbSpanish::getForeign() const { return foreign; } @@ -280,27 +280,27 @@ QString verbSpanish::getForeign() const // code umgewandelt wird. // Es wird nicht geprüft, ob der string keine Leerzeichen mehr enthält, denn das // dürfte eigentlich nicht vorkommen. -void verbSpanish::setForeign(const QString &s) +void verbSpanish::setForeign(const TQString &s) { foreign = s.simplifyWhiteSpace(); } // gibt das Verb auf spanisch zurück -QString verbSpanish::getSpanish() const +TQString verbSpanish::getSpanish() const { return spanish; } // Setzt die spanische Bedeutung des Verbes. // Siehe auch die Bemerkungen zur Arbeitsweise der Funktionbei der setForeign Funktion. -void verbSpanish::setSpanish(const QString &s) +void verbSpanish::setSpanish(const TQString &s) { spanish = s.simplifyWhiteSpace(); } // gibt die Gerundform des Verbes zurück. Dabei gilt: Alle Gruppenverben haben einen // regelmäßigen Gerund. Nur die irregulären Verben haben eventuell auch eine andere Gerundform -QString verbSpanish::getGerund() +TQString verbSpanish::getGerund() { if (!conjugated) conjugateAll(); @@ -309,14 +309,14 @@ QString verbSpanish::getGerund() // setzt die Gerundform des Verbes // Siehe auch die Bemerkungen zur Arbeitsweise der Funktionbei der setForeign Funktion. -void verbSpanish::setGerund(const QString &s) +void verbSpanish::setGerund(const TQString &s) { gerund = s.simplifyWhiteSpace(); } // gibt die Partizipform der Verbes zurück.Dabei gilt: Alle Gruppenverben haben ein // regelmäßiges Partizip. Nur die irregulären Verben haben eventuell auch eine andere Partizipform -QString verbSpanish::getPartizip() +TQString verbSpanish::getPartizip() { if (!conjugated) conjugateAll(); @@ -325,7 +325,7 @@ QString verbSpanish::getPartizip() // setzt die Partizipform der Verbes // Siehe auch die Bemerkungen zur Arbeitsweise der Funktionbei der setForeign Funktion. -void verbSpanish::setPartizip(const QString &s) +void verbSpanish::setPartizip(const TQString &s) { partizip = s.simplifyWhiteSpace(); } @@ -336,7 +336,7 @@ endings verbSpanish::getEnding(bool& good) if (spanish.isEmpty()) return empty; endings en = empty; - QString endung = ""; + TQString endung = ""; if (isReflexiv()) { endung = spanish.mid(spanish.length()-4, 2); @@ -375,7 +375,7 @@ bool verbSpanish::isReflexiv() const } // gibt das Reflexivpronomen zurück, das zu der angegebenen Person gehört. -QString verbSpanish::getRefPron(int i) +TQString verbSpanish::getRefPron(int i) { return refPron[i]; } @@ -396,7 +396,7 @@ void verbSpanish::setGroup(const int g) // die Person p und den Untertyp typ angegeben wird. Mit dieser Funktion können auch // die zusammengesetzten Zeitforms erfragt werden. // parts[0] = ref. Pron. part[1] = Hilfsverb parts[2] = verb -bool verbSpanish::getForm(int t, int p, int typ, QString parts[]) +bool verbSpanish::getForm(int t, int p, int typ, TQString parts[]) { bool good = !error; if (good) @@ -438,9 +438,9 @@ bool verbSpanish::getForm(int t, int p, int typ, QString parts[]) } // Eine überladene Funktion, die einen String zurückgibt. -QString verbSpanish::getForm(int t, int p) +TQString verbSpanish::getForm(int t, int p) { - QString st[3]; + TQString st[3]; if (getForm(t, p, normal, st)) return st[2]; return ""; @@ -448,7 +448,7 @@ QString verbSpanish::getForm(int t, int p) // setzt die angegebene Verbform mit int als Parameter // Siehe auch die Bemerkungen zur Arbeitsweise der Funktion bei der setForeign Funktion. -void verbSpanish::setForm(int t, int p, QString s) +void verbSpanish::setForm(int t, int p, TQString s) { forms[t][p] = s.simplifyWhiteSpace(); } @@ -456,7 +456,7 @@ void verbSpanish::setForm(int t, int p, QString s) // bildet die Formen, d.h. hängt die Endungen an den unveränderlichen // Teil an. // Die Form muss bisher ein leerer String sein. -bool verbSpanish::conjugateTime(const int t, const QString &s) +bool verbSpanish::conjugateTime(const int t, const TQString &s) { bool good = true; for (int i = yo; i <=ellos; i++) @@ -475,7 +475,7 @@ bool verbSpanish::conjugateTime(const int t, const QString &s) // dazu wird an den Verbstamm die entsprechende Endung angehängt bool verbSpanish::conjugatePresente() { - QString s = getStem(); + TQString s = getStem(); return conjugateTime(presente, s); } @@ -483,7 +483,7 @@ bool verbSpanish::conjugatePresente() // dazu wird an den Verbstamm die entsprechende Endung angehängt bool verbSpanish::conjugateImperfecto() { - QString s = getStem(); + TQString s = getStem(); return conjugateTime(imperfecto, s); } @@ -491,7 +491,7 @@ bool verbSpanish::conjugateImperfecto() // dazu wird an den Verbstamm die entsprechende Endung angehängt bool verbSpanish::conjugateIndefinido() { - QString s = getStem(); + TQString s = getStem(); return conjugateTime(indefinido, s); } @@ -500,7 +500,7 @@ bool verbSpanish::conjugateIndefinido() // Verben muss das 'se' abgetrennt werden. bool verbSpanish::conjugateFuturo() { - QString s = getSpanish(); + TQString s = getSpanish(); if (isReflexiv()) s = s.left(s.length()-2); return conjugateTime(futuro, s); @@ -510,7 +510,7 @@ bool verbSpanish::conjugateFuturo() // diese Formen werden ebenfalls vom Infinitiv des Verbes abgeleitet bool verbSpanish::conjugateCondicional() { - QString s = getSpanish(); + TQString s = getSpanish(); if (isReflexiv()) s = s.left(s.length()-2); return conjugateTime(condicional, s); @@ -602,7 +602,7 @@ bool verbSpanish::conjugateAll() // Stringvergleich, bei dem es nur auf ähnlich Bestandteile ankommt. // Bestandteile sind durch Komma getrennt. -bool verbSpanish::vergleich(const QString& s1, const QString& s2) const +bool verbSpanish::vergleich(const TQString& s1, const TQString& s2) const { bool gleich=false; unsigned int l=0; @@ -625,7 +625,7 @@ bool verbSpanish::vergleich(const QString& s1, const QString& s2) const } // returns true if the form is automatic generated and has a '#' on the right end. -bool verbSpanish::isAutoForm(QString& s) const +bool verbSpanish::isAutoForm(TQString& s) const { if ("#" == s.right(1)) return true; @@ -633,7 +633,7 @@ bool verbSpanish::isAutoForm(QString& s) const } // löscht das '#' einer automatisch generierten Form -QString verbSpanish::delAutoForm(QString s) const +TQString verbSpanish::delAutoForm(TQString s) const { if (isAutoForm(s)) s = s.left(s.length()-1); @@ -660,7 +660,7 @@ QString verbSpanish::delAutoForm(QString s) const // 15 -> // 16 -> // -bool verbSpanish::groupVerb(QString &s, int time/*=-1*/, int person/*=-1*/) +bool verbSpanish::groupVerb(TQString &s, int time/*=-1*/, int person/*=-1*/) { bool good = true; int pos; @@ -718,7 +718,7 @@ bool verbSpanish::groupVerb(QString &s, int time/*=-1*/, int person/*=-1*/) // alle subjuntivo Formen und den imperativo if ((presente == time) && (person != nosotros) && (person != vosotros)) { - QString st = getStem(); + TQString st = getStem(); pos = st.findRev("e"); if (pos>=0) { @@ -729,7 +729,7 @@ bool verbSpanish::groupVerb(QString &s, int time/*=-1*/, int person/*=-1*/) else if ((indefinido == time) && ((el == person)||(ellos == person))) { - QString st = getStem(); + TQString st = getStem(); pos = st.findRev("e"); if (pos>=0) { diff --git a/kverbos/kverbos/verbspanish.h b/kverbos/kverbos/verbspanish.h index 8b7cf7b1..f621718d 100644 --- a/kverbos/kverbos/verbspanish.h +++ b/kverbos/kverbos/verbspanish.h @@ -19,7 +19,7 @@ #define VERBSPANISH_H // include qt-Header -#include +#include #define MAX_TIEMPOS 9 #define MAX_SUBTYPES 3 @@ -41,8 +41,8 @@ enum timeTypes {presente, imperfecto, indefinido, futuro, condicional, subPresen enum timeSubTypes {normal, progresivo, perfecto}; enum persons {yo, tu, el, nosotros, vosotros, ellos}; -typedef QString formArray[MAX_TIEMPOS][PERSONEN]; -typedef QString endingsArray[MAX_TIEMPOS][VERBMUSTER][PERSONEN]; +typedef TQString formArray[MAX_TIEMPOS][PERSONEN]; +typedef TQString endingsArray[MAX_TIEMPOS][VERBMUSTER][PERSONEN]; /** This class contains all the information belonging to one verb: * @@ -93,13 +93,13 @@ typedef QString endingsArray[MAX_TIEMPOS][VERBMUSTER][PERSONEN]; * The conjugated forms of the verb are stored in the array 'formArray'. The first index * mentions the time and the second the person. *
-  *  typedef QString formArray[MAX_TIEMPOS][PERSONEN];
+  *  typedef TQString formArray[MAX_TIEMPOS][PERSONEN];
   *  
* * The type 'endingsArray' stores the different endings. The first index means the time, * the second the type of verb (-ar, -er, -ir) and the lase one is the person. *
-  *  typedef QString endingsArray[MAX_TIEMPOS][MAX_SUBTYPES][PERSONEN];
+  *  typedef TQString endingsArray[MAX_TIEMPOS][MAX_SUBTYPES][PERSONEN];
   *  
* * The verbs are divided in several groups: @@ -132,10 +132,10 @@ public: verbSpanish& operator= (const verbSpanish& v); /** If two verbs are compared only the foreign form and the spanish form are compared */ bool operator== (const verbSpanish& v) const; - /** This overloaded == operator compares the verb to a QString. + /** This overloaded == operator compares the verb to a TQString. * Only the spanish meaning is compared. */ - bool operator== (const QString& s) const; + bool operator== (const TQString& s) const; /** The spa/nisch forms of the verb are compared */ bool operator< (const verbSpanish& v) const; /** Compares the verb objects completely, all forms and fields. @@ -146,28 +146,28 @@ public: bool isEmpty() const; /** returns the foreign meaning of the verb */ - QString getForeign() const; + TQString getForeign() const; /** sets the foreign meaning of the verb */ - void setForeign(const QString &s); + void setForeign(const TQString &s); /** returns the spanish meaning of the verb */ - QString getSpanish() const; + TQString getSpanish() const; /** sets the spanish meaning of the verb */ - void setSpanish(const QString &s); + void setSpanish(const TQString &s); /** returns the gerund of the verb */ - QString getGerund(); + TQString getGerund(); /** sets the gerund form to the string given in s */ - void setGerund(const QString &s); + void setGerund(const TQString &s); /** returns the particip of the verb */ - QString getPartizip(); + TQString getPartizip(); /** sets the participe to the string given in s */ - void setPartizip(const QString &s); + void setPartizip(const TQString &s); /** returns if the verb belongs to one of the groups */ bool isGroupVerb(); @@ -186,13 +186,13 @@ public: * parts[2] the verb form * The return value 'bool' indicates if the form could be formed. */ - bool getForm(int t, int p, int typ, QString parts[]); + bool getForm(int t, int p, int typ, TQString parts[]); /** returns the desired verb form indicated by time and person as a string */ - QString getForm(int t, int p); + TQString getForm(int t, int p); /** sets the verb form that is indicated by time and person */ - void setForm(int t, int p, QString s); + void setForm(int t, int p, TQString s); /** The following function generates the regular verb forms. The forms can be * generated time by time or all times in one step by using conjugateAll() */ @@ -202,9 +202,9 @@ public: bool isReflexiv() const; /** returns the reflexive pronoun that belongs to the person p */ - QString getRefPron(int p); + TQString getRefPron(int p); /** tests if the string is an automatic generated Form, that means the last char is '#' */ - bool isAutoForm(QString& s) const; + bool isAutoForm(TQString& s) const; private: bool conjugatePresente(); bool conjugateImperfecto(); @@ -216,7 +216,7 @@ private: bool conjugateImperativo(); /** returns the verb stem */ - QString getStem() const; + TQString getStem() const; /** returns the ending of the verb */ endings getEnding(bool& good); @@ -226,7 +226,7 @@ private: * bereits eine gültige Form vorliegt und diese Form eine unregelmäßige Form ist, die * nicht überschrieben werden soll. */ - bool conjugateTime(const int t, const QString &s); + bool conjugateTime(const int t, const TQString &s); /** Es wird verglichen, ob die beiden Strings gemeinsame Bestandteile haben. Also * "gehen, laufen, springen" wird etwa mit "gehen, laufen" verglichen. Die Funktion * gibt in so einem Fall 'true' zurück, auch wenn im zweiten String ein Teil @@ -234,24 +234,24 @@ private: * mehr oder weniger deutsche Bedeutungen oder die Bedeutungen in anderer Reihenfolge * angegeben sind. */ - bool vergleich(const QString& s1, const QString& s2) const; + bool vergleich(const TQString& s1, const TQString& s2) const; /** Deletes the '#' character from autogenerated forms. */ - QString delAutoForm(QString s) const; + TQString delAutoForm(TQString s) const; /** does the changes for group verbs */ - bool groupVerb(QString &s, int time=-1, int person=-1); + bool groupVerb(TQString &s, int time=-1, int person=-1); /** the verb in the foreign language */ - QString foreign; + TQString foreign; /** the spanish verb */ - QString spanish; + TQString spanish; /** the gerund form of the verb */ - QString gerund; + TQString gerund; /** the partizip form of the verb */ - QString partizip; + TQString partizip; /** the array for all the different forms of the verb */ formArray forms; @@ -270,32 +270,32 @@ private: static endingsArray verbEndings; /** the reflexive pronouns */ - static QString refPron[PERSONEN]; + static TQString refPron[PERSONEN]; public: /** The forms of the verb estar. They are needed for the gerund form. */ - static QString estar[MAX_TIEMPOS][PERSONEN]; + static TQString estar[MAX_TIEMPOS][PERSONEN]; /** The forms of the verb haber. They are needed for perfect forms */ - static QString haber[MAX_TIEMPOS][PERSONEN]; + static TQString haber[MAX_TIEMPOS][PERSONEN]; /** This array contains the names of the time forms as strings */ - static QString timeNames[MAX_TIEMPOS*MAX_SUBTYPES]; + static TQString timeNames[MAX_TIEMPOS*MAX_SUBTYPES]; /** This array contains the names of the different verb groups */ - static QString groupNames[MAX_GRUPPEN]; + static TQString groupNames[MAX_GRUPPEN]; static int maxTiempos; static int maxSubtypes; static int persons; static int maxForms; /** The language that is selected at the moment. This selection affects all the instances * of the class. */ - static QString language; + static TQString language; }; /** Very often a list of verbs is needed. This is the type definition of a - * QValueList template with the verbSpanish type + * TQValueList template with the verbSpanish type */ -typedef QValueList spanishVerbList; +typedef TQValueList spanishVerbList; #endif diff --git a/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.cpp b/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.cpp index 96d9c23e..7bdfe888 100644 --- a/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.cpp @@ -28,13 +28,13 @@ #include #include "ProgressDlg.h" -#include -#include +#include +#include #include -ProgressDlg::ProgressDlg(const QString &doctitle, const QString &filename, const QString &title, QWidget* parent, const char* name) +ProgressDlg::ProgressDlg(const TQString &doctitle, const TQString &filename, const TQString &title, TQWidget* parent, const char* name) : ProgressDlgForm( parent, name ) { doc = 0; diff --git a/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.h b/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.h index 6be7a8a6..43242aa2 100644 --- a/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.h +++ b/kvoctrain/kvoctrain/common-dialogs/ProgressDlg.h @@ -40,10 +40,10 @@ public: ProgressDlg ( - const QString &doctitle, - const QString &filename, - const QString &title, - QWidget* parent = NULL, + const TQString &doctitle, + const TQString &filename, + const TQString &title, + TQWidget* parent = NULL, const char* name = NULL ); diff --git a/kvoctrain/kvoctrain/common-dialogs/blockoptions.cpp b/kvoctrain/kvoctrain/common-dialogs/blockoptions.cpp index 3a52d912..26834bea 100644 --- a/kvoctrain/kvoctrain/common-dialogs/blockoptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/blockoptions.cpp @@ -23,8 +23,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -74,26 +74,26 @@ static ListRef date_itemlist [] = }; -BlockOptions::BlockOptions(QWidget* parent, const char* name, WFlags fl) +BlockOptions::BlockOptions(TQWidget* parent, const char* name, WFlags fl) : BlockOptionsBase(parent, name, fl) { - connect(expire1, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(block1, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(expire2, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(block2, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(expire3, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(block3, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(expire4, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(block4, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(expire5, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(block5, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(expire6, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(block6, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(expire7, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - connect(block7, SIGNAL(activated(int)), this, SLOT(slotComboBoxActivated(int))); - - connect(kcfg_Block, SIGNAL(toggled(bool)), this, SLOT(slotBlockToggled(bool))); - connect(kcfg_Expire, SIGNAL(toggled(bool)), this, SLOT(slotExpireToggled(bool))); + connect(expire1, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(block1, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(expire2, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(block2, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(expire3, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(block3, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(expire4, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(block4, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(expire5, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(block5, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(expire6, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(block6, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(expire7, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + connect(block7, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotComboBoxActivated(int))); + + connect(kcfg_Block, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotBlockToggled(bool))); + connect(kcfg_Expire, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotExpireToggled(bool))); fillWidgets(); updateWidgets(); @@ -175,7 +175,7 @@ void BlockOptions::updateWidgets() emit blockExpireChanged(block, expire); } -void BlockOptions::fillComboBox(QComboBox * cb) +void BlockOptions::fillComboBox(TQComboBox * cb) { ListRef *ref = date_itemlist; @@ -187,7 +187,7 @@ void BlockOptions::fillComboBox(QComboBox * cb) } } -void BlockOptions::updateComboBox(int value, QComboBox * cb) +void BlockOptions::updateComboBox(int value, TQComboBox * cb) { ListRef *ref = date_itemlist; int index = 0; @@ -234,7 +234,7 @@ void BlockOptions::slotComboBoxActivated(int) void BlockOptions::checkValidity() { - QString message; + TQString message; bool found = false; for (int i = 1; i <= 6; i++) { @@ -247,7 +247,7 @@ void BlockOptions::checkValidity() date_itemlist[m_blockComboList[i]->currentItem()].num != 0 && date_itemlist[m_blockComboList[i - 1]->currentItem()].num >= date_itemlist[m_blockComboList[i]->currentItem()].num) { - QString format; + TQString format; if (!found) message.append(i18n("Illogical blocking times.\n")); found = true; @@ -266,7 +266,7 @@ void BlockOptions::checkValidity() date_itemlist[m_expireComboList[i - 1]->currentItem()].num >= date_itemlist[m_expireComboList[i]->currentItem()].num) { - QString format; + TQString format; if (!found) message.append(i18n("\nIllogical expiration times.\n")); found = true; @@ -286,7 +286,7 @@ void BlockOptions::checkValidity() date_itemlist[m_blockComboList[i]->currentItem()].num != 0 && date_itemlist[m_blockComboList[i]->currentItem()].num >= date_itemlist[m_expireComboList[i]->currentItem()].num) { - QString format; + TQString format; if (!found) message.append(i18n("\nIllogical blocking vs. expiration times.\n")); found = true; diff --git a/kvoctrain/kvoctrain/common-dialogs/blockoptions.h b/kvoctrain/kvoctrain/common-dialogs/blockoptions.h index 366d2eb2..1d05f5ef 100644 --- a/kvoctrain/kvoctrain/common-dialogs/blockoptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/blockoptions.h @@ -26,7 +26,7 @@ #ifndef BLOCKOPTIONS_H #define BLOCKOPTIONS_H -#include +#include #include "blockoptionsbase.h" #include "QueryManager.h" @@ -38,7 +38,7 @@ class BlockOptions : public BlockOptionsBase Q_OBJECT public: - BlockOptions(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + BlockOptions(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); void updateWidgets(); bool hasChanged(); bool isDefault(); @@ -55,12 +55,12 @@ protected slots: private: void fillWidgets(); - void fillComboBox(QComboBox *); - void updateComboBox(int, QComboBox *); + void fillComboBox(TQComboBox *); + void updateComboBox(int, TQComboBox *); void checkValidity(); - QValueList m_blockComboList; - QValueList m_expireComboList; + TQValueList m_blockComboList; + TQValueList m_expireComboList; }; #endif diff --git a/kvoctrain/kvoctrain/common-dialogs/generaloptions.cpp b/kvoctrain/kvoctrain/common-dialogs/generaloptions.cpp index ba3f0b14..e69d5c99 100644 --- a/kvoctrain/kvoctrain/common-dialogs/generaloptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/generaloptions.cpp @@ -23,13 +23,13 @@ * * ***************************************************************************/ -#include +#include #include #include "generaloptions.h" -GeneralOptions::GeneralOptions(QWidget* parent, const char* name, WFlags fl) +GeneralOptions::GeneralOptions(TQWidget* parent, const char* name, WFlags fl) : GeneralOptionsBase(parent,name,fl) { kcfg_BackupTime->setEnabled(kcfg_AutoBackup->isChecked()); diff --git a/kvoctrain/kvoctrain/common-dialogs/generaloptions.h b/kvoctrain/kvoctrain/common-dialogs/generaloptions.h index c4c7cc0b..434dd669 100644 --- a/kvoctrain/kvoctrain/common-dialogs/generaloptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/generaloptions.h @@ -33,7 +33,7 @@ class GeneralOptions : public GeneralOptionsBase Q_OBJECT public: - GeneralOptions(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + GeneralOptions(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); }; #endif diff --git a/kvoctrain/kvoctrain/common-dialogs/groupoptions.cpp b/kvoctrain/kvoctrain/common-dialogs/groupoptions.cpp index fae9cfa4..ea11654b 100644 --- a/kvoctrain/kvoctrain/common-dialogs/groupoptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/groupoptions.cpp @@ -23,12 +23,12 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include "groupoptions.h" -GroupOptions::GroupOptions(QWidget* parent, const char* name, WFlags fl) +GroupOptions::GroupOptions(TQWidget* parent, const char* name, WFlags fl) : GroupOptionsBase(parent,name,fl) { diff --git a/kvoctrain/kvoctrain/common-dialogs/groupoptions.h b/kvoctrain/kvoctrain/common-dialogs/groupoptions.h index bc8993af..6db54524 100644 --- a/kvoctrain/kvoctrain/common-dialogs/groupoptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/groupoptions.h @@ -33,7 +33,7 @@ class GroupOptions : public GroupOptionsBase Q_OBJECT public: - GroupOptions(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + GroupOptions(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); void updateButtons(); }; diff --git a/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.cpp b/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.cpp index 2af07f63..73db49ce 100644 --- a/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.cpp @@ -16,12 +16,12 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -54,7 +54,7 @@ static const char unapplied[] = I18N_NOOP( "If you save a profile, those changes will not be included.\n" "Do you wish to continue?"); -KVocTrainPrefs::KVocTrainPrefs(LangSet & ls, kvoctrainDoc * doc, KComboBox * lessons, QueryManager * m, QWidget *parent, +KVocTrainPrefs::KVocTrainPrefs(LangSet & ls, kvoctrainDoc * doc, KComboBox * lessons, QueryManager * m, TQWidget *parent, const char *name, KConfigSkeleton *config, DialogType dialogType, int /*dialogButtons*/, ButtonCode /*defaultButton*/, bool /*modal*/) : KConfigDialog(parent, name, config, dialogType, Default|Ok|Apply|Cancel|Help|User1, Ok, true), m_langSet(ls) @@ -67,26 +67,26 @@ KVocTrainPrefs::KVocTrainPrefs(LangSet & ls, kvoctrainDoc * doc, KComboBox * les m_languageOptions = new LanguageOptions(m_langSet, 0, "Language Settings"); addPage(m_languageOptions, i18n("Languages"), "set_language", i18n("Language Settings"), true); - connect(m_languageOptions, SIGNAL(widgetModified()), this, SLOT(updateButtons())); + connect(m_languageOptions, TQT_SIGNAL(widgetModified()), this, TQT_SLOT(updateButtons())); m_viewOptions = new ViewOptions(0, "View Settings"); addPage(m_viewOptions, i18n("View"), "view_choose", i18n("View Settings"), true); m_pasteOptions = new PasteOptions(m_langSet, doc, 0, "Copy & Paste Settings"); addPage(m_pasteOptions, i18n("Copy & Paste"), "editpaste", i18n("Copy & Paste Settings"), true); - connect(m_pasteOptions, SIGNAL(widgetModified()), this, SLOT(updateButtons())); + connect(m_pasteOptions, TQT_SIGNAL(widgetModified()), this, TQT_SLOT(updateButtons())); m_queryOptions = new QueryOptions(0, "Query Settings"); addPage(m_queryOptions, i18n("Query"), "run_query", i18n("Query Settings"), true); m_thresholdOptions = new ThresholdOptions(lessons, m_queryManager, 0, "Threshold Settings"); addPage(m_thresholdOptions, i18n("Thresholds"), "configure", i18n("Threshold Settings"), true); - connect(m_thresholdOptions, SIGNAL(widgetModified()), this, SLOT(updateButtons())); + connect(m_thresholdOptions, TQT_SIGNAL(widgetModified()), this, TQT_SLOT(updateButtons())); m_blockOptions = new BlockOptions(0, "Blocking Settings"); addPage(m_blockOptions, i18n("Blocking"), "configure", i18n("Blocking Settings"), true); - connect(m_blockOptions, SIGNAL(widgetModified()), this, SLOT(updateButtons())); - connect(m_blockOptions, SIGNAL(blockExpireChanged(bool, bool)), m_thresholdOptions, SLOT(slotBlockExpire(bool, bool))); + connect(m_blockOptions, TQT_SIGNAL(widgetModified()), this, TQT_SLOT(updateButtons())); + connect(m_blockOptions, TQT_SIGNAL(blockExpireChanged(bool, bool)), m_thresholdOptions, TQT_SLOT(slotBlockExpire(bool, bool))); setButtonGuiItem(KDialogBase::User1, KGuiItem(i18n("&Profiles..."))); setButtonTip(KDialogBase::User1, i18n("Save or load specific Query settings which consist in a profile")); @@ -143,7 +143,7 @@ void KVocTrainPrefs::slotUser1() if (showDlg) { ProfilesDialog * dlg = new ProfilesDialog(m_queryManager, this, 0, true); - connect(dlg, SIGNAL(profileActivated()), this, SLOT(updateWidgets())); + connect(dlg, TQT_SIGNAL(profileActivated()), this, TQT_SLOT(updateWidgets())); dlg->show(); } } diff --git a/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.h b/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.h index ca723129..3aaf994d 100644 --- a/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.h +++ b/kvoctrain/kvoctrain/common-dialogs/kvoctrainprefs.h @@ -46,7 +46,7 @@ public: /** * Creates a configuration dialog. */ - KVocTrainPrefs(LangSet & ls, kvoctrainDoc * doc, KComboBox * lessons, QueryManager * m, QWidget *parent=0, + KVocTrainPrefs(LangSet & ls, kvoctrainDoc * doc, KComboBox * lessons, QueryManager * m, TQWidget *parent=0, const char *name=0, KConfigSkeleton *config=0, DialogType dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel|Help, ButtonCode defaultButton=Ok, bool modal=false); diff --git a/kvoctrain/kvoctrain/common-dialogs/languageoptions.cpp b/kvoctrain/kvoctrain/common-dialogs/languageoptions.cpp index cbe8f08f..5da383b0 100644 --- a/kvoctrain/kvoctrain/common-dialogs/languageoptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/languageoptions.cpp @@ -25,10 +25,10 @@ //based on code copyright (C) 1999-2001 Ewald Arnold -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -677,19 +677,19 @@ KV_ISO639_Code kv_iso639_2[] = { }; */ -LanguageOptions::LanguageOptions(LangSet & langset, QWidget* parent, const char* name, WFlags fl) +LanguageOptions::LanguageOptions(LangSet & langset, TQWidget* parent, const char* name, WFlags fl) : LanguageOptionsBase(parent, name, fl), m_langSet(langset) { langset_popup = 0; - connect(b_langDel, SIGNAL(clicked()), this, SLOT(slotDeleteClicked())); - connect(b_langNew, SIGNAL(clicked()), this, SLOT(slotNewClicked())); - connect(b_langPixmap, SIGNAL(clicked()), SLOT(slotPixmapClicked())); - connect(e_newName, SIGNAL(textChanged(const QString&)), this, SLOT(slotNewNameChanged(const QString&))); - connect(d_shortName, SIGNAL(activated(const QString&)), this, SLOT(slotShortActivated(const QString&))); - connect(e_langLong, SIGNAL(textChanged(const QString&)), this, SLOT(slotLangChanged(const QString&))); - connect(e_shortName2, SIGNAL(textChanged(const QString&)), this, SLOT(slotShort2Changed(const QString&))); - connect(d_kblayout, SIGNAL(activated(const QString&)), this, SLOT(slotKeyboardLayoutChanged(const QString&))); + connect(b_langDel, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteClicked())); + connect(b_langNew, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewClicked())); + connect(b_langPixmap, TQT_SIGNAL(clicked()), TQT_SLOT(slotPixmapClicked())); + connect(e_newName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotNewNameChanged(const TQString&))); + connect(d_shortName, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotShortActivated(const TQString&))); + connect(e_langLong, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotLangChanged(const TQString&))); + connect(e_shortName2, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotShort2Changed(const TQString&))); + connect(d_kblayout, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotKeyboardLayoutChanged(const TQString&))); // Load the languages first, then the countries and create the // menus for the languages last, so they will have flags @@ -715,7 +715,7 @@ LanguageOptions::LanguageOptions(LangSet & langset, QWidget* parent, const char* e_shortName2->setText(m_langSet.shortId2(0)); if (!m_langSet.PixMapFile(0).isEmpty() ) { - QPixmap pix(m_langSet.PixMapFile(0)); + TQPixmap pix(m_langSet.PixMapFile(0)); if (!pix.isNull() ) { m_lastPix = m_langSet.PixMapFile(0); @@ -782,7 +782,7 @@ void LanguageOptions::slotDeleteClicked() } -void LanguageOptions::slotKeyboardLayoutChanged(const QString& layout) +void LanguageOptions::slotKeyboardLayoutChanged(const TQString& layout) { m_langSet.setKeyboardLayout(layout, d_shortName->currentItem()); emit widgetModified(); @@ -802,9 +802,9 @@ void LanguageOptions::enableLangWidgets() if (enabled && KApplication::dcopClient()->isApplicationRegistered("kxkb")) { - QByteArray data; - QCString replyType; - QByteArray replyData; + TQByteArray data; + TQCString replyType; + TQByteArray replyData; if (!KApplication::dcopClient()->call("kxkb", "kxkb", "getLayoutsList()", data, replyType, replyData)) { @@ -812,12 +812,12 @@ void LanguageOptions::enableLangWidgets() } else { - if (replyType == "QStringList") + if (replyType == "TQStringList") { - QStringList layouts; - QDataStream stream(replyData, IO_ReadOnly); + TQStringList layouts; + TQDataStream stream(replyData, IO_ReadOnly); stream >> layouts; - layouts.prepend(QString::null); + layouts.prepend(TQString::null); d_kblayout->clear(); d_kblayout->insertStringList(layouts); } @@ -832,16 +832,16 @@ void LanguageOptions::enableLangWidgets() } -void LanguageOptions::slotNewNameChanged(const QString& _s) +void LanguageOptions::slotNewNameChanged(const TQString& _s) { - QString s = _s; + TQString s = _s; b_langNew->setEnabled(s.stripWhiteSpace().length() >= 2); } void LanguageOptions::slotNewClicked() { - QString s = e_newName->text(); + TQString s = e_newName->text(); d_shortName->insertItem(s.stripWhiteSpace()); d_shortName->setCurrentItem(d_shortName->count()-1); enableLangWidgets(); @@ -851,10 +851,10 @@ void LanguageOptions::slotNewClicked() } -void LanguageOptions::slotShortActivated(const QString& _id) +void LanguageOptions::slotShortActivated(const TQString& _id) { int i = 0; - QString id = _id.stripWhiteSpace(); + TQString id = _id.stripWhiteSpace(); if (d_shortName->count() > (int) m_langSet.size() ) { // avoid duplicates in language code @@ -889,7 +889,7 @@ void LanguageOptions::slotShortActivated(const QString& _id) if (!m_langSet.PixMapFile(d_shortName->currentItem()).isEmpty()) { - QPixmap pix(m_langSet.PixMapFile(d_shortName->currentItem())); + TQPixmap pix(m_langSet.PixMapFile(d_shortName->currentItem())); if (!pix.isNull()) b_langPixmap->setPixmap(pix); else @@ -898,7 +898,7 @@ void LanguageOptions::slotShortActivated(const QString& _id) else b_langPixmap->setText (i18n("No Picture Selected")); - QString layout = m_langSet.keyboardLayout(d_shortName->currentItem()); + TQString layout = m_langSet.keyboardLayout(d_shortName->currentItem()); //kdDebug() << "layout to select " << layout << endl; @@ -919,7 +919,7 @@ void LanguageOptions::slotShortActivated(const QString& _id) } -void LanguageOptions::slotLangChanged(const QString& s) +void LanguageOptions::slotLangChanged(const TQString& s) { if (d_shortName->count() != 0 && d_shortName->currentItem() < (int) m_langSet.size()) { @@ -930,7 +930,7 @@ void LanguageOptions::slotLangChanged(const QString& s) } -void LanguageOptions::slotShort2Changed(const QString& s) +void LanguageOptions::slotShort2Changed(const TQString& s) { if (d_shortName->count() != 0 && d_shortName->currentItem() < (int) m_langSet.size()) { @@ -941,11 +941,11 @@ void LanguageOptions::slotShort2Changed(const QString& s) } -bool LanguageOptions::setPixmap(QString pm) +bool LanguageOptions::setPixmap(TQString pm) { if (d_shortName->count() ) { - QPixmap pix (pm); + TQPixmap pix (pm); if (!pix.isNull() ) { m_langSet.setPixMapFile(pm, d_shortName->currentItem()); b_langPixmap->setPixmap (pix); @@ -963,9 +963,9 @@ void LanguageOptions::slotPixmapClicked() { if (m_langSet.size() > 0 ) { - if (m_lastPix.isNull() || QPixmap(m_lastPix).isNull()) + if (m_lastPix.isNull() || TQPixmap(m_lastPix).isNull()) { - QString s; + TQString s; if (!m_langSet.shortId(d_shortName->currentItem()).isNull()) { s = m_langSet.shortId(d_shortName->currentItem()); @@ -981,11 +981,11 @@ void LanguageOptions::slotPixmapClicked() } else { - QFileInfo fi (m_lastPix); + TQFileInfo fi (m_lastPix); m_lastPix = fi.dirPath()+"/flag.png"; } - QString s = KFileDialog::getOpenFileName (m_lastPix, "*.png *.xpm *.gif *.xbm"); + TQString s = KFileDialog::getOpenFileName (m_lastPix, "*.png *.xpm *.gif *.xbm"); if (!s.isEmpty() ) { if (setPixmap (s)) @@ -1008,22 +1008,22 @@ void LanguageOptions::loadCountryData() { // temperary use of our locale as the global locale KLocale *lsave = KGlobal::_locale; - QString curr_lang = lsave->language(); + TQString curr_lang = lsave->language(); // KLocale locale("kvoctrain"); - KLocale locale(QString::null); + KLocale locale(TQString::null); locale.setLanguage(curr_lang); KGlobal::_locale = &locale; - QString sub = QString::fromLatin1("l10n/"); - QStringList regionlist = KGlobal::dirs()->findAllResources("locale", sub + QString::fromLatin1("*.desktop")); + TQString sub = TQString::fromLatin1("l10n/"); + TQStringList regionlist = KGlobal::dirs()->findAllResources("locale", sub + TQString::fromLatin1("*.desktop")); regionlist.sort(); - QMap regions; + TQMap regions; - for (QStringList::ConstIterator it = regionlist.begin(); it != regionlist.end(); ++it) + for (TQStringList::ConstIterator it = regionlist.begin(); it != regionlist.end(); ++it) { - QString tag = *it; + TQString tag = *it; int index; index = tag.findRev('/'); @@ -1033,24 +1033,24 @@ void LanguageOptions::loadCountryData() if (index != -1) tag.truncate(index); KSimpleConfig entry(*it); - entry.setGroup(QString::fromLatin1("KCM Locale")); - QString name = entry.readEntry(QString::fromLatin1("Name"), i18n("without name")); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name"), i18n("without name")); regions.insert(tag, Region(name)); } // add all languages to the list - QStringList countrylist = KGlobal::dirs()->findAllResources("locale", sub + QString::fromLatin1("*/entry.desktop")); + TQStringList countrylist = KGlobal::dirs()->findAllResources("locale", sub + TQString::fromLatin1("*/entry.desktop")); int idx = 0; - for (QStringList::ConstIterator sit = countrylist.begin(); sit != countrylist.end(); ++sit) + for (TQStringList::ConstIterator sit = countrylist.begin(); sit != countrylist.end(); ++sit) { KSimpleConfig entry(*sit); - entry.setGroup(QString::fromLatin1("KCM Locale")); - QString name = entry.readEntry(QString::fromLatin1("Name"), i18n("without name")); - QString submenu = entry.readEntry(QString::fromLatin1("Region")); + entry.setGroup(TQString::fromLatin1("KCM Locale")); + TQString name = entry.readEntry(TQString::fromLatin1("Name"), i18n("without name")); + TQString submenu = entry.readEntry(TQString::fromLatin1("Region")); - QString tag = *sit; + TQString tag = *sit; int index = tag.findRev('/'); tag.truncate(index); index = tag.findRev('/'); @@ -1059,15 +1059,15 @@ void LanguageOptions::loadCountryData() if (tag == "C") continue; - QStringList all_langs = QStringList::split(",", entry.readEntry(QString::fromLatin1("Languages"))); - QValueList langs; + TQStringList all_langs = TQStringList::split(",", entry.readEntry(TQString::fromLatin1("Languages"))); + TQValueList langs; - QString pixmap = *sit; + TQString pixmap = *sit; index = pixmap.findRev('/'); pixmap.truncate(index); pixmap += "/flag.png"; - for (QStringList::Iterator it = all_langs.begin(); it != all_langs.end(); ++it) + for (TQStringList::Iterator it = all_langs.begin(); it != all_langs.end(); ++it) { // Treat ie "en_GB" and "en_USE" as "en" because the language list // only contains the first letters @@ -1092,30 +1092,30 @@ void LanguageOptions::loadCountryData() regions[submenu].countries.append(countryIdMap[id]); } - langset_popup = new QPopupMenu(); + langset_popup = new TQPopupMenu(); // To have it sorted by name - QMap regmap; - for (QMap::Iterator it = regions.begin(); it != regions.end(); ++it) + TQMap regmap; + for (TQMap::Iterator it = regions.begin(); it != regions.end(); ++it) regmap.insert(it.data().region, it.data()); - connect(langset_popup, SIGNAL(activated(int)), this, SLOT(slotLangFromGlobalActivated(int))); - for (QMap::Iterator it = regmap.begin(); it != regmap.end(); ++it) + connect(langset_popup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotLangFromGlobalActivated(int))); + for (TQMap::Iterator it = regmap.begin(); it != regmap.end(); ++it) { - QPopupMenu *regpop = new QPopupMenu(); - connect(regpop, SIGNAL(activated(int)), this, SLOT(slotLangFromGlobalActivated(int))); + TQPopupMenu *regpop = new TQPopupMenu(); + connect(regpop, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotLangFromGlobalActivated(int))); langset_popup->insertItem(it.key(), regpop); Region r = it.data(); // To have it sorted by name - QMap countrymap; - for (QValueList::Iterator it = r.countries.begin(); it != r.countries.end(); ++it) + TQMap countrymap; + for (TQValueList::Iterator it = r.countries.begin(); it != r.countries.end(); ++it) { countrymap.insert((*it).country, *it); } - for (QMap::Iterator it = countrymap.begin(); it != countrymap.end(); ++it) + for (TQMap::Iterator it = countrymap.begin(); it != countrymap.end(); ++it) { - regpop->insertItem(QPixmap(it.data().pixmap), it.key(), it.data().id); + regpop->insertItem(TQPixmap(it.data().pixmap), it.key(), it.data().id); } } @@ -1130,9 +1130,9 @@ void LanguageOptions::slotLangFromGlobalActivated(int i) { Country c = countryIdMap[i]; bool first = true; - for (QValueList::Iterator it = c.langs.begin(); it != c.langs.end(); ++it) + for (TQValueList::Iterator it = c.langs.begin(); it != c.langs.end(); ++it) { - QString s = global_langset.shortId(*it); + TQString s = global_langset.shortId(*it); if (d_shortName->contains(s.stripWhiteSpace())) { @@ -1177,43 +1177,43 @@ void LanguageOptions::loadISO6391Data() { for (unsigned id = 0; id < (int)(sizeof(kv_iso639_1) / sizeof(kv_iso639_1[0])) && kv_iso639_1[id].iso1code != 0; ++id) { - QString s = i18n(kv_iso639_1[id].langname); - global_langset.addSet(kv_iso639_1[id].iso1code, s, QString::null, kv_iso639_1[id].iso2code); + TQString s = i18n(kv_iso639_1[id].langname); + global_langset.addSet(kv_iso639_1[id].iso1code, s, TQString::null, kv_iso639_1[id].iso2code); } } void LanguageOptions::createISO6391Menus() { // To have it sorted by name - QMap languages; + TQMap languages; for (unsigned id = 0; id < global_langset.size(); ++id) { - QString s = global_langset.longId(id); + TQString s = global_langset.longId(id); languages.insert(s, id); } - iso6391_popup = new QPopupMenu(); + iso6391_popup = new TQPopupMenu(); - QPopupMenu *pop = 0; - QString lang = ""; - for (QMap::Iterator it = languages.begin(); it != languages.end(); ++it) + TQPopupMenu *pop = 0; + TQString lang = ""; + for (TQMap::Iterator it = languages.begin(); it != languages.end(); ++it) { if (it.key()[0].upper() != lang[0].upper()) { - pop = new QPopupMenu(); - connect(pop, SIGNAL(activated(int)), this, SLOT(slotLangFromISO6391Activated(int))); + pop = new TQPopupMenu(); + connect(pop, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotLangFromISO6391Activated(int))); iso6391_popup->insertItem(it.key()[0].upper(), pop, 1); } lang = it.key(); - QString shortid = global_langset.shortId(it.data()); - QString short2id = global_langset.shortId2(it.data()); + TQString shortid = global_langset.shortId(it.data()); + TQString short2id = global_langset.shortId2(it.data()); lang += "\t("+shortid+")"; - QString pixmap = global_langset.PixMapFile(it.data()); + TQString pixmap = global_langset.PixMapFile(it.data()); if (pixmap.isEmpty()) pop->insertItem(lang, it.data()); else - pop->insertItem(QPixmap(pixmap), lang, it.data()); + pop->insertItem(TQPixmap(pixmap), lang, it.data()); } } @@ -1221,7 +1221,7 @@ void LanguageOptions::slotLangFromISO6391Activated(int id) { if (id < (int)global_langset.size()) { - QString shortid = global_langset.shortId(id); + TQString shortid = global_langset.shortId(id); if (d_shortName->contains(shortid.stripWhiteSpace())) { @@ -1269,7 +1269,7 @@ void LanguageOptions::updateSettings() for (int i = 0 ; i < (int) m_langSet.size(); i++) { - LanguageSettings languageSettings(QString::number(i)); + LanguageSettings languageSettings(TQString::number(i)); languageSettings.setShortId(m_langSet.shortId(i)); languageSettings.setShort2Id(m_langSet.shortId2(i)); languageSettings.setLongId(m_langSet.longId(i)); diff --git a/kvoctrain/kvoctrain/common-dialogs/languageoptions.h b/kvoctrain/kvoctrain/common-dialogs/languageoptions.h index b36d49a3..5da2bd88 100644 --- a/kvoctrain/kvoctrain/common-dialogs/languageoptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/languageoptions.h @@ -26,7 +26,7 @@ #ifndef LANGUAGEOPTIONS_H #define LANGUAGEOPTIONS_H -#include +#include #include "languageoptionsbase.h" #include "langset.h" @@ -36,29 +36,29 @@ class LanguageOptions : public LanguageOptionsBase Q_OBJECT public: - LanguageOptions(LangSet & langset, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + LanguageOptions(LangSet & langset, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); virtual ~LanguageOptions (); LangSet getLangSet () const; struct Country { - Country(const QString& c, const QValueList l, const QString& p, int i) + Country(const TQString& c, const TQValueList l, const TQString& p, int i) : country(c), langs(l), pixmap(p), id(i) { } Country() { } - QString country; - QValueList langs; - QString pixmap; + TQString country; + TQValueList langs; + TQString pixmap; int id; }; struct Region { - Region (const QString& reg) + Region (const TQString& reg) : region(reg) {} Region() {} - QString region; - QValueList countries; + TQString region; + TQValueList countries; }; void updateWidgets(); @@ -73,27 +73,27 @@ protected slots: void slotDeleteClicked(); void slotNewClicked(); void slotPixmapClicked(); - void slotLangChanged(const QString&); - void slotShort2Changed(const QString&); - void slotShortActivated(const QString&); - void slotNewNameChanged(const QString&); + void slotLangChanged(const TQString&); + void slotShort2Changed(const TQString&); + void slotShortActivated(const TQString&); + void slotNewNameChanged(const TQString&); void slotLangFromGlobalActivated(int); void slotLangFromISO6391Activated(int); - void slotKeyboardLayoutChanged(const QString&); + void slotKeyboardLayoutChanged(const TQString&); private: - bool setPixmap(QString pm); + bool setPixmap(TQString pm); void enableLangWidgets(); void loadCountryData(); void loadISO6391Data(); void createISO6391Menus(); LangSet global_langset; - QMap countryIdMap; - QPopupMenu * langset_popup; - QPopupMenu * iso6391_popup; + TQMap countryIdMap; + TQPopupMenu * langset_popup; + TQPopupMenu * iso6391_popup; LangSet m_langSet; - QString m_lastPix; + TQString m_lastPix; bool m_hasChanged; }; diff --git a/kvoctrain/kvoctrain/common-dialogs/pasteoptions.cpp b/kvoctrain/kvoctrain/common-dialogs/pasteoptions.cpp index cbfcadf4..ca79f2d5 100644 --- a/kvoctrain/kvoctrain/common-dialogs/pasteoptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/pasteoptions.cpp @@ -23,10 +23,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -50,7 +50,7 @@ static const char *separator_id[] = 0 }; -PasteOptions::PasteOptions(LangSet & langset, kvoctrainDoc * doc, QWidget* parent, const char* name, WFlags fl) +PasteOptions::PasteOptions(LangSet & langset, kvoctrainDoc * doc, TQWidget* parent, const char* name, WFlags fl) : PasteOptionsBase(parent,name,fl), m_langSet(langset) { OrderList->setEnabled(!kcfg_UseCurrent->isChecked()); @@ -58,13 +58,13 @@ PasteOptions::PasteOptions(LangSet & langset, kvoctrainDoc * doc, QWidget* paren SkipButton->setEnabled(!kcfg_UseCurrent->isChecked()); DownButton->setEnabled(!kcfg_UseCurrent->isChecked()); - connect(OrderList, SIGNAL(selectionChanged()), this, SLOT(syncButtons())); - connect(DownButton, SIGNAL(clicked()), this, SLOT(slotDownButtonClicked())); - connect(SkipButton, SIGNAL(clicked()), this, SLOT(slotSkipButtonClicked())); - connect(UpButton, SIGNAL(clicked()), this, SLOT(slotUpButtonClicked())); + connect(OrderList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(syncButtons())); + connect(DownButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDownButtonClicked())); + connect(SkipButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSkipButtonClicked())); + connect(UpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUpButtonClicked())); - connect(SeparatorCombo, SIGNAL(activated(int)), this, SLOT(slotSeparatorComboActivated(int))); - connect(kcfg_UseCurrent, SIGNAL(toggled(bool)), this, SLOT(slotUseCurrentDocToggled(bool))); + connect(SeparatorCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSeparatorComboActivated(int))); + connect(kcfg_UseCurrent, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotUseCurrentDocToggled(bool))); m_doc = doc; fillWidgets(); @@ -83,11 +83,11 @@ void PasteOptions::fillWidgets() SeparatorCombo->insertItem(i18n(" : ")); SeparatorCombo->insertItem(i18n(" :: ")); - QStringList sl = Prefs::pasteOrder(); + TQStringList sl = Prefs::pasteOrder(); OrderList->clear(); for (int i = 0; i < (int) sl.count(); i++) { - QString codename = m_langSet.findLongId(sl[i]); + TQString codename = m_langSet.findLongId(sl[i]); if (codename.isEmpty()) codename = sl[i]; OrderList->insertItem(codename); @@ -141,7 +141,7 @@ void PasteOptions::slotUpButtonClicked() if (OrderList->currentItem() > 0 && (int) OrderList->count() > 1) { int pos = OrderList->currentItem(); - QString item = OrderList->text(pos); + TQString item = OrderList->text(pos); OrderList->removeItem(pos); OrderList->insertItem(item, pos-1); OrderList->setCurrentItem(pos-1); @@ -164,7 +164,7 @@ void PasteOptions::slotDownButtonClicked() if ((int)OrderList->currentItem() < (int) OrderList->count()-1 && (int) OrderList->count() > 1) { int pos = OrderList->currentItem(); - QString item = OrderList->text(pos); + TQString item = OrderList->text(pos); OrderList->removeItem(pos); OrderList->insertItem(item, pos+1); OrderList->setCurrentItem(pos+1); @@ -206,7 +206,7 @@ bool PasteOptions::hasChanged() result = ((separator_id[SeparatorCombo->currentItem()] != Prefs::separator())); if (result) return true; - QStringList ol, pl; + TQStringList ol, pl; pl = Prefs::pasteOrder(); ol = preparePasteOrderList(); result = (pl.count() != ol.count()); @@ -237,7 +237,7 @@ void PasteOptions::slotSyncPasteOrderList() { for (int j = (int) OrderList->count()-1; j > 1; j--) { - QString comp = OrderList->text(j); + TQString comp = OrderList->text(j); for (int i = (int) j-1; i >=0; i--) { if (OrderList->text(i) == comp && !OrderList->text(i).isEmpty()) @@ -287,10 +287,10 @@ void PasteOptions::slotSyncPasteOrderList() } } -QStringList PasteOptions::preparePasteOrderList() +TQStringList PasteOptions::preparePasteOrderList() { slotSyncPasteOrderList(); - QStringList sl; + TQStringList sl; // skip "skip" elements at tail int i; for (i = (int) OrderList->count()-1; i >= 0 && OrderList->text(i).isEmpty(); i--); @@ -298,7 +298,7 @@ QStringList PasteOptions::preparePasteOrderList() // insert language codes and "skips" between them for ( /**/; i >= 0; i--) { - QString code = m_langSet.findShortId(OrderList->text(i)); + TQString code = m_langSet.findShortId(OrderList->text(i)); if (code.isEmpty()) code = OrderList->text(i); // no longId previously available if (OrderList->text(i).isEmpty()) diff --git a/kvoctrain/kvoctrain/common-dialogs/pasteoptions.h b/kvoctrain/kvoctrain/common-dialogs/pasteoptions.h index 15b1015b..587f3c09 100644 --- a/kvoctrain/kvoctrain/common-dialogs/pasteoptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/pasteoptions.h @@ -36,7 +36,7 @@ class PasteOptions : public PasteOptionsBase Q_OBJECT public: - PasteOptions(LangSet & langset, kvoctrainDoc * doc, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + PasteOptions(LangSet & langset, kvoctrainDoc * doc, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); void updateWidgets(); bool hasChanged(); @@ -58,7 +58,7 @@ private slots: private: void slotSyncPasteOrderList(); - QStringList preparePasteOrderList(); + TQStringList preparePasteOrderList(); kvoctrainDoc * m_doc; LangSet m_langSet; diff --git a/kvoctrain/kvoctrain/common-dialogs/profilesdialog.cpp b/kvoctrain/kvoctrain/common-dialogs/profilesdialog.cpp index d6669e7b..6660561f 100644 --- a/kvoctrain/kvoctrain/common-dialogs/profilesdialog.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/profilesdialog.cpp @@ -16,8 +16,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -34,27 +34,27 @@ SettingsProfile::SettingsProfile( ) { } -SettingsProfile::SettingsProfile(QString n, QString q, QString t, QString b) +SettingsProfile::SettingsProfile(TQString n, TQString q, TQString t, TQString b) : name(n), query_set(q), thresh_set(t), block_set(b) { } -ProfilesDialog::ProfilesDialog(QueryManager * m, QWidget *parent, const char *name, bool modal) +ProfilesDialog::ProfilesDialog(QueryManager * m, TQWidget *parent, const char *name, bool modal) : KDialogBase(Swallow, i18n("Profiles"), Close, Close, parent, name, modal, false) { m_queryManager = m; mw = new GroupOptions(this); setMainWidget(mw); - connect(mw->ps_del, SIGNAL(clicked()), this, SLOT(slotDeleteGroup())); - connect(mw->ps_new, SIGNAL(clicked()), this, SLOT(slotNewGroup())); - connect(mw->ps_recall, SIGNAL(clicked()), this, SLOT(slotRecallGroup())); - connect(mw->ps_store, SIGNAL(clicked()), this, SLOT(slotStoreGroup())); + connect(mw->ps_del, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteGroup())); + connect(mw->ps_new, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewGroup())); + connect(mw->ps_recall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRecallGroup())); + connect(mw->ps_store, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotStoreGroup())); int ls = Prefs::numPreSetting(); for (int i = 0 ; i < ls; i++) { - PreSettings preSettings(QString::number(i)); + PreSettings preSettings(TQString::number(i)); preSettings.readConfig(); profiles.append(SettingsProfile(preSettings.name(), preSettings.query(), preSettings.threshold(), preSettings.blocking())); @@ -81,8 +81,8 @@ void ProfilesDialog::slotDeleteGroup() void ProfilesDialog::slotNewGroup() { bool ok; - QString newGroupName = KInputDialog::getText(i18n("Profile Description"), - i18n("Enter profile description:"), QString::null, &ok); + TQString newGroupName = KInputDialog::getText(i18n("Profile Description"), + i18n("Enter profile description:"), TQString::null, &ok); if (ok) { @@ -111,7 +111,7 @@ void ProfilesDialog::slotStoreGroup() -static bool extract (QString &line, QString &ret) +static bool extract (TQString &line, TQString &ret) { int lim = line.find (","); if (lim < 0) @@ -133,8 +133,8 @@ void ProfilesDialog::selectProfile(int profile) { if (profile < (int) profiles.count()) { - QString line = profiles[profile].query_set; - QString s; + TQString line = profiles[profile].query_set; + TQString s; Prefs::setMaxTimePer(0); Prefs::setSwapDirection(false); Prefs::setAltLearn(false); @@ -275,8 +275,8 @@ void ProfilesDialog::modifyProfile(int profile) if (profile < (int) profiles.count()) { - QString s; - QString line; + TQString s; + TQString line; s.setNum(Prefs::maxTimePer()); line += s + ','; @@ -358,7 +358,7 @@ void ProfilesDialog::saveProfiles( ) Prefs::setNumPreSetting(profiles.count()); for (int i = 0 ; i < (int) profiles.count(); i++) { - PreSettings preSettings(QString::number(i)); + PreSettings preSettings(TQString::number(i)); preSettings.setName(profiles[i].name); preSettings.setQuery(profiles[i].query_set); preSettings.setThreshold(profiles[i].thresh_set); diff --git a/kvoctrain/kvoctrain/common-dialogs/profilesdialog.h b/kvoctrain/kvoctrain/common-dialogs/profilesdialog.h index 827ba191..165eb534 100644 --- a/kvoctrain/kvoctrain/common-dialogs/profilesdialog.h +++ b/kvoctrain/kvoctrain/common-dialogs/profilesdialog.h @@ -20,7 +20,7 @@ #ifndef PROFILESDIALOG_H #define PROFILESDIALOG_H -#include +#include #include @@ -35,12 +35,12 @@ class SettingsProfile { public: SettingsProfile(); - SettingsProfile (QString n, QString q, QString t, QString b); + SettingsProfile (TQString n, TQString q, TQString t, TQString b); - QString name; - QString query_set; - QString thresh_set; - QString block_set; + TQString name; + TQString query_set; + TQString thresh_set; + TQString block_set; }; class ProfilesDialog : public KDialogBase @@ -48,7 +48,7 @@ class ProfilesDialog : public KDialogBase Q_OBJECT public: - ProfilesDialog(QueryManager * m, QWidget *parent = 0, const char *name = 0, bool modal = true); + ProfilesDialog(QueryManager * m, TQWidget *parent = 0, const char *name = 0, bool modal = true); signals: void profileActivated(); @@ -64,7 +64,7 @@ private: void modifyProfile(int profile); void saveProfiles(); - typedef QValueList Profiles; + typedef TQValueList Profiles; Profiles profiles; QueryManager * m_queryManager; GroupOptions * mw; diff --git a/kvoctrain/kvoctrain/common-dialogs/queryoptions.cpp b/kvoctrain/kvoctrain/common-dialogs/queryoptions.cpp index b1677e3f..2b4e6c5a 100644 --- a/kvoctrain/kvoctrain/common-dialogs/queryoptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/queryoptions.cpp @@ -23,18 +23,18 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "queryoptions.h" #include "prefs.h" -QueryOptions::QueryOptions(QWidget* parent, const char* name, WFlags fl) +QueryOptions::QueryOptions(TQWidget* parent, const char* name, WFlags fl) : QueryOptionsBase(parent,name,fl) { kcfg_MaxTimePer->setDisabled(r_no_limit->isChecked()); diff --git a/kvoctrain/kvoctrain/common-dialogs/queryoptions.h b/kvoctrain/kvoctrain/common-dialogs/queryoptions.h index b424cbb2..409a597e 100644 --- a/kvoctrain/kvoctrain/common-dialogs/queryoptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/queryoptions.h @@ -33,7 +33,7 @@ class QueryOptions : public QueryOptionsBase Q_OBJECT public: - QueryOptions(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + QueryOptions(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); void updateWidgets(); }; diff --git a/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.cpp b/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.cpp index e611eb36..b54d60f6 100644 --- a/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.cpp @@ -23,10 +23,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -101,23 +101,23 @@ static ThreshListRef Threshdate_itemlist [] = }; -ThresholdOptions::ThresholdOptions(KComboBox * lessons, QueryManager * m, QWidget* parent, const char* name, WFlags fl) +ThresholdOptions::ThresholdOptions(KComboBox * lessons, QueryManager * m, TQWidget* parent, const char* name, WFlags fl) : ThresholdOptionsBase(parent, name, fl), m_lessons(lessons) { - connect(lessoncomp, SIGNAL(activated(int)), SLOT(slotSetLessonComp(int))); - connect(lessonlist, SIGNAL(selectionChanged()), SIGNAL(widgetModified())); - connect(b_all_less, SIGNAL(clicked()), SLOT(slotSelectAll())); - connect(b_none_less, SIGNAL(clicked()), SLOT(slotSelectNone())); - connect(typecomp, SIGNAL(activated(int)), SLOT(slotSetTypeComp(int))); - connect(typelist, SIGNAL(activated(int)), SLOT(slotComboActivated(int))); - connect(gradecomp, SIGNAL(activated(int)), SLOT(slotSetGradeComp(int))); - connect(gradelist, SIGNAL(activated(int)), SLOT(slotComboActivated(int))); - connect(querycomp, SIGNAL(activated(int)), SLOT(slotSetQueryComp(int))); - connect(querylist, SIGNAL(activated(int)), SLOT(slotComboActivated(int))); - connect(badcomp, SIGNAL(activated(int)), SLOT(slotSetBadComp(int))); - connect(badlist, SIGNAL(activated(int)), SLOT(slotComboActivated(int))); - connect(datecomp, SIGNAL(activated(int)), SLOT(slotSetDateComp(int))); - connect(datelist, SIGNAL(activated(int)), SLOT(slotComboActivated(int))); + connect(lessoncomp, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetLessonComp(int))); + connect(lessonlist, TQT_SIGNAL(selectionChanged()), TQT_SIGNAL(widgetModified())); + connect(b_all_less, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectAll())); + connect(b_none_less, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectNone())); + connect(typecomp, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetTypeComp(int))); + connect(typelist, TQT_SIGNAL(activated(int)), TQT_SLOT(slotComboActivated(int))); + connect(gradecomp, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetGradeComp(int))); + connect(gradelist, TQT_SIGNAL(activated(int)), TQT_SLOT(slotComboActivated(int))); + connect(querycomp, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetQueryComp(int))); + connect(querylist, TQT_SIGNAL(activated(int)), TQT_SLOT(slotComboActivated(int))); + connect(badcomp, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetBadComp(int))); + connect(badlist, TQT_SIGNAL(activated(int)), TQT_SLOT(slotComboActivated(int))); + connect(datecomp, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetDateComp(int))); + connect(datelist, TQT_SIGNAL(activated(int)), TQT_SLOT(slotComboActivated(int))); m_queryManager = m; fillWidgets(); @@ -147,8 +147,8 @@ void ThresholdOptions::fillWidgets() querylist->clear(); for (int i = 0; i <= 15; i++) { - badlist->insertItem(QString::number(i)); - querylist->insertItem(QString::number(i)); + badlist->insertItem(TQString::number(i)); + querylist->insertItem(TQString::number(i)); } ref = Threshdate_itemlist; @@ -344,7 +344,7 @@ void ThresholdOptions::slotSetLessonItems() } } - QString s; + TQString s; s.setNum(cnt); l_count->setText (s); diff --git a/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.h b/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.h index f64a99bb..e3d5b9da 100644 --- a/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/thresholdoptions.h @@ -36,7 +36,7 @@ class ThresholdOptions : public ThresholdOptionsBase Q_OBJECT public: - ThresholdOptions(KComboBox * lessons, QueryManager * m, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ThresholdOptions(KComboBox * lessons, QueryManager * m, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); void updateWidgets(); bool hasChanged(); diff --git a/kvoctrain/kvoctrain/common-dialogs/viewoptions.cpp b/kvoctrain/kvoctrain/common-dialogs/viewoptions.cpp index 8c0cd2c6..773f263f 100644 --- a/kvoctrain/kvoctrain/common-dialogs/viewoptions.cpp +++ b/kvoctrain/kvoctrain/common-dialogs/viewoptions.cpp @@ -23,11 +23,11 @@ * * ***************************************************************************/ -#include +#include #include "viewoptions.h" -ViewOptions::ViewOptions(QWidget* parent, const char* name, WFlags fl) +ViewOptions::ViewOptions(TQWidget* parent, const char* name, WFlags fl) : ViewOptionsBase(parent,name,fl) { kcfg_GradeCol0->setEnabled(kcfg_UseGradeCol->isChecked()); diff --git a/kvoctrain/kvoctrain/common-dialogs/viewoptions.h b/kvoctrain/kvoctrain/common-dialogs/viewoptions.h index fd3b3b1d..db3eb409 100644 --- a/kvoctrain/kvoctrain/common-dialogs/viewoptions.h +++ b/kvoctrain/kvoctrain/common-dialogs/viewoptions.h @@ -33,7 +33,7 @@ class ViewOptions : public ViewOptionsBase Q_OBJECT public: - ViewOptions(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ViewOptions(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); }; diff --git a/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.cpp b/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.cpp index 3a6e3a5a..f1c8d62d 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.cpp @@ -26,14 +26,14 @@ #include "DocOptionsPage.h" -#include +#include -DocOptionsPage::DocOptionsPage(bool sort, QWidget *parent, const char *name):DocOptionsPageForm(parent, name) +DocOptionsPage::DocOptionsPage(bool sort, TQWidget *parent, const char *name):DocOptionsPageForm(parent, name) { sorter = sort; docsort->setChecked(sort); - connect( docsort, SIGNAL(toggled(bool)), SLOT(docSortToggled(bool)) ); + connect( docsort, TQT_SIGNAL(toggled(bool)), TQT_SLOT(docSortToggled(bool)) ); } void DocOptionsPage::docSortToggled(bool state) diff --git a/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.h b/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.h index 97655e4c..948a37af 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/DocOptionsPage.h @@ -35,7 +35,7 @@ class DocOptionsPage : public DocOptionsPageForm public: - DocOptionsPage(bool sort, QWidget *parent, const char *name); + DocOptionsPage(bool sort, TQWidget *parent, const char *name); bool getSorting () const { return sorter; } diff --git a/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.cpp b/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.cpp index 5f430175..a49fd65e 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.cpp @@ -23,7 +23,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -39,48 +39,48 @@ DocPropsDlg::DocPropsDlg ( kvoctrainDoc *doc, const char * /*start_page*/, - QComboBox *lessons, - QString title, - QString author, - QString license, - QString doc_remark, - vector types, - vector tenses, - vector usages, - QWidget *parent, + TQComboBox *lessons, + TQString title, + TQString author, + TQString license, + TQString doc_remark, + vector types, + vector tenses, + vector usages, + TQWidget *parent, const char *name, bool modal ) : KDialogBase(Tabbed, i18n("Document Properties"), Ok|Cancel, Ok, parent, name, modal) { - QFrame *page = addPage( i18n("&General") ); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + TQFrame *page = addPage( i18n("&General") ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); titleOptPage = new TitlePage (title, author, license, doc_remark, page, name); topLayout->addWidget( titleOptPage ); page = addPage( i18n("L&essons")); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); lessOptPage = new LessOptPage (lessons, doc, page, name); topLayout->addWidget( lessOptPage ); page = addPage( i18n("word types","T&ypes")); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); typeOptPage = new TypeOptPage (types, doc, page, name); topLayout->addWidget( typeOptPage ); page = addPage( i18n("Te&nses")); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); tenseOptPage = new TenseOptPage (tenses, doc, page, name); topLayout->addWidget( tenseOptPage ); page = addPage( i18n("usage (area) of an expression", "&Usage")); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); useOptPage = new UsageOptPage (usages, doc, page, name); topLayout->addWidget( useOptPage ); page = addPage( i18n("&Options")); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); docOptPage = new DocOptionsPage (doc->isAllowedSorting(), page, name); topLayout->addWidget( docOptPage ); } diff --git a/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.h b/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.h index 31651c8e..9e6080d7 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/DocPropDlg.h @@ -51,36 +51,36 @@ public: ( kvoctrainDoc *doc, const char *start_page, - QComboBox *lessons, - QString title, - QString author, - QString license, - QString doc_remark, - vector types, - vector tenses, - vector usages, - QWidget *parent = NULL, + TQComboBox *lessons, + TQString title, + TQString author, + TQString license, + TQString doc_remark, + vector types, + vector tenses, + vector usages, + TQWidget *parent = NULL, const char *name = NULL, bool modal = true ); inline bool getSorting() const { return docOptPage->getSorting(); } - inline QString getTitle() { return titleOptPage->getTitle(); } - inline QString getAuthor() { return titleOptPage->getAuthor(); } - inline QString getLicense() { return titleOptPage->getLicense(); } - inline QString getDocRemark() { return titleOptPage->getDocRemark(); } + inline TQString getTitle() { return titleOptPage->getTitle(); } + inline TQString getAuthor() { return titleOptPage->getAuthor(); } + inline TQString getLicense() { return titleOptPage->getLicense(); } + inline TQString getDocRemark() { return titleOptPage->getDocRemark(); } - inline void getLesson (QComboBox *lessons, vector& ret_index) const + inline void getLesson (TQComboBox *lessons, vector& ret_index) const { lessOptPage->getLesson (lessons, ret_index); } - inline void getTypeNames (vector &types, vector& ret_index) const + inline void getTypeNames (vector &types, vector& ret_index) const { typeOptPage->getTypeNames (types, ret_index); } - inline void getTenseNames (vector &tenses, vector& ret_index) const + inline void getTenseNames (vector &tenses, vector& ret_index) const { tenseOptPage->getTenseNames (tenses, ret_index); } - inline void getUsageLabels (vector &usages, vector& ret_index) const + inline void getUsageLabels (vector &usages, vector& ret_index) const { useOptPage->getUsageLabels (usages, ret_index); } diff --git a/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.cpp b/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.cpp index 597978c0..76013ebf 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.cpp @@ -27,10 +27,10 @@ #include "DocPropLangDlg.h" #include "LangPropPage.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -42,17 +42,17 @@ class kvoctraindoc; -DocPropsLangDlg::DocPropsLangDlg(kvoctrainDoc *doc, LangSet *langset, QWidget *parent, const char *name, bool modal) +DocPropsLangDlg::DocPropsLangDlg(kvoctrainDoc *doc, LangSet *langset, TQWidget *parent, const char *name, bool modal) : KDialogBase(Tabbed, i18n("Language Properties"), Ok|Cancel, Ok, parent, name, modal) { - QFrame * page; - QVBoxLayout * topLayout; + TQFrame * page; + TQVBoxLayout * topLayout; LangPropPage* lpp; for (int i = 0; i < (int) doc->numLangs(); i++) { - QString s; + TQString s; if (i == 0) s = doc->getOriginalIdent(); else @@ -60,15 +60,15 @@ DocPropsLangDlg::DocPropsLangDlg(kvoctrainDoc *doc, LangSet *langset, QWidget *p int idx = langset->indexShortId(s); - QString tabCaption; + TQString tabCaption; if (idx >= 0) tabCaption = (langset->longId(idx)); else tabCaption = (s); - page = addPage(s, s, QPixmap(langset->PixMapFile(idx))); ///@todo The pixmaps don't show up in tabbed dialog - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + page = addPage(s, s, TQPixmap(langset->PixMapFile(idx))); ///@todo The pixmaps don't show up in tabbed dialog + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); lpp = new LangPropPage (doc, s, doc->getConjugation(i), doc->getArticle(i), page, name); topLayout->addWidget( lpp ); diff --git a/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.h b/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.h index e2fd9bf6..a6b7c14f 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/DocPropLangDlg.h @@ -26,7 +26,7 @@ #ifndef DocPropsLangDlg_included #define DocPropsLangDlg_included -#include +#include #include @@ -42,13 +42,13 @@ class DocPropsLangDlg : public KDialogBase public: - DocPropsLangDlg(kvoctrainDoc *doc, LangSet *langset, QWidget *parent = NULL, const char *name = NULL, bool modal = true); + DocPropsLangDlg(kvoctrainDoc *doc, LangSet *langset, TQWidget *parent = NULL, const char *name = NULL, bool modal = true); Conjugation getConjugation(int idx) const; Article getArticle(int idx) const; protected: - typedef QValueList LangPagesList; + typedef TQValueList LangPagesList; LangPagesList langPages; }; diff --git a/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.cpp b/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.cpp index 879b45d5..a9d255e6 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.cpp @@ -30,17 +30,17 @@ #include -#include -#include -#include +#include +#include +#include LangPropPage::LangPropPage ( kvoctrainDoc *_doc, - QString curr_lang, + TQString curr_lang, const Conjugation &conjug, const Article &art, - QWidget *parent, + TQWidget *parent, const char *name ) : @@ -51,25 +51,25 @@ LangPropPage::LangPropPage { l_langcode->setText(curr_lang); - connect( indef_female, SIGNAL(textChanged(const QString&)), SLOT(indefFemaleChanged(const QString&)) ); - connect( def_female, SIGNAL(textChanged(const QString&)), SLOT(defFemaleChanged(const QString&)) ); - connect( def_male, SIGNAL(textChanged(const QString&)), SLOT(defMaleChanged(const QString&)) ); - connect( indef_male, SIGNAL(textChanged(const QString&)), SLOT(indefMaleChanged(const QString&)) ); - connect( def_natural, SIGNAL(textChanged(const QString&)), SLOT(defNaturalChanged(const QString&)) ); - connect( indef_natural, SIGNAL(textChanged(const QString&)), SLOT(indefNaturalChanged(const QString&)) ); - connect( first_singular, SIGNAL(textChanged(const QString&)), SLOT(firstSingularChanged(const QString&)) ); - connect( first_plural, SIGNAL(textChanged(const QString&)), SLOT(firstPluralChanged(const QString&)) ); - connect( second_singular, SIGNAL(textChanged(const QString&)), SLOT(secondSingularChanged(const QString&)) ); - connect( second_plural, SIGNAL(textChanged(const QString&)), SLOT(secondPluralChanged(const QString&)) ); - connect( thirdF_singular, SIGNAL(textChanged(const QString&)), SLOT(thirdFSingularChanged(const QString&)) ); - connect( thirdF_plural, SIGNAL(textChanged(const QString&)), SLOT(thirdFPluralChanged(const QString&)) ); - connect( thirdM_singular, SIGNAL(textChanged(const QString&)), SLOT(thirdMSingularChanged(const QString&)) ); - connect( thirdM_plural, SIGNAL(textChanged(const QString&)), SLOT(thirdMPluralChanged(const QString&)) ); - connect( thirdN_singular, SIGNAL(textChanged(const QString&)), SLOT(thirdNSingularChanged(const QString&)) ); - connect( thirdN_plural, SIGNAL(textChanged(const QString&)), SLOT(thirdNPluralChanged(const QString&)) ); - - connect( thirdS_common, SIGNAL(toggled(bool)), SLOT(slotThirdSCommonToggled(bool)) ); - connect( thirdP_common, SIGNAL(toggled(bool)), SLOT(slotThirdPCommonToggled(bool)) ); + connect( indef_female, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(indefFemaleChanged(const TQString&)) ); + connect( def_female, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(defFemaleChanged(const TQString&)) ); + connect( def_male, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(defMaleChanged(const TQString&)) ); + connect( indef_male, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(indefMaleChanged(const TQString&)) ); + connect( def_natural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(defNaturalChanged(const TQString&)) ); + connect( indef_natural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(indefNaturalChanged(const TQString&)) ); + connect( first_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(firstSingularChanged(const TQString&)) ); + connect( first_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(firstPluralChanged(const TQString&)) ); + connect( second_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(secondSingularChanged(const TQString&)) ); + connect( second_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(secondPluralChanged(const TQString&)) ); + connect( thirdF_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdFSingularChanged(const TQString&)) ); + connect( thirdF_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdFPluralChanged(const TQString&)) ); + connect( thirdM_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdMSingularChanged(const TQString&)) ); + connect( thirdM_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdMPluralChanged(const TQString&)) ); + connect( thirdN_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdNSingularChanged(const TQString&)) ); + connect( thirdN_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdNPluralChanged(const TQString&)) ); + + connect( thirdS_common, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotThirdSCommonToggled(bool)) ); + connect( thirdP_common, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotThirdPCommonToggled(bool)) ); conjugations = conjug; @@ -94,7 +94,7 @@ LangPropPage::LangPropPage thirdN_plural->setEnabled(!common); thirdM_plural->setEnabled(!common); - QString def, indef; + TQString def, indef; articles.female(def, indef); def_female->setText (def); indef_female->setText (indef); @@ -117,61 +117,61 @@ Conjugation LangPropPage::getConjugation() } -void LangPropPage::firstPluralChanged(const QString& s) +void LangPropPage::firstPluralChanged(const TQString& s) { conjugations.setPers1Plural (CONJ_PREFIX, s); } -void LangPropPage::firstSingularChanged(const QString& s) +void LangPropPage::firstSingularChanged(const TQString& s) { conjugations.setPers1Singular (CONJ_PREFIX, s); } -void LangPropPage::secondSingularChanged(const QString& s) +void LangPropPage::secondSingularChanged(const TQString& s) { conjugations.setPers2Singular (CONJ_PREFIX, s); } -void LangPropPage::secondPluralChanged(const QString& s) +void LangPropPage::secondPluralChanged(const TQString& s) { conjugations.setPers2Plural (CONJ_PREFIX, s); } -void LangPropPage::thirdFPluralChanged(const QString& s) +void LangPropPage::thirdFPluralChanged(const TQString& s) { conjugations.setPers3FemalePlural (CONJ_PREFIX, s); } -void LangPropPage::thirdFSingularChanged(const QString& s) +void LangPropPage::thirdFSingularChanged(const TQString& s) { conjugations.setPers3FemaleSingular (CONJ_PREFIX, s); } -void LangPropPage::thirdMSingularChanged(const QString& s) +void LangPropPage::thirdMSingularChanged(const TQString& s) { conjugations.setPers3MaleSingular (CONJ_PREFIX, s); } -void LangPropPage::thirdNSingularChanged(const QString& s) +void LangPropPage::thirdNSingularChanged(const TQString& s) { conjugations.setPers3NaturalSingular(CONJ_PREFIX, s); } -void LangPropPage::thirdNPluralChanged(const QString& s) +void LangPropPage::thirdNPluralChanged(const TQString& s) { conjugations.setPers3NaturalPlural (CONJ_PREFIX, s); } -void LangPropPage::thirdMPluralChanged(const QString& s) +void LangPropPage::thirdMPluralChanged(const TQString& s) { conjugations.setPers3MalePlural (CONJ_PREFIX, s); } @@ -193,49 +193,49 @@ void LangPropPage::slotThirdPCommonToggled(bool common) } -void LangPropPage::defFemaleChanged(const QString& s) +void LangPropPage::defFemaleChanged(const TQString& s) { - QString def, indef; + TQString def, indef; articles.female(def, indef); articles.setFemale(s, indef); } -void LangPropPage::indefFemaleChanged(const QString& s) +void LangPropPage::indefFemaleChanged(const TQString& s) { - QString def, indef; + TQString def, indef; articles.female(def, indef); articles.setFemale(def, s); } -void LangPropPage::defMaleChanged(const QString& s) +void LangPropPage::defMaleChanged(const TQString& s) { - QString def, indef; + TQString def, indef; articles.male(def, indef); articles.setMale(s, indef); } -void LangPropPage::indefMaleChanged(const QString& s) +void LangPropPage::indefMaleChanged(const TQString& s) { - QString def, indef; + TQString def, indef; articles.male(def, indef); articles.setMale(def, s); } -void LangPropPage::defNaturalChanged(const QString& s) +void LangPropPage::defNaturalChanged(const TQString& s) { - QString def, indef; + TQString def, indef; articles.natural(def, indef); articles.setNatural(s, indef); } -void LangPropPage::indefNaturalChanged(const QString& s) +void LangPropPage::indefNaturalChanged(const TQString& s) { - QString def, indef; + TQString def, indef; articles.natural(def, indef); articles.setNatural(def, s); } diff --git a/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.h b/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.h index e98c9604..d7ab00f5 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/LangPropPage.h @@ -42,10 +42,10 @@ public: LangPropPage ( kvoctrainDoc *doc, - QString curr_lang, + TQString curr_lang, const Conjugation &conjugations, const Article &article, - QWidget *parent = NULL, + TQWidget *parent = NULL, const char *name = NULL ); @@ -54,25 +54,25 @@ public: protected slots: - void secondPluralChanged(const QString&); - void secondSingularChanged(const QString&); - void thirdNSingularChanged(const QString&); - void thirdFPluralChanged(const QString&); - void thirdMSingularChanged(const QString&); - void thirdFSingularChanged(const QString&); - void thirdMPluralChanged(const QString&); - void thirdNPluralChanged(const QString&); - void firstPluralChanged(const QString&); - void firstSingularChanged(const QString&); + void secondPluralChanged(const TQString&); + void secondSingularChanged(const TQString&); + void thirdNSingularChanged(const TQString&); + void thirdFPluralChanged(const TQString&); + void thirdMSingularChanged(const TQString&); + void thirdFSingularChanged(const TQString&); + void thirdMPluralChanged(const TQString&); + void thirdNPluralChanged(const TQString&); + void firstPluralChanged(const TQString&); + void firstSingularChanged(const TQString&); void slotThirdSCommonToggled(bool); void slotThirdPCommonToggled(bool); - void defNaturalChanged(const QString& ); - void indefMaleChanged(const QString& ); - void indefNaturalChanged(const QString& ); - void defFemaleChanged(const QString& ); - void indefFemaleChanged(const QString& ); - void defMaleChanged(const QString& ); + void defNaturalChanged(const TQString& ); + void indefMaleChanged(const TQString& ); + void indefNaturalChanged(const TQString& ); + void defFemaleChanged(const TQString& ); + void indefFemaleChanged(const TQString& ); + void defMaleChanged(const TQString& ); protected: diff --git a/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.cpp b/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.cpp index b5503228..d7015435 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.cpp @@ -30,9 +30,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -40,23 +40,23 @@ LessOptPage::LessOptPage ( - QComboBox *lessons, + TQComboBox *lessons, kvoctrainDoc *_doc, - QWidget *parent, + TQWidget *parent, const char *name ) : LessOptPageForm( parent, name ) { - connect( lessonList, SIGNAL(highlighted(int)), SLOT(slotLessonChosen(int)) ); - connect( b_new, SIGNAL(clicked()), SLOT(slotNewLesson()) ); - connect( b_modify, SIGNAL(clicked()), SLOT(slotModifyLesson()) ); - connect( b_delete, SIGNAL(clicked()), SLOT(slotDeleteLesson()) ); - connect( b_cleanup, SIGNAL(clicked()), SLOT(slotCleanup()) ); + connect( lessonList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotLessonChosen(int)) ); + connect( b_new, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewLesson()) ); + connect( b_modify, TQT_SIGNAL(clicked()), TQT_SLOT(slotModifyLesson()) ); + connect( b_delete, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteLesson()) ); + connect( b_cleanup, TQT_SIGNAL(clicked()), TQT_SLOT(slotCleanup()) ); doc = _doc; - QString str; + TQString str; for (int i = 1; i < lessons->count(); i++) { str.setNum (i); if (i <= 9) @@ -84,11 +84,11 @@ void LessOptPage::slotLessonChosen(int index) void LessOptPage::slotNewLesson() { bool ok; - QString getLesson = KInputDialog::getText( - i18n( "Lesson Description" ), i18n( "Enter lesson description:" ), QString::null, &ok ); + TQString getLesson = KInputDialog::getText( + i18n( "Lesson Description" ), i18n( "Enter lesson description:" ), TQString::null, &ok ); if( !ok ) return; - QString str; + TQString str; int i = lessonList->count()+1; str.setNum (i); if (i <= 9) @@ -106,15 +106,15 @@ void LessOptPage::slotModifyLesson() { if (lessonList->count() != 0 && (int) lessonList->count() > act_lesson) { - QString str = lessonList->text (act_lesson); + TQString str = lessonList->text (act_lesson); int pos = str.find (LESS_TAG); str.remove (0, pos+strlen (LESS_TAG)); bool ok; - QString getLesson = KInputDialog::getText( + TQString getLesson = KInputDialog::getText( i18n( "Lesson Description" ), i18n( "Enter lesson description:" ), str, &ok ); if( !ok ) return; - QString str2; + TQString str2; str2.setNum (act_lesson+1); if (act_lesson <= 9) str2.insert (0, " "); @@ -125,7 +125,7 @@ void LessOptPage::slotModifyLesson() void LessOptPage::updateListBox(int start) { - QString str, str2; + TQString str, str2; for (int i = start; i < (int) lessonList->count(); i++) { str = lessonList->text (i); @@ -171,12 +171,12 @@ void LessOptPage::slotDeleteLesson() } -void LessOptPage::getLesson (QComboBox *ret_lesson, vector &ret_Index) +void LessOptPage::getLesson (TQComboBox *ret_lesson, vector &ret_Index) { while (ret_lesson->count() > 1) /* first entry is "no lesson" */ ret_lesson->removeItem (1); - QString str; + TQString str; for (int i = 0; i < (int) lessonList->count(); i++) { str = lessonList->text(i); int pos = str.find (LESS_TAG); @@ -218,7 +218,7 @@ void LessOptPage::slotCleanup() void LessOptPage::cleanUnused (kvoctrainDoc *doc, - const QComboBox * /*lessons*/, + const TQComboBox * /*lessons*/, const vector &lessonIndex, int old_lessons, vector &lessons_in_query) diff --git a/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.h b/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.h index faeb981d..9116e179 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/LessOptPage.h @@ -42,16 +42,16 @@ public: LessOptPage ( - QComboBox *lessons, + TQComboBox *lessons, kvoctrainDoc *doc, - QWidget *parent = NULL, + TQWidget *parent = NULL, const char *name = NULL ); - void getLesson (QComboBox *ret_lesson, vector& ret_Index); + void getLesson (TQComboBox *ret_lesson, vector& ret_Index); static void cleanUnused(kvoctrainDoc *doc, - const QComboBox *lessons, + const TQComboBox *lessons, const vector &lessonIndex, int old_lessons, vector &lessons_in_use); diff --git a/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.cpp b/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.cpp index 0e3ece95..00325b7b 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.cpp @@ -25,7 +25,7 @@ #include "TenseOptPage.h" -#include +#include #include #include @@ -38,21 +38,21 @@ TenseOptPage::TenseOptPage ( - const vector &tenses, + const vector &tenses, kvoctrainDoc *_doc, - QWidget *parent, + TQWidget *parent, const char *name ) : TenseOptPageForm( parent, name ) { - connect( tenseList, SIGNAL(highlighted(int)), SLOT(slotTenseChosen(int)) ); - connect( b_cleanup, SIGNAL(clicked()), SLOT(slotCleanup()) ); - connect( b_delete, SIGNAL(clicked()), SLOT(slotDeleteTense()) ); - connect( b_modify, SIGNAL(clicked()), SLOT(slotModifyTense()) ); - connect( b_new, SIGNAL(clicked()), SLOT(slotNewTense()) ); + connect( tenseList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotTenseChosen(int)) ); + connect( b_cleanup, TQT_SIGNAL(clicked()), TQT_SLOT(slotCleanup()) ); + connect( b_delete, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteTense()) ); + connect( b_modify, TQT_SIGNAL(clicked()), TQT_SLOT(slotModifyTense()) ); + connect( b_new, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewTense()) ); - QString str; + TQString str; for (int i = 0; i < (int) tenses.size(); i++) { str.setNum (i+1); if (i <= 9) @@ -82,12 +82,12 @@ void TenseOptPage::slotTenseChosen(int index) void TenseOptPage::slotNewTense() { bool ok; - QString getTense = KInputDialog::getText( - i18n( "Tense Description" ), i18n( "Enter tense description:" ), QString::null, &ok ); + TQString getTense = KInputDialog::getText( + i18n( "Tense Description" ), i18n( "Enter tense description:" ), TQString::null, &ok ); if( !ok ) return; - QString str; + TQString str; int i = tenseList->count()+1; str.setNum (i); if (i <= 9) @@ -105,15 +105,15 @@ void TenseOptPage::slotModifyTense() { if (tenseList->count() != 0 && (int) tenseList->count() > act_tense) { - QString str = tenseList->text (act_tense); + TQString str = tenseList->text (act_tense); int pos = str.find (TENSE_TAG); str.remove (0, pos+strlen (TENSE_TAG)); bool ok; - QString getTense = KInputDialog::getText( + TQString getTense = KInputDialog::getText( i18n( "Tense Description" ), i18n( "Enter tense description:" ), str, &ok ); if( !ok ) return; - QString str2; + TQString str2; str2.setNum (act_tense+1); if (act_tense <= 9) str2.insert (0, " "); @@ -124,7 +124,7 @@ void TenseOptPage::slotModifyTense() void TenseOptPage::updateListBox(int start) { - QString str, str2; + TQString str, str2; for (int i = start; i < (int) tenseList->count(); i++) { str = tenseList->text (i); @@ -144,7 +144,7 @@ void TenseOptPage::slotDeleteTense() if (tenseList->count() != 0 && (int) tenseList->count() > act) { - QString t; + TQString t; t.setNum(tenseIndex[act_tense]+1); t.insert (0, QM_USER_TYPE); for (int ent = 0; ent < doc->numEntries(); ent++) { @@ -179,9 +179,9 @@ void TenseOptPage::slotDeleteTense() } -void TenseOptPage::getTenseNames (vector &ret_tense, vector &ret_Index) +void TenseOptPage::getTenseNames (vector &ret_tense, vector &ret_Index) { - QString str; ret_tense.clear(); + TQString str; ret_tense.clear(); for (int i = 0; i < (int) tenseList->count(); i++) { str = tenseList->text(i); @@ -203,7 +203,7 @@ void TenseOptPage::slotCleanup() for (int i = 0; i < (int) doc->numEntries(); i++) { Conjugation conj = doc->getEntry(i)->getConjugation(col); for (int ci = 0; ci < conj.numEntries(); ci++) { - QString t = conj.getType(ci); + TQString t = conj.getType(ci); if (t.left(strlen(UL_USER_TENSE)) == UL_USER_TENSE) { t.remove (0, strlen(UL_USER_TENSE)); int idx = t.toInt(); @@ -234,7 +234,7 @@ void TenseOptPage::slotCleanup() void TenseOptPage::cleanUnused(kvoctrainDoc *doc, const vector &tenseIndex, int old_tenses) { vector translate_index; - vector new_tenseStr; + vector new_tenseStr; ///////////////////////////////////////////////////// // translate_index contains new index number for each @@ -259,13 +259,13 @@ void TenseOptPage::cleanUnused(kvoctrainDoc *doc, const vector &tenseIndex, Conjugation conj = doc->getEntry(i)->getConjugation (col); bool dirty = false; for (int ci = 0; ci < conj.numEntries(); ci++) { - QString old = conj.getType(ci); + TQString old = conj.getType(ci); if (!old.isEmpty() && old.left(strlen(QM_USER_TYPE)) == QM_USER_TYPE) { old.remove (0, 1); int o = old.toInt(); dirty = true; - QString newtense; + TQString newtense; if (translate_index[o] != 0) { newtense.setNum (translate_index[o]); newtense.insert (0, QM_USER_TYPE); diff --git a/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.h b/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.h index 2ae20b7f..4a164a67 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/TenseOptPage.h @@ -43,13 +43,13 @@ public: TenseOptPage ( - const vector &tenses, + const vector &tenses, kvoctrainDoc *doc, - QWidget *parent = NULL, + TQWidget *parent = NULL, const char *name = NULL ); - void getTenseNames (vector &ret_types, vector &ret_Index); + void getTenseNames (vector &ret_types, vector &ret_Index); static void cleanUnused(kvoctrainDoc *doc, const vector &tenseIndex, int old_tenses); diff --git a/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.cpp b/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.cpp index 038bceac..96f71bd4 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.cpp @@ -29,17 +29,17 @@ #include #include -#include -#include -#include +#include +#include +#include TitlePage::TitlePage ( - QString _title, - QString _author, - QString _license, - QString _doc_remark, - QWidget* parent, + TQString _title, + TQString _author, + TQString _license, + TQString _doc_remark, + TQWidget* parent, const char* name ) : @@ -64,14 +64,14 @@ TitlePage::TitlePage e_remark->setText (doc_remark); label_remark->setBuddy(e_remark); - connect( e_author, SIGNAL(textChanged()), SLOT(slotAuthorChanged()) ); - connect( e_title, SIGNAL(textChanged(const QString&)), SLOT(slotTitleChanged(const QString&)) ); - connect( e_license, SIGNAL(textChanged(const QString&)), SLOT(slotLicenseChanged(const QString&)) ); - connect( e_remark, SIGNAL(textChanged()), SLOT(slotDocRemarkChanged()) ); + connect( e_author, TQT_SIGNAL(textChanged()), TQT_SLOT(slotAuthorChanged()) ); + connect( e_title, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotTitleChanged(const TQString&)) ); + connect( e_license, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotLicenseChanged(const TQString&)) ); + connect( e_remark, TQT_SIGNAL(textChanged()), TQT_SLOT(slotDocRemarkChanged()) ); } -void TitlePage::slotTitleChanged(const QString& s) +void TitlePage::slotTitleChanged(const TQString& s) { title = s; } @@ -83,7 +83,7 @@ void TitlePage::slotAuthorChanged() } -void TitlePage::slotLicenseChanged(const QString& s) +void TitlePage::slotLicenseChanged(const TQString& s) { license = s; } diff --git a/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.h b/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.h index 45b85ee6..d656342a 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/TitlePage.h @@ -37,32 +37,32 @@ public: TitlePage ( - QString title, - QString author, - QString license, - QString doc_remark, - QWidget *parent = NULL, + TQString title, + TQString author, + TQString license, + TQString doc_remark, + TQWidget *parent = NULL, const char *name = NULL ); - QString getTitle() { return title; } - QString getAuthor() { return author; } - QString getLicense() { return license; } - QString getDocRemark() { return doc_remark; } + TQString getTitle() { return title; } + TQString getAuthor() { return author; } + TQString getLicense() { return license; } + TQString getDocRemark() { return doc_remark; } protected slots: - void slotTitleChanged(const QString&); + void slotTitleChanged(const TQString&); void slotAuthorChanged(); - void slotLicenseChanged(const QString&); + void slotLicenseChanged(const TQString&); void slotDocRemarkChanged(); private: - QString title; - QString author; - QString license; - QString doc_remark; + TQString title; + TQString author; + TQString license; + TQString doc_remark; }; #endif // TitlePage_included diff --git a/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.cpp b/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.cpp index 9ab25379..c89129b8 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include @@ -38,22 +38,22 @@ TypeOptPage::TypeOptPage ( - const vector &types, + const vector &types, kvoctrainDoc *_doc, - QWidget *parent, + TQWidget *parent, const char *name ) : TypeOptPageForm( parent, name ), doc(_doc) { - connect( typeList, SIGNAL(highlighted(int)), SLOT(slotTypeChosen(int)) ); - connect( b_cleanup, SIGNAL(clicked()), SLOT(slotCleanup()) ); - connect( b_delete, SIGNAL(clicked()), SLOT(slotDeleteType()) ); - connect( b_modify, SIGNAL(clicked()), SLOT(slotModifyType()) ); - connect( b_new, SIGNAL(clicked()), SLOT(slotNewType()) ); + connect( typeList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotTypeChosen(int)) ); + connect( b_cleanup, TQT_SIGNAL(clicked()), TQT_SLOT(slotCleanup()) ); + connect( b_delete, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteType()) ); + connect( b_modify, TQT_SIGNAL(clicked()), TQT_SLOT(slotModifyType()) ); + connect( b_new, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewType()) ); - QString str; + TQString str; for (int i = 0; i < (int) types.size(); i++) { str.setNum (i+1); if (i <= 9) @@ -82,11 +82,11 @@ void TypeOptPage::slotTypeChosen(int index) void TypeOptPage::slotNewType() { bool ok; - QString getType = KInputDialog::getText( - i18n( "Type Description" ), i18n( "Enter type description:" ), QString::null, &ok ); + TQString getType = KInputDialog::getText( + i18n( "Type Description" ), i18n( "Enter type description:" ), TQString::null, &ok ); if( !ok ) return; - QString str; + TQString str; int i = typeList->count()+1; str.setNum (i); if (i <= 9) @@ -104,15 +104,15 @@ void TypeOptPage::slotModifyType() { if (typeList->count() != 0 && (int) typeList->count() > act_type) { - QString str = typeList->text (act_type); + TQString str = typeList->text (act_type); int pos = str.find (TYPE_TAG); str.remove (0, pos+strlen (TYPE_TAG)); bool ok; - QString getType = KInputDialog::getText( + TQString getType = KInputDialog::getText( i18n( "Type Description" ), i18n( "Enter type description:" ), str, &ok ); if( !ok ) return; - QString str2; + TQString str2; str2.setNum (act_type+1); if (act_type <= 9) str2.insert (0, " "); @@ -123,7 +123,7 @@ void TypeOptPage::slotModifyType() void TypeOptPage::updateListBox(int start) { - QString str, str2; + TQString str, str2; for (int i = start; i < (int) typeList->count(); i++) { str = typeList->text (i); int pos = str.find (TYPE_TAG); @@ -142,7 +142,7 @@ void TypeOptPage::slotDeleteType() if (typeList->count() != 0 && (int) typeList->count() > act) { - QString t; + TQString t; t.setNum(typeIndex[act_type]+1); t.insert (0, QM_USER_TYPE); for (int ent = 0; ent < doc->numEntries(); ent++) { @@ -174,9 +174,9 @@ void TypeOptPage::slotDeleteType() } -void TypeOptPage::getTypeNames (vector &ret_type, vector &ret_Index) +void TypeOptPage::getTypeNames (vector &ret_type, vector &ret_Index) { - QString str; ret_type.clear(); + TQString str; ret_type.clear(); for (int i = 0; i < (int) typeList->count(); i++) { str = typeList->text(i); int pos = str.find (TYPE_TAG); @@ -195,7 +195,7 @@ void TypeOptPage::slotCleanup() for (int col = 0; col < doc->numLangs(); col++) for (int i = 0; i < (int) doc->numEntries(); i++) { - QString t = doc->getEntry(i)->getType(col); + TQString t = doc->getEntry(i)->getType(col); if (t.left(strlen(QM_USER_TYPE)) == QM_USER_TYPE) { t.remove (0, 1); int idx = t.toInt(); @@ -225,7 +225,7 @@ void TypeOptPage::slotCleanup() void TypeOptPage::cleanUnused(kvoctrainDoc *doc, const vector &typeIndex, int old_types) { vector translate_index; - vector new_typeStr; + vector new_typeStr; ///////////////////////////////////////////////////// // translate_index contains new index number for each @@ -247,12 +247,12 @@ void TypeOptPage::cleanUnused(kvoctrainDoc *doc, const vector &typeIndex, i for (int col = 0; col < doc->numLangs(); col++) { for (int i = 0; i < doc->numEntries(); i++) { - QString old = doc->getEntry(i)->getType (col); + TQString old = doc->getEntry(i)->getType (col); if (!old.isEmpty() && old.left(strlen(QM_USER_TYPE)) == QM_USER_TYPE) { old.remove (0, 1); int o = old.toInt(); - QString newtype; + TQString newtype; if (translate_index[o] != 0) { newtype.setNum (translate_index[o]); newtype.insert (0, QM_USER_TYPE); diff --git a/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.h b/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.h index e497e361..4cba8d7a 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/TypeOptPage.h @@ -42,13 +42,13 @@ public: TypeOptPage ( - const vector &types, + const vector &types, kvoctrainDoc *doc, - QWidget *parent = NULL, + TQWidget *parent = NULL, const char *name = NULL ); - void getTypeNames (vector &ret_types, vector &ret_Index); + void getTypeNames (vector &ret_types, vector &ret_Index); static void cleanUnused(kvoctrainDoc *doc, const vector &lessonIndex, int old_lessons); diff --git a/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.cpp b/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.cpp index 007622a8..96c4a093 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.cpp +++ b/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.cpp @@ -30,8 +30,8 @@ #include #include -#include -#include +#include +#include #include @@ -39,22 +39,22 @@ UsageOptPage::UsageOptPage ( - const vector &usages, + const vector &usages, kvoctrainDoc *_doc, - QWidget *parent, + TQWidget *parent, const char *name ) : UsageOptPageForm( parent, name ), doc(_doc) { - connect( b_cleanup, SIGNAL(clicked()), SLOT(slotCleanup()) ); - connect( b_delete, SIGNAL(clicked()), SLOT(slotDeleteUsage()) ); - connect( b_modify, SIGNAL(clicked()), SLOT(slotModifyUsage()) ); - connect( b_new, SIGNAL(clicked()), SLOT(slotNewUsage()) ); - connect( usageList, SIGNAL(highlighted(int)), SLOT(slotUsageChosen(int)) ); + connect( b_cleanup, TQT_SIGNAL(clicked()), TQT_SLOT(slotCleanup()) ); + connect( b_delete, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteUsage()) ); + connect( b_modify, TQT_SIGNAL(clicked()), TQT_SLOT(slotModifyUsage()) ); + connect( b_new, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewUsage()) ); + connect( usageList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotUsageChosen(int)) ); - QString str; + TQString str; for (int i = 0; i < (int) usages.size(); i++) { str.setNum (i+1); if (i <= 9) @@ -83,11 +83,11 @@ void UsageOptPage::slotUsageChosen(int index) void UsageOptPage::slotNewUsage() { bool ok; - QString getUsage = KInputDialog::getText( - i18n( "usage (area) of an expression", "Usage Description" ), i18n( "Enter usage description:" ), QString::null, &ok ); + TQString getUsage = KInputDialog::getText( + i18n( "usage (area) of an expression", "Usage Description" ), i18n( "Enter usage description:" ), TQString::null, &ok ); if( !ok ) return; - QString str; + TQString str; int i = usageList->count()+1; str.setNum (i); if (i <= 9) @@ -105,16 +105,16 @@ void UsageOptPage::slotModifyUsage() { if (usageList->count() != 0 && (int) usageList->count() > act_usage) { - QString str = usageList->text (act_usage); + TQString str = usageList->text (act_usage); int pos = str.find (USAGE_TAG); str.remove (0, pos+strlen (USAGE_TAG)); bool ok; - QString getUsage = KInputDialog::getText( + TQString getUsage = KInputDialog::getText( i18n( "usage (area) of an expression", "Usage Description" ), i18n( "Enter usage description:" ), str, &ok ); if( !ok ) return; - QString str2; + TQString str2; str2.setNum (act_usage+1); if (act_usage <= 9) str2.insert (0, " "); @@ -125,7 +125,7 @@ void UsageOptPage::slotModifyUsage() void UsageOptPage::updateListBox(int start) { - QString str, str2; + TQString str, str2; for (int i = start; i < (int) usageList->count(); i++) { str = usageList->text (i); @@ -144,7 +144,7 @@ void UsageOptPage::slotDeleteUsage() int act = act_usage; if (usageList->count() != 0 && (int) usageList->count() > act) { - QString t; + TQString t; t.setNum(usageIndex[act_usage]+1); t.insert (0, UL_USER_USAGE); t += UL_USAGE_DIV; @@ -152,7 +152,7 @@ void UsageOptPage::slotDeleteUsage() // FIXME: ProgressDlg here? kvoctrainExpr *exp = doc->getEntry(ent); for (int lang = 0; lang < doc->numLangs(); lang++) { - QString ul = exp->getUsageLabel(lang) + UL_USAGE_DIV; + TQString ul = exp->getUsageLabel(lang) + UL_USAGE_DIV; if (ul.find(t) >= 0 ) { KMessageBox::information(this, i18n("usage (area) of an expression", @@ -181,10 +181,10 @@ void UsageOptPage::slotDeleteUsage() } -void UsageOptPage::getUsageLabels (vector &ret_usage, +void UsageOptPage::getUsageLabels (vector &ret_usage, vector &ret_Index) { - QString str; ret_usage.clear(); + TQString str; ret_usage.clear(); for (int i = 0; i < (int) usageList->count(); i++) { str = usageList->text(i); int pos = str.find (USAGE_TAG); @@ -203,8 +203,8 @@ void UsageOptPage::slotCleanup() for (int col = 0; col < doc->numLangs(); col++) for (int i = 0; i < (int) doc->numEntries(); i++) { - QString t = doc->getEntry(i)->getUsageLabel(col); - QString n; + TQString t = doc->getEntry(i)->getUsageLabel(col); + TQString n; while (t.left(strlen(UL_USER_USAGE)) == UL_USER_USAGE) { t.remove (0, 1); @@ -248,7 +248,7 @@ void UsageOptPage::cleanUnused(kvoctrainDoc *doc, int old_usages) { vector translate_index; - vector new_usageStr; + vector new_usageStr; ///////////////////////////////////////////////////// // translate_index contains new index number for each @@ -270,11 +270,11 @@ void UsageOptPage::cleanUnused(kvoctrainDoc *doc, for (int col = 0; col < doc->numLangs(); col++) { for (int i = 0; i < doc->numEntries(); i++) { - QString t = doc->getEntry(i)->getUsageLabel (col); + TQString t = doc->getEntry(i)->getUsageLabel (col); if (!t.isEmpty() && t.left(strlen(UL_USER_USAGE)) == UL_USER_USAGE) { - QString tg; + TQString tg; while (t.left(strlen(UL_USER_USAGE)) == UL_USER_USAGE) { - QString n; + TQString n; t.remove (0, 1); int next; if ((next = t.find(UL_USAGE_DIV)) >= 0) { @@ -286,7 +286,7 @@ void UsageOptPage::cleanUnused(kvoctrainDoc *doc, t = ""; } - QString newusage; + TQString newusage; int o = n.toInt(); if (translate_index[o] != 0) { newusage.setNum (translate_index[o]); diff --git a/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.h b/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.h index f9e8d978..5e7194bf 100644 --- a/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.h +++ b/kvoctrain/kvoctrain/docprop-dialogs/UsageOptPage.h @@ -44,13 +44,13 @@ public: UsageOptPage ( - const vector &usages, + const vector &usages, kvoctrainDoc *doc, - QWidget *parent = NULL, + TQWidget *parent = NULL, const char *name = NULL ); - void getUsageLabels (vector &ret_usages, vector &ret_Index); + void getUsageLabels (vector &ret_usages, vector &ret_Index); static void cleanUnused(kvoctrainDoc *doc, const vector &lessonIndex, int old_lessons); diff --git a/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.cpp b/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.cpp index ce97d871..0bdae252 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.cpp @@ -29,17 +29,17 @@ #include -#include +#include -AdjEntryPage::AdjEntryPage(EntryDlg *_dlgbook, bool multi_sel, const Comparison &comp, QWidget *parent, const char *name) +AdjEntryPage::AdjEntryPage(EntryDlg *_dlgbook, bool multi_sel, const Comparison &comp, TQWidget *parent, const char *name) : AdjEntryPageForm( parent, name ), dlgbook(_dlgbook) { comparisons = comp; - connect( lev1Field, SIGNAL(textChanged(const QString&)), SLOT(lev1Changed(const QString&)) ); - connect( lev2Field, SIGNAL(textChanged(const QString&)), SLOT(lev2Changed(const QString&)) ); - connect( lev3Field, SIGNAL(textChanged(const QString&)), SLOT(lev3Changed(const QString&)) ); + connect( lev1Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(lev1Changed(const TQString&)) ); + connect( lev2Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(lev2Changed(const TQString&)) ); + connect( lev3Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(lev3Changed(const TQString&)) ); setData(multi_sel, comp); } @@ -61,21 +61,21 @@ void AdjEntryPage::setData(bool multi_sel, const Comparison &comp) } -void AdjEntryPage::lev1Changed(const QString& s) +void AdjEntryPage::lev1Changed(const TQString& s) { setModified(true); comparisons.setL1 (s); } -void AdjEntryPage::lev2Changed(const QString& s) +void AdjEntryPage::lev2Changed(const TQString& s) { setModified(true); comparisons.setL2 (s); } -void AdjEntryPage::lev3Changed(const QString& s) +void AdjEntryPage::lev3Changed(const TQString& s) { setModified(true); comparisons.setL3 (s); diff --git a/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.h b/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.h index 095e22d7..efbae74f 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.h +++ b/kvoctrain/kvoctrain/entry-dialogs/AdjEntryPage.h @@ -37,7 +37,7 @@ class AdjEntryPage : public AdjEntryPageForm Q_OBJECT public: - AdjEntryPage(EntryDlg *_dlgbook, bool multi_sel, const Comparison &comp, QWidget *parent = NULL, const char *name = NULL); + AdjEntryPage(EntryDlg *_dlgbook, bool multi_sel, const Comparison &comp, TQWidget *parent = NULL, const char *name = NULL); void setData (bool multi_sel, const Comparison &comp); @@ -51,9 +51,9 @@ signals: void sigModified(); protected slots: - void lev1Changed(const QString&); - void lev2Changed(const QString&); - void lev3Changed(const QString&); + void lev1Changed(const TQString&); + void lev2Changed(const TQString&); + void lev3Changed(const TQString&); protected: Comparison comparisons; diff --git a/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.cpp b/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.cpp index b7c1837e..87e0fe59 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.cpp @@ -23,7 +23,7 @@ * * ***************************************************************************/ -#include +#include #include "AuxInfoEntryPage.h" #include "EntryDlg.h" @@ -36,18 +36,18 @@ AuxInfoEntryPage::AuxInfoEntryPage ( EntryDlg *_dlgbook, bool multi_sel, - QString syno, - QString anto, - QString exam, - QString rem, - QString para, - QWidget *parent, + TQString syno, + TQString anto, + TQString exam, + TQString rem, + TQString para, + TQWidget *parent, const char *name ) : AuxInfoEntryPageForm( parent, name ), dlgbook(_dlgbook) { - QFontMetrics fm (synonym_line->font()); + TQFontMetrics fm (synonym_line->font()); int sz = fm.lineSpacing(); synonym_line->setMaximumHeight(sz*3); @@ -56,17 +56,17 @@ AuxInfoEntryPage::AuxInfoEntryPage remark_line->setMaximumHeight(sz*3); examp_line->setMaximumHeight(sz*3); - connect( para_line, SIGNAL(textChanged()), SLOT(slotParaSelected()) ); - connect( remark_line, SIGNAL(textChanged()), SLOT(slotRemarkSelected()) ); - connect( examp_line, SIGNAL(textChanged()), SLOT(slotExampSelected()) ); - connect( antonym_line, SIGNAL(textChanged()), SLOT(slotAntonymSelected()) ); - connect( synonym_line, SIGNAL(textChanged()), SLOT(slotSynonymSelected()) ); + connect( para_line, TQT_SIGNAL(textChanged()), TQT_SLOT(slotParaSelected()) ); + connect( remark_line, TQT_SIGNAL(textChanged()), TQT_SLOT(slotRemarkSelected()) ); + connect( examp_line, TQT_SIGNAL(textChanged()), TQT_SLOT(slotExampSelected()) ); + connect( antonym_line, TQT_SIGNAL(textChanged()), TQT_SLOT(slotAntonymSelected()) ); + connect( synonym_line, TQT_SIGNAL(textChanged()), TQT_SLOT(slotSynonymSelected()) ); setData(multi_sel, syno, anto, exam, rem, para); } -void AuxInfoEntryPage::setData(bool multi_sel, QString syno, QString anto, QString example, QString remark, QString para) +void AuxInfoEntryPage::setData(bool multi_sel, TQString syno, TQString anto, TQString example, TQString remark, TQString para) { synonym_line->setText(syno); antonym_line->setText(anto); @@ -121,42 +121,42 @@ void AuxInfoEntryPage::slotParaSelected () } -QString AuxInfoEntryPage::getSynonym () +TQString AuxInfoEntryPage::getSynonym () { normalize(synonym); return synonym; } -QString AuxInfoEntryPage::getAntonym () +TQString AuxInfoEntryPage::getAntonym () { normalize(antonym); return antonym; } -QString AuxInfoEntryPage::getExample () +TQString AuxInfoEntryPage::getExample () { normalize(example); return example; } -QString AuxInfoEntryPage::getRemark () +TQString AuxInfoEntryPage::getRemark () { normalize(remark); return remark; } -QString AuxInfoEntryPage::getParaphrase () +TQString AuxInfoEntryPage::getParaphrase () { normalize(paraphrase); return paraphrase; } -void AuxInfoEntryPage::normalize (QString &str) +void AuxInfoEntryPage::normalize (TQString &str) { LineList ll (str); ll.normalizeWS(); diff --git a/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.h b/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.h index c9e78bf3..e8e88535 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.h +++ b/kvoctrain/kvoctrain/entry-dialogs/AuxInfoEntryPage.h @@ -39,22 +39,22 @@ public: ( EntryDlg *dlgbook, bool multi_sel, - QString syno, - QString anto, - QString example, - QString remark, - QString para, - QWidget *parent = 0, + TQString syno, + TQString anto, + TQString example, + TQString remark, + TQString para, + TQWidget *parent = 0, const char *name = 0 ); - void setData(bool multi_sel, QString syno, QString anto, QString example, QString remark, QString para); + void setData(bool multi_sel, TQString syno, TQString anto, TQString example, TQString remark, TQString para); - QString getSynonym (); - QString getAntonym (); - QString getExample (); - QString getRemark (); - QString getParaphrase(); + TQString getSynonym (); + TQString getAntonym (); + TQString getExample (); + TQString getRemark (); + TQString getParaphrase(); bool isModified(); void setModified(bool mod = true); @@ -64,7 +64,7 @@ signals: void sigModified(); protected: - void normalize(QString &str); + void normalize(TQString &str); protected slots: void slotAntonymSelected(); @@ -74,11 +74,11 @@ protected slots: void slotParaSelected(); protected: - QString synonym; - QString antonym; - QString example; - QString remark; - QString paraphrase; + TQString synonym; + TQString antonym; + TQString example; + TQString remark; + TQString paraphrase; bool modified; EntryDlg *dlgbook; }; diff --git a/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.cpp b/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.cpp index 9f5bc8b6..9a7d44fb 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.cpp @@ -26,12 +26,12 @@ #include "CommonEntryPage.h" #include "EntryDlg.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -52,18 +52,18 @@ CommonEntryPage::CommonEntryPage EntryDlg *_dlgbook, kvoctrainDoc *_doc, bool multi_sel, - QString expr, + TQString expr, int less, - QComboBox *lessbox, - QString lang, - QString act_type, - QString pron, - QString act_usage, - QString label, + TQComboBox *lessbox, + TQString lang, + TQString act_type, + TQString pron, + TQString act_usage, + TQString label, QueryManager &_querymanager, bool active, - const QFont& _ipafont, - QWidget *parent, + const TQFont& _ipafont, + TQWidget *parent, const char *name ) : @@ -80,18 +80,18 @@ CommonEntryPage::CommonEntryPage ipafont(_ipafont) { - connect( b_usageDlg, SIGNAL(clicked()), SLOT(invokeUsageDlg()) ); - connect( b_LessDlg, SIGNAL(clicked()), SLOT(invokeLessDlg()) ); - connect( b_pronDlg, SIGNAL(clicked()), SLOT(invokePronDlg()) ); - connect( b_TypeDlg, SIGNAL(clicked()), SLOT(invokeTypeDlg()) ); - connect( usage_box, SIGNAL(selectionChanged()), SLOT(slotUsageChanged()) ); - connect( lesson_box, SIGNAL(activated(int)), SLOT(slotLessonSelected(int)) ); - connect( subtype_box, SIGNAL(activated(int)), SLOT(slotSubTypeSelected(int)) ); - connect( type_box, SIGNAL(activated(int)), SLOT(slotTypeSelected(int)) ); - connect( c_active, SIGNAL(toggled(bool)), SLOT(slotActiveChanged(bool)) ); + connect( b_usageDlg, TQT_SIGNAL(clicked()), TQT_SLOT(invokeUsageDlg()) ); + connect( b_LessDlg, TQT_SIGNAL(clicked()), TQT_SLOT(invokeLessDlg()) ); + connect( b_pronDlg, TQT_SIGNAL(clicked()), TQT_SLOT(invokePronDlg()) ); + connect( b_TypeDlg, TQT_SIGNAL(clicked()), TQT_SLOT(invokeTypeDlg()) ); + connect( usage_box, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotUsageChanged()) ); + connect( lesson_box, TQT_SIGNAL(activated(int)), TQT_SLOT(slotLessonSelected(int)) ); + connect( subtype_box, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSubTypeSelected(int)) ); + connect( type_box, TQT_SIGNAL(activated(int)), TQT_SLOT(slotTypeSelected(int)) ); + connect( c_active, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotActiveChanged(bool)) ); - connect( pronunce_line, SIGNAL(textChanged(const QString&)), SLOT(slotPronunceSelected(const QString&)) ); - connect( expr_line, SIGNAL(textChanged(const QString&)), SLOT(slotExprSelected(const QString&)) ); + connect( pronunce_line, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotPronunceSelected(const TQString&)) ); + connect( expr_line, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotExprSelected(const TQString&)) ); usage_label->setTitle(i18n("Usage (area) of an Expression", "&Usage Labels")); pronunce_line->setFont(ipafont); @@ -100,12 +100,12 @@ CommonEntryPage::CommonEntryPage type_box->setValidator (new BlockAllValidator() ); subtype_box->setValidator (new BlockAllValidator() ); - QPixmap list_pm = SmallIcon("view_text"); + TQPixmap list_pm = SmallIcon("view_text"); b_LessDlg->setPixmap(list_pm); b_TypeDlg->setPixmap(list_pm); b_usageDlg->setPixmap(list_pm); - QPixmap pron_pm = SmallIcon("view_icon"); + TQPixmap pron_pm = SmallIcon("view_icon"); b_pronDlg->setPixmap(pron_pm); setData(multi_sel, expr, less, lessbox, lang, type, pronunce, act_usage, label, querymanager, active); @@ -114,14 +114,14 @@ CommonEntryPage::CommonEntryPage void CommonEntryPage::setData( bool multi_sel, - QString expr, + TQString expr, int less, - QComboBox *lessBox, - QString /*lang*/, - QString type, - QString pronunce, - QString usage, - QString /*label*/, + TQComboBox *lessBox, + TQString /*lang*/, + TQString type, + TQString pronunce, + TQString usage, + TQString /*label*/, QueryManager &/*querymanager*/, bool active) { @@ -172,12 +172,12 @@ void CommonEntryPage::setData( } -void CommonEntryPage::setTypeBox(const QString &act_type) +void CommonEntryPage::setTypeBox(const TQString &act_type) { all_types = QueryManager::getRelation(false); all_maintypes = QueryManager::getRelation(true); - QString s = QueryManager::getMainType(act_type)+QM_TYPE_DIV; + TQString s = QueryManager::getMainType(act_type)+QM_TYPE_DIV; int curr_type = 0; type_box->clear(); type_box->insertItem (i18n("")); @@ -191,7 +191,7 @@ void CommonEntryPage::setTypeBox(const QString &act_type) } -void CommonEntryPage::setLessonBox(QComboBox *lessbox, int lesson) +void CommonEntryPage::setLessonBox(TQComboBox *lessbox, int lesson) { lesson_box->clear(); for (int i = 0; i < lessbox->count(); i++) @@ -202,13 +202,13 @@ void CommonEntryPage::setLessonBox(QComboBox *lessbox, int lesson) } -void CommonEntryPage::setUsageBox(const QString & act_usage) +void CommonEntryPage::setUsageBox(const TQString & act_usage) { usages = UsageManager::getRelation(); usage_box->clear(); for (int i = 0; i < (int) usages.size(); i++) { usage_box->insertItem (usages[i].longStr()); - if (UsageManager::contains(QString(usages[i].identStr()), act_usage)) { + if (UsageManager::contains(TQString(usages[i].identStr()), act_usage)) { usage_box->setSelected (i, true); } } @@ -221,7 +221,7 @@ void CommonEntryPage::slotUsageChanged() setModified(true); usageCollection = ""; usage_dirty = true; - QString s; + TQString s; for (int i = 0; i < (int) usage_box->count(); i++) { if (usage_box->isSelected(i)) { @@ -254,14 +254,14 @@ void CommonEntryPage::slotActiveChanged(bool state) } -void CommonEntryPage::slotExprSelected (const QString& s) +void CommonEntryPage::slotExprSelected (const TQString& s) { setModified(true); expression = s; } -void CommonEntryPage::slotPronunceSelected (const QString& s) +void CommonEntryPage::slotPronunceSelected (const TQString& s) { setModified(true); pronunce = s; @@ -293,7 +293,7 @@ void CommonEntryPage::slotTypeSelected(int idx) else { type = all_maintypes[idx-1].shortStr(); emit typeSelected(type); - QString main_patt = all_maintypes[idx-1].shortStr()+QM_TYPE_DIV; + TQString main_patt = all_maintypes[idx-1].shortStr()+QM_TYPE_DIV; int sub_idx; if ( idx-1 < (int) all_types.size() ){ for (sub_idx = 0; sub_idx < (int) all_types.size(); sub_idx++) { @@ -303,7 +303,7 @@ void CommonEntryPage::slotTypeSelected(int idx) current_subtypes.push_back(all_maintypes[idx-1].shortStr()); first = false; } - QString s = all_types[sub_idx].longStr(); + TQString s = all_types[sub_idx].longStr(); subtype_box->insertItem (s.stripWhiteSpace()); current_subtypes.push_back(all_types[sub_idx].shortStr()); } @@ -320,7 +320,7 @@ void CommonEntryPage::slotTypeSelected(int idx) void CommonEntryPage::phoneticSelected(wchar_t wc) { setModified(true); - pronunce += QChar(wc); + pronunce += TQChar(wc); pronunce_line->setText(pronunce); } @@ -329,7 +329,7 @@ void CommonEntryPage::invokePronDlg() { //if (phoneticDlg == 0) { PhoneticEntryPage * phoneticDlg = new PhoneticEntryPage (ipafont, this); - connect (phoneticDlg, SIGNAL(charSelected(wchar_t)), SLOT(phoneticSelected(wchar_t)) ); + connect (phoneticDlg, TQT_SIGNAL(charSelected(wchar_t)), TQT_SLOT(phoneticSelected(wchar_t)) ); phoneticDlg->show(); //} //else @@ -340,7 +340,7 @@ void CommonEntryPage::invokePronDlg() void CommonEntryPage::invokeUsageDlg() { vector usageIndex; - vector new_usageStr; + vector new_usageStr; int old_usages = (int) doc->getUsageDescr().size(); @@ -350,7 +350,7 @@ void CommonEntryPage::invokeUsageDlg() UsageOptPage *usageOptPage = new UsageOptPage (doc->getUsageDescr(), doc, this, "name"); usageOpt.setMainWidget(usageOptPage); - if (usageOpt.exec() == QDialog::Accepted) + if (usageOpt.exec() == TQDialog::Accepted) { usageOptPage->getUsageLabels(new_usageStr, usageIndex); UsageOptPage::cleanUnused(doc, usageIndex, old_usages); @@ -365,7 +365,7 @@ void CommonEntryPage::invokeUsageDlg() void CommonEntryPage::invokeLessDlg() { vector lessonIndex; - vector new_lessonStr; + vector new_lessonStr; int old_lessons = (int) lesson_box->count(); KDialogBase lessOpt(KDialogBase::Swallow, i18n("Edit Lesson Names"), @@ -375,7 +375,7 @@ void CommonEntryPage::invokeLessDlg() lessOpt.setMainWidget(lessOptPage); vector lessoninquery = doc->getLessonsInQuery(); - if (lessOpt.exec() == QDialog::Accepted) + if (lessOpt.exec() == TQDialog::Accepted) { lessOptPage->getLesson(lesson_box, lessonIndex); LessOptPage::cleanUnused(doc, lesson_box, lessonIndex, old_lessons, lessoninquery); @@ -392,7 +392,7 @@ void CommonEntryPage::invokeLessDlg() void CommonEntryPage::invokeTypeDlg() { vector typeIndex; - vector new_typeStr; + vector new_typeStr; int old_types = (int) doc->getTypeDescr().size(); KDialogBase typeOpt(KDialogBase::Swallow, i18n("Edit User Defined Types"), @@ -401,7 +401,7 @@ void CommonEntryPage::invokeTypeDlg() TypeOptPage *typeOptPage = new TypeOptPage (doc->getTypeDescr(), doc, this, "name"); typeOpt.setMainWidget(typeOptPage); - if (typeOpt.exec() == QDialog::Accepted) + if (typeOpt.exec() == TQDialog::Accepted) { typeOptPage->getTypeNames(new_typeStr, typeIndex); TypeOptPage::cleanUnused(doc, typeIndex, old_types); diff --git a/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.h b/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.h index 71bbd84a..9d3652d2 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.h +++ b/kvoctrain/kvoctrain/entry-dialogs/CommonEntryPage.h @@ -44,31 +44,31 @@ public: EntryDlg *dlgbook, kvoctrainDoc *doc, bool multi_sel, - QString expr, + TQString expr, int less, - QComboBox *lessBox, - QString lang, - QString type, - QString pronunce, - QString usage, - QString label, + TQComboBox *lessBox, + TQString lang, + TQString type, + TQString pronunce, + TQString usage, + TQString label, QueryManager &querymanager, bool active, - const QFont& ipafont, - QWidget* parent = NULL, + const TQFont& ipafont, + TQWidget* parent = NULL, const char* name = NULL ); void setData( bool multi_sel, - QString expr, + TQString expr, int less, - QComboBox *lessBox, - QString lang, - QString type, - QString pronunce, - QString usage, - QString label, + TQComboBox *lessBox, + TQString lang, + TQString type, + TQString pronunce, + TQString usage, + TQString label, QueryManager &querymanager, bool active); @@ -79,10 +79,10 @@ public: bool usageDirty () const { return usage_dirty; } int getLesson () const { return lesson; } - QString getType () const { return type; } - QString getExpr () const { return expression; } - QString getPronunce () const { return pronunce; } - QString getUsageLabel() const { return usageCollection; } + TQString getType () const { return type; } + TQString getExpr () const { return expression; } + TQString getPronunce () const { return pronunce; } + TQString getUsageLabel() const { return usageCollection; } bool getActive () const { return entry_active; } bool isModified(); @@ -90,19 +90,19 @@ public: void setEnabled(int enable_type); signals: - void typeSelected(const QString &); + void typeSelected(const TQString &); protected: - void setTypeBox(const QString &act_type); - void setLessonBox(QComboBox *lessbox, int lesson); - void setUsageBox(const QString & act_type); + void setTypeBox(const TQString &act_type); + void setLessonBox(TQComboBox *lessbox, int lesson); + void setUsageBox(const TQString & act_type); protected slots: void slotLessonSelected(int); - void slotExprSelected(const QString&); + void slotExprSelected(const TQString&); void slotTypeSelected(int); void slotSubTypeSelected(int); - void slotPronunceSelected (const QString&); + void slotPronunceSelected (const TQString&); void slotUsageChanged(); void slotActiveChanged(bool state); void phoneticSelected(wchar_t); @@ -115,11 +115,11 @@ signals: void sigModified(); protected: - QString pronunce; - QString expression; - QString usageCollection; + TQString pronunce; + TQString expression; + TQString usageCollection; int lesson; - QString type; + TQString type; EntryDlg *dlgbook; bool lesson_dirty; bool type_dirty; @@ -132,9 +132,9 @@ protected: vector all_maintypes; vector all_types; vector usages; - vector current_subtypes; + vector current_subtypes; - QFont ipafont; + TQFont ipafont; bool modified; }; #endif // CommonEntryPage_included diff --git a/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.cpp b/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.cpp index 2d60ddb1..c0b249aa 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.cpp @@ -26,8 +26,8 @@ #include "EntryDlg.h" -#include -#include +#include +#include #include #include @@ -49,38 +49,38 @@ EntryDlg::EntryDlg( count_t t_bcount, time_t f_qdate, time_t t_qdate, - QString f_faux_ami, - QString t_faux_ami, - QString expr, + TQString f_faux_ami, + TQString t_faux_ami, + TQString expr, int lesson, - QComboBox *lessonbox, - QString lang, + TQComboBox *lessonbox, + TQString lang, LangSet &langset, - QString rem, - QString type, - QString pronunce, - QString synonym, - QString antonym, - QString example, - QString usagelabel, - QString paraphrase, + TQString rem, + TQString type, + TQString pronunce, + TQString synonym, + TQString antonym, + TQString example, + TQString usagelabel, + TQString paraphrase, const Conjugation &con_prefix, const Conjugation &conjugations, const Article &/*article*/, const Comparison &comp, const MultipleChoice &mc, QueryManager &querymanager, - const QString &title, + const TQString &title, bool active, - const QFont& ipafont, - QWidget *parent, + const TQFont& ipafont, + TQWidget *parent, const char *name, bool modal) : KDialogBase(Tabbed, title, User1|User2|User3|Apply|Close, Apply, parent, name, modal, false, KGuiItem(i18n("&Reset")), - KGuiItem(QString::null, "view_left_right"), - KGuiItem(QString::null, "view_top_bottom")) + KGuiItem(TQString::null, "view_left_right"), + KGuiItem(TQString::null, "view_top_bottom")) { mainwin = main; @@ -90,19 +90,19 @@ EntryDlg::EntryDlg( from_page = 0; to_page = 0; - QString s; + TQString s; if (langset.findLongId(lang).isEmpty() ) s = lang; else s = langset.findLongId(lang); - QFrame *page; - QVBoxLayout *topLayout; + TQFrame *page; + TQVBoxLayout *topLayout; if (origin) { page = addPage( i18n("Co&mmon") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); comm_page = new CommonEntryPage (this, doc, multi_sel, expr, lesson, lessonbox, lang, type, pronunce, usagelabel, i18n("Original &expression in %1:").arg(s), querymanager, active, @@ -110,29 +110,29 @@ EntryDlg::EntryDlg( topLayout->addWidget(comm_page); page = addPage( i18n("A&dditional") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); aux_page = new AuxInfoEntryPage (this, multi_sel, synonym, antonym, example, rem, paraphrase, page, name); topLayout->addWidget(aux_page); page = addPage( i18n("&Multiple Choice") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); mc_page = new MCEntryPage (this, multi_sel, mc, page, "MultipleChoice"); topLayout->addWidget(mc_page); page = addPage( i18n("Con&jugation") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); tense_page = new TenseEntryPage (this, multi_sel, con_prefix, conjugations, page, "Conjugation"); topLayout->addWidget(tense_page); page = addPage( i18n("Compar&ison") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); adj_page = new AdjEntryPage (this, multi_sel, comp, page, "Comparison"); topLayout->addWidget(adj_page); } else { page = addPage( i18n("Co&mmon") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); comm_page = new CommonEntryPage (this, doc, multi_sel, expr, lesson, lessonbox, lang, type, pronunce, usagelabel, i18n("Translated &expression in %1:").arg(s), querymanager, active, @@ -140,35 +140,35 @@ EntryDlg::EntryDlg( topLayout->addWidget(comm_page); page = addPage( i18n("A&dditional") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); aux_page = new AuxInfoEntryPage (this, multi_sel, synonym, antonym, example, rem, paraphrase, page, name); topLayout->addWidget(aux_page); page = addPage( i18n("&Multiple Choice") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); mc_page = new MCEntryPage (this, multi_sel, mc, page, "MultipleChoice"); topLayout->addWidget(mc_page); page = addPage( i18n("Con&jugation") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); tense_page = new TenseEntryPage (this, multi_sel, con_prefix, conjugations, page, "Conjugation"); topLayout->addWidget(tense_page); page = addPage( i18n("Compar&ison") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); adj_page = new AdjEntryPage (this, multi_sel, comp, page, "Comparison"); topLayout->addWidget(adj_page); } page = addPage( i18n("&From Original") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); from_page = new FromToEntryPage (this, multi_sel, f_grd, f_qdate, f_qcount, f_bcount, f_faux_ami, i18n("Properties From Original"), page, name); topLayout->addWidget(from_page); page = addPage( i18n("&To Original") ); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); to_page = new FromToEntryPage (this, multi_sel, t_grd, t_qdate, t_qcount, t_bcount, t_faux_ami, i18n("Properties to Original"), page, name); @@ -176,23 +176,23 @@ EntryDlg::EntryDlg( updatePages (type); - connect(comm_page, SIGNAL(typeSelected(const QString&)), SLOT(updatePages(const QString&)) ); + connect(comm_page, TQT_SIGNAL(typeSelected(const TQString&)), TQT_SLOT(updatePages(const TQString&)) ); - connect( this, SIGNAL(user1Clicked()), this, SLOT(slotUndo()) ); - connect( this, SIGNAL(applyClicked()), this, SLOT(slotApply()) ); - connect( this, SIGNAL(user2Clicked()), this, SLOT(slotDockVertical()) ); - connect( this, SIGNAL(user3Clicked()), this, SLOT(slotDockHorizontal()) ); + connect( this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(slotUndo()) ); + connect( this, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(slotApply()) ); + connect( this, TQT_SIGNAL(user2Clicked()), this, TQT_SLOT(slotDockVertical()) ); + connect( this, TQT_SIGNAL(user3Clicked()), this, TQT_SLOT(slotDockHorizontal()) ); - connect (comm_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() )); - connect (aux_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() )); - connect (adj_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() )); - connect (mc_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() )); - connect (tense_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() )); + connect (comm_page, TQT_SIGNAL(sigModified()), this, TQT_SLOT(slotDisplayModified() )); + connect (aux_page, TQT_SIGNAL(sigModified()), this, TQT_SLOT(slotDisplayModified() )); + connect (adj_page, TQT_SIGNAL(sigModified()), this, TQT_SLOT(slotDisplayModified() )); + connect (mc_page, TQT_SIGNAL(sigModified()), this, TQT_SLOT(slotDisplayModified() )); + connect (tense_page, TQT_SIGNAL(sigModified()), this, TQT_SLOT(slotDisplayModified() )); if (from_page != 0) - connect (from_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() )); + connect (from_page, TQT_SIGNAL(sigModified()), this, TQT_SLOT(slotDisplayModified() )); if (to_page != 0) - connect (to_page, SIGNAL(sigModified()), this, SLOT(slotDisplayModified() )); + connect (to_page, TQT_SIGNAL(sigModified()), this, TQT_SLOT(slotDisplayModified() )); enableButtonApply(false); enableButton(User1, false); @@ -212,33 +212,33 @@ void EntryDlg::setData( count_t t_bcount, time_t f_qdate, time_t t_qdate, - QString f_faux_ami, - QString t_faux_ami, - QString expr, + TQString f_faux_ami, + TQString t_faux_ami, + TQString expr, int lesson, - QComboBox *lessonbox, - QString lang, + TQComboBox *lessonbox, + TQString lang, LangSet &langset, - QString rem, - QString type, - QString pronunce, - QString synonym, - QString antonym, - QString example, - QString usagelabel, - QString paraphrase, + TQString rem, + TQString type, + TQString pronunce, + TQString synonym, + TQString antonym, + TQString example, + TQString usagelabel, + TQString paraphrase, const Conjugation &/*con_prefix*/, const Conjugation &conjugations, const Article &/*article*/, const Comparison &comp, const MultipleChoice &mc, QueryManager &querymanager, - const QString &title, + const TQString &title, bool active) { setCaption (kapp->makeStdCaption(title)); - QString s; + TQString s; if (langset.findLongId(lang).isEmpty() ) s = lang; else @@ -265,9 +265,9 @@ void EntryDlg::setData( } -void EntryDlg::updatePages(const QString &type) +void EntryDlg::updatePages(const TQString &type) { - QString main; + TQString main; int pos; if ((pos = type.find (QM_TYPE_DIV)) < 0) // only use main type main = type; @@ -308,8 +308,8 @@ void EntryDlg::setModified(bool mod) void EntryDlg::setEnabled(int enable) { - QString type = comm_page->getType(); - QString main; + TQString type = comm_page->getType(); + TQString main; int pos; if ((pos = type.find (QM_TYPE_DIV)) < 0) // only use main type main = type; @@ -382,7 +382,7 @@ void EntryDlg::slotDisplayModified() } -void EntryDlg::setCell(int row, int col, const vector& sel) +void EntryDlg::setCell(int row, int col, const vector& sel) { edit_row = row; edit_col = col; @@ -390,7 +390,7 @@ void EntryDlg::setCell(int row, int col, const vector& sel) } -void EntryDlg::getCell(int &row, int &col, vector& sel) const +void EntryDlg::getCell(int &row, int &col, vector& sel) const { row = edit_row; col = edit_col; @@ -407,7 +407,7 @@ void EntryDlg::slotDockVertical() } KWinModule info; - QRect rect = info.workArea(); + TQRect rect = info.workArea(); int diff_x = frameGeometry().width()-width(); int diff_y = frameGeometry().height()-height(); @@ -428,7 +428,7 @@ void EntryDlg::slotDockHorizontal() } KWinModule info; - QRect rect = info.workArea(); + TQRect rect = info.workArea(); int diff_x = frameGeometry().width()-width(); int diff_y = frameGeometry().height()-height(); @@ -457,7 +457,7 @@ void EntryDlg::reject () } -void EntryDlg::closeEvent (QCloseEvent * /*e*/) +void EntryDlg::closeEvent (TQCloseEvent * /*e*/) { emit sigEditChoice(EditCancel); } diff --git a/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h b/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h index f349ccfc..1c8551e3 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h +++ b/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h @@ -26,7 +26,7 @@ #ifndef EntryDlg_included #define EntryDlg_included -#include +#include #include @@ -65,31 +65,31 @@ public: count_t t_bcount, time_t f_qdate, time_t t_qdate, - QString f_faux_ami, - QString t_faux_ami, - QString _expr, + TQString f_faux_ami, + TQString t_faux_ami, + TQString _expr, int _lesson, - QComboBox *_lessonBox, - QString lang, + TQComboBox *_lessonBox, + TQString lang, LangSet &langset, - QString remark, - QString _type, - QString pronunce, - QString synonym, - QString antonym, - QString example, - QString usagelabel, - QString paraphrase, + TQString remark, + TQString _type, + TQString pronunce, + TQString synonym, + TQString antonym, + TQString example, + TQString usagelabel, + TQString paraphrase, const Conjugation &con_prefix, const Conjugation &conjugations, const Article &article, const Comparison &comp, const MultipleChoice &mc, QueryManager &querymanager, - const QString &title, + const TQString &title, bool active, - const QFont& ipafont, - QWidget *parent = 0, + const TQFont& ipafont, + TQWidget *parent = 0, const char *name = 0, bool modal = false ); @@ -108,35 +108,35 @@ public: count_t t_bcount, time_t f_qdate, time_t t_qdate, - QString f_faux_ami, - QString t_faux_ami, - QString _expr, + TQString f_faux_ami, + TQString t_faux_ami, + TQString _expr, int _lesson, - QComboBox *_lessonBox, - QString lang, + TQComboBox *_lessonBox, + TQString lang, LangSet &langset, - QString remark, - QString _type, - QString pronunce, - QString synonym, - QString antonym, - QString example, - QString usagelabel, - QString paraphrase, + TQString remark, + TQString _type, + TQString pronunce, + TQString synonym, + TQString antonym, + TQString example, + TQString usagelabel, + TQString paraphrase, const Conjugation &con_prefix, const Conjugation &conjugations, const Article &article, const Comparison &comp, const MultipleChoice &mc, QueryManager &querymanager, - const QString &title, + const TQString &title, bool active); bool fromDateDirty () const { return from_page ? from_page->dateDirty() : false; } bool fromGradeDirty () const { return from_page ? from_page->gradeDirty() : false; } bool fromBCountDirty () const { return from_page ? from_page->bCountDirty() : false; } bool fromQCountDirty () const { return from_page ? from_page->qCountDirty() : false; } - QString getFromFauxAmi () const { return from_page ? from_page->getFauxAmi() : QString(""); } + TQString getFromFauxAmi () const { return from_page ? from_page->getFauxAmi() : TQString(""); } time_t getFromDate () const { return from_page ? from_page->getDate() : 0; } grade_t getFromGrade () const { return from_page ? from_page->getGrade() : KV_NORM_GRADE; } @@ -147,7 +147,7 @@ public: bool toGradeDirty () const { return to_page ? to_page->gradeDirty() : false; } bool toBCountDirty () const { return to_page ? to_page->bCountDirty() : false; } bool toQCountDirty () const { return to_page ? to_page->qCountDirty() : false; } - QString getToFauxAmi () const { return to_page ? to_page->getFauxAmi() : QString(""); } + TQString getToFauxAmi () const { return to_page ? to_page->getFauxAmi() : TQString(""); } time_t getToDate () const { return to_page ? to_page->getDate() : 0; } grade_t getToGrade () const { return to_page ? to_page->getGrade() : KV_NORM_GRADE; } @@ -160,17 +160,17 @@ public: bool activeDirty () const { return comm_page->activeDirty (); } int getLesson () const { return comm_page->getLesson(); } - QString getType () const { return comm_page->getType(); } - QString getExpr () const { return comm_page->getExpr(); } - QString getPronunce () const { return comm_page->getPronunce(); } - QString getUsageLabel() const { return comm_page->getUsageLabel(); } + TQString getType () const { return comm_page->getType(); } + TQString getExpr () const { return comm_page->getExpr(); } + TQString getPronunce () const { return comm_page->getPronunce(); } + TQString getUsageLabel() const { return comm_page->getUsageLabel(); } bool getActive() const { return comm_page->getActive(); } - QString getSynonym () const { return aux_page->getSynonym(); } - QString getAntonym () const { return aux_page->getAntonym(); } - QString getRemark () const { return aux_page->getRemark(); } - QString getExample () const { return aux_page->getExample(); } - QString getParaphrase () const { return aux_page->getParaphrase(); } + TQString getSynonym () const { return aux_page->getSynonym(); } + TQString getAntonym () const { return aux_page->getAntonym(); } + TQString getRemark () const { return aux_page->getRemark(); } + TQString getExample () const { return aux_page->getExample(); } + TQString getParaphrase () const { return aux_page->getParaphrase(); } Conjugation getConjugation() const { return tense_page->getConjugation(); } @@ -182,8 +182,8 @@ public: void setModified(bool mod); void setEnabled(int); - void setCell(int row, int col, const vector& sel); - void getCell(int &row, int &col, vector& sel) const; + void setCell(int row, int col, const vector& sel); + void getCell(int &row, int &col, vector& sel) const; signals: void sigEditChoice(int); @@ -196,11 +196,11 @@ public slots: void slotDockVertical(); protected slots: - void updatePages(const QString &type); + void updatePages(const TQString &type); virtual void reject (); protected: - virtual void closeEvent (QCloseEvent*e); + virtual void closeEvent (TQCloseEvent*e); FromToEntryPage *from_page, *to_page; @@ -210,12 +210,12 @@ protected: AdjEntryPage *adj_page; MCEntryPage *mc_page; int edit_row, edit_col; - QTabWidget *tabber; + TQTabWidget *tabber; - vector selections; + vector selections; KMainWindow *mainwin; - QSize oldMainSize; - QPoint oldMainPos; + TQSize oldMainSize; + TQPoint oldMainPos; bool docked; }; diff --git a/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.cpp b/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.cpp index 462cdbf0..0a8bd0cb 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.cpp @@ -27,10 +27,10 @@ #include "FromToEntryPage.h" #include "EntryDlg.h" -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -42,7 +42,7 @@ #include -static QStringList monthnames; +static TQStringList monthnames; FromToEntryPage::FromToEntryPage ( @@ -52,9 +52,9 @@ FromToEntryPage::FromToEntryPage time_t _time, count_t _qcount, count_t _bcount, - QString faux, - QString label, - QWidget *parent, + TQString faux, + TQString label, + TQWidget *parent, const char *name ) : @@ -75,23 +75,23 @@ FromToEntryPage::FromToEntryPage monthnames.append (i18n("November")); monthnames.append (i18n("December")); - connect( bcount_line, SIGNAL(textChanged(const QString&)), SLOT(slotBCount(const QString&)) ); - connect( qcount_line, SIGNAL(textChanged(const QString&)), SLOT(slotQCount(const QString&)) ); - connect( fauxami_line, SIGNAL(textChanged(const QString&)), SLOT(slotFauxAmiSelected(const QString&)) ); + connect( bcount_line, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotBCount(const TQString&)) ); + connect( qcount_line, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotQCount(const TQString&)) ); + connect( fauxami_line, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotFauxAmiSelected(const TQString&)) ); - connect( never, SIGNAL(clicked()), SLOT(slotNever()) ); - connect( today, SIGNAL(clicked()), SLOT(slotToday()) ); - connect( gradebox, SIGNAL(activated(int)), SLOT(slotGradeSelected(int)) ); + connect( never, TQT_SIGNAL(clicked()), TQT_SLOT(slotNever()) ); + connect( today, TQT_SIGNAL(clicked()), TQT_SLOT(slotToday()) ); + connect( gradebox, TQT_SIGNAL(activated(int)), TQT_SLOT(slotGradeSelected(int)) ); - connect( year_spin, SIGNAL(valueChanged(int)), SLOT(slotYearChanged(int)) ); - connect( month_spin, SIGNAL(valueChanged(int)), SLOT(slotMonthChanged(int)) ); - connect( day_spin, SIGNAL(valueChanged(int)), SLOT(slotDayChanged(int)) ); + connect( year_spin, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotYearChanged(int)) ); + connect( month_spin, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotMonthChanged(int)) ); + connect( day_spin, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotDayChanged(int)) ); - year_spin->setData ((QStringList *) 0, 1980, 2100); + year_spin->setData ((TQStringList *) 0, 1980, 2100); month_spin->setData (&monthnames, 1, 12); - day_spin->setData ((QStringList *) 0, 1, 31); + day_spin->setData ((TQStringList *) 0, 1, 31); - QString s; + TQString s; for (int i = 0; i <= KV_MAX_GRADE; i++) { s.setNum (i); gradebox->insertItem( QueryManager::gradeStr(i) ); @@ -113,8 +113,8 @@ void FromToEntryPage::setData( time_t _time, count_t _qcount, count_t _bcount, - QString faux, - QString label) + TQString faux, + TQString label) { grade = _grade; qcount = _qcount; @@ -123,8 +123,8 @@ void FromToEntryPage::setData( fauxami_line->setText(fauxami); valid_date = false; - QDateTime dt; - QDate date; + TQDateTime dt; + TQDate date; if (_time != 0 && !multi_sel) { dt.setTime_t (_time); valid_date = true; @@ -137,9 +137,9 @@ void FromToEntryPage::setData( day_spin->setValue(day); month_spin->setValue(month); year_spin->setValue(year); - year_spin->setSpecial(QString::null); - month_spin->setSpecial(QString::null); - day_spin->setSpecial(QString::null); + year_spin->setSpecial(TQString::null); + month_spin->setSpecial(TQString::null); + day_spin->setSpecial(TQString::null); } else { dt.setTime_t (time(0L)); @@ -156,7 +156,7 @@ void FromToEntryPage::setData( gradebox->setCurrentItem (grade); - QString s; + TQString s; s.setNum (qcount); qcount_line->setText (s); @@ -185,7 +185,7 @@ void FromToEntryPage::setData( } -void FromToEntryPage::slotFauxAmiSelected(const QString& s) +void FromToEntryPage::slotFauxAmiSelected(const TQString& s) { setModified(true); fauxami = s; @@ -200,7 +200,7 @@ void FromToEntryPage::slotGradeSelected (int g) } -void FromToEntryPage::slotQCount(const QString& s) +void FromToEntryPage::slotQCount(const TQString& s) { setModified(true); qcount_dirty = true; @@ -208,7 +208,7 @@ void FromToEntryPage::slotQCount(const QString& s) } -void FromToEntryPage::slotBCount(const QString& s) +void FromToEntryPage::slotBCount(const TQString& s) { setModified(true); bcount_dirty = true; @@ -220,9 +220,9 @@ time_t FromToEntryPage::getDate () const { // FIXME: warning dialog/don`t quit dialog when date invalid if (valid_date) { - QDate act_date (year, month, day); - QDateTime time_null (QDate (1970, 1, 1), QTime (0,0,0)); - return -QDateTime(act_date).secsTo (time_null); + TQDate act_date (year, month, day); + TQDateTime time_null (TQDate (1970, 1, 1), TQTime (0,0,0)); + return -TQDateTime(act_date).secsTo (time_null); } else return 0; @@ -249,7 +249,7 @@ void FromToEntryPage::slotYearChanged(int new_year) new_year = year; } - year_spin->setSpecial(QString::null); + year_spin->setSpecial(TQString::null); year = new_year; validate(); @@ -278,7 +278,7 @@ void FromToEntryPage::slotMonthChanged(int new_month) new_month = month; } - month_spin->setSpecial(QString::null); + month_spin->setSpecial(TQString::null); month = new_month; validate(); @@ -306,7 +306,7 @@ void FromToEntryPage::slotDayChanged(int new_day) new_day = day; } - day_spin->setSpecial(QString::null); + day_spin->setSpecial(TQString::null); day = new_day; validate(); @@ -329,7 +329,7 @@ void FromToEntryPage::slotToday() { setModified(true); date_dirty = true; - QDateTime dt; + TQDateTime dt; dt.setTime_t (time(0L)); year = dt.date().year(); @@ -339,9 +339,9 @@ void FromToEntryPage::slotToday() day_spin->setValue(day); month_spin->setValue(month); year_spin->setValue(year); - year_spin->setSpecial(QString::null); - month_spin->setSpecial(QString::null); - day_spin->setSpecial(QString::null); + year_spin->setSpecial(TQString::null); + month_spin->setSpecial(TQString::null); + day_spin->setSpecial(TQString::null); validate(); } diff --git a/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.h b/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.h index ad322eff..238f4462 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.h +++ b/kvoctrain/kvoctrain/entry-dialogs/FromToEntryPage.h @@ -29,7 +29,7 @@ #include "FromToEntryPageForm.h" #include -#include +#include #include @@ -49,9 +49,9 @@ public: time_t _date, count_t _qcount, count_t _bcount, - QString faux, - QString label, - QWidget *parent = NULL, + TQString faux, + TQString label, + TQWidget *parent = NULL, const char *name = NULL ); @@ -61,8 +61,8 @@ public: time_t _date, count_t _qcount, count_t _bcount, - QString faux, - QString label); + TQString faux, + TQString label); time_t dateDirty () const { return date_dirty; } grade_t gradeDirty () const { return grade_dirty; } @@ -74,7 +74,7 @@ public: count_t getQCount () const { return qcount; } count_t getBCount () const { return bcount; } - QString getFauxAmi () const { return fauxami; } + TQString getFauxAmi () const { return fauxami; } bool isModified(); void setModified(bool mod = true); @@ -85,8 +85,8 @@ signals: protected slots: void slotGradeSelected(int); - void slotQCount(const QString&); - void slotBCount(const QString&); + void slotQCount(const TQString&); + void slotBCount(const TQString&); void slotIncYear(); void slotIncMonth(); @@ -96,7 +96,7 @@ protected slots: void slotDecDay(); void slotToday(); void slotNever(); - void slotFauxAmiSelected(const QString&); + void slotFauxAmiSelected(const TQString&); void slotDayChanged(int); void slotMonthChanged(int); @@ -105,7 +105,7 @@ protected slots: protected: void validate(); - QString fauxami; + TQString fauxami; bool valid_date; bool date_dirty, qcount_dirty, diff --git a/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.cpp b/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.cpp index a26e43ed..a6967704 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.cpp @@ -29,19 +29,19 @@ #include -#include +#include -MCEntryPage::MCEntryPage(EntryDlg *_dlgbook, bool multi_sel, const MultipleChoice &mc, QWidget *parent, const char *name) +MCEntryPage::MCEntryPage(EntryDlg *_dlgbook, bool multi_sel, const MultipleChoice &mc, TQWidget *parent, const char *name) : MCEntryPageForm( parent, name ), dlgbook(_dlgbook) { multiplechoice = mc; - connect( mc1Field, SIGNAL(textChanged(const QString&)), SLOT(mc1Changed(const QString&)) ); - connect( mc2Field, SIGNAL(textChanged(const QString&)), SLOT(mc2Changed(const QString&)) ); - connect( mc3Field, SIGNAL(textChanged(const QString&)), SLOT(mc3Changed(const QString&)) ); - connect( mc4Field, SIGNAL(textChanged(const QString&)), SLOT(mc4Changed(const QString&)) ); - connect( mc5Field, SIGNAL(textChanged(const QString&)), SLOT(mc5Changed(const QString&)) ); + connect( mc1Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(mc1Changed(const TQString&)) ); + connect( mc2Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(mc2Changed(const TQString&)) ); + connect( mc3Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(mc3Changed(const TQString&)) ); + connect( mc4Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(mc4Changed(const TQString&)) ); + connect( mc5Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(mc5Changed(const TQString&)) ); setData(multi_sel, mc); } @@ -68,35 +68,35 @@ void MCEntryPage::setData(bool multi_sel, const MultipleChoice &mc) } -void MCEntryPage::mc1Changed(const QString& s) +void MCEntryPage::mc1Changed(const TQString& s) { setModified(true); multiplechoice.setMC1 (s); } -void MCEntryPage::mc2Changed(const QString& s) +void MCEntryPage::mc2Changed(const TQString& s) { setModified(true); multiplechoice.setMC2 (s); } -void MCEntryPage::mc3Changed(const QString& s) +void MCEntryPage::mc3Changed(const TQString& s) { setModified(true); multiplechoice.setMC3 (s); } -void MCEntryPage::mc4Changed(const QString& s) +void MCEntryPage::mc4Changed(const TQString& s) { setModified(true); multiplechoice.setMC4 (s); } -void MCEntryPage::mc5Changed(const QString& s) +void MCEntryPage::mc5Changed(const TQString& s) { setModified(true); multiplechoice.setMC5 (s); diff --git a/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.h b/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.h index 23fb441a..c2938814 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.h +++ b/kvoctrain/kvoctrain/entry-dialogs/MCEntryPage.h @@ -37,7 +37,7 @@ class MCEntryPage : public MCEntryPageForm Q_OBJECT public: - MCEntryPage(EntryDlg *dlgbook, bool multi_sel, const MultipleChoice &mc, QWidget *parent = NULL, const char *name = NULL); + MCEntryPage(EntryDlg *dlgbook, bool multi_sel, const MultipleChoice &mc, TQWidget *parent = NULL, const char *name = NULL); void setData(bool multi_sel, const MultipleChoice &mc); @@ -51,11 +51,11 @@ signals: void sigModified(); protected slots: - void mc1Changed(const QString&); - void mc2Changed(const QString&); - void mc3Changed(const QString&); - void mc4Changed(const QString&); - void mc5Changed(const QString&); + void mc1Changed(const TQString&); + void mc2Changed(const TQString&); + void mc3Changed(const TQString&); + void mc4Changed(const TQString&); + void mc5Changed(const TQString&); protected: MultipleChoice multiplechoice; diff --git a/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.cpp b/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.cpp index f8d1e6f9..9e7c7450 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.cpp @@ -27,20 +27,20 @@ #include "MySpinBox.h" -MySpinBox::MySpinBox (QWidget* parent, const char* name ): QSpinBox(parent, name ), spin_names (0) +MySpinBox::MySpinBox (TQWidget* parent, const char* name ): TQSpinBox(parent, name ), spin_names (0) { setWrapping(true); } -void MySpinBox::setData (QStringList *names, int minValue, int maxValue) +void MySpinBox::setData (TQStringList *names, int minValue, int maxValue) { spin_names = names; setRange (minValue, maxValue); } -QString MySpinBox::mapValueToText( int value ) +TQString MySpinBox::mapValueToText( int value ) { if (special_str.length() != 0 ) return special_str; @@ -48,7 +48,7 @@ QString MySpinBox::mapValueToText( int value ) if (spin_names != 0) return (*spin_names)[value]; else - return QString("%1").arg(value); + return TQString("%1").arg(value); } @@ -58,7 +58,7 @@ int MySpinBox::MySpinBox::mapTextToValue(bool *) } -void MySpinBox::setSpecial(const QString &str) +void MySpinBox::setSpecial(const TQString &str) { special_str = str; setSuffix(""); // update display diff --git a/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.h b/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.h index 284bb8ea..f17ba8ba 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.h +++ b/kvoctrain/kvoctrain/entry-dialogs/MySpinBox.h @@ -26,23 +26,23 @@ #ifndef MySpinbox_included #define MySpinbox_included -#include +#include class QStringlist; class MySpinBox : public QSpinBox { public: - MySpinBox (QWidget* parent = 0, const char* name = 0); + MySpinBox (TQWidget* parent = 0, const char* name = 0); - void setSpecial(const QString &str); - void setData (QStringList *names, int minValue, int maxValue); - virtual QString mapValueToText( int value ); + void setSpecial(const TQString &str); + void setData (TQStringList *names, int minValue, int maxValue); + virtual TQString mapValueToText( int value ); virtual int mapTextToValue( bool* ok ); protected: - QStringList *spin_names; - QString special_str; + TQStringList *spin_names; + TQString special_str; }; #endif // MySpinbox_included diff --git a/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.cpp b/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.cpp index 6d26be5a..47487624 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.cpp @@ -26,10 +26,10 @@ #include "PhoneticEntryPage.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -175,32 +175,32 @@ void PhoneticButton::slotClicked() } -PhoneticEntryPage::PhoneticEntryPage(const QFont &ipafont, QWidget *parent, const char *name, bool modal) +PhoneticEntryPage::PhoneticEntryPage(const TQFont &ipafont, TQWidget *parent, const char *name, bool modal) : KDialogBase(Plain, i18n("Select Characters From Phonetic Alphabet"), Close, Close, parent, name, modal) { int num = sizeof(kv_unicode_ref) / sizeof(kv_unicode_ref[0]); - QFrame * phoneticbox = plainPage(); - QGridLayout *gbox = new QGridLayout(phoneticbox, KV_MAX_HORIZ, (num+KV_MAX_HORIZ-1)/KV_MAX_HORIZ, 1); + TQFrame * phoneticbox = plainPage(); + TQGridLayout *gbox = new TQGridLayout(phoneticbox, KV_MAX_HORIZ, (num+KV_MAX_HORIZ-1)/KV_MAX_HORIZ, 1); KV_Unicode_Ref *uni_ref = kv_unicode_ref; int vert = 0; int horiz = 0; while (uni_ref->code != 0) { - QChar qc = uni_ref->code; - QString text = qc; + TQChar qc = uni_ref->code; + TQString text = qc; PhoneticButton *butt = new PhoneticButton(text, phoneticbox, this); - connect (butt, SIGNAL(clicked()), butt, SLOT(slotClicked()) ); - QString tip = i18n("Unicode name: "); - tip += QString::fromLatin1(uni_ref->unicodename); + connect (butt, TQT_SIGNAL(clicked()), butt, TQT_SLOT(slotClicked()) ); + TQString tip = i18n("Unicode name: "); + tip += TQString::fromLatin1(uni_ref->unicodename); tip += "\n"; tip += i18n("Describing the sound of the character", "Sound: "); tip += i18n(uni_ref->audible); butt->setFont(ipafont); - butt->setSizePolicy(QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed)); + butt->setSizePolicy(TQSizePolicy (TQSizePolicy::Fixed, TQSizePolicy::Fixed)); int sz = QMAX(14, int(1.7*ipafont.pointSize())); - butt->setMaximumSize(QSize (sz, sz)); + butt->setMaximumSize(TQSize (sz, sz)); gbox->addWidget( butt, vert, horiz, AlignCenter ); - QToolTip::add (butt, tip); + TQToolTip::add (butt, tip); if (++horiz >= KV_MAX_HORIZ) { ++vert; @@ -212,10 +212,10 @@ PhoneticEntryPage::PhoneticEntryPage(const QFont &ipafont, QWidget *parent, cons } -void PhoneticEntryPage::keyPressEvent( QKeyEvent *e ) +void PhoneticEntryPage::keyPressEvent( TQKeyEvent *e ) { if ((e->state() & (ControlButton | AltButton)) == 0) { - QString s = e->text(); + TQString s = e->text(); for (unsigned i = 0; i < s.length(); ++i) { emit charSelected(s[i].unicode()); } diff --git a/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.h b/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.h index cf12ef48..d2747015 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.h +++ b/kvoctrain/kvoctrain/entry-dialogs/PhoneticEntryPage.h @@ -27,7 +27,7 @@ #ifndef PHONETICENTRYPAGE_H #define PHONETICENTRYPAGE_H -#include +#include #include @@ -36,13 +36,13 @@ class PhoneticEntryPage : public KDialogBase Q_OBJECT public: - PhoneticEntryPage(const QFont &ipafont, QWidget *parent = 0, const char *name = 0, bool modal = false); + PhoneticEntryPage(const TQFont &ipafont, TQWidget *parent = 0, const char *name = 0, bool modal = false); signals: void charSelected(wchar_t); protected: - void keyPressEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); friend class PhoneticButton; }; @@ -53,8 +53,8 @@ class PhoneticButton : public QPushButton Q_OBJECT public: - PhoneticButton (const QString & text, QWidget * parent, PhoneticEntryPage *_page, const char * name = 0) - : QPushButton (text, parent, name), page(_page) {} + PhoneticButton (const TQString & text, TQWidget * parent, PhoneticEntryPage *_page, const char * name = 0) + : TQPushButton (text, parent, name), page(_page) {} protected slots: void slotClicked(); diff --git a/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.cpp b/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.cpp index 30fa4fdd..c8c7d41e 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.cpp @@ -23,10 +23,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -39,27 +39,27 @@ TenseEntryPage::TenseEntryPage bool multi_sel, const Conjugation &con_prefix, const Conjugation &conjug, - QWidget *parent, + TQWidget *parent, const char *name ) : TenseEntryPageForm( parent, name ), multi_mode(multi_sel), dlgbook(_dlgbook) { - connect( third_p_common, SIGNAL(toggled(bool)), SLOT(slotThirdPCommonToggled(bool)) ); - connect( third_s_common, SIGNAL(toggled(bool)), SLOT(slotThirdSCommonToggled(bool)) ); - connect( b_next, SIGNAL(clicked()), SLOT(slotNextConj()) ); - connect( tensebox, SIGNAL(activated(int)), SLOT(slotTenseSelected(int)) ); - - connect( thirdN_plural, SIGNAL(textChanged(const QString&)), SLOT(thirdNPluralChanged(const QString&)) ); - connect( thirdN_singular, SIGNAL(textChanged(const QString&)), SLOT(thirdNSingularChanged(const QString&)) ); - connect( thirdM_plural, SIGNAL(textChanged(const QString&)), SLOT(thirdMPluralChanged(const QString&)) ); - connect( thirdM_singular, SIGNAL(textChanged(const QString&)), SLOT(thirdMSingularChanged(const QString&)) ); - connect( thirdF_plural, SIGNAL(textChanged(const QString&)), SLOT(thirdFPluralChanged(const QString&)) ); - connect( thirdF_singular, SIGNAL(textChanged(const QString&)), SLOT(thirdFSingularChanged(const QString&)) ); - connect( second_plural, SIGNAL(textChanged(const QString&)), SLOT(secondPluralChanged(const QString&)) ); - connect( second_singular, SIGNAL(textChanged(const QString&)), SLOT(secondSingularChanged(const QString&)) ); - connect( first_plural, SIGNAL(textChanged(const QString&)), SLOT(firstPluralChanged(const QString&)) ); - connect( first_singular, SIGNAL(textChanged(const QString&)), SLOT(firstSingularChanged(const QString&)) ); + connect( third_p_common, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotThirdPCommonToggled(bool)) ); + connect( third_s_common, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotThirdSCommonToggled(bool)) ); + connect( b_next, TQT_SIGNAL(clicked()), TQT_SLOT(slotNextConj()) ); + connect( tensebox, TQT_SIGNAL(activated(int)), TQT_SLOT(slotTenseSelected(int)) ); + + connect( thirdN_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdNPluralChanged(const TQString&)) ); + connect( thirdN_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdNSingularChanged(const TQString&)) ); + connect( thirdM_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdMPluralChanged(const TQString&)) ); + connect( thirdM_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdMSingularChanged(const TQString&)) ); + connect( thirdF_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdFPluralChanged(const TQString&)) ); + connect( thirdF_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(thirdFSingularChanged(const TQString&)) ); + connect( second_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(secondPluralChanged(const TQString&)) ); + connect( second_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(secondSingularChanged(const TQString&)) ); + connect( first_plural, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(firstPluralChanged(const TQString&)) ); + connect( first_singular, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(firstSingularChanged(const TQString&)) ); prefix = con_prefix; selection = ""; @@ -98,7 +98,7 @@ void TenseEntryPage::setData(bool /*multi_sel*/, const Conjugation &conjug) } -void TenseEntryPage::firstPluralChanged(const QString& s) +void TenseEntryPage::firstPluralChanged(const TQString& s) { conjugations.setPers1Plural (selection, s); updateFields(); @@ -106,7 +106,7 @@ void TenseEntryPage::firstPluralChanged(const QString& s) } -void TenseEntryPage::firstSingularChanged(const QString& s) +void TenseEntryPage::firstSingularChanged(const TQString& s) { conjugations.setPers1Singular (selection, s); updateFields(); @@ -114,7 +114,7 @@ void TenseEntryPage::firstSingularChanged(const QString& s) } -void TenseEntryPage::secondSingularChanged(const QString& s) +void TenseEntryPage::secondSingularChanged(const TQString& s) { conjugations.setPers2Singular (selection, s); updateFields(); @@ -122,7 +122,7 @@ void TenseEntryPage::secondSingularChanged(const QString& s) } -void TenseEntryPage::secondPluralChanged(const QString& s) +void TenseEntryPage::secondPluralChanged(const TQString& s) { conjugations.setPers2Plural (selection, s); updateFields(); @@ -130,7 +130,7 @@ void TenseEntryPage::secondPluralChanged(const QString& s) } -void TenseEntryPage::thirdFPluralChanged(const QString& s) +void TenseEntryPage::thirdFPluralChanged(const TQString& s) { conjugations.setPers3FemalePlural (selection, s); updateFields(); @@ -138,7 +138,7 @@ void TenseEntryPage::thirdFPluralChanged(const QString& s) } -void TenseEntryPage::thirdFSingularChanged(const QString& s) +void TenseEntryPage::thirdFSingularChanged(const TQString& s) { conjugations.setPers3FemaleSingular (selection, s); updateFields(); @@ -146,7 +146,7 @@ void TenseEntryPage::thirdFSingularChanged(const QString& s) } -void TenseEntryPage::thirdMSingularChanged(const QString& s) +void TenseEntryPage::thirdMSingularChanged(const TQString& s) { conjugations.setPers3MaleSingular (selection, s); updateFields(); @@ -154,7 +154,7 @@ void TenseEntryPage::thirdMSingularChanged(const QString& s) } -void TenseEntryPage::thirdNSingularChanged(const QString& s) +void TenseEntryPage::thirdNSingularChanged(const TQString& s) { conjugations.setPers3NaturalSingular(selection, s); updateFields(); @@ -162,7 +162,7 @@ void TenseEntryPage::thirdNSingularChanged(const QString& s) } -void TenseEntryPage::thirdNPluralChanged(const QString& s) +void TenseEntryPage::thirdNPluralChanged(const TQString& s) { conjugations.setPers3NaturalPlural (selection, s); updateFields(); @@ -170,7 +170,7 @@ void TenseEntryPage::thirdNPluralChanged(const QString& s) } -void TenseEntryPage::thirdMPluralChanged(const QString& s) +void TenseEntryPage::thirdMPluralChanged(const TQString& s) { conjugations.setPers3MalePlural (selection, s); updateFields(); diff --git a/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.h b/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.h index 5c118e8d..94e7a74c 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.h +++ b/kvoctrain/kvoctrain/entry-dialogs/TenseEntryPage.h @@ -43,7 +43,7 @@ public: bool multi_sel, const Conjugation &con_prefix, const Conjugation &conjugations, - QWidget *parent = NULL, + TQWidget *parent = NULL, const char *name = NULL ); @@ -62,17 +62,17 @@ protected: void updateFields(); protected slots: - void secondPluralChanged(const QString&); - void secondSingularChanged(const QString&); - void thirdNSingularChanged(const QString&); - void thirdFPluralChanged(const QString&); - void thirdMSingularChanged(const QString&); - void thirdFSingularChanged(const QString&); + void secondPluralChanged(const TQString&); + void secondSingularChanged(const TQString&); + void thirdNSingularChanged(const TQString&); + void thirdFPluralChanged(const TQString&); + void thirdMSingularChanged(const TQString&); + void thirdFSingularChanged(const TQString&); void slotTenseSelected(int); - void thirdMPluralChanged(const QString&); - void thirdNPluralChanged(const QString&); - void firstSingularChanged(const QString&); - void firstPluralChanged(const QString&); + void thirdMPluralChanged(const TQString&); + void thirdNPluralChanged(const TQString&); + void firstSingularChanged(const TQString&); + void firstPluralChanged(const TQString&); void slotThirdSCommonToggled(bool); void slotThirdPCommonToggled(bool); void slotNextConj(); @@ -80,7 +80,7 @@ protected slots: protected: Conjugation prefix, conjugations; - QString selection; + TQString selection; bool multi_mode; bool modified; EntryDlg *dlgbook; diff --git a/kvoctrain/kvoctrain/entry-dialogs/blockall.cpp b/kvoctrain/kvoctrain/entry-dialogs/blockall.cpp index 879acd8d..a21fd2b8 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/blockall.cpp +++ b/kvoctrain/kvoctrain/entry-dialogs/blockall.cpp @@ -25,12 +25,12 @@ #include "blockall.h" -BlockAllValidator::BlockAllValidator() : QValidator (0, 0) +BlockAllValidator::BlockAllValidator() : TQValidator (0, 0) { } -BlockAllValidator::State BlockAllValidator::validate (QString&, int& ) const +BlockAllValidator::State BlockAllValidator::validate (TQString&, int& ) const { return Invalid; } diff --git a/kvoctrain/kvoctrain/entry-dialogs/blockall.h b/kvoctrain/kvoctrain/entry-dialogs/blockall.h index 96b115be..f71230f6 100644 --- a/kvoctrain/kvoctrain/entry-dialogs/blockall.h +++ b/kvoctrain/kvoctrain/entry-dialogs/blockall.h @@ -26,13 +26,13 @@ #ifndef BlockAll_included #define BlockAll_included -#include +#include class BlockAllValidator : public QValidator { public: BlockAllValidator (); - State validate (QString&, int& ) const; + State validate (TQString&, int& ) const; }; #endif // BlockAll_included diff --git a/kvoctrain/kvoctrain/kva_clip.cpp b/kvoctrain/kvoctrain/kva_clip.cpp index fdbb2744..d441cc2e 100644 --- a/kvoctrain/kvoctrain/kva_clip.cpp +++ b/kvoctrain/kvoctrain/kva_clip.cpp @@ -26,7 +26,7 @@ #include "kvoctrain.h" -#include +#include #include #include @@ -37,8 +37,8 @@ using namespace std; void kvoctrainApp::slotSmartSearchClip() { - QString s; - QString entries = QApplication::clipboard()->text(); + TQString s; + TQString entries = TQApplication::clipboard()->text(); if (!entries.isEmpty()) { int pos = entries.find ('\n'); // search for a line end @@ -63,7 +63,7 @@ void kvoctrainApp::slotSmartSearchClip() vector kvoctrainApp::getCsvOrder(kvoctrainDoc *doc) { vector csv_order; - QStringList lang_order = Prefs::pasteOrder(); + TQStringList lang_order = Prefs::pasteOrder(); if (!Prefs::useCurrent()) { @@ -114,9 +114,9 @@ void kvoctrainApp::slotEditCopy() { slotStatusMsg(i18n("Copying selection to clipboard...")); - QApplication::setOverrideCursor( waitCursor ); - QString exp; - QString s; + TQApplication::setOverrideCursor( waitCursor ); + TQString exp; + TQString s; vector csv_order = getCsvOrder(doc); @@ -148,15 +148,15 @@ void kvoctrainApp::slotEditCopy() } if (!exp.isEmpty()) { #if defined(_WS_X11_) -// disconnect(QApplication::clipboard(),SIGNAL(dataChanged()),this,0); +// disconnect(TQApplication::clipboard(),TQT_SIGNAL(dataChanged()),this,0); #endif - QApplication::clipboard()->setText(exp); + TQApplication::clipboard()->setText(exp); #if defined(_WS_X11_) -// connect(QApplication::clipboard(),SIGNAL(dataChanged()), this,SLOT(clipboardChanged())); +// connect(TQApplication::clipboard(),TQT_SIGNAL(dataChanged()), this,TQT_SLOT(clipboardChanged())); #endif } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); slotStatusMsg(IDS_DEFAULT); } @@ -165,14 +165,14 @@ void kvoctrainApp::slotEditPaste() { slotStatusMsg(i18n("Inserting clipboard contents...")); - QApplication::setOverrideCursor( waitCursor ); - QString s; - QString entries = QApplication::clipboard()->text(); + TQApplication::setOverrideCursor( waitCursor ); + TQString s; + TQString entries = TQApplication::clipboard()->text(); vector csv_order = getCsvOrder(doc); bool changed = false; - QString num; + TQString num; // view->setView(0, langset, gradecols); while (!entries.isEmpty()) { int pos = entries.find ('\n'); // search for a line end @@ -197,7 +197,7 @@ void kvoctrainApp::slotEditPaste() kvoctrainExpr expr; expr.setLesson(act_lesson); // now move columns according to paste-order - QString s; + TQString s; for (int i = 0; i < (int) csv_order.size(); i++) { if (csv_order[i] >= 0) { if (i == 0) @@ -227,7 +227,7 @@ void kvoctrainApp::slotEditPaste() view->getTable()->updateContents(view->getTable()->numRows()-1, KV_COL_ORG); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); slotStatusMsg(IDS_DEFAULT); } diff --git a/kvoctrain/kvoctrain/kva_config.cpp b/kvoctrain/kvoctrain/kva_config.cpp index b5376c1e..875ecd04 100644 --- a/kvoctrain/kvoctrain/kva_config.cpp +++ b/kvoctrain/kvoctrain/kva_config.cpp @@ -23,7 +23,7 @@ * * ***************************************************************************/ -#include +#include #include "kvoctrain.h" #include @@ -46,7 +46,7 @@ void kvoctrainApp::saveOptions() Prefs::setNumPreSetting(presettings.size()); for (int i = 0 ; i < (int) presettings.size(); i++) { - PreSettings preSettings(QString::number(i)); + PreSettings preSettings(TQString::number(i)); preSettings.setName(presettings[i].name); preSettings.setQuery(presettings[i].query_set); preSettings.setThreshold(presettings[i].thresh_set); @@ -63,7 +63,7 @@ void kvoctrainApp::saveLanguages() Prefs::setNumLangSet(langset.size()); for (int i = 0 ; i < (int) langset.size(); i++) { - LanguageSettings languageSettings(QString::number(i)); + LanguageSettings languageSettings(TQString::number(i)); languageSettings.setShortId(langset.shortId(i)); languageSettings.setShort2Id(langset.shortId2(i)); languageSettings.setLongId(langset.longId(i)); @@ -81,7 +81,7 @@ void kvoctrainApp::readOptions() int ls = Prefs::numPreSetting(); for (int i = 0 ; i < ls; i++) { - PreSettings preSettings(QString::number(i)); + PreSettings preSettings(TQString::number(i)); preSettings.readConfig(); presettings.push_back(PreSetting(preSettings.name(), preSettings.query(), preSettings.threshold(), preSettings.blocking())); @@ -96,16 +96,16 @@ void kvoctrainApp::readLanguages() int ls = Prefs::numLangSet(); for (int i = 0 ; i < ls; i++) { - LanguageSettings languageSettings(QString::number(i)); + LanguageSettings languageSettings(TQString::number(i)); languageSettings.readConfig(); - QString shortId = languageSettings.shortId(); + TQString shortId = languageSettings.shortId(); if (shortId.stripWhiteSpace().length() == 0) { shortId.setNum (i); shortId.insert (0, "id"); } - QString longId = languageSettings.longId(); + TQString longId = languageSettings.longId(); if (longId.stripWhiteSpace().length() == 0) { longId.setNum (i); longId.insert (0, "ident"); @@ -125,8 +125,8 @@ void kvoctrainApp::saveProperties(KConfig *config ) config->writeEntry(CFG_QUERYMODE, querymode); - QString filename=doc->URL().path(); - QString tempname = kapp->tempSaveName(filename); + TQString filename=doc->URL().path(); + TQString tempname = kapp->tempSaveName(filename); saveDocProps(doc); doc->saveAs(this, KURL(tempname), doc->getTitle(), kvoctrainDoc::automatic); } @@ -137,15 +137,15 @@ void kvoctrainApp::readProperties(KConfig *config) { querymode = config->readBoolEntry(CFG_QUERYMODE, 0); - QString filename = config->readEntry(CFG_FILENAME); - QString title = config->readEntry(CFG_TITLE); + TQString filename = config->readEntry(CFG_FILENAME); + TQString title = config->readEntry(CFG_TITLE); bool modified = config->readBoolEntry(CFG_MODIFIED,false); if( modified ){ bool b_canRecover; - QString tempname = kapp->checkRecoverFile(filename,b_canRecover); + TQString tempname = kapp->checkRecoverFile(filename,b_canRecover); if(b_canRecover){ - pdlg = new ProgressDlg(QString(), QString(), kapp->makeStdCaption("")); + pdlg = new ProgressDlg(TQString(), TQString(), kapp->makeStdCaption("")); pdlg->show(); doc = new kvoctrainDoc(this, KURL(tempname)); removeProgressBar(); @@ -153,11 +153,11 @@ void kvoctrainApp::readProperties(KConfig *config) doc->setTitle(title); doc->setURL(KURL(filename)); setCaption(kapp->makeStdCaption(doc->getTitle(), false, doc->isModified())); - QFile::remove(tempname); + TQFile::remove(tempname); } } else if(!filename.isEmpty()){ - pdlg = new ProgressDlg (QString(), QString(), + pdlg = new ProgressDlg (TQString(), TQString(), kapp->makeStdCaption("")); pdlg->show(); doc = new kvoctrainDoc(this, KURL(filename)); diff --git a/kvoctrain/kvoctrain/kva_header.cpp b/kvoctrain/kvoctrain/kva_header.cpp index 2aad63c3..d1572659 100644 --- a/kvoctrain/kvoctrain/kva_header.cpp +++ b/kvoctrain/kvoctrain/kva_header.cpp @@ -48,29 +48,29 @@ void kvoctrainApp::slotHeaderMenu(int header, int x, int y) /*FOLD00*/ header_m = 0; if (header == KV_COL_LESS) { - header_m = new QPopupMenu(); + header_m = new TQPopupMenu(); header_m->insertItem(SmallIconSet("sort_incr"), i18n(SORT_ALPHA), (header << 16) | IDH_SORT_COL_ALPHA); header_m->insertItem(SmallIconSet("sort_num"), i18n(SORT_NUM), (header << 16) | IDH_SORT_COL_NUM); - connect (header_m, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect (header_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (header_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect (header_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); - header_m->exec(QPoint (x, y)); + header_m->exec(TQPoint (x, y)); return; } header -= KV_EXTRA_COLS; // adjust doc == header button - vector names; - QString curr_lang; - QString id = header == 0 ? doc->getOriginalIdent() + vector names; + TQString curr_lang; + TQString id = header == 0 ? doc->getOriginalIdent() : doc->getIdent(header); if (langset.indexShortId(id) >= 0) curr_lang = langset.longId(langset.indexShortId(id)); // select one of the available languages for the column - QPopupMenu *langs_m = new QPopupMenu(); + TQPopupMenu *langs_m = new TQPopupMenu(); // hack: ID => header-id + language for (int i = 0; i < (int) langset.size(); i++) { @@ -83,16 +83,16 @@ void kvoctrainApp::slotHeaderMenu(int header, int x, int y) /*FOLD00*/ for (int i = 0; i < (int) langset.size(); i++) { if( !langset.PixMapFile(i).isEmpty() && !langset.longId(i).isEmpty() ) - langs_m->insertItem(QPixmap(langset.PixMapFile(i)), names[i], + langs_m->insertItem(TQPixmap(langset.PixMapFile(i)), names[i], (header << 16) | (i << (16+8)) | IDH_SET_LANG); else langs_m->insertItem(names[i], (header << 16) | (i << (16+8)) | IDH_SET_LANG); } - connect (langs_m, SIGNAL(activated(int)), this, SLOT(slotSetHeaderProp(int))); - connect (langs_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (langs_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetHeaderProp(int))); + connect (langs_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); - header_m = new QPopupMenu(); + header_m = new TQPopupMenu(); if (header != KV_COL_ORG - KV_EXTRA_COLS ) { header_m->insertItem(SmallIconSet("run_query"), i18n("Create Random &Query"), (header << 16) | IDH_START_QUERY); @@ -116,8 +116,8 @@ void kvoctrainApp::slotHeaderMenu(int header, int x, int y) /*FOLD00*/ header_m->insertItem(SmallIconSet("delete_table_col"), i18n("&Remove Column"), (header << 16) | IDH_REMOVE ); } else { - QPopupMenu *query_m = new QPopupMenu(); - QPopupMenu *multiple_m = new QPopupMenu(); + TQPopupMenu *query_m = new TQPopupMenu(); + TQPopupMenu *multiple_m = new TQPopupMenu(); names.clear(); for (int j = 1; j < (int) doc->numLangs(); j++) { @@ -134,7 +134,7 @@ void kvoctrainApp::slotHeaderMenu(int header, int x, int y) /*FOLD00*/ if((j = langset.indexShortId(doc->getIdent(i))) >= 0 && !langset.PixMapFile(j).isEmpty() && !langset.longId(j).isEmpty() ) { - query_m->insertItem(QPixmap(langset.PixMapFile(j)), i18n("From %1").arg(names[i-1]), + query_m->insertItem(TQPixmap(langset.PixMapFile(j)), i18n("From %1").arg(names[i-1]), (i << (16+8)) | IDH_START_QUERY); // hack: IDs => header-ids + cmd } else { @@ -142,15 +142,15 @@ void kvoctrainApp::slotHeaderMenu(int header, int x, int y) /*FOLD00*/ } } header_m->insertItem(SmallIconSet("run_query"), i18n("Create Random &Query"), query_m, (3 << 16) | IDH_NULL); - connect (query_m, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect (query_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (query_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect (query_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); for (int i = 1; i < (int) doc->numLangs(); i++) { // show pixmap and long name if available int j; if((j = langset.indexShortId(doc->getIdent(i))) >= 0 && !langset.PixMapFile(j).isEmpty() && !langset.longId(j).isEmpty() ) { - multiple_m->insertItem(QPixmap(langset.PixMapFile(j)), i18n("From %1").arg(names[i-1]), + multiple_m->insertItem(TQPixmap(langset.PixMapFile(j)), i18n("From %1").arg(names[i-1]), (i << (16+8)) | IDH_START_MULTIPLE); // hack: IDs => header-ids + cmd } else { @@ -167,17 +167,17 @@ void kvoctrainApp::slotHeaderMenu(int header, int x, int y) /*FOLD00*/ header_m->insertItem(i18n("&Antonyms"), (header << 16) | IDH_START_ANTONYM); header_m->insertItem(i18n("E&xamples"), (header << 16) | IDH_START_EXAMPLE); header_m->insertItem(i18n("&Paraphrase"), (header << 16) | IDH_START_PARAPHRASE); - connect (multiple_m, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect (multiple_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (multiple_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect (multiple_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); header_m->insertSeparator(); header_m->insertItem(SmallIconSet("sort_incr"), i18n(SORT_ALPHA), (header+KV_EXTRA_COLS << 16) | IDH_SORT_COL_ALPHA); header_m->insertItem(SmallIconSet("set_language"), i18n("Set &Language"), langs_m, (2 << 16) | IDH_NULL); } - connect (header_m, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect (header_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); - header_m->exec(QPoint(x, y)); + connect (header_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect (header_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); + header_m->exec(TQPoint(x, y)); } @@ -190,11 +190,11 @@ void kvoctrainApp::slotSetHeaderProp (int header_and_id) /*FOLD00*/ if (id >= (int) langset.size()) return; // ??? - QString lid = langset.shortId(id); + TQString lid = langset.shortId(id); if (!langset.longId(id).isEmpty() ) lid = langset.longId(id); - QString pm = ""; + TQString pm = ""; if (!langset.PixMapFile(id).isEmpty() ) pm = langset.PixMapFile(id); @@ -255,17 +255,17 @@ void kvoctrainApp::slotHeaderStatus (int header_and_cmd) /*FOLD00*/ break; case IDH_SET_LANG: { - QString from = langset.longId(header2); + TQString from = langset.longId(header2); if (from.isEmpty()) from = langset.shortId(header2); - QString msg; + TQString msg; if (header1 == 0) { - QString format = i18n("Sets %1 as language for original"); + TQString format = i18n("Sets %1 as language for original"); msg = format.arg(from); } else { - QString format = i18n("Sets %1 as language for translation %2"); + TQString format = i18n("Sets %1 as language for translation %2"); msg = format.arg(from).arg(header1); } slotStatusHelpMsg(msg); @@ -274,14 +274,14 @@ void kvoctrainApp::slotHeaderStatus (int header_and_cmd) /*FOLD00*/ case IDH_APPEND: { - QString msg; + TQString msg; if (header1 == 0xFF) { msg = i18n("Appends a new language"); slotStatusHelpMsg(msg); } else if (header1 < (int) langset.size() ) { - QString from = langset.longId(header1); - QString format = i18n("Appends %1 as new language"); + TQString from = langset.longId(header1); + TQString format = i18n("Appends %1 as new language"); msg = format.arg(from); slotStatusHelpMsg(msg); } @@ -289,11 +289,11 @@ void kvoctrainApp::slotHeaderStatus (int header_and_cmd) /*FOLD00*/ break; case IDH_REMOVE: { - QString from = header1 ? doc->getIdent(header1) : doc->getOriginalIdent(); + TQString from = header1 ? doc->getIdent(header1) : doc->getOriginalIdent(); if (!langset.findLongId(from).isEmpty()) from = langset.findLongId(from); - QString msg; - QString format = i18n("Removes %1 irrevocably from dictionary"); + TQString msg; + TQString format = i18n("Removes %1 irrevocably from dictionary"); msg = format.arg(from); slotStatusHelpMsg(msg); } @@ -301,16 +301,16 @@ void kvoctrainApp::slotHeaderStatus (int header_and_cmd) /*FOLD00*/ case IDH_START_QUERY: case IDH_START_MULTIPLE: { - QString to = header1 ? doc->getIdent(header1) : doc->getOriginalIdent(); + TQString to = header1 ? doc->getIdent(header1) : doc->getOriginalIdent(); if (!langset.findLongId(to).isEmpty()) to = langset.findLongId(to); - QString from = header2 ? doc->getIdent(header2) : doc->getOriginalIdent(); + TQString from = header2 ? doc->getIdent(header2) : doc->getOriginalIdent(); if (!langset.findLongId(from).isEmpty()) from = langset.findLongId(from); - QString msg; - QString format; + TQString msg; + TQString format; if (doc->numLangs() == 1) { if (cmd == IDH_START_QUERY) @@ -372,11 +372,11 @@ void kvoctrainApp::slotHeaderStatus (int header_and_cmd) /*FOLD00*/ break; case IDH_RESET_GRADE: { - QString from = header1 ? doc->getIdent(header1) : doc->getOriginalIdent(); + TQString from = header1 ? doc->getIdent(header1) : doc->getOriginalIdent(); if (!langset.findLongId(from).isEmpty()) from = langset.findLongId(from); - QString format = i18n("Resets all properties for %1"); - QString msg = format.arg(from); + TQString format = i18n("Resets all properties for %1"); + TQString msg = format.arg(from); slotStatusHelpMsg(msg); } break; @@ -432,8 +432,8 @@ void kvoctrainApp::slotHeaderCallBack (int header_and_cmd) /*FOLD00*/ break; case IDH_REMOVE: { - QString msg; - QString name; + TQString msg; + TQString name; name = doc->getIdent(header1); int i= langset.indexShortId(name); @@ -441,7 +441,7 @@ void kvoctrainApp::slotHeaderCallBack (int header_and_cmd) /*FOLD00*/ && !langset.longId(i).isEmpty() ) name = langset.longId(i); - QString format = i18n("You are about to delete a language completely.\n" + TQString format = i18n("You are about to delete a language completely.\n" "Do you really want to delete \"%1\"?"); msg = format.arg(name); @@ -528,9 +528,9 @@ void kvoctrainApp::slotHeaderCallBack (int header_and_cmd) /*FOLD00*/ break; case IDH_RESET_GRADE: { - QString msg; - QString name; - QString format; + TQString msg; + TQString name; + TQString format; if (act_lesson == 0) { name = doc->getIdent(header1); diff --git a/kvoctrain/kvoctrain/kva_init.cpp b/kvoctrain/kvoctrain/kva_init.cpp index 8d8ef995..c1b3ebe8 100644 --- a/kvoctrain/kvoctrain/kva_init.cpp +++ b/kvoctrain/kvoctrain/kva_init.cpp @@ -27,8 +27,8 @@ #include "common-dialogs/ProgressDlg.h" -#include -#include +#include +#include #include #include @@ -40,7 +40,7 @@ #include "prefs.h" -kvoctrainApp::kvoctrainApp(QWidget *parent, const char *name) +kvoctrainApp::kvoctrainApp(TQWidget *parent, const char *name) : KMainWindow(parent, name) { doc = 0; @@ -89,8 +89,8 @@ kvoctrainApp::kvoctrainApp(QWidget *parent, const char *name) editRemoveSelectedArea->setEnabled(view->getTable()->numRows() > 0); querying = false; - btimer = new QTimer( this ); - connect( btimer, SIGNAL(timeout()), this, SLOT(slotTimeOutBackup()) ); + btimer = new TQTimer( this ); + connect( btimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeOutBackup()) ); if (Prefs::autoBackup()) btimer->start(Prefs::backupTime() * 60 * 1000, TRUE); } @@ -98,154 +98,154 @@ kvoctrainApp::kvoctrainApp(QWidget *parent, const char *name) void kvoctrainApp::initActions() { - fileNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); + fileNew = KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection()); fileNew->setWhatsThis(i18n("Creates a new blank vocabulary document")); fileNew->setToolTip(fileNew->whatsThis()); - fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); + fileOpen = KStdAction::open(this, TQT_SLOT(slotFileOpen()), actionCollection()); fileOpen->setWhatsThis(i18n("Opens an existing vocabulary document")); fileOpen->setToolTip(fileOpen->whatsThis()); - fileOpenExample = new KAction(i18n("Open &Example..."), "fileopen", 0, this, SLOT(slotFileOpenExample()), actionCollection(), "file_open_example"); + fileOpenExample = new KAction(i18n("Open &Example..."), "fileopen", 0, this, TQT_SLOT(slotFileOpenExample()), actionCollection(), "file_open_example"); fileOpen->setWhatsThis(i18n("Open a vocabulary document")); fileOpen->setToolTip(fileOpen->whatsThis()); - fileGHNS = new KAction(i18n("&Get New Vocabularies..."), "knewstuff", CTRL+Key_G, this, SLOT(slotGHNS()), actionCollection(), "file_ghns"); + fileGHNS = new KAction(i18n("&Get New Vocabularies..."), "knewstuff", CTRL+Key_G, this, TQT_SLOT(slotGHNS()), actionCollection(), "file_ghns"); fileGHNS->setWhatsThis(i18n("Downloads new vocabularies")); fileGHNS->setToolTip(fileGHNS->whatsThis()); - fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); + fileOpenRecent = KStdAction::openRecent(this, TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); - fileMerge = new KAction(i18n("&Merge..."), 0, 0, this, SLOT(slotFileMerge()), actionCollection(), "file_merge"); + fileMerge = new KAction(i18n("&Merge..."), 0, 0, this, TQT_SLOT(slotFileMerge()), actionCollection(), "file_merge"); fileMerge->setWhatsThis(i18n("Merge an existing vocabulary document with the current one")); fileMerge->setToolTip(fileOpen->whatsThis()); - fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); + fileSave = KStdAction::save(this, TQT_SLOT(slotFileSave()), actionCollection()); fileSave->setWhatsThis(i18n("Save the active vocabulary document")); fileSave->setToolTip(fileSave->whatsThis()); - fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); + fileSaveAs = KStdAction::saveAs(this, TQT_SLOT(slotFileSaveAs()), actionCollection()); fileSaveAs->setWhatsThis(i18n("Save the active vocabulary document with a different name")); fileSaveAs->setToolTip(fileSaveAs->whatsThis()); - filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection()); + filePrint = KStdAction::print(this, TQT_SLOT(slotFilePrint()), actionCollection()); filePrint->setWhatsThis(i18n("Print the active vocabulary document")); filePrint->setToolTip(filePrint->whatsThis()); - fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); + fileQuit = KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection()); fileQuit->setWhatsThis(i18n("Quit KVocTrain")); fileQuit->setToolTip(fileQuit->whatsThis()); - editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection()); + editCopy = KStdAction::copy(this, TQT_SLOT(slotEditCopy()), actionCollection()); editCopy->setWhatsThis(i18n("Copy")); editCopy->setToolTip(editCopy->whatsThis()); - editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection()); + editPaste = KStdAction::paste(this, TQT_SLOT(slotEditPaste()), actionCollection()); editPaste->setWhatsThis(i18n("Paste")); editPaste->setToolTip(editPaste->whatsThis()); - editSelectAll = KStdAction::selectAll(this, SLOT(slotSelectAll()), actionCollection()); + editSelectAll = KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), actionCollection()); editSelectAll->setWhatsThis(i18n("Select all rows")); editSelectAll->setToolTip(editSelectAll->whatsThis()); - editClearSelection = KStdAction::deselect(this, SLOT(slotCancelSelection()), actionCollection()); + editClearSelection = KStdAction::deselect(this, TQT_SLOT(slotCancelSelection()), actionCollection()); editClearSelection->setWhatsThis(i18n("Deselect all rows")); editClearSelection->setToolTip(editClearSelection->whatsThis()); - editSearchFromClipboard = KStdAction::find(this, SLOT(slotSmartSearchClip()), actionCollection()); + editSearchFromClipboard = KStdAction::find(this, TQT_SLOT(slotSmartSearchClip()), actionCollection()); editSearchFromClipboard->setWhatsThis(i18n("Search for the clipboard contents in the vocabulary")); editSearchFromClipboard->setToolTip(editSearchFromClipboard->whatsThis()); - editAppend = new KAction(i18n("&Append New Entry"), "insert_table_row", "Insert", this, SLOT(slotAppendRow()), actionCollection(),"edit_append"); + editAppend = new KAction(i18n("&Append New Entry"), "insert_table_row", "Insert", this, TQT_SLOT(slotAppendRow()), actionCollection(),"edit_append"); editAppend->setWhatsThis(i18n("Append a new row to the vocabulary")); editAppend->setToolTip(editAppend->whatsThis()); - editEditSelectedArea = new KAction(i18n("&Edit Selected Area..."), "edit_table_row", "Ctrl+Return", this, SLOT(slotEditRow()), actionCollection(),"edit_edit_selected_area"); + editEditSelectedArea = new KAction(i18n("&Edit Selected Area..."), "edit_table_row", "Ctrl+Return", this, TQT_SLOT(slotEditRow()), actionCollection(),"edit_edit_selected_area"); editEditSelectedArea->setWhatsThis(i18n("Edit the entries in the selected rows")); editEditSelectedArea->setToolTip(editEditSelectedArea->whatsThis()); - editRemoveSelectedArea = new KAction(i18n("&Remove Selected Area"), "delete_table_row", "Delete", this, SLOT(slotRemoveRow()), actionCollection(),"edit_remove_selected_area"); + editRemoveSelectedArea = new KAction(i18n("&Remove Selected Area"), "delete_table_row", "Delete", this, TQT_SLOT(slotRemoveRow()), actionCollection(),"edit_remove_selected_area"); editRemoveSelectedArea->setWhatsThis(i18n("Delete the selected rows")); editRemoveSelectedArea->setToolTip(editRemoveSelectedArea->whatsThis()); - editSaveSelectedArea = new KAction(i18n("Save E&ntries in Query As..."), KGlobal::iconLoader()->loadIcon("filesaveas", KIcon::Small), 0, this, SLOT(slotSaveSelection()), actionCollection(),"edit_save_selected_area"); + editSaveSelectedArea = new KAction(i18n("Save E&ntries in Query As..."), KGlobal::iconLoader()->loadIcon("filesaveas", KIcon::Small), 0, this, TQT_SLOT(slotSaveSelection()), actionCollection(),"edit_save_selected_area"); editSaveSelectedArea->setWhatsThis(i18n("Save the entries in the query as a new vocabulary")); editSaveSelectedArea->setToolTip(editSaveSelectedArea->whatsThis()); - vocabShowStatistics = new KAction(i18n("Show &Statistics"), "statistics", 0, this, SLOT(slotShowStatist()), actionCollection(),"vocab_show_statistics"); + vocabShowStatistics = new KAction(i18n("Show &Statistics"), "statistics", 0, this, TQT_SLOT(slotShowStatist()), actionCollection(),"vocab_show_statistics"); vocabShowStatistics->setWhatsThis(i18n("Show statistics for the current vocabulary")); vocabShowStatistics->setToolTip(vocabShowStatistics->whatsThis()); - vocabAssignLessons = new KAction(i18n("Assign L&essons..."), "rand_less", 0, this, SLOT(slotCreateRandom()), actionCollection(),"vocab_assign_lessons"); + vocabAssignLessons = new KAction(i18n("Assign L&essons..."), "rand_less", 0, this, TQT_SLOT(slotCreateRandom()), actionCollection(),"vocab_assign_lessons"); vocabAssignLessons->setWhatsThis(i18n("Create random lessons with unassigned entries")); vocabAssignLessons->setToolTip(vocabAssignLessons->whatsThis()); - vocabCleanUp = new KAction(i18n("&Clean Up"), "cleanup", 0, this, SLOT(slotCleanVocabulary()), actionCollection(),"vocab_clean_up"); + vocabCleanUp = new KAction(i18n("&Clean Up"), "cleanup", 0, this, TQT_SLOT(slotCleanVocabulary()), actionCollection(),"vocab_clean_up"); vocabCleanUp->setWhatsThis(i18n("Remove entries with same content from vocabulary")); vocabCleanUp->setToolTip(vocabCleanUp->whatsThis()); vocabAppendLanguage = new KSelectAction(i18n("&Append Language"), "insert_table_col", 0, actionCollection(), "vocab_append_language"); - connect(vocabAppendLanguage->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowVocabAppendLanguage())); - connect (vocabAppendLanguage->popupMenu(), SIGNAL(activated(int)), this, SLOT(slotAppendLang(int))); - connect (vocabAppendLanguage->popupMenu(), SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect(vocabAppendLanguage->popupMenu(), TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(aboutToShowVocabAppendLanguage())); + connect (vocabAppendLanguage->popupMenu(), TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotAppendLang(int))); + connect (vocabAppendLanguage->popupMenu(), TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); vocabSetLanguage = new KSelectAction(i18n("Set &Language"), "set_language", 0, actionCollection(), "vocab_set_language"); - connect(vocabSetLanguage->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowVocabSetLanguage())); + connect(vocabSetLanguage->popupMenu(), TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(aboutToShowVocabSetLanguage())); vocabRemoveLanguage = new KSelectAction(i18n("&Remove Language"), "delete_table_col", 0, actionCollection(), "vocab_remove_language"); - connect(vocabRemoveLanguage->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowVocabRemoveLanguage())); - connect(vocabRemoveLanguage->popupMenu(), SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect(vocabRemoveLanguage->popupMenu(), SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect(vocabRemoveLanguage->popupMenu(), TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(aboutToShowVocabRemoveLanguage())); + connect(vocabRemoveLanguage->popupMenu(), TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect(vocabRemoveLanguage->popupMenu(), TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); - vocabDocumentProperties = new KAction(i18n("Document &Properties"), 0, 0, this, SLOT(slotDocProps()), actionCollection(), "vocab_document_properties"); + vocabDocumentProperties = new KAction(i18n("Document &Properties"), 0, 0, this, TQT_SLOT(slotDocProps()), actionCollection(), "vocab_document_properties"); vocabDocumentProperties->setWhatsThis(i18n("Edit document properties")); vocabDocumentProperties->setToolTip(vocabAppendLanguage->whatsThis()); - vocabLanguageProperties = new KAction(i18n("Lan&guage Properties"), 0, 0, this, SLOT(slotDocPropsLang()), actionCollection(), "vocab_language_properties"); + vocabLanguageProperties = new KAction(i18n("Lan&guage Properties"), 0, 0, this, TQT_SLOT(slotDocPropsLang()), actionCollection(), "vocab_language_properties"); vocabLanguageProperties->setWhatsThis(i18n("Edit language properties in current document")); vocabLanguageProperties->setToolTip(vocabSetLanguage->whatsThis()); lessons = new KComboBox(this); lessons->setMinimumWidth(160); - connect(lessons, SIGNAL(highlighted(int)), this, SLOT(slotChooseLesson(int))); - lessons->setFocusPolicy(QWidget::NoFocus); + connect(lessons, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotChooseLesson(int))); + lessons->setFocusPolicy(TQWidget::NoFocus); vocabLessons = new KWidgetAction(lessons, i18n("Lessons"), 0, this, 0, actionCollection(), "vocab_lessons"); vocabLessons->setWhatsThis(i18n("Choose current lesson")); vocabLessons->setToolTip(vocabLessons->whatsThis()); searchLine = new KLineEdit(this); - searchLine->setFocusPolicy(QWidget::ClickFocus); - connect (searchLine, SIGNAL(returnPressed()), this, SLOT(slotSearchNext())); - connect (searchLine, SIGNAL(textChanged(const QString&)), this, SLOT(slotResumeSearch(const QString&))); + searchLine->setFocusPolicy(TQWidget::ClickFocus); + connect (searchLine, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotSearchNext())); + connect (searchLine, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotResumeSearch(const TQString&))); vocabSearch = new KWidgetAction(searchLine, i18n("Smart Search"), 0, this, 0, actionCollection(), "vocab_search"); vocabSearch->setAutoSized(true); vocabSearch->setWhatsThis(i18n("Search vocabulary for specified text ")); vocabSearch->setToolTip(vocabSearch->whatsThis()); /* - learningResumeQuery = new KAction(i18n("Resume &Query..."), "run_query", 0, this, SLOT(slotRestartQuery()), actionCollection(),"learning_resume_query"); + learningResumeQuery = new KAction(i18n("Resume &Query..."), "run_query", 0, this, TQT_SLOT(slotRestartQuery()), actionCollection(),"learning_resume_query"); //learningResumeQuery->setWhatsThis(i18n("")); learningResumeQuery->setToolTip(learningResumeQuery->whatsThis()); - learningResumeMultipleChoice = new KAction(i18n("&Resume Multiple Choice..."), "run_multi", 0, this, SLOT(slotRestartQuery()), actionCollection(),"learning_resume_multiple_choice"); + learningResumeMultipleChoice = new KAction(i18n("&Resume Multiple Choice..."), "run_multi", 0, this, TQT_SLOT(slotRestartQuery()), actionCollection(),"learning_resume_multiple_choice"); //learningResumeMultipleChoice->setWhatsThis(i18n("")); learningResumeMultipleChoice->setToolTip(learningResumeMultipleChoice->whatsThis()); */ - configApp = KStdAction::preferences(this, SLOT( slotGeneralOptions()), actionCollection()); + configApp = KStdAction::preferences(this, TQT_SLOT( slotGeneralOptions()), actionCollection()); configApp->setWhatsThis(i18n("Show the configuration dialog")); configApp->setToolTip(configApp->whatsThis()); - /*configQueryOptions = new KAction(i18n("Configure &Query..."), "configure_query", 0, this, SLOT(slotQueryOptions()), actionCollection(),"config_query_options"); + /*configQueryOptions = new KAction(i18n("Configure &Query..."), "configure_query", 0, this, TQT_SLOT(slotQueryOptions()), actionCollection(),"config_query_options"); configQueryOptions->setWhatsThis(i18n("Show the query configuration dialog")); configQueryOptions->setToolTip(configQueryOptions->whatsThis());*/ actionCollection()->setHighlightingEnabled(true); - connect(actionCollection(), SIGNAL(actionStatusText(const QString &)), this, SLOT(slotStatusHelpMsg(const QString &))); - //connect(actionCollection(), SIGNAL(actionHighlighted(KAction *, bool)), this, SLOT(slotActionHighlighted(KAction *, bool))); + connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), this, TQT_SLOT(slotStatusHelpMsg(const TQString &))); + //connect(actionCollection(), TQT_SIGNAL(actionHighlighted(KAction *, bool)), this, TQT_SLOT(slotActionHighlighted(KAction *, bool))); if (!initialGeometrySet()) - resize( QSize(550, 400).expandedTo(minimumSizeHint())); + resize( TQSize(550, 400).expandedTo(minimumSizeHint())); setupGUI(ToolBar | Keys | StatusBar | Create); setAutoSaveSettings(); @@ -253,26 +253,26 @@ void kvoctrainApp::initActions() configToolbar->setWhatsThis(i18n("Toggle display of the toolbars")); configToolbar->setToolTip(configToolbar->whatsThis()); - learn_menu = (QPopupMenu*) child( "learning", "KPopupMenu" ); - connect(learn_menu, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect(learn_menu, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); - connect(learn_menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowLearn())); + learn_menu = (TQPopupMenu*) child( "learning", "KPopupMenu" ); + connect(learn_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect(learn_menu, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); + connect(learn_menu, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(aboutToShowLearn())); } void kvoctrainApp::initStatusBar() { - type_label = new QLabel(statusBar()); - type_label->setFrameStyle(QFrame::NoFrame); + type_label = new TQLabel(statusBar()); + type_label->setFrameStyle(TQFrame::NoFrame); statusBar()->addWidget(type_label, 150); - pron_label = new QLabel(statusBar()); - pron_label->setFrameStyle(QFrame::NoFrame); + pron_label = new TQLabel(statusBar()); + pron_label->setFrameStyle(TQFrame::NoFrame); pron_label->setFont(Prefs::iPAFont()); statusBar()->addWidget(pron_label, 200); - rem_label = new QLabel(statusBar()); - rem_label->setFrameStyle(QFrame::NoFrame); + rem_label = new TQLabel(statusBar()); + rem_label->setFrameStyle(TQFrame::NoFrame); statusBar()->addWidget(rem_label, 150); } @@ -287,7 +287,7 @@ void kvoctrainApp::initDoc( ) loadDocProps(doc); if (doc->numLangs() == 0) doc->appendLang("en"); - connect (doc, SIGNAL (docModified(bool)), this, SLOT(slotModifiedDoc(bool))); + connect (doc, TQT_SIGNAL (docModified(bool)), this, TQT_SLOT(slotModifiedDoc(bool))); doc->setModified(false); } diff --git a/kvoctrain/kvoctrain/kva_io.cpp b/kvoctrain/kvoctrain/kva_io.cpp index 22df3874..c809cc3a 100644 --- a/kvoctrain/kvoctrain/kva_io.cpp +++ b/kvoctrain/kvoctrain/kva_io.cpp @@ -25,7 +25,7 @@ #include -#include +#include #include #include @@ -159,17 +159,17 @@ void kvoctrainApp::slotFileNew() if (queryExit() ) { view->setView (0, langset); delete doc; - QString name = ""; + TQString name = ""; doc = new kvoctrainDoc (this, 0 /*KURL(name)*/); loadDocProps(doc); if (doc->numLangs() == 0) { - QString l = "en"; + TQString l = "en"; doc->appendLang(l); } view->setView(doc, langset); view->getTable()->setFont(Prefs::tableFont()); view->adjustContent(); - connect (doc, SIGNAL (docModified(bool)), this, SLOT(slotModifiedDoc(bool))); + connect (doc, TQT_SIGNAL (docModified(bool)), this, TQT_SLOT(slotModifiedDoc(bool))); doc->setModified(false); } slotStatusMsg(IDS_DEFAULT); @@ -181,8 +181,8 @@ void kvoctrainApp::slotFileOpen() slotStatusMsg(i18n("Opening file...")); if (queryExit() ) { - QString s; - KURL url = KFileDialog::getOpenURL(QString::null, FILTER_RPATTERN, parentWidget(), i18n("Open Vocabulary File")); + TQString s; + KURL url = KFileDialog::getOpenURL(TQString::null, FILTER_RPATTERN, parentWidget(), i18n("Open Vocabulary File")); loadfileFromPath(url, true); } slotStatusMsg(IDS_DEFAULT); @@ -197,8 +197,8 @@ void kvoctrainApp::loadfileFromPath(const KURL & url, bool addRecent) delete doc; doc = 0; - QString format = i18n("Loading %1"); - QString msg = format.arg(url.path()); + TQString format = i18n("Loading %1"); + TQString msg = format.arg(url.path()); slotStatusMsg(msg); prepareProgressBar(); @@ -210,7 +210,7 @@ void kvoctrainApp::loadfileFromPath(const KURL & url, bool addRecent) view->adjustContent(); if (addRecent) fileOpenRecent->addURL(url) /*addRecentFile (url.path())*/; - connect (doc, SIGNAL (docModified(bool)), this, SLOT(slotModifiedDoc(bool))); + connect (doc, TQT_SIGNAL (docModified(bool)), this, TQT_SLOT(slotModifiedDoc(bool))); doc->setModified(false); } } @@ -220,12 +220,12 @@ void kvoctrainApp::slotFileOpenExample() slotStatusMsg(i18n("Opening example file...")); if (queryExit() ) { - QString s; + TQString s; s = locate("data", "kvoctrain/examples/"); KURL url = KFileDialog::getOpenURL(s, FILTER_RPATTERN, parentWidget(), i18n("Open Example Vocabulary File")); loadfileFromPath(url, false); if (doc) - doc->URL().setFileName(QString::null); + doc->URL().setFileName(TQString::null); } slotStatusMsg(IDS_DEFAULT); } @@ -243,41 +243,41 @@ void kvoctrainApp::slotFileMerge() { slotStatusMsg(i18n("Merging file...")); - QString s; - KURL url = KFileDialog::getOpenURL(QString::null, FILTER_RPATTERN, parentWidget(), i18n("Merge Vocabulary File")); + TQString s; + KURL url = KFileDialog::getOpenURL(TQString::null, FILTER_RPATTERN, parentWidget(), i18n("Merge Vocabulary File")); if (!url.isEmpty() ) { - QString format = i18n("Loading %1"); - QString msg = format.arg(url.path()); + TQString format = i18n("Loading %1"); + TQString msg = format.arg(url.path()); slotStatusMsg(msg); prepareProgressBar(); kvoctrainDoc *new_doc = new kvoctrainDoc (this, url); - connect (new_doc, SIGNAL (docModified(bool)), this, SLOT(slotModifiedDoc(bool))); + connect (new_doc, TQT_SIGNAL (docModified(bool)), this, TQT_SLOT(slotModifiedDoc(bool))); doc->setModified(false); removeProgressBar(); - vector old_names = doc->getLessonDescr(); - vector new_names = new_doc->getLessonDescr(); + vector old_names = doc->getLessonDescr(); + vector new_names = new_doc->getLessonDescr(); - vector old_types = doc->getTypeDescr(); - vector new_types = new_doc->getTypeDescr(); + vector old_types = doc->getTypeDescr(); + vector new_types = new_doc->getTypeDescr(); - vector old_tenses = doc->getTenseDescr(); - vector new_tenses = new_doc->getTenseDescr(); + vector old_tenses = doc->getTenseDescr(); + vector new_tenses = new_doc->getTenseDescr(); vector old_in_query = doc->getLessonsInQuery(); vector new_in_query = new_doc->getLessonsInQuery(); - vector old_usages = doc->getUsageDescr(); - vector new_usages = new_doc->getUsageDescr(); + vector old_usages = doc->getUsageDescr(); + vector new_usages = new_doc->getUsageDescr(); format = i18n("Merging %1"); msg = format.arg(url.path()); slotStatusMsg(msg); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); int lesson_offset = lessons->count()-1; for (int i = 0; i < (int) new_names.size(); i++) { @@ -330,10 +330,10 @@ void kvoctrainApp::slotFileMerge() expr->setLesson(expr->getLesson()+lesson_offset); for (int lang = 0; lang <= (int) expr->numTranslations(); lang++) { - QString t = expr->getType (lang); + TQString t = expr->getType (lang); // adjust type offset if (!t.isEmpty() && t.left(1) == QM_USER_TYPE) { - QString t2; + TQString t2; t.remove (0, 1); t2.setNum (t.toInt()+types_offset); t2.insert (0, QM_USER_TYPE); @@ -342,11 +342,11 @@ void kvoctrainApp::slotFileMerge() t = expr->getUsageLabel (lang); // adjust usage offset - QString tg; + TQString tg; if (!t.isEmpty() ) { - QString t2; + TQString t2; while (t.left(strlen(UL_USER_USAGE)) == UL_USER_USAGE) { - QString n; + TQString n; t.remove (0, 1); int next; if ((next = t.find(UL_USAGE_DIV)) >= 0) { @@ -380,7 +380,7 @@ void kvoctrainApp::slotFileMerge() t = conj.getType(ci); if (!t.isEmpty() && t.left(1) == UL_USER_TENSE) { t.remove (0, strlen(UL_USER_TENSE)); - QString t2; + TQString t2; t2.setNum (t.toInt()+tenses_offset); t2.insert (0, UL_USER_TENSE); conj.setType(ci, t2); @@ -422,7 +422,7 @@ void kvoctrainApp::slotFileMerge() if (!cs_equal[lpos]) { cs_equal[lpos] = true; - QString id = lpos == 0 ? doc->getOriginalIdent() + TQString id = lpos == 0 ? doc->getOriginalIdent() : doc->getIdent(lpos); } @@ -430,12 +430,12 @@ void kvoctrainApp::slotFileMerge() new_expr.setOriginal(s); else new_expr.setTranslation(i, s); - QString r = expr->getRemark(lpos); + TQString r = expr->getRemark(lpos); new_expr.setRemark (i, r); - QString t = expr->getType(lpos); + TQString t = expr->getType(lpos); if (!t.isEmpty() && t.left(1) == QM_USER_TYPE) { - QString t2; + TQString t2; t.remove (0, 1); t2.setNum (t.toInt()+types_offset); t2.insert (0, QM_USER_TYPE); @@ -444,7 +444,7 @@ void kvoctrainApp::slotFileMerge() t = expr->getUsageLabel(lpos); if (!t.isEmpty() && t.left(1) == QM_USER_TYPE) { - QString t2; + TQString t2; t.remove (0, 1); t2.setNum (t.toInt()+usages_offset); t2.insert (0, QM_USER_TYPE); @@ -456,7 +456,7 @@ void kvoctrainApp::slotFileMerge() t = conj.getType(ci); if (!t.isEmpty() && t.left(1) == QM_USER_TYPE) { t.remove (0, strlen(QM_USER_TYPE)); - QString t2; + TQString t2; t2.setNum (t.toInt()+tenses_offset); t2.insert (0, QM_USER_TYPE); conj.setType(ci, t2); @@ -484,7 +484,7 @@ void kvoctrainApp::slotFileMerge() view->setView(doc, langset); view->getTable()->setFont(Prefs::tableFont()); view->adjustContent(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); slotStatusMsg(IDS_DEFAULT); } @@ -499,14 +499,14 @@ void kvoctrainApp::slotFileSave() return; } - QString format = i18n("Saving %1"); - QString msg = format.arg(doc->URL().path()); + TQString format = i18n("Saving %1"); + TQString msg = format.arg(doc->URL().path()); slotStatusMsg(msg); // remove previous backup - QFile::remove(QFile::encodeName(doc->URL().path()+"~")); - ::rename (QFile::encodeName(doc->URL().path()), - QFile::encodeName(doc->URL().path()+"~")); + TQFile::remove(TQFile::encodeName(doc->URL().path()+"~")); + ::rename (TQFile::encodeName(doc->URL().path()), + TQFile::encodeName(doc->URL().path()+"~")); prepareProgressBar(); saveDocProps(doc); @@ -522,7 +522,7 @@ void kvoctrainApp::fillLessonBox(kvoctrainDoc *the_doc) { lessons->clear(); lessons->insertItem (the_doc->getLessonDescr(0)); - vector names = the_doc->getLessonDescr(); + vector names = the_doc->getLessonDescr(); for (int i = 0; i < (int) names.size(); i++) lessons->insertItem (names[i]); act_lesson = the_doc->getCurrentLesson(); @@ -592,25 +592,25 @@ void kvoctrainApp::slotFileSaveAs() if (entryDlg != 0) commitEntryDlg(false); - KURL url = KFileDialog::getSaveURL(QString::null, FILTER_WPATTERN, parentWidget(), i18n("Save Vocabulary As")); + KURL url = KFileDialog::getSaveURL(TQString::null, FILTER_WPATTERN, parentWidget(), i18n("Save Vocabulary As")); if (!url.isEmpty() ) { - QFileInfo fileinfo(url.path()); + TQFileInfo fileinfo(url.path()); if (fileinfo.exists() && KMessageBox::warningContinueCancel(0, i18n("The file
%1
already exists. Do you want to overwrite it?
") - .arg(url.path()),QString::null,i18n("Overwrite")) == KMessageBox::Cancel) + .arg(url.path()),TQString::null,i18n("Overwrite")) == KMessageBox::Cancel) { // do nothing } else if (doc) { - QString format = i18n("Saving %1"); - QString msg = format.arg(url.path()); + TQString format = i18n("Saving %1"); + TQString msg = format.arg(url.path()); slotStatusMsg(msg); - QFile::remove(QFile::encodeName(url.path()+"~")); // remove previous backup - ::rename (QFile::encodeName(url.path()), QFile::encodeName(QString(url.path()+"~"))); + TQFile::remove(TQFile::encodeName(url.path()+"~")); // remove previous backup + ::rename (TQFile::encodeName(url.path()), TQFile::encodeName(TQString(url.path()+"~"))); saveDocProps(doc); prepareProgressBar(); @@ -629,7 +629,7 @@ void kvoctrainApp::slotSaveSelection () commitEntryDlg(false); slotStatusMsg(i18n("Saving selected area under new filename...")); - QString save_separator = Prefs::separator(); + TQString save_separator = Prefs::separator(); Prefs::setSeparator("\t"); kvoctrainDoc seldoc(this, ""); // transfer most important parts @@ -644,26 +644,26 @@ void kvoctrainApp::slotSaveSelection () if (doc->getEntry(i)->isInQuery() ) seldoc.appendEntry(doc->getEntry(i)); - KURL url = KFileDialog::getSaveURL(QString::null, FILTER_WPATTERN, parentWidget(), i18n("Save Vocabulary As")); + KURL url = KFileDialog::getSaveURL(TQString::null, FILTER_WPATTERN, parentWidget(), i18n("Save Vocabulary As")); if (!url.isEmpty() ) { - QFileInfo fileinfo(url.path()); + TQFileInfo fileinfo(url.path()); if (fileinfo.exists() && KMessageBox::warningContinueCancel(0, i18n("The file
%1
already exists. Do you want to overwrite it?
") - .arg(url.path()),QString::null,i18n("Overwrite")) == KMessageBox::Cancel) + .arg(url.path()),TQString::null,i18n("Overwrite")) == KMessageBox::Cancel) { // do nothing } else { - QString format = i18n("Saving %1"); - QString msg = format.arg(url.path()); + TQString format = i18n("Saving %1"); + TQString msg = format.arg(url.path()); slotStatusMsg(msg); - QFile::remove(url.path()+"~"); // remove previous backup + TQFile::remove(url.path()+"~"); // remove previous backup // FIXME: check error - ::rename (QFile::encodeName(url.path()), QFile::encodeName(url.path()+"~")); + ::rename (TQFile::encodeName(url.path()), TQFile::encodeName(url.path()+"~")); saveDocProps(&seldoc); prepareProgressBar(); @@ -680,7 +680,7 @@ void kvoctrainApp::prepareProgressBar () { statusBar()->clear (); pbar = new KProgress (statusBar()); - pbar->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + pbar->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); statusBar()->addWidget(pbar, 150, true); pbar->show(); } diff --git a/kvoctrain/kvoctrain/kva_query.cpp b/kvoctrain/kvoctrain/kva_query.cpp index 98e1ed30..0f2ca08d 100644 --- a/kvoctrain/kvoctrain/kva_query.cpp +++ b/kvoctrain/kvoctrain/kva_query.cpp @@ -89,7 +89,7 @@ void kvoctrainApp::slotQueryOptions(int pageindex) qodlg.selectPage(pageindex); int res = qodlg.exec(); - if (res == QDialog::Accepted) { + if (res == TQDialog::Accepted) { //type_querytimeout = qodlg.getTypeQueryTimeout(); Prefs::setMaxTimePer(qodlg.getMQueryTime()*1000); @@ -133,7 +133,7 @@ void kvoctrainApp::slotStartPropertyQuery(int col, QueryType property) return; prepareProgressBar(); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); random_expr2.clear(); queryList = querymanager.select (doc, act_lesson, act_query_col, property); @@ -150,7 +150,7 @@ void kvoctrainApp::slotStartPropertyQuery(int col, QueryType property) } query_num = query_startnum; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); removeProgressBar(); query_cycle = 1; @@ -179,11 +179,11 @@ void kvoctrainApp::slotStartPropertyQuery(int col, QueryType property) exp, doc); - connect( simpleQueryDlg, SIGNAL(sigEditEntry(int,int)), - this, SLOT(slotEditEntry(int,int))); + connect( simpleQueryDlg, TQT_SIGNAL(sigEditEntry(int,int)), + this, TQT_SLOT(slotEditEntry(int,int))); - connect( simpleQueryDlg, SIGNAL(sigQueryChoice(QueryDlgBase::Result)), - this, SLOT(slotTimeOutProperty(QueryDlgBase::Result))); + connect( simpleQueryDlg, TQT_SIGNAL(sigQueryChoice(QueryDlgBase::Result)), + this, TQT_SLOT(slotTimeOutProperty(QueryDlgBase::Result))); simpleQueryDlg->initFocus(); simpleQueryDlg->show(); @@ -292,7 +292,7 @@ void kvoctrainApp::slotTimeOutProperty(QueryDlgBase::Result res) } -void kvoctrainApp::slotStartTypeQuery(int col, const QString & type) +void kvoctrainApp::slotStartTypeQuery(int col, const TQString & type) { removeEntryDlg(); slotStatusMsg(i18n("Starting special query...")); @@ -304,7 +304,7 @@ void kvoctrainApp::slotStartTypeQuery(int col, const QString & type) return; prepareProgressBar(); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); random_expr2.clear(); queryList = querymanager.select (doc, act_lesson, act_query_col, type); @@ -321,7 +321,7 @@ void kvoctrainApp::slotStartTypeQuery(int col, const QString & type) } query_num = query_startnum; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); removeProgressBar(); query_cycle = 1; @@ -352,11 +352,11 @@ void kvoctrainApp::slotStartTypeQuery(int col, const QString & type) exp->getConjugation(act_query_col)); verbQueryDlg->initFocus(); - connect( verbQueryDlg, SIGNAL(sigEditEntry(int,int)), - this, SLOT(slotEditEntry(int,int))); + connect( verbQueryDlg, TQT_SIGNAL(sigEditEntry(int,int)), + this, TQT_SLOT(slotEditEntry(int,int))); - connect(verbQueryDlg, SIGNAL(sigQueryChoice(QueryDlgBase::Result)), - this, SLOT(slotTimeOutType(QueryDlgBase::Result))); + connect(verbQueryDlg, TQT_SIGNAL(sigQueryChoice(QueryDlgBase::Result)), + this, TQT_SLOT(slotTimeOutType(QueryDlgBase::Result))); verbQueryDlg->show(); } else if (queryType == QT_Articles) { @@ -370,10 +370,10 @@ void kvoctrainApp::slotStartTypeQuery(int col, const QString & type) doc, doc->getArticle(act_query_col)); artQueryDlg->initFocus(); - connect( artQueryDlg, SIGNAL(sigEditEntry(int,int)), - this, SLOT(slotEditEntry(int,int))); - connect(artQueryDlg, SIGNAL(sigQueryChoice(QueryDlgBase::Result)), - this, SLOT(slotTimeOutType(QueryDlgBase::Result))); + connect( artQueryDlg, TQT_SIGNAL(sigEditEntry(int,int)), + this, TQT_SLOT(slotEditEntry(int,int))); + connect(artQueryDlg, TQT_SIGNAL(sigQueryChoice(QueryDlgBase::Result)), + this, TQT_SLOT(slotTimeOutType(QueryDlgBase::Result))); artQueryDlg->show(); } else if (queryType == QT_Comparison) { @@ -387,11 +387,11 @@ void kvoctrainApp::slotStartTypeQuery(int col, const QString & type) doc, exp->getComparison(act_query_col)); adjQueryDlg->initFocus(); - connect( adjQueryDlg, SIGNAL(sigEditEntry(int,int)), - this, SLOT(slotEditEntry(int,int))); + connect( adjQueryDlg, TQT_SIGNAL(sigEditEntry(int,int)), + this, TQT_SLOT(slotEditEntry(int,int))); - connect(adjQueryDlg, SIGNAL(sigQueryChoice(QueryDlgBase::Result)), - this, SLOT(slotTimeOutType(QueryDlgBase::Result))); + connect(adjQueryDlg, TQT_SIGNAL(sigQueryChoice(QueryDlgBase::Result)), + this, TQT_SLOT(slotTimeOutType(QueryDlgBase::Result))); adjQueryDlg->show(); } else { @@ -558,7 +558,7 @@ void kvoctrainApp::slotRestartQuery() } -void kvoctrainApp::slotStartQuery(const QString & translang, const QString & orglang, bool create_new) +void kvoctrainApp::slotStartQuery(const TQString & translang, const TQString & orglang, bool create_new) { removeEntryDlg(); slotStatusMsg(i18n("Starting random query...")); @@ -580,7 +580,7 @@ void kvoctrainApp::slotStartQuery(const QString & translang, const QString & org act_query_org = orglang; prepareProgressBar(); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); random_expr2.clear(); if (create_new || queryList.size() == 0) @@ -598,7 +598,7 @@ void kvoctrainApp::slotStartQuery(const QString & translang, const QString & org } query_num = query_startnum; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); removeProgressBar(); query_cycle = 1; @@ -617,7 +617,7 @@ void kvoctrainApp::slotStartQuery(const QString & translang, const QString & org random_query_nr = random.getLong(random_expr1.size()); kvoctrainExpr *exp = random_expr1[random_query_nr].exp; - QString q_org, + TQString q_org, q_trans; if (oindex == 0) { // usual: give original, ask for translation x @@ -642,10 +642,10 @@ void kvoctrainApp::slotStartQuery(const QString & translang, const QString & org exp, doc); randomQueryDlg->initFocus(); - connect( randomQueryDlg, SIGNAL(sigEditEntry(int,int)), - this, SLOT(slotEditEntry(int,int))); - connect(randomQueryDlg, SIGNAL(sigQueryChoice(QueryDlgBase::Result)), - this, SLOT(slotTimeOutRandomQuery(QueryDlgBase::Result))); + connect( randomQueryDlg, TQT_SIGNAL(sigEditEntry(int,int)), + this, TQT_SLOT(slotEditEntry(int,int))); + connect(randomQueryDlg, TQT_SIGNAL(sigQueryChoice(QueryDlgBase::Result)), + this, TQT_SLOT(slotTimeOutRandomQuery(QueryDlgBase::Result))); randomQueryDlg->show(); } else if (queryType == QT_Multiple) { @@ -661,10 +661,10 @@ void kvoctrainApp::slotStartQuery(const QString & translang, const QString & org exp, doc); mcQueryDlg->initFocus(); - connect( mcQueryDlg, SIGNAL(sigEditEntry(int,int)), - this, SLOT(slotEditEntry(int,int))); - connect(mcQueryDlg, SIGNAL(sigQueryChoice(QueryDlgBase::Result)), - this, SLOT(slotTimeOutMultipleChoice(QueryDlgBase::Result))); + connect( mcQueryDlg, TQT_SIGNAL(sigEditEntry(int,int)), + this, TQT_SLOT(slotEditEntry(int,int))); + connect(mcQueryDlg, TQT_SIGNAL(sigQueryChoice(QueryDlgBase::Result)), + this, TQT_SLOT(slotTimeOutMultipleChoice(QueryDlgBase::Result))); mcQueryDlg->show(); } else { @@ -929,7 +929,7 @@ void kvoctrainApp::slotTimeOutQuery(QueryDlgBase::Result res) tindex = view->getTable()->findIdent(act_query_trans); oindex = view->getTable()->findIdent(act_query_org); - QString q_org, + TQString q_org, q_trans; if (Prefs::swapDirection()) { diff --git a/kvoctrain/kvoctrain/kvoctrain.cpp b/kvoctrain/kvoctrain/kvoctrain.cpp index 86a306d9..62d2e901 100644 --- a/kvoctrain/kvoctrain/kvoctrain.cpp +++ b/kvoctrain/kvoctrain/kvoctrain.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include @@ -73,7 +73,7 @@ void kvoctrainApp::slotCancelSelection () void kvoctrainApp::slotSelectAll () { - QTableSelection ts; + TQTableSelection ts; KVocTrainTable *table = view->getTable(); table->clearSelection(); ts.init(0,0); @@ -96,13 +96,13 @@ void kvoctrainApp::slotCurrentCellChanged(int row, int col) if (rem_label != 0) rem_label->setText(i18n("Abbreviation for R)emark","R: %1") - .arg(noData ? QString::null : expr->getRemark(col))); + .arg(noData ? TQString::null : expr->getRemark(col))); if (pron_label != 0) pron_label->setText(i18n("Abbreviation for P)ronouncation","P: %1") - .arg(noData ? QString::null : expr->getPronunce(col))); + .arg(noData ? TQString::null : expr->getPronunce(col))); if (type_label != 0) type_label->setText(i18n("Abbreviation for T)ype of word", "T: %1") - .arg(noData ? QString::null : QueryManager::typeStr(expr->getType(col)))); + .arg(noData ? TQString::null : QueryManager::typeStr(expr->getType(col)))); if (entryDlg != 0) { if (noData) @@ -147,7 +147,7 @@ void kvoctrainApp::slotEditCallBack(int res) lesson = QMAX (0, lessons->count()-1); slotChooseLesson(lesson); - QString exp; + TQString exp; exp = doc->getEntry(row)->getTranslation(col+1-KV_COL_ORG); if (exp.isEmpty()) view->getTable()->setCurrentRow(row, col+1); @@ -160,7 +160,7 @@ void kvoctrainApp::slotEditCallBack(int res) case EntryDlg::EditUndo: int row, col; - vector tabsel; + vector tabsel; entryDlg->getCell(row, col, tabsel); setDataEntryDlg(row, col); break; @@ -187,7 +187,7 @@ void kvoctrainApp::commitEntryDlg(bool force) } int row, col; - vector tabsel; + vector tabsel; entryDlg->getCell(row, col, tabsel); int hasSel = tabsel.size() > 1; if (tabsel.size() == 1) @@ -311,7 +311,7 @@ void kvoctrainApp::createEntryDlg(int row, int col) if ((row < 0) || (col < 0) || (view->getTable()->numRows() <= 0)) return; - QString title, text, lang; + TQString title, text, lang; int lesson = doc->getEntry(row)->getLesson(); if (lesson >= lessons->count()) @@ -333,21 +333,21 @@ void kvoctrainApp::createEntryDlg(int row, int col) 0, 0, 0, - QString::null, - QString::null, - QString::null, + TQString::null, + TQString::null, + TQString::null, lesson, lessons, doc->getOriginalIdent(), langset, - QString::null, + TQString::null, doc->getEntry(row)->getType(col), - QString::null, - QString::null, - QString::null, - QString::null, - QString::null, - QString::null, + TQString::null, + TQString::null, + TQString::null, + TQString::null, + TQString::null, + TQString::null, doc->getConjugation(0), Conjugation(), doc->getArticle(0), @@ -410,8 +410,8 @@ void kvoctrainApp::createEntryDlg(int row, int col) doc->getEntry(row)->isActive(), Prefs::iPAFont()); } - connect( entryDlg, SIGNAL(sigEditChoice(int)), - this, SLOT(slotEditCallBack(int))); + connect( entryDlg, TQT_SIGNAL(sigEditChoice(int)), + this, TQT_SLOT(slotEditCallBack(int))); view->getTable()->setReadOnly(true); @@ -420,7 +420,7 @@ void kvoctrainApp::createEntryDlg(int row, int col) else entryDlg->setEnabled(EntryDlg::EnableAll); - vector tabsel; + vector tabsel; entryDlg->setCell(row, col+KV_EXTRA_COLS, tabsel); entryDlg->show(); } @@ -465,7 +465,7 @@ void kvoctrainApp::setDataEntryDlg (int row, int col) if ((row < 0) || (col < 0) || (view->getTable()->numRows() <= 0)) return; - QString text, lang, title; + TQString text, lang, title; kvoctrainExpr *expr = doc->getEntry(row); @@ -492,21 +492,21 @@ void kvoctrainApp::setDataEntryDlg (int row, int col) 0, 0, 0, - QString::null, - QString::null, - QString::null, + TQString::null, + TQString::null, + TQString::null, lesson, lessons, doc->getOriginalIdent(), langset, - QString::null, + TQString::null, doc->getEntry(row)->getType(0), - QString::null, - QString::null, - QString::null, - QString::null, - QString::null, - QString::null, + TQString::null, + TQString::null, + TQString::null, + TQString::null, + TQString::null, + TQString::null, doc->getConjugation(0), Conjugation(), doc->getArticle(0), @@ -567,7 +567,7 @@ void kvoctrainApp::setDataEntryDlg (int row, int col) } view->getTable()->updateCell(row, col); view->getTable()->updateCell(row, KV_COL_LESS); - vector tabsel; + vector tabsel; if (hasSel) { for (int i = 0; i < view->getTable()->numSelections(); ++i) tabsel.push_back(view->getTable()->selection(i)); @@ -597,15 +597,15 @@ void kvoctrainApp::slotDocProps () int res = ddlg.exec(); - if (res == QDialog::Accepted) { + if (res == TQDialog::Accepted) { vector typeIndex; vector tenseIndex; vector usageIndex; vector lessonIndex; - vector new_typeStr; - vector new_tenseStr; - vector new_usageStr; - vector new_lessonStr; + vector new_typeStr; + vector new_tenseStr; + vector new_usageStr; + vector new_lessonStr; vector new_lessoninquery; doc->allowSorting(ddlg.getSorting() ); @@ -616,7 +616,7 @@ void kvoctrainApp::slotDocProps () doc->setDocRemark(ddlg.getDocRemark() ); slotStatusMsg(i18n("Updating lesson indices...")); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); ddlg.getLesson(lessons, lessonIndex); ddlg.getTypeNames(new_typeStr, typeIndex); @@ -653,7 +653,7 @@ void kvoctrainApp::slotDocProps () setCaption(kapp->makeStdCaption(doc->getTitle(), false, doc->isModified())); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); slotStatusMsg(IDS_DEFAULT); } } @@ -664,7 +664,7 @@ void kvoctrainApp::slotDocPropsLang () DocPropsLangDlg ldlg (doc, &langset); int res = ldlg.exec(); - if (res == QDialog::Accepted) { + if (res == TQDialog::Accepted) { for (int i = 0; i < doc->numLangs(); i++) { doc->setArticle(i, ldlg.getArticle(i) ); doc->setConjugation(i, ldlg.getConjugation(i) ); @@ -691,7 +691,7 @@ bool kvoctrainApp::hasSelection() int num = view->getTable()->numSelections(); if (num < 1) return false; if (num > 1) return true; - QTableSelection ts = view->getTable()->selection(0); + TQTableSelection ts = view->getTable()->selection(0); return (ts.bottomRow() - ts.topRow()) > 0; } @@ -746,7 +746,7 @@ void kvoctrainApp::slotAppendRow () } -void kvoctrainApp::keyReleaseEvent( QKeyEvent *e ) +void kvoctrainApp::keyReleaseEvent( TQKeyEvent *e ) { switch( e->key() ) { case Key_Shift: shiftActive = false; @@ -761,7 +761,7 @@ void kvoctrainApp::keyReleaseEvent( QKeyEvent *e ) } -void kvoctrainApp::keyPressEvent( QKeyEvent *e ) +void kvoctrainApp::keyPressEvent( TQKeyEvent *e ) { controlActive = (e->state() & ControlButton) != 0; shiftActive = (e->state() & ShiftButton) != 0; @@ -880,16 +880,16 @@ void kvoctrainApp::slotShowStatist() void kvoctrainApp::slotCleanVocabulary () { prepareProgressBar(); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); int num = doc->cleanUp(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); removeProgressBar(); slotStatusMsg(IDS_DEFAULT); if (num != 0) { view->setView(doc, langset); - QString s = + TQString s = i18n("1 entry with the same content has been found and removed.", "%n entries with the same content have been found and removed.", num); @@ -911,7 +911,7 @@ void kvoctrainApp::slotCreateRandom() Prefs::setEntriesPerLesson(res); slotStatusMsg(i18n("Creating random lessons...")); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); vector randomList; for (int i = 0; i < doc->numEntries(); i++) { @@ -922,7 +922,7 @@ void kvoctrainApp::slotCreateRandom() if (randomList.size () != 0) { int less_no = lessons->count() /* +1 anyway */ ; - QString s; + TQString s; s.setNum (less_no); s.insert (0, "- "); lessons->insertItem (s); @@ -940,14 +940,14 @@ void kvoctrainApp::slotCreateRandom() randomList.erase(randomList.begin() + nr); } - vector new_lessonStr; + vector new_lessonStr; for (int i = 1; i < lessons->count(); i++) new_lessonStr.push_back(lessons->text(i)); doc->setLessonDescr (new_lessonStr); view->getTable()->updateContents(); doc->setModified (); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); slotStatusMsg(IDS_DEFAULT); } @@ -961,7 +961,7 @@ void kvoctrainApp::slotGeneralOptions() void kvoctrainApp::slotGeneralOptionsPage(int index) { KVocTrainPrefs* dialog = new KVocTrainPrefs(langset, doc, lessons, &querymanager, this, "settings", Prefs::self() ); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(slotApplyPreferences())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotApplyPreferences())); if (index >= 0) dialog->selectPage(index); dialog->show(); @@ -980,10 +980,10 @@ void kvoctrainApp::slotApplyPreferences() // update header buttons for (int i = 0; i < (int) doc->numLangs(); i++) { - QString sid = i>0 ? doc->getIdent(i): doc->getOriginalIdent(); + TQString sid = i>0 ? doc->getIdent(i): doc->getOriginalIdent(); int idx = langset.indexShortId(sid); - QString pm = ""; - QString lid = sid; + TQString pm = ""; + TQString lid = sid; if (idx >= 0) { lid = langset.longId(idx); @@ -999,7 +999,7 @@ void kvoctrainApp::slotAppendLang(int header_and_cmd) int lang_id = (header_and_cmd >> 16) & 0xFF; if (lang_id == 0xFF) { - QString msg = i18n("To append a new language which is not listed in " + TQString msg = i18n("To append a new language which is not listed in " "the submenu, you must first add its data in the " "general options dialog.\n" "Should this dialog be invoked now?"); @@ -1040,7 +1040,7 @@ void kvoctrainApp::slotSearchNext() } -void kvoctrainApp::slotResumeSearch(const QString& s) +void kvoctrainApp::slotResumeSearch(const TQString& s) { if (s.length() == 0) { slotInitSearch(); @@ -1048,7 +1048,7 @@ void kvoctrainApp::slotResumeSearch(const QString& s) } slotStatusMsg(i18n("Searching expression...")); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); // new word or shortend word if (s.length() < searchstr.length() ) @@ -1075,12 +1075,12 @@ void kvoctrainApp::slotResumeSearch(const QString& s) } searchstr = s; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); slotStatusMsg(IDS_DEFAULT); } -void kvoctrainApp::slotStatusMsg(const QString &/*text*/) +void kvoctrainApp::slotStatusMsg(const TQString &/*text*/) { // } @@ -1090,7 +1090,7 @@ void kvoctrainApp::aboutToShowLearn() { learn_menu->clear(); - vector set_names; + vector set_names; for (int i = 0; i < (int) langset.size(); i++) { if(langset.longId(i).isEmpty() ) set_names.push_back(langset.shortId(i)); @@ -1098,10 +1098,10 @@ void kvoctrainApp::aboutToShowLearn() set_names.push_back(langset.longId(i)); } - vector main_names; + vector main_names; for (int j = 0; j < (int) doc->numLangs(); j++) { int i; - QString did = j == 0 ? doc->getOriginalIdent() + TQString did = j == 0 ? doc->getOriginalIdent() : doc->getIdent(j); if ((i = langset.indexShortId(did)) >= 0) main_names.push_back(langset.longId(i)); @@ -1112,7 +1112,7 @@ void kvoctrainApp::aboutToShowLearn() for (int header = 0; header < (int) doc->numLangs(); header++) { // show pixmap and long name if available int j; - header_m = new QPopupMenu(); + header_m = new TQPopupMenu(); if (header != 0 ) { header_m->insertItem(SmallIconSet("run_query"), i18n("Create Random &Query"), (header << 16) | IDH_START_QUERY); header_m->insertItem(SmallIconSet("run_multi"), i18n("Create &Multiple Choice"), (header << 16) | IDH_START_MULTIPLE); @@ -1131,8 +1131,8 @@ void kvoctrainApp::aboutToShowLearn() header_m->insertItem(i18n("&Paraphrase"), (header << 16) | IDH_START_PARAPHRASE); } else { - QPopupMenu *query_m = new QPopupMenu(); - QPopupMenu *multiple_m = new QPopupMenu(); + TQPopupMenu *query_m = new TQPopupMenu(); + TQPopupMenu *multiple_m = new TQPopupMenu(); for (int i = 1; i < (int) doc->numLangs(); i++) { // show pixmap and long name if available @@ -1140,7 +1140,7 @@ void kvoctrainApp::aboutToShowLearn() if((j = langset.indexShortId(doc->getIdent(i))) >= 0 && !langset.PixMapFile(j).isEmpty() && !langset.longId(j).isEmpty() ) { - query_m->insertItem(QPixmap(langset.PixMapFile(j)), i18n("From %1").arg(main_names[i]), + query_m->insertItem(TQPixmap(langset.PixMapFile(j)), i18n("From %1").arg(main_names[i]), (i << (16+8)) | IDH_START_QUERY); // hack: IDs => header-ids + cmd } else { @@ -1149,8 +1149,8 @@ void kvoctrainApp::aboutToShowLearn() } header_m->insertItem(SmallIconSet("run_query"), i18n("Create Random &Query"), query_m, (3 << 16) | IDH_NULL); - connect (query_m, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect (query_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (query_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect (query_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); for (int i = 1; i < (int) doc->numLangs(); i++) { // show pixmap and long name if available @@ -1158,7 +1158,7 @@ void kvoctrainApp::aboutToShowLearn() if((j = langset.indexShortId(doc->getIdent(i))) >= 0 && !langset.PixMapFile(j).isEmpty() && !langset.longId(j).isEmpty() ) { - multiple_m->insertItem(QPixmap(langset.PixMapFile(j)), i18n("From %1").arg(main_names[i]), + multiple_m->insertItem(TQPixmap(langset.PixMapFile(j)), i18n("From %1").arg(main_names[i]), (i << (16+8)) | IDH_START_MULTIPLE); // hack: IDs => header-ids + cmd } else { @@ -1177,19 +1177,19 @@ void kvoctrainApp::aboutToShowLearn() header_m->insertItem(i18n("E&xamples"), (header << 16) | IDH_START_EXAMPLE); header_m->insertItem(i18n("&Paraphrase"), (header << 16) | IDH_START_PARAPHRASE); - connect (multiple_m, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect (multiple_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (multiple_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect (multiple_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); } - connect (header_m, SIGNAL(activated(int)), this, SLOT(slotHeaderCallBack(int))); - connect (header_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (header_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHeaderCallBack(int))); + connect (header_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); - QString id = header == 0 ? doc->getOriginalIdent() + TQString id = header == 0 ? doc->getOriginalIdent() : doc->getIdent(header); if((j = langset.indexShortId(id)) >= 0 && !langset.PixMapFile(j).isEmpty() && !langset.longId(j).isEmpty() ) { - learn_menu->insertItem(QPixmap(langset.PixMapFile(j)), main_names[header], header_m, IDH_NULL); + learn_menu->insertItem(TQPixmap(langset.PixMapFile(j)), main_names[header], header_m, IDH_NULL); } else { learn_menu->insertItem(id, header_m, IDH_NULL); @@ -1210,9 +1210,9 @@ void kvoctrainApp::aboutToShowVocabAppendLanguage() if (doc != 0) { vocabAppendLanguage->clear(); - QPopupMenu * add_m = vocabAppendLanguage->popupMenu(); + TQPopupMenu * add_m = vocabAppendLanguage->popupMenu(); - QStringList names; + TQStringList names; for (int i = 0; i < (int) langset.size(); i++) { if(langset.longId(i).isEmpty() ) @@ -1224,7 +1224,7 @@ void kvoctrainApp::aboutToShowVocabAppendLanguage() for (int i = 0; i < (int) langset.size(); i++) { if(!langset.PixMapFile(i).isEmpty() && !langset.longId(i).isEmpty()) - add_m->insertItem(QPixmap(langset.PixMapFile(i)), names[i], (i << 16) | IDH_APPEND); + add_m->insertItem(TQPixmap(langset.PixMapFile(i)), names[i], (i << 16) | IDH_APPEND); else add_m->insertItem(names[i], (i << 16) | IDH_APPEND); } @@ -1239,9 +1239,9 @@ void kvoctrainApp::aboutToShowVocabSetLanguage() if (doc != 0) { vocabSetLanguage->clear(); - QPopupMenu * set_m = vocabSetLanguage->popupMenu(); + TQPopupMenu * set_m = vocabSetLanguage->popupMenu(); - QStringList names; + TQStringList names; for (int i = 0; i < (int) langset.size(); i++) { if(langset.longId(i).isEmpty() ) @@ -1253,18 +1253,18 @@ void kvoctrainApp::aboutToShowVocabSetLanguage() for (int header = 0; header < doc->numLangs(); ++header ) { // select one of the available languages for the column - QPopupMenu *langs_m = new QPopupMenu(); + TQPopupMenu *langs_m = new TQPopupMenu(); // hack: ID => header-id + language for (int i = 0; i < (int) langset.size(); i++) { if(!langset.PixMapFile(i).isEmpty() && !langset.longId(i).isEmpty()) - langs_m->insertItem(QPixmap(langset.PixMapFile(i)), names[i], (header << 16) | (i << (16+8)) | IDH_SET_LANG); + langs_m->insertItem(TQPixmap(langset.PixMapFile(i)), names[i], (header << 16) | (i << (16+8)) | IDH_SET_LANG); else langs_m->insertItem(names[i], (header << 16) | (i << (16+8)) | IDH_SET_LANG); } - connect (langs_m, SIGNAL(activated(int)), this, SLOT(slotSetHeaderProp(int))); - connect (langs_m, SIGNAL(highlighted(int)), this, SLOT(slotHeaderStatus(int))); + connect (langs_m, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetHeaderProp(int))); + connect (langs_m, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotHeaderStatus(int))); if (header == 0) set_m->insertItem(i18n("&Original"), langs_m, (2 << 16) | IDH_NULL); @@ -1284,9 +1284,9 @@ void kvoctrainApp::aboutToShowVocabRemoveLanguage() if (doc != 0) { vocabRemoveLanguage->clear(); - QPopupMenu * remove_m = vocabRemoveLanguage->popupMenu(); + TQPopupMenu * remove_m = vocabRemoveLanguage->popupMenu(); - QStringList names; + TQStringList names; for (int j = 1; j < (int) doc->numLangs(); j++) { int i; @@ -1303,7 +1303,7 @@ void kvoctrainApp::aboutToShowVocabRemoveLanguage() if((j = langset.indexShortId(doc->getIdent(i))) >= 0 && !langset.PixMapFile(j).isEmpty() && !langset.longId(j).isEmpty() ) - remove_m->insertItem(QPixmap(langset.PixMapFile(j)), names[i-1], (i << 16) | IDH_REMOVE); // hack: IDs => header-ids + cmd + remove_m->insertItem(TQPixmap(langset.PixMapFile(j)), names[i-1], (i << 16) | IDH_REMOVE); // hack: IDs => header-ids + cmd else remove_m->insertItem(doc->getIdent(i), (i << 16) | IDH_REMOVE); } @@ -1311,7 +1311,7 @@ void kvoctrainApp::aboutToShowVocabRemoveLanguage() } -void kvoctrainApp::slotStatusHelpMsg(const QString &text) +void kvoctrainApp::slotStatusHelpMsg(const TQString &text) { /////////////////////////////////////////////////////////////////// // change status message of whole statusbar temporary (text, msec) diff --git a/kvoctrain/kvoctrain/kvoctrain.h b/kvoctrain/kvoctrain/kvoctrain.h index ff81c414..73551066 100644 --- a/kvoctrain/kvoctrain/kvoctrain.h +++ b/kvoctrain/kvoctrain/kvoctrain.h @@ -32,7 +32,7 @@ #endif // include files for QT -#include +#include // include files for KDE #include @@ -79,7 +79,7 @@ class kvoctrainApp : public KMainWindow public: /** construtor */ - kvoctrainApp(QWidget *parent = NULL, const char *name = NULL); + kvoctrainApp(TQWidget *parent = NULL, const char *name = NULL); /** destructor */ ~kvoctrainApp(); void initActions(); @@ -116,8 +116,8 @@ public: void progressChanged (kvoctrainDoc *, int curr_percent); public slots: - void keyPressEvent( QKeyEvent *e ); - void keyReleaseEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); + void keyReleaseEvent( TQKeyEvent *e ); void slotModifiedDoc(bool mod); void slotCurrentCellChanged(int row, int col); // void slotSelectEntry (int row, int col, int key_state); @@ -136,7 +136,7 @@ public: void slotCancelSelection (); void slotSelectAll(); void slotProgress(kvoctrainDoc*,int); - void slotResumeSearch(const QString&); + void slotResumeSearch(const TQString&); void slotSearchNext(); void slotInitSearch(); void slotCreateLesson(int header); @@ -172,9 +172,9 @@ public: /** starts random query mode */ void slotRestartQuery(); - void slotStartTypeQuery(int col, const QString & type); + void slotStartTypeQuery(int col, const TQString & type); void slotStartPropertyQuery(int col, QueryType property); - void slotStartQuery(const QString & trans, const QString & org, bool create_new); + void slotStartQuery(const TQString & trans, const TQString & org, bool create_new); void slotTimeOutRandomQuery(QueryDlgBase::Result res); void slotTimeOutMultipleChoice(QueryDlgBase::Result res); @@ -215,9 +215,9 @@ public: void slotEditPaste(); /** change the status message to text */ - void slotStatusMsg(const QString &text); + void slotStatusMsg(const TQString &text); /** change the status message of the whole statusbar temporary */ - void slotStatusHelpMsg(const QString &text); + void slotStatusHelpMsg(const TQString &text); public: void removeProgressBar(); @@ -269,9 +269,9 @@ private: KAction* configApp; //KAction* configQueryOptions; - QString lastPixName; + TQString lastPixName; - QPopupMenu *learn_menu; + TQPopupMenu *learn_menu; /** view is the main widget which represents your working area. The View * class should handle all events of the view widget. It is kept empty so @@ -291,18 +291,18 @@ private: vector correct_1_times, correct_2_times, correct_3_times; QuerySelection queryList; //KNewStuff *m_GHNS; - QTimer *btimer; + TQTimer *btimer; int random_query_nr; bool querymode; bool querying; - QString def_lang; - QPopupMenu *header_m; + TQString def_lang; + TQPopupMenu *header_m; int act_query_col; - QString act_query_trans; - QString act_query_org; + TQString act_query_trans; + TQString act_query_org; LangSet langset; int searchpos; - QString searchstr; + TQString searchstr; KLineEdit *searchLine; KComboBox *lessons; int act_lesson; @@ -312,10 +312,10 @@ private: bool altActive; ProgressDlg *pdlg; KProgress *pbar; - QLabel *vslide_label; - QLabel *pron_label; - QLabel *rem_label; - QLabel *type_label; + TQLabel *vslide_label; + TQLabel *pron_label; + TQLabel *rem_label; + TQLabel *type_label; SimpleQueryDlg *simpleQueryDlg; EntryDlg *entryDlg; MCQueryDlg *mcQueryDlg; diff --git a/kvoctrain/kvoctrain/kvoctraintable.cpp b/kvoctrain/kvoctrain/kvoctraintable.cpp index 98e64c13..7dc54b45 100644 --- a/kvoctrain/kvoctrain/kvoctraintable.cpp +++ b/kvoctrain/kvoctrain/kvoctraintable.cpp @@ -23,8 +23,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -39,8 +39,8 @@ #include "kv_resource.h" #include "prefs.h" -KVocTrainTable::KVocTrainTable(kvoctrainDoc *doc, const LangSet *ls, QWidget *parent, const char *name) - : QTable(parent, name), langs(ls) +KVocTrainTable::KVocTrainTable(kvoctrainDoc *doc, const LangSet *ls, TQWidget *parent, const char *name) + : TQTable(parent, name), langs(ls) { m_doc = doc; defaultItem = 0; @@ -57,17 +57,17 @@ KVocTrainTable::KVocTrainTable(kvoctrainDoc *doc, const LangSet *ls, QWidget *pa triggerSect = -1; - m_pixInQuery = QPixmap(KGlobal::iconLoader()->loadIcon("ok", KIcon::Small)); - m_pixInactive = QPixmap(KGlobal::iconLoader()->loadIcon("no", KIcon::Small)); + m_pixInQuery = TQPixmap(KGlobal::iconLoader()->loadIcon("ok", KIcon::Small)); + m_pixInactive = TQPixmap(KGlobal::iconLoader()->loadIcon("no", KIcon::Small)); - delayTimer = new QTimer(this); - connect(delayTimer, SIGNAL(timeout()), this, SLOT(menuTriggerTimeout())); + delayTimer = new TQTimer(this); + connect(delayTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(menuTriggerTimeout())); - QHeader *header = horizontalHeader(); - connect(header, SIGNAL(pressed(int)), this, SLOT(headerPressEvent(int))); - connect(header, SIGNAL(released(int)), this, SLOT(headerReleaseEvent(int))); + TQHeader *header = horizontalHeader(); + connect(header, TQT_SIGNAL(pressed(int)), this, TQT_SLOT(headerPressEvent(int))); + connect(header, TQT_SIGNAL(released(int)), this, TQT_SLOT(headerReleaseEvent(int))); - connect(this, SIGNAL(currentChanged(int, int)), this, SLOT(slotCurrentChanged(int, int))); + connect(this, TQT_SIGNAL(currentChanged(int, int)), this, TQT_SLOT(slotCurrentChanged(int, int))); } @@ -76,26 +76,26 @@ void KVocTrainTable::setCurrentItem(int row) setCurrentRow(row, currentColumn()); } /* -QWidget* KVocTrainTable::beginEdit(int row, int col, bool replace) +TQWidget* KVocTrainTable::beginEdit(int row, int col, bool replace) { if (KApplication::dcopClient()->isApplicationRegistered("kxkb")) { if (m_doc) { - QString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); + TQString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); if (langs) { - QString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); + TQString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); kdDebug() << "Keyboard Layout: " << kbLayout << endl; if (!kbLayout.isEmpty()) { - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << kbLayout; - if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(QString)", data, replyType, replyData)) + if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(TQString)", data, replyType, replyData)) { kdDebug() << "kxkb dcop error: beginEdit()" << endl; } @@ -103,12 +103,12 @@ QWidget* KVocTrainTable::beginEdit(int row, int col, bool replace) } } } - return QTable::beginEdit(row, col, replace); + return TQTable::beginEdit(row, col, replace); } void KVocTrainTable::endEdit(int row, int col, bool accept, bool replace) { - QTable::endEdit(row, col, accept, replace); + TQTable::endEdit(row, col, accept, replace); } */ void KVocTrainTable::sortByColumn(int header, bool alpha) { @@ -126,7 +126,7 @@ void KVocTrainTable::sortByColumn(int header, bool alpha) { return; } - QApplication::setOverrideCursor(waitCursor); + TQApplication::setOverrideCursor(waitCursor); clearSelection(); @@ -144,7 +144,7 @@ void KVocTrainTable::sortByColumn(int header, bool alpha) { repaintContents(); m_doc->setModified(); emit currentChanged(currentRow(), currentColumn()); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void KVocTrainTable::sortByColumn_alpha(int header) @@ -166,7 +166,7 @@ void KVocTrainTable::sortByColumn_index(int header) void KVocTrainTable::setCurrentRow(int row, int col) { - QTable::setCurrentCell(row, col); + TQTable::setCurrentCell(row, col); } void KVocTrainTable::updateContents(int row, int col) @@ -236,7 +236,7 @@ void KVocTrainTable::setDoc(kvoctrainDoc * rows) } if (d == 0) { - defaultItem = new KVocTrainTableItem(this, QTableItem::OnTyping, rows); + defaultItem = new KVocTrainTableItem(this, TQTableItem::OnTyping, rows); } else { defaultItem = d; @@ -254,17 +254,17 @@ void KVocTrainTable::menuTriggerTimeout() int mt = triggerSect; triggerSect = -1; - QHeader *header = horizontalHeader(); + TQHeader *header = horizontalHeader(); int x = leftMargin(); for (int i = 0; i < mt; ++i) x += header->sectionSize(i); - QPoint mpos = mapToGlobal(QPoint(x, topMargin())); + TQPoint mpos = mapToGlobal(TQPoint(x, topMargin())); if (mt != KV_COL_MARK) emit rightButtonClicked(mt, mpos.x(), mpos.y()); - QMouseEvent me(QEvent::MouseButtonRelease, QPoint(0, 0), QMouseEvent::LeftButton, QMouseEvent::LeftButton); - QApplication::sendEvent(header, &me); + TQMouseEvent me(TQEvent::MouseButtonRelease, TQPoint(0, 0), TQMouseEvent::LeftButton, TQMouseEvent::LeftButton); + TQApplication::sendEvent(header, &me); } void KVocTrainTable::headerReleaseEvent(int /*sec*/) @@ -285,15 +285,15 @@ void KVocTrainTable::headerPressEvent(int sec) delayTimer->start(500, true); } -void KVocTrainTable::setFont(const QFont & font) +void KVocTrainTable::setFont(const TQFont & font) { - QTable::setFont(font); + TQTable::setFont(font); horizontalHeader()->setFont(KGlobalSettings::generalFont()); for (unsigned i = 0; i < (unsigned) numRows(); ++i) setRowHeight(i, fontMetrics().lineSpacing()); } -int cellAlignment(const QString & text) +int cellAlignment(const TQString & text) { bool num; bool ok1 = false; @@ -307,7 +307,7 @@ int cellAlignment(const QString & text) } -void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup &cg) +void KVocTrainTable::paintCell(TQPainter * p, int row, int col, const TQRect & cr, bool selected, const TQColorGroup &cg) { if (cr.width() == 0 || cr.height() == 0) return; @@ -320,7 +320,7 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, int x2 = w - 1; int y2 = h - 1; - p->fillRect( 0, 0, w, h, selected ? cg.brush( QColorGroup::Highlight ) : cg.brush( QColorGroup::Base ) ); + p->fillRect( 0, 0, w, h, selected ? cg.brush( TQColorGroup::Highlight ) : cg.brush( TQColorGroup::Base ) ); kvoctrainExpr *expr = getRow(row); if (expr) @@ -328,7 +328,7 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, p->save(); //cell->paint(p, col, w, selected, m_doc, numCols() == KV_EXTRA_COLS+2 ? KV_COL_TRANS : currentColumn(), gradecols); - QColor color = KV_NORM_COLOR; + TQColor color = KV_NORM_COLOR; int current_col = numCols() == KV_EXTRA_COLS+2 ? KV_COL_TRANS : currentColumn(); if (Prefs::useGradeCol()) @@ -386,7 +386,7 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, { case KV_COL_LESS: // lesson { - QString less_str; + TQString less_str; if (m_doc != 0 && expr->getLesson() != 0) less_str = m_doc->getLessonDescr(expr->getLesson()); p->drawText( 3, fontpos, w, p->fontMetrics().lineSpacing(), Qt::AlignLeft, less_str); @@ -410,23 +410,23 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, case KV_COL_ORG: // original { - QString s = expr->getOriginal(); + TQString s = expr->getOriginal(); p->drawText(3, fontpos, w - 6, p->fontMetrics().lineSpacing(), cellAlignment(s), s); } break; default: // translation x - QString s = expr->getTranslation(col - KV_COL_ORG); + TQString s = expr->getTranslation(col - KV_COL_ORG); p->drawText(3, fontpos, w - 6, p->fontMetrics().lineSpacing(), cellAlignment(s), s); break; } p->restore(); } - QPen pen( p->pen() ); - int gridColor = style().styleHint( QStyle::SH_Table_GridLineColor, this ); + TQPen pen( p->pen() ); + int gridColor = style().styleHint( TQStyle::SH_Table_GridLineColor, this ); if (gridColor != -1) { - const QPalette &pal = palette(); + const TQPalette &pal = palette(); if (cg != colorGroup() && cg != pal.disabled() && cg != pal.inactive()) @@ -441,20 +441,20 @@ void KVocTrainTable::paintCell(QPainter * p, int row, int col, const QRect & cr, p->setPen( pen ); } -void KVocTrainTable::setItem(int row, int col, QTableItem * /*item*/) +void KVocTrainTable::setItem(int row, int col, TQTableItem * /*item*/) { // ignore item! updateContents(row, col); } -QTableItem * KVocTrainTable::item(int row, int col) const +TQTableItem * KVocTrainTable::item(int row, int col) const { if (defaultItem) defaultItem->setPosition(row, col); return defaultItem; } -void KVocTrainTable::keyPressEvent(QKeyEvent * e) +void KVocTrainTable::keyPressEvent(TQKeyEvent * e) { delayTimer->stop(); switch(e->key()) @@ -470,11 +470,11 @@ void KVocTrainTable::keyPressEvent(QKeyEvent * e) case Key_Down: case Key_Next: case Key_Prior: - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); break; case Key_Left: { - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); int topCell = rowAt(0); int lastRowVisible = QMIN(numRows(), rowAt(contentsHeight())); if (numCols() > 2) @@ -486,7 +486,7 @@ void KVocTrainTable::keyPressEvent(QKeyEvent * e) case Key_Shift: case Key_Alt: case Key_Control: // fallthrough - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); emit forwardKeyPressEvent(e); break; @@ -498,12 +498,12 @@ void KVocTrainTable::keyPressEvent(QKeyEvent * e) break; default: - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); break; } } -void KVocTrainTable::keyReleaseEvent(QKeyEvent * e) +void KVocTrainTable::keyReleaseEvent(TQKeyEvent * e) { delayTimer->stop(); switch(e->key()) @@ -511,20 +511,20 @@ void KVocTrainTable::keyReleaseEvent(QKeyEvent * e) case Key_Shift: case Key_Alt: case Key_Control: // fallthrough - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); emit forwardKeyReleaseEvent(e); break; } } -void KVocTrainTable::contentsMousePressEvent(QMouseEvent * e) +void KVocTrainTable::contentsMousePressEvent(TQMouseEvent * e) { delayTimer->stop(); int cc = columnAt(e->x()); int cr = rowAt(e->y()); int co = currentColumn(); - QTable::contentsMousePressEvent(e); + TQTable::contentsMousePressEvent(e); if(cc >= KV_EXTRA_COLS) { // update color of original when column changes and more than 1 translation @@ -542,10 +542,10 @@ void KVocTrainTable::contentsMousePressEvent(QMouseEvent * e) setCurrentCell(cr, cc); } -void KVocTrainTable::contentsMouseDoubleClickEvent(QMouseEvent * e) +void KVocTrainTable::contentsMouseDoubleClickEvent(TQMouseEvent * e) { delayTimer->stop(); - QTable::contentsMouseDoubleClickEvent(e); + TQTable::contentsMouseDoubleClickEvent(e); } void KVocTrainTable::activateNextCell() @@ -553,7 +553,7 @@ void KVocTrainTable::activateNextCell() int currRow = currentRow(); int currCol = currentColumn(); - QTableSelection currentSel = selection(0); + TQTableSelection currentSel = selection(0); int tr = currentSel.topRow(); int br = currentSel.bottomRow(); @@ -579,20 +579,20 @@ void KVocTrainTable::slotCurrentChanged(int row, int col) { if (m_doc) { - QString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); + TQString id = (col == KV_COL_ORG) ? m_doc->getOriginalIdent() : m_doc->getIdent(col - KV_EXTRA_COLS); if (langs) { - QString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); + TQString kbLayout(langs->keyboardLayout(langs->indexShortId(id))); //kdDebug() << "Keyboard Layout: " << kbLayout << endl; if (!kbLayout.isEmpty()) { - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << kbLayout; - if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(QString)", data, replyType, replyData)) + if (!KApplication::dcopClient()->call("kxkb", "kxkb", "setLayout(TQString)", data, replyType, replyData)) { kdDebug() << "kxkb dcop error: beginEdit()" << endl; } diff --git a/kvoctrain/kvoctrain/kvoctraintable.h b/kvoctrain/kvoctrain/kvoctraintable.h index f42e0140..77fffa77 100644 --- a/kvoctrain/kvoctrain/kvoctraintable.h +++ b/kvoctrain/kvoctrain/kvoctraintable.h @@ -26,8 +26,8 @@ #ifndef KVOCTRAINTABLE_H #define KVOCTRAINTABLE_H -#include -#include +#include +#include #include "kvt-core/kvoctraindoc.h" #include "kvt-core/kvoctrainexpr.h" @@ -42,7 +42,7 @@ class KVocTrainTable : public QTable Q_OBJECT public: public: - KVocTrainTable( kvoctrainDoc *_doc, const LangSet *ls, QWidget *parent = NULL, const char *name = NULL ); + KVocTrainTable( kvoctrainDoc *_doc, const LangSet *ls, TQWidget *parent = NULL, const char *name = NULL ); friend class kvoctrainView; @@ -51,20 +51,20 @@ public: int count() { return numRows(); } void setModified(bool _dirty = true) { m_doc->setModified(_dirty); } - QString getIdent(int i) const { return m_doc->getIdent(i); } - QString getOriginalIdent() const { return m_doc->getOriginalIdent(); } - int findIdent(QString id) const { return m_doc->findIdent(id); } + TQString getIdent(int i) const { return m_doc->getIdent(i); } + TQString getOriginalIdent() const { return m_doc->getOriginalIdent(); } + int findIdent(TQString id) const { return m_doc->findIdent(id); } void setCurrentRow(int row, int col); void updateContents(int row = -1, int col = -1); kvoctrainExpr *getRow(int row); void setDoc(kvoctrainDoc *rows); - void setFont(const QFont &); + void setFont(const TQFont &); signals: void selected(int row); void rightButtonClicked(int header, int x, int y); - void forwardKeyPressEvent(QKeyEvent *); - void forwardKeyReleaseEvent(QKeyEvent *); + void forwardKeyPressEvent(TQKeyEvent *); + void forwardKeyReleaseEvent(TQKeyEvent *); void edited(int, int); public slots: @@ -80,15 +80,15 @@ public: protected: int current; - //QWidget* beginEdit(int row, int col, bool replace); + //TQWidget* beginEdit(int row, int col, bool replace); //void endEdit(int row, int col, bool accept, bool replace); - void paintCell(QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg); - void setItem(int row, int col, QTableItem * item); - QTableItem* item (int row, int col) const; - void keyPressEvent(QKeyEvent *e); - void keyReleaseEvent(QKeyEvent *e); - void contentsMousePressEvent(QMouseEvent *e); - void contentsMouseDoubleClickEvent(QMouseEvent *e); + void paintCell(TQPainter *p, int row, int col, const TQRect &cr, bool selected, const TQColorGroup &cg); + void setItem(int row, int col, TQTableItem * item); + TQTableItem* item (int row, int col) const; + void keyPressEvent(TQKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); + void contentsMousePressEvent(TQMouseEvent *e); + void contentsMouseDoubleClickEvent(TQMouseEvent *e); void activateNextCell(); private: @@ -97,10 +97,10 @@ public: const LangSet* langs; //const GradeCols *gradecols; KVocTrainTableItem *defaultItem; - QTimer *delayTimer; + TQTimer *delayTimer; int triggerSect; - QPixmap m_pixInactive; - QPixmap m_pixInQuery; + TQPixmap m_pixInactive; + TQPixmap m_pixInQuery; }; #endif diff --git a/kvoctrain/kvoctrain/kvoctraintableitem.cpp b/kvoctrain/kvoctrain/kvoctraintableitem.cpp index 9972cd6d..f4aefca8 100644 --- a/kvoctrain/kvoctrain/kvoctraintableitem.cpp +++ b/kvoctrain/kvoctrain/kvoctraintableitem.cpp @@ -23,8 +23,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -32,8 +32,8 @@ #include "kvoctraintableitem.h" -KVocTrainTableItem::KVocTrainTableItem( QTable *t, EditType et, kvoctrainDoc *doc) - : QTableItem( t, et, QString::null ) +KVocTrainTableItem::KVocTrainTableItem( TQTable *t, EditType et, kvoctrainDoc *doc) + : TQTableItem( t, et, TQString::null ) { m_doc = doc; // we do not want that this item can be replaced @@ -54,12 +54,12 @@ void KVocTrainTableItem::setDoc(kvoctrainDoc *doc) } -QWidget *KVocTrainTableItem::createEditor() const +TQWidget *KVocTrainTableItem::createEditor() const { if (m_doc != 0 && m_doc->numEntries() != 0 && row() >= 0 && col() >= 0) { switch (col()) { case KV_COL_LESS: { - QComboBox *lessonbox = new QComboBox(table()->viewport() ); + TQComboBox *lessonbox = new TQComboBox(table()->viewport() ); lessonbox->setFont(KGlobalSettings::generalFont()); lessonbox->insertItem (m_doc->getLessonDescr(0)); for (unsigned i = 1; i <= (unsigned) m_doc->numLessons(); ++i) @@ -70,12 +70,12 @@ QWidget *KVocTrainTableItem::createEditor() const break; case KV_COL_MARK: { - QComboBox *statebox = new QComboBox(table()->viewport() ); + TQComboBox *statebox = new TQComboBox(table()->viewport() ); statebox->setFont(KGlobalSettings::generalFont()); statebox->insertItem (i18n("state of a row", "Active, Not in Query")); statebox->insertItem (i18n("state of a row", "In Query")); statebox->insertItem (i18n("state of a row", "Inactive")); - QSize sz = statebox->sizeHint(); + TQSize sz = statebox->sizeHint(); sz.setHeight(table()->rowHeight(row())); statebox->setMinimumSize(sz); if (!m_doc->getEntry(row())->isActive() ) @@ -89,7 +89,7 @@ QWidget *KVocTrainTableItem::createEditor() const break; default: { - QLineEdit *edit = new QLineEdit(table()->viewport() ); + TQLineEdit *edit = new TQLineEdit(table()->viewport() ); edit->setFrame(false); if (col() == KV_COL_ORG) edit->setText(m_doc->getEntry(row())->getOriginal()); @@ -103,12 +103,12 @@ QWidget *KVocTrainTableItem::createEditor() const } -void KVocTrainTableItem::setContentFromEditor( QWidget *w ) +void KVocTrainTableItem::setContentFromEditor( TQWidget *w ) { if (m_doc != 0) { - if ( w->inherits( "QComboBox" ) ) { + if ( w->inherits( "TQComboBox" ) ) { if (col() == KV_COL_MARK) { - QComboBox *statebox = (QComboBox*) w; + TQComboBox *statebox = (TQComboBox*) w; kvoctrainExpr *expr = m_doc->getEntry(row()); bool inq = false; bool act = true; @@ -131,14 +131,14 @@ void KVocTrainTableItem::setContentFromEditor( QWidget *w ) expr->setActive(act); } else if (col() == KV_COL_LESS) { - QComboBox *lessonbox = (QComboBox*) w; + TQComboBox *lessonbox = (TQComboBox*) w; if (m_doc->getEntry(row())->getLesson() != lessonbox->currentItem()) m_doc->setModified(); m_doc->getEntry(row())->setLesson(lessonbox->currentItem()); } } else { - QLineEdit *edit = (QLineEdit*) w; + TQLineEdit *edit = (TQLineEdit*) w; if (col() == KV_COL_ORG) { if (m_doc->getEntry(row())->getOriginal() != edit->text()) m_doc->setModified(); diff --git a/kvoctrain/kvoctrain/kvoctraintableitem.h b/kvoctrain/kvoctrain/kvoctraintableitem.h index fc347e43..aa3b7cdd 100644 --- a/kvoctrain/kvoctrain/kvoctraintableitem.h +++ b/kvoctrain/kvoctrain/kvoctraintableitem.h @@ -26,7 +26,7 @@ #ifndef KVOCTRAINTABLEITEM_H #define KVOCTRAINTABLEITEM_H -#include +#include #include "kvoctraindoc.h" #include "kv_resource.h" @@ -37,9 +37,9 @@ class KVocTrainTableItem : public QTableItem { public: - KVocTrainTableItem( QTable *t, EditType et, kvoctrainDoc *doc ); - QWidget *createEditor() const; - void setContentFromEditor( QWidget *w ); + KVocTrainTableItem( TQTable *t, EditType et, kvoctrainDoc *doc ); + TQWidget *createEditor() const; + void setContentFromEditor( TQWidget *w ); void setPosition(int row, int col); void setDoc(kvoctrainDoc *doc); diff --git a/kvoctrain/kvoctrain/kvoctrainview.cpp b/kvoctrain/kvoctrain/kvoctrainview.cpp index e4ccc163..ebad99ee 100644 --- a/kvoctrain/kvoctrain/kvoctrainview.cpp +++ b/kvoctrain/kvoctrain/kvoctrainview.cpp @@ -38,16 +38,16 @@ #include #include -#include -#include -#include +#include +#include +#include #include #define HEADER_MINSIZE 24 #define KV_COLWIDTH_MARK 20 -kvoctrainView::kvoctrainView(kvoctrainDoc* doc, const LangSet &ls, kvoctrainApp *_parent) : QWidget(_parent) +kvoctrainView::kvoctrainView(kvoctrainDoc* doc, const LangSet &ls, kvoctrainApp *_parent) : TQWidget(_parent) { m_doc = doc; parent = _parent; @@ -59,15 +59,15 @@ kvoctrainView::kvoctrainView(kvoctrainDoc* doc, const LangSet &ls, kvoctrainApp if (m_doc->numLangs() == 0) m_doc->appendLang(i18n("Original")); - connect(m_table, SIGNAL(selected(int)), m_table, SLOT(sortByColumn_alpha(int))); - connect(m_table, SIGNAL(rightButtonClicked(int, int, int)), parent, SLOT(slotHeaderMenu(int, int, int))); - connect(m_table, SIGNAL(edited(int, int)), parent, SLOT(slotEditEntry(int, int))); - connect(m_table, SIGNAL(currentChanged(int, int)), parent, SLOT(slotCurrentCellChanged(int, int))); - connect(m_table, SIGNAL(selectionChanged()), m_table, SLOT(slotSelectionChanged())); - connect(m_table, SIGNAL(forwardKeyPressEvent(QKeyEvent*)), parent, SLOT(keyPressEvent(QKeyEvent *))); - connect(m_table, SIGNAL(forwardKeyReleaseEvent(QKeyEvent*)), parent, SLOT(keyReleaseEvent(QKeyEvent *))); + connect(m_table, TQT_SIGNAL(selected(int)), m_table, TQT_SLOT(sortByColumn_alpha(int))); + connect(m_table, TQT_SIGNAL(rightButtonClicked(int, int, int)), parent, TQT_SLOT(slotHeaderMenu(int, int, int))); + connect(m_table, TQT_SIGNAL(edited(int, int)), parent, TQT_SLOT(slotEditEntry(int, int))); + connect(m_table, TQT_SIGNAL(currentChanged(int, int)), parent, TQT_SLOT(slotCurrentCellChanged(int, int))); + connect(m_table, TQT_SIGNAL(selectionChanged()), m_table, TQT_SLOT(slotSelectionChanged())); + connect(m_table, TQT_SIGNAL(forwardKeyPressEvent(TQKeyEvent*)), parent, TQT_SLOT(keyPressEvent(TQKeyEvent *))); + connect(m_table, TQT_SIGNAL(forwardKeyReleaseEvent(TQKeyEvent*)), parent, TQT_SLOT(keyReleaseEvent(TQKeyEvent *))); - list_layout = new QGridLayout( this, 2, 1/*, 4 */); + list_layout = new TQGridLayout( this, 2, 1/*, 4 */); list_layout->addWidget(m_table, 1, 0); list_layout->setRowStretch(1, 1); list_layout->activate(); @@ -76,29 +76,29 @@ kvoctrainView::kvoctrainView(kvoctrainDoc* doc, const LangSet &ls, kvoctrainApp } -void kvoctrainView::showEvent (QShowEvent * s_ev) +void kvoctrainView::showEvent (TQShowEvent * s_ev) { - QWidget::showEvent(s_ev); - QResizeEvent r_ev(size(), size()); + TQWidget::showEvent(s_ev); + TQResizeEvent r_ev(size(), size()); resizeEvent(&r_ev); } void kvoctrainView::adjustContent() { - QResizeEvent r_ev(size(), size()); + TQResizeEvent r_ev(size(), size()); resizeEvent (&r_ev); } -void kvoctrainView::resizeEvent (QResizeEvent *r_ev) +void kvoctrainView::resizeEvent (TQResizeEvent *r_ev) { - QWidget::resizeEvent(r_ev); + TQWidget::resizeEvent(r_ev); if (r_ev == 0) return; - QHeader *header = m_table->horizontalHeader(); + TQHeader *header = m_table->horizontalHeader(); unsigned oldwidth = 0; for (int i = 0; i < m_table->numCols(); ++i) oldwidth += header->sectionSize(i); @@ -176,8 +176,8 @@ void kvoctrainView::setView(kvoctrainDoc *doc, const LangSet& ls) if (m_doc) { int id = ls.indexShortId (m_doc->getOriginalIdent()); - setHeaderProp(KV_COL_LESS, i18n("Lesson"), QString::null); - setHeaderProp(KV_COL_MARK, "", QString::null); + setHeaderProp(KV_COL_LESS, i18n("Lesson"), TQString::null); + setHeaderProp(KV_COL_MARK, "", TQString::null); m_table->setColumnWidth(KV_COL_MARK, KV_COLWIDTH_MARK); if (id < 0) @@ -207,9 +207,9 @@ kvoctrainView::~kvoctrainView() } -void kvoctrainView::setHeaderProp (int id, const QString &name, const QString &pixfile) +void kvoctrainView::setHeaderProp (int id, const TQString &name, const TQString &pixfile) { - QHeader *header = m_table->horizontalHeader(); + TQHeader *header = m_table->horizontalHeader(); if (pixfile.isEmpty()) { @@ -217,8 +217,8 @@ void kvoctrainView::setHeaderProp (int id, const QString &name, const QString &p } else { - QPixmap pix; - if (QFile::exists(pixfile)) + TQPixmap pix; + if (TQFile::exists(pixfile)) pix.load(pixfile); else { @@ -227,11 +227,11 @@ void kvoctrainView::setHeaderProp (int id, const QString &name, const QString &p pix.resize(21, 14); pix.fill(Qt::white); - QPainter p(&pix); + TQPainter p(&pix); - QFont font("sans"); + TQFont font("sans"); font.setPixelSize(10); - font.setWeight(QFont::Bold); + font.setWeight(TQFont::Bold); p.setFont(font); p.setPen(Qt::red); p.drawText(2, 1, pix.width(), pix.height()-2, Qt::AlignCenter, "err"); @@ -242,8 +242,8 @@ void kvoctrainView::setHeaderProp (int id, const QString &name, const QString &p int w = pix.width(); int h = pix.height(); - QPixmap arrow(w + 14, h); - QBitmap mask(arrow.width(), arrow.height()); + TQPixmap arrow(w + 14, h); + TQBitmap mask(arrow.width(), arrow.height()); arrow.fill(Qt::white); mask.fill(Qt::black); @@ -251,22 +251,22 @@ void kvoctrainView::setHeaderProp (int id, const QString &name, const QString &p if (pix.mask() != 0) bitBlt(&mask, 0, 0, pix.mask(), 0, 0); else { - QBitmap bmp(pix.createHeuristicMask()); + TQBitmap bmp(pix.createHeuristicMask()); bitBlt(&mask, 0, 0, &bmp, 0, 0); } - QPainter p, pm; + TQPainter p, pm; p.begin(&arrow); pm.begin(&mask); - p.setPen(QColor(0, 0, 0)); + p.setPen(TQColor(0, 0, 0)); p.drawLine(w + 5, h - 2, w + 5 + 1, h - 2); p.drawLine(w + 4, h - 3, w + 6 + 1, h - 3); p.drawLine(w + 3, h - 4, w + 7 + 1, h - 4); p.drawLine(w + 2, h - 5, w + 8 + 1, h - 5); p.drawLine(w + 2, h - 6, w + 8 + 1, h - 6); - pm.setPen(QColor(255, 255, 255)); + pm.setPen(TQColor(255, 255, 255)); pm.drawLine(w + 5, h - 2, w + 5 + 1, h - 2); pm.drawLine(w + 4, h - 3, w + 6 + 1, h - 3); pm.drawLine(w + 3, h - 4, w + 7 + 1, h - 4); @@ -277,14 +277,14 @@ void kvoctrainView::setHeaderProp (int id, const QString &name, const QString &p p.end(); arrow.setMask(mask); - QIconSet set(arrow, QIconSet::Small); + TQIconSet set(arrow, TQIconSet::Small); header->setLabel(id, set, name); } } void kvoctrainView::print(KPrinter * pPrinter) { - QPainter painter; + TQPainter painter; int res = pPrinter->resolution(); int marg = res; @@ -298,11 +298,11 @@ void kvoctrainView::print(KPrinter * pPrinter) int hh = m_table->horizontalHeader()->height(); int tPos = marg + hh; - QColorGroup cg; + TQColorGroup cg; painter.begin(pPrinter); - QRect w = painter.window(); - QRect cr; + TQRect w = painter.window(); + TQRect cr; pw = w.width() - (2 * marg); @@ -360,13 +360,13 @@ void kvoctrainView::print(KPrinter * pPrinter) painter.end(); } -void kvoctrainView::newPage(QPainter & painter, int res, int startCol, int endCol) +void kvoctrainView::newPage(TQPainter & painter, int res, int startCol, int endCol) { int marg = res; int hh = m_table->horizontalHeader()->height(); int cw; - QRect cr; - QRect w = painter.window(); + TQRect cr; + TQRect w = painter.window(); painter.resetXForm(); painter.setFont(KGlobalSettings::generalFont()); painter.drawText(marg, marg - 20, i18n("KVocTrain - %1").arg(m_doc->getTitle())); @@ -384,13 +384,13 @@ void kvoctrainView::newPage(QPainter & painter, int res, int startCol, int endCo } } -void kvoctrainView::endOfPage(QPainter & painter, int pageNum, int res) +void kvoctrainView::endOfPage(TQPainter & painter, int pageNum, int res) { painter.resetXForm(); painter.setFont(KGlobalSettings::generalFont()); - QRect w = painter.window(); - QRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, QString::number(pageNum)); - painter.drawText((w.width()/2) - (r.width()/2), w.height() - res + 20, QString::number(pageNum)); + TQRect w = painter.window(); + TQRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, TQString::number(pageNum)); + painter.drawText((w.width()/2) - (r.width()/2), w.height() - res + 20, TQString::number(pageNum)); } diff --git a/kvoctrain/kvoctrain/kvoctrainview.h b/kvoctrain/kvoctrain/kvoctrainview.h index f332e9a8..871e9730 100644 --- a/kvoctrain/kvoctrain/kvoctrainview.h +++ b/kvoctrain/kvoctrain/kvoctrainview.h @@ -63,25 +63,25 @@ class kvoctrainView : public QWidget void setView(kvoctrainDoc *doc, const LangSet &ls); KVocTrainTable* getTable() { return m_table; } - void setHeaderProp(int id, const QString &name, const QString &pixfile=QString::null); + void setHeaderProp(int id, const TQString &name, const TQString &pixfile=TQString::null); void adjustContent(); void print(KPrinter *pPrinter); private: - void newPage(QPainter &, int, int, int); - void endOfPage(QPainter &, int, int); + void newPage(TQPainter &, int, int, int); + void endOfPage(TQPainter &, int, int); protected: KVocTrainTable * m_table; bool autoResize; kvoctrainDoc * m_doc; - QGridLayout * list_layout; + TQGridLayout * list_layout; kvoctrainApp * parent; /** resizes table when frame is resized */ - virtual void resizeEvent(QResizeEvent *); - void showEvent(QShowEvent * s_ev); + virtual void resizeEvent(TQResizeEvent *); + void showEvent(TQShowEvent * s_ev); }; #endif // KVOCTRAINVIEW_H diff --git a/kvoctrain/kvoctrain/kvt-core/LineList.cpp b/kvoctrain/kvoctrain/kvt-core/LineList.cpp index 5b79b3b9..4c38d530 100644 --- a/kvoctrain/kvoctrain/kvt-core/LineList.cpp +++ b/kvoctrain/kvoctrain/kvt-core/LineList.cpp @@ -28,16 +28,16 @@ #include -LineList::LineList (const QString &multilines) +LineList::LineList (const TQString &multilines) { setLines (multilines); } -void LineList::setLines(const QString &the_lines ) +void LineList::setLines(const TQString &the_lines ) { multilines.clear(); - QString lines = the_lines; + TQString lines = the_lines; int pos; if ((pos = lines.find ('\n')) >= 0) { while (pos >= 0) { @@ -69,7 +69,7 @@ int LineList::count() const } -QString LineList::getLine (int index) const +TQString LineList::getLine (int index) const { if (index < (int) multilines.size()) return multilines[index]; @@ -80,9 +80,9 @@ QString LineList::getLine (int index) const } -QString LineList::allLines() const +TQString LineList::allLines() const { - QString ret; + TQString ret; if (multilines.size() > 0) ret = multilines[0]; diff --git a/kvoctrain/kvoctrain/kvt-core/LineList.h b/kvoctrain/kvoctrain/kvt-core/LineList.h index b1d6f01f..15309c48 100644 --- a/kvoctrain/kvoctrain/kvt-core/LineList.h +++ b/kvoctrain/kvoctrain/kvt-core/LineList.h @@ -27,23 +27,23 @@ #ifndef LineList_h #define LineList_h -#include +#include #include using namespace std; class LineList { public: - LineList (const QString &multilines = ""); + LineList (const TQString &multilines = ""); - void setLines(const QString &lines); + void setLines(const TQString &lines); void normalizeWS(); int count() const; - QString getLine (int index) const; - QString allLines() const; + TQString getLine (int index) const; + TQString allLines() const; protected: - vector multilines; + vector multilines; }; #endif // LineList_h diff --git a/kvoctrain/kvoctrain/kvt-core/MultipleChoice.cpp b/kvoctrain/kvoctrain/kvt-core/MultipleChoice.cpp index e73f358a..a326452a 100644 --- a/kvoctrain/kvoctrain/kvt-core/MultipleChoice.cpp +++ b/kvoctrain/kvoctrain/kvt-core/MultipleChoice.cpp @@ -26,11 +26,11 @@ #include "MultipleChoice.h" MultipleChoice::MultipleChoice ( - const QString &mc1, - const QString &mc2, - const QString &mc3, - const QString &mc4, - const QString &mc5 + const TQString &mc1, + const TQString &mc2, + const TQString &mc3, + const TQString &mc4, + const TQString &mc5 ) { setMC1 (mc1); @@ -61,7 +61,7 @@ void MultipleChoice::clear() } -QString MultipleChoice::mc (unsigned idx) const +TQString MultipleChoice::mc (unsigned idx) const { switch (idx) { case 0: return muc1; diff --git a/kvoctrain/kvoctrain/kvt-core/MultipleChoice.h b/kvoctrain/kvoctrain/kvt-core/MultipleChoice.h index 99bc56ea..4d7fd029 100644 --- a/kvoctrain/kvoctrain/kvt-core/MultipleChoice.h +++ b/kvoctrain/kvoctrain/kvt-core/MultipleChoice.h @@ -27,7 +27,7 @@ #ifndef MultipleChoice_included #define MultipleChoice_included -#include +#include #define MAX_MULTIPLE_CHOICE 5 // select one out of x @@ -39,26 +39,26 @@ public: MultipleChoice() {} MultipleChoice ( - const QString &mc1, - const QString &mc2, - const QString &mc3, - const QString &mc4, - const QString &mc5 + const TQString &mc1, + const TQString &mc2, + const TQString &mc3, + const TQString &mc4, + const TQString &mc5 ); - void setMC1 (const QString &s) { muc1 = s; } - void setMC2 (const QString &s) { muc2 = s; } - void setMC3 (const QString &s) { muc3 = s; } - void setMC4 (const QString &s) { muc4 = s; } - void setMC5 (const QString &s) { muc5 = s; } + void setMC1 (const TQString &s) { muc1 = s; } + void setMC2 (const TQString &s) { muc2 = s; } + void setMC3 (const TQString &s) { muc3 = s; } + void setMC4 (const TQString &s) { muc4 = s; } + void setMC5 (const TQString &s) { muc5 = s; } - QString mc1 () const { return muc1; } - QString mc2 () const { return muc2; } - QString mc3 () const { return muc3; } - QString mc4 () const { return muc4; } - QString mc5 () const { return muc5; } + TQString mc1 () const { return muc1; } + TQString mc2 () const { return muc2; } + TQString mc3 () const { return muc3; } + TQString mc4 () const { return muc4; } + TQString mc5 () const { return muc5; } - QString mc (unsigned idx) const; + TQString mc (unsigned idx) const; bool isEmpty() const; void normalize(); @@ -67,7 +67,7 @@ public: protected: - QString muc1, muc2, muc3, muc4, muc5; + TQString muc1, muc2, muc3, muc4, muc5; }; diff --git a/kvoctrain/kvoctrain/kvt-core/QueryManager.cpp b/kvoctrain/kvoctrain/kvt-core/QueryManager.cpp index 2c7b76ca..7eb65e1a 100644 --- a/kvoctrain/kvoctrain/kvt-core/QueryManager.cpp +++ b/kvoctrain/kvoctrain/kvt-core/QueryManager.cpp @@ -34,7 +34,7 @@ using namespace std; #include "kvoctraincore.h" #include -vector QueryManager::userTypes; +vector QueryManager::userTypes; struct t_type_rel { @@ -89,20 +89,20 @@ static t_type_rel InternalTypeRelations [] = }; -QString QueryManager::getSubType (const QString & type) +TQString QueryManager::getSubType (const TQString & type) { int i; - QString t = type; + TQString t = type; if ((i = t.find(QM_TYPE_DIV)) >= 0) { t.remove(0, i+1); return t; } else - return QString::null; + return TQString::null; } -QString QueryManager::getMainType (const QString & type) +TQString QueryManager::getMainType (const TQString & type) { int i; if ((i = type.find(QM_TYPE_DIV)) >= 0) @@ -201,7 +201,7 @@ bool QueryManager::validate(kvoctrainExpr *expr, int act_lesson, int oindex, int } -QuerySelection QueryManager::select(kvoctrainDoc *doc, int act_lesson, int idx, QString type) +QuerySelection QueryManager::select(kvoctrainDoc *doc, int act_lesson, int idx, TQString type) { QuerySelection random; random.resize(doc->numLessons()+1); @@ -235,16 +235,16 @@ QuerySelection QueryManager::select(kvoctrainDoc *doc, int act_lesson, int idx, } -bool QueryManager::validate(kvoctrainExpr *expr, int act_lesson, int idx, QString query_type) +bool QueryManager::validate(kvoctrainExpr *expr, int act_lesson, int idx, TQString query_type) { - QString qtype; + TQString qtype; int pos = query_type.find (QM_TYPE_DIV); if (pos >= 0) qtype = query_type.left (pos); else qtype = query_type; - QString expr_type = expr->getType(idx); + TQString expr_type = expr->getType(idx); bool type_ok = false; if (qtype == QM_NOUN) { type_ok = expr_type == QM_NOUN QM_TYPE_DIV QM_NOUN_S @@ -337,9 +337,9 @@ bool QueryManager::validate(kvoctrainExpr *expr, int act_lesson, int idx, QueryT } -QString QueryManager::compStr(Prefs::EnumCompType::type type) +TQString QueryManager::compStr(Prefs::EnumCompType::type type) { - QString str = "???"; + TQString str = "???"; switch (type) { case DontCare: str = i18n("Do not Care"); break; @@ -371,7 +371,7 @@ QString QueryManager::compStr(Prefs::EnumCompType::type type) } -QString QueryManager::gradeStr (int i) +TQString QueryManager::gradeStr (int i) { switch (i) { case KV_NORM_GRADE: return i18n(KV_NORM_TEXT); break; @@ -391,7 +391,7 @@ vector QueryManager::getRelation (bool only_maintypes) { vector vec; for (int i = 0; i < (int) userTypes.size(); i++) { - QString s; + TQString s; s.setNum(i+1); s.insert(0, QM_USER_TYPE); vec.push_back(TypeRelation(s, userTypes[i])); @@ -409,16 +409,16 @@ vector QueryManager::getRelation (bool only_maintypes) } -QString QueryManager::typeStr (const QString id) +TQString QueryManager::typeStr (const TQString id) { if (id.left(1) == QM_USER_TYPE) { - QString num = id; + TQString num = id; num.remove (0, 1); int i = num.toInt()-1; if (i >= 0 && i < (int) userTypes.size() ) return userTypes[i]; else - return QString::null; + return TQString::null; } else { t_type_rel *type = InternalTypeRelations; @@ -428,7 +428,7 @@ QString QueryManager::typeStr (const QString id) type++; } } - return QString::null; + return TQString::null; } @@ -576,7 +576,7 @@ bool QueryManager::compareGrade (CompType type, grade_t qgrade, grade_t limit) } -bool QueryManager::compareType (CompType type, const QString & exprtype, const QString & limit) +bool QueryManager::compareType (CompType type, const TQString & exprtype, const TQString & limit) { bool erg = true; switch (type) { @@ -637,19 +637,19 @@ bool QueryManager::compareLesson (CompType type, int less, const vector &li } -void QueryManager::setTypeNames (vector names) +void QueryManager::setTypeNames (vector names) { userTypes = names; } -void QueryManager::setLessonItemStr (const QString & indices) +void QueryManager::setLessonItemStr (const TQString & indices) { int pos; - QString indices_copy = indices; + TQString indices_copy = indices; lessonitems.clear(); while ((pos = indices_copy.find(' ')) >= 0) { - QString s = indices_copy.left(pos); + TQString s = indices_copy.left(pos); indices_copy.remove(0, pos+1); lessonitems.push_back(s.toInt()); } @@ -659,9 +659,9 @@ void QueryManager::setLessonItemStr (const QString & indices) } -QString QueryManager::lessonItemStr() const +TQString QueryManager::lessonItemStr() const { - QString s, ret; + TQString s, ret; for (int i = 0; i < (int) lessonitems.size(); i++) { s.setNum (lessonitems[i]); if (i != 0) diff --git a/kvoctrain/kvoctrain/kvt-core/QueryManager.h b/kvoctrain/kvoctrain/kvt-core/QueryManager.h index 07567d22..bdd7d815 100644 --- a/kvoctrain/kvoctrain/kvt-core/QueryManager.h +++ b/kvoctrain/kvoctrain/kvt-core/QueryManager.h @@ -81,15 +81,15 @@ class TypeRelation { public: - TypeRelation (const QString & _short, const QString & _long) + TypeRelation (const TQString & _short, const TQString & _long) : shortId (_short), longId(_long) {} - QString shortStr() const { return shortId; } - QString longStr() const { return longId; } + TQString shortStr() const { return shortId; } + TQString longStr() const { return longId; } protected: - QString shortId, longId; + TQString shortId, longId; }; @@ -128,30 +128,30 @@ class QueryManager //void saveConfig (KConfig *); static vector getRelation (bool only_maintypes); - static void setTypeNames (vector names); - static QString getSubType (const QString & type); - static QString getMainType (const QString & type); + static void setTypeNames (vector names); + static TQString getSubType (const TQString & type); + static TQString getMainType (const TQString & type); - static QString compStr(Prefs::EnumCompType::type type); - static QString gradeStr(int i); - static QString typeStr(const QString id); + static TQString compStr(Prefs::EnumCompType::type type); + static TQString gradeStr(int i); + static TQString typeStr(const TQString id); void setLessonItems(vector indices) { lessonitems = indices; } - void setLessonItemStr(const QString & indices); + void setLessonItemStr(const TQString & indices); //void setDateItem (time_t time) { dateitem = time; } //void setQueryItem (int query) { queryitem = query; } //void setBadItem (int bad) { baditem = bad; } - //void setTypeItem (const QString & type) { typeitem = type; } + //void setTypeItem (const TQString & type) { typeitem = type; } //void setGradeItem (grade_t grade) { gradeitem = grade; } //void setBlockItem (int item, int grade); //void setExpireItem (int item, int grade); vector lessonItems() const { return lessonitems; } - QString lessonItemStr() const; + TQString lessonItemStr() const; //time_t dateItem () const { return dateitem; } //int queryItem () const { return queryitem; } //int badItem () const { return baditem; } - //QString typeItem () const { return typeitem; } + //TQString typeItem () const { return typeitem; } //grade_t gradeItem () const { return gradeitem; } //int blockItem (int grade) const; //int expireItem (int grade) const; @@ -177,10 +177,10 @@ class QueryManager int oindex, int tindex); bool validate(kvoctrainExpr *expr, int act_lesson, - int index, QString type); + int index, TQString type); QuerySelection select(kvoctrainDoc*, int act_lesson, - int index, QString type); + int index, TQString type); bool validate(kvoctrainExpr *expr, int act_lesson, int index, QueryType type); @@ -196,7 +196,7 @@ class QueryManager bool compareQuery (CompType, int, int); bool compareBad (CompType, int, int); bool compareGrade (CompType, grade_t, grade_t); - bool compareType (CompType, const QString &, const QString &); + bool compareType (CompType, const TQString &, const TQString &); bool compareLesson (CompType type, int less, const vector &limit, int current); /* CompType typecomp, @@ -209,7 +209,7 @@ class QueryManager //time_t dateitem; //int queryitem, // baditem; - //QString typeitem; + //TQString typeitem; //grade_t gradeitem; vector lessonitems; @@ -217,7 +217,7 @@ class QueryManager // expireItems; private: - static vector userTypes; + static vector userTypes; }; #endif // QueryManager_included diff --git a/kvoctrain/kvoctrain/kvt-core/UsageManager.cpp b/kvoctrain/kvoctrain/kvt-core/UsageManager.cpp index 7f98665a..9180d6e4 100644 --- a/kvoctrain/kvoctrain/kvt-core/UsageManager.cpp +++ b/kvoctrain/kvoctrain/kvt-core/UsageManager.cpp @@ -33,7 +33,7 @@ #include using namespace std; -vector UsageManager::userUsages; +vector UsageManager::userUsages; // user usages are strings like this: #1 @@ -112,7 +112,7 @@ vector UsageManager::getRelation () { vector vec; for (int i = 0; i < (int) userUsages.size(); i++) { - QString s; + TQString s; s.setNum(i+1); s.insert(0, UL_USER_USAGE); vec.push_back(UsageRelation(s, userUsages[i], userUsages[i])); @@ -120,7 +120,7 @@ vector UsageManager::getRelation () internalRelation_t *usage = InternalUsageRelations; while (usage->ident != 0) { - QString s; + TQString s; if (usage->context == 0) s = i18n(usage->shortid); else @@ -135,9 +135,9 @@ vector UsageManager::getRelation () } -bool UsageManager::contains (const QString& label, const QString& collection) +bool UsageManager::contains (const TQString& label, const TQString& collection) { - QString s = collection; + TQString s = collection; int pos; while ((pos = s.find(UL_USAGE_DIV)) >= 0) { if (s.left(pos) == label) @@ -149,7 +149,7 @@ bool UsageManager::contains (const QString& label, const QString& collection) } -void UsageManager::setUsageNames (vector names) +void UsageManager::setUsageNames (vector names) { userUsages = names; } diff --git a/kvoctrain/kvoctrain/kvt-core/UsageManager.h b/kvoctrain/kvoctrain/kvt-core/UsageManager.h index e49a6c85..647de685 100644 --- a/kvoctrain/kvoctrain/kvt-core/UsageManager.h +++ b/kvoctrain/kvoctrain/kvt-core/UsageManager.h @@ -94,15 +94,15 @@ struct UsageRelation { public: - UsageRelation (const QString & id, const QString & shorty, const QString & longy) + UsageRelation (const TQString & id, const TQString & shorty, const TQString & longy) :ident(id), shortId(shorty), longId(longy) {} - QString identStr() const { return ident; } - QString shortStr() const { return shortId; } - QString longStr() const { return longId; } + TQString identStr() const { return ident; } + TQString shortStr() const { return shortId; } + TQString longStr() const { return longId; } protected: - QString ident, + TQString ident, shortId, longId; }; @@ -114,14 +114,14 @@ class UsageManager UsageManager (); - static bool contains (const QString& label, const QString& collection); + static bool contains (const TQString& label, const TQString& collection); static vector getRelation (); - static void setUsageNames (vector names); + static void setUsageNames (vector names); protected: private: - static vector userUsages; + static vector userUsages; }; #endif // UsageManager_included diff --git a/kvoctrain/kvoctrain/kvt-core/grammarmanager.cpp b/kvoctrain/kvoctrain/kvt-core/grammarmanager.cpp index 2c789890..1119d011 100644 --- a/kvoctrain/kvoctrain/kvt-core/grammarmanager.cpp +++ b/kvoctrain/kvoctrain/kvt-core/grammarmanager.cpp @@ -42,15 +42,15 @@ Conjugation::names [] = }; -vector Conjugation::userTenses; +vector Conjugation::userTenses; //================================================================ Comparison::Comparison ( - const QString &l1, - const QString &l2, - const QString &l3 + const TQString &l1, + const TQString &l2, + const TQString &l3 ) { setL1 (l1); @@ -79,9 +79,9 @@ void Comparison::clear() Article::Article - (const QString &fem_def, const QString &fem_indef, - const QString &mal_def, const QString &mal_indef, - const QString &nat_def, const QString &nat_indef + (const TQString &fem_def, const TQString &fem_indef, + const TQString &mal_def, const TQString &mal_indef, + const TQString &nat_def, const TQString &nat_indef ) { setFemale (fem_def, fem_indef); @@ -91,7 +91,7 @@ Article::Article void Article::setFemale - (const QString &def, const QString &indef) + (const TQString &def, const TQString &indef) { fem_def = def; fem_indef = indef; @@ -99,7 +99,7 @@ void Article::setFemale void Article::setMale - (const QString &def, const QString &indef) + (const TQString &def, const TQString &indef) { mal_def = def; mal_indef = indef; @@ -107,7 +107,7 @@ void Article::setMale void Article::setNatural - (const QString &def, const QString &indef) + (const TQString &def, const TQString &indef) { nat_def = def; nat_indef = indef; @@ -115,7 +115,7 @@ void Article::setNatural void Article::female - (QString &def, QString &indef) const + (TQString &def, TQString &indef) const { def = fem_def; indef = fem_indef; @@ -123,7 +123,7 @@ void Article::female void Article::male - (QString &def, QString &indef) const + (TQString &def, TQString &indef) const { def = mal_def; indef = mal_indef; @@ -131,7 +131,7 @@ void Article::male void Article::natural - (QString &def, QString &indef) const + (TQString &def, TQString &indef) const { def = nat_def; indef = nat_indef; @@ -158,7 +158,7 @@ vector Conjugation::getRelation () } for (int i = 0; i < (int) userTenses.size(); i++) { - QString s; + TQString s; s.setNum(i+1); s.insert(0, UL_USER_TENSE); vec.push_back(TenseRelation(s, userTenses[i])); @@ -168,16 +168,16 @@ vector Conjugation::getRelation () } -void Conjugation::setTenseNames (vector names) +void Conjugation::setTenseNames (vector names) { userTenses = names; } -QString Conjugation::getName (const QString &abbrev) +TQString Conjugation::getName (const TQString &abbrev) { - if (abbrev.length() >= 2 && abbrev[0] == QString(UL_USER_TENSE)) { - QString s = abbrev; + if (abbrev.length() >= 2 && abbrev[0] == TQString(UL_USER_TENSE)) { + TQString s = abbrev; s.remove(0, 1); int i = s.toInt() - 1; @@ -197,7 +197,7 @@ QString Conjugation::getName (const QString &abbrev) } -QString Conjugation::getName (int idx) +TQString Conjugation::getName (int idx) { if (idx < numInternalNames() ) return i18n(names[idx].name); @@ -210,11 +210,11 @@ QString Conjugation::getName (int idx) } -QString Conjugation::getAbbrev (const QString &name) +TQString Conjugation::getAbbrev (const TQString &name) { for (int i = 0; i < (int) userTenses.size(); i++) if (userTenses[i] == name) { - QString s; + TQString s; s.setNum(i+1); s.insert(0, UL_USER_TENSE); return s; @@ -228,13 +228,13 @@ QString Conjugation::getAbbrev (const QString &name) } -QString Conjugation::getAbbrev (int idx) +TQString Conjugation::getAbbrev (int idx) { if (idx < numInternalNames() ) return names[idx].abbrev; else if (idx < numTenses() ) { - QString s; + TQString s; s.setNum(idx-numInternalNames()+1); s.insert(0, UL_USER_TENSE); return s; @@ -257,7 +257,7 @@ int Conjugation::numTenses() } -QString Conjugation::getType (int idx) +TQString Conjugation::getType (int idx) { if (idx >= (int) conjugations.size() ) return ""; @@ -266,7 +266,7 @@ QString Conjugation::getType (int idx) } -void Conjugation::setType (int idx, const QString & type) +void Conjugation::setType (int idx, const TQString & type) { if (idx >= (int) conjugations.size() ) return; @@ -321,83 +321,83 @@ bool Conjugation::isEmpty (int idx) return default; -bool Conjugation::pers3SingularCommon(const QString &type) const +bool Conjugation::pers3SingularCommon(const TQString &type) const { _GET_CON_(s3common, type, false); } -bool Conjugation::pers3PluralCommon(const QString &type) const +bool Conjugation::pers3PluralCommon(const TQString &type) const { _GET_CON_(p3common, type, false); } -QString Conjugation::pers1Singular - (const QString &type) const +TQString Conjugation::pers1Singular + (const TQString &type) const { _GET_CON_(pers1_sing, type, ""); } -QString Conjugation::pers2Singular - (const QString &type) const +TQString Conjugation::pers2Singular + (const TQString &type) const { _GET_CON_(pers2_sing, type, ""); } -QString Conjugation::pers3FemaleSingular - (const QString &type) const +TQString Conjugation::pers3FemaleSingular + (const TQString &type) const { _GET_CON_(pers3_f_sing, type, ""); } -QString Conjugation::pers3MaleSingular - (const QString &type) const +TQString Conjugation::pers3MaleSingular + (const TQString &type) const { _GET_CON_(pers3_m_sing, type, ""); } -QString Conjugation::pers3NaturalSingular - (const QString &type) const +TQString Conjugation::pers3NaturalSingular + (const TQString &type) const { _GET_CON_(pers3_n_sing, type, ""); } -QString Conjugation::pers1Plural - (const QString &type) const +TQString Conjugation::pers1Plural + (const TQString &type) const { _GET_CON_(pers1_plur, type, ""); } -QString Conjugation::pers2Plural - (const QString &type) const +TQString Conjugation::pers2Plural + (const TQString &type) const { _GET_CON_(pers2_plur, type, ""); } -QString Conjugation::pers3FemalePlural - (const QString &type) const +TQString Conjugation::pers3FemalePlural + (const TQString &type) const { _GET_CON_(pers3_f_plur, type, ""); } -QString Conjugation::pers3MalePlural - (const QString &type) const +TQString Conjugation::pers3MalePlural + (const TQString &type) const { _GET_CON_(pers3_m_plur, type, ""); } -QString Conjugation::pers3NaturalPlural - (const QString &type) const +TQString Conjugation::pers3NaturalPlural + (const TQString &type) const { _GET_CON_(pers3_n_plur, type, ""); } @@ -418,83 +418,83 @@ QString Conjugation::pers3NaturalPlural conjugations.push_back(ct); -void Conjugation::setPers3PluralCommon(const QString &type, bool f) +void Conjugation::setPers3PluralCommon(const TQString &type, bool f) { _SET_CON_(p3common, type, f); } -void Conjugation::setPers3SingularCommon(const QString &type, bool f) +void Conjugation::setPers3SingularCommon(const TQString &type, bool f) { _SET_CON_(s3common, type, f); } void Conjugation::setPers1Singular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers1_sing, type, str); } void Conjugation::setPers2Singular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers2_sing, type, str); } void Conjugation::setPers3FemaleSingular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_f_sing, type, str); } void Conjugation::setPers3MaleSingular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_m_sing, type, str); } void Conjugation::setPers3NaturalSingular - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_n_sing, type, str); } void Conjugation::setPers1Plural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers1_plur, type, str); } void Conjugation::setPers2Plural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers2_plur, type, str); } void Conjugation::setPers3FemalePlural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_f_plur, type, str); } void Conjugation::setPers3MalePlural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_m_plur, type, str); } void Conjugation::setPers3NaturalPlural - (const QString &type, const QString &str) + (const TQString &type, const TQString &str) { _SET_CON_(pers3_n_plur, type, str); } diff --git a/kvoctrain/kvoctrain/kvt-core/grammarmanager.h b/kvoctrain/kvoctrain/kvt-core/grammarmanager.h index 1b9cfe76..01f020b9 100644 --- a/kvoctrain/kvoctrain/kvt-core/grammarmanager.h +++ b/kvoctrain/kvoctrain/kvt-core/grammarmanager.h @@ -27,7 +27,7 @@ #ifndef grammarmanager_included #define grammarmanager_included -#include +#include #include using namespace std; @@ -54,22 +54,22 @@ public: Article() {} Article ( - const QString &fem_def, const QString &fem_indef, - const QString &mal_def, const QString &mal_indef, - const QString &nat_def, const QString &nat_indef + const TQString &fem_def, const TQString &fem_indef, + const TQString &mal_def, const TQString &mal_indef, + const TQString &nat_def, const TQString &nat_indef ); - void setFemale (const QString &def, const QString &indef); - void setMale (const QString &def, const QString &indef); - void setNatural (const QString &def, const QString &indef); + void setFemale (const TQString &def, const TQString &indef); + void setMale (const TQString &def, const TQString &indef); + void setNatural (const TQString &def, const TQString &indef); - void female (QString &def, QString &indef) const; - void male (QString &def, QString &indef) const; - void natural (QString &def, QString &indef) const; + void female (TQString &def, TQString &indef) const; + void male (TQString &def, TQString &indef) const; + void natural (TQString &def, TQString &indef) const; protected: - QString fem_def, fem_indef, + TQString fem_def, fem_indef, mal_def, mal_indef, nat_def, nat_indef; }; @@ -83,25 +83,25 @@ public: Comparison() {} Comparison ( - const QString &l1, - const QString &l2, - const QString &l3 + const TQString &l1, + const TQString &l2, + const TQString &l3 ); - void setL1 (const QString &s) { ls1 = s; } - void setL2 (const QString &s) { ls2 = s; } - void setL3 (const QString &s) { ls3 = s; } + void setL1 (const TQString &s) { ls1 = s; } + void setL2 (const TQString &s) { ls2 = s; } + void setL3 (const TQString &s) { ls3 = s; } - QString l1 () const { return ls1; } - QString l2 () const { return ls2; } - QString l3 () const { return ls3; } + TQString l1 () const { return ls1; } + TQString l2 () const { return ls2; } + TQString l3 () const { return ls3; } bool isEmpty() const; void clear(); protected: - QString ls1, ls2, ls3; + TQString ls1, ls2, ls3; }; @@ -109,15 +109,15 @@ class TenseRelation { public: - TenseRelation (const QString & _short, const QString & _long) + TenseRelation (const TQString & _short, const TQString & _long) : shortId (_short), longId(_long) {} - inline QString shortStr() const { return shortId; } - inline QString longStr() const { return longId; } + inline TQString shortStr() const { return shortId; } + inline TQString longStr() const { return longId; } protected: - QString shortId, longId; + TQString shortId, longId; }; @@ -131,47 +131,47 @@ public: int numEntries() const; static vector getRelation (); - static void setTenseNames (vector names); + static void setTenseNames (vector names); - static QString getName (const QString &abbrev); - static QString getName (int index); - static QString getAbbrev (const QString &name); - static QString getAbbrev (int index); + static TQString getName (const TQString &abbrev); + static TQString getName (int index); + static TQString getAbbrev (const TQString &name); + static TQString getAbbrev (int index); static int numInternalNames(); static int numTenses(); - QString getType (int index); - void setType (int index, const QString & type); + TQString getType (int index); + void setType (int index, const TQString & type); void cleanUp(); bool isEmpty (int idx); - QString pers1Singular(const QString &type) const; - QString pers2Singular(const QString &type) const; - bool pers3SingularCommon(const QString &type) const; - QString pers3FemaleSingular(const QString &type) const; - QString pers3MaleSingular(const QString &type) const; - QString pers3NaturalSingular(const QString &type) const; - - QString pers1Plural(const QString &type) const; - QString pers2Plural(const QString &type) const; - bool pers3PluralCommon(const QString &type) const; - QString pers3FemalePlural(const QString &type) const; - QString pers3MalePlural(const QString &type) const; - QString pers3NaturalPlural(const QString &type) const; - - void setPers1Singular(const QString &type, const QString &str); - void setPers2Singular(const QString &type, const QString &str); - void setPers3SingularCommon(const QString &type, bool f); - void setPers3FemaleSingular(const QString &type, const QString &str); - void setPers3MaleSingular(const QString &type, const QString &str); - void setPers3NaturalSingular(const QString &type, const QString &str); - - void setPers1Plural(const QString &type, const QString &str); - void setPers2Plural(const QString &type, const QString &str); - void setPers3PluralCommon(const QString &type, bool f); - void setPers3FemalePlural(const QString &type, const QString &str); - void setPers3MalePlural(const QString &type, const QString &str); - void setPers3NaturalPlural(const QString &type, const QString &str); + TQString pers1Singular(const TQString &type) const; + TQString pers2Singular(const TQString &type) const; + bool pers3SingularCommon(const TQString &type) const; + TQString pers3FemaleSingular(const TQString &type) const; + TQString pers3MaleSingular(const TQString &type) const; + TQString pers3NaturalSingular(const TQString &type) const; + + TQString pers1Plural(const TQString &type) const; + TQString pers2Plural(const TQString &type) const; + bool pers3PluralCommon(const TQString &type) const; + TQString pers3FemalePlural(const TQString &type) const; + TQString pers3MalePlural(const TQString &type) const; + TQString pers3NaturalPlural(const TQString &type) const; + + void setPers1Singular(const TQString &type, const TQString &str); + void setPers2Singular(const TQString &type, const TQString &str); + void setPers3SingularCommon(const TQString &type, bool f); + void setPers3FemaleSingular(const TQString &type, const TQString &str); + void setPers3MaleSingular(const TQString &type, const TQString &str); + void setPers3NaturalSingular(const TQString &type, const TQString &str); + + void setPers1Plural(const TQString &type, const TQString &str); + void setPers2Plural(const TQString &type, const TQString &str); + void setPers3PluralCommon(const TQString &type, bool f); + void setPers3FemalePlural(const TQString &type, const TQString &str); + void setPers3MalePlural(const TQString &type, const TQString &str); + void setPers3NaturalPlural(const TQString &type, const TQString &str); private: @@ -182,10 +182,10 @@ private: s3common = false; } - QString type; + TQString type; bool p3common, s3common; - QString pers1_sing, + TQString pers1_sing, pers2_sing, pers3_m_sing, pers3_f_sing, @@ -207,7 +207,7 @@ protected: vector conjugations; static conjug_name_t names []; - static vector userTenses; + static vector userTenses; }; diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_csv.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_csv.cpp index 851e0ea9..e4906935 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_csv.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_csv.cpp @@ -27,37 +27,37 @@ #include "kvoctrain.h" -#include +#include #include using namespace std; -bool kvoctrainDoc::saveTypeNameCsv (QTextStream &) +bool kvoctrainDoc::saveTypeNameCsv (TQTextStream &) { return true; } -bool kvoctrainDoc::loadTypeNameCsv (QTextStream &) +bool kvoctrainDoc::loadTypeNameCsv (TQTextStream &) { return true; } -bool kvoctrainDoc::saveLessonCsv (QTextStream &) +bool kvoctrainDoc::saveLessonCsv (TQTextStream &) { return true; } -bool kvoctrainDoc::loadLessonCsv (QTextStream &) +bool kvoctrainDoc::loadLessonCsv (TQTextStream &) { return true; } -bool kvoctrainDoc::saveToCsv (QTextStream& os, QString &) +bool kvoctrainDoc::saveToCsv (TQTextStream& os, TQString &) { - QString separator = Prefs::separator(); + TQString separator = Prefs::separator(); saveTypeNameCsv (os); saveLessonCsv (os); @@ -73,9 +73,9 @@ bool kvoctrainDoc::saveToCsv (QTextStream& os, QString &) vector csv_order = kvoctrainApp::getCsvOrder(this); vector::const_iterator first = vocabulary.begin (); - QString exp; + TQString exp; - os.setCodec(QTextCodec::codecForName("UTF-8")); + os.setCodec(TQTextCodec::codecForName("UTF-8")); while (first != vocabulary.end ()) { ent_no++; @@ -110,10 +110,10 @@ bool kvoctrainDoc::saveToCsv (QTextStream& os, QString &) } -bool kvoctrainDoc::loadFromCsv (QTextStream& is) +bool kvoctrainDoc::loadFromCsv (TQTextStream& is) { - QString separator = Prefs::separator(); - QStringList lang_order = Prefs::pasteOrder(); + TQString separator = Prefs::separator(); + TQStringList lang_order = Prefs::pasteOrder(); langs.clear(); vocabulary.clear(); @@ -122,8 +122,8 @@ bool kvoctrainDoc::loadFromCsv (QTextStream& is) // autodetect utf8 // FIXME: provide choice for Latinx? - is.setCodec(QTextCodec::codecForName("ISO 8859-1")); - is.setEncoding(QTextStream::Latin1); + is.setCodec(TQTextCodec::codecForName("ISO 8859-1")); + is.setEncoding(TQTextStream::Latin1); int size = is.device()->size (); int ln = size / 20 / 100; // assume each line about 20 chars @@ -133,7 +133,7 @@ bool kvoctrainDoc::loadFromCsv (QTextStream& is) bool utf8_mode = false; int lang_num = 0; for (int l = 0; !is.eof(); l++) { - QString s = is.readLine(); + TQString s = is.readLine(); // autodetect utf8 if (!utf8_mode) { @@ -180,9 +180,9 @@ bool kvoctrainDoc::loadFromCsv (QTextStream& is) } if (utf8_mode) { - is.setCodec(QTextCodec::codecForName("UTF-8")); - is.setEncoding(QTextStream::UnicodeUTF8); - s = QString::fromUtf8(s.ascii()); + is.setCodec(TQTextCodec::codecForName("UTF-8")); + is.setEncoding(TQTextStream::UnicodeUTF8); + s = TQString::fromUtf8(s.ascii()); } } @@ -204,7 +204,7 @@ bool kvoctrainDoc::loadFromCsv (QTextStream& is) if (i == 0) expr.setOriginal(bucket.getOriginal()); else { - QString ts = bucket.getTranslation(i); + TQString ts = bucket.getTranslation(i); expr.setTranslation(i, ts); } } @@ -220,7 +220,7 @@ bool kvoctrainDoc::loadFromCsv (QTextStream& is) if (j == 0) langs.push_back("org"); else { - QString s; + TQString s; s.setNum(j); s.insert(0, "trans"); langs.push_back(s); @@ -232,12 +232,12 @@ bool kvoctrainDoc::loadFromCsv (QTextStream& is) } -void kvoctrainDoc::errorCsv (int /*line*/, const QString &text ) +void kvoctrainDoc::errorCsv (int /*line*/, const TQString &text ) { unknown_elem = true; - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Error in csv file")); - QString msg = text; + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Error in csv file")); + TQString msg = text; KMessageBox::error( 0, msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_lex.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_lex.cpp index feb160cf..7212f456 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_lex.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_lex.cpp @@ -90,9 +90,9 @@ Sachgebiete| */ -static QString extract (QString &line) +static TQString extract (TQString &line) { - QString ret; + TQString ret; int lim = line.find ("|"); if (lim < 0) { ret = line; @@ -107,7 +107,7 @@ static QString extract (QString &line) } -bool kvoctrainDoc::saveTypeNameLex (QTextStream &os) +bool kvoctrainDoc::saveTypeNameLex (TQTextStream &os) { int i; for (i = 0; i < (int) type_descr.size() && i < LEX_MAX_ATTR; i++) @@ -120,10 +120,10 @@ bool kvoctrainDoc::saveTypeNameLex (QTextStream &os) } -bool kvoctrainDoc::loadTypeNameLex (QTextStream &is) +bool kvoctrainDoc::loadTypeNameLex (TQTextStream &is) { - QString s; - QString attr; + TQString s; + TQString attr; type_descr.clear(); @@ -143,7 +143,7 @@ bool kvoctrainDoc::loadTypeNameLex (QTextStream &is) } -bool kvoctrainDoc::saveLessonLex (QTextStream &os) +bool kvoctrainDoc::saveLessonLex (TQTextStream &os) { int i; for (i = 0; i < (int) lesson_descr.size() && i < LEX_MAX_LESSON; i++) @@ -156,10 +156,10 @@ bool kvoctrainDoc::saveLessonLex (QTextStream &os) } -bool kvoctrainDoc::loadLessonLex (QTextStream &is) +bool kvoctrainDoc::loadLessonLex (TQTextStream &is) { - QString s; - QString lesson; + TQString s; + TQString lesson; lesson_descr.clear(); @@ -167,7 +167,7 @@ bool kvoctrainDoc::loadLessonLex (QTextStream &is) s = is.readLine(); lesson = extract (s); if (lesson.stripWhiteSpace().isEmpty()) { - lesson = "#" + QString::number(i+1); + lesson = "#" + TQString::number(i+1); } lesson_descr.push_back (lesson); } @@ -176,7 +176,7 @@ bool kvoctrainDoc::loadLessonLex (QTextStream &is) } -bool kvoctrainDoc::saveToLex (QTextStream& os, QString & /*title*/) +bool kvoctrainDoc::saveToLex (TQTextStream& os, TQString & /*title*/) { os << LEX_IDENT_50 "\n"; os << "LEX|" << getOriginalIdent() << "|" << getIdent(1) << "|" @@ -238,12 +238,12 @@ bool kvoctrainDoc::saveToLex (QTextStream& os, QString & /*title*/) } -bool kvoctrainDoc::loadFromLex (QTextStream& is) +bool kvoctrainDoc::loadFromLex (TQTextStream& is) { langs.clear(); vocabulary.clear(); - QString version, + TQString version, info1, s_dummy, title, @@ -285,7 +285,7 @@ bool kvoctrainDoc::loadFromLex (QTextStream& is) langs.push_back (orgID.left(2).lower()); langs.push_back (transID.left(2).lower()); - QTextStream params (info1, IO_ReadOnly); + TQTextStream params (info1, IO_ReadOnly); params >> i_dummy; params >> i_dummy; params >> i_dummy; @@ -346,17 +346,17 @@ bool kvoctrainDoc::loadFromLex (QTextStream& is) is >> f_grade; is >> lesson; - QString line = is.readLine(); - QString s; + TQString line = is.readLine(); + TQString s; - QString original = extract (line); + TQString original = extract (line); for (int i = 0; i < 3; i++) { s = extract (line); if (!s.isEmpty()) original += ", " +s; } - QString translation = extract (line); + TQString translation = extract (line); for (int i = 0; i < 3; i++) { s = extract (line); if (!s.isEmpty()) @@ -384,12 +384,12 @@ bool kvoctrainDoc::loadFromLex (QTextStream& is) } -void kvoctrainDoc::errorLex (int /*line*/, const QString &text ) +void kvoctrainDoc::errorLex (int /*line*/, const TQString &text ) { unknown_elem = true; - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Error in lex file")); - QString msg = text; + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Error in lex file")); + TQString msg = text; KMessageBox::error(0, msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml1.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml1.cpp index 4aea5283..f07e906d 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml1.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml1.cpp @@ -70,7 +70,7 @@ bool kvoctrainDoc::extract_T_GROUP_attr (XmlReader &xml, bool kvoctrainDoc::loadTypeNameKvtMl (XmlElement elem, XmlReader& xml) { bool endOfGroup = false; - QString s; + TQString s; type_descr.clear(); if (!extract_T_GROUP_attr (xml, elem)) @@ -144,7 +144,7 @@ bool kvoctrainDoc::loadTypeNameKvtMl (XmlElement elem, XmlReader& xml) bool kvoctrainDoc::loadTenseNameKvtMl (XmlElement elem, XmlReader& xml) { bool endOfGroup = false; - QString s; + TQString s; tense_descr.clear(); if (!extract_T_GROUP_attr (xml, elem)) @@ -218,7 +218,7 @@ bool kvoctrainDoc::loadTenseNameKvtMl (XmlElement elem, XmlReader& xml) bool kvoctrainDoc::loadUsageNameKvtMl (XmlElement elem, XmlReader& xml) { bool endOfGroup = false; - QString s; + TQString s; usage_descr.clear(); if (!extract_T_GROUP_attr (xml, elem)) @@ -292,23 +292,23 @@ bool kvoctrainDoc::loadUsageNameKvtMl (XmlElement elem, XmlReader& xml) bool kvoctrainDoc::extract_O_T_attr ( XmlReader &xml, XmlElement &elem, - QString &lang, + TQString &lang, grade_t &grade, grade_t &rev_grade, int &count, int &rev_count, time_t &date, time_t &rev_date, - QString &remark, + TQString &remark, int &bcount, int &rev_bcount, - QString &query_id, - QString &pronunce, + TQString &query_id, + TQString &pronunce, int &width, - QString &type, - QString &faux_ami_f, - QString &faux_ami_t, - QString &synonym, - QString &example, - QString &antonym, - QString &usage, - QString ¶phrase) + TQString &type, + TQString &faux_ami_f, + TQString &faux_ami_t, + TQString &synonym, + TQString &example, + TQString &antonym, + TQString &usage, + TQString ¶phrase) { grade = KV_NORM_GRADE; rev_grade = KV_NORM_GRADE; @@ -345,7 +345,7 @@ bool kvoctrainDoc::extract_O_T_attr ( } else if ((*first).name () == KV_GRADE) { - QString s = (*first).stringValue(); + TQString s = (*first).stringValue(); if ((pos = s.find(';')) >= 1) { grade = s.left(pos).toInt(); @@ -356,7 +356,7 @@ bool kvoctrainDoc::extract_O_T_attr ( } else if ((*first).name () == KV_COUNT) { - QString s = (*first).stringValue(); + TQString s = (*first).stringValue(); if ((pos = s.find(';')) >= 1) { count = s.left(pos).toInt(); rev_count = s.mid(pos+1, s.length()).toInt(); @@ -366,7 +366,7 @@ bool kvoctrainDoc::extract_O_T_attr ( } else if ((*first).name () == KV_BAD) { - QString s = (*first).stringValue(); + TQString s = (*first).stringValue(); if ((pos = s.find(';')) >= 1) { bcount = s.left(pos).toInt(); rev_bcount = s.mid(pos+1, s.length()).toInt(); @@ -375,7 +375,7 @@ bool kvoctrainDoc::extract_O_T_attr ( } else if ((*first).name () == KV_DATE) { - QString s = (*first).stringValue(); + TQString s = (*first).stringValue(); if ((pos = s.find(';')) >= 1) { date = s.left(pos).toInt(); rev_date = s.mid(pos+1, s.length()).toInt(); @@ -386,7 +386,7 @@ bool kvoctrainDoc::extract_O_T_attr ( } else if ((*first).name () == KV_DATE2) { - QString s = (*first).stringValue(); + TQString s = (*first).stringValue(); if ((pos = s.find(';')) >= 1) { date = decompressDate (s.left(pos)); rev_date = decompressDate (s.mid(pos+1, s.length())); @@ -422,7 +422,7 @@ bool kvoctrainDoc::extract_O_T_attr ( if (usage.length() != 0 && usage.left(1) == UL_USER_USAGE) { int num = QMIN(usage.mid (1, 40).toInt(), 1000); // paranioa check if( num > (int) usage_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = usage_descr.size(); i < num; i++) { s.setNum (i+1); s.insert (0, "#"); // invent descr according to number @@ -452,7 +452,7 @@ bool kvoctrainDoc::extract_O_T_attr ( if (type.length() != 0 && type.left(1) == QM_USER_TYPE) { int num = QMIN(type.mid (1, 40).toInt(), 1000); // paranoia check if( num > (int) type_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = type_descr.size(); i < num; i++) { s.setNum (i+1); s.insert (0, "#"); // invent descr according to number @@ -487,7 +487,7 @@ bool kvoctrainDoc::extract_KVT_E_attr ( int &lesson, bool &sel, bool &active, - QString &type) + TQString &type) { lesson = 0; sel = false; @@ -513,7 +513,7 @@ bool kvoctrainDoc::extract_KVT_E_attr ( if (type.length() != 0 && type.left(1) == QM_USER_TYPE) { int num = QMIN(type.mid (1, 40).toInt(), 1000); // paranoia check if( num > (int) type_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = type_descr.size(); i < num; i++) { s.setNum (i+1); s.insert (0, "#"); // invent descr according to number @@ -543,7 +543,7 @@ bool kvoctrainDoc::loadComparison (Comparison &comp, XmlElement elem, */ { bool endOfGroup = false; - QString s; + TQString s; comp.clear(); do { @@ -610,7 +610,7 @@ bool kvoctrainDoc::loadMultipleChoice (MultipleChoice &mc, XmlElement elem, { bool endOfGroup = false; - QString s; + TQString s; mc.clear(); do { @@ -816,17 +816,17 @@ bool kvoctrainDoc::parseBody_kvtml (XmlElement elem, XmlReader& xml) } -bool kvoctrainDoc::unknownAttribute (int line, const QString &name, - const QString &attr ) +bool kvoctrainDoc::unknownAttribute (int line, const TQString &name, + const TQString &attr ) { if (unknown_attr) // show dialog only once return true; // proceed unknown_attr = true; - QString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); + TQString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); - QString format = i18n( + TQString format = i18n( "Your document contains an unknown attribute <%1> " // keep trailing space "in tag <%2>.\n" "Maybe your version of KVocTrain is too old, " @@ -834,55 +834,55 @@ bool kvoctrainDoc::unknownAttribute (int line, const QString &name, "If you proceed and save afterwards you are likely to lose data;\n" "do you want to proceed anyway?\n" ); - QString msg = format.arg(attr).arg(name); + TQString msg = format.arg(attr).arg(name); - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Unknown attribute")); + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Unknown attribute")); bool result = (KMessageBox::warningContinueCancel(0, ln+msg, s) == KMessageBox::Continue); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return result; } -void kvoctrainDoc::unknownElement (int line, const QString &elem ) +void kvoctrainDoc::unknownElement (int line, const TQString &elem ) { unknown_elem = true; - QString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); + TQString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); - QString format = i18n( + TQString format = i18n( "Your document contains an unknown tag <%1>. " // keep trailing space "Maybe your version of KVocTrain is too old, " "or the document is damaged.\n" "Loading is aborted because KVocTrain cannot " "read documents with unknown elements.\n" ); - QString msg = format.arg(elem); - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Unknown element")); + TQString msg = format.arg(elem); + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Unknown element")); KMessageBox::sorry(0, ln+msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } -void kvoctrainDoc::errorKvtMl (int line, const QString &text ) +void kvoctrainDoc::errorKvtMl (int line, const TQString &text ) { - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Error")); - QString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Error")); + TQString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); - QString msg = text; + TQString msg = text; KMessageBox::error(0, ln+msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } -void kvoctrainDoc::warningKvtMl (int line, const QString &text ) +void kvoctrainDoc::warningKvtMl (int line, const TQString &text ) { - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Warning")); - QString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); - QString msg = text; + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Warning")); + TQString ln = i18n("File:\t%1\nLine:\t%2\n").arg(URL().path()).arg(line); + TQString msg = text; KMessageBox::information(0, ln+msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml2.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml2.cpp index 8179bfa6..f4443ca5 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml2.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_rb_kvtml2.cpp @@ -37,30 +37,30 @@ bool kvoctrainDoc::parseBody_e (XmlElement elem, XmlReader& xml) r_qcount; int bcount, r_bcount; - QString remark; - QString pronunce; + TQString remark; + TQString pronunce; time_t qdate, r_qdate; bool inquery; bool active; - QString lang; - QString textstr; - QString exprtype; + TQString lang; + TQString textstr; + TQString exprtype; bool org_found = false; - QString q_org, + TQString q_org, q_trans; - QString query_id; + TQString query_id; kvoctrainExpr expr; int lesson; int width; - QString type; - QString faux_ami_f; - QString faux_ami_t; - QString synonym; - QString example; - QString antonym; - QString usage; - QString paraphrase; + TQString type; + TQString faux_ami_f; + TQString faux_ami_t; + TQString synonym; + TQString example; + TQString antonym; + TQString usage; + TQString paraphrase; vector conjug; Comparison comparison; MultipleChoice mc; @@ -70,7 +70,7 @@ bool kvoctrainDoc::parseBody_e (XmlElement elem, XmlReader& xml) if (lesson && lesson > (int) lesson_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = lesson_descr.size(); i < lesson; i++) { s.setNum (i+1); s.insert (0, "#"); // invent descr according to number @@ -164,7 +164,7 @@ bool kvoctrainDoc::parseBody_e (XmlElement elem, XmlReader& xml) } if (elem.tag () == KV_CONJUG_GRP && !elem.isEndTag() ) { - if (!loadConjugKvtMl (conjug, (QString) KV_CON_TYPE, elem, xml)) + if (!loadConjugKvtMl (conjug, (TQString) KV_CON_TYPE, elem, xml)) return false; if (! xml.readElement (elem) ) { @@ -324,7 +324,7 @@ bool kvoctrainDoc::parseBody_e (XmlElement elem, XmlReader& xml) } if (elem.tag () == KV_CONJUG_GRP && !elem.isEndTag() ) { - if (!loadConjugKvtMl (conjug, (QString) KV_CON_TYPE, elem, xml)) + if (!loadConjugKvtMl (conjug, (TQString) KV_CON_TYPE, elem, xml)) return false; if (! xml.readElement (elem) ) { diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_rh_kvtml.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_rh_kvtml.cpp index e6588675..f952b38a 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_rh_kvtml.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_rh_kvtml.cpp @@ -27,14 +27,14 @@ #include -#include +#include -bool kvoctrainDoc::loadFromKvtMl (QTextStream& is) +bool kvoctrainDoc::loadFromKvtMl (TQTextStream& is) { // important, first action // switch to actual encoding afterwards, otherwise blocked - is.setCodec(QTextCodec::codecForName("UTF-8")); - is.setEncoding(QTextStream::UnicodeUTF8); + is.setCodec(TQTextCodec::codecForName("UTF-8")); + is.setEncoding(TQTextStream::UnicodeUTF8); langs.clear(); vocabulary.clear(); @@ -71,20 +71,20 @@ bool kvoctrainDoc::loadFromKvtMl (QTextStream& is) if ((*first).name () == KV_ENCODING) { - if ((*first).stringValue().upper() == (QString)"UTF-8" ) { - is.setCodec(QTextCodec::codecForName("UTF-8")); - is.setEncoding(QTextStream::UnicodeUTF8); + if ((*first).stringValue().upper() == (TQString)"UTF-8" ) { + is.setCodec(TQTextCodec::codecForName("UTF-8")); + is.setEncoding(TQTextStream::UnicodeUTF8); } - else if ((*first).stringValue().upper() == (QString)"8BIT" ) { // old compatibility mode - is.setCodec(QTextCodec::codecForName("ISO 8859-1")); - is.setEncoding(QTextStream::Latin1); + else if ((*first).stringValue().upper() == (TQString)"8BIT" ) { // old compatibility mode + is.setCodec(TQTextCodec::codecForName("ISO 8859-1")); + is.setEncoding(TQTextStream::Latin1); } else { - is.setCodec(QTextCodec::codecForName("ISO 8859-1")); - is.setEncoding(QTextStream::Latin1); - QString format = i18n("Unknown document encoding \"%1\" was encountered.\n\n" + is.setCodec(TQTextCodec::codecForName("ISO 8859-1")); + is.setEncoding(TQTextStream::Latin1); + TQString format = i18n("Unknown document encoding \"%1\" was encountered.\n\n" "It will be ignored. Encoding is now \"%2\"."); - QString msg =format.arg((*first).stringValue ().upper()).arg("ISO 8859-1"); + TQString msg =format.arg((*first).stringValue ().upper()).arg("ISO 8859-1"); warningKvtMl (xml.lineNumber(), msg); } @@ -155,7 +155,7 @@ bool kvoctrainDoc::extract_L_DESCR_attr (XmlReader &xml, } -bool kvoctrainDoc::check_Empty_attr (QString tag_name, +bool kvoctrainDoc::check_Empty_attr (TQString tag_name, XmlReader &xml, XmlElement &elem) { @@ -168,10 +168,10 @@ bool kvoctrainDoc::check_Empty_attr (QString tag_name, } -bool kvoctrainDoc::extract_simple_tag (QString tag_name, +bool kvoctrainDoc::extract_simple_tag (TQString tag_name, XmlReader& xml, XmlElement &elem, - QString &data, + TQString &data, bool check_it) { if (check_it) @@ -208,7 +208,7 @@ bool kvoctrainDoc::extract_simple_tag (QString tag_name, bool kvoctrainDoc::extract_CON_E_attr (XmlReader& xml, XmlElement &elem, - QString &lang) + TQString &lang) { lang = ""; @@ -246,19 +246,19 @@ bool kvoctrainDoc::loadArticleKvtMl (XmlElement elem, XmlReader& xml) { bool endOfGroup = false; bool inEntry = false; - QString s; + TQString s; articles.clear(); if (!check_Empty_attr (KV_ARTICLE_GRP, xml, elem)) return false; - QString fem_def, + TQString fem_def, mal_def, nat_def, fem_indef, mal_indef, nat_indef; - QString lang; + TQString lang; int count = 0; do { @@ -391,7 +391,7 @@ bool kvoctrainDoc::loadArticleKvtMl (XmlElement elem, XmlReader& xml) bool kvoctrainDoc::extract_T_attr (XmlReader &xml, XmlElement &elem, - QString &name) + TQString &name) { name = ""; list::const_iterator first = elem.attributes ().begin (); @@ -413,8 +413,8 @@ bool kvoctrainDoc::extract_T_attr (XmlReader &xml, bool kvoctrainDoc::extract_BOOL_attr ( XmlReader &xml, XmlElement &elem, - const QString &tag_name, - const QString &attr_name, + const TQString &tag_name, + const TQString &attr_name, bool &flag) { list::const_iterator first = elem.attributes ().begin (); @@ -432,7 +432,7 @@ bool kvoctrainDoc::extract_BOOL_attr ( bool kvoctrainDoc::loadConjugKvtMl (vector &curr_conjug, - const QString &entry_tag, + const TQString &entry_tag, XmlElement elem, XmlReader& xml) /* @@ -470,7 +470,7 @@ bool kvoctrainDoc::loadConjugKvtMl (vector &curr_conjug, { bool endOfGroup = false; bool inEntry = false; - QString s; + TQString s; curr_conjug.clear(); @@ -479,7 +479,7 @@ bool kvoctrainDoc::loadConjugKvtMl (vector &curr_conjug, bool p3_common, s3_common; - QString pers1_sing, + TQString pers1_sing, pers2_sing, pers3_m_sing, pers3_f_sing, @@ -490,8 +490,8 @@ bool kvoctrainDoc::loadConjugKvtMl (vector &curr_conjug, pers3_f_plur, pers3_n_plur; - QString lang; - QString type; + TQString lang; + TQString type; int count = 0; curr_conjug.push_back (Conjugation()); @@ -546,7 +546,7 @@ bool kvoctrainDoc::loadConjugKvtMl (vector &curr_conjug, if (type.length() != 0 && type.left(1) == UL_USER_TENSE) { int num = QMIN(type.mid (1, 40).toInt(), 1000); // paranoia check if( num > (int) tense_descr.size() ) { // description missing ? - QString s; + TQString s; for (int i = tense_descr.size(); i < num; i++) { s.setNum (i+1); s.insert (0, "#"); // invent descr according to number @@ -731,7 +731,7 @@ bool kvoctrainDoc::extract_L_GROUP_attr (XmlReader &xml, bool kvoctrainDoc::loadLessonKvtMl (XmlElement elem, XmlReader& xml) { bool endOfGroup = false; - QString s; + TQString s; bool isCurr; bool inQuery = false; lesson_descr.clear(); @@ -814,7 +814,7 @@ bool kvoctrainDoc::loadLessonKvtMl (XmlElement elem, XmlReader& xml) bool kvoctrainDoc::loadOptionsKvtMl (XmlElement elem, XmlReader& xml) { bool endOfGroup = false; - QString s; + TQString s; do { if (! xml.readElement (elem)) diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_vcb.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_vcb.cpp index 2dfde3fe..72020b94 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_vcb.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_vcb.cpp @@ -32,31 +32,31 @@ -bool kvoctrainDoc::saveTypeNameVcb (QTextStream &/*os*/) +bool kvoctrainDoc::saveTypeNameVcb (TQTextStream &/*os*/) { return true; } -bool kvoctrainDoc::loadTypeNameVcb (QTextStream &/*is*/) +bool kvoctrainDoc::loadTypeNameVcb (TQTextStream &/*is*/) { return true; } -bool kvoctrainDoc::saveLessonVcb (QTextStream &/*os*/) +bool kvoctrainDoc::saveLessonVcb (TQTextStream &/*os*/) { return true; } -bool kvoctrainDoc::loadLessonVcb (QTextStream &/*is*/) +bool kvoctrainDoc::loadLessonVcb (TQTextStream &/*is*/) { return true; } -bool kvoctrainDoc::saveToVcb (QTextStream& os, QString &/*title*/) +bool kvoctrainDoc::saveToVcb (TQTextStream& os, TQString &/*title*/) { saveTypeNameVcb (os); saveLessonVcb (os); @@ -73,7 +73,7 @@ bool kvoctrainDoc::saveToVcb (QTextStream& os, QString &/*title*/) if (ent_percent != 0 && (ent_no % ent_percent) == 0 ) emit progressChanged(this, int(ent_no / f_ent_percent)); - QString s, exp; + TQString s, exp; exp = (*first).getOriginal()+VCB_SEPARATOR; exp += (*first).getTranslation(1)+VCB_SEPARATOR; @@ -95,7 +95,7 @@ bool kvoctrainDoc::saveToVcb (QTextStream& os, QString &/*title*/) } -bool kvoctrainDoc::loadFromVcb (QTextStream& is) +bool kvoctrainDoc::loadFromVcb (TQTextStream& is) { langs.clear(); @@ -109,7 +109,7 @@ bool kvoctrainDoc::loadFromVcb (QTextStream& is) emit progressChanged (this, 0); for (int l = 0; !is.eof(); l++) { - QString s = is.readLine(); + TQString s = is.readLine(); ln--; if (ln <= 0) { @@ -118,7 +118,7 @@ bool kvoctrainDoc::loadFromVcb (QTextStream& is) } if (!s.stripWhiteSpace().isEmpty()) { - QString o, t; + TQString o, t; grade_t ograde = KV_LEV1_GRADE, tgrade = KV_LEV1_GRADE; size_t odate = time(0), @@ -127,13 +127,13 @@ bool kvoctrainDoc::loadFromVcb (QTextStream& is) int pos = s.find (VCB_SEPARATOR); if (pos >= 0) { o = s.left(pos); - s.remove (0, pos+QString(VCB_SEPARATOR).length()); + s.remove (0, pos+TQString(VCB_SEPARATOR).length()); } pos = s.find (VCB_SEPARATOR); if (pos >= 0) { t = s.left(pos); - s.remove (0, pos+QString(VCB_SEPARATOR).length()); + s.remove (0, pos+TQString(VCB_SEPARATOR).length()); } else { t = s; @@ -142,19 +142,19 @@ bool kvoctrainDoc::loadFromVcb (QTextStream& is) pos = s.find (VCB_SEPARATOR); if (pos >= 0) { ograde = s.left(pos).toInt(); - s.remove (0, pos+QString(VCB_SEPARATOR).length()); + s.remove (0, pos+TQString(VCB_SEPARATOR).length()); } pos = s.find (VCB_SEPARATOR); if (pos >= 0) { tgrade = s.left(pos).toInt(); - s.remove (0, pos+QString(VCB_SEPARATOR).length()); + s.remove (0, pos+TQString(VCB_SEPARATOR).length()); } pos = s.find (VCB_SEPARATOR); if (pos >= 0) { odate = s.left(pos).toInt(); - s.remove (0, pos+QString(VCB_SEPARATOR).length()); + s.remove (0, pos+TQString(VCB_SEPARATOR).length()); } if (s.stripWhiteSpace().length() > 0) { @@ -188,12 +188,12 @@ bool kvoctrainDoc::loadFromVcb (QTextStream& is) } -void kvoctrainDoc::errorVcb (int /*line*/, const QString &text ) +void kvoctrainDoc::errorVcb (int /*line*/, const TQString &text ) { unknown_elem = true; - QApplication::setOverrideCursor( arrowCursor, true ); - QString s = kapp->makeStdCaption(i18n("Error in vocabbox file")); - QString msg = text; + TQApplication::setOverrideCursor( arrowCursor, true ); + TQString s = kapp->makeStdCaption(i18n("Error in vocabbox file")); + TQString msg = text; KMessageBox::error(0, msg, s); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_voc.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_voc.cpp index e99c2e31..7cce072b 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_voc.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_voc.cpp @@ -30,7 +30,7 @@ #include "kvoctraincore.h" -bool kvoctrainDoc::loadFromVoc(QTextStream& is) +bool kvoctrainDoc::loadFromVoc(TQTextStream& is) { author = "http://www.vokabeln.de"; //DO NOT translate @@ -38,7 +38,7 @@ bool kvoctrainDoc::loadFromVoc(QTextStream& is) vocabulary.clear(); lesson_descr.clear(); - QString title, + TQString title, lang1, lang2, expression, @@ -53,7 +53,7 @@ bool kvoctrainDoc::loadFromVoc(QTextStream& is) int lines = 10000; - QStringList titles, + TQStringList titles, languages, words; @@ -68,7 +68,7 @@ bool kvoctrainDoc::loadFromVoc(QTextStream& is) title.append(" "); } - titles = QStringList::split("\",", title); + titles = TQStringList::split("\",", title); doctitle = titles[0].mid(1); wordCount = titles[1].section(',', 0, 0).toInt(); @@ -76,7 +76,7 @@ bool kvoctrainDoc::loadFromVoc(QTextStream& is) is.readLine(); lang1 = is.readLine(); - languages = QStringList::split("\",", lang1); + languages = TQStringList::split("\",", lang1); langs.push_back(languages[0].mid(1)); langs.push_back(languages[1].mid(1)); @@ -102,7 +102,7 @@ bool kvoctrainDoc::loadFromVoc(QTextStream& is) expression.append(" "); } - words = QStringList::split("\",", expression); + words = TQStringList::split("\",", expression); original = words[0].mid(1); translation = words[1].mid(1); lesson = words[2].toInt(); diff --git a/kvoctrain/kvoctrain/kvt-core/kvd_wkvtml.cpp b/kvoctrain/kvoctrain/kvt-core/kvd_wkvtml.cpp index af0ba06d..c3f546c7 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvd_wkvtml.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvd_wkvtml.cpp @@ -28,7 +28,7 @@ #include -#include +#include bool kvoctrainDoc::saveTypeNameKvtMl (XmlWriter &xml) { @@ -124,9 +124,9 @@ bool kvoctrainDoc::saveLessonKvtMl (XmlWriter &xml) xml.startTag (KV_LESS_DESC, false); xml.addAttribute (KV_LESS_NO, lfn+1 ); if (getCurrentLesson() == lfn+1) - xml.addAttribute (KV_LESS_CURR, (QString) "1" ); + xml.addAttribute (KV_LESS_CURR, (TQString) "1" ); if (lfn < (int) lessons_in_query.size() && lessons_in_query[lfn]) - xml.addAttribute (KV_LESS_QUERY, (QString) "1" ); + xml.addAttribute (KV_LESS_QUERY, (TQString) "1" ); xml.closeTag(); xml.writeText (lesson_descr[lfn]); xml.endTag (KV_LESS_DESC, true); @@ -140,8 +140,8 @@ bool kvoctrainDoc::saveLessonKvtMl (XmlWriter &xml) } -bool kvoctrainDoc::saveConjug (const Conjugation &curr_conjug, QString type, - XmlWriter &xml, QString identstr) +bool kvoctrainDoc::saveConjug (const Conjugation &curr_conjug, TQString type, + XmlWriter &xml, TQString identstr) { bool linefeed = type == CONJ_PREFIX; if (linefeed) @@ -260,7 +260,7 @@ bool kvoctrainDoc::saveConjugHeader(vector &curr_conjug, xml.startTag (KV_CONJUG_GRP, false); xml.closeTag(false, true); - QString def, indef, s; + TQString def, indef, s; for (int ent = 0; ent < QMIN((int) curr_conjug.size(), numLangs()); ent++) { xml.writeText(" "); // indent entry a bit xml.startTag (KV_CON_ENTRY, false); @@ -310,7 +310,7 @@ bool kvoctrainDoc::saveComparison (const Comparison &comp, return true; xml.writeText("\n"); - QString identstr; + TQString identstr; identstr.fill (' ', ident+1); xml.writeText(identstr); @@ -361,7 +361,7 @@ bool kvoctrainDoc::saveMultipleChoice (const MultipleChoice &mc, return true; xml.writeText("\n"); - QString identstr; + TQString identstr; identstr.fill (' ', ident+1); xml.writeText(identstr); @@ -431,7 +431,7 @@ bool kvoctrainDoc::saveConjugEntry (Conjugation &curr_conjug, if (curr_conjug.numEntries() == 0 ) return true; - QString identstr; + TQString identstr; identstr.fill (' ', ident+1); xml.writeText("\n"); @@ -439,8 +439,8 @@ bool kvoctrainDoc::saveConjugEntry (Conjugation &curr_conjug, xml.startTag (KV_CONJUG_GRP, false); xml.closeTag(false, true); - QString def, indef, s; - QString type; + TQString def, indef, s; + TQString type; for (int lfn = 0; lfn < (int) curr_conjug.numEntries(); lfn++) { xml.writeText(identstr+" "); // indent entry a bit xml.startTag (KV_CON_TYPE, false); @@ -484,7 +484,7 @@ bool kvoctrainDoc::saveArticleKvtMl (XmlWriter &xml) xml.startTag (KV_ARTICLE_GRP, false); xml.closeTag(false, true); - QString def, indef, s; + TQString def, indef, s; for (int lfn = 0; lfn < QMIN((int) articles.size(), numLangs()); lfn++) { xml.writeText(" "); // indent entry a bit xml.startTag (KV_ART_ENTRY, false); @@ -575,10 +575,10 @@ bool kvoctrainDoc::saveOptionsKvtMl (XmlWriter &xml) } -bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { +bool kvoctrainDoc::saveToKvtMl (TQTextStream& os, TQString &title) { bool first_expr = true; - os.setCodec(QTextCodec::codecForName("UTF-8")); + os.setCodec(TQTextCodec::codecForName("UTF-8")); XmlWriter xml (os); xml.setAutoEndl (false); @@ -650,10 +650,10 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { xml.writeText ("\n "); xml.startTag (KV_DOCTYPE, false); xml.writeText ("\n "); - xml.addAttribute (KV_ENCODING, (QString)"UTF-8"); + xml.addAttribute (KV_ENCODING, (TQString)"UTF-8"); xml.writeText ("\n "); - xml.addAttribute (KV_GENERATOR, (QString) "kvoctrain" KVD_VERS_PREFIX KVOCTRAIN_VERSION_STRING); + xml.addAttribute (KV_GENERATOR, (TQString) "kvoctrain" KVD_VERS_PREFIX KVOCTRAIN_VERSION_STRING); xml.writeText ("\n "); xml.addAttribute (KV_COLS, numLangs() ); xml.writeText ("\n "); @@ -707,7 +707,7 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { if (!saveUsageNameKvtMl(xml)) return false; - QString q_org, q_trans; + TQString q_org, q_trans; vector::const_iterator first = vocabulary.begin (); getQueryLang (q_org, q_trans); @@ -725,7 +725,7 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { emit progressChanged(this, ent_no / (int) f_ent_percent); if ((*first).getLesson() != 0) { // entry belongs to lesson x - QString ls; + TQString ls; int lm = (*first).getLesson(); if (lm > (int) lesson_descr.size() ) { // should not be kdError() << "index of lesson member too high: " << lm << endl; @@ -736,11 +736,11 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { } if ((*first).isInQuery()) { // entry was selected for query - xml.addAttribute (KV_SELECTED, (QString) "1"); + xml.addAttribute (KV_SELECTED, (TQString) "1"); } if (!(*first).isActive()) { // entry was inactive - xml.addAttribute (KV_INACTIVE, (QString) "1"); + xml.addAttribute (KV_INACTIVE, (TQString) "1"); } if ((*first).uniqueType() && !(*first).getType(0).isEmpty()) { @@ -750,7 +750,7 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { xml.closeTag (); xml.startTag (KV_ORG, false); if (first_expr) { // save space, only tell language in first entry - QString s; + TQString s; s.setNum (getSizeHint (0)); xml.addAttribute (KV_SIZEHINT, s); @@ -759,9 +759,9 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { s = "original"; xml.addAttribute (KV_LANG, s); if (s == q_org) - xml.addAttribute (KV_QUERY, (QString) KV_O); + xml.addAttribute (KV_QUERY, (TQString) KV_O); else if (s == q_trans) - xml.addAttribute (KV_QUERY, (QString) KV_T); + xml.addAttribute (KV_QUERY, (TQString) KV_T); } @@ -802,8 +802,8 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { if (!saveMultipleChoice ((*first).getMultipleChoice(0), xml, 1)) return false; - QString s; - QString entype = s = (*first).getType(0); + TQString s; + TQString entype = s = (*first).getType(0); int pos = s.find (QM_TYPE_DIV); if (pos >= 0) entype = s.left (pos); @@ -830,7 +830,7 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { while (trans < (int)langs.size()) { xml.startTag (KV_TRANS, false); if (first_expr) { // save space, only tell language in first entry - QString s; + TQString s; s.setNum (getSizeHint (trans)); xml.addAttribute (KV_SIZEHINT, s); @@ -841,12 +841,12 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { } xml.addAttribute (KV_LANG, s); if (s == q_org) - xml.addAttribute (KV_QUERY, (QString) KV_O); + xml.addAttribute (KV_QUERY, (TQString) KV_O); else if (s == q_trans) - xml.addAttribute (KV_QUERY, (QString) KV_T); + xml.addAttribute (KV_QUERY, (TQString) KV_T); } - QString s1, s2; + TQString s1, s2; if ((*first).getGrade(trans, false) != 0 ||(*first).getGrade(trans, true) != 0) { @@ -923,8 +923,8 @@ bool kvoctrainDoc::saveToKvtMl (QTextStream& os, QString &title) { if (!saveMultipleChoice ((*first).getMultipleChoice(trans), xml, 1)) return false; - QString s; - QString entype = s = (*first).getType(0); + TQString s; + TQString entype = s = (*first).getType(0); int pos = s.find (QM_TYPE_DIV); if (pos >= 0) entype = s.left (pos); diff --git a/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.cpp b/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.cpp index f2701bed..a10aa28a 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.cpp @@ -34,8 +34,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -53,7 +53,7 @@ using namespace std; // kvoctrainDoc //******************************************************** -void kvoctrainDoc::setVersion (const QString & vers) +void kvoctrainDoc::setVersion (const TQString & vers) { doc_version = vers; } @@ -67,7 +67,7 @@ void kvoctrainDoc::getVersion(int &, int &, int &) void kvoctrainDoc::Init () { - setVersion (QString::fromUtf8(KVOCTRAIN_VERSION_STRING)); + setVersion (TQString::fromUtf8(KVOCTRAIN_VERSION_STRING)); lesson_descr.clear(); type_descr.clear(); tense_descr.clear(); @@ -91,18 +91,18 @@ void kvoctrainDoc::Init () } -kvoctrainDoc::kvoctrainDoc(QObject *parent, const KURL& url) +kvoctrainDoc::kvoctrainDoc(TQObject *parent, const KURL& url) { Init(); if (!url.isEmpty()) doc_url = url; - connect( this, SIGNAL(progressChanged(kvoctrainDoc*,int)), parent, SLOT(slotProgress(kvoctrainDoc*,int)) ); + connect( this, TQT_SIGNAL(progressChanged(kvoctrainDoc*,int)), parent, TQT_SLOT(slotProgress(kvoctrainDoc*,int)) ); - QString tmpfile; + TQString tmpfile; if (KIO::NetAccess::download( url, tmpfile, 0 )) { - QFile f(tmpfile); + TQFile f(tmpfile); if (!f.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("Cannot open file
%1
").arg(url.path())); @@ -114,59 +114,59 @@ kvoctrainDoc::kvoctrainDoc(QObject *parent, const KURL& url) bool read = false; while (!read) { - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); switch (ft) { case kvtml: { - QTextStream is (&f); + TQTextStream is (&f); read = loadFromKvtMl (is); } break; case vt_lex: { - QTextStream is (&f); + TQTextStream is (&f); read = loadFromLex (is); } break; case vt_vcb: { - QTextStream is (&f); + TQTextStream is (&f); read = loadFromVcb (is); } break; case vt_voc: { - QTextStream is (&f); + TQTextStream is (&f); read = loadFromVoc(is); } break; case csv: { - QTextStream is(&f); + TQTextStream is(&f); read = loadFromCsv(is); } break; default: { - QTextStream is (&f); + TQTextStream is (&f); read = loadFromKvtMl (is); } } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (!read) { if (unknown_attr || unknown_elem ) { Init(); return; } - QString format = i18n("Could not load \"%1\"\nDo you want to try again?"); - QString msg = format.arg(url.path()); + TQString format = i18n("Could not load \"%1\"\nDo you want to try again?"); + TQString msg = format.arg(url.path()); int result = KMessageBox::warningContinueCancel(0, msg, kapp->makeStdCaption(i18n("I/O Failure")), i18n("&Retry")); @@ -187,15 +187,15 @@ kvoctrainDoc::~kvoctrainDoc() } -bool kvoctrainDoc::saveAs (QObject *parent, const KURL & url, QString title, FileType ft) +bool kvoctrainDoc::saveAs (TQObject *parent, const KURL & url, TQString title, FileType ft) { - connect( this, SIGNAL(progressChanged(kvoctrainDoc*,int)), parent, SLOT(slotProgress(kvoctrainDoc*,int)) ); + connect( this, TQT_SIGNAL(progressChanged(kvoctrainDoc*,int)), parent, TQT_SLOT(slotProgress(kvoctrainDoc*,int)) ); KURL tmp (url); if (title == i18n("Untitled")) - title = QString::null; + title = TQString::null; if (title == doc_url.fileName()) - title = QString::null; + title = TQString::null; if (ft == automatic) { @@ -218,7 +218,7 @@ bool kvoctrainDoc::saveAs (QObject *parent, const KURL & url, QString title, Fil while (!saved) { - QFile f(tmp.path()); + TQFile f(tmp.path()); if (!f.open(IO_WriteOnly)) { @@ -226,28 +226,28 @@ bool kvoctrainDoc::saveAs (QObject *parent, const KURL & url, QString title, Fil return false; } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); switch (ft) { case kvtml: { - QTextStream os( &f ); // serialize using f + TQTextStream os( &f ); // serialize using f saved = saveToKvtMl(os, title); } break; case vt_lex: { - QTextStream os( &f ); // serialize using f + TQTextStream os( &f ); // serialize using f saved = saveToLex(os, title); } break; case vt_vcb: { - QTextStream os( &f ); // serialize using f + TQTextStream os( &f ); // serialize using f saved = saveToVcb(os, title); } break; case csv: { - QTextStream os( &f ); // serialize using f + TQTextStream os( &f ); // serialize using f saved = saveToCsv(os, title); } break; @@ -258,11 +258,11 @@ bool kvoctrainDoc::saveAs (QObject *parent, const KURL & url, QString title, Fil break; } f.close(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (!saved) { - QString format = i18n("Could not save \"%1\"\nDo you want to try again?"); - QString msg = format.arg(tmp.path()); + TQString format = i18n("Could not save \"%1\"\nDo you want to try again?"); + TQString msg = format.arg(tmp.path()); int result = KMessageBox::warningContinueCancel(0, msg, kapp->makeStdCaption(i18n("I/O Failure")), i18n("&Retry")); @@ -292,9 +292,9 @@ void kvoctrainDoc::removeEntry(int index) } -int kvoctrainDoc::findIdent (const QString &lang) const +int kvoctrainDoc::findIdent (const TQString &lang) const { - vector::const_iterator first = langs.begin(); + vector::const_iterator first = langs.begin(); int count = 0; while (first != langs.end()) { if ( *first == lang) @@ -306,7 +306,7 @@ int kvoctrainDoc::findIdent (const QString &lang) const } -QString kvoctrainDoc::getIdent (int index) const +TQString kvoctrainDoc::getIdent (int index) const { if (index >= (int)langs.size() || index < 1 ) return ""; @@ -315,7 +315,7 @@ QString kvoctrainDoc::getIdent (int index) const } -void kvoctrainDoc::setIdent (int idx, const QString &id) +void kvoctrainDoc::setIdent (int idx, const TQString &id) { if (idx < (int)langs.size() && idx >= 1 ) { langs[idx] = id; @@ -323,7 +323,7 @@ void kvoctrainDoc::setIdent (int idx, const QString &id) } -QString kvoctrainDoc::getTypeName (int index) const +TQString kvoctrainDoc::getTypeName (int index) const { if (index >= (int)type_descr.size()) return ""; @@ -332,7 +332,7 @@ QString kvoctrainDoc::getTypeName (int index) const } -void kvoctrainDoc::setTypeName (int idx, QString &id) +void kvoctrainDoc::setTypeName (int idx, TQString &id) { if (idx >= (int)type_descr.size()) for (int i = (int)type_descr.size(); i <= idx; i++) @@ -342,7 +342,7 @@ void kvoctrainDoc::setTypeName (int idx, QString &id) } -QString kvoctrainDoc::getTenseName (int index) const +TQString kvoctrainDoc::getTenseName (int index) const { if (index >= (int)tense_descr.size()) return ""; @@ -351,7 +351,7 @@ QString kvoctrainDoc::getTenseName (int index) const } -void kvoctrainDoc::setTenseName (int idx, QString &id) +void kvoctrainDoc::setTenseName (int idx, TQString &id) { if (idx >= (int)tense_descr.size()) for (int i = (int)tense_descr.size(); i <= idx; i++) @@ -361,7 +361,7 @@ void kvoctrainDoc::setTenseName (int idx, QString &id) } -QString kvoctrainDoc::getUsageName (int index) const +TQString kvoctrainDoc::getUsageName (int index) const { if (index >= (int)usage_descr.size()) return ""; @@ -370,7 +370,7 @@ QString kvoctrainDoc::getUsageName (int index) const } -void kvoctrainDoc::setUsageName (int idx, QString &id) +void kvoctrainDoc::setUsageName (int idx, TQString &id) { if (idx >= (int)usage_descr.size()) for (int i = (int)usage_descr.size(); i <= idx; i++) @@ -499,7 +499,7 @@ void kvoctrainDoc::removeIdent (int index) } -QString kvoctrainDoc::getOriginalIdent () const +TQString kvoctrainDoc::getOriginalIdent () const { if (langs.size() > 0) return langs[0]; @@ -508,7 +508,7 @@ QString kvoctrainDoc::getOriginalIdent () const } -void kvoctrainDoc::setOriginalIdent (const QString &id) +void kvoctrainDoc::setOriginalIdent (const TQString &id) { if (langs.size() > 0) { langs[0] = id; @@ -528,9 +528,9 @@ public: { return !dir - ? (QString::compare(x.getOriginal().upper(), + ? (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) < 0) - : (QString::compare(x.getOriginal().upper(), + : (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) > 0); } @@ -553,16 +553,16 @@ public: if (x.getLesson() != y.getLesson() ) return !dir - ? (QString::compare(doc.getLessonDescr(x.getLesson()).upper(), + ? (TQString::compare(doc.getLessonDescr(x.getLesson()).upper(), doc.getLessonDescr(y.getLesson()).upper() ) < 0) - : (QString::compare(doc.getLessonDescr(x.getLesson()).upper(), + : (TQString::compare(doc.getLessonDescr(x.getLesson()).upper(), doc.getLessonDescr(y.getLesson()).upper() ) > 0); else return !dir - ? (QString::compare(x.getOriginal().upper(), + ? (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) < 0) - : (QString::compare(x.getOriginal().upper(), + : (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) > 0); } @@ -591,9 +591,9 @@ public: else return !dir - ? (QString::compare(x.getOriginal().upper(), + ? (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) < 0) - : (QString::compare(x.getOriginal().upper(), + : (TQString::compare(x.getOriginal().upper(), y.getOriginal().upper() ) > 0); } @@ -615,9 +615,9 @@ public: { return !dir - ? (QString::compare(x.getTranslation(index).upper(), + ? (TQString::compare(x.getTranslation(index).upper(), y.getTranslation(index).upper() ) < 0) - : (QString::compare(x.getTranslation(index).upper(), + : (TQString::compare(x.getTranslation(index).upper(), y.getTranslation(index).upper() ) > 0); } @@ -740,7 +740,7 @@ void kvoctrainDoc::resetEntry (int index, int lesson) } -QString kvoctrainDoc::getLessonDescr(int idx) const +TQString kvoctrainDoc::getLessonDescr(int idx) const { if (idx == 0) return i18n(""); @@ -778,7 +778,7 @@ void kvoctrainDoc::setLessonsInQuery(vector lesson_iq) } -QString kvoctrainDoc::getTitle() const +TQString kvoctrainDoc::getTitle() const { if (doctitle.isEmpty()) return doc_url.fileName(); @@ -787,49 +787,49 @@ QString kvoctrainDoc::getTitle() const } -QString kvoctrainDoc::getAuthor() const +TQString kvoctrainDoc::getAuthor() const { return author; } -QString kvoctrainDoc::getLicense() const +TQString kvoctrainDoc::getLicense() const { return license; } -QString kvoctrainDoc::getDocRemark() const +TQString kvoctrainDoc::getDocRemark() const { return doc_remark; } -void kvoctrainDoc::setTitle(const QString & title) +void kvoctrainDoc::setTitle(const TQString & title) { doctitle = title.stripWhiteSpace(); } -void kvoctrainDoc::setAuthor(const QString & s) +void kvoctrainDoc::setAuthor(const TQString & s) { author = s.stripWhiteSpace(); } -void kvoctrainDoc::setLicense(const QString & s) +void kvoctrainDoc::setLicense(const TQString & s) { license = s.stripWhiteSpace(); } -void kvoctrainDoc::setDocRemark(const QString & s) +void kvoctrainDoc::setDocRemark(const TQString & s) { doc_remark = s.stripWhiteSpace(); } -int kvoctrainDoc::search(QString substr, int id, +int kvoctrainDoc::search(TQString substr, int id, int first, int last, bool word_start, bool) @@ -877,12 +877,12 @@ int kvoctrainDoc::search(QString substr, int id, #define _BITMASK 0x3F #define _BITUSED 6 -QString kvoctrainDoc::compressDate(unsigned long l) const +TQString kvoctrainDoc::compressDate(unsigned long l) const { if (l == 0) return ""; - QString res; + TQString res; if (l <= KVD_ZERO_TIME) l = 1; else @@ -896,7 +896,7 @@ QString kvoctrainDoc::compressDate(unsigned long l) const } -unsigned long kvoctrainDoc::decompressDate(QString s) const +unsigned long kvoctrainDoc::decompressDate(TQString s) const { if (s.isEmpty()) return 0; @@ -912,13 +912,13 @@ unsigned long kvoctrainDoc::decompressDate(QString s) const } -kvoctrainDoc::FileType kvoctrainDoc::detectFT(const QString &filename) +kvoctrainDoc::FileType kvoctrainDoc::detectFT(const TQString &filename) { - QFile f( filename ); + TQFile f( filename ); if (!f.open( IO_ReadOnly )) return csv; - QDataStream is( &f ); + TQDataStream is( &f ); Q_INT8 c1, c2, c3, c4, c5; is >> c1 @@ -927,8 +927,8 @@ kvoctrainDoc::FileType kvoctrainDoc::detectFT(const QString &filename) >> c4 >> c5; // guess filetype by first x bytes - QTextStream ts (&f); - QString line; + TQTextStream ts (&f); + TQString line; line = ts.readLine(); line.insert (0, c5); line.insert (0, c4); @@ -949,7 +949,7 @@ kvoctrainDoc::FileType kvoctrainDoc::detectFT(const QString &filename) if (line == LEX_IDENT_50) return vt_lex; - if (c1 == '"' && (line.contains('"') == 1 || line.contains(QRegExp("\",[0-9]")))) + if (c1 == '"' && (line.contains('"') == 1 || line.contains(TQRegExp("\",[0-9]")))) return vt_voc; return csv; @@ -968,9 +968,9 @@ public: bool operator< (const expRef& y) const { - QString s1 = exp->getOriginal(); - QString s2 = y.exp->getOriginal(); - int cmp = QString::compare(s1.upper(), s2.upper()); + TQString s1 = exp->getOriginal(); + TQString s2 = y.exp->getOriginal(); + int cmp = TQString::compare(s1.upper(), s2.upper()); if (cmp != 0) return cmp < 0; @@ -978,7 +978,7 @@ public: s1 = exp->getTranslation(i); s2 = y.exp->getTranslation(i); - cmp = QString::compare(s1.upper(), s2.upper() ); + cmp = TQString::compare(s1.upper(), s2.upper() ); if (cmp != 0) return cmp < 0; } diff --git a/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.h b/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.h index d0defb5a..2f2c5f99 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.h +++ b/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.h @@ -31,7 +31,7 @@ #include #endif -#include +#include #include @@ -265,7 +265,7 @@ class kvoctrainDoc : public QObject * @param obj calling object * @param url URL of file to parse */ - kvoctrainDoc(QObject* obj, const KURL& url); + kvoctrainDoc(TQObject* obj, const KURL& url); /** Destructor for the fileclass of the application */ ~kvoctrainDoc(); @@ -325,25 +325,25 @@ class kvoctrainDoc : public QObject /** returns original´s identifier */ - QString getOriginalIdent () const; + TQString getOriginalIdent () const; /** set original´s identifier */ - void setOriginalIdent (const QString &id); + void setOriginalIdent (const TQString &id); /** returns identifier of translation x * * @param index number of translation 1..x * @result ident string: de=german, en=englisch, .. */ - QString getIdent (int index) const; + TQString getIdent (int index) const; /** sets identifier of translation * * @param index number of translation 1..x * @param lang ident string: de=german, en=englisch, .. */ - void setIdent (int index, const QString &lang); + void setIdent (int index, const TQString &lang); /** removes identifier an the according translation in all entries * @@ -356,67 +356,67 @@ class kvoctrainDoc : public QObject * @param lang identifier of language * @result index of translation, 0=original, -1=none */ - int findIdent (const QString &lang) const; + int findIdent (const TQString &lang) const; /** returns attribute string * * @param index number of attribute * @result string */ - QString getTypeName (int index) const; + TQString getTypeName (int index) const; /** sets attribute string * * @param index number of attribute * @param str name of attribute */ - void setTypeName (int index, QString &str); + void setTypeName (int index, TQString &str); /** gets descr of types */ - inline vector getTypeDescr() const { return type_descr; } + inline vector getTypeDescr() const { return type_descr; } /** sets descr of types */ - inline void setTypeDescr(vector names) { type_descr = names; } + inline void setTypeDescr(vector names) { type_descr = names; } /** returns tense string * * @param index number of tense * @result string */ - QString getTenseName (int index) const; + TQString getTenseName (int index) const; /** sets tense string * * @param index number of tense * @param str name of tense */ - void setTenseName (int index, QString &str); + void setTenseName (int index, TQString &str); /** gets descr of tenses */ - inline vector getTenseDescr() const { return tense_descr; } + inline vector getTenseDescr() const { return tense_descr; } /** sets descr of tenses */ - inline void setTenseDescr(vector names) { tense_descr = names; } + inline void setTenseDescr(vector names) { tense_descr = names; } /** returns usage string * * @param index number of usage * @result string */ - QString getUsageName (int index) const; + TQString getUsageName (int index) const; /** sets usage string * * @param index number of usage * @param str name of usage */ - void setUsageName (int index, QString &str); + void setUsageName (int index, TQString &str); /** gets descr of usages */ - inline vector getUsageDescr() const { return usage_descr; } + inline vector getUsageDescr() const { return usage_descr; } /** sets descr of usages */ - inline void setUsageDescr(vector names) { usage_descr = names; } + inline void setUsageDescr(vector names) { usage_descr = names; } /** saves the data under the given name @@ -424,7 +424,7 @@ class kvoctrainDoc : public QObject * @param url if url is empty (or NULL) actual name is preserved * @result true if successful */ - bool saveAs (QObject *parent, const KURL & url, QString title, FileType ft); + bool saveAs (TQObject *parent, const KURL & url, TQString title, FileType ft); /** returns count of entries */ @@ -444,7 +444,7 @@ class kvoctrainDoc : public QObject /** append new lang ident */ - inline void appendLang(const QString & id) { langs.push_back(id); } + inline void appendLang(const TQString & id) { langs.push_back(id); } /** returns pointer to expression object x * @@ -464,7 +464,7 @@ class kvoctrainDoc : public QObject * @param tolerant * @result index of found entry, -1 if none */ - int search(QString substr, int id, + int search(TQString substr, int id, int first=0, int last=-1, bool word_start = false, bool tolerant=false); /** returns url of xml file */ @@ -474,34 +474,34 @@ class kvoctrainDoc : public QObject inline void setURL(const KURL& url) {doc_url = url;} /** returns title of xml file */ - QString getTitle() const; + TQString getTitle() const; /** returns author of file */ - QString getAuthor() const; + TQString getAuthor() const; /** returns license of file */ - QString getLicense() const; + TQString getLicense() const; /** returns remark of file */ - QString getDocRemark() const; + TQString getDocRemark() const; - inline void getQueryLang(QString &org, QString &trans) const + inline void getQueryLang(TQString &org, TQString &trans) const { org = queryorg; trans = querytrans; } - inline void setQueryLang(const QString &org, const QString &trans) + inline void setQueryLang(const TQString &org, const TQString &trans) { queryorg = org; querytrans = trans; } /** sets title of xml file */ - void setTitle(const QString & title); + void setTitle(const TQString & title); /** sets author of file */ - void setAuthor(const QString & author); + void setAuthor(const TQString & author); /** sets license of file */ - void setLicense(const QString & license); + void setLicense(const TQString & license); /** sets remark of file */ - void setDocRemark(const QString & rem); + void setDocRemark(const TQString & rem); /** gets version of loaded file */ void getVersion(int &major, int &minor, int &patch); @@ -515,7 +515,7 @@ class kvoctrainDoc : public QObject inline void setCurrentLesson(int lesson) { current_lesson = lesson; } /** returns descr of lesson */ - QString getLessonDescr(int index) const; + TQString getLessonDescr(int index) const; /** returns lessons in current query */ vector getLessonsInQuery() const; @@ -523,12 +523,12 @@ class kvoctrainDoc : public QObject /** sets lessons in current query */ void setLessonsInQuery(vector); - inline vector getLessonDescr() const { return lesson_descr; } + inline vector getLessonDescr() const { return lesson_descr; } inline int numLessons () const {return (int) lesson_descr.size(); } /** sets descr of lesson */ - inline void setLessonDescr(vector names) { lesson_descr = names; } + inline void setLessonDescr(vector names) { lesson_descr = names; } /** returns pointer to conjugations if available * @@ -557,10 +557,10 @@ class kvoctrainDoc : public QObject void setArticle(int index, const Article &art); /** compress date */ - QString compressDate(unsigned long) const; + TQString compressDate(unsigned long) const; /** decompress date */ - unsigned long decompressDate(QString) const; + unsigned long decompressDate(TQString) const; /** returns recommended size * @@ -576,16 +576,16 @@ class kvoctrainDoc : public QObject */ void setSizeHint (int index, const int width); - bool unknownAttribute (int line, const QString &name, const QString &attr); - void unknownElement (int line, const QString &elem ); - void errorKvtMl (int line, const QString &text ); - void warningKvtMl (int line, const QString &text ); + bool unknownAttribute (int line, const TQString &name, const TQString &attr); + void unknownElement (int line, const TQString &elem ); + void errorKvtMl (int line, const TQString &text ); + void warningKvtMl (int line, const TQString &text ); - void errorLex (int line, const QString &text ); + void errorLex (int line, const TQString &text ); - void errorCsv (int line, const QString &text ); + void errorCsv (int line, const TQString &text ); - FileType detectFT(const QString &filename); + FileType detectFT(const TQString &filename); friend class QueryManager; @@ -598,14 +598,14 @@ protected: void Init(); /** sets version of loaded file */ - void setVersion(const QString & ver); + void setVersion(const TQString & ver); - bool saveToKvtMl (QTextStream& os, QString &title); - bool loadFromKvtMl (QTextStream& is); + bool saveToKvtMl (TQTextStream& os, TQString &title); + bool loadFromKvtMl (TQTextStream& is); bool parseBody_kvtml (XmlElement elem, XmlReader& xml); bool parseBody_e (XmlElement elem, XmlReader& xml); - bool extract_simple_tag (QString tag_name, XmlReader& xml, - XmlElement &elem, QString &data, + bool extract_simple_tag (TQString tag_name, XmlReader& xml, + XmlElement &elem, TQString &data, bool check_empty = true); bool extract_T_GROUP_attr (XmlReader &xml, @@ -614,23 +614,23 @@ protected: XmlElement &elem, int &no); bool extract_O_T_attr (XmlReader &xml, XmlElement &elem, - QString &lang, + TQString &lang, grade_t &grade, grade_t &rev_grade, int &count, int &rev_count, time_t &date, time_t &rev_date, - QString &remark, + TQString &remark, int &bcount, int &rev_bcount, - QString &query_id, - QString &pronunce, + TQString &query_id, + TQString &pronunce, int &width, - QString &type, - QString &faux_ami_f, - QString &faux_ami_t, - QString &synonym, - QString &example, - QString &antonym, - QString &usage, - QString ¶phrase); + TQString &type, + TQString &faux_ami_f, + TQString &faux_ami_t, + TQString &synonym, + TQString &example, + TQString &antonym, + TQString &usage, + TQString ¶phrase); bool extract_L_DESCR_attr (XmlReader &xml, XmlElement &elem, int &no, bool &isCurr, bool &inQuery); @@ -639,20 +639,20 @@ protected: int &lesson, bool &sel, bool &active, - QString &type); - bool check_Empty_attr (QString tag_name, + TQString &type); + bool check_Empty_attr (TQString tag_name, XmlReader &xml, XmlElement &elem); bool extract_CON_E_attr (XmlReader& xml, XmlElement &elem, - QString &lang); + TQString &lang); bool extract_T_attr (XmlReader &xml, XmlElement &elem, - QString &name); + TQString &name); bool extract_BOOL_attr (XmlReader &xml, XmlElement &elem, - const QString &tag_name, - const QString &attr_name, + const TQString &tag_name, + const TQString &attr_name, bool &flag); bool extract_L_GROUP_attr (XmlReader &xml, XmlElement &elem, @@ -672,11 +672,11 @@ protected: bool loadArticleKvtMl (XmlElement elem, XmlReader& xml); bool saveConjugHeader (vector &curr_conjug, XmlWriter &xml); - bool saveConjug (const Conjugation &curr_conjug, QString type, - XmlWriter &xml, QString identstr); + bool saveConjug (const Conjugation &curr_conjug, TQString type, + XmlWriter &xml, TQString identstr); bool saveConjugEntry (Conjugation &curr_conjug, XmlWriter &xml, int ident); - bool loadConjugKvtMl (vector &curr_conjug, const QString &entry_tag, + bool loadConjugKvtMl (vector &curr_conjug, const TQString &entry_tag, XmlElement elem, XmlReader& xml); bool saveComparison (const Comparison &comp, XmlWriter &xml, int ident); @@ -685,28 +685,28 @@ protected: bool saveMultipleChoice(const MultipleChoice &mc, XmlWriter &xml, int ident); bool loadMultipleChoice(MultipleChoice &mc, XmlElement elem, XmlReader &xml); - bool saveToLex (QTextStream& os, QString &title); - bool loadFromLex (QTextStream& is); - bool loadLessonLex (QTextStream& is); - bool saveLessonLex (QTextStream& os); - bool saveTypeNameLex (QTextStream& os); - bool loadTypeNameLex (QTextStream& is); - - bool saveToCsv (QTextStream& os, QString &title); - bool loadFromCsv (QTextStream& is); - bool loadLessonCsv (QTextStream& is); - bool saveLessonCsv (QTextStream& os); - bool saveTypeNameCsv (QTextStream& os); - bool loadTypeNameCsv (QTextStream& is); - - bool saveTypeNameVcb (QTextStream &os); - bool loadTypeNameVcb (QTextStream &is); - bool saveLessonVcb (QTextStream &os); - bool loadLessonVcb (QTextStream &is); - bool saveToVcb (QTextStream& os, QString &title); - bool loadFromVcb (QTextStream& is); - bool loadFromVoc(QTextStream& is); - void errorVcb (int line, const QString &text ); + bool saveToLex (TQTextStream& os, TQString &title); + bool loadFromLex (TQTextStream& is); + bool loadLessonLex (TQTextStream& is); + bool saveLessonLex (TQTextStream& os); + bool saveTypeNameLex (TQTextStream& os); + bool loadTypeNameLex (TQTextStream& is); + + bool saveToCsv (TQTextStream& os, TQString &title); + bool loadFromCsv (TQTextStream& is); + bool loadLessonCsv (TQTextStream& is); + bool saveLessonCsv (TQTextStream& os); + bool saveTypeNameCsv (TQTextStream& os); + bool loadTypeNameCsv (TQTextStream& is); + + bool saveTypeNameVcb (TQTextStream &os); + bool loadTypeNameVcb (TQTextStream &is); + bool saveLessonVcb (TQTextStream &os); + bool loadLessonVcb (TQTextStream &is); + bool saveToVcb (TQTextStream& os, TQString &title); + bool loadFromVcb (TQTextStream& is); + bool loadFromVoc(TQTextStream& is); + void errorVcb (int line, const TQString &text ); private: bool dirty; @@ -718,26 +718,26 @@ protected: bool sort_allowed; // save these to document - vector langs; //0= origin, 1,.. translations + vector langs; //0= origin, 1,.. translations int cols, lines; int current_lesson; vector extraSizehints; vector sizehints; - QString generator; - QString queryorg, + TQString generator; + TQString queryorg, querytrans; vector vocabulary; vector lessons_in_query; - vector lesson_descr; - vector type_descr; - vector tense_descr; - vector usage_descr; - QString doctitle; - QString author; - QString license; - QString doc_remark; - QString doc_version; + vector lesson_descr; + vector type_descr; + vector tense_descr; + vector usage_descr; + TQString doctitle; + TQString author; + TQString license; + TQString doc_remark; + TQString doc_version; vector
articles; vector conjugations; diff --git a/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.cpp b/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.cpp index 2faba172..5ce499d1 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.cpp +++ b/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.cpp @@ -41,7 +41,7 @@ void kvoctrainExpr::Init() } -kvoctrainExpr::kvoctrainExpr (QString &expr, int _lesson) +kvoctrainExpr::kvoctrainExpr (TQString &expr, int _lesson) { Init(); setOriginal(expr.stripWhiteSpace() ); @@ -55,10 +55,10 @@ kvoctrainExpr::kvoctrainExpr () } -kvoctrainExpr::kvoctrainExpr (QString &s, QString separator, int _lesson) +kvoctrainExpr::kvoctrainExpr (TQString &s, TQString separator, int _lesson) { Init(); - QString se; + TQString se; lesson = _lesson; if (separator.length() ) { @@ -97,7 +97,7 @@ int kvoctrainExpr::numTranslations() const } -QString kvoctrainExpr::getRemark (int idx) const +TQString kvoctrainExpr::getRemark (int idx) const { if (idx >= (int)remarks.size() || idx < 0) { return ""; @@ -108,7 +108,7 @@ QString kvoctrainExpr::getRemark (int idx) const } -void kvoctrainExpr::setRemark (int idx, const QString & expr) +void kvoctrainExpr::setRemark (int idx, const TQString & expr) { if ( idx < 0) return; @@ -121,7 +121,7 @@ void kvoctrainExpr::setRemark (int idx, const QString & expr) } -void kvoctrainExpr::setFauxAmi (int idx, const QString & expr, bool rev_ami) +void kvoctrainExpr::setFauxAmi (int idx, const TQString & expr, bool rev_ami) { if (idx < 1) return; @@ -145,7 +145,7 @@ void kvoctrainExpr::setFauxAmi (int idx, const QString & expr, bool rev_ami) } -QString kvoctrainExpr::getFauxAmi (int idx, bool rev_ami) const +TQString kvoctrainExpr::getFauxAmi (int idx, bool rev_ami) const { if (rev_ami) { if (idx >= (int)rev_fauxAmi.size() || idx < 1 ) { @@ -163,7 +163,7 @@ QString kvoctrainExpr::getFauxAmi (int idx, bool rev_ami) const } -void kvoctrainExpr::setSynonym (int idx, const QString & expr) +void kvoctrainExpr::setSynonym (int idx, const TQString & expr) { if ( idx < 0) return; @@ -176,7 +176,7 @@ void kvoctrainExpr::setSynonym (int idx, const QString & expr) } -QString kvoctrainExpr::getSynonym (int idx) const +TQString kvoctrainExpr::getSynonym (int idx) const { if (idx >= (int)synonym.size() || idx < 0) { return ""; @@ -187,7 +187,7 @@ QString kvoctrainExpr::getSynonym (int idx) const } -void kvoctrainExpr::setExample (int idx, const QString & expr) +void kvoctrainExpr::setExample (int idx, const TQString & expr) { if ( idx < 0) return; @@ -200,7 +200,7 @@ void kvoctrainExpr::setExample (int idx, const QString & expr) } -QString kvoctrainExpr::getExample (int idx) const +TQString kvoctrainExpr::getExample (int idx) const { if (idx >= (int)example.size() || idx < 0) { return ""; @@ -211,7 +211,7 @@ QString kvoctrainExpr::getExample (int idx) const } -void kvoctrainExpr::setUsageLabel (int idx, const QString & expr) +void kvoctrainExpr::setUsageLabel (int idx, const TQString & expr) { if ( idx < 0) return; @@ -224,7 +224,7 @@ void kvoctrainExpr::setUsageLabel (int idx, const QString & expr) } -QString kvoctrainExpr::getUsageLabel (int idx) const +TQString kvoctrainExpr::getUsageLabel (int idx) const { if (idx >= (int)usageLabels.size() || idx < 0) { return ""; @@ -235,7 +235,7 @@ QString kvoctrainExpr::getUsageLabel (int idx) const } -void kvoctrainExpr::setParaphrase (int idx, const QString & expr) +void kvoctrainExpr::setParaphrase (int idx, const TQString & expr) { if ( idx < 0) return; @@ -248,7 +248,7 @@ void kvoctrainExpr::setParaphrase (int idx, const QString & expr) } -QString kvoctrainExpr::getParaphrase (int idx) const +TQString kvoctrainExpr::getParaphrase (int idx) const { if (idx >= (int)paraphrases.size() || idx < 0) { return ""; @@ -259,7 +259,7 @@ QString kvoctrainExpr::getParaphrase (int idx) const } -void kvoctrainExpr::setAntonym (int idx, const QString & expr) +void kvoctrainExpr::setAntonym (int idx, const TQString & expr) { if ( idx < 0) return; @@ -272,7 +272,7 @@ void kvoctrainExpr::setAntonym (int idx, const QString & expr) } -QString kvoctrainExpr::getAntonym (int idx) const +TQString kvoctrainExpr::getAntonym (int idx) const { if (idx >= (int)antonym.size() || idx < 0) { return ""; @@ -355,7 +355,7 @@ MultipleChoice kvoctrainExpr::getMultipleChoice (int idx) const } -QString kvoctrainExpr::getPronunce (int idx) const +TQString kvoctrainExpr::getPronunce (int idx) const { if (idx >= (int)pronunces.size() || idx < 0) { return ""; @@ -366,7 +366,7 @@ QString kvoctrainExpr::getPronunce (int idx) const } -void kvoctrainExpr::setPronunce (int idx, const QString & expr) +void kvoctrainExpr::setPronunce (int idx, const TQString & expr) { if ( idx < 0) return; @@ -379,7 +379,7 @@ void kvoctrainExpr::setPronunce (int idx, const QString & expr) } -void kvoctrainExpr::addTranslation (QString expr, +void kvoctrainExpr::addTranslation (TQString expr, grade_t grade, grade_t rev_grade) { if (grade > KV_MAX_GRADE) @@ -394,7 +394,7 @@ void kvoctrainExpr::addTranslation (QString expr, } -QString kvoctrainExpr::getTranslation (int idx) const +TQString kvoctrainExpr::getTranslation (int idx) const { if (idx > (int)translations.size() || idx < 1) return ""; @@ -473,7 +473,7 @@ void kvoctrainExpr::removeTranslation (int idx) } -void kvoctrainExpr::setTranslation (int idx, const QString & expr) +void kvoctrainExpr::setTranslation (int idx, const TQString & expr) { if ( idx <= 0) return; @@ -487,9 +487,9 @@ void kvoctrainExpr::setTranslation (int idx, const QString & expr) } -QString kvoctrainExpr::gradeStr (int idx, bool rev_grade) const +TQString kvoctrainExpr::gradeStr (int idx, bool rev_grade) const { - QString s; + TQString s; s.setNum(getGrade(idx, rev_grade)); return s; } @@ -731,7 +731,7 @@ void kvoctrainExpr::setQueryDate (int idx, time_t date, bool rev_date) bool kvoctrainExpr::uniqueType () const { bool unique = true; - QString type0 = getType(0); + TQString type0 = getType(0); for (int i = 1; i < numTranslations(); i++) if (type0 != getType(i) ) unique = false; @@ -739,7 +739,7 @@ bool kvoctrainExpr::uniqueType () const } -QString kvoctrainExpr::getType (int idx) const +TQString kvoctrainExpr::getType (int idx) const { if (idx >= (int)exprtypes.size() || idx < 0) { return ""; @@ -767,13 +767,13 @@ void kvoctrainExpr::incBadCount (int index, bool rev_count) } -void kvoctrainExpr::setOriginal ( const QString & expr) +void kvoctrainExpr::setOriginal ( const TQString & expr) { origin = expr; } -QString kvoctrainExpr::getOriginal () const +TQString kvoctrainExpr::getOriginal () const { return origin; } @@ -785,7 +785,7 @@ void kvoctrainExpr::setLesson (int l) } -void kvoctrainExpr::setType (int idx, const QString &type) +void kvoctrainExpr::setType (int idx, const TQString &type) { if ( idx < 0) return; diff --git a/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.h b/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.h index ecdefa4d..f31cd1e9 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.h +++ b/kvoctrain/kvoctrain/kvt-core/kvoctrainexpr.h @@ -81,20 +81,20 @@ class kvoctrainExpr kvoctrainExpr (); - kvoctrainExpr (QString &s, QString separator, int lesson = 0); + kvoctrainExpr (TQString &s, TQString separator, int lesson = 0); /** Constructor for an expression in different languages * * @param expr expression */ - kvoctrainExpr (QString &expr, int lesson = 0); + kvoctrainExpr (TQString &expr, int lesson = 0); /** adds a new translation of this entry * @param expr translation * @param grade grade of knowledge of this translation * @param rev_grade dito, in opposite direction */ - void addTranslation (QString expr, grade_t grade=KV_NORM_GRADE, + void addTranslation (TQString expr, grade_t grade=KV_NORM_GRADE, grade_t rev_grade=KV_NORM_GRADE); /** removes translation @@ -113,11 +113,11 @@ class kvoctrainExpr /** returns original expression of this entry */ - QString getOriginal () const; + TQString getOriginal () const; /** sets original expression of this entry */ - void setOriginal (const QString & expr); + void setOriginal (const TQString & expr); /** returns number of max. translations of all expressions */ @@ -144,42 +144,42 @@ class kvoctrainExpr * @param index number of translation * @result expression or "" if no translation available */ - QString getTranslation (int index) const; + TQString getTranslation (int index) const; /** sets translation of this expression * * @param index number of translation * @param expr expression of this index */ - void setTranslation (int index, const QString & expr); + void setTranslation (int index, const TQString & expr); /** sets remark of this expression * * @param index index of expression * @param expr remark of this index */ - void setPronunce (int index, const QString & expr); + void setPronunce (int index, const TQString & expr); /** returns pronunciation of this expression * * @param index index of expression * @result pronunciation or "" if none available */ - QString getPronunce (int index) const; + TQString getPronunce (int index) const; /** returns remarks of this expression * * @param index index of expression * @result remark or "" if no remark available */ - QString getRemark (int index) const; + TQString getRemark (int index) const; /** sets remark of this expression * * @param index index of expression * @param expr remark of this index */ - void setRemark (int index, const QString & expr); + void setRemark (int index, const TQString & expr); /** sets false friend of this expression @@ -188,7 +188,7 @@ class kvoctrainExpr * @param expr false friend of this index * @param rev_grade dito, in opposite direction */ - void setFauxAmi (int index, const QString & expr, bool rev_ami = false); + void setFauxAmi (int index, const TQString & expr, bool rev_ami = false); /** returns false friend of this expression @@ -197,14 +197,14 @@ class kvoctrainExpr * @param rev_grade dito, in opposite direction * @result false friend or "" if no string available */ - QString getFauxAmi (int index, bool rev_ami = false) const; + TQString getFauxAmi (int index, bool rev_ami = false) const; /** sets synonym this expression * * @param index index of expression * @param expr synonym of this index */ - void setSynonym (int index, const QString & expr); + void setSynonym (int index, const TQString & expr); /** returns synonym of this expression @@ -212,14 +212,14 @@ class kvoctrainExpr * @param index index of expression * @result synonym or "" if no string available */ - QString getSynonym (int index) const; + TQString getSynonym (int index) const; /** sets example this expression * * @param index index of expression * @param expr example of this index */ - void setExample (int index, const QString & expr); + void setExample (int index, const TQString & expr); /** returns example of this expression @@ -227,14 +227,14 @@ class kvoctrainExpr * @param index index of expression * @result example or "" if no string available */ - QString getExample (int index) const; + TQString getExample (int index) const; /** sets usage label this expression * * @param index index of expression * @param usage usage label of this index */ - void setUsageLabel (int index, const QString & usage); + void setUsageLabel (int index, const TQString & usage); /** returns usage label of this expression @@ -242,14 +242,14 @@ class kvoctrainExpr * @param index index of expression * @result usage or "" if no string available */ - QString getUsageLabel (int index) const; + TQString getUsageLabel (int index) const; /** sets paraphrase of this expression * * @param index index of expression * @param usage paraphrase of this index */ - void setParaphrase (int index, const QString & usage); + void setParaphrase (int index, const TQString & usage); /** returns paraphrase of this expression @@ -257,14 +257,14 @@ class kvoctrainExpr * @param index index of expression * @result paraphrase or "" if no string available */ - QString getParaphrase (int index) const; + TQString getParaphrase (int index) const; /** sets antonym this expression * * @param index index of expression * @param expr antonym of this index */ - void setAntonym (int index, const QString & expr); + void setAntonym (int index, const TQString & expr); /** returns antonym of this expression @@ -272,13 +272,13 @@ class kvoctrainExpr * @param index index of expression * @result antonym or "" if no string available */ - QString getAntonym (int index) const; + TQString getAntonym (int index) const; /** returns type of this expression * * @result type or "" if no type available */ - QString getType (int index) const; + TQString getType (int index) const; /** all langs have same type ? * @@ -291,7 +291,7 @@ class kvoctrainExpr * @param index index of type * @param type type of this expression ("" = none) */ - void setType (int index, const QString &type); + void setType (int index, const TQString &type); /** returns grade of given translation as string * @@ -299,7 +299,7 @@ class kvoctrainExpr * @param rev_grade dito, in opposite direction * @result number of knowlegde: 0=known, x=numbers not knows */ - QString gradeStr (int index, bool rev_grade = false) const; + TQString gradeStr (int index, bool rev_grade = false) const; /** sets grade of given translation * @@ -430,20 +430,20 @@ class kvoctrainExpr void Init(); private: - QString origin; + TQString origin; // all these vectors must be deleted in removeTranslation() - vector exprtypes; - vector translations; - vector remarks; - vector usageLabels; - vector paraphrases; - vector fauxAmi; - vector rev_fauxAmi; - vector synonym; - vector example; - vector antonym; - vector pronunces; + vector exprtypes; + vector translations; + vector remarks; + vector usageLabels; + vector paraphrases; + vector fauxAmi; + vector rev_fauxAmi; + vector synonym; + vector example; + vector antonym; + vector pronunces; vector grades; vector rev_grades; vector qcounts; diff --git a/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlTokenizer.h b/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlTokenizer.h index d78b6c7e..df0d4031 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlTokenizer.h +++ b/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlTokenizer.h @@ -95,7 +95,7 @@ protected: Token readComment (); private: -// QIODevice *strm; +// TQIODevice *strm; KOXML_STRING last_chars; KOXML_ISTREAM &istrm; KOXML_STRING elem; diff --git a/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlWriter.h b/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlWriter.h index d73bce59..2c95a515 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlWriter.h +++ b/kvoctrain/kvoctrain/kvt-core/kvt-xml/XmlWriter.h @@ -172,7 +172,7 @@ public: /** * Get the raw output stream. */ - inline QIODevice *stream () { return strm.device(); } + inline TQIODevice *stream () { return strm.device(); } #endif private: diff --git a/kvoctrain/kvoctrain/kvt-core/kvt-xml/koxml_config.h b/kvoctrain/kvoctrain/kvt-core/kvt-xml/koxml_config.h index 2f0daecb..4587e25d 100644 --- a/kvoctrain/kvoctrain/kvt-core/kvt-xml/koxml_config.h +++ b/kvoctrain/kvoctrain/kvt-core/kvt-xml/koxml_config.h @@ -8,11 +8,11 @@ #ifndef KOXML_USE_STL -# include +# include # define KOXML_ISTREAM QTextStream # define KOXML_OSTREAM QTextStream -# include +# include # define KOXML_STRING QString // Unicode character diff --git a/kvoctrain/kvoctrain/kvt-core/langset.cpp b/kvoctrain/kvoctrain/kvt-core/langset.cpp index 644878e7..633e6f59 100644 --- a/kvoctrain/kvoctrain/kvt-core/langset.cpp +++ b/kvoctrain/kvoctrain/kvt-core/langset.cpp @@ -27,8 +27,8 @@ #include "langset.h" -// void LangSet::addSet (QString _shortId, QString _longId, -// QString _PixMapFile, const QString& keyboardLayout) +// void LangSet::addSet (TQString _shortId, TQString _longId, +// TQString _PixMapFile, const TQString& keyboardLayout) // { // LangDef def; // def.shortId = _shortId; @@ -40,9 +40,9 @@ // } -void LangSet::addSet (QString _shortId, QString _longId, - QString _PixMapFile, const QString& _shortId2, - const QString& keyboardLayout) +void LangSet::addSet (TQString _shortId, TQString _longId, + TQString _PixMapFile, const TQString& _shortId2, + const TQString& keyboardLayout) { LangDef def; @@ -77,52 +77,52 @@ void LangSet::erase (int idx) } -QString LangSet::shortId (int index) const +TQString LangSet::shortId (int index) const { if (index >= 0 && index < (int) langs.size() ) return langs[index].shortId; - return QString::null; + return TQString::null; } -QString LangSet::shortId2 (int index) const +TQString LangSet::shortId2 (int index) const { if (index >= 0 && index < (int) langs.size() ) return langs[index].shortId2; - return QString::null; + return TQString::null; } -QString LangSet::longId (int index) const +TQString LangSet::longId (int index) const { if (index >= 0 && index < (int) langs.size() ) return langs[index].longId; - return QString::null; + return TQString::null; } -QString LangSet::PixMapFile (int index) const +TQString LangSet::PixMapFile (int index) const { if (index >= 0 && index < (int) langs.size() ) return langs[index].PixMapFile; return ""; } -QString LangSet::keyboardLayout (int index) const +TQString LangSet::keyboardLayout (int index) const { if (index >= 0 && index < (int) langs.size()) { return langs[index].keyboardLayout; } else { - return QString::null; + return TQString::null; } } -QString LangSet::findShortId (const QString &_longId) const +TQString LangSet::findShortId (const TQString &_longId) const { if (_longId.isEmpty()) return ""; @@ -131,11 +131,11 @@ QString LangSet::findShortId (const QString &_longId) const if (_longId == langs[i].longId) return langs[i].shortId; - return QString::null; + return TQString::null; } -QString LangSet::findLongId (const QString &_shortId) const +TQString LangSet::findLongId (const TQString &_shortId) const { if (_shortId.isEmpty()) return ""; @@ -145,11 +145,11 @@ QString LangSet::findLongId (const QString &_shortId) const || _shortId == langs[i].shortId2) return langs[i].longId; - return QString::null; + return TQString::null; } -int LangSet::indexShortId (QString _shortId) const +int LangSet::indexShortId (TQString _shortId) const { if (_shortId.isEmpty()) return -1; @@ -163,7 +163,7 @@ int LangSet::indexShortId (QString _shortId) const } -int LangSet::indexLongId (QString _longId) const +int LangSet::indexLongId (TQString _longId) const { if (_longId.isEmpty()) return -1; @@ -176,7 +176,7 @@ int LangSet::indexLongId (QString _longId) const } -int LangSet::indexPixMapFile (QString PixMapFile) const +int LangSet::indexPixMapFile (TQString PixMapFile) const { int id = -1; for (int i = 0; i < (int) langs.size(); i++) @@ -185,34 +185,34 @@ int LangSet::indexPixMapFile (QString PixMapFile) const return id; } -void LangSet::setShortId (const QString & s, int index) +void LangSet::setShortId (const TQString & s, int index) { if (index < (int) langs.size() ) langs[index].shortId = s; } -void LangSet::setShortId2 (const QString & s, int index) +void LangSet::setShortId2 (const TQString & s, int index) { if (index < (int) langs.size() ) langs[index].shortId2 = s; } -void LangSet::setLongId (const QString & s, int index) +void LangSet::setLongId (const TQString & s, int index) { if (index < (int) langs.size() ) langs[index].longId = s; } -void LangSet::setPixMapFile (const QString & s, int index) +void LangSet::setPixMapFile (const TQString & s, int index) { if (index < (int) langs.size() ) langs[index].PixMapFile = s; } -void LangSet::setKeyboardLayout(const QString& layout, int index) +void LangSet::setKeyboardLayout(const TQString& layout, int index) { if (index < (int) langs.size()) { langs[index].keyboardLayout = layout; diff --git a/kvoctrain/kvoctrain/kvt-core/langset.h b/kvoctrain/kvoctrain/kvt-core/langset.h index f0da2a5a..526f330d 100644 --- a/kvoctrain/kvoctrain/kvt-core/langset.h +++ b/kvoctrain/kvoctrain/kvt-core/langset.h @@ -32,7 +32,7 @@ #include using namespace std; -#include +#include class LangSet @@ -41,13 +41,13 @@ class LangSet LangSet () {} - void addSet (QString shortId, QString longId, QString PixMapFile, - const QString& shortId2 = QString::null, - const QString& keyboardLayout = QString::null); + void addSet (TQString shortId, TQString longId, TQString PixMapFile, + const TQString& shortId2 = TQString::null, + const TQString& keyboardLayout = TQString::null); -/* void addSet (QString shortId, QString shortId2, QString longId, */ -/* QString PixMapFile, */ -/* const QString& keyboardLayout = QString::null); */ +/* void addSet (TQString shortId, TQString shortId2, TQString longId, */ +/* TQString PixMapFile, */ +/* const TQString& keyboardLayout = TQString::null); */ void appendSet(const LangSet &set); @@ -55,30 +55,30 @@ class LangSet void erase (int idx); void clear (); - QString shortId (int index) const; - QString shortId2 (int index) const; - QString longId (int index) const; - QString PixMapFile (int index) const; - QString keyboardLayout (int index) const; + TQString shortId (int index) const; + TQString shortId2 (int index) const; + TQString longId (int index) const; + TQString PixMapFile (int index) const; + TQString keyboardLayout (int index) const; - int indexShortId (QString shortId) const; - int indexLongId (QString longId) const; - int indexPixMapFile (QString PixMapFile) const; + int indexShortId (TQString shortId) const; + int indexLongId (TQString longId) const; + int indexPixMapFile (TQString PixMapFile) const; // doesn't make sense for keyboard layouts since there is no 1-to-1 relation to languages - void setShortId (const QString & shortId, int index); - void setShortId2 (const QString & shortId2, int index); - void setLongId (const QString & longId, int index); - void setPixMapFile (const QString & PixMapFile, int index); - void setKeyboardLayout(const QString & layout, int index); + void setShortId (const TQString & shortId, int index); + void setShortId2 (const TQString & shortId2, int index); + void setLongId (const TQString & longId, int index); + void setPixMapFile (const TQString & PixMapFile, int index); + void setKeyboardLayout(const TQString & layout, int index); - QString findShortId (const QString & longId) const; - QString findLongId (const QString & shortId) const; + TQString findShortId (const TQString & longId) const; + TQString findLongId (const TQString & shortId) const; private: struct LangDef { - QString shortId, + TQString shortId, shortId2, longId, PixMapFile, diff --git a/kvoctrain/kvoctrain/kvtnewstuff.cpp b/kvoctrain/kvoctrain/kvtnewstuff.cpp index b1004c56..2714cf76 100644 --- a/kvoctrain/kvoctrain/kvtnewstuff.cpp +++ b/kvoctrain/kvoctrain/kvtnewstuff.cpp @@ -10,7 +10,7 @@ // // -#include +#include #include #include @@ -22,13 +22,13 @@ #include "kvtnewstuff.h" #include "prefs.h" -KVTNewStuff::KVTNewStuff(QWidget *parent, const char * /*name*/) : QObject(), KNewStuff("kdeedu/vocabulary", parent) +KVTNewStuff::KVTNewStuff(TQWidget *parent, const char * /*name*/) : TQObject(), KNewStuff("kdeedu/vocabulary", parent) { m_app = (kvoctrainApp*) parent; } -bool KVTNewStuff::install(const QString & fileName) +bool KVTNewStuff::install(const TQString & fileName) { if (m_app->queryExit()) m_app->loadfileFromPath(fileName, true); @@ -36,54 +36,54 @@ bool KVTNewStuff::install(const QString & fileName) } -bool KVTNewStuff::createUploadFile(const QString & /*fileName*/) +bool KVTNewStuff::createUploadFile(const TQString & /*fileName*/) { return true; } -QString KVTNewStuff::destinationPath(KNS::Entry * entry) +TQString KVTNewStuff::destinationPath(KNS::Entry * entry) { if (entry) { KURL url = entry->payload(); - QString fileName = url.fileName(); + TQString fileName = url.fileName(); - QString path = Prefs::installPath(); //default is Vocabularies which will be created in the user's home directory - QString file; + TQString path = Prefs::installPath(); //default is Vocabularies which will be created in the user's home directory + TQString file; if (path.isEmpty()) file = KNewStuff::downloadDestination(entry); //fall back on a temp file, should never happen else { - file = QDir::home().path() + "/" + path + "/"; + file = TQDir::home().path() + "/" + path + "/"; KStandardDirs::makeDir(file); //ensure the directory exists file += fileName; } return file; } else - return QString::null; + return TQString::null; } -QString KVTNewStuff::downloadDestination(KNS::Entry * entry) +TQString KVTNewStuff::downloadDestination(KNS::Entry * entry) { - QString file = destinationPath(entry); + TQString file = destinationPath(entry); if (KStandardDirs::exists(file)) { int result = KMessageBox::warningContinueCancel(parentWidget(), i18n("The file '%1' already exists. Do you want to overwrite it?") .arg(file), - QString::null, i18n("Overwrite") ); + TQString::null, i18n("Overwrite") ); if (result == KMessageBox::Cancel) - return QString::null; + return TQString::null; } KMessageBox::information(parentWidget(), i18n("The selected file will now be downloaded and saved as\n'%1'.") .arg(file), - QString::null, + TQString::null, "NewStuffDownloadLocation"); return file; } diff --git a/kvoctrain/kvoctrain/kvtnewstuff.h b/kvoctrain/kvoctrain/kvtnewstuff.h index 9953ac1a..1649868a 100644 --- a/kvoctrain/kvoctrain/kvtnewstuff.h +++ b/kvoctrain/kvoctrain/kvtnewstuff.h @@ -19,11 +19,11 @@ class kvoctrainApp; /** @author Peter Hedlund */ -class KVTNewStuff : public QObject, public KNewStuff +class KVTNewStuff : public TQObject, public KNewStuff { Q_OBJECT public: - KVTNewStuff(QWidget *parent = 0, const char *name = 0); + KVTNewStuff(TQWidget *parent = 0, const char *name = 0); /** Installs a downloaded file according to the application's configuration. @@ -31,7 +31,7 @@ public: @param fileName filename of the donwloaded file @return @c true in case of installation success, @c false otherwise */ - bool install(const QString &fileName); + bool install(const TQString &fileName); /** Creates a file suitable for upload. @@ -41,7 +41,7 @@ public: @param fileName the name of the file to upload after its creation @return @c true in case of creation success, @c false otherwise */ - bool createUploadFile(const QString &fileName); + bool createUploadFile(const TQString &fileName); /** Queries the preferred destination file for a download. @@ -49,10 +49,10 @@ public: @param entry a Hotstuff data entry @return destination filename, or 0 to return directory only */ - QString downloadDestination(KNS::Entry *entry); + TQString downloadDestination(KNS::Entry *entry); private: - QString destinationPath(KNS::Entry *entry); + TQString destinationPath(KNS::Entry *entry); kvoctrainApp * m_app; }; diff --git a/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.cpp b/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.cpp index c643ba01..69deae26 100644 --- a/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.cpp +++ b/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.cpp @@ -34,14 +34,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include AdjQueryDlg::AdjQueryDlg ( - QString type, + TQString type, int entry, int col, int query_cycle, @@ -55,18 +55,18 @@ AdjQueryDlg::AdjQueryDlg mw = new AdjQueryDlgForm(this); setMainWidget(mw); - connect(mw->dont_know, SIGNAL(clicked()), SLOT(dontKnowClicked()) ); - connect(mw->know_it, SIGNAL(clicked()), SLOT(knowItClicked()) ); - connect(mw->verify, SIGNAL(clicked()), SLOT(verifyClicked()) ); - connect(mw->show_all, SIGNAL(clicked()), SLOT(showAllClicked()) ); + connect(mw->dont_know, TQT_SIGNAL(clicked()), TQT_SLOT(dontKnowClicked()) ); + connect(mw->know_it, TQT_SIGNAL(clicked()), TQT_SLOT(knowItClicked()) ); + connect(mw->verify, TQT_SIGNAL(clicked()), TQT_SLOT(verifyClicked()) ); + connect(mw->show_all, TQT_SIGNAL(clicked()), TQT_SLOT(showAllClicked()) ); - connect(mw->lev1Field, SIGNAL(returnPressed()), SLOT(returnPressed()) ); - connect(mw->lev2Field, SIGNAL(returnPressed()), SLOT(returnPressed()) ); - connect(mw->lev3Field, SIGNAL(returnPressed()), SLOT(returnPressed()) ); + connect(mw->lev1Field, TQT_SIGNAL(returnPressed()), TQT_SLOT(returnPressed()) ); + connect(mw->lev2Field, TQT_SIGNAL(returnPressed()), TQT_SLOT(returnPressed()) ); + connect(mw->lev3Field, TQT_SIGNAL(returnPressed()), TQT_SLOT(returnPressed()) ); - connect(mw->lev1Field, SIGNAL(textChanged(const QString&)), SLOT(lev1Changed(const QString&)) ); - connect(mw->lev2Field, SIGNAL(textChanged(const QString&)), SLOT(lev2Changed(const QString&)) ); - connect(mw->lev3Field, SIGNAL(textChanged(const QString&)), SLOT(lev3Changed(const QString&)) ); + connect(mw->lev1Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(lev1Changed(const TQString&)) ); + connect(mw->lev2Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(lev2Changed(const TQString&)) ); + connect(mw->lev3Field, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(lev3Changed(const TQString&)) ); qtimer = 0; @@ -87,7 +87,7 @@ AdjQueryDlg::~AdjQueryDlg() } -void AdjQueryDlg::setQuery(QString, +void AdjQueryDlg::setQuery(TQString, int entry, int col, int q_cycle, @@ -106,7 +106,7 @@ void AdjQueryDlg::setQuery(QString, mw->timelabel->setEnabled(Prefs::showCounter()); comp = _comp; mw->show_all->setDefault(true); - QString s; + TQString s; s.setNum (q_cycle); mw->progCount->setText (s); @@ -136,8 +136,8 @@ void AdjQueryDlg::setQuery(QString, int mqtime = Prefs::maxTimePer(); if (mqtime > 0) { if (qtimer == 0) { - qtimer = new QTimer( this ); - connect( qtimer, SIGNAL(timeout()), this, SLOT(timeoutReached()) ); + qtimer = new TQTimer( this ); + connect( qtimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeoutReached()) ); } if (Prefs::queryTimeout() != Prefs::EnumQueryTimeout::NoTimeout) { @@ -247,7 +247,7 @@ void AdjQueryDlg::slotUser2() } -void AdjQueryDlg::keyPressEvent( QKeyEvent *e ) +void AdjQueryDlg::keyPressEvent( TQKeyEvent *e ) { switch( e->key() ) { @@ -279,21 +279,21 @@ void AdjQueryDlg::returnPressed() } -void AdjQueryDlg::lev1Changed(const QString&) +void AdjQueryDlg::lev1Changed(const TQString&) { mw->verify->setDefault(true); resetField (mw->lev1Field); } -void AdjQueryDlg::lev2Changed(const QString&) +void AdjQueryDlg::lev2Changed(const TQString&) { mw->verify->setDefault(true); resetField (mw->lev2Field); } -void AdjQueryDlg::lev3Changed(const QString&) +void AdjQueryDlg::lev3Changed(const TQString&) { mw->verify->setDefault(true); resetField (mw->lev3Field); diff --git a/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.h b/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.h index 29561404..fd26f7bf 100644 --- a/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.h +++ b/kvoctrain/kvoctrain/query-dialogs/AdjQueryDlg.h @@ -37,7 +37,7 @@ class AdjQueryDlg : public QueryDlgBase public: AdjQueryDlg ( - QString type, + TQString type, int entry, int col, int query_cycle, @@ -49,7 +49,7 @@ public: ~AdjQueryDlg(); - void setQuery(QString type, + void setQuery(TQString type, int entry, int col, int query_cycle, @@ -63,13 +63,13 @@ public slots: virtual void initFocus() const; protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(TQKeyEvent *e); void resetAllFields(); protected slots: - void lev1Changed(const QString&); - void lev2Changed(const QString&); - void lev3Changed(const QString&); + void lev1Changed(const TQString&); + void lev2Changed(const TQString&); + void lev3Changed(const TQString&); void showAllClicked(); void slotUser2(); void knowItClicked(); diff --git a/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.cpp b/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.cpp index a35ffa83..244141e0 100644 --- a/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.cpp +++ b/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.cpp @@ -33,15 +33,15 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include ArtQueryDlg::ArtQueryDlg ( - QString type, + TQString type, int entry, int col, int query_cycle, @@ -61,14 +61,14 @@ ArtQueryDlg::ArtQueryDlg mw->artGroup->insert (mw->male); mw->artGroup->insert (mw->rb_fem); - connect(mw->dont_know, SIGNAL(clicked()), SLOT(dontKnowClicked()) ); - connect(mw->know_it, SIGNAL(clicked()), SLOT(knowItClicked()) ); - connect(mw->verify, SIGNAL(clicked()), SLOT(verifyClicked()) ); - connect(mw->show_all, SIGNAL(clicked()), SLOT(showAllClicked()) ); + connect(mw->dont_know, TQT_SIGNAL(clicked()), TQT_SLOT(dontKnowClicked()) ); + connect(mw->know_it, TQT_SIGNAL(clicked()), TQT_SLOT(knowItClicked()) ); + connect(mw->verify, TQT_SIGNAL(clicked()), TQT_SLOT(verifyClicked()) ); + connect(mw->show_all, TQT_SIGNAL(clicked()), TQT_SLOT(showAllClicked()) ); - connect(mw->natural, SIGNAL(clicked()), SLOT(slotNaturalClicked()) ); - connect(mw->male, SIGNAL(clicked()), SLOT(slotMaleClicked()) ); - connect(mw->rb_fem, SIGNAL(clicked()), SLOT(slotFemClicked()) ); + connect(mw->natural, TQT_SIGNAL(clicked()), TQT_SLOT(slotNaturalClicked()) ); + connect(mw->male, TQT_SIGNAL(clicked()), TQT_SLOT(slotMaleClicked()) ); + connect(mw->rb_fem, TQT_SIGNAL(clicked()), TQT_SLOT(slotFemClicked()) ); setQuery (type, entry, col, query_cycle, query_num, query_startnum, exp, doc, articles); mw->countbar->setFormat("%v/%m"); @@ -83,7 +83,7 @@ ArtQueryDlg::~ArtQueryDlg() } -void ArtQueryDlg::setQuery(QString, +void ArtQueryDlg::setQuery(TQString, int entry, int col, int q_cycle, @@ -103,18 +103,18 @@ void ArtQueryDlg::setQuery(QString, mw->show_all->setDefault(true); articles = art; - QString s; + TQString s; if (col == 0) s = exp->getOriginal().stripWhiteSpace(); else s = exp->getTranslation(q_ocol).stripWhiteSpace(); - QString def, indef; + TQString def, indef; bool removed = false; articles.female(def, indef); mw->rb_fem->setText (i18n("&female:\t")+def+" / "+indef); - mw->rb_fem->setEnabled (!QString(def+indef).isEmpty() ); + mw->rb_fem->setEnabled (!TQString(def+indef).isEmpty() ); if (!removed && s.find(def+" ") == 0) { s.remove (0, def.length()+1); removed = true; @@ -126,7 +126,7 @@ void ArtQueryDlg::setQuery(QString, articles.male(def, indef); mw->male->setText (i18n("&male:\t")+def+" / "+indef); - mw->male->setEnabled (!QString(def+indef).isEmpty() ); + mw->male->setEnabled (!TQString(def+indef).isEmpty() ); if (!removed && s.find(def+" ") == 0) { s.remove (0, def.length()+1); removed = true; @@ -138,7 +138,7 @@ void ArtQueryDlg::setQuery(QString, articles.natural(def, indef); mw->natural->setText (i18n("&natural:\t")+def+" / "+indef); - mw->natural->setEnabled (!QString(def+indef).isEmpty() ); + mw->natural->setEnabled (!TQString(def+indef).isEmpty() ); if (!removed && s.find(def+" ") == 0) { s.remove (0, def.length()+1); removed = true; @@ -157,8 +157,8 @@ void ArtQueryDlg::setQuery(QString, int mqtime = Prefs::maxTimePer(); if (mqtime > 0) { if (qtimer == 0) { - qtimer = new QTimer( this ); - connect( qtimer, SIGNAL(timeout()), this, SLOT(timeoutReached()) ); + qtimer = new TQTimer( this ); + connect( qtimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeoutReached()) ); } if (Prefs::queryTimeout() != Prefs::EnumQueryTimeout::NoTimeout) { @@ -284,7 +284,7 @@ void ArtQueryDlg::slotUser2() } -void ArtQueryDlg::keyPressEvent( QKeyEvent *e ) +void ArtQueryDlg::keyPressEvent( TQKeyEvent *e ) { switch( e->key() ) { diff --git a/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.h b/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.h index 61d84103..a2884d05 100644 --- a/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.h +++ b/kvoctrain/kvoctrain/query-dialogs/ArtQueryDlg.h @@ -36,7 +36,7 @@ class ArtQueryDlg : public QueryDlgBase public: ArtQueryDlg( - QString type, + TQString type, int entry, int col, int query_cycle, @@ -48,7 +48,7 @@ public: ~ArtQueryDlg(); - void setQuery (QString type, + void setQuery (TQString type, int entry, int col, int query_cycle, @@ -62,7 +62,7 @@ public slots: virtual void initFocus() const; protected: - void keyPressEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); protected slots: void showMoreClicked(); diff --git a/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.cpp b/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.cpp index 596492ad..ac4345a1 100644 --- a/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.cpp +++ b/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.cpp @@ -33,18 +33,18 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include using namespace std; MCQueryDlg::MCQueryDlg( - QString org, - QString trans, + TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -64,15 +64,15 @@ MCQueryDlg::MCQueryDlg( mw->transgroup->insert(mw->rb_trans4); mw->transgroup->insert(mw->rb_trans5); - connect( mw->dont_know, SIGNAL(clicked()), SLOT(dontKnowClicked()) ); - connect( mw->know_it, SIGNAL(clicked()), SLOT(knowItClicked()) ); -// connect( verify, SIGNAL(clicked()), SLOT(verifyClicked()) ); - connect( mw->show_all, SIGNAL(clicked()), SLOT(showItClicked()) ); - connect( mw->rb_trans5, SIGNAL(clicked()), SLOT(trans5clicked()) ); - connect( mw->rb_trans4, SIGNAL(clicked()), SLOT(trans4clicked()) ); - connect( mw->rb_trans3, SIGNAL(clicked()), SLOT(trans3clicked()) ); - connect( mw->rb_trans2, SIGNAL(clicked()), SLOT(trans2clicked()) ); - connect( mw->rb_trans1, SIGNAL(clicked()), SLOT(trans1clicked()) ); + connect( mw->dont_know, TQT_SIGNAL(clicked()), TQT_SLOT(dontKnowClicked()) ); + connect( mw->know_it, TQT_SIGNAL(clicked()), TQT_SLOT(knowItClicked()) ); +// connect( verify, TQT_SIGNAL(clicked()), TQT_SLOT(verifyClicked()) ); + connect( mw->show_all, TQT_SIGNAL(clicked()), TQT_SLOT(showItClicked()) ); + connect( mw->rb_trans5, TQT_SIGNAL(clicked()), TQT_SLOT(trans5clicked()) ); + connect( mw->rb_trans4, TQT_SIGNAL(clicked()), TQT_SLOT(trans4clicked()) ); + connect( mw->rb_trans3, TQT_SIGNAL(clicked()), TQT_SLOT(trans3clicked()) ); + connect( mw->rb_trans2, TQT_SIGNAL(clicked()), TQT_SLOT(trans2clicked()) ); + connect( mw->rb_trans1, TQT_SIGNAL(clicked()), TQT_SLOT(trans1clicked()) ); qtimer = 0; @@ -89,8 +89,8 @@ MCQueryDlg::~MCQueryDlg() } -void MCQueryDlg::setQuery(QString org, - QString trans, +void MCQueryDlg::setQuery(TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -111,7 +111,7 @@ void MCQueryDlg::setQuery(QString org, mw->orgField->setFont(Prefs::tableFont()); mw->orgField->setText (org); mw->show_all->setDefault(true); - QString s; + TQString s; s.setNum (q_cycle); mw->progCount->setText (s); @@ -120,8 +120,8 @@ void MCQueryDlg::setQuery(QString org, int mqtime = Prefs::maxTimePer(); if (mqtime > 0) { if (qtimer == 0) { - qtimer = new QTimer( this ); - connect( qtimer, SIGNAL(timeout()), this, SLOT(timeoutReached()) ); + qtimer = new TQTimer( this ); + connect( qtimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeoutReached()) ); } if (Prefs::queryTimeout() != Prefs::EnumQueryTimeout::NoTimeout) { @@ -136,7 +136,7 @@ void MCQueryDlg::setQuery(QString org, else mw->timebar->setEnabled(false); - vector strings; + vector strings; button_ref.clear(); button_ref.push_back(RB_Label(mw->rb_trans1, mw->trans1)); button_ref.push_back(RB_Label(mw->rb_trans2, mw->trans2)); @@ -158,7 +158,7 @@ void MCQueryDlg::setQuery(QString org, std::random_shuffle(strings.begin(), strings.end()); // always include false friend - QString ff; + TQString ff; if (q_tcol != 0) ff = exp->getFauxAmi (q_tcol, false).stripWhiteSpace(); else @@ -390,7 +390,7 @@ void MCQueryDlg::slotUser2() } -void MCQueryDlg::keyPressEvent( QKeyEvent *e ) +void MCQueryDlg::keyPressEvent( TQKeyEvent *e ) { switch( e->key() ) { diff --git a/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.h b/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.h index 4e94f9db..4fcbccf7 100644 --- a/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.h +++ b/kvoctrain/kvoctrain/query-dialogs/MCQueryDlg.h @@ -36,8 +36,8 @@ class MCQueryDlg : public QueryDlgBase public: MCQueryDlg( - QString org, - QString trans, + TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -49,8 +49,8 @@ public: ~MCQueryDlg(); - void setQuery(QString org, - QString trans, + void setQuery(TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -64,7 +64,7 @@ public slots: virtual void initFocus() const; protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(TQKeyEvent *e); public slots: void showItClicked(); diff --git a/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.cpp b/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.cpp index 97b47c57..d70b92ed 100644 --- a/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.cpp +++ b/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.cpp @@ -25,15 +25,15 @@ #include "QueryDlgBase.h" -#include -#include -#include +#include +#include +#include #include #include -QueryDlgBase::QueryDlgBase(const QString & caption, QWidget *parent, const char *name, bool modal) +QueryDlgBase::QueryDlgBase(const TQString & caption, TQWidget *parent, const char *name, bool modal) : KDialogBase(Swallow, caption, User1|User2, NoDefault, parent, name, modal, false, KGuiItem(i18n("&Stop Query")), KGuiItem(i18n("&Edit Expression..."))) { @@ -54,29 +54,29 @@ void QueryDlgBase::initFocus() const } -bool QueryDlgBase::smartCompare (const QString& s1, const QString &s2, +bool QueryDlgBase::smartCompare (const TQString& s1, const TQString &s2, int ) const { return s1.stripWhiteSpace() == s2.stripWhiteSpace(); } -bool QueryDlgBase::verifyField(QLineEdit *field, const QString &really) +bool QueryDlgBase::verifyField(TQLineEdit *field, const TQString &really) { if (!field->isEnabled() ) return true; - QColorGroup u_normal = field->colorGroup(); - u_normal.setColor(QColorGroup::Text, QColor(0xff, 0x00, 0x00)); - QColorGroup k_normal = field->colorGroup(); - k_normal.setColor(QColorGroup::Text, QColor(0x00, 0x80, 0x00)); + TQColorGroup u_normal = field->colorGroup(); + u_normal.setColor(TQColorGroup::Text, TQColor(0xff, 0x00, 0x00)); + TQColorGroup k_normal = field->colorGroup(); + k_normal.setColor(TQColorGroup::Text, TQColor(0x00, 0x80, 0x00)); - QPalette known_pal( field->palette()); - QPalette unknown_pal( field->palette()); + TQPalette known_pal( field->palette()); + TQPalette unknown_pal( field->palette()); - QFont ft = field->font(); - if (ft.weight() != QFont::Bold) { - ft.setWeight(QFont::Bold); + TQFont ft = field->font(); + if (ft.weight() != TQFont::Bold) { + ft.setWeight(TQFont::Bold); field->setFont(ft); } @@ -103,14 +103,14 @@ bool QueryDlgBase::verifyField(QLineEdit *field, const QString &really) } -void QueryDlgBase::resetField(QLineEdit *field) +void QueryDlgBase::resetField(TQLineEdit *field) { if (!field->isEnabled() ) return; - QColorGroup normal = field->colorGroup(); - normal.setColor(QColorGroup::Text, QColor(0x00, 0x00, 0x00)); + TQColorGroup normal = field->colorGroup(); + normal.setColor(TQColorGroup::Text, TQColor(0x00, 0x00, 0x00)); - QPalette pal( field->palette()); + TQPalette pal( field->palette()); // replace text colors if ( pal.inactive() != normal @@ -120,29 +120,29 @@ void QueryDlgBase::resetField(QLineEdit *field) field->setPalette( pal ); } - QFont ft = field->font(); - if (ft.weight() != QFont::Normal) { - ft.setWeight(QFont::Normal); + TQFont ft = field->font(); + if (ft.weight() != TQFont::Normal) { + ft.setWeight(TQFont::Normal); field->setFont(ft); } } -bool QueryDlgBase::verifyField(QMultiLineEdit *field, const QString &really, bool mixed) +bool QueryDlgBase::verifyField(TQMultiLineEdit *field, const TQString &really, bool mixed) { if (!field->isEnabled()) return true; - QColorGroup u_normal = field->colorGroup(); - u_normal.setColor(QColorGroup::Text, QColor(0xff, 0x00, 0x00)); - QColorGroup k_normal = field->colorGroup(); - k_normal.setColor(QColorGroup::Text, QColor(0x00, 0x80, 0x00)); + TQColorGroup u_normal = field->colorGroup(); + u_normal.setColor(TQColorGroup::Text, TQColor(0xff, 0x00, 0x00)); + TQColorGroup k_normal = field->colorGroup(); + k_normal.setColor(TQColorGroup::Text, TQColor(0x00, 0x80, 0x00)); - QPalette known_pal( field->palette()); - QPalette unknown_pal( field->palette()); + TQPalette known_pal( field->palette()); + TQPalette unknown_pal( field->palette()); - QFont ft = field->font(); - if (ft.weight() != QFont::Bold) { - ft.setWeight(QFont::Bold); + TQFont ft = field->font(); + if (ft.weight() != TQFont::Bold) { + ft.setWeight(TQFont::Bold); field->setFont(ft); } @@ -191,14 +191,14 @@ bool QueryDlgBase::verifyField(QMultiLineEdit *field, const QString &really, boo } -void QueryDlgBase::resetField(QMultiLineEdit *field) +void QueryDlgBase::resetField(TQMultiLineEdit *field) { if (!field->isEnabled() ) return; - QColorGroup normal = field->colorGroup(); - normal.setColor(QColorGroup::Text, QColor(0x00, 0x00, 0x00)); + TQColorGroup normal = field->colorGroup(); + normal.setColor(TQColorGroup::Text, TQColor(0x00, 0x00, 0x00)); - QPalette pal( field->palette()); + TQPalette pal( field->palette()); // replace text colors if ( pal.inactive() != normal @@ -208,39 +208,39 @@ void QueryDlgBase::resetField(QMultiLineEdit *field) field->setPalette( pal ); } - QFont ft = field->font(); - if (ft.weight() != QFont::Normal) { - ft.setWeight(QFont::Normal); + TQFont ft = field->font(); + if (ft.weight() != TQFont::Normal) { + ft.setWeight(TQFont::Normal); field->setFont(ft); } } -void QueryDlgBase::verifyButton(QRadioButton *radio, bool is_ok, QWidget *widget2) +void QueryDlgBase::verifyButton(TQRadioButton *radio, bool is_ok, TQWidget *widget2) { if (!radio->isEnabled() ) return; - QColorGroup u_normal = radio->colorGroup(); - u_normal.setColor(QColorGroup::Foreground, QColor(0xff, 0x00, 0x00)); - QColorGroup k_normal = radio->colorGroup(); - k_normal.setColor(QColorGroup::Foreground, QColor(0x00, 0x80, 0x00)); + TQColorGroup u_normal = radio->colorGroup(); + u_normal.setColor(TQColorGroup::Foreground, TQColor(0xff, 0x00, 0x00)); + TQColorGroup k_normal = radio->colorGroup(); + k_normal.setColor(TQColorGroup::Foreground, TQColor(0x00, 0x80, 0x00)); - QPalette known_pal( radio->palette()); - QPalette unknown_pal( radio->palette()); + TQPalette known_pal( radio->palette()); + TQPalette unknown_pal( radio->palette()); // replace text colors - QFont ft = radio->font(); - if (ft.weight() != QFont::Bold) { - ft.setWeight(QFont::Bold); + TQFont ft = radio->font(); + if (ft.weight() != TQFont::Bold) { + ft.setWeight(TQFont::Bold); radio->setFont(ft); } if (widget2 != 0) { ft = widget2->font(); - if (ft.weight() != QFont::Bold) { - ft.setWeight(QFont::Bold); + if (ft.weight() != TQFont::Bold) { + ft.setWeight(TQFont::Bold); widget2->setFont(ft); } } @@ -269,14 +269,14 @@ void QueryDlgBase::verifyButton(QRadioButton *radio, bool is_ok, QWidget *widget -void QueryDlgBase::resetButton(QRadioButton *radio, QWidget *widget2) +void QueryDlgBase::resetButton(TQRadioButton *radio, TQWidget *widget2) { if (!radio->isEnabled() ) return; - QColorGroup normal = radio->colorGroup(); - normal.setColor(QColorGroup::Foreground, QColor(0x00, 0x00, 0x00)); + TQColorGroup normal = radio->colorGroup(); + normal.setColor(TQColorGroup::Foreground, TQColor(0x00, 0x00, 0x00)); - QPalette pal(radio->palette()); + TQPalette pal(radio->palette()); // replace text colors, avoid flickering if ( pal.inactive() != normal || pal.active() != normal) { @@ -287,40 +287,40 @@ void QueryDlgBase::resetButton(QRadioButton *radio, QWidget *widget2) widget2->setPalette( pal ); } - QFont ft = radio->font(); - if (ft.weight() != QFont::Normal) { - ft.setWeight(QFont::Normal); + TQFont ft = radio->font(); + if (ft.weight() != TQFont::Normal) { + ft.setWeight(TQFont::Normal); radio->setFont(ft); } if (widget2 != 0) { ft = widget2->font(); - if (ft.weight() != QFont::Normal) { - ft.setWeight(QFont::Normal); + if (ft.weight() != TQFont::Normal) { + ft.setWeight(TQFont::Normal); widget2->setFont(ft); } } } -QString QueryDlgBase::getOKComment(int percent_done) +TQString QueryDlgBase::getOKComment(int percent_done) { return i18n("Well done, you knew the correct answer. %1% done.").arg(percent_done); } -QString QueryDlgBase::getTimeoutComment(int percent_done) +TQString QueryDlgBase::getTimeoutComment(int percent_done) { return i18n("You waited too long to enter the correct answer. %1% done.").arg(percent_done); } -QString QueryDlgBase::getNOKComment(int percent_done) +TQString QueryDlgBase::getNOKComment(int percent_done) { return i18n("Your answer was wrong. %1% done.").arg(percent_done); } -void QueryDlgBase::closeEvent(QCloseEvent * /*e*/) +void QueryDlgBase::closeEvent(TQCloseEvent * /*e*/) { emit sigQueryChoice(StopIt); } diff --git a/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.h b/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.h index 6f62ddf0..4c67b096 100644 --- a/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.h +++ b/kvoctrain/kvoctrain/query-dialogs/QueryDlgBase.h @@ -51,27 +51,27 @@ class QueryDlgBase : public KDialogBase public: enum Result { Unknown, Known, Timeout, StopIt }; - QueryDlgBase(const QString & caption, QWidget *parent = 0, const char *name = 0, bool modal = false); + QueryDlgBase(const TQString & caption, TQWidget *parent = 0, const char *name = 0, bool modal = false); virtual ~QueryDlgBase (); - bool smartCompare (const QString&, const QString&, int level) const; + bool smartCompare (const TQString&, const TQString&, int level) const; - bool verifyField(QLineEdit *field, const QString &really); - void resetField (QLineEdit *field); + bool verifyField(TQLineEdit *field, const TQString &really); + void resetField (TQLineEdit *field); - bool verifyField(QMultiLineEdit *field, const QString &really, + bool verifyField(TQMultiLineEdit *field, const TQString &really, bool mixed); - void resetField (QMultiLineEdit *field); + void resetField (TQMultiLineEdit *field); - void verifyButton(QRadioButton *radio, bool is_ok, QWidget *widget2 = 0); - void resetButton (QRadioButton *radio, QWidget *widget2 = 0); + void verifyButton(TQRadioButton *radio, bool is_ok, TQWidget *widget2 = 0); + void resetButton (TQRadioButton *radio, TQWidget *widget2 = 0); // Show string after selceting known/unknown // depending on progress and randomness - QString getOKComment(int percent); - QString getNOKComment(int percent); - QString getTimeoutComment(int percent); + TQString getOKComment(int percent); + TQString getNOKComment(int percent); + TQString getTimeoutComment(int percent); int getRandom(int range) { @@ -86,15 +86,15 @@ signals: void sigEditEntry(int row, int col); protected: - virtual void closeEvent(QCloseEvent*e); + virtual void closeEvent(TQCloseEvent*e); virtual void slotUser1(); struct RB_Label { - RB_Label (QRadioButton* _rb, QLabel *_label) + RB_Label (TQRadioButton* _rb, TQLabel *_label) : rb(_rb), label(_label) {} - QRadioButton *rb; - QLabel *label; + TQRadioButton *rb; + TQLabel *label; }; int q_row, @@ -102,8 +102,8 @@ protected: q_tcol; kvoctrainDoc *kv_doc; kvoctrainExpr *kv_exp; - QString translation; - QTimer *qtimer; + TQString translation; + TQTimer *qtimer; int timercount; }; diff --git a/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.cpp b/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.cpp index be309563..8f1e315f 100644 --- a/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.cpp +++ b/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.cpp @@ -33,31 +33,31 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -QStringList RandomQueryDlg::extractTranslations (QString trans) +#include +#include +#include +#include +#include +#include +#include +#include + +TQStringList RandomQueryDlg::extractTranslations (TQString trans) { - QRegExp full_stop ("^(.*[^\\. ])\\.* *$"); + TQRegExp full_stop ("^(.*[^\\. ])\\.* *$"); //full_stop.setMinimal (true); if ( full_stop.search (trans) >= 0 ) trans = full_stop.cap (1); int i; - QStringList translations; + TQStringList translations; if ( Prefs::periods() ) for ( i = fields - 1; i > 0; i -- ) { - QString regexp ("^ *"); + TQString regexp ("^ *"); for ( int j = 0; j < i; j ++ ) regexp += "([^ ][^.]*)\\.[. ]*"; regexp += "([^. ].*)$"; - QRegExp regex (regexp); + TQRegExp regex (regexp); if ( regex.search (trans) >= 0 ) { translations = regex.capturedTexts(); @@ -70,11 +70,11 @@ QStringList RandomQueryDlg::extractTranslations (QString trans) translations.clear(); for ( i = fields - 1; i > 0; i -- ) { - QString regexp ("^ *"); + TQString regexp ("^ *"); for ( int j = 0; j < i; j ++ ) regexp += "([^ ][^:]*):[: ]*"; regexp += "([^: ].*)$"; - QRegExp regex (regexp); + TQRegExp regex (regexp); if ( regex.search (trans) >= 0 ) { translations = regex.capturedTexts(); @@ -88,11 +88,11 @@ QStringList RandomQueryDlg::extractTranslations (QString trans) translations.clear(); for ( i = fields - 1; i > 0; i -- ) { - QString regexp ("^ *"); + TQString regexp ("^ *"); for ( int j = 0; j < i; j ++ ) regexp += "([^ ][^;]*);[; ]*"; regexp += "([^; ].*)$"; - QRegExp regex (regexp); + TQRegExp regex (regexp); if ( regex.search (trans) >= 0 ) { translations = regex.capturedTexts(); @@ -106,11 +106,11 @@ QStringList RandomQueryDlg::extractTranslations (QString trans) translations.clear(); for ( i = fields - 1; i > 0; i -- ) { - QString regexp ("^ *"); + TQString regexp ("^ *"); for ( int j = 0; j < i; j ++ ) regexp += "([^ ][^,]*),[, ]*"; regexp += "([^, ].*)$"; - QRegExp regex (regexp); + TQRegExp regex (regexp); if ( regex.search (trans) >= 0 ) { translations = regex.capturedTexts(); @@ -120,13 +120,13 @@ QStringList RandomQueryDlg::extractTranslations (QString trans) } } if ( translations.count() <= 1 ) - translations = QStringList (trans); + translations = TQStringList (trans); return translations; } RandomQueryDlg::RandomQueryDlg( - QString org, - QString trans, + TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -140,14 +140,14 @@ RandomQueryDlg::RandomQueryDlg( mw = new QueryDlgForm(this); setMainWidget(mw); - connect( mw->c_type, SIGNAL(clicked()), SLOT(slotTypeClicked()) ); - connect( mw->c_remark, SIGNAL(clicked()), SLOT(slotRemClicked()) ); - connect( mw->c_falsefriend, SIGNAL(clicked()), SLOT(slotFFClicked()) ); - connect( mw->dont_know, SIGNAL(clicked()), SLOT(dontKnowClicked()) ); - connect( mw->know_it, SIGNAL(clicked()), SLOT(knowItClicked()) ); - connect( mw->verify, SIGNAL(clicked()), SLOT(verifyClicked()) ); - connect( mw->show_all, SIGNAL(clicked()), SLOT(showAllClicked()) ); - connect( mw->show_more, SIGNAL(clicked()), SLOT(showMoreClicked()) ); + connect( mw->c_type, TQT_SIGNAL(clicked()), TQT_SLOT(slotTypeClicked()) ); + connect( mw->c_remark, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemClicked()) ); + connect( mw->c_falsefriend, TQT_SIGNAL(clicked()), TQT_SLOT(slotFFClicked()) ); + connect( mw->dont_know, TQT_SIGNAL(clicked()), TQT_SLOT(dontKnowClicked()) ); + connect( mw->know_it, TQT_SIGNAL(clicked()), TQT_SLOT(knowItClicked()) ); + connect( mw->verify, TQT_SIGNAL(clicked()), TQT_SLOT(verifyClicked()) ); + connect( mw->show_all, TQT_SIGNAL(clicked()), TQT_SLOT(showAllClicked()) ); + connect( mw->show_more, TQT_SIGNAL(clicked()), TQT_SLOT(showMoreClicked()) ); mw->show_more -> setEnabled (Prefs::showMore()); mw->know_it -> setEnabled (Prefs::iKnow()); @@ -159,7 +159,7 @@ RandomQueryDlg::RandomQueryDlg( else if ( fields > 10 ) fields = 10; - QVBoxLayout * vb = new QVBoxLayout(mw->TranslationFrame, 0, KDialog::spacingHint()); + TQVBoxLayout * vb = new TQVBoxLayout(mw->TranslationFrame, 0, KDialog::spacingHint()); bool suggestions = Prefs::suggestions(); int i; @@ -167,25 +167,25 @@ RandomQueryDlg::RandomQueryDlg( { for ( i = 0; i < fields; i ++ ) { - transCombos.append (new QComboBox (false, mw->TranslationFrame, QCString ("transCombo") + QCString().setNum (i))); - transCombos.at(i) -> setSizePolicy (QSizePolicy ((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, transCombos.at(i) -> sizePolicy().hasHeightForWidth())); + transCombos.append (new TQComboBox (false, mw->TranslationFrame, TQCString ("transCombo") + TQCString().setNum (i))); + transCombos.at(i) -> setSizePolicy (TQSizePolicy ((TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)1, 0, 0, transCombos.at(i) -> sizePolicy().hasHeightForWidth())); transCombos.at(i) -> setEditable (true); - transCombos.at(i) -> setInsertionPolicy (QComboBox::NoInsertion); + transCombos.at(i) -> setInsertionPolicy (TQComboBox::NoInsertion); transCombos.at(i) -> setDuplicatesEnabled (false); vb->addWidget(transCombos.at(i)); - connect (transCombos.at(i), SIGNAL (textChanged (const QString&)), SLOT (slotTransChanged (const QString&))); - connect (transCombos.at(i) -> lineEdit(), SIGNAL (lostFocus()), SLOT (slotTransLostFocus())); + connect (transCombos.at(i), TQT_SIGNAL (textChanged (const TQString&)), TQT_SLOT (slotTransChanged (const TQString&))); + connect (transCombos.at(i) -> lineEdit(), TQT_SIGNAL (lostFocus()), TQT_SLOT (slotTransLostFocus())); } } else { for ( i = 0; i < fields; i ++ ) { - transFields.append (new QLineEdit (mw->TranslationFrame, QCString ("transField") + QCString().setNum (i))); - transFields.at(i) -> setSizePolicy (QSizePolicy ((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, transFields.at(i) -> sizePolicy().hasHeightForWidth())); + transFields.append (new TQLineEdit (mw->TranslationFrame, TQCString ("transField") + TQCString().setNum (i))); + transFields.at(i) -> setSizePolicy (TQSizePolicy ((TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)1, 0, 0, transFields.at(i) -> sizePolicy().hasHeightForWidth())); vb->addWidget(transFields.at(i)); - connect (transFields.at(i), SIGNAL (textChanged (const QString&)), SLOT (slotTransChanged (const QString&))); - connect (transFields.at(i), SIGNAL (lostFocus()), SLOT (slotTransLostFocus())); + connect (transFields.at(i), TQT_SIGNAL (textChanged (const TQString&)), TQT_SLOT (slotTransChanged (const TQString&))); + connect (transFields.at(i), TQT_SIGNAL (lostFocus()), TQT_SLOT (slotTransLostFocus())); } } @@ -201,7 +201,7 @@ RandomQueryDlg::RandomQueryDlg( ProgressDlg* pdlg = 0; if ( split && kv_doc -> numEntries() >= 500 ) { - pdlg = new ProgressDlg (QString(), QString(), kapp -> makeStdCaption (i18n("Loading Random Query"))); + pdlg = new ProgressDlg (TQString(), TQString(), kapp -> makeStdCaption (i18n("Loading Random Query"))); pdlg -> resize (pdlg -> width(), pdlg -> minimumSize().height()); pdlg -> show(); kapp -> processEvents(); @@ -243,8 +243,8 @@ RandomQueryDlg::~RandomQueryDlg() } -void RandomQueryDlg::setQuery(QString org, - QString trans, +void RandomQueryDlg::setQuery(TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -297,7 +297,7 @@ void RandomQueryDlg::setQuery(QString org, mw->orgField->setFont(Prefs::tableFont()); mw->orgField->setText (org); mw->show_all->setDefault(true); - QString s; + TQString s; s.setNum (q_cycle); mw->progCount->setText (s); @@ -315,8 +315,8 @@ void RandomQueryDlg::setQuery(QString org, int mqtime = Prefs::maxTimePer(); if (mqtime > 0) { if (qtimer == 0) { - qtimer = new QTimer( this ); - connect( qtimer, SIGNAL(timeout()), this, SLOT(timeoutReached()) ); + qtimer = new TQTimer( this ); + connect( qtimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeoutReached()) ); } if (Prefs::queryTimeout() != Prefs::EnumQueryTimeout::NoTimeout) { @@ -348,11 +348,11 @@ void RandomQueryDlg::initFocus() const void RandomQueryDlg::verifyClicked() { - QStringList trans (translations); + TQStringList trans (translations); uint i, j; if ( Prefs::suggestions() ) { - QPtrList combos (transCombos); + TQPtrList combos (transCombos); for ( i = combos.count() - 1; i >= translations.count(); i -- ) combos.remove (i); for ( i = 0; i < combos.count(); i ++ ) @@ -381,7 +381,7 @@ void RandomQueryDlg::verifyClicked() } else { - QPtrList fields (transFields); + TQPtrList fields (transFields); for ( i = fields.count() - 1; i >= translations.count(); i -- ) fields.remove (i); for ( i = 0; i < fields.count(); i ++ ) @@ -415,7 +415,7 @@ void RandomQueryDlg::showMoreClicked() if ( Prefs::suggestions() ) for ( uint i = 0; i < translations.count(); i ++ ) { - QComboBox* combo = transCombos.at(i); + TQComboBox* combo = transCombos.at(i); if ( ! smartCompare (combo -> currentText(), translations[i], 0) ) { uint length = combo -> currentText().length() + 1; @@ -437,7 +437,7 @@ void RandomQueryDlg::showMoreClicked() else for ( uint i = 0; i < translations.count(); i ++ ) { - QLineEdit* field = transFields.at(i); + TQLineEdit* field = transFields.at(i); if ( ! smartCompare (field -> text(), translations[i], 0) ) { uint length = field -> text().length() + 1; @@ -482,23 +482,23 @@ void RandomQueryDlg::showAllClicked() } -void RandomQueryDlg::slotTransChanged(const QString&) +void RandomQueryDlg::slotTransChanged(const TQString&) { mw->verify->setDefault(true); bool suggestions = Prefs::suggestions(); - if ( suggestions && sender() && sender() -> isA ("QComboBox") ) + if ( suggestions && sender() && sender() -> isA ("TQComboBox") ) { - QLineEdit* edit = ((QComboBox*) sender()) -> lineEdit(); + TQLineEdit* edit = ((TQComboBox*) sender()) -> lineEdit(); resetField (edit); suggestion_hint = ! edit -> text().isEmpty() && edit -> text().length() <= 10; if ( suggestion_hint ) - mw->status -> setText (QString (i18n("Press F5 for a list of translations starting with '%1'\n" + mw->status -> setText (TQString (i18n("Press F5 for a list of translations starting with '%1'\n" "Press F6 for a list of translations containing '%2'")).arg (edit -> text()).arg (edit -> text())); else mw->status -> clear(); } - else if ( ! suggestions && sender() && sender() -> isA ("QLineEdit") ) - resetField ((QLineEdit*) sender()); + else if ( ! suggestions && sender() && sender() -> isA ("TQLineEdit") ) + resetField ((TQLineEdit*) sender()); } void RandomQueryDlg::slotTransLostFocus() @@ -551,7 +551,7 @@ void RandomQueryDlg::dontKnowClicked() void RandomQueryDlg::setHintFields() { - QString s; + TQString s; kvoctrainExpr *exp = kv_doc->getEntry(q_row); s = exp->getRemark(q_ocol); @@ -627,11 +627,11 @@ void RandomQueryDlg::slotTypeClicked() } -void RandomQueryDlg::keyPressEvent( QKeyEvent *e ) +void RandomQueryDlg::keyPressEvent( TQKeyEvent *e ) { if ( Prefs::suggestions() ) { - QComboBox* combo = 0; + TQComboBox* combo = 0; if ( e -> key() == Key_F4 || e -> key() == Key_F5 || e -> key() == Key_F6 ) for ( uint i = 0; i < translations.count(); i ++ ) if ( transCombos.at(i) -> hasFocus() ) @@ -645,11 +645,11 @@ void RandomQueryDlg::keyPressEvent( QKeyEvent *e ) case Key_F6: if ( combo && ! combo -> currentText().isEmpty() ) { - QString curText (combo -> currentText()); + TQString curText (combo -> currentText()); combo -> clear(); for ( uint i = 0; i < vocabulary.count(); i ++ ) { - QString trans (vocabulary[i]); + TQString trans (vocabulary[i]); if ( (e -> key() == Key_F5 && trans.startsWith (curText, false) || e -> key() == Key_F6 && trans.contains (curText, false)) ) combo -> insertItem (trans); diff --git a/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.h b/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.h index 92ab7fd7..e1fd7362 100644 --- a/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.h +++ b/kvoctrain/kvoctrain/query-dialogs/RandomQueryDlg.h @@ -30,8 +30,8 @@ #include "RandomQueryDlgForm.h" #include "QueryDlgBase.h" -#include -#include +#include +#include class kvoctrainDoc; @@ -41,8 +41,8 @@ class RandomQueryDlg : public QueryDlgBase public: RandomQueryDlg( - QString org, - QString trans, + TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -54,8 +54,8 @@ public: ~RandomQueryDlg(); - void setQuery(QString org, - QString trans, + void setQuery(TQString org, + TQString trans, int entry, int orgcol, int transcol, @@ -76,25 +76,25 @@ public slots: void dontKnowClicked(); void timeoutReached(); void slotUser2(); - void slotTransChanged(const QString&); + void slotTransChanged(const TQString&); void slotTransLostFocus(); void slotFFClicked(); void slotTypeClicked(); void slotRemClicked(); protected: - virtual void keyPressEvent(QKeyEvent *e); + virtual void keyPressEvent(TQKeyEvent *e); void setHintFields(); - QStringList extractTranslations (QString trans); + TQStringList extractTranslations (TQString trans); kvoctrainDoc * kv_doc; - QPtrList transCombos; - QPtrList transFields; + TQPtrList transCombos; + TQPtrList transFields; - QStringList translations; - QStringList vocabulary; + TQStringList translations; + TQStringList vocabulary; bool suggestion_hint; int fields; diff --git a/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.cpp b/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.cpp index 47421e7a..1c6f8469 100644 --- a/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.cpp +++ b/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.cpp @@ -27,10 +27,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -51,12 +51,12 @@ SimpleQueryDlg::SimpleQueryDlg( mw = new SimpleQueryDlgForm(this); setMainWidget(mw); - connect(mw->dont_know, SIGNAL(clicked()), SLOT(dontKnowClicked()) ); - connect(mw->know_it, SIGNAL(clicked()), SLOT(knowItClicked()) ); - connect(mw->verify, SIGNAL(clicked()), SLOT(verifyClicked()) ); - connect(mw->show_all, SIGNAL(clicked()), SLOT(showAllClicked()) ); - connect(mw->show_more, SIGNAL(clicked()), SLOT(showMoreClicked()) ); - connect(mw->answerField, SIGNAL(textChanged()), SLOT(slotAnswerChanged()) ); + connect(mw->dont_know, TQT_SIGNAL(clicked()), TQT_SLOT(dontKnowClicked()) ); + connect(mw->know_it, TQT_SIGNAL(clicked()), TQT_SLOT(knowItClicked()) ); + connect(mw->verify, TQT_SIGNAL(clicked()), TQT_SLOT(verifyClicked()) ); + connect(mw->show_all, TQT_SIGNAL(clicked()), TQT_SLOT(showAllClicked()) ); + connect(mw->show_more, TQT_SIGNAL(clicked()), TQT_SLOT(showMoreClicked()) ); + connect(mw->answerField, TQT_SIGNAL(textChanged()), TQT_SLOT(slotAnswerChanged()) ); kv_doc = 0; qtimer = 0; @@ -100,7 +100,7 @@ void SimpleQueryDlg::setQuery(QueryType _querytype, mw->answerField->setFont(Prefs::tableFont()); mw->answerField->setText(""); - QString s; + TQString s; switch (querytype) { case QT_Synonym: @@ -169,8 +169,8 @@ void SimpleQueryDlg::setQuery(QueryType _querytype, if (mqtime > 0) { if (qtimer == 0) { - qtimer = new QTimer( this ); - connect( qtimer, SIGNAL(timeout()), this, SLOT(timeoutReached()) ); + qtimer = new TQTimer( this ); + connect( qtimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeoutReached()) ); } if (Prefs::queryTimeout() != Prefs::EnumQueryTimeout::NoTimeout) { @@ -295,7 +295,7 @@ void SimpleQueryDlg::slotUser2() } -void SimpleQueryDlg::keyPressEvent(QKeyEvent *e) +void SimpleQueryDlg::keyPressEvent(TQKeyEvent *e) { switch( e->key() ) { @@ -323,7 +323,7 @@ void SimpleQueryDlg::keyPressEvent(QKeyEvent *e) void SimpleQueryDlg::setQueryFieldWordwrap() { - QFontMetrics fm(Prefs::tableFont()); + TQFontMetrics fm(Prefs::tableFont()); int w = fm.width(mw->queryField->text()); int w2 = mw->width(); if (w > w2) diff --git a/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.h b/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.h index adf9827b..9d88cf4a 100644 --- a/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.h +++ b/kvoctrain/kvoctrain/query-dialogs/SimpleQueryDlg.h @@ -59,7 +59,7 @@ public slots: virtual void initFocus() const; protected: - void keyPressEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); public slots: void showMoreClicked(); @@ -72,7 +72,7 @@ public slots: void timeoutReached(); protected: - QString answerstring; + TQString answerstring; QueryType querytype; private: diff --git a/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.cpp b/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.cpp index 8a33d2c3..72d749a2 100644 --- a/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.cpp +++ b/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.cpp @@ -32,14 +32,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include VerbQueryDlg::VerbQueryDlg ( - QString type, + TQString type, int entry, int col, int query_cycle, @@ -54,32 +54,32 @@ VerbQueryDlg::VerbQueryDlg mw = new VerbQueryDlgForm(this); setMainWidget(mw); - connect(mw->dont_know, SIGNAL(clicked()), SLOT(dontKnowClicked()) ); - connect(mw->know_it, SIGNAL(clicked()), SLOT(knowItClicked()) ); - connect(mw->verify, SIGNAL(clicked()), SLOT(verifyClicked()) ); - connect(mw->show_all, SIGNAL(clicked()), SLOT(showAllClicked()) ); - - connect(mw->p3pmField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p3pnField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p3snField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p3smField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p3pfField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p3sfField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p2pField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p2sField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p1pField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - connect(mw->p1sField, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) ); - - connect(mw->p3pmField, SIGNAL(textChanged(const QString&)), SLOT(slotP3pmChanged(const QString&)) ); - connect(mw->p3snField, SIGNAL(textChanged(const QString&)), SLOT(slotP3snChanged(const QString&)) ); - connect(mw->p3pnField, SIGNAL(textChanged(const QString&)), SLOT(slotP3pnChanged(const QString&)) ); - connect(mw->p3smField, SIGNAL(textChanged(const QString&)), SLOT(slotP3smChanged(const QString&)) ); - connect(mw->p3pfField, SIGNAL(textChanged(const QString&)), SLOT(slotP3pfChanged(const QString&)) ); - connect(mw->p3sfField, SIGNAL(textChanged(const QString&)), SLOT(slotP3sfChanged(const QString&)) ); - connect(mw->p2pField, SIGNAL(textChanged(const QString&)), SLOT(slotP2pChanged(const QString&)) ); - connect(mw->p2sField, SIGNAL(textChanged(const QString&)), SLOT(slotP2sChanged(const QString&)) ); - connect(mw->p1pField, SIGNAL(textChanged(const QString&)), SLOT(slotP1pChanged(const QString&)) ); - connect(mw->p1sField, SIGNAL(textChanged(const QString&)), SLOT(slotP1sChanged(const QString&)) ); + connect(mw->dont_know, TQT_SIGNAL(clicked()), TQT_SLOT(dontKnowClicked()) ); + connect(mw->know_it, TQT_SIGNAL(clicked()), TQT_SLOT(knowItClicked()) ); + connect(mw->verify, TQT_SIGNAL(clicked()), TQT_SLOT(verifyClicked()) ); + connect(mw->show_all, TQT_SIGNAL(clicked()), TQT_SLOT(showAllClicked()) ); + + connect(mw->p3pmField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p3pnField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p3snField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p3smField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p3pfField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p3sfField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p2pField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p2sField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p1pField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + connect(mw->p1sField, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) ); + + connect(mw->p3pmField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP3pmChanged(const TQString&)) ); + connect(mw->p3snField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP3snChanged(const TQString&)) ); + connect(mw->p3pnField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP3pnChanged(const TQString&)) ); + connect(mw->p3smField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP3smChanged(const TQString&)) ); + connect(mw->p3pfField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP3pfChanged(const TQString&)) ); + connect(mw->p3sfField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP3sfChanged(const TQString&)) ); + connect(mw->p2pField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP2pChanged(const TQString&)) ); + connect(mw->p2sField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP2sChanged(const TQString&)) ); + connect(mw->p1pField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP1pChanged(const TQString&)) ); + connect(mw->p1sField, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotP1sChanged(const TQString&)) ); qtimer = 0; @@ -102,7 +102,7 @@ void VerbQueryDlg::initFocus() const } -void VerbQueryDlg::setQuery(QString, +void VerbQueryDlg::setQuery(TQString, int entry, int col, int q_cycle, @@ -122,7 +122,7 @@ void VerbQueryDlg::setQuery(QString, mw->timebar->setEnabled(Prefs::showCounter()); mw->timelabel->setEnabled(Prefs::showCounter()); mw->show_all->setDefault(true); - QString s; + TQString s; s.setNum (q_cycle); mw->progCount->setText (s); @@ -145,8 +145,8 @@ void VerbQueryDlg::setQuery(QString, if (mqtime > 0) { // more than 1000 milli-seconds if (qtimer == 0) { - qtimer = new QTimer( this ); - connect( qtimer, SIGNAL(timeout()), this, SLOT(timeoutReached()) ); + qtimer = new TQTimer( this ); + connect( qtimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeoutReached()) ); } if (Prefs::queryTimeout() != Prefs::EnumQueryTimeout::NoTimeout) { @@ -169,7 +169,7 @@ void VerbQueryDlg::setQuery(QString, bool VerbQueryDlg::next() { resetAllFields(); - QString s, type; + TQString s, type; if (q_ocol == 0) s = kv_exp->getOriginal(); else @@ -179,8 +179,8 @@ bool VerbQueryDlg::next() current++; type = conjugations.getType(current); - QString format = i18n("Current tense is: %1."); - QString msg = format.arg(conjugations.getName(type)); + TQString format = i18n("Current tense is: %1."); + TQString msg = format.arg(conjugations.getName(type)); mw->instructionLabel->setText (msg); mw->baseLabel->setText (s); @@ -236,7 +236,7 @@ void VerbQueryDlg::showAllClicked() resetAllFields(); mw->dont_know->setDefault(true); - QString type = conjugations.getType (current); + TQString type = conjugations.getType (current); mw->p1sField->setText (conjugations.pers1Singular(type)); mw->p2sField->setText (conjugations.pers2Singular(type)); @@ -275,7 +275,7 @@ void VerbQueryDlg::showAllClicked() void VerbQueryDlg::verifyClicked() { - QString type = conjugations.getType(current); + TQString type = conjugations.getType(current); bool known = true; @@ -412,7 +412,7 @@ void VerbQueryDlg::slotUser2() } -void VerbQueryDlg::keyPressEvent( QKeyEvent *e ) +void VerbQueryDlg::keyPressEvent( TQKeyEvent *e ) { switch( e->key() ) { @@ -439,14 +439,14 @@ void VerbQueryDlg::keyPressEvent( QKeyEvent *e ) } -void VerbQueryDlg::slotP3pfChanged(const QString&) +void VerbQueryDlg::slotP3pfChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p3pfField); } -void VerbQueryDlg::slotP3snChanged(const QString&) +void VerbQueryDlg::slotP3snChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p3snField); @@ -458,56 +458,56 @@ void VerbQueryDlg::slotReturnPressed() } -void VerbQueryDlg::slotP3smChanged(const QString&) +void VerbQueryDlg::slotP3smChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p3smField); } -void VerbQueryDlg::slotP3pnChanged(const QString&) +void VerbQueryDlg::slotP3pnChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p3pnField); } -void VerbQueryDlg::slotP3sfChanged(const QString&) +void VerbQueryDlg::slotP3sfChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p3sfField); } -void VerbQueryDlg::slotP1sChanged(const QString&) +void VerbQueryDlg::slotP1sChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p1sField); } -void VerbQueryDlg::slotP2sChanged(const QString&) +void VerbQueryDlg::slotP2sChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p2sField); } -void VerbQueryDlg::slotP3pmChanged(const QString&) +void VerbQueryDlg::slotP3pmChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p3pmField); } -void VerbQueryDlg::slotP1pChanged(const QString&) +void VerbQueryDlg::slotP1pChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p1pField); } -void VerbQueryDlg::slotP2pChanged(const QString&) +void VerbQueryDlg::slotP2pChanged(const TQString&) { mw->verify->setDefault(true); resetField(mw->p2pField); diff --git a/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.h b/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.h index e972eb2a..910cd89a 100644 --- a/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.h +++ b/kvoctrain/kvoctrain/query-dialogs/VerbQueryDlg.h @@ -37,7 +37,7 @@ class VerbQueryDlg : public QueryDlgBase public: VerbQueryDlg( - QString type, + TQString type, int entry, int col, int query_cycle, @@ -50,7 +50,7 @@ public: ~VerbQueryDlg(); - void setQuery(QString type, + void setQuery(TQString type, int entry, int col, int query_cycle, @@ -66,25 +66,25 @@ public slots: protected: bool next(); - void keyPressEvent( QKeyEvent *e ); + void keyPressEvent( TQKeyEvent *e ); void resetAllFields(); protected slots: void slotUser2(); - void slotP3pfChanged(const QString&); - void slotP3snChanged(const QString&); + void slotP3pfChanged(const TQString&); + void slotP3snChanged(const TQString&); void showAllClicked(); void slotReturnPressed(); - void slotP3smChanged(const QString&); + void slotP3smChanged(const TQString&); void knowItClicked(); void dontKnowClicked(); - void slotP3pnChanged(const QString&); - void slotP3sfChanged(const QString&); - void slotP1sChanged(const QString&); - void slotP2sChanged(const QString&); - void slotP3pmChanged(const QString&); - void slotP1pChanged(const QString&); - void slotP2pChanged(const QString&); + void slotP3pnChanged(const TQString&); + void slotP3sfChanged(const TQString&); + void slotP1sChanged(const TQString&); + void slotP2sChanged(const TQString&); + void slotP3pmChanged(const TQString&); + void slotP1pChanged(const TQString&); + void slotP2pChanged(const TQString&); void verifyClicked(); void timeoutReached(); diff --git a/kvoctrain/kvoctrain/spotlight2kvtml.cpp b/kvoctrain/kvoctrain/spotlight2kvtml.cpp index c0d4ab90..c6f9c565 100644 --- a/kvoctrain/kvoctrain/spotlight2kvtml.cpp +++ b/kvoctrain/kvoctrain/spotlight2kvtml.cpp @@ -23,7 +23,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -42,20 +42,20 @@ using namespace std; #define SPOT_VERSION "v0.2.1" -vector lesson_names; +vector lesson_names; struct spotty { - QString type; + TQString type; int lesson; - QString en_rem, // possibly remarks + TQString en_rem, // possibly remarks de_rem; - QString en, + TQString en, de; }; vector spottys; -void writeSpotty (QTextStream &os, spotty& spot_line, bool first) { +void writeSpotty (TQTextStream &os, spotty& spot_line, bool first) { os << " \n" @@ -308,8 +308,8 @@ int main(int argc, char **argv) exit (1); } - QString spot (argv[1]); - QString kvtml; + TQString spot (argv[1]); + TQString kvtml; int dot = spot.findRev('.'); if (dot < 0) { @@ -321,9 +321,9 @@ int main(int argc, char **argv) kvtml += "." KVTML_EXT; } - QFile fs(spot); + TQFile fs(spot); fs.open( IO_ReadOnly ); - QTextStream is( &fs ); + TQTextStream is( &fs ); readToMem (is, argv[2], argv[3]); fs.close(); @@ -332,9 +332,9 @@ int main(int argc, char **argv) exit (1); } - QFile fk(kvtml); + TQFile fk(kvtml); fk.open( IO_WriteOnly ); - QTextStream os( &fk ); + TQTextStream os( &fk ); writeToKvtml(os, argv[2], argv[3]); fk.close(); diff --git a/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.cpp b/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.cpp index d9fdea3f..4537b42f 100644 --- a/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.cpp +++ b/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.cpp @@ -27,18 +27,18 @@ #include -#include -#include +#include +#include -GenStatPage::GenStatPage(kvoctrainDoc *doc, QWidget* parent, const char* name): GenStatPageForm( parent, name ) +GenStatPage::GenStatPage(kvoctrainDoc *doc, TQWidget* parent, const char* name): GenStatPageForm( parent, name ) { l_filename->setText(doc->URL().path()); l_title->setText(doc->getTitle()); l_author->setText(doc->getAuthor()); - QString s; + TQString s; s.setNum(doc->numEntries()); kcfg_entriesPerLesson->setText(s); - vector lesson = doc->getLessonDescr(); + vector lesson = doc->getLessonDescr(); s.setNum(lesson.size()); l_lessons->setText(s); } diff --git a/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.h b/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.h index b868741f..38cb7854 100644 --- a/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.h +++ b/kvoctrain/kvoctrain/statistik-dialogs/GenStatPage.h @@ -37,7 +37,7 @@ class GenStatPage : public GenStatPageForm public: - GenStatPage(kvoctrainDoc *doc, QWidget* parent = NULL, const char* name = NULL); + GenStatPage(kvoctrainDoc *doc, TQWidget* parent = NULL, const char* name = NULL); }; #endif // GenStatPage_included diff --git a/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.cpp b/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.cpp index 79bdcb99..7fd6bbb0 100644 --- a/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.cpp +++ b/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.cpp @@ -23,7 +23,7 @@ * * ***************************************************************************/ -#include +#include #include "StatistikDlg.h" #include "StatistikPage.h" @@ -34,28 +34,28 @@ #include #include -StatistikDlg::StatistikDlg(LangSet &langset, kvoctrainDoc *doc, QWidget *parent, const char *name, bool modal) +StatistikDlg::StatistikDlg(LangSet &langset, kvoctrainDoc *doc, TQWidget *parent, const char *name, bool modal) : KDialogBase(Tabbed, i18n("Document Statistics"), Close, Close, parent, name, modal) { - QFrame * page; - QVBoxLayout * topLayout; + TQFrame * page; + TQVBoxLayout * topLayout; StatistikPage *spage; page = addPage(i18n("General")); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); GenStatPage *gspage = new GenStatPage (doc, page, name); topLayout->addWidget(gspage); for (int i = 1; i < (int) doc->numLangs(); i++) { - QString s = langset.findLongId(doc->getIdent(i)); + TQString s = langset.findLongId(doc->getIdent(i)); if (s.isEmpty() ) s = doc->getIdent(i); else s = i18n(s.local8Bit()); page = addPage(s); - topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); spage = new StatistikPage (i, doc, page, name); topLayout->addWidget(spage); } diff --git a/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.h b/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.h index 4f519550..3199ae27 100644 --- a/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.h +++ b/kvoctrain/kvoctrain/statistik-dialogs/StatistikDlg.h @@ -40,7 +40,7 @@ class StatistikDlg : public KDialogBase Q_OBJECT public: - StatistikDlg(LangSet &langset, kvoctrainDoc *doc, QWidget *parent = NULL, const char *name = NULL, bool modal = true); + StatistikDlg(LangSet &langset, kvoctrainDoc *doc, TQWidget *parent = NULL, const char *name = NULL, bool modal = true); }; diff --git a/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.cpp b/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.cpp index 6541d085..7453b75c 100644 --- a/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.cpp +++ b/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.cpp @@ -32,8 +32,8 @@ #include #include -#include -#include +#include +#include #define MIN_COL_WIDTH 2 #define PIX_SHIFT 2 @@ -50,7 +50,7 @@ class GradeListItem : public QListViewItem { public: - inline GradeListItem (QListView* parent, int _lesson): QListViewItem(parent), lesson(_lesson) {} + inline GradeListItem (TQListView* parent, int _lesson): TQListViewItem(parent), lesson(_lesson) {} inline int getLesson() const { return lesson; } private: @@ -58,7 +58,7 @@ private: }; -StatistikPage::StatistikPage(int col, kvoctrainDoc *_doc, QWidget *parent, const char *name) +StatistikPage::StatistikPage(int col, kvoctrainDoc *_doc, TQWidget *parent, const char *name) : StatistikPageForm( parent, name ), doc(_doc) { StatListView->setColumnWidth(0, SIZE_GRADE + 10); @@ -66,7 +66,7 @@ StatistikPage::StatistikPage(int col, kvoctrainDoc *_doc, QWidget *parent, cons StatListView->setColumnWidth(2, SIZE_COUNT); StatListView->setColumnWidth(3, SIZE_LESSON); - vector lesson = doc->getLessonDescr(); + vector lesson = doc->getLessonDescr(); fsc.resize(lesson.size()+1); tsc.resize(lesson.size()+1); @@ -85,8 +85,8 @@ StatistikPage::StatistikPage(int col, kvoctrainDoc *_doc, QWidget *parent, cons } } setupPixmaps(); - connect(StatListView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint& , int ) ), - this, SLOT( slotRMB( QListViewItem *, const QPoint &, int ) ) ); + connect(StatListView, TQT_SIGNAL( rightButtonPressed( TQListViewItem *, const TQPoint& , int ) ), + this, TQT_SLOT( slotRMB( TQListViewItem *, const TQPoint &, int ) ) ); } @@ -97,9 +97,9 @@ void StatistikPage::setupPixmaps() GradeListItem lvi (StatListView, 0); height = lvi.height(); for (int entry = 0; entry < (int) fsc.size(); entry++) { - QPainter p; - QColor color; - QPixmap fpix (SIZE_GRADE, height); + TQPainter p; + TQColor color; + TQPixmap fpix (SIZE_GRADE, height); p.begin( &fpix); p.eraseRect (0, 0, fpix.width(), fpix.height()); p.setPen( black ); @@ -158,7 +158,7 @@ void StatistikPage::setupPixmaps() p.end(); from_pix.push_back(fpix); - QPixmap tpix (SIZE_GRADE, height); + TQPixmap tpix (SIZE_GRADE, height); p.begin( &tpix ); p.eraseRect (0, 0, tpix.width(), tpix.height()); p.setPen( black ); @@ -218,9 +218,9 @@ void StatistikPage::setupPixmaps() } // setup rows with pixmaps and strings - vector lesson = doc->getLessonDescr(); + vector lesson = doc->getLessonDescr(); - QString s; + TQString s; GradeListItem *plvi = new GradeListItem(StatListView, 0); plvi->setPixmap (TB_FGRADE, from_pix[0]); @@ -242,7 +242,7 @@ void StatistikPage::setupPixmaps() } -void StatistikPage::slotRMB( QListViewItem* Item, const QPoint & /*point*/, int col) +void StatistikPage::slotRMB( TQListViewItem* Item, const TQPoint & /*point*/, int col) { if( Item != 0) slotPopupMenu(((GradeListItem*)Item)->getLesson(), col); @@ -274,16 +274,16 @@ void StatistikPage::slotPopupMenu(int row, int col) KPopupMenu *header_m = new KPopupMenu(i18n("Number of Entries per Grade")); - header_m->insertItem (i18n(KV_NORM_TEXT) + "\t" + QString::number(sc->grade[KV_NORM_GRADE]) ); - header_m->insertItem (i18n(KV_LEV1_TEXT) + "\t" + QString::number(sc->grade[KV_LEV1_GRADE]) ); - header_m->insertItem (i18n(KV_LEV2_TEXT) + "\t" + QString::number(sc->grade[KV_LEV2_GRADE]) ); - header_m->insertItem (i18n(KV_LEV3_TEXT) + "\t" + QString::number(sc->grade[KV_LEV3_GRADE]) ); - header_m->insertItem (i18n(KV_LEV4_TEXT) + "\t" + QString::number(sc->grade[KV_LEV4_GRADE]) ); - header_m->insertItem (i18n(KV_LEV5_TEXT) + "\t" + QString::number(sc->grade[KV_LEV5_GRADE]) ); - header_m->insertItem (i18n(KV_LEV6_TEXT) + "\t" + QString::number(sc->grade[KV_LEV6_GRADE]) ); - header_m->insertItem (i18n(KV_LEV7_TEXT) + "\t" + QString::number(sc->grade[KV_LEV7_GRADE]) ); + header_m->insertItem (i18n(KV_NORM_TEXT) + "\t" + TQString::number(sc->grade[KV_NORM_GRADE]) ); + header_m->insertItem (i18n(KV_LEV1_TEXT) + "\t" + TQString::number(sc->grade[KV_LEV1_GRADE]) ); + header_m->insertItem (i18n(KV_LEV2_TEXT) + "\t" + TQString::number(sc->grade[KV_LEV2_GRADE]) ); + header_m->insertItem (i18n(KV_LEV3_TEXT) + "\t" + TQString::number(sc->grade[KV_LEV3_GRADE]) ); + header_m->insertItem (i18n(KV_LEV4_TEXT) + "\t" + TQString::number(sc->grade[KV_LEV4_GRADE]) ); + header_m->insertItem (i18n(KV_LEV5_TEXT) + "\t" + TQString::number(sc->grade[KV_LEV5_GRADE]) ); + header_m->insertItem (i18n(KV_LEV6_TEXT) + "\t" + TQString::number(sc->grade[KV_LEV6_GRADE]) ); + header_m->insertItem (i18n(KV_LEV7_TEXT) + "\t" + TQString::number(sc->grade[KV_LEV7_GRADE]) ); - header_m->exec(QCursor::pos()+QPoint(10, 0)); + header_m->exec(TQCursor::pos()+TQPoint(10, 0)); } #include "StatistikPage.moc" diff --git a/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.h b/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.h index a5a7d166..0e15231e 100644 --- a/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.h +++ b/kvoctrain/kvoctrain/statistik-dialogs/StatistikPage.h @@ -30,7 +30,7 @@ #include -#include +#include class kvoctrainDoc; class GradeCols; @@ -40,11 +40,11 @@ class StatistikPage : public StatistikPageForm Q_OBJECT public: - StatistikPage(int col, kvoctrainDoc *doc, QWidget *parent = NULL, const char *name = NULL); + StatistikPage(int col, kvoctrainDoc *doc, TQWidget *parent = NULL, const char *name = NULL); public slots: void slotPopupMenu(int row, int col); - void slotRMB( QListViewItem* Item, const QPoint & point, int ); + void slotRMB( TQListViewItem* Item, const TQPoint & point, int ); protected: void setupPixmaps(); @@ -63,7 +63,7 @@ protected: int calc_width (struct StatistikPage::stat_counter *gc, int grade, int max_width); - vector from_pix, to_pix; + vector from_pix, to_pix; kvoctrainDoc *doc; vector fsc; diff --git a/kvoctrain/kvoctrain/tools/extractlang.cpp b/kvoctrain/kvoctrain/tools/extractlang.cpp index 6123214c..a775274e 100644 --- a/kvoctrain/kvoctrain/tools/extractlang.cpp +++ b/kvoctrain/kvoctrain/tools/extractlang.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include /////////////////////////////////////////////////////////// // @@ -14,16 +14,16 @@ // /////////////////////////////////////////////////////////// -QString twoLangs; -QString threeLangs; +TQString twoLangs; +TQString threeLangs; -void parseLanguage(QString name, QString three, QString two) +void parseLanguage(TQString name, TQString three, TQString two) { int star = three.find('*'); if (star > 0) three.remove(star, 1); - QString three_1 = three; + TQString three_1 = three; int slash = three_1.find('/'); if (slash > 0) { @@ -59,11 +59,11 @@ void parseLanguage(QString name, QString three, QString two) threeLangs.append("\")}},\n"); } -QString parseTD(QString& line) +TQString parseTD(TQString& line) { - QCString cline = line.local8Bit(); + TQCString cline = line.local8Bit(); uint clineLength = cline.length(); - QCString result = cline; + TQCString result = cline; int pos = -1; bool inTag = false; @@ -80,15 +80,15 @@ QString parseTD(QString& line) } } - QString retVal(result); + TQString retVal(result); retVal = retVal.left(pos+1); return retVal.simplifyWhiteSpace(); } -bool parseTR(QString& line, QTextIStream& in) +bool parseTR(TQString& line, TQTextIStream& in) { - QString text[4]; + TQString text[4]; line = in.readLine(); if (line.isNull()) @@ -119,11 +119,11 @@ bool parseTR(QString& line, QTextIStream& in) int main() { - QString line; + TQString line; bool readNext = true; - QTextIStream in(stdin); - QTextOStream out(stdout); + TQTextIStream in(stdin); + TQTextOStream out(stdout); while (!in.atEnd()) { diff --git a/kwordquiz/src/dlglanguage.cpp b/kwordquiz/src/dlglanguage.cpp index 97a8e6c1..f142ee64 100644 --- a/kwordquiz/src/dlglanguage.cpp +++ b/kwordquiz/src/dlglanguage.cpp @@ -18,12 +18,12 @@ #include #include -#include +#include #include "prefs.h" #include "dlglanguage.h" -DlgLanguage::DlgLanguage(QWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Column Titles"), Ok|Cancel, Ok, parent, name, modal, true) +DlgLanguage::DlgLanguage(TQWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Column Titles"), Ok|Cancel, Ok, parent, name, modal, true) { dlgBase = new DlgLanguageBase( this, "Dlg" ); setMainWidget(dlgBase); @@ -49,7 +49,7 @@ DlgLanguage::~DlgLanguage() } -void DlgLanguage::setLanguage(int index, const QString &lang) { +void DlgLanguage::setLanguage(int index, const TQString &lang) { if (index == 1) { dlgBase->txtLanguage1 -> setText(lang); } @@ -60,7 +60,7 @@ void DlgLanguage::setLanguage(int index, const QString &lang) { } -QString DlgLanguage::Language(int index){ +TQString DlgLanguage::Language(int index){ if (index == 1) { completion1->addItem(dlgBase->txtLanguage1 -> text()); Prefs::setColumnTitles1(completion1->items()); diff --git a/kwordquiz/src/dlglanguage.h b/kwordquiz/src/dlglanguage.h index 8dfba91d..d158f52b 100644 --- a/kwordquiz/src/dlglanguage.h +++ b/kwordquiz/src/dlglanguage.h @@ -29,11 +29,11 @@ class KCompletion; class DlgLanguage : public KDialogBase { Q_OBJECT public: - DlgLanguage(QWidget *parent = 0, const char *name = 0, bool modal=true); + DlgLanguage(TQWidget *parent = 0, const char *name = 0, bool modal=true); ~DlgLanguage(); - void setLanguage(int index, const QString &lang); - QString Language(int index); + void setLanguage(int index, const TQString &lang); + TQString Language(int index); private: DlgLanguageBase *dlgBase; diff --git a/kwordquiz/src/dlgrc.cpp b/kwordquiz/src/dlgrc.cpp index 07694b63..9fa996e3 100644 --- a/kwordquiz/src/dlgrc.cpp +++ b/kwordquiz/src/dlgrc.cpp @@ -19,7 +19,7 @@ #include "dlgrc.h" -DlgRC::DlgRC(QWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Rows & Columns"), Ok|Cancel, Ok, parent, name, modal, true) +DlgRC::DlgRC(TQWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Rows & Columns"), Ok|Cancel, Ok, parent, name, modal, true) { dlgBase = new DlgRCBase( this, "Dlg" ); setMainWidget(dlgBase); @@ -33,17 +33,17 @@ DlgRC::~DlgRC() void DlgRC::setNumRows( int r ) { - dlgBase->txtNumRows->setText(QString::number(r, 10)); + dlgBase->txtNumRows->setText(TQString::number(r, 10)); } void DlgRC::setRowHeight( int h ) { - dlgBase->txtRowHeight->setText(QString::number(h, 10)); + dlgBase->txtRowHeight->setText(TQString::number(h, 10)); } void DlgRC::setColWidth( int w ) { - dlgBase->txtColWidth->setText(QString::number(w, 10)); + dlgBase->txtColWidth->setText(TQString::number(w, 10)); } int DlgRC::numRows( ) diff --git a/kwordquiz/src/dlgrc.h b/kwordquiz/src/dlgrc.h index 3bf3c077..b54fa64c 100644 --- a/kwordquiz/src/dlgrc.h +++ b/kwordquiz/src/dlgrc.h @@ -28,7 +28,7 @@ class DlgRC : public KDialogBase { Q_OBJECT public: - DlgRC(QWidget *parent = 0, const char *name = 0, bool modal=true); + DlgRC(TQWidget *parent = 0, const char *name = 0, bool modal=true); ~DlgRC(); void setNumRows(int r); diff --git a/kwordquiz/src/dlgsort.cpp b/kwordquiz/src/dlgsort.cpp index cb96c945..20221468 100644 --- a/kwordquiz/src/dlgsort.cpp +++ b/kwordquiz/src/dlgsort.cpp @@ -16,12 +16,12 @@ #include -#include +#include #include "dlgsort.h" -DlgSort::DlgSort(QWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Sort"), Ok|Cancel, Ok, parent, name, modal, true) +DlgSort::DlgSort(TQWidget *parent, const char *name, bool modal): KDialogBase(Swallow, i18n("Sort"), Ok|Cancel, Ok, parent, name, modal, true) { dlgBase = new DlgSortBase( this, "Dlg" ); setMainWidget(dlgBase); @@ -45,7 +45,7 @@ bool DlgSort::ascending( ) return dlgBase->optAscending->isChecked(); } -void DlgSort::setLanguage( int index, const QString & lang ) +void DlgSort::setLanguage( int index, const TQString & lang ) { if (index == 1) { dlgBase->optLang1 -> setText("&1 " + lang); diff --git a/kwordquiz/src/dlgsort.h b/kwordquiz/src/dlgsort.h index 8642eb62..181cf75b 100644 --- a/kwordquiz/src/dlgsort.h +++ b/kwordquiz/src/dlgsort.h @@ -29,12 +29,12 @@ class DlgSort : public KDialogBase Q_OBJECT public: - DlgSort(QWidget *parent = 0, const char *name = 0, bool modal=true); + DlgSort(TQWidget *parent = 0, const char *name = 0, bool modal=true); ~DlgSort(); bool base(); bool ascending(); - void setLanguage(int index, const QString &lang); + void setLanguage(int index, const TQString &lang); private: DlgSortBase *dlgBase; diff --git a/kwordquiz/src/dlgspecchar.cpp b/kwordquiz/src/dlgspecchar.cpp index e35fe236..79dd2da0 100644 --- a/kwordquiz/src/dlgspecchar.cpp +++ b/kwordquiz/src/dlgspecchar.cpp @@ -16,13 +16,13 @@ #include "dlgspecchar.h" -#include +#include #include #include #include -DlgSpecChar::DlgSpecChar( QWidget *parent, const char *name, const QString &_font, const QChar &_chr, bool _modal ) +DlgSpecChar::DlgSpecChar( TQWidget *parent, const char *name, const TQString &_font, const TQChar &_chr, bool _modal ) : KDialogBase( Plain, i18n("Select Character"), User1 | Cancel, User1 , parent, name, _modal ) { initDialog(_chr,_font,true); @@ -32,16 +32,16 @@ DlgSpecChar::DlgSpecChar( QWidget *parent, const char *name, const QString &_fon } -void DlgSpecChar::initDialog(const QChar &_chr, const QString &_font, bool /*_enableFont*/) +void DlgSpecChar::initDialog(const TQChar &_chr, const TQString &_font, bool /*_enableFont*/) { - QWidget *page = plainPage(); + TQWidget *page = plainPage(); - grid = new QGridLayout( page, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); + grid = new TQGridLayout( page, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); int t = (_chr.unicode()/256); charSelect = new KCharSelect( page, "", _font, _chr, t); - connect(charSelect, SIGNAL(doubleClicked()),this, SLOT(slotDoubleClicked())); + connect(charSelect, TQT_SIGNAL(doubleClicked()),this, TQT_SLOT(slotDoubleClicked())); charSelect->resize( charSelect->sizeHint() ); charSelect->enableFontCombo( false ); grid->addWidget( charSelect, 0, 0 ); @@ -61,7 +61,7 @@ void DlgSpecChar::closeDialog() KDialogBase::close(); } -QChar DlgSpecChar::chr() +TQChar DlgSpecChar::chr() { return charSelect->chr(); } diff --git a/kwordquiz/src/dlgspecchar.h b/kwordquiz/src/dlgspecchar.h index f2a18c8d..daf91d97 100644 --- a/kwordquiz/src/dlgspecchar.h +++ b/kwordquiz/src/dlgspecchar.h @@ -33,17 +33,17 @@ class DlgSpecChar : public KDialogBase Q_OBJECT public: //constructor when you want to insert multi char - DlgSpecChar( QWidget *parent, const char *name, const QString &_font, - const QChar &_chr, bool _modal=true ); + DlgSpecChar( TQWidget *parent, const char *name, const TQString &_font, + const TQChar &_chr, bool _modal=true ); ~DlgSpecChar(); // internal - QChar chr(); + TQChar chr(); void closeDialog(); private: - void initDialog(const QChar &_chr, const QString &_font, bool _enableFont); + void initDialog(const TQChar &_chr, const TQString &_font, bool _enableFont); private slots: void slotUser1(); @@ -51,13 +51,13 @@ private slots: protected: // dialog objects - QGridLayout *grid; + TQGridLayout *grid; KButtonBox *bbox; - QPushButton *bOk, *bCancel; + TQPushButton *bOk, *bCancel; KCharSelect *charSelect; signals: - void insertChar(QChar); + void insertChar(TQChar); }; #endif diff --git a/kwordquiz/src/flashview.cpp b/kwordquiz/src/flashview.cpp index df6a39ae..eafa5294 100644 --- a/kwordquiz/src/flashview.cpp +++ b/kwordquiz/src/flashview.cpp @@ -14,7 +14,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -25,12 +25,12 @@ #include "prefs.h" -FlashView::FlashView(QWidget *parent, const char *name, WFlags f) +FlashView::FlashView(TQWidget *parent, const char *name, WFlags f) : FlashViewBase(parent, name, f) { m_score = new WQScore(); - m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimer())); + m_timer = new TQTimer(this); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimer())); } @@ -126,7 +126,7 @@ void FlashView::slotFlip() fraCard->setPaletteForegroundColor(Prefs::frontFrameColor()); linFlash->setPaletteForegroundColor(Prefs::frontFrameColor()); linFlash->setPaletteBackgroundColor(Prefs::frontCardColor()); - //linFlash->setPaletteForegroundColor(QColor(255, 0, 0)); + //linFlash->setPaletteForegroundColor(TQColor(255, 0, 0)); showFront(m_question); m_showFirst = false; } @@ -140,7 +140,7 @@ void FlashView::slotFlip() fraCard->setPaletteForegroundColor(Prefs::backFrameColor()); linFlash->setPaletteForegroundColor(Prefs::backFrameColor()); linFlash->setPaletteBackgroundColor(Prefs::backCardColor()); - //linFlash->setPaletteForegroundColor(QColor(0, 0, 255)); + //linFlash->setPaletteForegroundColor(TQColor(0, 0, 255)); showBack(m_question); m_showFirst = true; } @@ -178,7 +178,7 @@ void FlashView::slotRepeat() */ void FlashView::updateScore() { - QString s; + TQString s; s = s.setNum(m_quiz->questionCount(), 10); lblScoreCount->setText(s); picCount->setPixmap(KGlobal::iconLoader()->loadIcon("kwordquiz", KIcon::Panel)); diff --git a/kwordquiz/src/flashview.h b/kwordquiz/src/flashview.h index 9fa26db9..c6135df5 100644 --- a/kwordquiz/src/flashview.h +++ b/kwordquiz/src/flashview.h @@ -32,7 +32,7 @@ class FlashView : public FlashViewBase { Q_OBJECT public: - FlashView(QWidget *parent = 0, const char *name = 0, WFlags f = 0); + FlashView(TQWidget *parent = 0, const char *name = 0, WFlags f = 0); ~FlashView(); @@ -60,7 +60,7 @@ private: KAction* actRepeat; KAction* actRestart; - QTimer* m_timer; + TQTimer* m_timer; int m_question; int m_error; diff --git a/kwordquiz/src/keduvocdata.cpp b/kwordquiz/src/keduvocdata.cpp index 4d46d7d9..48b20f8e 100644 --- a/kwordquiz/src/keduvocdata.cpp +++ b/kwordquiz/src/keduvocdata.cpp @@ -18,7 +18,7 @@ #include "keduvocdata.h" -#include +#include #include @@ -33,7 +33,7 @@ KEduVocDataItem::KEduVocDataItem() } -KEduVocDataItem::KEduVocDataItem(QDomElement &entry) +KEduVocDataItem::KEduVocDataItem(TQDomElement &entry) { domElement = entry; } @@ -43,39 +43,39 @@ KEduVocDataItem::~KEduVocDataItem() } -QString KEduVocDataItem::originalText() const +TQString KEduVocDataItem::originalText() const { return getText("o"); } -QString KEduVocDataItem::translatedText() const +TQString KEduVocDataItem::translatedText() const { return getText("t"); } // protected methods -QString KEduVocDataItem::getText(const QString &tagName) const +TQString KEduVocDataItem::getText(const TQString &tagName) const { if(!domElement.isNull()) { - QDomNodeList list = domElement.elementsByTagName(tagName); + TQDomNodeList list = domElement.elementsByTagName(tagName); if(list.count() > 0) { - QDomElement element = list.item(0).toElement(); + TQDomElement element = list.item(0).toElement(); if(!element.isNull()) { return element.text(); } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } //////////////////////////////////////////////////////////////////////////////// @@ -88,24 +88,24 @@ QString KEduVocDataItem::getText(const QString &tagName) const */ KEduVocData::KEduVocData() { - document = new QDomDocument(); + document = new TQDomDocument(); } -KEduVocDataItemList KEduVocData::parse(const QString &fileName) +KEduVocDataItemList KEduVocData::parse(const TQString &fileName) { KEduVocDataItemList list; - //QDomDocument document; - QFile file(fileName); + //TQDomDocument document; + TQFile file(fileName); document->setContent(&file); - QDomNodeList entries = document->elementsByTagName("e"); + TQDomNodeList entries = document->elementsByTagName("e"); // loop through the "e" (entry) tags looking for data for(uint i = 0 ; i < entries.count() ; i++) { // get an entry to operate on - QDomElement entry = entries.item(i).toElement(); + TQDomElement entry = entries.item(i).toElement(); // if the "node" is in fact an element -- i.e. not null if(!entry.isNull()) { @@ -148,7 +148,7 @@ int KEduVocData::numRows() /*! \fn KEduVocData::language(int col) */ -QString KEduVocData::language(int col) +TQString KEduVocData::language(int col) { if (!document->isNull()) if (col == 0) @@ -156,7 +156,7 @@ QString KEduVocData::language(int col) else return document -> documentElement().namedItem("e").namedItem("t").toElement().attribute("l"); else - return QString::null; + return TQString::null; } diff --git a/kwordquiz/src/keduvocdata.h b/kwordquiz/src/keduvocdata.h index 968f3243..f9f28257 100644 --- a/kwordquiz/src/keduvocdata.h +++ b/kwordquiz/src/keduvocdata.h @@ -19,40 +19,40 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include class KEduVocDataItem { public: KEduVocDataItem(); - KEduVocDataItem(QDomElement &entry); + KEduVocDataItem(TQDomElement &entry); virtual ~KEduVocDataItem(); - QString originalText() const; - QString translatedText() const; + TQString originalText() const; + TQString translatedText() const; protected: - QString getText(const QString &tagName) const; + TQString getText(const TQString &tagName) const; private: - QDomElement domElement; + TQDomElement domElement; }; -typedef QValueList KEduVocDataItemList; +typedef TQValueList KEduVocDataItemList; class KEduVocData { public: KEduVocData(); - KEduVocDataItemList parse(const QString &fileName); + KEduVocDataItemList parse(const TQString &fileName); int colWidth(int col); int numRows(); - QString language(int col); + TQString language(int col); private: - QDomDocument* document; + TQDomDocument* document; }; #endif diff --git a/kwordquiz/src/kvtmlwriter.cpp b/kwordquiz/src/kvtmlwriter.cpp index 8ad93797..787cabab 100644 --- a/kwordquiz/src/kvtmlwriter.cpp +++ b/kwordquiz/src/kvtmlwriter.cpp @@ -16,13 +16,13 @@ #include "kvtmlwriter.h" -KVTMLWriter::KVTMLWriter(QFile *file) +KVTMLWriter::KVTMLWriter(TQFile *file) { outputFile = file; if(outputFile->open(IO_WriteOnly)) { outputStream.setDevice(outputFile); - outputStream.setEncoding(QTextStream::UnicodeUTF8); + outputStream.setEncoding(TQTextStream::UnicodeUTF8); outputStream << "" << endl; outputStream << "" << endl; @@ -30,11 +30,11 @@ KVTMLWriter::KVTMLWriter(QFile *file) } /*! - \fn KVTMLWriter::addHeader(const QString &generator, int cols, int rows, const QString &title) + \fn KVTMLWriter::addHeader(const TQString &generator, int cols, int rows, const TQString &title) */ -void KVTMLWriter::addHeader(const QString &generator, int cols, int rows, const QString &title) +void KVTMLWriter::addHeader(const TQString &generator, int cols, int rows, const TQString &title) { - QString s = QString("") + TQString s = TQString("") .arg(generator) .arg(cols) .arg(rows) @@ -44,16 +44,16 @@ void KVTMLWriter::addHeader(const QString &generator, int cols, int rows, const } /*! - \fn KVTMLWriter::addFirstItem(const QString &ll, int lwidth, const QString &left, const QString &rl, int rwidth, const QString &right) + \fn KVTMLWriter::addFirstItem(const TQString &ll, int lwidth, const TQString &left, const TQString &rl, int rwidth, const TQString &right) */ -void KVTMLWriter::addFirstItem(const QString &ll, int lwidth, const QString &left, const QString &rl, int rwidth, const QString &right) +void KVTMLWriter::addFirstItem(const TQString &ll, int lwidth, const TQString &left, const TQString &rl, int rwidth, const TQString &right) { outputStream << " " << endl; - QString s = QString(" ") + TQString s = TQString(" ") .arg(lwidth) .arg(ll); outputStream << s << escape(left) << "" << endl; - s = QString(" ") + s = TQString(" ") .arg(rwidth) .arg(rl); outputStream << s << escape(right) << "" << endl; @@ -61,9 +61,9 @@ void KVTMLWriter::addFirstItem(const QString &ll, int lwidth, const QString &lef } /*! - \fn KVTMLWriter::addItem(const QString &left, const QString &right) + \fn KVTMLWriter::addItem(const TQString &left, const TQString &right) */ -void KVTMLWriter::addItem(const QString &left, const QString &right) +void KVTMLWriter::addItem(const TQString &left, const TQString &right) { outputStream << " " << endl; outputStream << " " << escape(left) << "" << endl; @@ -78,12 +78,12 @@ KVTMLWriter::~KVTMLWriter() outputFile->close(); } -QString KVTMLWriter::escape( const QString & s) +TQString KVTMLWriter::escape( const TQString & s) { - QString result = s; - result.replace(QChar('&'), "&"); //must be done first - result.replace(QChar('<'), "<"); - result.replace(QChar('>'), ">"); + TQString result = s; + result.replace(TQChar('&'), "&"); //must be done first + result.replace(TQChar('<'), "<"); + result.replace(TQChar('>'), ">"); return result; } diff --git a/kwordquiz/src/kvtmlwriter.h b/kwordquiz/src/kvtmlwriter.h index 7ff9fa37..ccf18071 100644 --- a/kwordquiz/src/kvtmlwriter.h +++ b/kwordquiz/src/kvtmlwriter.h @@ -17,24 +17,24 @@ #ifndef KVTMLWRITER_H #define KVTMLWRITER_H -#include -#include +#include +#include /** @author Peter Hedlund */ class KVTMLWriter{ public: - KVTMLWriter(QFile *file); + KVTMLWriter(TQFile *file); ~KVTMLWriter(); - void addFirstItem(const QString &ll, int lwidth, const QString &left, const QString &rl, int rwidth, const QString &right); - void addHeader(const QString &generator, int cols, int rows, const QString &title); - void addItem(const QString &left, const QString &right); + void addFirstItem(const TQString &ll, int lwidth, const TQString &left, const TQString &rl, int rwidth, const TQString &right); + void addHeader(const TQString &generator, int cols, int rows, const TQString &title); + void addItem(const TQString &left, const TQString &right); private: - QString escape(const QString &); - QFile *outputFile; - QTextStream outputStream; + TQString escape(const TQString &); + TQFile *outputFile; + TQTextStream outputStream; }; #endif diff --git a/kwordquiz/src/kwordquiz.cpp b/kwordquiz/src/kwordquiz.cpp index 1c384d9c..9dde6a0c 100644 --- a/kwordquiz/src/kwordquiz.cpp +++ b/kwordquiz/src/kwordquiz.cpp @@ -16,9 +16,9 @@ ***************************************************************************/ // // include files for QT -#include -#include -#include +#include +#include +#include // include files for KDE #include @@ -54,7 +54,7 @@ #define ID_MENU_QUIZ 1001 -KWordQuizApp::KWordQuizApp(QWidget* , const char* name):KMainWindow(0, name) +KWordQuizApp::KWordQuizApp(TQWidget* , const char* name):KMainWindow(0, name) { /////////////////////////////////////////////////////////////////// @@ -105,117 +105,117 @@ void KWordQuizApp::initActions() KAction* configNotifications; KAction* configApp; - fileNew = KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); + fileNew = KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection()); fileNew->setWhatsThis(i18n("Creates a new blank vocabulary document")); fileNew->setToolTip(fileNew->whatsThis()); - fileOpen = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); + fileOpen = KStdAction::open(this, TQT_SLOT(slotFileOpen()), actionCollection()); fileOpen->setWhatsThis(i18n("Opens an existing vocabulary document")); fileOpen->setToolTip(fileOpen->whatsThis()); - fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); + fileOpenRecent = KStdAction::openRecent(this, TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); - fileGHNS = new KAction(i18n("&Get New Vocabularies..."), "knewstuff", "CTRL+G", this, SLOT(slotFileGHNS()), actionCollection(), "file_ghns"); + fileGHNS = new KAction(i18n("&Get New Vocabularies..."), "knewstuff", "CTRL+G", this, TQT_SLOT(slotFileGHNS()), actionCollection(), "file_ghns"); fileGHNS->setWhatsThis(i18n("Downloads new vocabularies")); fileGHNS->setToolTip(fileGHNS->whatsThis()); - fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); + fileSave = KStdAction::save(this, TQT_SLOT(slotFileSave()), actionCollection()); fileSave->setWhatsThis(i18n("Saves the active vocabulary document")); fileSave->setToolTip(fileSave->whatsThis()); - fileSaveAs = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); + fileSaveAs = KStdAction::saveAs(this, TQT_SLOT(slotFileSaveAs()), actionCollection()); fileSaveAs->setWhatsThis(i18n("Saves the active vocabulary document with a different name")); fileSaveAs->setToolTip(fileSaveAs->whatsThis()); - fileClose = KStdAction::close(this, SLOT(slotFileClose()), actionCollection()); + fileClose = KStdAction::close(this, TQT_SLOT(slotFileClose()), actionCollection()); fileClose->setWhatsThis(i18n("Closes the active vocabulary document")); fileClose->setToolTip(fileClose->whatsThis()); - filePrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection()); + filePrint = KStdAction::print(this, TQT_SLOT(slotFilePrint()), actionCollection()); filePrint->setWhatsThis(i18n("Prints the active vocabulary document")); filePrint->setToolTip(filePrint->whatsThis()); - fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); + fileQuit = KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection()); fileQuit->setWhatsThis(i18n("Quits KWordQuiz")); fileQuit->setToolTip(fileQuit->whatsThis()); - editUndo = KStdAction::undo(this, SLOT(slotEditUndo()), actionCollection()); + editUndo = KStdAction::undo(this, TQT_SLOT(slotEditUndo()), actionCollection()); editUndo->setWhatsThis(i18n("Undoes the last command")); editUndo->setToolTip(editUndo->whatsThis()); - editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection()); + editCut = KStdAction::cut(this, TQT_SLOT(slotEditCut()), actionCollection()); editCut->setWhatsThis(i18n("Cuts the text from the selected cells and places it on the clipboard")); editCut->setToolTip(editCut->whatsThis()); - editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection()); + editCopy = KStdAction::copy(this, TQT_SLOT(slotEditCopy()), actionCollection()); editCopy->setWhatsThis(i18n("Copies the text from the selected cells and places it on the clipboard")); editCopy->setToolTip(editCopy->whatsThis()); - editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection()); + editPaste = KStdAction::paste(this, TQT_SLOT(slotEditPaste()), actionCollection()); editPaste->setWhatsThis(i18n("Pastes previously cut or copied text from the clipboard into the selected cells")); editPaste->setToolTip(editPaste->whatsThis()); - editClear = KStdAction::clear(this, SLOT(slotEditClear()), actionCollection()); + editClear = KStdAction::clear(this, TQT_SLOT(slotEditClear()), actionCollection()); editClear->setWhatsThis(i18n("Clears the content of the selected cells")); editClear->setToolTip(editClear->whatsThis()); - editInsert = new KAction(i18n("&Insert Row"), "insert_table_row", "CTRL+I", this, SLOT(slotEditInsert()), actionCollection(),"edit_insert"); + editInsert = new KAction(i18n("&Insert Row"), "insert_table_row", "CTRL+I", this, TQT_SLOT(slotEditInsert()), actionCollection(),"edit_insert"); editInsert->setWhatsThis(i18n("Inserts a new row above the current row")); editInsert->setToolTip(editInsert->whatsThis()); - editDelete = new KAction(i18n("&Delete Row"), "delete_table_row", "CTRL+K", this, SLOT(slotEditDelete()), actionCollection(),"edit_delete"); + editDelete = new KAction(i18n("&Delete Row"), "delete_table_row", "CTRL+K", this, TQT_SLOT(slotEditDelete()), actionCollection(),"edit_delete"); editDelete->setWhatsThis(i18n("Deletes the selected row(s)")); editDelete->setToolTip(editDelete->whatsThis()); - editMarkBlank = new KAction(i18n("&Mark as Blank"), "markasblank", "CTRL+M", this, SLOT(slotEditMarkBlank()), actionCollection(),"edit_mark_blank"); + editMarkBlank = new KAction(i18n("&Mark as Blank"), "markasblank", "CTRL+M", this, TQT_SLOT(slotEditMarkBlank()), actionCollection(),"edit_mark_blank"); editMarkBlank->setWhatsThis(i18n("Marks the current or selected word as a blank for Fill-in-the-blank")); editMarkBlank->setToolTip(editMarkBlank->whatsThis()); - editUnmarkBlank = new KAction(i18n("&Unmark Blanks"), "unmarkasblank", 0, this, SLOT(slotEditUnmarkBlank()), actionCollection(),"edit_unmark_blank"); + editUnmarkBlank = new KAction(i18n("&Unmark Blanks"), "unmarkasblank", 0, this, TQT_SLOT(slotEditUnmarkBlank()), actionCollection(),"edit_unmark_blank"); editUnmarkBlank->setWhatsThis(i18n("Removes blanks from the current or selected word")); editUnmarkBlank->setToolTip(editUnmarkBlank->whatsThis()); - //@todo implement editFind = KStdAction::find(this, SLOT(slotEditFind()), actionCollection()); + //@todo implement editFind = KStdAction::find(this, TQT_SLOT(slotEditFind()), actionCollection()); - vocabLanguages = new KAction(i18n("&Column Titles..."), "languages", "CTRL+L", this, SLOT(slotVocabLanguages()), actionCollection(),"vocab_languages"); + vocabLanguages = new KAction(i18n("&Column Titles..."), "languages", "CTRL+L", this, TQT_SLOT(slotVocabLanguages()), actionCollection(),"vocab_languages"); vocabLanguages->setWhatsThis(i18n("Defines the column titles for the active vocabulary")); vocabLanguages->setToolTip(vocabLanguages->whatsThis()); - vocabFont = new KAction(i18n("&Font..."), "fonts", 0, this, SLOT(slotVocabFont()), actionCollection(),"vocab_font"); + vocabFont = new KAction(i18n("&Font..."), "fonts", 0, this, TQT_SLOT(slotVocabFont()), actionCollection(),"vocab_font"); vocabFont->setWhatsThis(i18n("Defines the font used by the editor")); vocabFont->setToolTip(vocabFont->whatsThis()); - //@todo implement vocabKeyboard = new KAction(i18n("&Keyboard..."), "kxkb", 0, this, SLOT(slotVocabKeyboard()), actionCollection(),"vocab_keyboard"); + //@todo implement vocabKeyboard = new KAction(i18n("&Keyboard..."), "kxkb", 0, this, TQT_SLOT(slotVocabKeyboard()), actionCollection(),"vocab_keyboard"); - vocabRC = new KAction(i18n("&Rows/Columns..."), "rowcol", 0, this, SLOT(slotVocabRC()), actionCollection(),"vocab_rc"); + vocabRC = new KAction(i18n("&Rows/Columns..."), "rowcol", 0, this, TQT_SLOT(slotVocabRC()), actionCollection(),"vocab_rc"); vocabRC->setWhatsThis(i18n("Defines the number of rows, row heights, and column widths for the active vocabulary")); vocabRC->setToolTip(vocabRC->whatsThis()); - vocabSort = new KAction(i18n("&Sort..."), "sort_incr", 0, this, SLOT(slotVocabSort()), actionCollection(),"vocab_sort"); + vocabSort = new KAction(i18n("&Sort..."), "sort_incr", 0, this, TQT_SLOT(slotVocabSort()), actionCollection(),"vocab_sort"); vocabSort->setWhatsThis(i18n("Sorts the vocabulary in ascending or descending order based on the left or right column")); vocabSort->setToolTip(vocabSort->whatsThis()); - vocabShuffle = new KAction(i18n("Sh&uffle"), "shuffle", 0, this, SLOT(slotVocabShuffle()), actionCollection(),"vocab_shuffle"); + vocabShuffle = new KAction(i18n("Sh&uffle"), "shuffle", 0, this, TQT_SLOT(slotVocabShuffle()), actionCollection(),"vocab_shuffle"); vocabShuffle->setWhatsThis(i18n("Shuffles the entries of the active vocabulary")); vocabShuffle->setToolTip(vocabShuffle->whatsThis()); - mode = new KToolBarPopupAction(i18n("Change Mode"), "mode1", 0, this, SLOT(slotMode0()), actionCollection(),"mode_0"); + mode = new KToolBarPopupAction(i18n("Change Mode"), "mode1", 0, this, TQT_SLOT(slotMode0()), actionCollection(),"mode_0"); mode->setWhatsThis(i18n("Changes the mode used in quiz sessions")); mode->setToolTip(mode->whatsThis()); KPopupMenu *popup = mode->popupMenu(); popup->clear(); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode1", KIcon::Toolbar), "", this, SLOT(slotMode1()), 0, 0); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode2", KIcon::Toolbar), "", this, SLOT(slotMode2()), 0, 1); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode3", KIcon::Toolbar), "", this, SLOT(slotMode3()), 0, 2); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode4", KIcon::Toolbar), "", this, SLOT(slotMode4()), 0, 3); - popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode5", KIcon::Toolbar), "", this, SLOT(slotMode5()), 0, 4); - - mode1 = new KToggleAction("", "mode1", 0, this, SLOT(slotMode1()), actionCollection(),"mode_1"); - mode2 = new KToggleAction("", "mode2", 0, this, SLOT(slotMode2()), actionCollection(),"mode_2"); - mode3 = new KToggleAction("", "mode3", 0, this, SLOT(slotMode3()), actionCollection(),"mode_3"); - mode4 = new KToggleAction("", "mode4", 0, this, SLOT(slotMode4()), actionCollection(),"mode_4"); - mode5 = new KToggleAction("", "mode5", 0, this, SLOT(slotMode5()), actionCollection(),"mode_5"); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode1", KIcon::Toolbar), "", this, TQT_SLOT(slotMode1()), 0, 0); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode2", KIcon::Toolbar), "", this, TQT_SLOT(slotMode2()), 0, 1); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode3", KIcon::Toolbar), "", this, TQT_SLOT(slotMode3()), 0, 2); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode4", KIcon::Toolbar), "", this, TQT_SLOT(slotMode4()), 0, 3); + popup->insertItem(KGlobal::iconLoader()->loadIconSet("mode5", KIcon::Toolbar), "", this, TQT_SLOT(slotMode5()), 0, 4); + + mode1 = new KToggleAction("", "mode1", 0, this, TQT_SLOT(slotMode1()), actionCollection(),"mode_1"); + mode2 = new KToggleAction("", "mode2", 0, this, TQT_SLOT(slotMode2()), actionCollection(),"mode_2"); + mode3 = new KToggleAction("", "mode3", 0, this, TQT_SLOT(slotMode3()), actionCollection(),"mode_3"); + mode4 = new KToggleAction("", "mode4", 0, this, TQT_SLOT(slotMode4()), actionCollection(),"mode_4"); + mode5 = new KToggleAction("", "mode5", 0, this, TQT_SLOT(slotMode5()), actionCollection(),"mode_5"); mode1->setWhatsThis(i18n("Selects this mode")); mode2->setWhatsThis(i18n("Selects this mode")); mode3->setWhatsThis(i18n("Selects this mode")); @@ -227,19 +227,19 @@ void KWordQuizApp::initActions() mode4->setToolTip(mode4->whatsThis()); mode5->setToolTip(mode5->whatsThis()); - quizEditor = new KAction(i18n("&Editor"), "editor", "F6", this, SLOT(slotQuizEditor()), actionCollection(),"quiz_editor"); + quizEditor = new KAction(i18n("&Editor"), "editor", "F6", this, TQT_SLOT(slotQuizEditor()), actionCollection(),"quiz_editor"); quizEditor->setWhatsThis(i18n("Activates the vocabulary editor")); quizEditor->setToolTip(quizEditor->whatsThis()); - quizFlash = new KAction(i18n("&Flashcard"), "flash", "F7", this, SLOT(slotQuizFlash()), actionCollection(),"quiz_flash"); + quizFlash = new KAction(i18n("&Flashcard"), "flash", "F7", this, TQT_SLOT(slotQuizFlash()), actionCollection(),"quiz_flash"); quizFlash->setWhatsThis(i18n("Starts a flashcard session using the active vocabulary")); quizFlash->setToolTip(quizFlash->whatsThis()); - quizMultiple = new KAction(i18n("&Multiple Choice"), "multiple", "F8", this, SLOT(slotQuizMultiple()), actionCollection(),"quiz_multiple"); + quizMultiple = new KAction(i18n("&Multiple Choice"), "multiple", "F8", this, TQT_SLOT(slotQuizMultiple()), actionCollection(),"quiz_multiple"); quizMultiple->setWhatsThis(i18n("Starts a multiple choice session using the active vocabulary")); quizMultiple->setToolTip(quizMultiple->whatsThis()); - quizQA = new KAction(i18n("&Question && Answer"), "qa", "F9", this, SLOT(slotQuizQA()), actionCollection(),"quiz_qa"); + quizQA = new KAction(i18n("&Question && Answer"), "qa", "F9", this, TQT_SLOT(slotQuizQA()), actionCollection(),"quiz_qa"); quizQA->setWhatsThis(i18n("Starts a question and answer session using the active vocabulary")); quizQA->setToolTip(quizQA->whatsThis()); @@ -267,26 +267,26 @@ void KWordQuizApp::initActions() quizRepeatErrors->setWhatsThis(i18n("Repeats all incorrectly answered questions")); quizRepeatErrors->setToolTip(quizRepeatErrors->whatsThis()); - configNotifications = KStdAction::configureNotifications(this, SLOT(slotConfigureNotifications()), actionCollection()); + configNotifications = KStdAction::configureNotifications(this, TQT_SLOT(slotConfigureNotifications()), actionCollection()); configNotifications->setWhatsThis(i18n("Configures sound and other notifications for certain events")); configNotifications->setToolTip(configNotifications->whatsThis()); - configApp = KStdAction::preferences(this, SLOT( slotConfigure()), actionCollection()); + configApp = KStdAction::preferences(this, TQT_SLOT( slotConfigure()), actionCollection()); configApp->setWhatsThis(i18n("Specifies preferences for the vocabulary editor and quiz sessions")); configApp->setToolTip(configApp->whatsThis()); - charMapper = new QSignalMapper(this); - connect(charMapper, SIGNAL(mapped(int)), this, SLOT(slotInsertChar(int))); + charMapper = new TQSignalMapper(this); + connect(charMapper, TQT_SIGNAL(mapped(int)), this, TQT_SLOT(slotInsertChar(int))); - specialChar1 = new KAction(i18n("Special Character 1"), "", "CTRL+1", charMapper, SLOT(map()), actionCollection(), "char_1") ; - specialChar2 = new KAction(i18n("Special Character 2"), 0, "CTRL+2", charMapper, SLOT(map()), actionCollection(), "char_2") ; - specialChar3 = new KAction(i18n("Special Character 3"), 0, "CTRL+3", charMapper, SLOT(map()), actionCollection(), "char_3") ; - specialChar4 = new KAction(i18n("Special Character 4"), 0, "CTRL+4", charMapper, SLOT(map()), actionCollection(), "char_4") ; - specialChar5 = new KAction(i18n("Special Character 5"), 0, "CTRL+5", charMapper, SLOT(map()), actionCollection(), "char_5") ; - specialChar6 = new KAction(i18n("Special Character 6"), 0, "CTRL+6", charMapper, SLOT(map()), actionCollection(), "char_6") ; - specialChar7 = new KAction(i18n("Special Character 7"), 0, "CTRL+7", charMapper, SLOT(map()), actionCollection(), "char_7") ; - specialChar8 = new KAction(i18n("Special Character 8"), 0, "CTRL+8", charMapper, SLOT(map()), actionCollection(), "char_8") ; - specialChar9 = new KAction(i18n("Special Character 9"), 0, "CTRL+9", charMapper, SLOT(map()), actionCollection(), "char_9") ; + specialChar1 = new KAction(i18n("Special Character 1"), "", "CTRL+1", charMapper, TQT_SLOT(map()), actionCollection(), "char_1") ; + specialChar2 = new KAction(i18n("Special Character 2"), 0, "CTRL+2", charMapper, TQT_SLOT(map()), actionCollection(), "char_2") ; + specialChar3 = new KAction(i18n("Special Character 3"), 0, "CTRL+3", charMapper, TQT_SLOT(map()), actionCollection(), "char_3") ; + specialChar4 = new KAction(i18n("Special Character 4"), 0, "CTRL+4", charMapper, TQT_SLOT(map()), actionCollection(), "char_4") ; + specialChar5 = new KAction(i18n("Special Character 5"), 0, "CTRL+5", charMapper, TQT_SLOT(map()), actionCollection(), "char_5") ; + specialChar6 = new KAction(i18n("Special Character 6"), 0, "CTRL+6", charMapper, TQT_SLOT(map()), actionCollection(), "char_6") ; + specialChar7 = new KAction(i18n("Special Character 7"), 0, "CTRL+7", charMapper, TQT_SLOT(map()), actionCollection(), "char_7") ; + specialChar8 = new KAction(i18n("Special Character 8"), 0, "CTRL+8", charMapper, TQT_SLOT(map()), actionCollection(), "char_8") ; + specialChar9 = new KAction(i18n("Special Character 9"), 0, "CTRL+9", charMapper, TQT_SLOT(map()), actionCollection(), "char_9") ; charMapper->setMapping(specialChar1, 1); charMapper->setMapping(specialChar2, 2); @@ -299,12 +299,12 @@ void KWordQuizApp::initActions() charMapper->setMapping(specialChar9, 9); actionCollection()->setHighlightingEnabled(true); - connect(actionCollection(), SIGNAL(actionStatusText(const QString &)), this, SLOT(slotStatusMsg(const QString &))); - connect(actionCollection(), SIGNAL(actionHighlighted(KAction *, bool)), this, SLOT(slotActionHighlighted(KAction *, bool))); + connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &))); + connect(actionCollection(), TQT_SIGNAL(actionHighlighted(KAction *, bool)), this, TQT_SLOT(slotActionHighlighted(KAction *, bool))); updateSpecialCharIcons(); if (!initialGeometrySet()) - resize( QSize(650, 500).expandedTo(minimumSizeHint())); + resize( TQSize(650, 500).expandedTo(minimumSizeHint())); setupGUI(ToolBar | Keys | StatusBar | Create); setAutoSaveSettings(); @@ -333,8 +333,8 @@ void KWordQuizApp::initView() setCentralWidget(m_editView); setCaption(doc->URL().fileName(),false); m_editView->setFont(Prefs::editorFont()); - connect(m_editView, SIGNAL(undoChange(const QString&, bool )), this, SLOT(slotUndoChange(const QString&, bool))); - connect(m_editView, SIGNAL(contextMenuRequested(int, int, const QPoint &)), this, SLOT(slotContextMenuRequested(int, int, const QPoint& ))); + connect(m_editView, TQT_SIGNAL(undoChange(const TQString&, bool )), this, TQT_SLOT(slotUndoChange(const TQString&, bool))); + connect(m_editView, TQT_SIGNAL(contextMenuRequested(int, int, const TQPoint &)), this, TQT_SLOT(slotContextMenuRequested(int, int, const TQPoint& ))); } void KWordQuizApp::openURL(const KURL& url) @@ -419,8 +419,8 @@ void KWordQuizApp::saveProperties(KConfig *_cfg) KURL url=doc->URL(); _cfg->writeEntry("filename", url.url()); _cfg->writeEntry("modified", doc->isModified()); - QString tempname = kapp->tempSaveName(url.url()); - QString tempurl= KURL::encode_string(tempname); + TQString tempname = kapp->tempSaveName(url.url()); + TQString tempurl= KURL::encode_string(tempname); KURL _url(tempurl); doc->saveDocument(_url); } @@ -429,13 +429,13 @@ void KWordQuizApp::saveProperties(KConfig *_cfg) void KWordQuizApp::readProperties(KConfig* _cfg) { - QString filename = _cfg->readEntry("filename", ""); + TQString filename = _cfg->readEntry("filename", ""); KURL url(filename); bool modified = _cfg->readBoolEntry("modified", false); if(modified) { bool canRecover; - QString tempname = kapp->checkRecoverFile(filename, canRecover); + TQString tempname = kapp->checkRecoverFile(filename, canRecover); KURL _url(tempname); if(canRecover) @@ -443,7 +443,7 @@ void KWordQuizApp::readProperties(KConfig* _cfg) doc->openDocument(_url); doc->setModified(); setCaption(_url.fileName(),true); - QFile::remove(tempname); + TQFile::remove(tempname); } } else @@ -472,7 +472,7 @@ bool KWordQuizApp::queryExit() } ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// void KWordQuizApp::slotFileNew() @@ -493,16 +493,16 @@ void KWordQuizApp::slotFileOpen() { slotStatusMsg(i18n("Opening file...")); - QCheckBox * cb = new QCheckBox(i18n("&Join selected files into one list"), 0, 0); + TQCheckBox * cb = new TQCheckBox(i18n("&Join selected files into one list"), 0, 0); cb -> setChecked(false); - QString filter = i18n("*.kvtml *.wql *.xml.gz *.csv|All Supported Documents\n*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.xml.gz|Pauker Lesson\n*.csv|Comma-Separated Values"); - KFileDialog *fd = new KFileDialog(QString::null, filter, this, 0, true, cb); + TQString filter = i18n("*.kvtml *.wql *.xml.gz *.csv|All Supported Documents\n*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.xml.gz|Pauker Lesson\n*.csv|Comma-Separated Values"); + KFileDialog *fd = new KFileDialog(TQString::null, filter, this, 0, true, cb); fd -> setOperationMode(KFileDialog::Opening); fd -> setMode(KFile::Files | KFile::ExistingOnly); fd -> setCaption(i18n("Open Vocabulary Document")); - if (fd->exec() == QDialog::Accepted) + if (fd->exec() == TQDialog::Accepted) { KURL::List l = fd -> selectedURLs(); bool append = ((cb -> isChecked()) && (l.count() > 1)); @@ -584,12 +584,12 @@ bool KWordQuizApp::saveAsFileName( ) bool success = false; - QString filter = i18n("*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.csv|Comma-Separated Values\n*.html|Hypertext Markup Language"); - KFileDialog *fd = new KFileDialog(QString::null, filter, this, 0, true); + TQString filter = i18n("*.kvtml|KDE Vocabulary Document\n*.wql|KWordQuiz Document\n*.csv|Comma-Separated Values\n*.html|Hypertext Markup Language"); + KFileDialog *fd = new KFileDialog(TQString::null, filter, this, 0, true); fd -> setOperationMode(KFileDialog::Saving); fd -> setCaption(i18n("Save Vocabulary Document As")); - if (fd->exec() == QDialog::Accepted) + if (fd->exec() == TQDialog::Accepted) { KURL url = fd -> selectedURL(); if(!url.isEmpty()){ @@ -607,10 +607,10 @@ bool KWordQuizApp::saveAsFileName( ) url = KURL(url.path() + ".kvtml"); } - QFileInfo fileinfo(url.path()); + TQFileInfo fileinfo(url.path()); if (fileinfo.exists() && KMessageBox::warningContinueCancel(0, i18n("The file
%1
already exists. Do you want to overwrite it?
") - .arg(url.path()),QString::null,i18n("Overwrite")) == KMessageBox::Cancel) + .arg(url.path()),TQString::null,i18n("Overwrite")) == KMessageBox::Cancel) { // do nothing } @@ -691,7 +691,7 @@ void KWordQuizApp::slotFileQuit() } } -void KWordQuizApp::slotUndoChange( const QString & text, bool enabled ) +void KWordQuizApp::slotUndoChange( const TQString & text, bool enabled ) { editUndo->setText(text); editUndo->setEnabled(enabled); @@ -956,7 +956,7 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) break; case WQQuiz::qtFlash: m_quiz = new WQQuiz(m_editView); - connect(m_quiz, SIGNAL(checkingAnswer(int )), m_editView, SLOT(slotCheckedAnswer(int ))); + connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int ))); m_quiz ->setQuizType(WQQuiz::qtFlash); m_quiz->setQuizMode(Prefs::mode()); if (m_quiz -> init()) @@ -964,12 +964,12 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) m_editView->saveCurrentSelection(true); m_editView->hide(); m_flashView = new FlashView(this); - connect(quizCheck, SIGNAL(activated()), m_flashView, SLOT(slotFlip())); - connect(flashKnow, SIGNAL(activated()), m_flashView, SLOT(slotKnow())); - connect(flashDontKnow, SIGNAL(activated()), m_flashView, SLOT(slotDontKnow())); - connect(quizRestart, SIGNAL(activated()), m_flashView, SLOT(slotRestart())); - connect(quizRepeatErrors, SIGNAL(activated()), m_flashView, SLOT(slotRepeat())); - connect(this, SIGNAL(settingsChanged()), m_flashView, SLOT(slotApplySettings())); + connect(quizCheck, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotFlip())); + connect(flashKnow, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotKnow())); + connect(flashDontKnow, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotDontKnow())); + connect(quizRestart, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotRestart())); + connect(quizRepeatErrors, TQT_SIGNAL(activated()), m_flashView, TQT_SLOT(slotRepeat())); + connect(this, TQT_SIGNAL(settingsChanged()), m_flashView, TQT_SLOT(slotApplySettings())); setCentralWidget(m_flashView); m_flashView -> setQuiz(m_quiz); @@ -984,7 +984,7 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) break; case WQQuiz::qtMultiple: m_quiz = new WQQuiz(m_editView); - connect(m_quiz, SIGNAL(checkingAnswer(int )), m_editView, SLOT(slotCheckedAnswer(int ))); + connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int ))); m_quiz ->setQuizType(WQQuiz::qtMultiple); m_quiz->setQuizMode(Prefs::mode()); if (m_quiz -> init()) @@ -992,10 +992,10 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) m_editView->saveCurrentSelection(true); m_editView->hide(); m_multipleView = new MultipleView(this); - connect(quizCheck, SIGNAL(activated()), m_multipleView, SLOT(slotCheck())); - connect(quizRestart, SIGNAL(activated()), m_multipleView, SLOT(slotRestart())); - connect(quizRepeatErrors, SIGNAL(activated()), m_multipleView, SLOT(slotRepeat())); - connect(this, SIGNAL(settingsChanged()), m_multipleView, SLOT(slotApplySettings())); + connect(quizCheck, TQT_SIGNAL(activated()), m_multipleView, TQT_SLOT(slotCheck())); + connect(quizRestart, TQT_SIGNAL(activated()), m_multipleView, TQT_SLOT(slotRestart())); + connect(quizRepeatErrors, TQT_SIGNAL(activated()), m_multipleView, TQT_SLOT(slotRepeat())); + connect(this, TQT_SIGNAL(settingsChanged()), m_multipleView, TQT_SLOT(slotApplySettings())); setCentralWidget(m_multipleView); @@ -1011,7 +1011,7 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) break; case WQQuiz::qtQA: m_quiz = new WQQuiz(m_editView); - connect(m_quiz, SIGNAL(checkingAnswer(int )), m_editView, SLOT(slotCheckedAnswer(int ))); + connect(m_quiz, TQT_SIGNAL(checkingAnswer(int )), m_editView, TQT_SLOT(slotCheckedAnswer(int ))); m_quiz ->setQuizType(WQQuiz::qtQA); m_quiz->setQuizMode(Prefs::mode()); if (m_quiz -> init()) @@ -1019,11 +1019,11 @@ void KWordQuizApp::updateSession(WQQuiz::QuizType qt) m_editView->saveCurrentSelection(true); m_editView->hide(); m_qaView = new QAView(this); - connect(quizCheck, SIGNAL(activated()), m_qaView, SLOT(slotCheck())); - connect(qaHint, SIGNAL(activated()), m_qaView, SLOT(slotHint())); - connect(quizRestart, SIGNAL(activated()), m_qaView, SLOT(slotRestart())); - connect(quizRepeatErrors, SIGNAL(activated()), m_qaView, SLOT(slotRepeat())); - connect(this, SIGNAL(settingsChanged()), m_qaView, SLOT(slotApplySettings())); + connect(quizCheck, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotCheck())); + connect(qaHint, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotHint())); + connect(quizRestart, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotRestart())); + connect(quizRepeatErrors, TQT_SIGNAL(activated()), m_qaView, TQT_SLOT(slotRepeat())); + connect(this, TQT_SIGNAL(settingsChanged()), m_qaView, TQT_SLOT(slotApplySettings())); setCentralWidget(m_qaView); @@ -1055,7 +1055,7 @@ void KWordQuizApp::slotConfigure() //KConfigDialog didn't find an instance of this dialog, so lets create it : KWordQuizPrefs* dialog = new KWordQuizPrefs( this, "settings", Prefs::self() ); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(slotApplyPreferences())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotApplyPreferences())); dialog->show(); } @@ -1072,43 +1072,43 @@ void KWordQuizApp::slotApplyPreferences() void KWordQuizApp::updateSpecialCharIcons( ) { for (int i = 0; i < 9; i++){ - KAction * act = actionCollection()->action(QString("char_" + QString::number(i + 1)).latin1()); + KAction * act = actionCollection()->action(TQString("char_" + TQString::number(i + 1)).latin1()); act->setIcon(charIcon(Prefs::specialCharacters()[i])); act->setToolTip(i18n("Inserts the character %1").arg(Prefs::specialCharacters()[i])); } } -QString KWordQuizApp::charIcon(const QChar & c) +TQString KWordQuizApp::charIcon(const TQChar & c) { ///Create a name and path for the icon - QString s = locateLocal("icon", "char" + QString::number(c.unicode()) + ".png"); + TQString s = locateLocal("icon", "char" + TQString::number(c.unicode()) + ".png"); ///No need to redraw if it already exists if (KStandardDirs::exists(s)) return s; - QRect r(4, 4, 120, 120); + TQRect r(4, 4, 120, 120); ///A font to draw the character with - QFont font("sans"); + TQFont font("sans"); font.setPixelSize(100); - font.setWeight(QFont::Bold); + font.setWeight(TQFont::Bold); ///Create the pixmap - QPixmap pm(128, 128); + TQPixmap pm(128, 128); pm.fill(Qt::white); - QPainter p(&pm); + TQPainter p(&pm); p.setFont(font); p.setPen(Qt::blue); - p.drawText(r, Qt::AlignCenter, (QString) c); + p.drawText(r, Qt::AlignCenter, (TQString) c); ///Create transparency mask - QBitmap bm(128, 128); + TQBitmap bm(128, 128); bm.fill(Qt::color0); - QPainter b(&bm); + TQPainter b(&bm); b.setFont(font); b.setPen(Qt::color1); - b.drawText(r, Qt::AlignCenter, (QString) c); + b.drawText(r, Qt::AlignCenter, (TQString) c); ///Mask the pixmap pm.setMask(bm); @@ -1119,7 +1119,7 @@ QString KWordQuizApp::charIcon(const QChar & c) return s; } -void KWordQuizApp::slotStatusMsg(const QString &text) +void KWordQuizApp::slotStatusMsg(const TQString &text) { statusBar()->clear(); statusBar()->message(text); @@ -1131,7 +1131,7 @@ void KWordQuizApp::slotStatusMsg(const QString &text) void KWordQuizApp::updateMode(int m) { if (m_quiz != 0) - if (KMessageBox::warningContinueCancel(this, i18n("This will restart your quiz. Do you wish to continue?"), QString::null, KStdGuiItem::cont(), "askModeQuiz") != KMessageBox::Continue) + if (KMessageBox::warningContinueCancel(this, i18n("This will restart your quiz. Do you wish to continue?"), TQString::null, KStdGuiItem::cont(), "askModeQuiz") != KMessageBox::Continue) { mode1->setChecked(Prefs::mode() == 1); mode2->setChecked(Prefs::mode() == 2); @@ -1142,8 +1142,8 @@ void KWordQuizApp::updateMode(int m) } Prefs::setMode(m); - QString s1 = m_editView -> horizontalHeader()->label(0); - QString s2 = m_editView -> horizontalHeader()->label(1); + TQString s1 = m_editView -> horizontalHeader()->label(0); + TQString s2 = m_editView -> horizontalHeader()->label(1); mode1->setText(i18n("&1 %1 -> %2 In Order").arg(s1).arg(s2)); mode2->setText(i18n("&2 %1 -> %2 In Order").arg(s2).arg(s1)); @@ -1170,7 +1170,7 @@ void KWordQuizApp::updateMode(int m) popup->changeItem(3, i18n("&4 %1 -> %2 Randomly").arg(s2).arg(s1)); popup->changeItem(4, i18n("&5 %1 <-> %2 Randomly").arg(s1).arg(s2)); - QString s; + TQString s; mode->setIcon("mode" + s.setNum(Prefs::mode())); switch( Prefs::mode() ){ @@ -1210,10 +1210,10 @@ void KWordQuizApp::slotActionHighlighted( KAction * action, bool hl) slotStatusMsg(i18n("Ready")); } -void KWordQuizApp::slotContextMenuRequested(int row, int col, const QPoint & pos) +void KWordQuizApp::slotContextMenuRequested(int row, int col, const TQPoint & pos) { - QWidget *w = factory()->container("editor_popup", this); - QPopupMenu *popup = static_cast(w); + TQWidget *w = factory()->container("editor_popup", this); + TQPopupMenu *popup = static_cast(w); popup->exec(pos); } diff --git a/kwordquiz/src/kwordquiz.h b/kwordquiz/src/kwordquiz.h index 85c474b2..66e7b440 100644 --- a/kwordquiz/src/kwordquiz.h +++ b/kwordquiz/src/kwordquiz.h @@ -24,7 +24,7 @@ #endif // include files for Qt -#include +#include // include files for KDE #include @@ -66,7 +66,7 @@ class KWordQuizApp : public KMainWindow public: /** construtor of KWordQuizApp, calls all init functions to create the application. */ - KWordQuizApp(QWidget* parent=0, const char* name=0); + KWordQuizApp(TQWidget* parent=0, const char* name=0); ~KWordQuizApp(); /** opens a file specified by commandline option */ @@ -212,18 +212,18 @@ class KWordQuizApp : public KMainWindow /** changes the statusbar contents for the standard label permanently, used to indicate current actions. * @param text the text that is displayed in the statusbar */ - void slotStatusMsg(const QString &text); + void slotStatusMsg(const TQString &text); /** applies changes from the preferences dialog */ void slotApplyPreferences(); - void slotUndoChange(const QString & text, bool enabled); + void slotUndoChange(const TQString & text, bool enabled); void slotInsertChar(int i); void slotActionHighlighted(KAction *, bool); - void slotContextMenuRequested(int, int, const QPoint &); + void slotContextMenuRequested(int, int, const TQPoint &); private: WQQuiz::QuizType m_quizType; @@ -297,7 +297,7 @@ class KWordQuizApp : public KMainWindow KAction* qaHint; - QSignalMapper* charMapper; + TQSignalMapper* charMapper; KAction* specialChar1; KAction* specialChar2; KAction* specialChar3; @@ -315,7 +315,7 @@ class KWordQuizApp : public KMainWindow void updateSession(WQQuiz::QuizType qt); void updateActions(WQQuiz::QuizType qt); void updateSpecialCharIcons(); - QString charIcon(const QChar &); + TQString charIcon(const TQChar &); void openURL(const KURL& url); }; diff --git a/kwordquiz/src/kwordquizdoc.cpp b/kwordquiz/src/kwordquizdoc.cpp index 6666bbc8..f5309636 100644 --- a/kwordquiz/src/kwordquizdoc.cpp +++ b/kwordquiz/src/kwordquizdoc.cpp @@ -36,9 +36,9 @@ //QList *KWordQuizDoc::pViewList = 0L; //KWordQuizView *KWordQuizDoc::m_view; -KWordQuizDoc::KWordQuizDoc(QWidget *parent, const char *name) : QObject(parent, name) +KWordQuizDoc::KWordQuizDoc(TQWidget *parent, const char *name) : TQObject(parent, name) { - connect(KDirWatch::self(), SIGNAL(dirty(const QString& )), this, SLOT(slotModifiedOnDisk(const QString& ))); + connect(KDirWatch::self(), TQT_SIGNAL(dirty(const TQString& )), this, TQT_SLOT(slotModifiedOnDisk(const TQString& ))); /* if(!pViewList) { pViewList = new QList(); @@ -156,10 +156,10 @@ bool KWordQuizDoc::newDocument() bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) { - QString tmpfile; + TQString tmpfile; if (KIO::NetAccess::download( url, tmpfile, 0 )) { - QFile file(tmpfile); + TQFile file(tmpfile); if (!file.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("Cannot open file
%1
").arg(url.path())); @@ -171,7 +171,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) else doc_url = url; - QTable* g = m_view; + TQTable* g = m_view; g->setUpdatesEnabled(false); int i = 0; @@ -186,7 +186,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) if (!dataList.isEmpty()) { g->setNumRows(dataList.count() + i); - QString s; + TQString s; PaukerDataItemList::ConstIterator end(dataList.end()); for(PaukerDataItemList::ConstIterator dataIt = dataList.begin(); dataIt != end; ++dataIt) { @@ -219,7 +219,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) g->setColumnWidth(0, kvtmldoc->colWidth(0)); g->setColumnWidth(1, kvtmldoc->colWidth(1)); } - QString s; + TQString s; KEduVocDataItemList::ConstIterator end(dataList.end()); for(KEduVocDataItemList::ConstIterator dataIt = dataList.begin(); dataIt != end; ++dataIt) { @@ -256,7 +256,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) g->selectCells(wqldoc->startRow(), wqldoc->startCol(), wqldoc->endRow(), wqldoc->endCol()); Prefs::setSpecialCharacters(wqldoc->specialCharacters()); } - QString s; + TQString s; KWqlDataItemList::ConstIterator end(dataList.end()); for(KWqlDataItemList::ConstIterator dataIt = dataList.begin(); dataIt != end; ++dataIt) { @@ -274,14 +274,14 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) if (url.path().right(4) == ".csv") { - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); - QString f = ts.read(); - QStringList fl = QStringList::split('\n', f, true); + TQString f = ts.read(); + TQStringList fl = TQStringList::split('\n', f, true); g->setNumRows(fl.count() - 1 + i); - QStringList sl = QStringList::split(",", fl[0], true); + TQStringList sl = TQStringList::split(",", fl[0], true); if (!append) { @@ -293,7 +293,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) for(int j = 1; j < fl.count(); j++) { - QStringList sl = QStringList::split(",", fl[j], true); + TQStringList sl = TQStringList::split(",", fl[j], true); if (!sl[0].isEmpty()) g->setText(i + j - 1, 0, sl[0]); if (!sl[1].isEmpty()) @@ -305,7 +305,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) KIO::NetAccess::removeTempFile( tmpfile ); //Apply word wrap to cell with text - QTableItem* itm; + TQTableItem* itm; for (int r = 0; r <= g->numRows() -1; ++r) { itm = g->item(r, 0); @@ -329,7 +329,7 @@ bool KWordQuizDoc::openDocument(const KURL& url, bool append, int index) bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) { - QFile file(url.path()); + TQFile file(url.path()); if (!file.open(IO_WriteOnly)) { KMessageBox::error(0, i18n("Cannot write to file
%1
") @@ -339,15 +339,15 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) return false; } - QTable* g = m_view; - QString s = ""; + TQTable* g = m_view; + TQString s = ""; int w = 0; if (url.path().right(6) == ".kvtml") { file.close(); KVTMLWriter writer(&file); - writer.addHeader(QString("kwordquiz %1").arg(KWQ_VERSION), 2, g->numRows(), url.fileName()); + writer.addHeader(TQString("kwordquiz %1").arg(KWQ_VERSION), 2, g->numRows(), url.fileName()); writer.addFirstItem(g->horizontalHeader()->label(0), g->columnWidth(0), g->text(w, 0), g->horizontalHeader()->label(1), g->columnWidth(1), g->text(w, 1)); w++; int r = g->numRows(); @@ -367,7 +367,7 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) writer.writeGridInfo(g->verticalHeader()->width(), g->columnWidth(0), g->columnWidth(1), g->numRows()); if (g->numSelections() > 0) { - QTableSelection qts = g->selection(0); + TQTableSelection qts = g->selection(0); writer.writeSelection(qts.leftCol(), qts.topRow(), qts.rightCol(), qts.bottomRow()); } else @@ -385,8 +385,8 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) if (url.path().right(4) == ".csv") { - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); ts << g->horizontalHeader()->label(0) << "," << g->horizontalHeader()->label(1) << endl; int i = 0; @@ -400,13 +400,13 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) if (url.path().right(5) == ".html") { - QString cw1 = "width: " + QString::number(g->columnWidth(0)) + "; "; - QString cw2 = "width: " + QString::number(g->columnWidth(1)) + "; "; + TQString cw1 = "width: " + TQString::number(g->columnWidth(0)) + "; "; + TQString cw2 = "width: " + TQString::number(g->columnWidth(1)) + "; "; - QString fn = "font-family: '" + g->font().family() + "'; "; - QString fs = "font-size: " + QString::number(g->font().pointSize()) + "pt; "; - QString fb; - QString fi; + TQString fn = "font-family: '" + g->font().family() + "'; "; + TQString fs = "font-size: " + TQString::number(g->font().pointSize()) + "pt; "; + TQString fb; + TQString fi; if (g->font().bold()) fb = "font-weight: bold; "; @@ -418,15 +418,15 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) else fi = "font-style: normal; "; - QString hstyle0 = "style=\"text-align: right; width: " + QString::number(g->verticalHeader()->sectionSize(0)) + "; font-size: 12pt; background-color: darkgray\""; - QString hstyle1 = "style=\"" + cw1 + "font-size: 12pt; background-color: darkgray\""; - QString hstyle2 = "style=\"" + cw2 + "font-size: 12pt; background-color: darkgray\""; + TQString hstyle0 = "style=\"text-align: right; width: " + TQString::number(g->verticalHeader()->sectionSize(0)) + "; font-size: 12pt; background-color: darkgray\""; + TQString hstyle1 = "style=\"" + cw1 + "font-size: 12pt; background-color: darkgray\""; + TQString hstyle2 = "style=\"" + cw2 + "font-size: 12pt; background-color: darkgray\""; - QString style1 = "style=\"" + cw1 + fn + fs + fb + fi + "background-color: white\""; - QString style2 = "style=\"" + cw2 + fn + fs + fb + fi + "background-color: white\""; + TQString style1 = "style=\"" + cw1 + fn + fs + fb + fi + "background-color: white\""; + TQString style2 = "style=\"" + cw2 + fn + fs + fb + fi + "background-color: white\""; - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); ts << "" << endl; ts << "" << endl; @@ -439,7 +439,7 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) ts << "
0 ) tmp += "COLSPAN=" + QString().setNum( col ) + " "; + if( col > 0 ) tmp += "COLSPAN=" + TQString().setNum( col ) + " "; tmp += "ALIGN=CENTER>" + title @@ -582,10 +582,10 @@ QString KEducaView::insertTable( const QString &title, unsigned int col){ } /** Insert row */ -QString KEducaView::insertRow( const QString &text, bool title, unsigned colSpan ){ - QString tmp; +TQString KEducaView::insertRow( const TQString &text, bool title, unsigned colSpan ){ + TQString tmp; tmp = "
" << endl; - ts << "" << endl; + ts << "" << endl; ts << "" << endl; ts << "" << endl; ts << "" << endl; @@ -449,8 +449,8 @@ bool KWordQuizDoc::saveDocument(const KURL& url, const char *format /*=0*/) int r = g->numRows(); while (i < r) { - ts << "" << endl; - ts << "" << endl; + ts << "" << endl; + ts << "" << endl; ts << "" << endl; ts << "" << endl; ts << "" << endl; @@ -474,13 +474,13 @@ void KWordQuizDoc::deleteContents() { } -void KWordQuizDoc::slotModifiedOnDisk( const QString & path) +void KWordQuizDoc::slotModifiedOnDisk( const TQString & path) { /*@todo this code doesn't work very well. Have to look in more detail on how Kate does it. if (doc_url.path() == path) { - QString str = i18n("The file %1 was changed (modified) on disc by another program!\n\n").arg(doc_url.fileName()); - int i = KMessageBox::warningYesNoCancel(0, str + i18n("Do you want to reload the modified file? Data loss may occur."),QString::null,i18n("Reload"),i18n("Do Not Reload")); + TQString str = i18n("The file %1 was changed (modified) on disc by another program!\n\n").arg(doc_url.fileName()); + int i = KMessageBox::warningYesNoCancel(0, str + i18n("Do you want to reload the modified file? Data loss may occur."),TQString::null,i18n("Reload"),i18n("Do Not Reload")); if ( i == KMessageBox::Yes) openDocument(doc_url); } diff --git a/kwordquiz/src/kwordquizdoc.h b/kwordquiz/src/kwordquizdoc.h index 28e75419..b79879fc 100644 --- a/kwordquiz/src/kwordquizdoc.h +++ b/kwordquiz/src/kwordquizdoc.h @@ -45,7 +45,7 @@ class KWordQuizDoc : public QObject Q_OBJECT public: /** Constructor for the fileclass of the application */ - KWordQuizDoc(QWidget *parent, const char *name=0); + KWordQuizDoc(TQWidget *parent, const char *name=0); /** Destructor for the fileclass of the application */ ~KWordQuizDoc(); @@ -79,7 +79,7 @@ class KWordQuizDoc : public QObject * As this view normally repaints itself, it is excluded from the paintEvent. */ void slotUpdateAllViews(KWordQuizView *sender); - void slotModifiedOnDisk(const QString &); + void slotModifiedOnDisk(const TQString &); public: /** the list of the views currently connected to the document */ diff --git a/kwordquiz/src/kwordquizprefs.cpp b/kwordquiz/src/kwordquizprefs.cpp index 932868cd..61380e68 100644 --- a/kwordquiz/src/kwordquizprefs.cpp +++ b/kwordquiz/src/kwordquizprefs.cpp @@ -15,12 +15,12 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ #include "kwordquiz.h" #include "dlgspecchar.h" -KWordQuizPrefs::KWordQuizPrefs(QWidget *parent, const char *name, KConfigSkeleton *config, DialogType dialogType, int /*dialogButtons*/, ButtonCode /*defaultButton*/, bool /*modal*/) +KWordQuizPrefs::KWordQuizPrefs(TQWidget *parent, const char *name, KConfigSkeleton *config, DialogType dialogType, int /*dialogButtons*/, ButtonCode /*defaultButton*/, bool /*modal*/) : KConfigDialog(parent, name, config, dialogType, Default|Ok|Apply|Cancel|Help, Ok, false) { m_config = config; @@ -60,19 +60,19 @@ KWordQuizPrefs::KWordQuizPrefs(QWidget *parent, const char *name, KConfigSkelet m_dlgSpecChar = 0L; - connect(m_prefCharacter->lstCharacters, SIGNAL(selectionChanged()), this, SLOT(slotCharListSelectionChanged())); - connect(m_prefCharacter->btnCharacter, SIGNAL(clicked()), this, SLOT(slotSelectSpecChar())); + connect(m_prefCharacter->lstCharacters, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotCharListSelectionChanged())); + connect(m_prefCharacter->btnCharacter, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectSpecChar())); KWordQuizApp *win=(KWordQuizApp *) parent; int i=0; KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); - for ( QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + for ( TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { - it.current()->setText(2, (QString) ds[i++] ) ; - it.current()->setText(1, win->actionCollection()->action(QString("char_" + QString::number(i)).latin1())->shortcut().toString()); + it.current()->setText(2, (TQString) ds[i++] ) ; + it.current()->setText(1, win->actionCollection()->action(TQString("char_" + TQString::number(i)).latin1())->shortcut().toString()); } m_prefCharacter->lstCharacters->setSelected(m_prefCharacter->lstCharacters->firstChild(), true); @@ -89,15 +89,15 @@ void KWordQuizPrefs::slotCharListSelectionChanged() void KWordQuizPrefs::slotSelectSpecChar( ) { KConfigSkeletonItem * item = m_config->findItem("EditorFont"); - QString f = item->property().toFont().family(); - QString s = m_prefCharacter->lstCharacters->currentItem()->text(2); - QChar c = s[0]; + TQString f = item->property().toFont().family(); + TQString s = m_prefCharacter->lstCharacters->currentItem()->text(2); + TQChar c = s[0]; if (m_dlgSpecChar == 0) { m_dlgSpecChar = new DlgSpecChar( this, "insert special char", f, c, true ); - connect(m_dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - connect(m_dlgSpecChar, SIGNAL(finished()), this, SLOT(slotDlgSpecCharClosed())); + connect(m_dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + connect(m_dlgSpecChar, TQT_SIGNAL(finished()), this, TQT_SLOT(slotDlgSpecCharClosed())); } m_dlgSpecChar->show(); } @@ -106,14 +106,14 @@ void KWordQuizPrefs::slotDlgSpecCharClosed() { if ( m_dlgSpecChar ) { - disconnect(m_dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - disconnect(m_dlgSpecChar, SIGNAL(finished()), this, SLOT(slotDlgSpecCharClosed())); + disconnect(m_dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + disconnect(m_dlgSpecChar, TQT_SIGNAL(finished()), this, TQT_SLOT(slotDlgSpecCharClosed())); m_dlgSpecChar->deleteLater(); m_dlgSpecChar = 0L; } } -void KWordQuizPrefs::slotSpecChar(QChar c) +void KWordQuizPrefs::slotSpecChar(TQChar c) { m_prefCharacter->lstCharacters->currentItem()->setText(2, c); m_prefCharacter->lblPreview->setText(m_prefCharacter->lstCharacters->currentItem()->text(2)); @@ -124,14 +124,14 @@ bool KWordQuizPrefs::hasChanged() { bool result; - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); if (ds == s.stripWhiteSpace()) result = KConfigDialog::hasChanged(); @@ -146,14 +146,14 @@ bool KWordQuizPrefs::isDefault() bool bUseDefaults = m_config->useDefaults(true); bool result; - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); if (ds == s.stripWhiteSpace()) result = KConfigDialog::isDefault(); @@ -166,14 +166,14 @@ bool KWordQuizPrefs::isDefault() void KWordQuizPrefs::updateSettings( ) { - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - item->setProperty(QVariant(s)); + item->setProperty(TQVariant(s)); emit settingsChanged(); } @@ -182,19 +182,19 @@ void KWordQuizPrefs::updateWidgetsDefault( ) { bool bUseDefaults = m_config->useDefaults(true); - QString s; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + TQString s; + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { s.append(it.current()->text(2)); } KConfigSkeletonItem * item = m_config->findItem("SpecialCharacters"); - QString ds = item->property().toString(); + TQString ds = item->property().toString(); int i=0; - for (QListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) + for (TQListViewItemIterator it = m_prefCharacter->lstCharacters; it.current(); ++it) { - it.current()->setText(2, (QString) ds[i++] ) ; + it.current()->setText(2, (TQString) ds[i++] ) ; } m_prefCharacter->lblPreview->setText(m_prefCharacter->lstCharacters->currentItem()->text(2)); m_config->useDefaults(bUseDefaults); diff --git a/kwordquiz/src/kwordquizprefs.h b/kwordquiz/src/kwordquizprefs.h index f53e30d8..3afd5f9f 100644 --- a/kwordquiz/src/kwordquizprefs.h +++ b/kwordquiz/src/kwordquizprefs.h @@ -34,7 +34,7 @@ class KWordQuizPrefs : public KConfigDialog { Q_OBJECT public: - KWordQuizPrefs(QWidget *parent=0, const char *name=0, KConfigSkeleton *config=0, DialogType dialogType=IconList, + KWordQuizPrefs(TQWidget *parent=0, const char *name=0, KConfigSkeleton *config=0, DialogType dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel|Help, ButtonCode defaultButton=Ok, bool modal=false); protected slots: @@ -45,7 +45,7 @@ private slots: void slotCharListSelectionChanged(); void slotDlgSpecCharClosed(); void slotSelectSpecChar(); - void slotSpecChar(QChar); + void slotSpecChar(TQChar); protected: bool hasChanged(); diff --git a/kwordquiz/src/kwordquizview.cpp b/kwordquiz/src/kwordquizview.cpp index 69e2046b..0096f591 100644 --- a/kwordquiz/src/kwordquizview.cpp +++ b/kwordquiz/src/kwordquizview.cpp @@ -16,10 +16,10 @@ ***************************************************************************/ // include files for Qt -#include -#include -#include -#include +#include +#include +#include +#include // include files for KDE #include //i18n @@ -37,9 +37,9 @@ #include "dlgrc.h" #include "dlgspecchar.h" -QValueList *KWordQuizView::m_undoList = 0L; +TQValueList *KWordQuizView::m_undoList = 0L; -KWQTableItem::KWQTableItem(QTable* table, EditType et, const QString & text) : QTableItem(table, et, text) +KWQTableItem::KWQTableItem(TQTable* table, EditType et, const TQString & text) : TQTableItem(table, et, text) {} int KWQTableItem::alignment() const @@ -55,16 +55,16 @@ int KWQTableItem::alignment() const return (num ? Qt::AlignRight : Qt::AlignAuto) | Qt::AlignVCenter; } -KWordQuizView::KWordQuizView(QWidget *parent, const char *name) : QTable(parent, name) +KWordQuizView::KWordQuizView(TQWidget *parent, const char *name) : TQTable(parent, name) { if(!m_undoList) - m_undoList = new QValueList(); + m_undoList = new TQValueList(); setNumCols(2); setNumRows(50); setColumnWidth(1, 250); setColumnWidth(0, 250); - setSelectionMode(QTable::Single); + setSelectionMode(TQTable::Single); horizontalHeader()->setLabel(0, i18n("Column 1")); horizontalHeader()->setLabel(1, i18n("Column 2")); setMinimumSize(0, 0); //This seems to improve resizing of main window @@ -83,7 +83,7 @@ KWordQuizDoc *KWordQuizView::getDocument() const void KWordQuizView::print(KPrinter *pPrinter) { - QPainter painter; + TQPainter painter; //type 0 Vocabulary list //type 1 Vocabulary exam @@ -121,7 +121,7 @@ void KWordQuizView::print(KPrinter *pPrinter) int lPos = marg; int tPos = marg + horizontalHeader()->height(); - QRect w = painter.window(); + TQRect w = painter.window(); doNewPage(painter, res, type); @@ -169,7 +169,7 @@ void KWordQuizView::print(KPrinter *pPrinter) painter.drawLine(lPos, tPos, lPos + gridWidth, tPos); painter.setFont(KGlobalSettings::generalFont()); - painter.drawText(lPos, tPos, cw0 - pad, rowHeight(rc), AlignRight | AlignVCenter, QString::number(rc + 1)); + painter.drawText(lPos, tPos, cw0 - pad, rowHeight(rc), AlignRight | AlignVCenter, TQString::number(rc + 1)); painter.setFont(font()); painter.drawText(lPos + cw0 + pad, tPos, cw1, rowHeight(rc), AlignAuto | AlignVCenter | WordBreak, text(rc, 0)); @@ -192,7 +192,7 @@ void KWordQuizView::print(KPrinter *pPrinter) painter.end(); } -void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) +void KWordQuizView::doNewPage( TQPainter & painter, int res, int type ) { int cw0 = verticalHeader()->width(); int cw1 = columnWidth(0); @@ -205,7 +205,7 @@ void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) if (type == 1) cw3 = 50; - QRect w = painter.window(); + TQRect w = painter.window(); painter.setFont(KGlobalSettings::generalFont()); @@ -220,8 +220,8 @@ void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) if (type == 1) { - QString score = i18n("Name:_____________________________ Date:__________"); - QRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, score); + TQString score = i18n("Name:_____________________________ Date:__________"); + TQRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, score); painter.drawText(w.width() - r.width() - marg, marg - 20, score); } @@ -235,13 +235,13 @@ void KWordQuizView::doNewPage( QPainter & painter, int res, int type ) } -void KWordQuizView::doEndOfPage( QPainter & painter, int vPos, int pageNum, int res, int type ) +void KWordQuizView::doEndOfPage( TQPainter & painter, int vPos, int pageNum, int res, int type ) { int marg = res; painter.setFont(KGlobalSettings::generalFont()); - QRect w = painter.window(); - QRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, QString::number(pageNum)); - painter.drawText((w.width()/2) - (r.width()/2), w.height() - marg + 20, QString::number(pageNum)); + TQRect w = painter.window(); + TQRect r = painter.boundingRect(0, 0, 0, 0, AlignAuto, TQString::number(pageNum)); + painter.drawText((w.width()/2) - (r.width()/2), w.height() - marg + 20, TQString::number(pageNum)); if (type == 2) return; @@ -284,10 +284,10 @@ bool KWordQuizView::gridIsEmpty() return true; } -QWidget * KWordQuizView::beginEdit( int row, int col, bool replace ) +TQWidget * KWordQuizView::beginEdit( int row, int col, bool replace ) { m_currentText = text(row, col); - cellEditor = QTable::beginEdit(row, col, replace); + cellEditor = TQTable::beginEdit(row, col, replace); if (cellEditor) cellEditor->installEventFilter(this); return cellEditor; @@ -300,12 +300,12 @@ void KWordQuizView::endEdit( int row, int col, bool accept, bool replace ) if (cellWidget(row, col) != 0) //if edited the cellWidget still exists { - if (((QLineEdit *) cellWidget(row, col))->text() != m_currentText) + if (((TQLineEdit *) cellWidget(row, col))->text() != m_currentText) addUndo(i18n("&Undo Entry")); - QTable::endEdit(row, col, accept, replace); //this will destroy the cellWidget + TQTable::endEdit(row, col, accept, replace); //this will destroy the cellWidget if (!text(row, col).isEmpty()) { - QTableItem* itm; + TQTableItem* itm; itm = item(row, col); itm->setWordWrap(true); adjustRow(row); @@ -322,7 +322,7 @@ void KWordQuizView::adjustRow( int row ) // we want to make the row high enough to display content, but // if the user already made it even higher we keep that height int rh = rowHeight(row); - QTable::adjustRow(row); + TQTable::adjustRow(row); if (rh > rowHeight(row)) setRowHeight(row, rh); } @@ -341,8 +341,8 @@ void KWordQuizView::saveCurrentSelection(bool clear = true) } else { - QTableSelection* ts; - ts = new QTableSelection(m_currentRow, m_currentCol, m_currentRow, m_currentCol); + TQTableSelection* ts; + ts = new TQTableSelection(m_currentRow, m_currentCol, m_currentRow, m_currentCol); m_currentSel = *ts; } } @@ -351,8 +351,8 @@ void KWordQuizView::doEditUndo( ) { if (isEditing()) { - if (((QLineEdit *) cellWidget(currentRow(), currentColumn()))->isUndoAvailable()) - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->undo(); + if (((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->isUndoAvailable()) + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->undo(); } else { @@ -370,7 +370,7 @@ void KWordQuizView::doEditUndo( ) setCurrentCell(undo.currentRow(), undo.currentCol()); addSelection(undo.selection()); - QString s; + TQString s; int i = 0; KWqlDataItemList dataList = undo.list(); KWqlDataItemList::ConstIterator end(dataList.end()); @@ -404,7 +404,7 @@ void KWordQuizView::doEditCut( ) { if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->cut(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->cut(); } else { @@ -423,12 +423,12 @@ void KWordQuizView::doEditCopy( ) bool mod = getDocument()->isModified(); if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->copy(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->copy(); } else { saveCurrentSelection(false); - QString s; + TQString s; for (int r = m_currentSel.topRow(); r <= m_currentSel.bottomRow(); ++r) { for (int c = m_currentSel.leftCol(); c <= m_currentSel.rightCol(); ++c) @@ -444,7 +444,7 @@ void KWordQuizView::doEditPaste( ) { if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->paste(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->paste(); } else { @@ -457,9 +457,9 @@ void KWordQuizView::doEditPaste( ) if (lc == rc && tr == br) //one cell selected { - QString s = kapp->clipboard()->text(); - QStringList sl; - sl = QStringList::split("\n", s); + TQString s = kapp->clipboard()->text(); + TQStringList sl; + sl = TQStringList::split("\n", s); uint r = numRows() - tr; @@ -477,12 +477,12 @@ void KWordQuizView::doEditPaste( ) uint i = 0; int ar = tr; - QStringList sr; + TQStringList sr; while(i < sl.count() && br <= numRows() ) { int ac = lc; - sr = QStringList::split("\t", sl[i]); + sr = TQStringList::split("\t", sl[i]); int c = 0; while (ac <= rc) { @@ -498,17 +498,17 @@ void KWordQuizView::doEditPaste( ) } else { - QString s = kapp->clipboard()->text(); - QStringList sl; - sl = QStringList::split("\n", s); + TQString s = kapp->clipboard()->text(); + TQStringList sl; + sl = TQStringList::split("\n", s); uint i = 0; int ar = tr; - QStringList sr; + TQStringList sr; while(i < sl.count() && ar <= br ) { int ac = lc; - sr = QStringList::split("\t", sl[i]); + sr = TQStringList::split("\t", sl[i]); int c = 0; while (ac <= rc) { @@ -522,7 +522,7 @@ void KWordQuizView::doEditPaste( ) } //restore selection - addSelection(QTableSelection(tr, lc, br, rc)); + addSelection(TQTableSelection(tr, lc, br, rc)); setCurrentCell(m_currentRow, m_currentCol); } getDocument()->setModified(true); @@ -532,7 +532,7 @@ void KWordQuizView::doEditClear( ) { if (isEditing()) { - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->clear(); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->clear(); } else { @@ -552,7 +552,7 @@ void KWordQuizView::doEditInsert( ) saveCurrentSelection(); insertRows(m_currentSel.topRow(), m_currentSel.bottomRow() - m_currentSel.topRow() + 1); - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); setUpdatesEnabled(true); repaintContents(); @@ -578,7 +578,7 @@ void KWordQuizView::doEditDelete( ) br = numRows(); //adjust for new numRows //restore selection as much as possible - addSelection(QTableSelection(tr, m_currentSel.leftCol(), br, m_currentSel.rightCol())); + addSelection(TQTableSelection(tr, m_currentSel.leftCol(), br, m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); getDocument()->setModified(true); } @@ -587,7 +587,7 @@ const char delim_start = '['; const char delim_end = ']'; -bool KWordQuizView::checkForBlank( const QString & s, bool blank ) +bool KWordQuizView::checkForBlank( const TQString & s, bool blank ) { if (!blank) return true; @@ -595,8 +595,8 @@ bool KWordQuizView::checkForBlank( const QString & s, bool blank ) bool result = false; int openCount = 0; int closeCount = 0; - QMemArray openPos(0); - QMemArray closePos(0); + TQMemArray openPos(0); + TQMemArray closePos(0); for (uint i = 0; i<= s.length(); ++i) { @@ -631,10 +631,10 @@ void KWordQuizView::doEditMarkBlank( ) if (isEditing()) { addUndo(i18n("&Undo Mark Blank")); - QLineEdit * l = (QLineEdit *) cellWidget(currentRow(), currentColumn()); + TQLineEdit * l = (TQLineEdit *) cellWidget(currentRow(), currentColumn()); if (l->text().length() > 0) { - QString s = l->text(); + TQString s = l->text(); int cp = l->cursorPosition(); if (!l->hasSelectedText()) { @@ -661,7 +661,7 @@ void KWordQuizView::doEditMarkBlank( ) if (l->hasSelectedText()) { - QString st = l->selectedText(); + TQString st = l->selectedText(); int len = st.length(); st = st.prepend(delim_start); st = st.append(delim_end); @@ -677,15 +677,15 @@ void KWordQuizView::doEditMarkBlank( ) void KWordQuizView::doEditUnmarkBlank( ) { addUndo(i18n("&Undo Unmark Blank")); - QString s; + TQString s; if (isEditing()) { - QLineEdit * l = (QLineEdit *) cellWidget(currentRow(), currentColumn()); + TQLineEdit * l = (TQLineEdit *) cellWidget(currentRow(), currentColumn()); if (l->hasSelectedText()) { - QString ls = l->text(); + TQString ls = l->text(); s = l->selectedText(); int len = s.length(); s.remove(delim_start); @@ -755,7 +755,7 @@ bool KWordQuizView::checkSyntax(bool all, bool blanks) for (int r = r1; r <= r2; ++r) for(int c = c1 ; c <= c2 ; ++c ) { - QString s = text(r, c); + TQString s = text(r, c); if (s.length() > 0) for (uint i = 0; i <= s.length(); ++i) if (s[i] == delim_start || s[i] == delim_end) @@ -783,7 +783,7 @@ void KWordQuizView::doVocabSort( ) getDocument()->setModified(true); } //restore selection - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); } @@ -802,7 +802,7 @@ void KWordQuizView::doVocabShuffle( ) count--; } //restore selection - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); setUpdatesEnabled(true); repaintContents(); @@ -814,7 +814,7 @@ void KWordQuizView::doVocabRC( ) saveCurrentSelection(); DlgRC* dlg; dlg = new DlgRC(this, "dlg_rc", true); - //dlg->setInitialSize(QSize(225, 230), true); + //dlg->setInitialSize(TQSize(225, 230), true); dlg->setNumRows(numRows()); dlg->setRowHeight(rowHeight(m_currentRow)); dlg->setColWidth(columnWidth(m_currentCol)); @@ -831,19 +831,19 @@ void KWordQuizView::doVocabRC( ) setColumnWidth(i, dlg->colWidth()); getDocument()->setModified(true); } - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); } void KWordQuizView::doVocabSpecChar( ) { - QString f = font().family(); - QChar c=' '; + TQString f = font().family(); + TQChar c=' '; if (dlgSpecChar==0) { dlgSpecChar = new DlgSpecChar( this, "insert special char", f, c, false ); - connect( dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - connect( dlgSpecChar, SIGNAL( finished() ), this, SLOT( slotDlgSpecCharClosed() ) ); + connect( dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + connect( dlgSpecChar, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotDlgSpecCharClosed() ) ); } dlgSpecChar->show(); } @@ -852,22 +852,22 @@ void KWordQuizView::slotDlgSpecCharClosed( ) { if ( dlgSpecChar ) { - disconnect( dlgSpecChar, SIGNAL(insertChar(QChar)), this, SLOT(slotSpecChar(QChar))); - disconnect( dlgSpecChar, SIGNAL( finished() ), this, SLOT( slotDlgSpecCharClosed() ) ); + disconnect( dlgSpecChar, TQT_SIGNAL(insertChar(TQChar)), this, TQT_SLOT(slotSpecChar(TQChar))); + disconnect( dlgSpecChar, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotDlgSpecCharClosed() ) ); dlgSpecChar->deleteLater(); dlgSpecChar = 0L; } } -void KWordQuizView::slotSpecChar(const QChar & c) +void KWordQuizView::slotSpecChar(const TQChar & c) { if (isEditing()) { - QLineEdit * l = (QLineEdit *) cellWidget(currentRow(), currentColumn()); + TQLineEdit * l = (TQLineEdit *) cellWidget(currentRow(), currentColumn()); if (l->hasSelectedText()) { - QString ls = l->text(); - QString s = l->selectedText(); + TQString ls = l->text(); + TQString s = l->selectedText(); int len = s.length(); int ss = l->selectionStart(); ls = ls.replace(ss, len, c); @@ -876,7 +876,7 @@ void KWordQuizView::slotSpecChar(const QChar & c) } else { - QString s = l->text(); + TQString s = l->text(); int i = l->cursorPosition(); s.insert(i, c); l->setText(s); @@ -886,8 +886,8 @@ void KWordQuizView::slotSpecChar(const QChar & c) else { editCell(currentRow(), currentColumn(), true); - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->setText(c); - ((QLineEdit *) cellWidget(currentRow(), currentColumn()))->setCursorPosition(1); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->setText(c); + ((TQLineEdit *) cellWidget(currentRow(), currentColumn()))->setCursorPosition(1); } } @@ -926,7 +926,7 @@ void KWordQuizView::activateNextCell( ) } else //a larger selection, move within it { - //addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + //addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); switch(Prefs::enterMove()) { case 0: @@ -959,7 +959,7 @@ void KWordQuizView::activateNextCell( ) } } -void KWordQuizView::addUndo( const QString & caption ) +void KWordQuizView::addUndo( const TQString & caption ) { while (m_undoList->count() > 10) { @@ -993,27 +993,27 @@ void KWordQuizView::addUndo( const QString & caption ) emit undoChange(caption, true); } -void KWordQuizView::setFont( const QFont & font) +void KWordQuizView::setFont( const TQFont & font) { - QTable::setFont(font); + TQTable::setFont(font); horizontalHeader()->setFont(KGlobalSettings::generalFont()); verticalHeader()->setFont(KGlobalSettings::generalFont()); for (int i = 0; i < numRows(); ++i) adjustRow(i); //setRowHeight(i, fontMetrics().lineSpacing() ); } -void KWordQuizView::paintCell( QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup & cg ) +void KWordQuizView::paintCell( TQPainter * p, int row, int col, const TQRect & cr, bool selected, const TQColorGroup & cg ) { - QColorGroup g (cg); + TQColorGroup g (cg); if (Prefs::enableBlanks()) if (!checkForBlank(text(row, col), true)) - g.setColor(QColorGroup::Text, Qt::red); + g.setColor(TQColorGroup::Text, Qt::red); - QTable::paintCell (p, row, col, cr, selected, g ); + TQTable::paintCell (p, row, col, cr, selected, g ); } -void KWordQuizView::keyPressEvent( QKeyEvent * e) +void KWordQuizView::keyPressEvent( TQKeyEvent * e) { /*if (isEditing()) if (e->key() == Key_Tab) @@ -1030,7 +1030,7 @@ void KWordQuizView::keyPressEvent( QKeyEvent * e) activateNextCell(); return; } - QTable::keyPressEvent(e); + TQTable::keyPressEvent(e); } void KWordQuizView::slotCheckedAnswer( int i ) @@ -1038,7 +1038,7 @@ void KWordQuizView::slotCheckedAnswer( int i ) if (i == -1) { clearSelection(); - addSelection(QTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); + addSelection(TQTableSelection(m_currentSel.topRow(), m_currentSel.leftCol(), m_currentSel.bottomRow(), m_currentSel.rightCol())); setCurrentCell(m_currentRow, m_currentCol); } else @@ -1049,13 +1049,13 @@ void KWordQuizView::slotCheckedAnswer( int i ) } } -bool KWordQuizView::eventFilter( QObject * o, QEvent * e ) +bool KWordQuizView::eventFilter( TQObject * o, TQEvent * e ) { if (o == cellEditor) { - if ( e->type() == QEvent::KeyPress ) + if ( e->type() == TQEvent::KeyPress ) { - QKeyEvent *k = (QKeyEvent *)e; + TQKeyEvent *k = (TQKeyEvent *)e; if (k->key() == Key_Tab) { endEdit(currentRow(), currentColumn(), true, true); @@ -1064,18 +1064,18 @@ bool KWordQuizView::eventFilter( QObject * o, QEvent * e ) } } } - return QTable::eventFilter(o, e); + return TQTable::eventFilter(o, e); } -void KWordQuizView::setText(int row, int col, const QString & text) +void KWordQuizView::setText(int row, int col, const TQString & text) { - QTableItem *itm = item(row, col); + TQTableItem *itm = item(row, col); if (itm) { itm->setText(text); itm->updateEditor(row, col); updateCell(row, col); } else { - KWQTableItem *i = new KWQTableItem(this, QTableItem::OnTyping, text); + KWQTableItem *i = new KWQTableItem(this, TQTableItem::OnTyping, text); setItem(row, col, i); } } diff --git a/kwordquiz/src/kwordquizview.h b/kwordquiz/src/kwordquizview.h index 6e963064..00289925 100644 --- a/kwordquiz/src/kwordquizview.h +++ b/kwordquiz/src/kwordquizview.h @@ -23,7 +23,7 @@ #endif // include files for Qt -#include +#include #include @@ -44,7 +44,7 @@ class DlgSpecChar; class KWQTableItem :public QTableItem { public: - KWQTableItem( QTable* table, EditType et, const QString & text ); + KWQTableItem( TQTable* table, EditType et, const TQString & text ); virtual int alignment() const; }; @@ -53,7 +53,7 @@ class KWordQuizView : public QTable Q_OBJECT public: /** Constructor for the main view */ - KWordQuizView(QWidget *parent = 0, const char *name=0); + KWordQuizView(TQWidget *parent = 0, const char *name=0); /** Destructor for the main view */ ~KWordQuizView(); @@ -65,14 +65,14 @@ class KWordQuizView : public QTable KWordQuizDoc *getDocument() const; //Reimplemented from QTable - void paintCell ( QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup & cg ); - void setFont( const QFont &); - void setText( int row, int col, const QString &text ); + void paintCell ( TQPainter * p, int row, int col, const TQRect & cr, bool selected, const TQColorGroup & cg ); + void setFont( const TQFont &); + void setText( int row, int col, const TQString &text ); /** contains the implementation for printing functionality */ void print(KPrinter *pPrinter); bool gridIsEmpty(); - void addUndo(const QString & caption); + void addUndo(const TQString & caption); void doEditUndo(); void doEditCut(); void doEditCopy(); @@ -89,35 +89,35 @@ class KWordQuizView : public QTable bool checkSyntax(bool all, bool blanks); void saveCurrentSelection(bool clear); protected: - QWidget * beginEdit(int row, int col, bool replace); + TQWidget * beginEdit(int row, int col, bool replace); void endEdit ( int row, int col, bool accept, bool replace ); void activateNextCell(); - void keyPressEvent( QKeyEvent* ); - bool eventFilter( QObject*, QEvent* ); + void keyPressEvent( TQKeyEvent* ); + bool eventFilter( TQObject*, TQEvent* ); public slots: void adjustRow(int row); - void slotSpecChar(const QChar &); + void slotSpecChar(const TQChar &); void slotCheckedAnswer(int ); private slots: void slotDlgSpecCharClosed(); signals: - void undoChange(const QString & text, bool enabled); + void undoChange(const TQString & text, bool enabled); private: int m_currentRow; int m_currentCol; - QString m_currentText; - QTableSelection m_currentSel; + TQString m_currentText; + TQTableSelection m_currentSel; DlgSpecChar* dlgSpecChar; - QWidget * cellEditor; + TQWidget * cellEditor; /** the list of the undo objects */ - static QValueList *m_undoList; + static TQValueList *m_undoList; - void doNewPage(QPainter & painter, int res, int type); - void doEndOfPage(QPainter & painter, int vPos, int pageNum, int res, int type); - bool checkForBlank(const QString & s, bool blank); + void doNewPage(TQPainter & painter, int res, int type); + void doEndOfPage(TQPainter & painter, int vPos, int pageNum, int res, int type); + bool checkForBlank(const TQString & s, bool blank); }; #endif // KWORDQUIZVIEW_H diff --git a/kwordquiz/src/kwqnewstuff.cpp b/kwordquiz/src/kwqnewstuff.cpp index cc8310a7..05da32af 100644 --- a/kwordquiz/src/kwqnewstuff.cpp +++ b/kwordquiz/src/kwqnewstuff.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include #include @@ -27,68 +27,68 @@ #include "kwqnewstuff.h" #include "prefs.h" -KWQNewStuff::KWQNewStuff(QWidget *parent, const char *name) : QObject(), KNewStuff("kdeedu/vocabulary", parent) +KWQNewStuff::KWQNewStuff(TQWidget *parent, const char *name) : TQObject(), KNewStuff("kdeedu/vocabulary", parent) { m_app = (KWordQuizApp *) parent; } -bool KWQNewStuff::install(const QString & fileName) +bool KWQNewStuff::install(const TQString & fileName) { m_app->slotFileOpenRecent(KURL(fileName)); return true; } -bool KWQNewStuff::createUploadFile(const QString & fileName) +bool KWQNewStuff::createUploadFile(const TQString & fileName) { return true; } -QString KWQNewStuff::destinationPath(KNS::Entry * entry) +TQString KWQNewStuff::destinationPath(KNS::Entry * entry) { if (entry) { KURL url = entry->payload(); - QString fileName = url.fileName(); + TQString fileName = url.fileName(); - QString path = Prefs::installPath(); //default is Vocabularies which will be created in the user's home directory - QString file; + TQString path = Prefs::installPath(); //default is Vocabularies which will be created in the user's home directory + TQString file; if (path.isEmpty()) file = KNewStuff::downloadDestination(entry); //fall back on a temp file, should never happen else { - file = QDir::home().path() + "/" + path + "/"; + file = TQDir::home().path() + "/" + path + "/"; KStandardDirs::makeDir(file); //ensure the directory exists file += fileName; } return file; } else - return QString::null; + return TQString::null; } -QString KWQNewStuff::downloadDestination(KNS::Entry * entry) +TQString KWQNewStuff::downloadDestination(KNS::Entry * entry) { - QString file = destinationPath(entry); + TQString file = destinationPath(entry); if (KStandardDirs::exists(file)) { int result = KMessageBox::questionYesNo(parentWidget(), i18n("The file '%1' already exists. Do you want to overwrite it?") .arg(file), - QString::null, + TQString::null, i18n("Overwrite"),i18n("Do Not Overwrite")); if (result == KMessageBox::No) - return QString::null; + return TQString::null; } KMessageBox::information(parentWidget(), i18n("The selected file will now be downloaded and saved as\n'%1'.") .arg(file), - QString::null, + TQString::null, "NewStuffDownloadLocation"); return file; } diff --git a/kwordquiz/src/kwqnewstuff.h b/kwordquiz/src/kwqnewstuff.h index eb91044a..f3ae82c1 100644 --- a/kwordquiz/src/kwqnewstuff.h +++ b/kwordquiz/src/kwqnewstuff.h @@ -25,11 +25,11 @@ class KWordQuizApp; /** @author Peter Hedlund */ -class KWQNewStuff : public QObject, public KNewStuff +class KWQNewStuff : public TQObject, public KNewStuff { Q_OBJECT public: - KWQNewStuff(QWidget *parent = 0, const char *name = 0); + KWQNewStuff(TQWidget *parent = 0, const char *name = 0); /** Installs a downloaded file according to the application's configuration. @@ -37,7 +37,7 @@ public: @param fileName filename of the donwloaded file @return @c true in case of installation success, @c false otherwise */ - bool install(const QString &fileName); + bool install(const TQString &fileName); /** Creates a file suitable for upload. @@ -47,7 +47,7 @@ public: @param fileName the name of the file to upload after its creation @return @c true in case of creation success, @c false otherwise */ - bool createUploadFile(const QString &fileName); + bool createUploadFile(const TQString &fileName); /** Queries the preferred destination file for a download. @@ -55,10 +55,10 @@ public: @param entry a Hotstuff data entry @return destination filename, or 0 to return directory only */ - QString downloadDestination(KNS::Entry *entry); + TQString downloadDestination(KNS::Entry *entry); private: - QString destinationPath(KNS::Entry *entry); + TQString destinationPath(KNS::Entry *entry); KWordQuizApp * m_app; }; diff --git a/kwordquiz/src/main.cpp b/kwordquiz/src/main.cpp index 57fefbfd..3de695a8 100644 --- a/kwordquiz/src/main.cpp +++ b/kwordquiz/src/main.cpp @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) if (args->count()) { kwordquiz->openDocumentFile(args->arg(args->count() - 1)); - QCString mode = args->getOption("mode"); + TQCString mode = args->getOption("mode"); if (!mode.isEmpty()) { if (mode == "1") @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) if (mode == "5") kwordquiz->slotMode5(); } - QCString go_to = args->getOption("goto"); + TQCString go_to = args->getOption("goto"); if (!go_to.isEmpty()) { if (go_to == "flash") diff --git a/kwordquiz/src/multipleview.cpp b/kwordquiz/src/multipleview.cpp index 9c050a86..3920c12a 100644 --- a/kwordquiz/src/multipleview.cpp +++ b/kwordquiz/src/multipleview.cpp @@ -16,8 +16,8 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include @@ -27,7 +27,7 @@ #include "multipleview.h" #include "prefs.h" -MultipleView::MultipleView(QWidget *parent, const char *name, WFlags f) +MultipleView::MultipleView(TQWidget *parent, const char *name, WFlags f) : MultipleViewBase(parent, name, f) { m_score = new WQScore(); @@ -91,7 +91,7 @@ void MultipleView::slotCheck() if (win->actionCollection()->action("quiz_check")->isEnabled()) { - QString ans; + TQString ans; bool oneIsChecked = false; if (opt1->isChecked()) @@ -221,7 +221,7 @@ void MultipleView::slotRepeat() void MultipleView::updateScore() { - QString s; + TQString s; s = s.setNum(m_quiz->questionCount(), 10); lblScoreCount->setText(s); picCount->setPixmap(KGlobal::iconLoader()->loadIcon("kwordquiz", KIcon::Panel)); @@ -261,10 +261,10 @@ void MultipleView::showQuestion(int i) //opt2->setFont(m_quiz->fontAnswer(i)); //opt3->setFont(m_quiz->fontAnswer(i)); - QStringList sl = m_quiz->multiOptions(i); - QString s[10]; + TQStringList sl = m_quiz->multiOptions(i); + TQString s[10]; int j = 0; - for(QStringList::Iterator it = sl.begin(); it != sl.end(); ++it) + for(TQStringList::Iterator it = sl.begin(); it != sl.end(); ++it) { s[j] = *it; j++; diff --git a/kwordquiz/src/multipleview.h b/kwordquiz/src/multipleview.h index c5b1cd16..7d4f06de 100644 --- a/kwordquiz/src/multipleview.h +++ b/kwordquiz/src/multipleview.h @@ -30,7 +30,7 @@ class MultipleView : public MultipleViewBase { Q_OBJECT public: - MultipleView(QWidget *parent = 0, const char *name = 0, WFlags f = 0); + MultipleView(TQWidget *parent = 0, const char *name = 0, WFlags f = 0); ~MultipleView(); diff --git a/kwordquiz/src/paukerreader.cpp b/kwordquiz/src/paukerreader.cpp index 95bcf7cc..df34a8d7 100644 --- a/kwordquiz/src/paukerreader.cpp +++ b/kwordquiz/src/paukerreader.cpp @@ -18,8 +18,8 @@ #include "paukerreader.h" -#include -#include +#include +#include #include #include @@ -28,7 +28,7 @@ PaukerDataItem::PaukerDataItem() { } -PaukerDataItem::PaukerDataItem(QDomElement &entry) +PaukerDataItem::PaukerDataItem(TQDomElement &entry) { domElement = entry; } @@ -37,37 +37,37 @@ PaukerDataItem::~PaukerDataItem() { } -QString PaukerDataItem::frontSide() const +TQString PaukerDataItem::frontSide() const { return getText("FrontSide"); } -QString PaukerDataItem::backSide() const +TQString PaukerDataItem::backSide() const { return getText("BackSide"); } -QString PaukerDataItem::getText(const QString &tagName) const +TQString PaukerDataItem::getText(const TQString &tagName) const { if(!domElement.isNull()) { - QDomNodeList list = domElement.elementsByTagName(tagName); + TQDomNodeList list = domElement.elementsByTagName(tagName); if(list.count() > 0) { - QDomElement element = list.item(0).toElement(); + TQDomElement element = list.item(0).toElement(); if(!element.isNull()) { return element.text(); } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } /*! @@ -75,23 +75,23 @@ QString PaukerDataItem::getText(const QString &tagName) const */ PaukerData::PaukerData() { - document = new QDomDocument(); + document = new TQDomDocument(); } -PaukerDataItemList PaukerData::parse(const QString &fileName) +PaukerDataItemList PaukerData::parse(const TQString &fileName) { PaukerDataItemList list; - QIODevice * file = KFilterDev::deviceForFile(fileName); + TQIODevice * file = KFilterDev::deviceForFile(fileName); document->setContent(file); - QDomNodeList entries = document->elementsByTagName("Card"); + TQDomNodeList entries = document->elementsByTagName("Card"); // loop through the "Card" tags looking for data for(uint i = 0 ; i < entries.count() ; i++) { // get an entry to operate on - QDomElement entry = entries.item(i).toElement(); + TQDomElement entry = entries.item(i).toElement(); // if the "node" is in fact an element -- i.e. not null if(!entry.isNull()) { diff --git a/kwordquiz/src/paukerreader.h b/kwordquiz/src/paukerreader.h index 95a3241c..2049e062 100644 --- a/kwordquiz/src/paukerreader.h +++ b/kwordquiz/src/paukerreader.h @@ -19,39 +19,39 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include class PaukerDataItem { public: PaukerDataItem(); - PaukerDataItem(QDomElement &entry); + PaukerDataItem(TQDomElement &entry); virtual ~PaukerDataItem(); - QString frontSide() const; - QString backSide() const; + TQString frontSide() const; + TQString backSide() const; protected: - QString getText(const QString &tagName) const; + TQString getText(const TQString &tagName) const; private: - QDomElement domElement; + TQDomElement domElement; }; -typedef QValueList PaukerDataItemList; +typedef TQValueList PaukerDataItemList; class PaukerData { public: PaukerData(); - PaukerDataItemList parse(const QString &fileName); + PaukerDataItemList parse(const TQString &fileName); int colWidth(int col); int numRows(); - QString language(int col); + TQString language(int col); private: - QDomDocument* document; + TQDomDocument* document; }; #endif diff --git a/kwordquiz/src/prefcardappearance.cpp b/kwordquiz/src/prefcardappearance.cpp index 165abeab..e2e08f2a 100644 --- a/kwordquiz/src/prefcardappearance.cpp +++ b/kwordquiz/src/prefcardappearance.cpp @@ -9,8 +9,8 @@ // Copyright: See COPYING file that comes with this distribution // // -#include -#include +#include +#include #include #include @@ -18,7 +18,7 @@ #include "prefcardappearance.h" -PrefCardAppearance::PrefCardAppearance(QWidget *parent, const char *name) +PrefCardAppearance::PrefCardAppearance(TQWidget *parent, const char *name) : PrefCardAppearanceBase(parent, name) { widgetStack->raiseWidget(frontStackPage); @@ -37,17 +37,17 @@ void PrefCardAppearance::slotFlipButtonClicked( ) widgetStack->raiseWidget(frontStackPage); } -void PrefCardAppearance::slotFontChanged(const QFont & font) +void PrefCardAppearance::slotFontChanged(const TQFont & font) { textLabel->setFont(font); } -void PrefCardAppearance::slotTextColorChanged( const QColor & color) +void PrefCardAppearance::slotTextColorChanged( const TQColor & color) { textLabel->setPaletteForegroundColor(color); } -void PrefCardAppearance::slotCardColorChanged( const QColor & color) +void PrefCardAppearance::slotCardColorChanged( const TQColor & color) { cardFrame->setPaletteBackgroundColor(color); titleLabel->setPaletteBackgroundColor(color); @@ -55,13 +55,13 @@ void PrefCardAppearance::slotCardColorChanged( const QColor & color) line->setPaletteBackgroundColor(color); } -void PrefCardAppearance::slotFrameColorChanged( const QColor & color) +void PrefCardAppearance::slotFrameColorChanged( const TQColor & color) { cardFrame->setPaletteForegroundColor(color); line->setPaletteForegroundColor(color); } -void PrefCardAppearance::slotAboutToShowWidget(QWidget * widget) +void PrefCardAppearance::slotAboutToShowWidget(TQWidget * widget) { if (widget == backStackPage) { diff --git a/kwordquiz/src/prefcardappearance.h b/kwordquiz/src/prefcardappearance.h index 14c1d70b..b152155c 100644 --- a/kwordquiz/src/prefcardappearance.h +++ b/kwordquiz/src/prefcardappearance.h @@ -21,16 +21,16 @@ class PrefCardAppearance : public PrefCardAppearanceBase { Q_OBJECT public: - PrefCardAppearance(QWidget *parent = 0, const char *name = 0); + PrefCardAppearance(TQWidget *parent = 0, const char *name = 0); ~PrefCardAppearance(); public slots: void slotFlipButtonClicked(); - void slotFontChanged(const QFont &); - void slotTextColorChanged(const QColor &); - void slotCardColorChanged(const QColor &); - void slotFrameColorChanged(const QColor &); - void slotAboutToShowWidget(QWidget *); + void slotFontChanged(const TQFont &); + void slotTextColorChanged(const TQColor &); + void slotCardColorChanged(const TQColor &); + void slotFrameColorChanged(const TQColor &); + void slotAboutToShowWidget(TQWidget *); }; #endif diff --git a/kwordquiz/src/prefcharacter.cpp b/kwordquiz/src/prefcharacter.cpp index 7197b798..7ef819d4 100644 --- a/kwordquiz/src/prefcharacter.cpp +++ b/kwordquiz/src/prefcharacter.cpp @@ -18,7 +18,7 @@ #include "prefcharacter.h" -PrefCharacter::PrefCharacter(QWidget *parent, const char *name) +PrefCharacter::PrefCharacter(TQWidget *parent, const char *name) : PrefCharacterBase(parent, name) { } diff --git a/kwordquiz/src/prefcharacter.h b/kwordquiz/src/prefcharacter.h index c863093e..eb46f2e3 100644 --- a/kwordquiz/src/prefcharacter.h +++ b/kwordquiz/src/prefcharacter.h @@ -28,7 +28,7 @@ class PrefCharacter : public PrefCharacterBase { Q_OBJECT public: - PrefCharacter(QWidget *parent = 0, const char *name = 0); + PrefCharacter(TQWidget *parent = 0, const char *name = 0); ~PrefCharacter(); }; diff --git a/kwordquiz/src/prefeditor.cpp b/kwordquiz/src/prefeditor.cpp index 2ff2a92e..3fc69802 100644 --- a/kwordquiz/src/prefeditor.cpp +++ b/kwordquiz/src/prefeditor.cpp @@ -19,7 +19,7 @@ #include "prefeditor.h" -PrefEditor::PrefEditor(QWidget *parent, const char *name, WFlags f) +PrefEditor::PrefEditor(TQWidget *parent, const char *name, WFlags f) : PrefEditorBase(parent, name, f) { } diff --git a/kwordquiz/src/prefeditor.h b/kwordquiz/src/prefeditor.h index 762e4afe..c84b3364 100644 --- a/kwordquiz/src/prefeditor.h +++ b/kwordquiz/src/prefeditor.h @@ -29,7 +29,7 @@ class PrefEditor : public PrefEditorBase Q_OBJECT public: - PrefEditor(QWidget *parent, const char *name=0, WFlags f=0); + PrefEditor(TQWidget *parent, const char *name=0, WFlags f=0); ~PrefEditor(); }; diff --git a/kwordquiz/src/prefquiz.cpp b/kwordquiz/src/prefquiz.cpp index ebd62cb3..cfb07aae 100644 --- a/kwordquiz/src/prefquiz.cpp +++ b/kwordquiz/src/prefquiz.cpp @@ -16,15 +16,15 @@ Boston, MA 02110-1301, USA. */ -#include -#include +#include +#include #include #include "prefquiz.h" -PrefQuiz::PrefQuiz(QWidget *parent, const char *name, WFlags f) +PrefQuiz::PrefQuiz(TQWidget *parent, const char *name, WFlags f) : PrefQuizBase(parent, name, f) { kcfg_FlipDelay -> setEnabled(kcfg_AutoFlip->isChecked()); diff --git a/kwordquiz/src/prefquiz.h b/kwordquiz/src/prefquiz.h index baee69ac..9d7174c4 100644 --- a/kwordquiz/src/prefquiz.h +++ b/kwordquiz/src/prefquiz.h @@ -29,7 +29,7 @@ class PrefQuiz : public PrefQuizBase Q_OBJECT public: - PrefQuiz(QWidget *parent, const char *name=0, WFlags f=0); + PrefQuiz(TQWidget *parent, const char *name=0, WFlags f=0); ~PrefQuiz(); }; diff --git a/kwordquiz/src/qaview.cpp b/kwordquiz/src/qaview.cpp index 9e4deca9..4660df9f 100644 --- a/kwordquiz/src/qaview.cpp +++ b/kwordquiz/src/qaview.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -27,24 +27,24 @@ #include "prefs.h" #include "kwordquiz.h" -QString highlightError(const QString & c, const QString & e) +TQString highlightError(const TQString & c, const TQString & e) { if (c == e) return c; - QString s = c; + TQString s = c; if (s.left(4) == "" && e.left(4) != "") s = s.mid(4, s.length() - 9); if (s == e) return s; - QString result = ""; + TQString result = ""; int i = 0; while (s[i] == e[i]) result.append(e[i++]); result.append(""); - QString result2 = ""; + TQString result2 = ""; int j = s.length() - 1; int k = e.length() - 1; while (s[j] == e[k] && k > i) @@ -63,7 +63,7 @@ QString highlightError(const QString & c, const QString & e) } -QAView::QAView(QWidget *parent, const char *name, WFlags f):QAViewBase(parent, name, f) +QAView::QAView(TQWidget *parent, const char *name, WFlags f):QAViewBase(parent, name, f) { m_score = new WQScore(); } @@ -90,8 +90,8 @@ void QAView::init() picCorrect -> clear(); picError -> clear(); - QFont f = Prefs::editorFont(); - f.setWeight(QFont::Normal); + TQFont f = Prefs::editorFont(); + f.setWeight(TQFont::Normal); lblQuestion -> setFont(f); //lblQuestion -> font().setBold(false); lblAnswerBlank -> setFont(f); @@ -202,8 +202,8 @@ void QAView::slotCheck() void QAView::slotHint() { - QString answer = txtAnswer->text(); - QString correctAnswer = m_quiz->hint(m_question); + TQString answer = txtAnswer->text(); + TQString correctAnswer = m_quiz->hint(m_question); if (correctAnswer.left(4) == "") { correctAnswer = correctAnswer.remove(""); @@ -242,7 +242,7 @@ void QAView::slotRepeat() void QAView::updateScore() { - QString s; + TQString s; s = s.setNum(m_quiz->questionCount(), 10); lblScoreCount->setText(s); picCount->setPixmap(KGlobal::iconLoader()->loadIcon("kwordquiz", KIcon::Panel)); @@ -278,7 +278,7 @@ void QAView::showQuestion(int i) lblAnswerLanguage -> setText(m_quiz ->langAnswer(i)); - if (!QString(m_quiz ->blankAnswer(i)).isEmpty()) + if (!TQString(m_quiz ->blankAnswer(i)).isEmpty()) { lblAnswerBlank->show(); //lblAnswerBlank->setFont(m_quiz->fontAnswer(i)); @@ -301,14 +301,14 @@ void QAView::slotApplySettings( ) updateScore(); } -void QAView::slotSpecChar( const QChar & c) +void QAView::slotSpecChar( const TQChar & c) { if (txtAnswer->hasFocus()) { if (txtAnswer->hasSelectedText()) { - QString ls = txtAnswer->text(); - QString s = txtAnswer->selectedText(); + TQString ls = txtAnswer->text(); + TQString s = txtAnswer->selectedText(); int len = s.length(); int ss = txtAnswer->selectionStart(); ls = ls.replace(ss, len, c); @@ -317,7 +317,7 @@ void QAView::slotSpecChar( const QChar & c) } else { - QString s = txtAnswer->text(); + TQString s = txtAnswer->text(); int i = txtAnswer->cursorPosition(); s.insert(i, c); txtAnswer->setText(s); diff --git a/kwordquiz/src/qaview.h b/kwordquiz/src/qaview.h index 9ba26fdf..f18567ec 100644 --- a/kwordquiz/src/qaview.h +++ b/kwordquiz/src/qaview.h @@ -33,7 +33,7 @@ class QAView : public QAViewBase { Q_OBJECT public: - QAView(QWidget *parent = 0, const char *name = 0, WFlags f = 0); + QAView(TQWidget *parent = 0, const char *name = 0, WFlags f = 0); ~QAView(); @@ -46,7 +46,7 @@ public slots: void slotRepeat(); void slotRestart(); void slotApplySettings(); - void slotSpecChar(const QChar &); + void slotSpecChar(const TQChar &); private: WQQuiz *m_quiz; diff --git a/kwordquiz/src/wqlreader.cpp b/kwordquiz/src/wqlreader.cpp index 5d60a186..7eef97c7 100644 --- a/kwordquiz/src/wqlreader.cpp +++ b/kwordquiz/src/wqlreader.cpp @@ -14,8 +14,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -27,7 +27,7 @@ KWqlDataItem::KWqlDataItem() } -KWqlDataItem::KWqlDataItem(const QString &front, const QString &back, int height) +KWqlDataItem::KWqlDataItem(const TQString &front, const TQString &back, int height) { m_front = front; m_back = back; @@ -47,15 +47,15 @@ WqlReader::WqlReader() } -KWqlDataItemList WqlReader::parse(const QString &fileName) +KWqlDataItemList WqlReader::parse(const TQString &fileName) { KWqlDataItemList list; - QFile file(fileName); + TQFile file(fileName); file.open(IO_ReadOnly); - QTextStream ts(&file); - ts.setEncoding(QTextStream::Latin1); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::Latin1); - QString s = ""; + TQString s = ""; s=ts.readLine(); if (s != "WordQuiz") { @@ -76,7 +76,7 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) while (ts.readLine() != "[Font Info]"); s = ts.readLine(); int p = s.find("=", 0); - QString fam = s.right(s.length() - (p + 1)); + TQString fam = s.right(s.length() - (p + 1)); fam = fam.mid(1, fam.length() - 2); //g->font().setFamily(s); @@ -91,7 +91,7 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) int b = 0; if (s == "1") { - b = QFont::Bold; + b = TQFont::Bold; } s = ts.readLine(); @@ -99,7 +99,7 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) s = s.right(s.length() - (p + 1)); bool it = (s == "1"); - QFont m_font(fam, ps, b, it); + TQFont m_font(fam, ps, b, it); while (ts.readLine() != "[Character Info]"); s = ts.readLine(); @@ -158,12 +158,12 @@ KWqlDataItemList WqlReader::parse(const QString &fileName) { s = ts.readLine(); p = s.find("[", 0); - QString r = s.mid(p + 1, 10); + TQString r = s.mid(p + 1, 10); int h = r.toInt(0, 10); s = s.left(p); s = s.stripWhiteSpace(); - QString b; + TQString b; b = ts.readLine(); KWqlDataItem item(s, b, h /15); @@ -189,7 +189,7 @@ int WqlReader::colWidth(int col) /*! \fn WqlReader::language(int col) */ -QString WqlReader::language(int col) +TQString WqlReader::language(int col) { if (col == 0) return m_language1; diff --git a/kwordquiz/src/wqlreader.h b/kwordquiz/src/wqlreader.h index 37920f5d..79096956 100644 --- a/kwordquiz/src/wqlreader.h +++ b/kwordquiz/src/wqlreader.h @@ -20,45 +20,45 @@ @author Peter Hedlund */ -#include -#include -#include +#include +#include +#include class KWqlDataItem { public: KWqlDataItem(); - KWqlDataItem(const QString &front, const QString &back, int height); + KWqlDataItem(const TQString &front, const TQString &back, int height); virtual ~KWqlDataItem(); - QString frontText() const {return m_front;} - QString backText() const {return m_back;} + TQString frontText() const {return m_front;} + TQString backText() const {return m_back;} int rowHeight() const {return m_height;} private: - QString m_front; - QString m_back; + TQString m_front; + TQString m_back; int m_height; }; -typedef QValueList KWqlDataItemList; +typedef TQValueList KWqlDataItemList; class WqlReader{ public: WqlReader(); - KWqlDataItemList parse(const QString &fileName); + KWqlDataItemList parse(const TQString &fileName); int colWidth(int col); int numRows() {return m_numRows;} int startCol() {return m_topLeft;} int startRow() {return m_topRight;} int endCol() {return m_bottomLeft;} int endRow() {return m_bottomRight;} - QString language(int col); - QFont font() {return m_font;} - QString specialCharacters() {return m_specialCharacters;} + TQString language(int col); + TQFont font() {return m_font;} + TQString specialCharacters() {return m_specialCharacters;} private: - QFont m_font; + TQFont m_font; int m_colWidth1; int m_colWidth2; int m_numRows; @@ -66,9 +66,9 @@ private: int m_topRight; int m_bottomLeft; int m_bottomRight; - QString m_language1; - QString m_language2; - QString m_specialCharacters; + TQString m_language1; + TQString m_language2; + TQString m_specialCharacters; }; diff --git a/kwordquiz/src/wqlwriter.cpp b/kwordquiz/src/wqlwriter.cpp index 6428036e..e5314201 100644 --- a/kwordquiz/src/wqlwriter.cpp +++ b/kwordquiz/src/wqlwriter.cpp @@ -17,40 +17,40 @@ #define winendl "\r\n" -WqlWriter::WqlWriter(QFile *file) +WqlWriter::WqlWriter(TQFile *file) { outputFile = file; if(outputFile->open(IO_WriteOnly)) { outputStream.setDevice(outputFile); - outputStream.setEncoding(QTextStream::Latin1); + outputStream.setEncoding(TQTextStream::Latin1); outputStream << "WordQuiz" << winendl; outputStream << "5.9.0" << winendl << winendl; } } -void WqlWriter::writeFont( const QFont & font ) +void WqlWriter::writeFont( const TQFont & font ) { outputStream << "[Font Info]" << winendl; outputStream << "FontName1=\"" << font.family() << "\"" << winendl; - outputStream << "FontSize1=" << QString::number(font.pointSize()) << winendl; - outputStream << QString("FontBold1=%1").arg(font.bold() ? "1" : "0") < -#include -#include +#include +#include +#include /** @author Peter Hedlund */ class WqlWriter{ public: - WqlWriter(QFile *file); + WqlWriter(TQFile *file); ~WqlWriter(); - void writeFont(const QFont & font); - void writeCharacters(const QString & s); + void writeFont(const TQFont & font); + void writeCharacters(const TQString & s); void writeGridInfo(int col0, int col1, int col2, int numRows); void writeSelection(int lc, int tr, int rc, int br); - void writeFirstItem(const QString &ll, const QString &rl); - void writeItem(const QString &left, const QString &right, int rh); + void writeFirstItem(const TQString &ll, const TQString &rl); + void writeItem(const TQString &left, const TQString &right, int rh); private: - QFile *outputFile; - QTextStream outputStream; + TQFile *outputFile; + TQTextStream outputStream; }; #endif diff --git a/kwordquiz/src/wqprintdialogpage.cpp b/kwordquiz/src/wqprintdialogpage.cpp index 2e5710d1..e9baebcc 100644 --- a/kwordquiz/src/wqprintdialogpage.cpp +++ b/kwordquiz/src/wqprintdialogpage.cpp @@ -16,41 +16,41 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include "wqprintdialogpage.h" -WQPrintDialogPage::WQPrintDialogPage(QWidget *parent, const char *name ) +WQPrintDialogPage::WQPrintDialogPage(TQWidget *parent, const char *name ) : KPrintDialogPage( parent, name ) { setTitle(i18n("Vocabulary Options")); - QGridLayout * l = new QGridLayout( this, 1, 1, 11, 6); + TQGridLayout * l = new TQGridLayout( this, 1, 1, 11, 6); - g = new QButtonGroup(i18n("Select Type of Printout"), this ); + g = new TQButtonGroup(i18n("Select Type of Printout"), this ); g->setColumnLayout(0, Qt::Vertical ); g->layout()->setSpacing( 6 ); g->layout()->setMargin( 11 ); - QGridLayout * v = new QGridLayout( g->layout() ); + TQGridLayout * v = new TQGridLayout( g->layout() ); v->setAlignment( Qt::AlignTop ); - rb0 = new QRadioButton(i18n("Vocabulary &list"), g ); + rb0 = new TQRadioButton(i18n("Vocabulary &list"), g ); v->addWidget( rb0, 0, 0 ); - rb1 = new QRadioButton(i18n("Vocabulary e&xam"), g); + rb1 = new TQRadioButton(i18n("Vocabulary e&xam"), g); v->addWidget( rb1, 1, 0 ); - rb2 = new QRadioButton(i18n("&Flashcards"), g); + rb2 = new TQRadioButton(i18n("&Flashcards"), g); v->addWidget( rb2, 2, 0 ); l->addWidget( g, 0, 0 ); - QWhatsThis::add(g, i18n("Specify type of printout to make")); - QWhatsThis::add(rb0, i18n("Select to print the vocabulary as displayed in the editor")); - QWhatsThis::add(rb1, i18n("Select to print the vocabulary as a vocabulary exam")); - QWhatsThis::add(rb2, i18n("Select to print flashcards")); + TQWhatsThis::add(g, i18n("Specify type of printout to make")); + TQWhatsThis::add(rb0, i18n("Select to print the vocabulary as displayed in the editor")); + TQWhatsThis::add(rb1, i18n("Select to print the vocabulary as a vocabulary exam")); + TQWhatsThis::add(rb2, i18n("Select to print flashcards")); } @@ -58,14 +58,14 @@ WQPrintDialogPage::~WQPrintDialogPage() { } -void WQPrintDialogPage::getOptions(QMap< QString, QString > & opts, bool incldef) +void WQPrintDialogPage::getOptions(TQMap< TQString, TQString > & opts, bool incldef) { - opts[ "kde-kwordquiz-type" ] = QString::number(g->selectedId()); + opts[ "kde-kwordquiz-type" ] = TQString::number(g->selectedId()); } -void WQPrintDialogPage::setOptions(const QMap< QString, QString > & opts ) +void WQPrintDialogPage::setOptions(const TQMap< TQString, TQString > & opts ) { - QString type = opts[ "kde-kwordquiz-type" ]; + TQString type = opts[ "kde-kwordquiz-type" ]; switch (type.toInt()) { case 0: rb0->setChecked(true); break; @@ -74,7 +74,7 @@ void WQPrintDialogPage::setOptions(const QMap< QString, QString > & opts ) } } -bool WQPrintDialogPage::isValid(const QString & msg ) +bool WQPrintDialogPage::isValid(const TQString & msg ) { return true; } diff --git a/kwordquiz/src/wqprintdialogpage.h b/kwordquiz/src/wqprintdialogpage.h index a7834241..3a52aa6e 100644 --- a/kwordquiz/src/wqprintdialogpage.h +++ b/kwordquiz/src/wqprintdialogpage.h @@ -31,19 +31,19 @@ class WQPrintDialogPage : public KPrintDialogPage { Q_OBJECT public: - WQPrintDialogPage( QWidget *parent = 0, const char *name = 0 ); + WQPrintDialogPage( TQWidget *parent = 0, const char *name = 0 ); ~WQPrintDialogPage(); //reimplement virtual functions - void getOptions(QMap& opts, bool incldef = false); - void setOptions(const QMap& opts); - bool isValid(const QString& msg ); + void getOptions(TQMap& opts, bool incldef = false); + void setOptions(const TQMap& opts); + bool isValid(const TQString& msg ); private: - QButtonGroup * g; - QRadioButton * rb0; - QRadioButton * rb1; - QRadioButton * rb2; + TQButtonGroup * g; + TQRadioButton * rb0; + TQRadioButton * rb1; + TQRadioButton * rb2; }; #endif diff --git a/kwordquiz/src/wqquiz.cpp b/kwordquiz/src/wqquiz.cpp index 23399e5e..23600567 100644 --- a/kwordquiz/src/wqquiz.cpp +++ b/kwordquiz/src/wqquiz.cpp @@ -18,12 +18,12 @@ #include -#include +#include #include "wqquiz.h" #include "prefs.h" -WQQuiz::WQQuiz(KWordQuizView * parent, const char *name) : QObject(parent, name) +WQQuiz::WQQuiz(KWordQuizView * parent, const char *name) : TQObject(parent, name) { m_table = parent; @@ -68,7 +68,7 @@ void WQQuiz::addToList(int aCol, int bCol) { //build a list of row numbers containing text in both columns - typedef QValueList IntList; + typedef TQValueList IntList; IntList tempList; for (int current = 0; current < m_table ->numRows(); ++current) { @@ -198,7 +198,7 @@ bool WQQuiz::init() void WQQuiz::listRandom() { - QPtrList list; + TQPtrList list; for(int i = 0; i < m_quizList.count(); i++) list.append((void*) i); @@ -216,7 +216,7 @@ void WQQuiz::listRandom() m_quizList.append(items[i]); } -bool WQQuiz::checkAnswer(int i, const QString & a) +bool WQQuiz::checkAnswer(int i, const TQString & a) { bool result = false; WQListItem li = m_list[i]; @@ -229,23 +229,23 @@ bool WQQuiz::checkAnswer(int i, const QString & a) { j= 0; } - QString ans = a; - QString tTemp = m_table -> text(li.oneOp(), j); + TQString ans = a; + TQString tTemp = m_table -> text(li.oneOp(), j); tTemp = tTemp.stripWhiteSpace(); ans = ans.stripWhiteSpace(); if (m_quizType == qtQA) { - if (QString(m_correctBlank).length() > 0) + if (TQString(m_correctBlank).length() > 0) { - QStringList la, ls; + TQStringList la, ls; if (ans.find(";") > 0) - ls = QStringList::split(";", ans); + ls = TQStringList::split(";", ans); else ls.append(ans); if (m_correctBlank.find(";") > 0) - la = QStringList::split(";", m_correctBlank); + la = TQStringList::split(";", m_correctBlank); else la.append(m_correctBlank); @@ -292,15 +292,15 @@ bool WQQuiz::checkAnswer(int i, const QString & a) return result; } -QStringList WQQuiz::multiOptions(int i) +TQStringList WQQuiz::multiOptions(int i) { - QString *s; - QStringList Result; + TQString *s; + TQStringList Result; WQListItem li = m_list[i]; - typedef QPtrList LS; + typedef TQPtrList LS; LS *ls; - ls = new QPtrList(); + ls = new TQPtrList(); int j; if (li.question() == 0) @@ -312,7 +312,7 @@ QStringList WQQuiz::multiOptions(int i) j= 0; } - s= new QString(m_table->text(li.oneOp(), j)); + s= new TQString(m_table->text(li.oneOp(), j)); if (Prefs::enableBlanks()) { s->remove("["); @@ -320,7 +320,7 @@ QStringList WQQuiz::multiOptions(int i) } ls->append(s); - s = new QString(m_table->text(li.twoOp(), j)); + s = new TQString(m_table->text(li.twoOp(), j)); if (Prefs::enableBlanks()) { s->remove("["); @@ -328,7 +328,7 @@ QStringList WQQuiz::multiOptions(int i) } ls->append(s); - s = new QString(m_table->text(li.threeOp(), j)); + s = new TQString(m_table->text(li.threeOp(), j)); if (Prefs::enableBlanks()) { s->remove("["); @@ -347,9 +347,9 @@ QStringList WQQuiz::multiOptions(int i) return Result; } -QString WQQuiz::quizIcon(int i, QuizIcon ico) +TQString WQQuiz::quizIcon(int i, QuizIcon ico) { - QString s; + TQString s; WQListItem li = m_list[i]; if (ico == qiLeftCol) { @@ -369,16 +369,16 @@ QString WQQuiz::quizIcon(int i, QuizIcon ico) return s; } -QString WQQuiz::yourAnswer(int i, const QString & s) +TQString WQQuiz::yourAnswer(int i, const TQString & s) { - QString result =""; + TQString result =""; - if (QString(m_answerBlank).length() > 0) + if (TQString(m_answerBlank).length() > 0) { - QStringList ls; + TQStringList ls; if (s.find(";") > 0) - ls = QStringList::split(";", s, true); + ls = TQStringList::split(";", s, true); else ls.append(s); @@ -405,9 +405,9 @@ QString WQQuiz::yourAnswer(int i, const QString & s) return result; } -QString WQQuiz::hint(int i) +TQString WQQuiz::hint(int i) { - if (QString(m_correctBlank).length() > 0) + if (TQString(m_correctBlank).length() > 0) { return m_correctBlank; } @@ -428,10 +428,10 @@ void WQQuiz::setQuizMode(int qm) } -QString WQQuiz::question(int i) +TQString WQQuiz::question(int i) { WQListItem li = m_list[i]; - QString s = m_table->text(li.oneOp(), li.question()); + TQString s = m_table->text(li.oneOp(), li.question()); if (Prefs::enableBlanks()) { s.remove("["); @@ -448,13 +448,13 @@ QString WQQuiz::question(int i) return s; } -QString WQQuiz::blankAnswer(int i) +TQString WQQuiz::blankAnswer(int i) { - QString r = ""; + TQString r = ""; m_correctBlank = ""; m_answerBlank = ""; - QString tTemp; + TQString tTemp; if (m_quizType == qtQA && Prefs::enableBlanks()) { @@ -470,7 +470,7 @@ QString WQQuiz::blankAnswer(int i) } tTemp = m_table->text(li.oneOp(), j); r = tTemp; - QRegExp rx; + TQRegExp rx; rx.setMinimal(true); rx.setPattern("\\[.*\\]"); @@ -497,9 +497,9 @@ QString WQQuiz::blankAnswer(int i) return m_answerBlank; } -QString WQQuiz::answer(int i) +TQString WQQuiz::answer(int i) { - QString s; + TQString s; WQListItem li = m_list[i]; int j; if (li.question() == 0) @@ -535,13 +535,13 @@ QString WQQuiz::answer(int i) return s; } -QString WQQuiz::langQuestion(int i) +TQString WQQuiz::langQuestion(int i) { WQListItem li = m_list[i]; return m_table->horizontalHeader()->label(li.question()); } -QString WQQuiz::langAnswer(int i) +TQString WQQuiz::langAnswer(int i) { WQListItem li = m_list[i]; diff --git a/kwordquiz/src/wqquiz.h b/kwordquiz/src/wqquiz.h index 94f77f4f..d86c9fa0 100644 --- a/kwordquiz/src/wqquiz.h +++ b/kwordquiz/src/wqquiz.h @@ -19,7 +19,7 @@ #ifndef WQQUIZ_H #define WQQUIZ_H -#include +#include #include "wqlistitem.h" #include "kwordquizview.h" @@ -28,7 +28,7 @@ @author Peter Hedlund */ -typedef QValueList QuizList; +typedef TQValueList QuizList; class WQQuiz : public QObject { @@ -44,11 +44,11 @@ class WQQuiz : public QObject bool init(); void finish(); - bool checkAnswer(int i, const QString & ); - QStringList multiOptions(int i); - QString quizIcon(int i, QuizIcon ico); - QString yourAnswer(int i, const QString & s); - QString hint(int i); + bool checkAnswer(int i, const TQString & ); + TQStringList multiOptions(int i); + TQString quizIcon(int i, QuizIcon ico); + TQString yourAnswer(int i, const TQString & s); + TQString hint(int i); QuizType quizType() const {return m_quizType;} void setQuizType(QuizType qt); @@ -57,11 +57,11 @@ class WQQuiz : public QObject void setQuizMode(int qm); int questionCount(); - QString question(int i); - QString blankAnswer(int i); - QString answer(int i); - QString langQuestion(int i); - QString langAnswer(int i); + TQString question(int i); + TQString blankAnswer(int i); + TQString answer(int i); + TQString langQuestion(int i); + TQString langAnswer(int i); int kbAnswer(int i); @@ -77,8 +77,8 @@ class WQQuiz : public QObject QuizList m_quizList; QuizType m_quizType; - QString m_correctBlank; - QString m_answerBlank; + TQString m_correctBlank; + TQString m_answerBlank; void addToList(int aCol, int bCol); void listRandom(); diff --git a/kwordquiz/src/wqscore.cpp b/kwordquiz/src/wqscore.cpp index 420a002d..80cb3960 100644 --- a/kwordquiz/src/wqscore.cpp +++ b/kwordquiz/src/wqscore.cpp @@ -58,9 +58,9 @@ void WQScore::countIncrement(CountDirection d) /*! \fn WQScore::answerText() */ -QString WQScore::answerText() +TQString WQScore::answerText() { - QString s; + TQString s; if (m_percent) { float f = ((m_answerCount * 100.0) / m_questionCount); @@ -82,9 +82,9 @@ QString WQScore::answerText() /*! \fn WQScore::correctText() */ -QString WQScore::correctText() +TQString WQScore::correctText() { - QString s; + TQString s; if (m_percent) { if (m_correct > 0) @@ -104,9 +104,9 @@ QString WQScore::correctText() /*! \fn WQScore::errorText() */ -QString WQScore::errorText() +TQString WQScore::errorText() { - QString s; + TQString s; if (m_percent) { if (m_error > 0) @@ -126,9 +126,9 @@ QString WQScore::errorText() /*! \fn WQScore::valueToString(int i) */ -QString WQScore::valueToString(int i) +TQString WQScore::valueToString(int i) { - QString s = ""; //return empty string for 0 + TQString s = ""; //return empty string for 0 if (i > 0) s = s.setNum(i, 10); diff --git a/kwordquiz/src/wqscore.h b/kwordquiz/src/wqscore.h index 6e493c58..46c4651d 100644 --- a/kwordquiz/src/wqscore.h +++ b/kwordquiz/src/wqscore.h @@ -17,7 +17,7 @@ #ifndef WQSCORE_H #define WQSCORE_H -#include +#include /** @author Peter Hedlund @@ -33,9 +33,9 @@ public: void setQuestionCount(int c); void countIncrement(CountDirection d); - QString answerText(); - QString correctText(); - QString errorText(); + TQString answerText(); + TQString correctText(); + TQString errorText(); private: @@ -44,7 +44,7 @@ private: int m_error; int m_correct; int m_answerCount; - QString valueToString(int i); + TQString valueToString(int i); }; #endif diff --git a/kwordquiz/src/wqundo.h b/kwordquiz/src/wqundo.h index cc30425c..d9b5e9c7 100644 --- a/kwordquiz/src/wqundo.h +++ b/kwordquiz/src/wqundo.h @@ -16,7 +16,7 @@ #ifndef WQUNDO_H #define WQUNDO_H -#include +#include #include "wqlreader.h" @@ -25,8 +25,8 @@ */ class WQUndo{ public: - QFont font() const {return m_font;} - void setFont(const QFont & font) {m_font = font;} + TQFont font() const {return m_font;} + void setFont(const TQFont & font) {m_font = font;} int colWidth0() {return m_colWidth0;} void setColWidth0(int cw) {m_colWidth0 = cw;} @@ -41,27 +41,27 @@ public: void setCurrentRow(int r) {m_currentRow = r;} int currentCol() {return m_currentCol;} void setCurrentCol(int c) {m_currentCol = c;} - QTableSelection selection() const {return m_selection;} - void setSelection(const QTableSelection & sel) {m_selection = sel;} + TQTableSelection selection() const {return m_selection;} + void setSelection(const TQTableSelection & sel) {m_selection = sel;} KWqlDataItemList list() const {return m_list;} void setList(const KWqlDataItemList & list) {m_list = list;} - QString text() const {return m_text;} - void setText(const QString & s) {m_text = s;} + TQString text() const {return m_text;} + void setText(const TQString & s) {m_text = s;} private: - QFont m_font; + TQFont m_font; int m_colWidth0; int m_colWidth1; int m_colWidth2; int m_numRows; int m_currentRow; int m_currentCol; - QTableSelection m_selection; + TQTableSelection m_selection; KWqlDataItemList m_list; - QString m_text; + TQString m_text; }; #endif diff --git a/libkdeedu/extdate/extcalendarsystem.cpp b/libkdeedu/extdate/extcalendarsystem.cpp index f5cd0a36..f453bb6f 100644 --- a/libkdeedu/extdate/extcalendarsystem.cpp +++ b/libkdeedu/extdate/extcalendarsystem.cpp @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from ExtCalendarSystem; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -57,9 +57,9 @@ const KLocale * ExtCalendarSystem::locale() const return KGlobal::locale(); } -QString ExtCalendarSystem::dayString(const ExtDate & pDate, bool bShort) const +TQString ExtCalendarSystem::dayString(const ExtDate & pDate, bool bShort) const { - QString sResult; + TQString sResult; sResult.setNum(day(pDate)); if (!bShort && sResult.length() == 1 ) @@ -68,9 +68,9 @@ QString ExtCalendarSystem::dayString(const ExtDate & pDate, bool bShort) const return sResult; } -QString ExtCalendarSystem::monthString(const ExtDate & pDate, bool bShort) const +TQString ExtCalendarSystem::monthString(const ExtDate & pDate, bool bShort) const { - QString sResult; + TQString sResult; sResult.setNum(month(pDate)); if (!bShort && sResult.length() == 1 ) @@ -79,9 +79,9 @@ QString ExtCalendarSystem::monthString(const ExtDate & pDate, bool bShort) const return sResult; } -QString ExtCalendarSystem::yearString(const ExtDate & pDate, bool bShort) const +TQString ExtCalendarSystem::yearString(const ExtDate & pDate, bool bShort) const { - QString sResult; + TQString sResult; sResult.setNum(year(pDate)); if (bShort && sResult.length() == 4 ) @@ -90,7 +90,7 @@ QString ExtCalendarSystem::yearString(const ExtDate & pDate, bool bShort) const return sResult; } -static int stringToInteger(const QString & sNum, int & iLength) +static int stringToInteger(const TQString & sNum, int & iLength) { unsigned int iPos = 0; @@ -106,22 +106,22 @@ static int stringToInteger(const QString & sNum, int & iLength) } -int ExtCalendarSystem::dayStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystem::dayStringToInteger(const TQString & sNum, int & iLength) const { return stringToInteger(sNum, iLength); } -int ExtCalendarSystem::monthStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystem::monthStringToInteger(const TQString & sNum, int & iLength) const { return stringToInteger(sNum, iLength); } -int ExtCalendarSystem::yearStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystem::yearStringToInteger(const TQString & sNum, int & iLength) const { return stringToInteger(sNum, iLength); } -QString ExtCalendarSystem::weekDayName (int weekDay, bool shortName) const +TQString ExtCalendarSystem::weekDayName (int weekDay, bool shortName) const { if ( shortName ) switch ( weekDay ) @@ -146,6 +146,6 @@ QString ExtCalendarSystem::weekDayName (int weekDay, bool shortName) const case 7: return locale()->translate("Sunday"); } - return QString::null; + return TQString::null; } diff --git a/libkdeedu/extdate/extcalendarsystem.h b/libkdeedu/extdate/extcalendarsystem.h index 5007ba90..be7ba336 100644 --- a/libkdeedu/extdate/extcalendarsystem.h +++ b/libkdeedu/extdate/extcalendarsystem.h @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from KCalendarSystem; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -73,7 +73,7 @@ public: * @param bShort If the short version of should be used * @return The year literal of the date */ - virtual QString yearString(const ExtDate & pDate, bool bShort) const; + virtual TQString yearString(const ExtDate & pDate, bool bShort) const; /** * Converts a year literal of a part of a string into a integer starting at the beginning of the string @@ -82,7 +82,7 @@ public: * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string * @return An integer corresponding to the year */ - virtual int yearStringToInteger(const QString & sNum, int & iLength) const; + virtual int yearStringToInteger(const TQString & sNum, int & iLength) const; /** * Gets specific calendar type month for a given gregorian date @@ -99,7 +99,7 @@ public: * @param bShort If the short version of should be used * @return The month literal of the date */ - virtual QString monthString(const ExtDate & pDate, bool bShort) const; + virtual TQString monthString(const ExtDate & pDate, bool bShort) const; /** * Converts a month literal of a part of a string into a integer starting at the beginning of the string @@ -108,7 +108,7 @@ public: * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string * @return An integer corresponding to the month */ - virtual int monthStringToInteger(const QString & sNum, int & iLength) const; + virtual int monthStringToInteger(const TQString & sNum, int & iLength) const; /** * Gets specific calendar type day number of month for a given date @@ -125,7 +125,7 @@ public: * @param bShort If the short version of should be used * @return The day literal of the date */ - virtual QString dayString(const ExtDate & pDate, bool bShort) const; + virtual TQString dayString(const ExtDate & pDate, bool bShort) const; /** * Converts a day literal of a part of a string into a integer starting at the beginning of the string @@ -134,7 +134,7 @@ public: * @param iLength The number of QChars used, and 0 if no valid symbols was found in the string * @return An integer corresponding to the day */ - virtual int dayStringToInteger(const QString & sNum, int & iLength) const; + virtual int dayStringToInteger(const TQString & sNum, int & iLength) const; /** * Gets specific calendar type number of day of week number for a given @@ -166,7 +166,7 @@ public: virtual bool setYMD(ExtDate & date, int y, int m, int d) const = 0; /** - * Returns a QDate object containing a date nyears later. + * Returns a TQDate object containing a date nyears later. * * @param date The old date * @param nyears The number of years to add @@ -175,7 +175,7 @@ public: virtual ExtDate addYears(const ExtDate & date, int nyears) const = 0; /** - * Returns a QDate object containing a date nmonths later. + * Returns a TQDate object containing a date nmonths later. * * @param date The old date * @param nmonths The number of months to add @@ -184,7 +184,7 @@ public: virtual ExtDate addMonths(const ExtDate & date, int nmonths) const = 0; /** - * Returns a QDate object containing a date ndays later. + * Returns a TQDate object containing a date ndays later. * * @param date The old date * @param ndays The number of days to add @@ -235,14 +235,14 @@ public: /** * Gets specific calendar type month name for a given month number - * If an invalid month is specified, QString::null is returned. + * If an invalid month is specified, TQString::null is returned. * * @param month The month number * @param year The year the month belongs to * @param shortName Specifies if the short month name should be used * @return The name of the month */ - virtual QString monthName (int month, int year, bool shortName = false) const = 0; + virtual TQString monthName (int month, int year, bool shortName = false) const = 0; /** * Gets specific calendar type month name for a given gregorian date @@ -251,13 +251,13 @@ public: * @param shortName Specifies if the short month name should be used * @return The name of the month */ - virtual QString monthName (const ExtDate & date, bool shortName = false ) const = 0; + virtual TQString monthName (const ExtDate & date, bool shortName = false ) const = 0; /** * Returns a string containing the possessive form of the month name. * ("of January", "of February", etc.) * It's needed in long format dates in some languages. - * If an invalid month is specified, QString::null is returned. + * If an invalid month is specified, TQString::null is returned. * * @param month The month number * @param year The year the month belongs to @@ -265,7 +265,7 @@ public: * * @return The possessive form of the name of the month */ - virtual QString monthNamePossessive(int month, int year, bool shortName = false) const = 0; + virtual TQString monthNamePossessive(int month, int year, bool shortName = false) const = 0; /** * Returns a string containing the possessive form of the month name. @@ -277,17 +277,17 @@ public: * * @return The possessive form of the name of the month */ - virtual QString monthNamePossessive(const ExtDate & date, bool shortName = false) const = 0; + virtual TQString monthNamePossessive(const ExtDate & date, bool shortName = false) const = 0; /** * Gets specific calendar type week day name - * If an invalid week day is specified, QString::null is returned. + * If an invalid week day is specified, TQString::null is returned. * * @param weekDay number of day in week (1 -> Monday) * @param shortName short or complete day name * @return day name */ - virtual QString weekDayName (int weekDay, bool shortName = false) const = 0; + virtual TQString weekDayName (int weekDay, bool shortName = false) const = 0; /** * Gets specific calendar type week day name @@ -296,7 +296,7 @@ public: * @param shortName short or complete day name * @return day name */ - virtual QString weekDayName (const ExtDate & date, bool shortName = false) const = 0; + virtual TQString weekDayName (const ExtDate & date, bool shortName = false) const = 0; /** * Gets the first year value supported by specific calendar type @@ -308,7 +308,7 @@ public: /** * Gets the maximum year value supported by specific calendar type - * algorithms (QDate, 8000) + * algorithms (TQDate, 8000) * * @return maximum year supported */ @@ -324,7 +324,7 @@ public: /** * Gets the string representing the calendar */ - virtual QString calendarName() const = 0; + virtual TQString calendarName() const = 0; /** * Gets if the calendar is lunar based diff --git a/libkdeedu/extdate/extcalendarsystemgregorian.cpp b/libkdeedu/extdate/extcalendarsystemgregorian.cpp index d358f595..47338f4b 100644 --- a/libkdeedu/extdate/extcalendarsystemgregorian.cpp +++ b/libkdeedu/extdate/extcalendarsystemgregorian.cpp @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from KCalendarSystemGregorian; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -72,18 +72,18 @@ int ExtCalendarSystemGregorian::weekNumber(const ExtDate& date, return date.weekNumber(yearNum); } -QString ExtCalendarSystemGregorian::monthName(const ExtDate& date, +TQString ExtCalendarSystemGregorian::monthName(const ExtDate& date, bool shortName) const { return monthName(month(date), year(date), shortName); } -QString ExtCalendarSystemGregorian::monthNamePossessive(const ExtDate& date, bool shortName) const +TQString ExtCalendarSystemGregorian::monthNamePossessive(const ExtDate& date, bool shortName) const { return monthNamePossessive(month(date), year(date), shortName); } -QString ExtCalendarSystemGregorian::monthName(int month, int year, bool shortName) const +TQString ExtCalendarSystemGregorian::monthName(int month, int year, bool shortName) const { Q_UNUSED(year); @@ -144,10 +144,10 @@ QString ExtCalendarSystemGregorian::monthName(int month, int year, bool shortNam return locale()->translate("December"); } - return QString::null; + return TQString::null; } -QString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year, +TQString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year, bool shortName) const { Q_UNUSED(year); @@ -209,7 +209,7 @@ QString ExtCalendarSystemGregorian::monthNamePossessive(int month, int year, return locale()->translate("of December"); } - return QString::null; + return TQString::null; } bool ExtCalendarSystemGregorian::setYMD(ExtDate & date, int y, int m, int d) const @@ -233,7 +233,7 @@ ExtDate ExtCalendarSystemGregorian::addDays(const ExtDate & date, int ndays) con return date.addDays(ndays); } -QString ExtCalendarSystemGregorian::weekDayName(int col, bool shortName) const +TQString ExtCalendarSystemGregorian::weekDayName(int col, bool shortName) const { // ### Should this really be different to each calendar system? Or are we // only going to support weeks with 7 days? @@ -241,7 +241,7 @@ QString ExtCalendarSystemGregorian::weekDayName(int col, bool shortName) const return ExtCalendarSystem::weekDayName(col, shortName); } -QString ExtCalendarSystemGregorian::weekDayName(const ExtDate& date, bool shortName) const +TQString ExtCalendarSystemGregorian::weekDayName(const ExtDate& date, bool shortName) const { return weekDayName(dayOfWeek(date), shortName); } @@ -292,9 +292,9 @@ int ExtCalendarSystemGregorian::weekDayOfPray() const return 7; // sunday } -QString ExtCalendarSystemGregorian::calendarName() const +TQString ExtCalendarSystemGregorian::calendarName() const { - return QString::fromLatin1("gregorian"); + return TQString::fromLatin1("gregorian"); } bool ExtCalendarSystemGregorian::isLunar() const @@ -312,7 +312,7 @@ bool ExtCalendarSystemGregorian::isSolar() const return true; } -int ExtCalendarSystemGregorian::yearStringToInteger(const QString & sNum, int & iLength) const +int ExtCalendarSystemGregorian::yearStringToInteger(const TQString & sNum, int & iLength) const { int iYear; iYear = ExtCalendarSystem::yearStringToInteger(sNum, iLength); diff --git a/libkdeedu/extdate/extcalendarsystemgregorian.h b/libkdeedu/extdate/extcalendarsystemgregorian.h index c426f997..6d1035c9 100644 --- a/libkdeedu/extdate/extcalendarsystemgregorian.h +++ b/libkdeedu/extdate/extcalendarsystemgregorian.h @@ -4,7 +4,7 @@ Copyright (c) 2004 Jason Harris This class has been derived from KCalendarSystemGregorian; - the changesd made just replace QDate objects with ExtDate objects. + the changesd made just replace TQDate objects with ExtDate objects. These changes by Jason Harris This library is free software; you can redistribute it and/or @@ -70,20 +70,20 @@ public: virtual int weeksInYear(int year) const; virtual int weekNumber(const ExtDate& date, int * yearNum = 0) const; - virtual int yearStringToInteger(const QString & sNum, int & iLength) const; + virtual int yearStringToInteger(const TQString & sNum, int & iLength) const; - virtual QString monthName (int month, int year, bool shortName = false) const; - virtual QString monthName (const ExtDate & date, bool shortName = false ) const; - virtual QString monthNamePossessive(int month, int year, bool shortName = false) const; - virtual QString monthNamePossessive(const ExtDate & date, bool shortName = false ) const; - virtual QString weekDayName (int weekDay, bool shortName = false) const; - virtual QString weekDayName (const ExtDate & date, bool shortName = false) const; + virtual TQString monthName (int month, int year, bool shortName = false) const; + virtual TQString monthName (const ExtDate & date, bool shortName = false ) const; + virtual TQString monthNamePossessive(int month, int year, bool shortName = false) const; + virtual TQString monthNamePossessive(const ExtDate & date, bool shortName = false ) const; + virtual TQString weekDayName (int weekDay, bool shortName = false) const; + virtual TQString weekDayName (const ExtDate & date, bool shortName = false) const; virtual int minValidYear () const; virtual int maxValidYear () const; virtual int weekDayOfPray () const; - virtual QString calendarName() const; + virtual TQString calendarName() const; virtual bool isLunar() const; virtual bool isLunisolar() const; diff --git a/libkdeedu/extdate/extdatepicker.cpp b/libkdeedu/extdate/extdatepicker.cpp index 22b4ba80..ad524863 100644 --- a/libkdeedu/extdate/extdatepicker.cpp +++ b/libkdeedu/extdate/extdatepicker.cpp @@ -20,11 +20,11 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,10 +48,10 @@ public: void fillWeeksCombo(const ExtDate &date); - QToolButton *closeButton; - QComboBox *selectWeek; - QToolButton *todayButton; - QBoxLayout *navigationLayout; + TQToolButton *closeButton; + TQComboBox *selectWeek; + TQToolButton *todayButton; + TQBoxLayout *navigationLayout; ExtCalendarSystem *calendar; }; @@ -77,26 +77,26 @@ void ExtDatePicker::fillWeeksCombo(const ExtDate &date) for (; day <= lastDay; day = d->calendar->addDays(day, 7 /*calendar->daysOfWeek()*/) ) { int year = 0; - QString week = i18n("Week %1").arg(d->calendar->weekNumber(day, &year)); + TQString week = i18n("Week %1").arg(d->calendar->weekNumber(day, &year)); if ( year != date.year() ) week += "*"; // show that this is a week from a different year d->selectWeek->insertItem(week); } } -ExtDatePicker::ExtDatePicker(QWidget *parent, ExtDate dt, const char *name) - : QFrame(parent,name) +ExtDatePicker::ExtDatePicker(TQWidget *parent, ExtDate dt, const char *name) + : TQFrame(parent,name) { init( dt ); } -ExtDatePicker::ExtDatePicker(QWidget *parent, ExtDate dt, const char *name, WFlags f) - : QFrame(parent,name, f) +ExtDatePicker::ExtDatePicker(TQWidget *parent, ExtDate dt, const char *name, WFlags f) + : TQFrame(parent,name, f) { init( dt ); } -ExtDatePicker::ExtDatePicker( QWidget *parent, const char *name ) - : QFrame(parent,name) +ExtDatePicker::ExtDatePicker( TQWidget *parent, const char *name ) + : TQFrame(parent,name) { init( ExtDate::currentDate() ); } @@ -107,31 +107,31 @@ void ExtDatePicker::init( const ExtDate &dt ) d->calendar = new ExtCalendarSystemGregorian(); - QBoxLayout * topLayout = new QVBoxLayout(this); + TQBoxLayout * topLayout = new TQVBoxLayout(this); - d->navigationLayout = new QHBoxLayout(topLayout); + d->navigationLayout = new TQHBoxLayout(topLayout); d->navigationLayout->addStretch(); - yearBackward = new QToolButton(this); + yearBackward = new TQToolButton(this); yearBackward->setAutoRaise(true); d->navigationLayout->addWidget(yearBackward); - monthBackward = new QToolButton(this); + monthBackward = new TQToolButton(this); monthBackward ->setAutoRaise(true); d->navigationLayout->addWidget(monthBackward); d->navigationLayout->addSpacing(KDialog::spacingHint()); - selectMonth = new QToolButton(this); + selectMonth = new TQToolButton(this); selectMonth ->setAutoRaise(true); d->navigationLayout->addWidget(selectMonth); - selectYear = new QToolButton(this); + selectYear = new TQToolButton(this); selectYear->setToggleButton(true); selectYear->setAutoRaise(true); d->navigationLayout->addWidget(selectYear); d->navigationLayout->addSpacing(KDialog::spacingHint()); - monthForward = new QToolButton(this); + monthForward = new TQToolButton(this); monthForward ->setAutoRaise(true); d->navigationLayout->addWidget(monthForward); - yearForward = new QToolButton(this); + yearForward = new TQToolButton(this); yearForward ->setAutoRaise(true); d->navigationLayout->addWidget(yearForward); d->navigationLayout->addStretch(); @@ -141,22 +141,22 @@ void ExtDatePicker::init( const ExtDate &dt ) table = new ExtDateTable(this); fontsize = KGlobalSettings::generalFont().pointSize(); if (fontsize == -1) - fontsize = QFontInfo(KGlobalSettings::generalFont()).pointSize(); + fontsize = TQFontInfo(KGlobalSettings::generalFont()).pointSize(); fontsize++; // Make a little bigger - d->selectWeek = new QComboBox(false, this); // read only week selection - d->todayButton = new QToolButton(this); + d->selectWeek = new TQComboBox(false, this); // read only week selection + d->todayButton = new TQToolButton(this); d->todayButton->setIconSet(SmallIconSet("today")); - QToolTip::add(yearForward, i18n("Next year")); - QToolTip::add(yearBackward, i18n("Previous year")); - QToolTip::add(monthForward, i18n("Next month")); - QToolTip::add(monthBackward, i18n("Previous month")); - QToolTip::add(d->selectWeek, i18n("Select a week")); - QToolTip::add(selectMonth, i18n("Select a month")); - QToolTip::add(selectYear, i18n("Select a year")); - QToolTip::add(d->todayButton, i18n("Select the current day")); + TQToolTip::add(yearForward, i18n("Next year")); + TQToolTip::add(yearBackward, i18n("Previous year")); + TQToolTip::add(monthForward, i18n("Next month")); + TQToolTip::add(monthBackward, i18n("Previous month")); + TQToolTip::add(d->selectWeek, i18n("Select a week")); + TQToolTip::add(selectMonth, i18n("Select a month")); + TQToolTip::add(selectYear, i18n("Select a year")); + TQToolTip::add(d->todayButton, i18n("Select the current day")); // ----- setFontSize(fontsize); @@ -164,37 +164,37 @@ void ExtDatePicker::init( const ExtDate &dt ) line->installEventFilter( this ); line->setReadOnly( true ); - if ( QApplication::reverseLayout() ) + if ( TQApplication::reverseLayout() ) { - yearForward->setIconSet(BarIconSet(QString::fromLatin1("2leftarrow"))); - yearBackward->setIconSet(BarIconSet(QString::fromLatin1("2rightarrow"))); - monthForward->setIconSet(BarIconSet(QString::fromLatin1("1leftarrow"))); - monthBackward->setIconSet(BarIconSet(QString::fromLatin1("1rightarrow"))); + yearForward->setIconSet(BarIconSet(TQString::fromLatin1("2leftarrow"))); + yearBackward->setIconSet(BarIconSet(TQString::fromLatin1("2rightarrow"))); + monthForward->setIconSet(BarIconSet(TQString::fromLatin1("1leftarrow"))); + monthBackward->setIconSet(BarIconSet(TQString::fromLatin1("1rightarrow"))); } else { - yearForward->setIconSet(BarIconSet(QString::fromLatin1("2rightarrow"))); - yearBackward->setIconSet(BarIconSet(QString::fromLatin1("2leftarrow"))); - monthForward->setIconSet(BarIconSet(QString::fromLatin1("1rightarrow"))); - monthBackward->setIconSet(BarIconSet(QString::fromLatin1("1leftarrow"))); + yearForward->setIconSet(BarIconSet(TQString::fromLatin1("2rightarrow"))); + yearBackward->setIconSet(BarIconSet(TQString::fromLatin1("2leftarrow"))); + monthForward->setIconSet(BarIconSet(TQString::fromLatin1("1rightarrow"))); + monthBackward->setIconSet(BarIconSet(TQString::fromLatin1("1leftarrow"))); } - connect(table, SIGNAL(dateChanged(const ExtDate&)), SLOT(dateChangedSlot(const ExtDate&))); - connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); - connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); - connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); - connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); - connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); - connect(d->selectWeek, SIGNAL(activated(int)), SLOT(weekSelected(int))); - connect(d->todayButton, SIGNAL(clicked()), SLOT(todayButtonClicked())); - connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); - connect(selectYear, SIGNAL(toggled(bool)), SLOT(selectYearClicked())); - connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); + connect(table, TQT_SIGNAL(dateChanged(const ExtDate&)), TQT_SLOT(dateChangedSlot(const ExtDate&))); + connect(table, TQT_SIGNAL(tableClicked()), TQT_SLOT(tableClickedSlot())); + connect(monthForward, TQT_SIGNAL(clicked()), TQT_SLOT(monthForwardClicked())); + connect(monthBackward, TQT_SIGNAL(clicked()), TQT_SLOT(monthBackwardClicked())); + connect(yearForward, TQT_SIGNAL(clicked()), TQT_SLOT(yearForwardClicked())); + connect(yearBackward, TQT_SIGNAL(clicked()), TQT_SLOT(yearBackwardClicked())); + connect(d->selectWeek, TQT_SIGNAL(activated(int)), TQT_SLOT(weekSelected(int))); + connect(d->todayButton, TQT_SIGNAL(clicked()), TQT_SLOT(todayButtonClicked())); + connect(selectMonth, TQT_SIGNAL(clicked()), TQT_SLOT(selectMonthClicked())); + connect(selectYear, TQT_SIGNAL(toggled(bool)), TQT_SLOT(selectYearClicked())); + connect(line, TQT_SIGNAL(returnPressed()), TQT_SLOT(lineEnterPressed())); table->setFocus(); topLayout->addWidget(table); - QBoxLayout * bottomLayout = new QHBoxLayout(topLayout); + TQBoxLayout * bottomLayout = new TQHBoxLayout(topLayout); bottomLayout->addWidget(d->todayButton); bottomLayout->addWidget(line); bottomLayout->addWidget(d->selectWeek); @@ -209,28 +209,28 @@ ExtDatePicker::~ExtDatePicker() } bool -ExtDatePicker::eventFilter(QObject *o, QEvent *e ) +ExtDatePicker::eventFilter(TQObject *o, TQEvent *e ) { - if ( e->type() == QEvent::KeyPress ) { - QKeyEvent *k = (QKeyEvent *)e; + if ( e->type() == TQEvent::KeyPress ) { + TQKeyEvent *k = (TQKeyEvent *)e; if ( (k->key() == Qt::Key_Prior) || (k->key() == Qt::Key_Next) || (k->key() == Qt::Key_Up) || (k->key() == Qt::Key_Down) ) { - QApplication::sendEvent( table, e ); + TQApplication::sendEvent( table, e ); table->setFocus(); return true; // eat event } } - return QFrame::eventFilter( o, e ); + return TQFrame::eventFilter( o, e ); } void -ExtDatePicker::resizeEvent(QResizeEvent* e) +ExtDatePicker::resizeEvent(TQResizeEvent* e) { - QWidget::resizeEvent(e); + TQWidget::resizeEvent(e); } void @@ -353,14 +353,14 @@ ExtDatePicker::selectMonthClicked() ExtDate date = table->getDate(); int i, month, months = d->calendar->monthsInYear(date); - QPopupMenu popup(selectMonth); + TQPopupMenu popup(selectMonth); for (i = 1; i <= months; i++) popup.insertItem(d->calendar->monthName(i, d->calendar->year(date)), i); popup.setActiveItem(d->calendar->month(date) - 1); - if ( (month = popup.exec(selectMonth->mapToGlobal(QPoint(0, 0)), d->calendar->month(date) - 1)) == -1 ) return; // canceled + if ( (month = popup.exec(selectMonth->mapToGlobal(TQPoint(0, 0)), d->calendar->month(date) - 1)) == -1 ) return; // canceled int day = d->calendar->day(date); // ----- construct a valid date in this month: @@ -377,7 +377,7 @@ ExtDatePicker::selectYearClicked() { // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); - if (selectYear->state() == QButton::Off) + if (selectYear->state() == TQButton::Off) { return; } @@ -388,9 +388,9 @@ ExtDatePicker::selectYearClicked() // ----- picker->resize(picker->sizeHint()); popup->setMainWidget(picker); - connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); + connect(picker, TQT_SIGNAL(closeMe(int)), popup, TQT_SLOT(close(int))); picker->setFocus(); - if(popup->exec(selectYear->mapToGlobal(QPoint(0, selectMonth->height())))) + if(popup->exec(selectYear->mapToGlobal(TQPoint(0, selectMonth->height())))) { ExtDate date; int day; @@ -414,7 +414,7 @@ ExtDatePicker::selectYearClicked() void ExtDatePicker::setEnabled(bool enable) { - QWidget *widgets[]= { + TQWidget *widgets[]= { yearForward, yearBackward, monthForward, monthBackward, selectMonth, selectYear, line, table, d->selectWeek, d->todayButton }; @@ -432,7 +432,7 @@ ExtDatePicker::lineEnterPressed() { ExtDate temp; // ----- - if(val->date(line->text(), temp)==QValidator::Acceptable) + if(val->date(line->text(), temp)==TQValidator::Acceptable) { kdDebug(298) << "ExtDatePicker::lineEnterPressed: valid date entered." << endl; emit(dateEntered(temp)); @@ -452,13 +452,13 @@ ExtDatePicker::todayButtonClicked() QSize ExtDatePicker::sizeHint() const { - return QWidget::sizeHint(); + return TQWidget::sizeHint(); } void ExtDatePicker::setFontSize(int s) { - QWidget *buttons[]= { + TQWidget *buttons[]= { // yearBackward, // monthBackward, selectMonth, @@ -468,8 +468,8 @@ ExtDatePicker::setFontSize(int s) }; const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); int count; - QFont font; - QRect r; + TQFont font; + TQRect r; // ----- fontsize=s; for(count=0; countsetFont(font); } - QFontMetrics metrics(selectMonth->fontMetrics()); + TQFontMetrics metrics(selectMonth->fontMetrics()); for (int i = 1; ; ++i) { - QString str = d->calendar->monthName(i, + TQString str = d->calendar->monthName(i, d->calendar->year(table->getDate()), false); if (str.isNull()) break; r=metrics.boundingRect(str); @@ -490,7 +490,7 @@ ExtDatePicker::setFontSize(int s) maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); } - QSize metricBound = style().sizeFromContents(QStyle::CT_ToolButton, + TQSize metricBound = style().sizeFromContents(TQStyle::CT_ToolButton, selectMonth, maxMonthRect); selectMonth->setMinimumSize(metricBound); @@ -505,14 +505,14 @@ ExtDatePicker::setCloseButton( bool enable ) return; if ( enable ) { - d->closeButton = new QToolButton( this ); + d->closeButton = new TQToolButton( this ); d->closeButton->setAutoRaise(true); d->navigationLayout->addSpacing(KDialog::spacingHint()); d->navigationLayout->addWidget(d->closeButton); - QToolTip::add(d->closeButton, i18n("Close")); + TQToolTip::add(d->closeButton, i18n("Close")); d->closeButton->setPixmap( SmallIcon("remove") ); - connect( d->closeButton, SIGNAL( clicked() ), - topLevelWidget(), SLOT( close() ) ); + connect( d->closeButton, TQT_SIGNAL( clicked() ), + topLevelWidget(), TQT_SLOT( close() ) ); } else { delete d->closeButton; diff --git a/libkdeedu/extdate/extdatepicker.h b/libkdeedu/extdate/extdatepicker.h index 58fae58a..732ff7e1 100644 --- a/libkdeedu/extdate/extdatepicker.h +++ b/libkdeedu/extdate/extdatepicker.h @@ -60,7 +60,7 @@ public: /** The usual constructor. The given date will be displayed * initially. **/ - ExtDatePicker(QWidget *parent=0, + ExtDatePicker(TQWidget *parent=0, ExtDate=ExtDate::currentDate(), const char *name=0); @@ -68,7 +68,7 @@ public: * initially. * @since 3.1 **/ - ExtDatePicker(QWidget *parent, + ExtDatePicker(TQWidget *parent, ExtDate, const char *name, WFlags f); // ### KDE 4.0: Merge @@ -78,7 +78,7 @@ public: * current date. * @since 3.1 */ - ExtDatePicker( QWidget *parent, const char *name ); + ExtDatePicker( TQWidget *parent, const char *name ); /** * The destructor. @@ -91,7 +91,7 @@ public: * size hint, try adding 28 to each of the reported numbers of * pixels. **/ - QSize sizeHint() const; + TQSize sizeHint() const; /** * Sets the date. @@ -153,22 +153,22 @@ public: bool hasCloseButton() const; protected: - /// to catch move keyEvents when QLineEdit has keyFocus - virtual bool eventFilter(QObject *o, QEvent *e ); + /// to catch move keyEvents when TQLineEdit has keyFocus + virtual bool eventFilter(TQObject *o, TQEvent *e ); /// the resize event - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); /// the year forward button - QToolButton *yearForward; + TQToolButton *yearForward; /// the year backward button - QToolButton *yearBackward; + TQToolButton *yearBackward; /// the month forward button - QToolButton *monthForward; + TQToolButton *monthForward; /// the month backward button - QToolButton *monthBackward; + TQToolButton *monthBackward; /// the button for selecting the month directly - QToolButton *selectMonth; + TQToolButton *selectMonth; /// the button for selecting the year directly - QToolButton *selectYear; + TQToolButton *selectYear; /// the line edit to enter the date directly KLineEdit *line; /// the validator for the line edit: @@ -176,9 +176,9 @@ protected: /// the date table ExtDateTable *table; /// the size calculated during resize events - // QSize sizehint; + // TQSize sizehint; /// the widest month string in pixels: - QSize maxMonthRect; + TQSize maxMonthRect; protected slots: void dateChangedSlot(const ExtDate&); void tableClickedSlot(); diff --git a/libkdeedu/extdate/extdatetbl.cpp b/libkdeedu/extdate/extdatetbl.cpp index 43a33a76..ca403a68 100644 --- a/libkdeedu/extdate/extdatetbl.cpp +++ b/libkdeedu/extdate/extdatetbl.cpp @@ -5,7 +5,7 @@ (C) 2004 Jason Harris (jharris@30doradus.org) These classes has been derived from those in kdatetbl.[h|cpp]. - The only differences are adaptations to use ExtDate instead of QDate, + The only differences are adaptations to use ExtDate instead of TQDate, to allow for more remote dates. These changes by Jason Harris. This library is free software; you can redistribute it and/or @@ -47,8 +47,8 @@ #include #include #include "kpopupmenu.h" -#include -#include +#include +#include #include @@ -73,30 +73,30 @@ public: struct DatePaintingMode { - QColor fgColor; - QColor bgColor; + TQColor fgColor; + TQColor bgColor; BackgroundMode bgMode; }; - QDict customPaintingModes; + TQDict customPaintingModes; ExtCalendarSystem *calendar; }; -ExtDateValidator::ExtDateValidator(QWidget* parent, const char* name) - : QValidator(parent, name) +ExtDateValidator::ExtDateValidator(TQWidget* parent, const char* name) + : TQValidator(parent, name) { } -QValidator::State -ExtDateValidator::validate(QString& text, int&) const +TQValidator::State +ExtDateValidator::validate(TQString& text, int&) const { ExtDate temp; // ----- everything is tested in date(): return date(text, temp); } -QValidator::State -ExtDateValidator::date(const QString& text, ExtDate& ed) const +TQValidator::State +ExtDateValidator::date(const TQString& text, ExtDate& ed) const { //FIXME: Can't uncomment unless ExtDate is adopted by KDE //ExtDate tmp = KGlobal::locale()->readDate(text); @@ -111,13 +111,13 @@ ExtDateValidator::date(const QString& text, ExtDate& ed) const } void -ExtDateValidator::fixup( QString& ) const +ExtDateValidator::fixup( TQString& ) const { } -ExtDateTable::ExtDateTable(QWidget *parent, ExtDate date_, const char* name, WFlags f) - : QGridView(parent, name, f) +ExtDateTable::ExtDateTable(TQWidget *parent, ExtDate date_, const char* name, WFlags f) + : TQGridView(parent, name, f) { d = new ExtDateTablePrivate; setFontSize(10); @@ -126,7 +126,7 @@ ExtDateTable::ExtDateTable(QWidget *parent, ExtDate date_, const char* name, WFl kdDebug() << "ExtDateTable ctor: WARNING: Given date is invalid, using current date." << endl; date_=ExtDate::currentDate(); } - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( TQWidget::StrongFocus ); setNumRows(7); // 6 weeks max + headline setNumCols(7); // 7 days a week setHScrollBarMode(AlwaysOff); @@ -177,19 +177,19 @@ ExtDate ExtDateTable::dateFromPos( int pos ) } void -ExtDateTable::paintCell(QPainter *painter, int row, int col) +ExtDateTable::paintCell(TQPainter *painter, int row, int col) { //FIXME: Can't uncomment unless ExtDate is added to kdelibs // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); // int firstWeekDay = KGlobal::locale()->weekStartDay(); const int firstWeekDay = 7; - QRect rect; - QString text; - QPen pen; + TQRect rect; + TQString text; + TQPen pen; int w=cellWidth(); int h=cellHeight(); - QFont font=KGlobalSettings::generalFont(); + TQFont font=KGlobalSettings::generalFont(); // ----- if(row==0) @@ -203,10 +203,10 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) ( daynum == 6 && d->calendar->calendarName() == "gregorian" ) ) normalday=false; - QBrush brushTitle(); - QBrush brushInvertTitle(colorGroup().base()); - QColor titleColor(isEnabled()?( KGlobalSettings::activeTitleColor() ):( KGlobalSettings::inactiveTitleColor() ) ); - QColor textColor(isEnabled()?( KGlobalSettings::activeTextColor() ):( KGlobalSettings::inactiveTextColor() ) ); + TQBrush brushTitle(); + TQBrush brushInvertTitle(colorGroup().base()); + TQColor titleColor(isEnabled()?( KGlobalSettings::activeTitleColor() ):( KGlobalSettings::inactiveTitleColor() ) ); + TQColor textColor(isEnabled()?( KGlobalSettings::activeTextColor() ):( KGlobalSettings::inactiveTextColor() ) ); if (!normalday) { painter->setPen(textColor); @@ -248,7 +248,7 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) { if (mode->bgMode != NoBgMode) { - QBrush oldbrush=painter->brush(); + TQBrush oldbrush=painter->brush(); painter->setBrush( mode->bgColor ); switch(mode->bgMode) { @@ -300,7 +300,7 @@ ExtDateTable::paintCell(QPainter *painter, int row, int col) } void -ExtDateTable::keyPressEvent( QKeyEvent *e ) +ExtDateTable::keyPressEvent( TQKeyEvent *e ) { //FIXME: Can't uncomment unless ExtDate is added to kdelibs // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); @@ -361,9 +361,9 @@ ExtDateTable::keyPressEvent( QKeyEvent *e ) } void -ExtDateTable::viewportResizeEvent(QResizeEvent * e) +ExtDateTable::viewportResizeEvent(TQResizeEvent * e) { - QGridView::viewportResizeEvent(e); + TQGridView::viewportResizeEvent(e); setCellWidth(viewport()->width()/7); setCellHeight(viewport()->height()/7); @@ -376,8 +376,8 @@ ExtDateTable::setFontSize(int size) // const ExtCalendarSystem * calendar = KGlobal::locale()->calendar(); int count; - QFontMetrics metrics(fontMetrics()); - QRect rect; + TQFontMetrics metrics(fontMetrics()); + TQRect rect; // ----- store rectangles: fontsize=size; // ----- find largest day name: @@ -390,23 +390,23 @@ ExtDateTable::setFontSize(int size) maxCell.setHeight(QMAX(maxCell.height(), rect.height())); } // ----- compare with a real wide number and add some space: - rect=metrics.boundingRect(QString::fromLatin1("88")); + rect=metrics.boundingRect(TQString::fromLatin1("88")); maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); } void -ExtDateTable::wheelEvent ( QWheelEvent * e ) +ExtDateTable::wheelEvent ( TQWheelEvent * e ) { setDate(date.addMonths( -(int)(e->delta()/120)) ); e->accept(); } void -ExtDateTable::contentsMousePressEvent(QMouseEvent *e) +ExtDateTable::contentsMousePressEvent(TQMouseEvent *e) { - if(e->type()!=QEvent::MouseButtonPress) + if(e->type()!=TQEvent::MouseButtonPress) { // the ExtDatePicker only reacts on mouse press events: return; } @@ -418,7 +418,7 @@ ExtDateTable::contentsMousePressEvent(QMouseEvent *e) // ----- int row, col, pos, temp; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -506,16 +506,16 @@ ExtDateTable::getDate() const } // what are those repaintContents() good for? (pfeiffer) -void ExtDateTable::focusInEvent( QFocusEvent *e ) +void ExtDateTable::focusInEvent( TQFocusEvent *e ) { // repaintContents(false); - QGridView::focusInEvent( e ); + TQGridView::focusInEvent( e ); } -void ExtDateTable::focusOutEvent( QFocusEvent *e ) +void ExtDateTable::focusOutEvent( TQFocusEvent *e ) { // repaintContents(false); - QGridView::focusOutEvent( e ); + TQGridView::focusOutEvent( e ); } QSize @@ -523,11 +523,11 @@ ExtDateTable::sizeHint() const { if(maxCell.height()>0 && maxCell.width()>0) { - return QSize(maxCell.width()*numCols()+2*frameWidth(), + return TQSize(maxCell.width()*numCols()+2*frameWidth(), (maxCell.height()+2)*numRows()+2*frameWidth()); } else { kdDebug() << "ExtDateTable::sizeHint: obscure failure - " << endl; - return QSize(-1, -1); + return TQSize(-1, -1); } } @@ -541,7 +541,7 @@ bool ExtDateTable::popupMenuEnabled() const return d->popupMenuEnabled; } -void ExtDateTable::setCustomDatePainting(const ExtDate &date, const QColor &fgColor, BackgroundMode bgMode, const QColor &bgColor) +void ExtDateTable::setCustomDatePainting(const ExtDate &date, const TQColor &fgColor, BackgroundMode bgMode, const TQColor &bgColor) { if (!fgColor.isValid()) { @@ -565,18 +565,18 @@ void ExtDateTable::unsetCustomDatePainting( const ExtDate &date ) } ExtDateInternalWeekSelector::ExtDateInternalWeekSelector -(QWidget* parent, const char* name) +(TQWidget* parent, const char* name) : KLineEdit(parent, name), - val(new QIntValidator(this)), + val(new TQIntValidator(this)), result(0) { - QFont font; + TQFont font; // ----- font=KGlobalSettings::generalFont(); setFont(font); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); setValidator(val); - connect(this, SIGNAL(returnPressed()), SLOT(weekEnteredSlot())); + connect(this, TQT_SIGNAL(returnPressed()), TQT_SLOT(weekEnteredSlot())); } void @@ -604,7 +604,7 @@ ExtDateInternalWeekSelector::getWeek() void ExtDateInternalWeekSelector::setWeek(int week) { - QString temp; + TQString temp; // ----- temp.setNum(week); setText(temp); @@ -638,15 +638,15 @@ ExtDateInternalMonthPicker::~ExtDateInternalMonthPicker() { } ExtDateInternalMonthPicker::ExtDateInternalMonthPicker -(const ExtDate & date, QWidget* parent, const char* name) - : QGridView(parent, name), +(const ExtDate & date, TQWidget* parent, const char* name) + : TQGridView(parent, name), result(0) // invalid { //FIXME: Can't uncomment the following unless ExtDate is moved to kdelibs // ExtCalendarSystem *calendar = KGlobal::locale()->calendar(); - QRect rect; - QFont font; + TQRect rect; + TQFont font; // ----- activeCol = -1; activeRow = -1; @@ -654,7 +654,7 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker setFont(font); setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); setNumCols(3); d = new ExtDateInternalMonthPrivate(date.year(), date.month(), date.day()); // For monthsInYear != 12 @@ -664,10 +664,10 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker viewport()->setEraseColor(KGlobalSettings::baseColor()); // for consistency with the datepicker // ----- find the preferred size // (this is slow, possibly, but unfortunately it is needed here): - QFontMetrics metrics(font); + TQFontMetrics metrics(font); for(int i = 1; ; ++i) { - QString str = d->calendar->monthName(i, + TQString str = d->calendar->monthName(i, d->calendar->year(date), false); if (str.isNull()) break; rect=metrics.boundingRect(str); @@ -679,7 +679,7 @@ ExtDateInternalMonthPicker::ExtDateInternalMonthPicker QSize ExtDateInternalMonthPicker::sizeHint() const { - return QSize((max.width()+6)*numCols()+2*frameWidth(), + return TQSize((max.width()+6)*numCols()+2*frameWidth(), (max.height()+6)*numRows()+2*frameWidth()); } @@ -690,23 +690,23 @@ ExtDateInternalMonthPicker::getResult() const } void -ExtDateInternalMonthPicker::setupPainter(QPainter *p) +ExtDateInternalMonthPicker::setupPainter(TQPainter *p) { p->setPen(KGlobalSettings::textColor()); } void -ExtDateInternalMonthPicker::viewportResizeEvent(QResizeEvent*) +ExtDateInternalMonthPicker::viewportResizeEvent(TQResizeEvent*) { setCellWidth(width() / numCols()); setCellHeight(height() / numRows()); } void -ExtDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) +ExtDateInternalMonthPicker::paintCell(TQPainter* painter, int row, int col) { int index; - QString text; + TQString text; // ----- find the number of the cell: index=3*row+col+1; text=d->calendar->monthName(index, @@ -718,7 +718,7 @@ ExtDateInternalMonthPicker::paintCell(QPainter* painter, int row, int col) } void -ExtDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) +ExtDateInternalMonthPicker::contentsMousePressEvent(TQMouseEvent *e) { if(!isEnabled() || e->button() != LeftButton) { @@ -727,7 +727,7 @@ ExtDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) } // ----- int row, col; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -745,12 +745,12 @@ ExtDateInternalMonthPicker::contentsMousePressEvent(QMouseEvent *e) } void -ExtDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) +ExtDateInternalMonthPicker::contentsMouseMoveEvent(TQMouseEvent *e) { if (e->state() & LeftButton) { int row, col; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -785,7 +785,7 @@ ExtDateInternalMonthPicker::contentsMouseMoveEvent(QMouseEvent *e) } void -ExtDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) +ExtDateInternalMonthPicker::contentsMouseReleaseEvent(TQMouseEvent *e) { if(!isEnabled()) { @@ -793,7 +793,7 @@ ExtDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) } // ----- int row, col, pos; - QPoint mouseCoord; + TQPoint mouseCoord; // ----- mouseCoord = e->pos(); row=rowAt(mouseCoord.y()); @@ -811,22 +811,22 @@ ExtDateInternalMonthPicker::contentsMouseReleaseEvent(QMouseEvent *e) ExtDateInternalYearSelector::ExtDateInternalYearSelector -(QWidget* parent, const char* name) - : QLineEdit(parent, name), - val(new QIntValidator(this)), +(TQWidget* parent, const char* name) + : TQLineEdit(parent, name), + val(new TQIntValidator(this)), result(0), d(new ExtDateInternalYearPrivate()) { - QFont font; + TQFont font; // ----- font=KGlobalSettings::generalFont(); setFont(font); - setFrameStyle(QFrame::NoFrame); + setFrameStyle(TQFrame::NoFrame); // set year limits (perhaps we should get rid of limits altogether) //there si also a year limit in ExtCalendarSystemGregorian... val->setRange(-50000, 50000); setValidator(val); - connect(this, SIGNAL(returnPressed()), SLOT(yearEnteredSlot())); + connect(this, TQT_SIGNAL(returnPressed()), TQT_SLOT(yearEnteredSlot())); } ExtDateInternalYearSelector::~ExtDateInternalYearSelector() { @@ -867,23 +867,23 @@ ExtDateInternalYearSelector::getYear() void ExtDateInternalYearSelector::setYear(int year) { - QString temp; + TQString temp; // ----- temp.setNum(year); setText(temp); } -KPopupFrame::KPopupFrame(QWidget* parent, const char* name) - : QFrame(parent, name, WType_Popup), +KPopupFrame::KPopupFrame(TQWidget* parent, const char* name) + : TQFrame(parent, name, WType_Popup), result(0), // rejected main(0) { - setFrameStyle(QFrame::Box|QFrame::Raised); + setFrameStyle(TQFrame::Box|TQFrame::Raised); setMidLineWidth(2); } void -KPopupFrame::keyPressEvent(QKeyEvent* e) +KPopupFrame::keyPressEvent(TQKeyEvent* e) { if(e->key()==Key_Escape) { @@ -900,7 +900,7 @@ KPopupFrame::close(int r) } void -KPopupFrame::setMainWidget(QWidget* m) +KPopupFrame::setMainWidget(TQWidget* m) { main=m; if(main!=0) @@ -910,7 +910,7 @@ KPopupFrame::setMainWidget(QWidget* m) } void -KPopupFrame::resizeEvent(QResizeEvent*) +KPopupFrame::resizeEvent(TQResizeEvent*) { if(main!=0) { @@ -920,10 +920,10 @@ KPopupFrame::resizeEvent(QResizeEvent*) } void -KPopupFrame::popup(const QPoint &pos) +KPopupFrame::popup(const TQPoint &pos) { // Make sure the whole popup is visible. - QRect d = KGlobalSettings::desktopGeometry(pos); + TQRect d = KGlobalSettings::desktopGeometry(pos); int x = pos.x(); int y = pos.y(); @@ -944,7 +944,7 @@ KPopupFrame::popup(const QPoint &pos) } int -KPopupFrame::exec(QPoint pos) +KPopupFrame::exec(TQPoint pos) { popup(pos); repaint(); @@ -956,7 +956,7 @@ KPopupFrame::exec(QPoint pos) int KPopupFrame::exec(int x, int y) { - return exec(QPoint(x, y)); + return exec(TQPoint(x, y)); } void KPopupFrame::virtual_hook( int, void* ) diff --git a/libkdeedu/extdate/extdatetbl.h b/libkdeedu/extdate/extdatetbl.h index ac9b7156..8aa3281a 100644 --- a/libkdeedu/extdate/extdatetbl.h +++ b/libkdeedu/extdate/extdatetbl.h @@ -5,7 +5,7 @@ (C) 2004 Jason Harris (jharris@30doradus.org) These classes has been derived from those in kdatetbl.[h|cpp]. - The only differences are adaptations to use ExtDate instead of QDate, + The only differences are adaptations to use ExtDate instead of TQDate, to allow for more remote dates. These changes by Jason Harris. This library is free software; you can redistribute it and/or @@ -26,8 +26,8 @@ #ifndef EXTDATETBL_H #define EXTDATETBL_H -#include -#include +#include +#include #include #include "extcalendarsystemgregorian.h" @@ -42,7 +42,7 @@ class ExtDateInternalWeekSelector : public KLineEdit { Q_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void weekEnteredSlot(); @@ -50,7 +50,7 @@ public slots: signals: void closeMe(int); public: - ExtDateInternalWeekSelector( QWidget* parent=0, const char* name=0); + ExtDateInternalWeekSelector( TQWidget* parent=0, const char* name=0); int getWeek(); void setWeek(int week); @@ -81,7 +81,7 @@ protected: /** * Contains the largest rectangle needed by the month names. */ - QRect max; + TQRect max; signals: /** * This is send from the mouse click event handler. @@ -91,7 +91,7 @@ public: /** * The constructor. */ - ExtDateInternalMonthPicker(const ExtDate& date, QWidget* parent, const char* name=0); + ExtDateInternalMonthPicker(const ExtDate& date, TQWidget* parent, const char* name=0); /** * The destructor. */ @@ -99,7 +99,7 @@ public: /** * The size hint. */ - QSize sizeHint() const; + TQSize sizeHint() const; /** * Return the result. 0 means no selection (reject()), 1..12 are the * months. @@ -109,24 +109,24 @@ protected: /** * Set up the painter. */ - void setupPainter(QPainter *p); + void setupPainter(TQPainter *p); /** * The resize event. */ - virtual void viewportResizeEvent(QResizeEvent*); + virtual void viewportResizeEvent(TQResizeEvent*); /** * Paint a cell. This simply draws the month names in it. */ - virtual void paintCell(QPainter* painter, int row, int col); + virtual void paintCell(TQPainter* painter, int row, int col); /** * Catch mouse click and move events to paint a rectangle around the item. */ - virtual void contentsMousePressEvent(QMouseEvent *e); - virtual void contentsMouseMoveEvent(QMouseEvent *e); + virtual void contentsMousePressEvent(TQMouseEvent *e); + virtual void contentsMouseMoveEvent(TQMouseEvent *e); /** * Emit monthSelected(int) when a cell has been released. */ - virtual void contentsMouseReleaseEvent(QMouseEvent *e); + virtual void contentsMouseReleaseEvent(TQMouseEvent *e); private: class ExtDateInternalMonthPrivate; @@ -142,14 +142,14 @@ class ExtDateInternalYearSelector : public QLineEdit { Q_OBJECT protected: - QIntValidator *val; + TQIntValidator *val; int result; public slots: void yearEnteredSlot(); signals: void closeMe(int); public: - ExtDateInternalYearSelector( QWidget* parent=0, const char* name=0); + ExtDateInternalYearSelector( TQWidget* parent=0, const char* name=0); ~ExtDateInternalYearSelector(); int getYear(); void setYear(int year); @@ -185,11 +185,11 @@ protected: /** * Catch key press events. */ - virtual void keyPressEvent(QKeyEvent* e); + virtual void keyPressEvent(TQKeyEvent* e); /** * The only subwidget that uses the whole dialog window. */ - QWidget *main; + TQWidget *main; public slots: /** * Close the popup window. This is called from the main widget, usually. @@ -200,7 +200,7 @@ public: /** * The contructor. Creates a dialog without buttons. */ - KPopupFrame(QWidget* parent=0, const char* name=0); + KPopupFrame(TQWidget* parent=0, const char* name=0); /** * Set the main widget. You cannot set the main widget from the constructor, * since it must be a child of the frame itselfes. @@ -208,20 +208,20 @@ public: * set the main widgets correct size before setting it as the main * widget. */ - void setMainWidget(QWidget* m); + void setMainWidget(TQWidget* m); /** * The resize event. Simply resizes the main widget to the whole * widgets client size. */ - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); /** * Open the popup window at position pos. */ - void popup(const QPoint &pos); + void popup(const TQPoint &pos); /** * Execute the popup window. */ - int exec(QPoint p); + int exec(TQPoint p); /** * Dito. */ @@ -229,7 +229,7 @@ public: private: - virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } + virtual bool close(bool alsoDelete) { return TQFrame::close(alsoDelete); } protected: virtual void virtual_hook( int id, void* data ); private: @@ -243,10 +243,10 @@ private: class ExtDateValidator : public QValidator { public: - ExtDateValidator(QWidget* parent=0, const char* name=0); - virtual State validate(QString&, int&) const; - virtual void fixup ( QString & input ) const; - State date(const QString&, ExtDate&) const; + ExtDateValidator(TQWidget* parent=0, const char* name=0); + virtual State validate(TQString&, int&) const; + virtual void fixup ( TQString & input ) const; + State date(const TQString&, ExtDate&) const; }; /** @@ -272,7 +272,7 @@ public: /** * The constructor. */ - ExtDateTable(QWidget *parent=0, + ExtDateTable(TQWidget *parent=0, ExtDate date=ExtDate::currentDate(), const char* name=0, WFlags f=0); @@ -288,7 +288,7 @@ public: * to be done there anyway. The size is stored in maxCell. The * sizeHint() simply returns a multiple of maxCell. */ - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; /** * Set the font size of the date table. */ @@ -323,7 +323,7 @@ public: * * @since 3.2 */ - void setCustomDatePainting( const ExtDate &date, const QColor &fgColor, BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor()); + void setCustomDatePainting( const ExtDate &date, const TQColor &fgColor, BackgroundMode bgMode=NoBgMode, const TQColor &bgColor=TQColor()); /** * Unsets the custom painting of a date so that the date is painted as usual. @@ -346,19 +346,19 @@ protected: /** * Paint a cell. */ - virtual void paintCell(QPainter*, int, int); + virtual void paintCell(TQPainter*, int, int); /** * Handle the resize events. */ - virtual void viewportResizeEvent(QResizeEvent *); + virtual void viewportResizeEvent(TQResizeEvent *); /** * React on mouse clicks that select a date. */ - virtual void contentsMousePressEvent(QMouseEvent *); - virtual void wheelEvent( QWheelEvent * e ); - virtual void keyPressEvent( QKeyEvent *e ); - virtual void focusInEvent( QFocusEvent *e ); - virtual void focusOutEvent( QFocusEvent *e ); + virtual void contentsMousePressEvent(TQMouseEvent *); + virtual void wheelEvent( TQWheelEvent * e ); + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void focusInEvent( TQFocusEvent *e ); + virtual void focusOutEvent( TQFocusEvent *e ); // ### KDE 4.0 make the following private and mark as members @@ -390,7 +390,7 @@ protected: /** * Save the size of the largest used cell content. */ - QRect maxCell; + TQRect maxCell; signals: /** * The selected date changed. diff --git a/libkdeedu/extdate/extdatetime.cpp b/libkdeedu/extdate/extdatetime.cpp index 36e3860d..fe32cf91 100644 --- a/libkdeedu/extdate/extdatetime.cpp +++ b/libkdeedu/extdate/extdatetime.cpp @@ -14,7 +14,7 @@ **********************************************************************/ #include "extdatetime.h" -#include +#include #include #include @@ -45,7 +45,7 @@ static const uint MSECS_PER_MIN = 60000; uint ExtDate::m_monthLength[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; uint ExtDate::m_monthOrigin[] = { 0, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; -QString ExtDate::m_shortMonthNames[12] = { +TQString ExtDate::m_shortMonthNames[12] = { i18n("Short month name", "Jan"), i18n("Short month name", "Feb"), i18n("Short month name", "Mar"), i18n("Short month name", "Apr"), i18n("Short month name", "May"), i18n("Short month name", "Jun"), @@ -53,13 +53,13 @@ QString ExtDate::m_shortMonthNames[12] = { i18n("Short month name", "Sep"), i18n("Short month name", "Oct"), i18n("Short month name", "Nov"), i18n("Short month name", "Dec") }; -QString ExtDate::m_shortDayNames[7] = { +TQString ExtDate::m_shortDayNames[7] = { i18n("Short day name", "Mon"), i18n("Short day name", "Tue"), i18n("Short day name", "Wed"), i18n("Short day name", "Thu"), i18n("Short day name", "Fri"), i18n("Short day name", "Sat"), i18n("Short day name", "Sun") }; -QString ExtDate::m_longMonthNames[12] = { +TQString ExtDate::m_longMonthNames[12] = { i18n("Long month name", "January"), i18n("Long month name", "February"), i18n("Long month name", "March"), i18n("Long month name", "April"), i18n("Long month name", "May"), i18n("Long month name", "June"), @@ -67,7 +67,7 @@ QString ExtDate::m_longMonthNames[12] = { i18n("Long month name", "September"), i18n("Long month name", "October"), i18n("Long month name", "November"), i18n("Long month name", "December") }; -QString ExtDate::m_longDayNames[7] = { +TQString ExtDate::m_longDayNames[7] = { i18n("Long day name", "Monday"), i18n("Long day name", "Tuesday"), i18n("Long day name", "Wednesday"), i18n("Long day name", "Thursday"), i18n("Long day name", "Friday"), i18n("Long day name", "Saturday"), @@ -233,19 +233,19 @@ int ExtDate::weekNumber( int *yearNum ) const } #ifndef QT_NO_TEXTDATE -QString ExtDate::shortMonthName( int month ) {return m_shortMonthNames[month-1];} -QString ExtDate::shortDayName( int weekday ) {return m_shortDayNames[weekday-1];} -QString ExtDate::longMonthName( int month ) {return m_longMonthNames[month-1];} -QString ExtDate::longDayName( int weekday ) {return m_longDayNames[weekday-1];} +TQString ExtDate::shortMonthName( int month ) {return m_shortMonthNames[month-1];} +TQString ExtDate::shortDayName( int weekday ) {return m_shortDayNames[weekday-1];} +TQString ExtDate::longMonthName( int month ) {return m_longMonthNames[month-1];} +TQString ExtDate::longDayName( int weekday ) {return m_longDayNames[weekday-1];} #endif //QT_NO_TEXTDATE #ifndef QT_NO_TEXTSTRING #if !defined(QT_NO_SPRINTF) -QString ExtDate::toString( Qt::DateFormat f) const +TQString ExtDate::toString( Qt::DateFormat f) const { QString a_format; - if ( ! isValid() ) return QString::null; + if ( ! isValid() ) return TQString::null; switch (f) { @@ -270,9 +270,9 @@ QString ExtDate::toString( Qt::DateFormat f) const } #endif -QString ExtDate::toString( const QString& format ) const +TQString ExtDate::toString( const TQString& format ) const { - if ( ! isValid() ) return QString::null; + if ( ! isValid() ) return TQString::null; //We use the KDE Date format specs. //Replace occurences of the following tokens with their @@ -291,14 +291,14 @@ QString ExtDate::toString( const QString& format ) const //All other characters are left as-is. - QString result( format ); + TQString result( format ); - result.replace( "%Y", QString().sprintf( "%d", year() ) ); - result.replace( "%y", QString().sprintf( "%02d", (year() % 100) ) ); - result.replace( "%n", QString().sprintf( "%d", month() ) ); - result.replace( "%m", QString().sprintf( "%02d", month() ) ); - result.replace( "%e", QString().sprintf( "%d", day() ) ); - result.replace( "%d", QString().sprintf( "%02d", day() ) ); + result.replace( "%Y", TQString().sprintf( "%d", year() ) ); + result.replace( "%y", TQString().sprintf( "%02d", (year() % 100) ) ); + result.replace( "%n", TQString().sprintf( "%d", month() ) ); + result.replace( "%m", TQString().sprintf( "%02d", month() ) ); + result.replace( "%e", TQString().sprintf( "%d", day() ) ); + result.replace( "%d", TQString().sprintf( "%02d", day() ) ); result.replace( "%b", shortMonthName( month() ) ); result.replace( "%B", longMonthName( month() ) ); result.replace( "%a", shortDayName( dayOfWeek() ) ); @@ -402,7 +402,7 @@ ExtDate ExtDate::currentDate(Qt::TimeSpec ts) #ifndef QT_NO_DATESTRING //Try both DateFormat values -ExtDate ExtDate::fromString( const QString& s ) +ExtDate ExtDate::fromString( const TQString& s ) { ExtDate dResult = ExtDate::fromString( s, Qt::TextDate ); if ( dResult.isValid() ) return dResult; @@ -412,13 +412,13 @@ ExtDate ExtDate::fromString( const QString& s ) else return ExtDate(); //invalid } -ExtDate ExtDate::fromString( const QString& s, Qt::DateFormat f ) +ExtDate ExtDate::fromString( const TQString& s, Qt::DateFormat f ) { ExtDate dt = ExtDate(); //initialize invalid date if ( s.isEmpty() ) { return dt; } if ( f == Qt::LocalDate ) { //can't use LocalFormat #if defined(QT_CHECK_RANGE) - qWarning( "QDate::fromString: Parameter out of range" ); + qWarning( "TQDate::fromString: Parameter out of range" ); #endif return dt; } @@ -442,7 +442,7 @@ ExtDate ExtDate::fromString( const QString& s, Qt::DateFormat f ) //Three possible date formats: //dd mth yyyy; mth dd yyyy; wkd mth dd yyyy //"mth" is the word for the month (long or short form) - QStringList ss = QStringList::split( " ", s ); + TQStringList ss = TQStringList::split( " ", s ); bool ok = false; int month = -1; uint imonth = 0; @@ -515,13 +515,13 @@ bool ExtDate::isValid( int y, int m, int d ) return true; } -QDate ExtDate::qdate() const { - QDate q( year(), month(), day() ); +TQDate ExtDate::qdate() const { + TQDate q( year(), month(), day() ); if ( q.isValid() ) return q; else - return QDate(); + return TQDate(); } bool ExtDate::leapYear( int year ) @@ -552,7 +552,7 @@ int ExtDate::dayOfYear(int y, int m, int d) \ingroup time A ExtDateTime object contains a calendar date and a clock time (a - "datetime"). It is a combination of the ExtDate and QTime classes. + "datetime"). It is a combination of the ExtDate and TQTime classes. It can read the current datetime from the system clock. It provides functions for comparing datetimes and for manipulating a datetime by adding a number of seconds, days, months or years. @@ -582,11 +582,11 @@ int ExtDate::dayOfYear(int y, int m, int d) number of seconds between two datetimes. The range of a datetime object is constrained to the ranges of the - ExtDate and QTime objects which it embodies. + ExtDate and TQTime objects which it embodies. Methods in this class are reentrant. - \sa ExtDate QTime ExtDateTimeEdit + \sa ExtDate TQTime ExtDateTimeEdit */ @@ -614,7 +614,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date ) Constructs a datetime with date \a date and time \a time. */ -ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) +ExtDateTime::ExtDateTime( const ExtDate &date, const TQTime &time ) : d(date), t(time) { } @@ -626,7 +626,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) Returns TRUE if both the date and the time are null; otherwise returns FALSE. A null datetime is invalid. - \sa ExtDate::isNull(), QTime::isNull() + \sa ExtDate::isNull(), TQTime::isNull() */ /*! @@ -635,7 +635,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) Returns TRUE if both the date and the time are valid; otherwise returns FALSE. - \sa ExtDate::isValid(), QTime::isValid() + \sa ExtDate::isValid(), TQTime::isValid() */ /*! @@ -647,7 +647,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) */ /*! - \fn QTime ExtDateTime::time() const + \fn TQTime ExtDateTime::time() const Returns the time part of the datetime. @@ -663,7 +663,7 @@ ExtDateTime::ExtDateTime( const ExtDate &date, const QTime &time ) */ /*! - \fn void ExtDateTime::setTime( const QTime &time ) + \fn void ExtDateTime::setTime( const TQTime &time ) Sets the time part of this datetime to \a time. @@ -773,7 +773,7 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts ) If \a f is \c Qt::TextDate, the string format is "Wed May 20 03:40:13 1998" (using ExtDate::shortDayName(), ExtDate::shortMonthName(), - and QTime::toString() to generate the string, so the day and month + and TQTime::toString() to generate the string, so the day and month names will have localized names). If \a f is \c Qt::ISODate, the string format corresponds to the @@ -786,13 +786,13 @@ void ExtDateTime::setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ts ) If the format \a f is invalid or the datetime is invalid, toString() returns a null string. - \sa ExtDate::toString() QTime::toString() + \sa ExtDate::toString() TQTime::toString() */ -QString ExtDateTime::toString( Qt::DateFormat f ) const +TQString ExtDateTime::toString( Qt::DateFormat f ) const { if ( !isValid() ) - return QString::null; + return TQString::null; if ( f == Qt::ISODate ) { return d.toString( Qt::ISODate ) + "T" + t.toString( Qt::ISODate ); @@ -807,17 +807,17 @@ QString ExtDateTime::toString( Qt::DateFormat f ) const + " " + KGlobal::locale()->timeFormat() ); } - return QString::null; + return TQString::null; } #endif -QString ExtDateTime::toString( const QString& format ) const +TQString ExtDateTime::toString( const TQString& format ) const { if ( !isValid() ) - return QString::null; + return TQString::null; //Parse the date portion of the format string - QString result = date().toString( format ); + TQString result = date().toString( format ); //For the time format, use the following KDE format specs: //Replace occurences of the following tokens with their @@ -833,13 +833,13 @@ QString ExtDateTime::toString( const QString& format ) const int h = time().hour(); - result.replace( "%H", QString().sprintf( "%02d", h ) ); - result.replace( "%k", QString().sprintf( "%d", h ) ); - result.replace( "%I", QString().sprintf( "%02d", ( h > 12 ) ? h-12 : h ) ); - result.replace( "%l", QString().sprintf( "%d", ( h > 12 ) ? h-12 : h ) ); - result.replace( "%M", QString().sprintf( "%02d", time().minute() ) ); - result.replace( "%S", QString().sprintf( "%02d", time().second() ) ); - result.replace( "%p", QString().sprintf( "%s", ( h > 12 ) ? "pm" : "am" ) ); + result.replace( "%H", TQString().sprintf( "%02d", h ) ); + result.replace( "%k", TQString().sprintf( "%d", h ) ); + result.replace( "%I", TQString().sprintf( "%02d", ( h > 12 ) ? h-12 : h ) ); + result.replace( "%l", TQString().sprintf( "%d", ( h > 12 ) ? h-12 : h ) ); + result.replace( "%M", TQString().sprintf( "%02d", time().minute() ) ); + result.replace( "%S", TQString().sprintf( "%02d", time().second() ) ); + result.replace( "%p", TQString().sprintf( "%s", ( h > 12 ) ? "pm" : "am" ) ); return result; } @@ -909,7 +909,7 @@ ExtDateTime ExtDateTime::addSecs( int nsecs ) const } ExtDateTime ret; - ret.setTime( QTime().addMSecs( tt ) ); + ret.setTime( TQTime().addMSecs( tt ) ); ret.setDate( ExtDate( dd ) ); return ret; @@ -934,11 +934,11 @@ int ExtDateTime::daysTo( const ExtDateTime &dt ) const Example: \code ExtDateTime dt = ExtDateTime::currentDateTime(); - ExtDateTime xmas( ExtDate(dt.date().year(),12,24), QTime(17,00) ); + ExtDateTime xmas( ExtDate(dt.date().year(),12,24), TQTime(17,00) ); kdDebug( ) << "There are " << dt.secsTo(xmas) << " seconds to Christmas" << endl; \endcode - \sa addSecs(), daysTo(), QTime::secsTo() + \sa addSecs(), daysTo(), TQTime::secsTo() */ int ExtDateTime::secsTo( const ExtDateTime &dt ) const @@ -1023,7 +1023,7 @@ bool ExtDateTime::operator>=( const ExtDateTime &dt ) const Returns the current datetime, as reported by the system clock. - \sa ExtDate::currentDate(), QTime::currentTime() + \sa ExtDate::currentDate(), TQTime::currentTime() */ ExtDateTime ExtDateTime::currentDateTime() @@ -1035,14 +1035,14 @@ ExtDateTime ExtDateTime::currentDateTime() Returns the current datetime, as reported by the system clock, for the TimeSpec \a ts. The default TimeSpec is LocalTime. - \sa ExtDate::currentDate(), QTime::currentTime(), Qt::TimeSpec + \sa ExtDate::currentDate(), TQTime::currentTime(), Qt::TimeSpec */ ExtDateTime ExtDateTime::currentDateTime( Qt::TimeSpec ts ) { ExtDateTime dt; dt.setDate( ExtDate::currentDate(ts) ); - QTime t = t.currentTime(ts); + TQTime t = t.currentTime(ts); if ( t.hour()==0 && t.minute()==0 ) // midnight or right after? dt.setDate( ExtDate::currentDate(ts) ); // fetch date again dt.setTime( t ); @@ -1060,7 +1060,7 @@ ExtDateTime ExtDateTime::currentDateTime( Qt::TimeSpec ts ) \warning Note that \c Qt::LocalDate cannot be used here. */ -ExtDateTime ExtDateTime::fromString( const QString& s ) +ExtDateTime ExtDateTime::fromString( const TQString& s ) { ExtDateTime dtResult = ExtDateTime::fromString( s, Qt::TextDate ); if ( dtResult.isValid() ) return dtResult; @@ -1071,7 +1071,7 @@ ExtDateTime ExtDateTime::fromString( const QString& s ) else return ExtDateTime(); //invalid } -ExtDateTime ExtDateTime::fromString( const QString& s, Qt::DateFormat f ) +ExtDateTime ExtDateTime::fromString( const TQString& s, Qt::DateFormat f ) { ExtDateTime dt; @@ -1085,21 +1085,21 @@ ExtDateTime ExtDateTime::fromString( const QString& s, Qt::DateFormat f ) if ( f == Qt::ISODate ) { if ( s.length() <= 10 || ! s.contains( ':' ) ) { //no time specified - QTime t = QTime(0,0,0); + TQTime t = TQTime(0,0,0); return ExtDateTime( ExtDate::fromString( s.mid(0,10), Qt::ISODate ) ); } else { return ExtDateTime( ExtDate::fromString( s.mid(0,10), Qt::ISODate ), - QTime::fromString( s.mid(11), Qt::ISODate ) ); + TQTime::fromString( s.mid(11), Qt::ISODate ) ); } } #if !defined(QT_NO_REGEXP) && !defined(QT_NO_TEXTDATE) else if ( f == Qt::TextDate ) { //parse the time, if it exists. - QTime time; - QString sd = s; + TQTime time; + TQString sd = s; int hour, minute, second; - int pivot = s.find( QRegExp(QString::fromLatin1("[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")) ); + int pivot = s.find( TQRegExp(TQString::fromLatin1("[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")) ); if ( pivot != -1 ) { hour = s.mid( pivot, 2 ).toInt(); minute = s.mid( pivot+3, 2 ).toInt(); @@ -1121,12 +1121,12 @@ ExtDateTime ExtDateTime::fromString( const QString& s, Qt::DateFormat f ) #ifndef QT_NO_DATASTREAM -KDE_EXPORT QDataStream &operator<<( QDataStream & ostream, const ExtDate & date) +KDE_EXPORT TQDataStream &operator<<( TQDataStream & ostream, const ExtDate & date) { return ostream << (Q_UINT32)(date.jd()); } -KDE_EXPORT QDataStream &operator>>( QDataStream & ostream, ExtDate & date) +KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDate & date) { Q_UINT32 julday; ostream >> julday; @@ -1134,12 +1134,12 @@ KDE_EXPORT QDataStream &operator>>( QDataStream & ostream, ExtDate & date) return ostream; } -KDE_EXPORT QDataStream &operator<<( QDataStream & ostream, const ExtDateTime & dt) +KDE_EXPORT TQDataStream &operator<<( TQDataStream & ostream, const ExtDateTime & dt) { return ostream << dt.d << dt.t; } -KDE_EXPORT QDataStream &operator>>( QDataStream & ostream, ExtDateTime & dt) +KDE_EXPORT TQDataStream &operator>>( TQDataStream & ostream, ExtDateTime & dt) { ostream >> dt.d >> dt.t; return ostream; diff --git a/libkdeedu/extdate/extdatetime.h b/libkdeedu/extdate/extdatetime.h index e1bc2a79..0830af83 100644 --- a/libkdeedu/extdate/extdatetime.h +++ b/libkdeedu/extdate/extdatetime.h @@ -17,9 +17,9 @@ #define EXTDATETIME_H #include -#include "qstring.h" -#include "qnamespace.h" -#include "qdatetime.h" +#include "tqstring.h" +#include "tqnamespace.h" +#include "tqdatetime.h" #include #define INVALID_DAY LONG_MIN @@ -39,13 +39,13 @@ class KDE_EXPORT ExtDate public: ExtDate() : m_jd(INVALID_DAY), m_year(0), m_month(0), m_day(0) {} ExtDate( int y, int m, int d ); - ExtDate( const QDate &q ) { ExtDate( q.year(), q.month(), q.day() ); } + ExtDate( const TQDate &q ) { ExtDate( q.year(), q.month(), q.day() ); } ExtDate( long int jd ); bool isNull() const { return m_jd == INVALID_DAY; } bool isValid() const; - QDate qdate() const; + TQDate qdate() const; int year() const { return m_year; } int month() const { return m_month; } @@ -59,19 +59,19 @@ public: #ifndef QT_NO_TEXTDATE #ifndef QT_NO_COMPAT - static QString monthName( int month ) { return shortMonthName( month ); } - static QString dayName( int weekday ) { return shortDayName( weekday ); } + static TQString monthName( int month ) { return shortMonthName( month ); } + static TQString dayName( int weekday ) { return shortDayName( weekday ); } #endif - static QString shortMonthName( int month ); - static QString shortDayName( int weekday ); - static QString longMonthName( int month ); - static QString longDayName( int weekday ); + static TQString shortMonthName( int month ); + static TQString shortDayName( int weekday ); + static TQString longMonthName( int month ); + static TQString longDayName( int weekday ); #endif //QT_NO_TEXTDATE #ifndef QT_NO_TEXTSTRING #if !defined(QT_NO_SPRINTF) - QString toString( Qt::DateFormat f = Qt::TextDate ) const; + TQString toString( Qt::DateFormat f = Qt::TextDate ) const; #endif - QString toString( const QString& format ) const; + TQString toString( const TQString& format ) const; #endif bool setYMD( int y, int m, int d ); bool setJD( long int _jd ); @@ -90,8 +90,8 @@ public: static ExtDate currentDate( Qt::TimeSpec ts = Qt::LocalTime ); #ifndef QT_NO_DATESTRING - static ExtDate fromString( const QString &s ); - static ExtDate fromString( const QString &s, Qt::DateFormat f ); + static ExtDate fromString( const TQString &s ); + static ExtDate fromString( const TQString &s, Qt::DateFormat f ); #endif static bool isValid( int y, int m, int d ); static bool leapYear( int year ); @@ -106,18 +106,18 @@ private: int m_year, m_month, m_day; static uint m_monthLength[12]; static uint m_monthOrigin[12]; - static QString m_shortMonthNames[12]; - static QString m_shortDayNames[7]; - static QString m_longMonthNames[12]; - static QString m_longDayNames[7]; + static TQString m_shortMonthNames[12]; + static TQString m_shortDayNames[7]; + static TQString m_longMonthNames[12]; + static TQString m_longDayNames[7]; friend class ExtDateTime; #ifndef QT_NO_DATASTREAM - friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & ); - friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & ); - friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime & ); - friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & ); + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDate & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDate & ); + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDateTime & ); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDateTime & ); #endif }; @@ -130,23 +130,23 @@ class KDE_EXPORT ExtDateTime public: ExtDateTime() {} // set null date and null time ExtDateTime( const ExtDate & ); - ExtDateTime( const ExtDate &, const QTime & ); + ExtDateTime( const ExtDate &, const TQTime & ); bool isNull() const { return d.isNull() && t.isNull(); } bool isValid() const { return d.isValid() && t.isValid(); } ExtDate date() const { return d; } - QTime time() const { return t; } + TQTime time() const { return t; } uint toTime_t() const; void setDate( const ExtDate &date ) { d = date; } - void setTime( const QTime &time ) { t = time; } + void setTime( const TQTime &time ) { t = time; } void setTime_t( uint secsSince1Jan1970UTC ); void setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec ); #ifndef QT_NO_DATESTRING #ifndef QT_NO_SPRINTF - QString toString( Qt::DateFormat f = Qt::TextDate ) const; + TQString toString( Qt::DateFormat f = Qt::TextDate ) const; #endif - QString toString( const QString& format ) const; + TQString toString( const TQString& format ) const; #endif ExtDateTime addDays( int days ) const; ExtDateTime addMonths( int months ) const; @@ -165,15 +165,15 @@ public: static ExtDateTime currentDateTime(); static ExtDateTime currentDateTime( Qt::TimeSpec ); #ifndef QT_NO_DATESTRING - static ExtDateTime fromString( const QString &s ); - static ExtDateTime fromString( const QString &s, Qt::DateFormat f ); + static ExtDateTime fromString( const TQString &s ); + static ExtDateTime fromString( const TQString &s, Qt::DateFormat f ); #endif private: ExtDate d; - QTime t; + TQTime t; #ifndef QT_NO_DATASTREAM - friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime &); - friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & ); + friend Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDateTime &); + friend Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDateTime & ); #endif }; @@ -182,8 +182,8 @@ private: *****************************************************************************/ #ifndef QT_NO_DATASTREAM -Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & ); -Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & ); +Q_EXPORT TQDataStream &operator<<( TQDataStream &, const ExtDate & ); +Q_EXPORT TQDataStream &operator>>( TQDataStream &, ExtDate & ); #endif // QT_NO_DATASTREAM #endif // EXTDATE_H diff --git a/libkdeedu/extdate/extdatetimeedit.cpp b/libkdeedu/extdate/extdatetimeedit.cpp index 2a9a467b..203f1dbb 100644 --- a/libkdeedu/extdate/extdatetimeedit.cpp +++ b/libkdeedu/extdate/extdatetimeedit.cpp @@ -31,14 +31,14 @@ //#include "../kernel/qrichtext_p.h" #include #include -#include -#include -#include -#include -#include -#include -#include -#include //need for QTimeEdit +#include +#include +#include +#include +#include +#include +#include +#include //need for QTimeEdit #define EXTDATETIMEEDIT_HIDDEN_CHAR '0' @@ -71,48 +71,48 @@ static void readLocaleSettings() int dpos, mpos, ypos; cleanup(); - lDateSep = new QString(); - lTimeSep = new QString(); + lDateSep = new TQString(); + lTimeSep = new TQString(); #if defined(Q_WS_WIN) QT_WA( { TCHAR data[10]; GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_SDATE, data, 10 ); - *lDateSep = QString::fromUcs2( (ushort*)data ); + *lDateSep = TQString::fromUcs2( (ushort*)data ); GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_STIME, data, 10 ); - *lTimeSep = QString::fromUcs2( (ushort*)data ); + *lTimeSep = TQString::fromUcs2( (ushort*)data ); GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_ITIME, data, 10 ); - lAMPM = QString::fromUcs2( (ushort*)data ).toInt()==0; + lAMPM = TQString::fromUcs2( (ushort*)data ).toInt()==0; GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_S1159, data, 10 ); - QString am = QString::fromUcs2( (ushort*)data ); + TQString am = TQString::fromUcs2( (ushort*)data ); if ( !am.isEmpty() ) - lAM = new QString( am ); + lAM = new TQString( am ); GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_S2359, data, 10 ); - QString pm = QString::fromUcs2( (ushort*)data ); + TQString pm = TQString::fromUcs2( (ushort*)data ); if ( !pm.isEmpty() ) - lPM = new QString( pm ); + lPM = new TQString( pm ); } , { char data[10]; GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_SDATE, (char*)&data, 10 ); - *lDateSep = QString::fromLocal8Bit( data ); + *lDateSep = TQString::fromLocal8Bit( data ); GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_STIME, (char*)&data, 10 ); - *lTimeSep = QString::fromLocal8Bit( data ); + *lTimeSep = TQString::fromLocal8Bit( data ); GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_ITIME, (char*)&data, 10 ); - lAMPM = QString::fromLocal8Bit( data ).toInt()==0; + lAMPM = TQString::fromLocal8Bit( data ).toInt()==0; GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_S1159, (char*)&data, 10 ); - QString am = QString::fromLocal8Bit( data ); + TQString am = TQString::fromLocal8Bit( data ); if ( !am.isEmpty() ) - lAM = new QString( am ); + lAM = new TQString( am ); GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_S2359, (char*)&data, 10 ); - QString pm = QString::fromLocal8Bit( data ); + TQString pm = TQString::fromLocal8Bit( data ); if ( !pm.isEmpty() ) - lPM = new QString( pm ); + lPM = new TQString( pm ); } ); #else *lDateSep = "-"; *lTimeSep = ":"; #endif - QString d = ExtDate( 1999, 11, 22 ).toString( Qt::LocalDate ); + TQString d = ExtDate( 1999, 11, 22 ).toString( Qt::LocalDate ); dpos = d.find( "22" ); mpos = d.find( "11" ); ypos = d.find( "99" ); @@ -134,7 +134,7 @@ static void readLocaleSettings() // this code needs to change if new formats are added #ifndef Q_WS_WIN - QString sep = d.mid( QMIN( dpos, mpos ) + 2, QABS( dpos - mpos ) - 2 ); + TQString sep = d.mid( QMIN( dpos, mpos ) + 2, QABS( dpos - mpos ) - 2 ); if ( d.contains( sep ) == 2 ) { *lDateSep = sep; } @@ -142,13 +142,13 @@ static void readLocaleSettings() } #ifndef Q_WS_WIN - QString t = QTime( 11, 22, 33 ).toString( Qt::LocalDate ); + TQString t = TQTime( 11, 22, 33 ).toString( Qt::LocalDate ); dpos = t.find( "11" ); mpos = t.find( "22" ); ypos = t.find( "33" ); // We only allow hhmmss if ( dpos > -1 && dpos < mpos && mpos < ypos ) { - QString sep = t.mid( dpos + 2, mpos - dpos - 2 ); + TQString sep = t.mid( dpos + 2, mpos - dpos - 2 ); if ( sep == t.mid( mpos + 2, ypos - mpos - 2 ) ) { *lTimeSep = sep; } @@ -163,14 +163,14 @@ static ExtDateEdit::Order localOrder() { return lOrder; } -static QString localDateSep() { +static TQString localDateSep() { if ( !lDateSep ) { readLocaleSettings(); } return *lDateSep; } -static QString localTimeSep() { +static TQString localTimeSep() { if ( !lTimeSep ) { readLocaleSettings(); } @@ -217,16 +217,16 @@ public: sections[sec].setSelectionEnd( selend ); } uint sectionCount() const { return (uint)sections.count(); } - void setSeparator( const QString& s ) { sep = s; } - QString separator() const { return sep; } + void setSeparator( const TQString& s ) { sep = s; } + TQString separator() const { return sep; } void setFrame( bool f ) { frm = f; } bool frame() const { return frm; } int focusSection() const { return focusSec; } - int section( const QPoint& p ) + int section( const TQPoint& p ) { - cursor->place( p + QPoint( offset, 0 ), parag ); + cursor->place( p + TQPoint( offset, 0 ), parag ); int idx = cursor->index(); for ( uint i = 0; i < sections.count(); ++i ) { if ( idx >= sections[i].selectionStart() && @@ -261,12 +261,12 @@ public: return FALSE; } - void paint( const QString& txt, bool focus, QPainter& p, - const QColorGroup& cg, const QRect& rect, QStyle& style ) + void paint( const TQString& txt, bool focus, TQPainter& p, + const TQColorGroup& cg, const TQRect& rect, TQStyle& style ) { int fw = 0; if ( frm ) - fw = style.pixelMetric(QStyle::PM_DefaultFrameWidth); + fw = style.pixelMetric(TQStyle::PM_DefaultFrameWidth); parag->truncate( 0 ); parag->append( txt ); @@ -293,7 +293,7 @@ public: fb->removeRef(); nf->removeRef(); - QRect r( rect.x(), rect.y(), rect.width() - 2 * ( 2 + fw ), rect.height() ); + TQRect r( rect.x(), rect.y(), rect.width() - 2 * ( 2 + fw ), rect.height() ); parag->pseudoDocument()->docRect = r; parag->invalidate(0); parag->format(); @@ -309,7 +309,7 @@ public: p.translate( -xoff, -yoff ); } - void resize( const QSize& size ) { sz = size; } + void resize( const TQSize& size ) { sz = size; } int mapSection( int sec ) { @@ -334,24 +334,24 @@ private: bool frm; QTextParagraph *parag; QTextCursor *cursor; - QSize sz; + TQSize sz; int focusSec; - QValueList< QNumberSection > sections; - QString sep; + TQValueList< QNumberSection > sections; + TQString sep; int offset; }; class ExtDateTimeSpinWidget : public QSpinWidget { public: - ExtDateTimeSpinWidget( QWidget *parent, const char *name ) - : QSpinWidget( parent, name ) + ExtDateTimeSpinWidget( TQWidget *parent, const char *name ) + : TQSpinWidget( parent, name ) { } protected: #ifndef QT_NO_WHEELEVENT - void wheelEvent( QWheelEvent *e ) + void wheelEvent( TQWheelEvent *e ) { ExtDateTimeEditor *editor = (ExtDateTimeEditor*)editWidget()->qt_cast( "ExtDateTimeEditor" ); Q_ASSERT( editor ); @@ -363,7 +363,7 @@ protected: if ( section == -1 ) return; - QSpinWidget::wheelEvent( e ); + TQSpinWidget::wheelEvent( e ); } #endif }; @@ -374,7 +374,7 @@ protected: */ ExtDateTimeEditor::ExtDateTimeEditor( ExtDateTimeEditBase * parent, const char * name ) - : QWidget( parent, name, WNoAutoErase ) + : TQWidget( parent, name, WNoAutoErase ) { d = new ExtDateTimeEditorPrivate(); cw = parent; @@ -407,14 +407,14 @@ void ExtDateTimeEditor::init() */ -bool ExtDateTimeEditor::event( QEvent *e ) +bool ExtDateTimeEditor::event( TQEvent *e ) { - if ( e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut ) { - if ( e->type() == QEvent::FocusOut ) + if ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) { + if ( e->type() == TQEvent::FocusOut ) qApp->sendEvent( cw, e ); update( rect() ); - } else if ( e->type() == QEvent::AccelOverride ) { - QKeyEvent* ke = (QKeyEvent*) e; + } else if ( e->type() == TQEvent::AccelOverride ) { + TQKeyEvent* ke = (TQKeyEvent*) e; switch ( ke->key() ) { case Key_Delete: case Key_Backspace: @@ -427,17 +427,17 @@ bool ExtDateTimeEditor::event( QEvent *e ) break; } } - return QWidget::event( e ); + return TQWidget::event( e ); } /*! \reimp */ -void ExtDateTimeEditor::resizeEvent( QResizeEvent *e ) +void ExtDateTimeEditor::resizeEvent( TQResizeEvent *e ) { d->resize( e->size() ); - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); } @@ -445,9 +445,9 @@ void ExtDateTimeEditor::resizeEvent( QResizeEvent *e ) */ -void ExtDateTimeEditor::paintEvent( QPaintEvent * ) +void ExtDateTimeEditor::paintEvent( TQPaintEvent * ) { - QString txt; + TQString txt; for ( uint i = 0; i < d->sectionCount(); ++i ) { txt += cw->sectionFormattedText( i ); if ( i < d->sectionCount()-1 ) { @@ -459,8 +459,8 @@ void ExtDateTimeEditor::paintEvent( QPaintEvent * ) } QSharedDoubleBuffer buffer( this ); - const QBrush &bg = - colorGroup().brush( isEnabled() ? QColorGroup::Base : QColorGroup::Background ); + const TQBrush &bg = + colorGroup().brush( isEnabled() ? TQColorGroup::Base : TQColorGroup::Background ); buffer.painter()->fillRect( 0, 0, width(), height(), bg ); d->paint( txt, hasFocus(), *buffer.painter(), colorGroup(), rect(), style() ); @@ -471,7 +471,7 @@ void ExtDateTimeEditor::paintEvent( QPaintEvent * ) /*! Returns the section index at point \a p. */ -int ExtDateTimeEditor::sectionAt( const QPoint &p ) +int ExtDateTimeEditor::sectionAt( const TQPoint &p ) { return d->section( p ); } @@ -486,9 +486,9 @@ int ExtDateTimeEditor::mapSection( int sec ) */ -void ExtDateTimeEditor::mousePressEvent( QMouseEvent *e ) +void ExtDateTimeEditor::mousePressEvent( TQMouseEvent *e ) { - QPoint p( e->pos().x(), 0 ); + TQPoint p( e->pos().x(), 0 ); int sec = sectionAt( p ); if ( sec != -1 ) { cw->setFocusSection( sec ); @@ -499,11 +499,11 @@ void ExtDateTimeEditor::mousePressEvent( QMouseEvent *e ) /*! \reimp */ -bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) +bool ExtDateTimeEditor::eventFilter( TQObject *o, TQEvent *e ) { if ( o == this ) { - if ( e->type() == QEvent::KeyPress ) { - QKeyEvent *ke = (QKeyEvent*)e; + if ( e->type() == TQEvent::KeyPress ) { + TQKeyEvent *ke = (TQKeyEvent*)e; switch ( ke->key() ) { case Key_Right: if ( d->focusSection() < (int)d->sectionCount()-1 ) { @@ -537,7 +537,7 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) if ( ke->state() == Qt::ControlButton ) return FALSE; - QWidget *w = this; + TQWidget *w = this; bool hadDateEdit = FALSE; while ( w ) { if ( ::qt_cast(w) && qstrcmp( w->name(), "qt_spin_widget" ) != 0 || @@ -569,7 +569,7 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) } } break; default: - QString txt = ke->text().lower(); + TQString txt = ke->text().lower(); if ( !txt.isEmpty() && !separator().isEmpty() && txt[0] == separator()[0] ) { // do the same thing as KEY_RIGHT when the user presses the separator key if ( d->focusSection() < 2 ) { @@ -580,7 +580,7 @@ bool ExtDateTimeEditor::eventFilter( QObject *o, QEvent *e ) } else if ( !txt.isEmpty() && ::qt_cast(cw) && focusSection() == (int) d->sectionCount()-1 ) { // the first character of the AM/PM indicator toggles if the section has focus QTimeEdit *te = (QTimeEdit*)cw; - QTime time = te->time(); + TQTime time = te->time(); if ( lAMPM && lAM && lPM && (te->display()&QTimeEdit::AMPM) ) { if ( txt[0] == (*lAM).lower()[0] && time.hour() >= 12 ) { time.setHMS( time.hour()-12, time.minute(), time.second(), time.msec() ); @@ -637,7 +637,7 @@ void ExtDateTimeEditor::setSectionSelection( int sec, int selstart, int selend ) currently, only the first character of \a s is used. */ -void ExtDateTimeEditor::setSeparator( const QString& s ) +void ExtDateTimeEditor::setSeparator( const TQString& s ) { d->setSeparator( s ); update(); @@ -648,7 +648,7 @@ void ExtDateTimeEditor::setSeparator( const QString& s ) Returns the editor's separator. */ -QString ExtDateTimeEditor::separator() const +TQString ExtDateTimeEditor::separator() const { return d->separator(); } @@ -682,7 +682,7 @@ bool ExtDateTimeEditor::setFocusSection( int sec ) ExtDateTimeEditor. */ -/*! \fn QString ExtDateTimeEditBase::sectionFormattedText( int sec ) +/*! \fn TQString ExtDateTimeEditBase::sectionFormattedText( int sec ) \internal Pure virtual function which returns the formatted text of section \a @@ -747,7 +747,7 @@ public: ExtDate max; bool changed; ExtDateTimeEditor *ed; - QSpinWidget *controls; + TQSpinWidget *controls; }; @@ -823,7 +823,7 @@ public: called name \a name. */ -ExtDateEdit::ExtDateEdit( QWidget * parent, const char * name ) +ExtDateEdit::ExtDateEdit( TQWidget * parent, const char * name ) : ExtDateTimeEditBase( parent, name ) { init(); @@ -839,7 +839,7 @@ ExtDateEdit::ExtDateEdit( QWidget * parent, const char * name ) The date editor is initialized with \a date. */ -ExtDateEdit::ExtDateEdit( const ExtDate& date, QWidget * parent, const char * name ) +ExtDateEdit::ExtDateEdit( const ExtDate& date, TQWidget * parent, const char * name ) : ExtDateTimeEditBase( parent, name ) { init(); @@ -857,10 +857,10 @@ void ExtDateEdit::init() d->ed = new ExtDateTimeEditor( this, "date editor" ); d->controls->setEditWidget( d->ed ); setFocusProxy( d->ed ); - connect( d->controls, SIGNAL( stepUpPressed() ), SLOT( stepUp() ) ); - connect( d->controls, SIGNAL( stepDownPressed() ), SLOT( stepDown() ) ); - connect( this, SIGNAL( valueChanged(const ExtDate&) ), - SLOT( updateButtons() ) ); + connect( d->controls, TQT_SIGNAL( stepUpPressed() ), TQT_SLOT( stepUp() ) ); + connect( d->controls, TQT_SIGNAL( stepDownPressed() ), TQT_SLOT( stepDown() ) ); + connect( this, TQT_SIGNAL( valueChanged(const ExtDate&) ), + TQT_SLOT( updateButtons() ) ); d->ed->appendSection( QNumberSection( 0,4 ) ); d->ed->appendSection( QNumberSection( 5,7 ) ); d->ed->appendSection( QNumberSection( 8,10 ) ); @@ -883,7 +883,7 @@ void ExtDateEdit::init() d->max = ExtDate( 50000, 12, 31 ); d->changed = FALSE; - setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); + setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); refcount++; } @@ -953,7 +953,7 @@ void ExtDateEdit::setRange( const ExtDate& min, const ExtDate& max ) character of \a s is used. */ -void ExtDateEdit::setSeparator( const QString& s ) +void ExtDateEdit::setSeparator( const TQString& s ) { d->ed->setSeparator( s ); } @@ -962,7 +962,7 @@ void ExtDateEdit::setSeparator( const QString& s ) Returns the editor's separator. */ -QString ExtDateEdit::separator() const +TQString ExtDateEdit::separator() const { return d->ed->separator(); } @@ -989,7 +989,7 @@ void ExtDateEdit::updateButtons() /*! \reimp */ -void ExtDateEdit::resizeEvent( QResizeEvent * ) +void ExtDateEdit::resizeEvent( TQResizeEvent * ) { d->controls->resize( width(), height() ); } @@ -997,22 +997,22 @@ void ExtDateEdit::resizeEvent( QResizeEvent * ) /*! \reimp */ -QSize ExtDateEdit::sizeHint() const +TQSize ExtDateEdit::sizeHint() const { constPolish(); - QFontMetrics fm( font() ); - int fw = style().pixelMetric( QStyle::PM_DefaultFrameWidth, this ); + TQFontMetrics fm( font() ); + int fw = style().pixelMetric( TQStyle::PM_DefaultFrameWidth, this ); int h = QMAX( fm.lineSpacing(), 14 ) + 2; int w = 2 + fm.width( '9' ) * 8 + fm.width( d->ed->separator() ) * 2 + d->controls->upRect().width() + fw * 4; - return QSize( w, QMAX(h + fw * 2,20) ).expandedTo( QApplication::globalStrut() ); + return TQSize( w, QMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() ); } /*! \reimp */ -QSize ExtDateEdit::minimumSizeHint() const +TQSize ExtDateEdit::minimumSizeHint() const { return sizeHint(); } @@ -1026,9 +1026,9 @@ QSize ExtDateEdit::minimumSizeHint() const \sa setOrder() */ -QString ExtDateEdit::sectionFormattedText( int sec ) +TQString ExtDateEdit::sectionFormattedText( int sec ) { - QString txt; + TQString txt; txt = sectionText( sec ); if ( d->typing && sec == d->ed->focusSection() ) d->ed->setSectionSelection( sec, sectionOffsetEnd( sec ) - txt.length(), @@ -1071,7 +1071,7 @@ int ExtDateEdit::sectionLength( int sec ) const \sa setOrder() */ -QString ExtDateEdit::sectionText( int sec ) const +TQString ExtDateEdit::sectionText( int sec ) const { int val = 0; if ( sec == d->yearSection ) @@ -1081,7 +1081,7 @@ QString ExtDateEdit::sectionText( int sec ) const else if ( sec == d->daySection ) val = d->d; - return QString::number( val ); + return TQString::number( val ); } /*! \internal @@ -1363,25 +1363,25 @@ void ExtDateEdit::addNumber( int sec, int num ) bool overwrite = FALSE; bool accepted = FALSE; d->typing = TRUE; - QString txt; + TQString txt; if ( sec == d->yearSection ) { if ( d->overwrite ) { d->y = num; d->overwrite = FALSE; accepted = TRUE; } else { - txt = QString::number( 10*d->y + num ); + txt = TQString::number( 10*d->y + num ); if ( txt.length() > 5 ) txt = txt.mid(1); d->y = txt.toInt(); accepted = TRUE; } /* - txt = QString::number( d->y ); + txt = TQString::number( d->y ); if ( d->overwrite || txt.length() == 4 ) { accepted = TRUE; d->y = num; } else { - txt += QString::number( num ); + txt += TQString::number( num ); if ( txt.length() == 4 ) { int val = txt.toInt(); if ( val < 1792 ) @@ -1389,7 +1389,7 @@ void ExtDateEdit::addNumber( int sec, int num ) else if ( val > 8000 ) d->y = 8000; else if ( outOfRange( val, d->m, d->d ) ) - txt = QString::number( d->y ); + txt = TQString::number( d->y ); else { accepted = TRUE; d->y = val; @@ -1405,17 +1405,17 @@ void ExtDateEdit::addNumber( int sec, int num ) } */ } else if ( sec == d->monthSection ) { - txt = QString::number( d->m ); + txt = TQString::number( d->m ); if ( d->overwrite || txt.length() == 2 ) { accepted = TRUE; d->m = num; } else { - txt += QString::number( num ); + txt += TQString::number( num ); int temp = txt.toInt(); if ( temp > 12 ) temp = num; if ( outOfRange( d->y, temp, d->d ) ) - txt = QString::number( d->m ); + txt = TQString::number( d->m ); else { accepted = TRUE; d->m = temp; @@ -1426,18 +1426,18 @@ void ExtDateEdit::addNumber( int sec, int num ) } } } else if ( sec == d->daySection ) { - txt = QString::number( d->d ); + txt = TQString::number( d->d ); if ( d->overwrite || txt.length() == 2 ) { accepted = TRUE; d->d = num; d->dayCache = d->d; } else { - txt += QString::number( num ); + txt += TQString::number( num ); int temp = txt.toInt(); if ( temp > 31 ) temp = num; if ( outOfRange( d->y, d->m, temp ) ) - txt = QString::number( d->d ); + txt = TQString::number( d->d ); else { accepted = TRUE; d->d = temp; @@ -1549,9 +1549,9 @@ void ExtDateEdit::fix() */ -bool ExtDateEdit::event( QEvent *e ) +bool ExtDateEdit::event( TQEvent *e ) { - if( e->type() == QEvent::FocusOut ) { + if( e->type() == TQEvent::FocusOut ) { d->typing = FALSE; d->overwrite = TRUE; // the following can't be done in fix() because fix() called @@ -1571,7 +1571,7 @@ bool ExtDateEdit::event( QEvent *e ) emit valueChanged( date() ); d->changed = FALSE; } - } else if ( e->type() == QEvent::LocaleChange ) { + } else if ( e->type() == TQEvent::LocaleChange ) { readLocaleSettings(); d->ed->setSeparator( localDateSep() ); setOrder( localOrder() ); @@ -1593,17 +1593,17 @@ void ExtDateEdit::removeFirstNumber( int sec ) { if ( sec == -1 ) return; - QString txt; + TQString txt; if ( sec == d->yearSection ) { - txt = QString::number( d->y ); + txt = TQString::number( d->y ); txt = txt.mid( 1, txt.length() ) + "0"; d->y = txt.toInt(); } else if ( sec == d->monthSection ) { - txt = QString::number( d->m ); + txt = TQString::number( d->m ); txt = txt.mid( 1, txt.length() ) + "0"; d->m = txt.toInt(); } else if ( sec == d->daySection ) { - txt = QString::number( d->d ); + txt = TQString::number( d->d ); txt = txt.mid( 1, txt.length() ) + "0"; d->d = txt.toInt(); d->dayCache = d->d; @@ -1619,17 +1619,17 @@ void ExtDateEdit::removeLastNumber( int sec ) { if ( sec == -1 ) return; - QString txt; + TQString txt; if ( sec == d->yearSection ) { - txt = QString::number( d->y ); + txt = TQString::number( d->y ); txt = txt.mid( 0, txt.length()-1 ); d->y = txt.toInt(); } else if ( sec == d->monthSection ) { - txt = QString::number( d->m ); + txt = TQString::number( d->m ); txt = txt.mid( 0, txt.length()-1 ); d->m = txt.toInt(); } else if ( sec == d->daySection ) { - txt = QString::number( d->d ); + txt = TQString::number( d->d ); txt = txt.mid( 0, txt.length()-1 ); d->d = txt.toInt(); d->dayCache = d->d; @@ -1661,7 +1661,7 @@ bool ExtDateEdit::autoAdvance() const /*! \reimp */ -void ExtDateEdit::timerEvent( QTimerEvent * ) +void ExtDateEdit::timerEvent( TQTimerEvent * ) { d->overwrite = TRUE; } @@ -1686,11 +1686,11 @@ public: bool overwrite; int timerId; bool typing; - QTime min; - QTime max; + TQTime min; + TQTime max; bool changed; ExtDateTimeEditor *ed; - QSpinWidget *controls; + TQSpinWidget *controls; }; /*! @@ -1709,7 +1709,7 @@ public: hour, minute, second order. It is recommended that the QTimeEdit is initialised with a time, e.g. \code - QTime timeNow = QTime::currentTime(); + TQTime timeNow = TQTime::currentTime(); QTimeEdit *timeEdit = new QTimeEdit( timeNow, this ); timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) ); \endcode @@ -1718,7 +1718,7 @@ public: maximum time to one hour from now. The maximum and minimum values for a time value in the time editor - default to the maximum and minimum values for a QTime. You can + default to the maximum and minimum values for a TQTime. You can change this by calling setMinValue(), setMaxValue() or setRange(). Terminology: A QTimeWidget consists of three sections, one each @@ -1728,7 +1728,7 @@ public: \img datetimewidgets.png Date Time Widgets - \sa QTime ExtDateEdit ExtDateTimeEdit + \sa TQTime ExtDateEdit ExtDateTimeEdit */ @@ -1737,7 +1737,7 @@ public: // name. // */ // -// QTimeEdit::QTimeEdit( QWidget * parent, const char * name ) +// QTimeEdit::QTimeEdit( TQWidget * parent, const char * name ) // : ExtDateTimeEditBase( parent, name ) // { // init(); @@ -1750,7 +1750,7 @@ public: // parent \a parent and called \a name. // */ // -// QTimeEdit::QTimeEdit( const QTime& time, QWidget * parent, const char * name ) +// QTimeEdit::QTimeEdit( const TQTime& time, TQWidget * parent, const char * name ) // : ExtDateTimeEditBase( parent, name ) // { // init(); @@ -1767,8 +1767,8 @@ public: // d->controls = new ExtDateTimeSpinWidget( this, qstrcmp( name(), "qt_datetime_timeedit" ) == 0 ? "qt_spin_widget" : "time edit controls" ); // d->controls->setEditWidget( d->ed ); // setFocusProxy( d->ed ); -// connect( d->controls, SIGNAL( stepUpPressed() ), SLOT( stepUp() ) ); -// connect( d->controls, SIGNAL( stepDownPressed() ), SLOT( stepDown() ) ); +// connect( d->controls, TQT_SIGNAL( stepUpPressed() ), TQT_SLOT( stepUp() ) ); +// connect( d->controls, TQT_SIGNAL( stepDownPressed() ), TQT_SLOT( stepDown() ) ); // // d->ed->appendSection( QNumberSection( 0,0, TRUE, 0 ) ); // d->ed->appendSection( QNumberSection( 0,0, TRUE, 1 ) ); @@ -1787,11 +1787,11 @@ public: // d->overwrite = TRUE; // d->timerId = 0; // d->typing = FALSE; -// d->min = QTime( 0, 0, 0 ); -// d->max = QTime( 23, 59, 59 ); +// d->min = TQTime( 0, 0, 0 ); +// d->max = TQTime( 23, 59, 59 ); // d->changed = FALSE; // -// setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); +// setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); // // refcount++; // } @@ -1818,7 +1818,7 @@ public: // \sa maxValue setRange() // */ // -// QTime QTimeEdit::minValue() const +// TQTime QTimeEdit::minValue() const // { // return d->min; // } @@ -1834,7 +1834,7 @@ public: // \sa minValue setRange() // */ // -// QTime QTimeEdit::maxValue() const +// TQTime QTimeEdit::maxValue() const // { // return d->max; // } @@ -1846,7 +1846,7 @@ public: // Similarly, if \a max is invalid no maximum time is set. // */ // -// void QTimeEdit::setRange( const QTime& min, const QTime& max ) +// void QTimeEdit::setRange( const TQTime& min, const TQTime& max ) // { // if ( min.isValid() ) // d->min = min; @@ -1894,7 +1894,7 @@ public: // minValue(), or is greater than maxValue(), nothing happens. // */ // -// void QTimeEdit::setTime( const QTime& time ) +// void QTimeEdit::setTime( const TQTime& time ) // { // if ( !time.isValid() ) { // d->h = 0; @@ -1912,11 +1912,11 @@ public: // d->ed->repaint( d->ed->rect(), FALSE ); // } // -// QTime QTimeEdit::time() const +// TQTime QTimeEdit::time() const // { -// if ( QTime::isValid( d->h, d->m, d->s ) ) -// return QTime( d->h, d->m, d->s ); -// return QTime(); +// if ( TQTime::isValid( d->h, d->m, d->s ) ) +// return TQTime( d->h, d->m, d->s ); +// return TQTime(); // } // // /*! @@ -1944,7 +1944,7 @@ public: // character of \a s is used. // */ // -// void QTimeEdit::setSeparator( const QString& s ) +// void QTimeEdit::setSeparator( const TQString& s ) // { // d->ed->setSeparator( s ); // } @@ -1953,14 +1953,14 @@ public: // Returns the editor's separator. // */ // -// QString QTimeEdit::separator() const +// TQString QTimeEdit::separator() const // { // return d->ed->separator(); // } // // // /*! -// \fn void QTimeEdit::valueChanged( const QTime& time ) +// \fn void QTimeEdit::valueChanged( const TQTime& time ) // // This signal is emitted whenever the editor's value changes. The \a // time parameter is the new value. @@ -1970,15 +1970,15 @@ public: // // */ // -// bool QTimeEdit::event( QEvent *e ) +// bool QTimeEdit::event( TQEvent *e ) // { -// if ( e->type() == QEvent::FocusOut ) { +// if ( e->type() == TQEvent::FocusOut ) { // d->typing = FALSE; // if ( d->changed ) { // emit valueChanged( time() ); // d->changed = FALSE; // } -// } else if ( e->type() == QEvent::LocaleChange ) { +// } else if ( e->type() == TQEvent::LocaleChange ) { // readLocaleSettings(); // d->ed->setSeparator( localTimeSep() ); // } @@ -1989,7 +1989,7 @@ public: // // */ // -// void QTimeEdit::timerEvent( QTimerEvent * ) +// void QTimeEdit::timerEvent( TQTimerEvent * ) // { // d->overwrite = TRUE; // } @@ -2098,9 +2098,9 @@ public: // on \a sec. // */ // -// QString QTimeEdit::sectionFormattedText( int sec ) +// TQString QTimeEdit::sectionFormattedText( int sec ) // { -// QString txt; +// TQString txt; // txt = sectionText( sec ); // txt = txt.rightJustify( 2, EXTDATETIMEEDIT_HIDDEN_CHAR ); // int offset = sec*2+sec*separator().length() + txt.length(); @@ -2123,7 +2123,7 @@ public: // killTimer( d->timerId ); // d->overwrite = TRUE; // d->typing = FALSE; -// QString txt = sectionText( sec ); +// TQString txt = sectionText( sec ); // txt = txt.rightJustify( 2, EXTDATETIMEEDIT_HIDDEN_CHAR ); // int offset = sec*2+sec*separator().length() + txt.length(); // d->ed->setSectionSelection( sec, offset - txt.length(), offset ); @@ -2187,39 +2187,39 @@ public: // // */ // -// QString QTimeEdit::sectionText( int sec ) +// TQString QTimeEdit::sectionText( int sec ) // { // sec = d->ed->mapSection( sec ); // -// QString txt; +// TQString txt; // switch( sec ) { // case 0: // if ( !(d->display & AMPM) || ( d->h < 13 && d->h ) ) { // I wished the day stared at 0:00 for everybody -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // } else { // if ( d->h ) -// txt = QString::number( d->h - 12 ); +// txt = TQString::number( d->h - 12 ); // else // txt = "12"; // } // break; // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // break; // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // break; // case 3: // if ( d->h < 12 ) { // if ( lAM ) // txt = *lAM; // else -// txt = QString::fromLatin1( "AM" ); +// txt = TQString::fromLatin1( "AM" ); // } else { // if ( lPM ) // txt = *lPM; // else -// txt = QString::fromLatin1( "PM" ); +// txt = TQString::fromLatin1( "PM" ); // } // break; // default: @@ -2235,8 +2235,8 @@ public: // // bool QTimeEdit::outOfRange( int h, int m, int s ) const // { -// if ( QTime::isValid( h, m, s ) ) { -// QTime currentTime( h, m, s ); +// if ( TQTime::isValid( h, m, s ) ) { +// TQTime currentTime( h, m, s ); // if ( currentTime > maxValue() || // currentTime < minValue() ) // return TRUE; @@ -2259,12 +2259,12 @@ public: // bool overwrite = FALSE; // bool accepted = FALSE; // d->typing = TRUE; -// QString txt; +// TQString txt; // // switch( sec ) { // case 0: // txt = ( d->display & AMPM && d->h > 12 ) ? -// QString::number( d->h - 12 ) : QString::number( d->h ); +// TQString::number( d->h - 12 ) : TQString::number( d->h ); // // if ( d->overwrite || txt.length() == 2 ) { // if ( d->display & AMPM && num == 0 ) @@ -2276,7 +2276,7 @@ public: // d->h = num; // } // } else { -// txt += QString::number( num ); +// txt += TQString::number( num ); // int temp = txt.toInt(); // // if ( d->display & AMPM ) { @@ -2286,7 +2286,7 @@ public: // } // accepted = TRUE; // } else if ( outOfRange( temp + 12, d->m, d->s ) ) { -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // } else { // if ( d->h > 11 ) { // temp += 12; @@ -2294,7 +2294,7 @@ public: // accepted = TRUE; // } // } else if ( !(d->display & AMPM) && outOfRange( temp, d->m, d->s ) ) { -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // } else { // accepted = TRUE; // } @@ -2310,19 +2310,19 @@ public: // break; // // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // if ( d->overwrite || txt.length() == 2 ) { // if ( !outOfRange( d->h, num, d->s ) ) { // accepted = TRUE; // d->m = num; // } // } else { -// txt += QString::number( num ); +// txt += TQString::number( num ); // int temp = txt.toInt(); // if ( temp > 59 ) // temp = num; // if ( outOfRange( d->h, temp, d->s ) ) -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // else { // accepted = TRUE; // d->m = temp; @@ -2335,19 +2335,19 @@ public: // break; // // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // if ( d->overwrite || txt.length() == 2 ) { // if ( !outOfRange( d->h, d->m, num ) ) { // accepted = TRUE; // d->s = num; // } // } else { -// txt += QString::number( num ); +// txt += TQString::number( num ); // int temp = txt.toInt(); // if ( temp > 59 ) // temp = num; // if ( outOfRange( d->h, d->m, temp ) ) -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // else { // accepted = TRUE; // d->s = temp; @@ -2386,16 +2386,16 @@ public: // if ( sec == -1 ) // return; // sec = d->ed->mapSection( sec ); -// QString txt; +// TQString txt; // switch( sec ) { // case 0: -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // break; // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // break; // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // break; // } // txt = txt.mid( 1, txt.length() ) + "0"; @@ -2421,16 +2421,16 @@ public: // if ( sec == -1 ) // return; // sec = d->ed->mapSection( sec ); -// QString txt; +// TQString txt; // switch( sec ) { // case 0: -// txt = QString::number( d->h ); +// txt = TQString::number( d->h ); // break; // case 1: -// txt = QString::number( d->m ); +// txt = TQString::number( d->m ); // break; // case 2: -// txt = QString::number( d->s ); +// txt = TQString::number( d->s ); // break; // } // txt = txt.mid( 0, txt.length()-1 ); @@ -2450,18 +2450,18 @@ public: // // /*! \reimp // */ -// void QTimeEdit::resizeEvent( QResizeEvent * ) +// void QTimeEdit::resizeEvent( TQResizeEvent * ) // { // d->controls->resize( width(), height() ); // } // // /*! \reimp // */ -// QSize QTimeEdit::sizeHint() const +// TQSize QTimeEdit::sizeHint() const // { // constPolish(); -// QFontMetrics fm( font() ); -// int fw = style().pixelMetric( QStyle::PM_DefaultFrameWidth, this ); +// TQFontMetrics fm( font() ); +// int fw = style().pixelMetric( TQStyle::PM_DefaultFrameWidth, this ); // int h = fm.lineSpacing() + 2; // int w = 2 + fm.width( '9' ) * 6 + fm.width( d->ed->separator() ) * 2 + // d->controls->upRect().width() + fw * 4; @@ -2469,15 +2469,15 @@ public: // if ( lAM ) // w += fm.width( *lAM ) + 4; // else -// w += fm.width( QString::fromLatin1( "AM" ) ) + 4; +// w += fm.width( TQString::fromLatin1( "AM" ) ) + 4; // } // -// return QSize( w, QMAX(h + fw * 2,20) ).expandedTo( QApplication::globalStrut() ); +// return TQSize( w, QMAX(h + fw * 2,20) ).expandedTo( TQApplication::globalStrut() ); // } // // /*! \reimp // */ -// QSize QTimeEdit::minimumSizeHint() const +// TQSize QTimeEdit::minimumSizeHint() const // { // return sizeHint(); // } @@ -2558,8 +2558,8 @@ public: Constructs an empty datetime edit with parent \a parent and called \a name. */ -ExtDateTimeEdit::ExtDateTimeEdit( QWidget * parent, const char * name ) - : QWidget( parent, name ) +ExtDateTimeEdit::ExtDateTimeEdit( TQWidget * parent, const char * name ) + : TQWidget( parent, name ) { init(); } @@ -2572,8 +2572,8 @@ ExtDateTimeEdit::ExtDateTimeEdit( QWidget * parent, const char * name ) parent \a parent and called \a name. */ ExtDateTimeEdit::ExtDateTimeEdit( const ExtDateTime& datetime, - QWidget * parent, const char * name ) - : QWidget( parent, name ) + TQWidget * parent, const char * name ) + : TQWidget( parent, name ) { init(); setDateTime( datetime ); @@ -2598,7 +2598,7 @@ ExtDateTimeEdit::~ExtDateTimeEdit() for the ExtDateTimeEdit. */ -void ExtDateTimeEdit::resizeEvent( QResizeEvent * ) +void ExtDateTimeEdit::resizeEvent( TQResizeEvent * ) { int dw = de->sizeHint().width(); int tw = te->sizeHint().width(); @@ -2620,11 +2620,11 @@ void ExtDateTimeEdit::resizeEvent( QResizeEvent * ) /*! \reimp */ -QSize ExtDateTimeEdit::minimumSizeHint() const +TQSize ExtDateTimeEdit::minimumSizeHint() const { - QSize dsh = de->minimumSizeHint(); - QSize tsh = te->minimumSizeHint(); - return QSize( dsh.width() + tsh.width(), + TQSize dsh = de->minimumSizeHint(); + TQSize tsh = te->minimumSizeHint(); + return TQSize( dsh.width() + tsh.width(), QMAX( dsh.height(), tsh.height() ) ); } @@ -2637,23 +2637,23 @@ void ExtDateTimeEdit::init() de = new ExtDateEdit( this, "qt_datetime_dateedit" ); te = new QTimeEdit( this, "qt_datetime_timeedit" ); d->adv = FALSE; - connect( de, SIGNAL( valueChanged( const ExtDate& ) ), - this, SLOT( newValue( const ExtDate& ) ) ); - connect( te, SIGNAL( valueChanged( const QTime& ) ), - this, SLOT( newValue( const QTime& ) ) ); + connect( de, TQT_SIGNAL( valueChanged( const ExtDate& ) ), + this, TQT_SLOT( newValue( const ExtDate& ) ) ); + connect( te, TQT_SIGNAL( valueChanged( const TQTime& ) ), + this, TQT_SLOT( newValue( const TQTime& ) ) ); setFocusProxy( de ); - setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); + setSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); } /*! \reimp */ -QSize ExtDateTimeEdit::sizeHint() const +TQSize ExtDateTimeEdit::sizeHint() const { constPolish(); - QSize dsh = de->sizeHint(); - QSize tsh = te->sizeHint(); - return QSize( dsh.width() + tsh.width(), + TQSize dsh = de->sizeHint(); + TQSize tsh = te->sizeHint(); + return TQSize( dsh.width() + tsh.width(), QMAX( dsh.height(), tsh.height() ) ); } @@ -2702,7 +2702,7 @@ void ExtDateTimeEdit::newValue( const ExtDate& ) Re-emits the value \a t. */ -void ExtDateTimeEdit::newValue( const QTime& ) +void ExtDateTimeEdit::newValue( const TQTime& ) { ExtDateTime dt = dateTime(); emit valueChanged( dt ); diff --git a/libkdeedu/extdate/extdatetimeedit.h b/libkdeedu/extdate/extdatetimeedit.h index 048f7aa3..4bcf78c8 100644 --- a/libkdeedu/extdate/extdatetimeedit.h +++ b/libkdeedu/extdate/extdatetimeedit.h @@ -26,8 +26,8 @@ #define EXTDATETIMEEDIT_H #ifndef QT_H -#include -#include +#include +#include #endif // QT_H #include "extdatetime.h" @@ -40,11 +40,11 @@ class ExtDateTimeEditBase : public QWidget { Q_OBJECT public: - ExtDateTimeEditBase( QWidget* parent=0, const char* name=0 ) - : QWidget( parent, name ) {} + ExtDateTimeEditBase( TQWidget* parent=0, const char* name=0 ) + : TQWidget( parent, name ) {} virtual bool setFocusSection( int sec ) = 0; - virtual QString sectionFormattedText( int sec ) = 0; + virtual TQString sectionFormattedText( int sec ) = 0; virtual void addNumber( int sec, int num ) = 0; virtual void removeLastNumber( int sec ) = 0; @@ -72,8 +72,8 @@ class KDE_EXPORT ExtDateEdit : public ExtDateTimeEditBase // Q_PROPERTY( ExtDate minValue READ minValue WRITE setMinValue ) public: - ExtDateEdit( QWidget* parent=0, const char* name=0 ); - ExtDateEdit( const ExtDate& date, QWidget* parent=0, const char* name=0 ); + ExtDateEdit( TQWidget* parent=0, const char* name=0 ); + ExtDateEdit( const ExtDate& date, TQWidget* parent=0, const char* name=0 ); ~ExtDateEdit(); enum Order { DMY /**< Day-Month-Year */, @@ -81,8 +81,8 @@ public: YMD /**< Year-Month-Day, also the default */, YDM /**< Year-Day-Month @deprecated Included for completeness. */ }; - QSize sizeHint() const; - QSize minimumSizeHint() const; + TQSize sizeHint() const; + TQSize minimumSizeHint() const; public slots: virtual void setDate( const ExtDate& date ); @@ -99,8 +99,8 @@ public: virtual void setMaxValue( const ExtDate& d ) { setRange( minValue(), d ); } ExtDate maxValue() const; virtual void setRange( const ExtDate& min, const ExtDate& max ); - QString separator() const; - virtual void setSeparator( const QString& s ); + TQString separator() const; + virtual void setSeparator( const TQString& s ); // Make removeFirstNumber() virtual in ExtDateTimeEditBase in 4.0 void removeFirstNumber( int sec ); @@ -109,12 +109,12 @@ signals: void valueChanged( const ExtDate& date ); protected: - bool event( QEvent *e ); - void timerEvent( QTimerEvent * ); - void resizeEvent( QResizeEvent * ); + bool event( TQEvent *e ); + void timerEvent( TQTimerEvent * ); + void resizeEvent( TQResizeEvent * ); void stepUp(); void stepDown(); - QString sectionFormattedText( int sec ); + TQString sectionFormattedText( int sec ); void addNumber( int sec, int num ); void removeLastNumber( int sec ); @@ -133,7 +133,7 @@ private: void init(); int sectionOffsetEnd( int sec ) const; int sectionLength( int sec ) const; - QString sectionText( int sec ) const; + TQString sectionText( int sec ) const; ExtDateEditPrivate* d; #if defined(Q_DISABLE_COPY) @@ -148,10 +148,10 @@ private: // { // Q_OBJECT // Q_SETS( Display ) -// Q_PROPERTY( QTime time READ time WRITE setTime ) +// Q_PROPERTY( TQTime time READ time WRITE setTime ) // Q_PROPERTY( bool autoAdvance READ autoAdvance WRITE setAutoAdvance ) -// Q_PROPERTY( QTime maxValue READ maxValue WRITE setMaxValue ) -// Q_PROPERTY( QTime minValue READ minValue WRITE setMinValue ) +// Q_PROPERTY( TQTime maxValue READ maxValue WRITE setMaxValue ) +// Q_PROPERTY( TQTime minValue READ minValue WRITE setMinValue ) // Q_PROPERTY( Display display READ display WRITE setDisplay ) // // public: @@ -163,28 +163,28 @@ private: // AMPM = 0x10 // }; // -// QTimeEdit( QWidget* parent=0, const char* name=0 ); -// QTimeEdit( const QTime& time, QWidget* parent=0, const char* name=0 ); +// QTimeEdit( TQWidget* parent=0, const char* name=0 ); +// QTimeEdit( const TQTime& time, TQWidget* parent=0, const char* name=0 ); // ~QTimeEdit(); // -// QSize sizeHint() const; -// QSize minimumSizeHint() const; +// TQSize sizeHint() const; +// TQSize minimumSizeHint() const; // // public slots: -// virtual void setTime( const QTime& time ); +// virtual void setTime( const TQTime& time ); // // public: -// QTime time() const; +// TQTime time() const; // virtual void setAutoAdvance( bool advance ); // bool autoAdvance() const; // -// virtual void setMinValue( const QTime& d ) { setRange( d, maxValue() ); } -// QTime minValue() const; -// virtual void setMaxValue( const QTime& d ) { setRange( minValue(), d ); } -// QTime maxValue() const; -// virtual void setRange( const QTime& min, const QTime& max ); -// QString separator() const; -// virtual void setSeparator( const QString& s ); +// virtual void setMinValue( const TQTime& d ) { setRange( d, maxValue() ); } +// TQTime minValue() const; +// virtual void setMaxValue( const TQTime& d ) { setRange( minValue(), d ); } +// TQTime maxValue() const; +// virtual void setRange( const TQTime& min, const TQTime& max ); +// TQString separator() const; +// virtual void setSeparator( const TQString& s ); // // uint display() const; // void setDisplay( uint disp ); @@ -193,15 +193,15 @@ private: // void removeFirstNumber( int sec ); // // signals: -// void valueChanged( const QTime& time ); +// void valueChanged( const TQTime& time ); // // protected: -// bool event( QEvent *e ); -// void timerEvent( QTimerEvent *e ); -// void resizeEvent( QResizeEvent * ); +// bool event( TQEvent *e ); +// void timerEvent( TQTimerEvent *e ); +// void resizeEvent( TQResizeEvent * ); // void stepUp(); // void stepDown(); -// QString sectionFormattedText( int sec ); +// TQString sectionFormattedText( int sec ); // void addNumber( int sec, int num ); // void removeLastNumber( int sec ); // bool setFocusSection( int s ); @@ -216,7 +216,7 @@ private: // // private: // void init(); -// QString sectionText( int sec ); +// TQString sectionText( int sec ); // QTimeEditPrivate* d; // // #if defined(Q_DISABLE_COPY) @@ -234,13 +234,13 @@ class KDE_EXPORT ExtDateTimeEdit : public QWidget // Q_PROPERTY( ExtDateTime dateTime READ dateTime WRITE setDateTime ) public: - ExtDateTimeEdit( QWidget* parent=0, const char* name=0 ); - ExtDateTimeEdit( const ExtDateTime& datetime, QWidget* parent=0, + ExtDateTimeEdit( TQWidget* parent=0, const char* name=0 ); + ExtDateTimeEdit( const ExtDateTime& datetime, TQWidget* parent=0, const char* name=0 ); ~ExtDateTimeEdit(); - QSize sizeHint() const; - QSize minimumSizeHint() const; + TQSize sizeHint() const; + TQSize minimumSizeHint() const; public slots: virtual void setDateTime( const ExtDateTime & dt ); @@ -260,13 +260,13 @@ signals: protected: // ### make init() private in Qt 4.0 void init(); - void resizeEvent( QResizeEvent * ); + void resizeEvent( TQResizeEvent * ); protected slots: // ### make these two functions private in Qt 4.0, // and merge them into one with no parameter void newValue( const ExtDate& d ); - void newValue( const QTime& t ); + void newValue( const TQTime& t ); private: ExtDateEdit* de; @@ -313,24 +313,24 @@ public: // void setControlWidget( ExtDateTimeEditBase * widget ); // ExtDateTimeEditBase * controlWidget() const; - void setSeparator( const QString& s ); - QString separator() const; + void setSeparator( const TQString& s ); + TQString separator() const; int focusSection() const; bool setFocusSection( int s ); void appendSection( const QNumberSection& sec ); void clearSections(); void setSectionSelection( int sec, int selstart, int selend ); - bool eventFilter( QObject *o, QEvent *e ); - int sectionAt( const QPoint &p ); + bool eventFilter( TQObject *o, TQEvent *e ); + int sectionAt( const TQPoint &p ); int mapSection( int sec ); protected: void init(); - bool event( QEvent *e ); - void resizeEvent( QResizeEvent * ); - void paintEvent( QPaintEvent * ); - void mousePressEvent( QMouseEvent *e ); + bool event( TQEvent *e ); + void resizeEvent( TQResizeEvent * ); + void paintEvent( TQPaintEvent * ); + void mousePressEvent( TQMouseEvent *e ); private: ExtDateTimeEditBase* cw; diff --git a/libkdeedu/extdate/extdatewidget.cpp b/libkdeedu/extdate/extdatewidget.cpp index 6a3fcbf5..5f5d19d6 100644 --- a/libkdeedu/extdate/extdatewidget.cpp +++ b/libkdeedu/extdate/extdatewidget.cpp @@ -1,7 +1,7 @@ /* This file is part of the KDE libraries Copyright (C) 2001 Waldo Bastian (bastian@kde.org) - Modified to use ExtDate instead of QDate. Modifications + Modified to use ExtDate instead of TQDate. Modifications Copyright (C) 2004 Jason Harris (jharris@30doradus.org) This library is free software; you can redistribute it and/or @@ -20,9 +20,9 @@ */ -#include -#include -#include +#include +#include +#include #include #include @@ -33,8 +33,8 @@ class ExtDateWidgetSpinBox : public QSpinBox { public: - ExtDateWidgetSpinBox(int min, int max, QWidget *parent) - : QSpinBox(min, max, 1, parent) + ExtDateWidgetSpinBox(int min, int max, TQWidget *parent) + : TQSpinBox(min, max, 1, parent) { editor()->setAlignment(AlignRight); } @@ -46,23 +46,23 @@ public: ExtDateWidgetPrivate() { calendar = new ExtCalendarSystemGregorian(); } ~ExtDateWidgetPrivate() { delete calendar; } ExtDateWidgetSpinBox *m_day; - QComboBox *m_month; + TQComboBox *m_month; ExtDateWidgetSpinBox *m_year; ExtDate m_dat; ExtCalendarSystemGregorian *calendar; }; -ExtDateWidget::ExtDateWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) +ExtDateWidget::ExtDateWidget( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { init(ExtDate::currentDate()); setDate(ExtDate()); } -ExtDateWidget::ExtDateWidget( const ExtDate &date, QWidget *parent, +ExtDateWidget::ExtDateWidget( const ExtDate &date, TQWidget *parent, const char *name ) - : QWidget( parent, name ) + : TQWidget( parent, name ) { init(date); setDate(date); @@ -74,13 +74,13 @@ ExtDateWidget::ExtDateWidget( const ExtDate &date, QWidget *parent, // { // d = new ExtDateWidgetPrivate; // KLocale *locale = KGlobal::locale(); -// QHBoxLayout *layout = new QHBoxLayout(this, 0, KDialog::spacingHint()); +// TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint()); // layout->setAutoAdd(true); // d->m_day = new ExtDateWidgetSpinBox(1, 1, this); -// d->m_month = new QComboBox(false, this); +// d->m_month = new TQComboBox(false, this); // for (int i = 1; ; ++i) // { -// QString str = d->calendar->monthName(i, +// TQString str = d->calendar->monthName(i, // d->calendar->year(ExtDate())); // if (str.isNull()) break; // d->m_month->insertItem(str); @@ -89,22 +89,22 @@ ExtDateWidget::ExtDateWidget( const ExtDate &date, QWidget *parent, // d->m_year = new ExtDateWidgetSpinBox(d->calendar->minValidYear(), // d->calendar->maxValidYear(), this); // -// connect(d->m_day, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); -// connect(d->m_month, SIGNAL(activated(int)), this, SLOT(slotDateChanged())); -// connect(d->m_year, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); +// connect(d->m_day, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); +// connect(d->m_month, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotDateChanged())); +// connect(d->m_year, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); // } void ExtDateWidget::init(const ExtDate& date) { d = new ExtDateWidgetPrivate; //KLocale *locale = KGlobal::locale(); - QHBoxLayout *layout = new QHBoxLayout(this, 0, KDialog::spacingHint()); + TQHBoxLayout *layout = new TQHBoxLayout(this, 0, KDialog::spacingHint()); layout->setAutoAdd(true); d->m_day = new ExtDateWidgetSpinBox(1, 1, this); - d->m_month = new QComboBox(false, this); + d->m_month = new TQComboBox(false, this); for (int i = 1; ; ++i) { - QString str = d->calendar->monthName(i, + TQString str = d->calendar->monthName(i, d->calendar->year(date)); if (str.isNull()) break; d->m_month->insertItem(str); @@ -113,9 +113,9 @@ void ExtDateWidget::init(const ExtDate& date) d->m_year = new ExtDateWidgetSpinBox(d->calendar->minValidYear(), d->calendar->maxValidYear(), this); - connect(d->m_day, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); - connect(d->m_month, SIGNAL(activated(int)), this, SLOT(slotDateChanged())); - connect(d->m_year, SIGNAL(valueChanged(int)), this, SLOT(slotDateChanged())); + connect(d->m_day, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); + connect(d->m_month, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotDateChanged())); + connect(d->m_year, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotDateChanged())); } ExtDateWidget::~ExtDateWidget() diff --git a/libkdeedu/extdate/extdatewidget.h b/libkdeedu/extdate/extdatewidget.h index 66bec871..f2fd3045 100644 --- a/libkdeedu/extdate/extdatewidget.h +++ b/libkdeedu/extdate/extdatewidget.h @@ -1,7 +1,7 @@ /* This file is part of the KDE libraries Copyright (C) 2001 Waldo Bastian (bastian@kde.org) - Modified to use ExtDate instead of QDate. Modifications + Modified to use ExtDate instead of TQDate. Modifications Copyright (C) 2004 Jason Harris (jharris@30doradus.org) This library is free software; you can redistribute it and/or @@ -41,12 +41,12 @@ public: /** * Constructs a date selection widget, initialized to the current CPU date. */ - ExtDateWidget( QWidget *parent=0, const char *name=0 ); + ExtDateWidget( TQWidget *parent=0, const char *name=0 ); /** * Constructs a date selection widget with the initial date set to @p date. */ - ExtDateWidget( const ExtDate &date, QWidget *parent=0, const char *name=0 ); + ExtDateWidget( const ExtDate &date, TQWidget *parent=0, const char *name=0 ); /** * Destructs the date selection widget. diff --git a/libkdeedu/extdate/main.cpp b/libkdeedu/extdate/main.cpp index f71a6acd..bcc68a1f 100644 --- a/libkdeedu/extdate/main.cpp +++ b/libkdeedu/extdate/main.cpp @@ -25,6 +25,6 @@ int main( int argc, char *argv[] ) KApplication a; TestWidget *t = new TestWidget(0,0); t->show(); - QObject::connect(kapp, SIGNAL(lastWindowClosed()), kapp, SLOT(quit())); + TQObject::connect(kapp, TQT_SIGNAL(lastWindowClosed()), kapp, TQT_SLOT(quit())); return a.exec(); } diff --git a/libkdeedu/extdate/test_extdate.cc b/libkdeedu/extdate/test_extdate.cc index b21e228b..d63d1558 100644 --- a/libkdeedu/extdate/test_extdate.cc +++ b/libkdeedu/extdate/test_extdate.cc @@ -5,7 +5,7 @@ void test1_unit(int a_year) { - std::cout << a_year << " (QDate|ExtDate): " << ((QDate::leapYear(a_year)) ? "yes" : "no") + std::cout << a_year << " (QDate|ExtDate): " << ((TQDate::leapYear(a_year)) ? "yes" : "no") <<"|"<< ((ExtDate::leapYear(a_year)) ? "yes" : "no") << std::endl; } @@ -117,7 +117,7 @@ void test2() {2003, 11, 2} }; uint i; - std::cout << "(y, m, d) :: QDate : Q.dayOfWeek() : Q.weekNumber() : Q.dayOfYear() :: ExtDate : E.dayOfWeek() : E.weekNumber() : E.dayOfYear()\n" << std::endl; + std::cout << "(y, m, d) :: TQDate : Q.dayOfWeek() : Q.weekNumber() : Q.dayOfYear() :: ExtDate : E.dayOfWeek() : E.weekNumber() : E.dayOfYear()\n" << std::endl; for (i = 0 ; i < sizeof(a_set_of_dates)/sizeof(a_set_of_dates[0]) ; i++) { @@ -130,11 +130,11 @@ void test3_unit(int y, int m, int d, int dm) { QDate q(y, m, d); ExtDate e(y, m, d); - QDate q2 = q.addMonths(dm); + TQDate q2 = q.addMonths(dm); ExtDate e2 = e.addMonths(dm); std::cout << e.toString("%d.%b.%Y").local8Bit() << " + " << dm << " months :: ExtDate : " << e2.toString("%d.%b.%Y").local8Bit() - << " QDate : " << q2.toString("dd.MMM.yyyy").local8Bit() << std::endl; + << " TQDate : " << q2.toString("dd.MMM.yyyy").local8Bit() << std::endl; } void test3() @@ -162,7 +162,7 @@ void test4_unit(int y, int m, int d, int dy) QDate q2 = q.addYears(dy); ExtDate e2 = e.addYears(dy); std::cout << e.toString("%d.%m.%Y").local8Bit() << " + " << dy << " years :: ExtDate : " - << e2.toString().local8Bit() << " QDate : " + << e2.toString().local8Bit() << " TQDate : " << q2.toString().local8Bit() << std::endl; } @@ -189,10 +189,10 @@ void test4() void test5_unit(int y, int m, int d, const char *qformat, const char *eformat) { - QDate q(y, m, d); + TQDate q(y, m, d); ExtDate e(y, m, d); - if ( QString(qformat) == "" ) + if ( TQString(qformat) == "" ) std::cout << eformat << " : " << e.toString().local8Bit() << " :: " << qformat << " : " << q.toString().local8Bit() << std::endl; else @@ -238,7 +238,7 @@ void test6_unit(int y, int m, int d) { std::cout << d << "/" << m << "/" << y << " :: " << ( ExtDate::isValid(y, m, d) ? "TRUE" : "FALSE" ) << " : " - << ( QDate::isValid(y, m, d) ? "TRUE" : "FALSE" ) << std::endl; + << ( TQDate::isValid(y, m, d) ? "TRUE" : "FALSE" ) << std::endl; } void test6() @@ -265,7 +265,7 @@ void test6() }; uint i; std::cout << "Date.isValid()" << std::endl; - std::cout << "d/m/y :: ExtDate.isValid() : QDate.isValid()\n" << std::endl; + std::cout << "d/m/y :: ExtDate.isValid() : TQDate.isValid()\n" << std::endl; for (i = 0 ; i < sizeof(a_set_of_dates)/sizeof(a_set_of_dates[0]) ; i++) { @@ -277,29 +277,29 @@ void test6() void test7() { std::cout << "Express the current date:\n" << std::endl; - QDate q = QDate::currentDate(Qt::LocalTime); + TQDate q = TQDate::currentDate(Qt::LocalTime); ExtDate e = ExtDate::currentDate(Qt::TimeSpec(Qt::LocalTime)); - std::cout << "Qt::LocalTime :: ExtDate : " << e.toString().local8Bit() << " QDate : " + std::cout << "Qt::LocalTime :: ExtDate : " << e.toString().local8Bit() << " TQDate : " << q.toString().local8Bit() << std::endl; - q = QDate::currentDate(Qt::UTC); + q = TQDate::currentDate(Qt::UTC); e = ExtDate::currentDate(Qt::UTC); - std::cout << "Qt::UTC :: ExtDate : " << e.toString().local8Bit() << " QDate : " + std::cout << "Qt::UTC :: ExtDate : " << e.toString().local8Bit() << " TQDate : " << q.toString().local8Bit() << std::endl; - q = QDate::currentDate(); + q = TQDate::currentDate(); e = ExtDate::currentDate(); - std::cout << " :: ExtDate : " << e.toString().local8Bit() << " QDate : " + std::cout << " :: ExtDate : " << e.toString().local8Bit() << " TQDate : " << q.toString().local8Bit() << std::endl; std::cout << "--------------------" << std::endl; } void test8() { std::cout << "Set dates using days 1-32 for Jan and Feb (some will be invalid): \n" << std::endl; - std::cout << " QDate : ExtDate" << std::endl; + std::cout << " TQDate : ExtDate" << std::endl; for ( uint m=1; m<=2; ++m ) { for ( uint d=1; d<=32; ++d ) { - QDate test1( 2004, m, d ); + TQDate test1( 2004, m, d ); ExtDate test2( 2004, m, d ); std::cout << test1.toString( "ddd dd.MMM.yy" ).local8Bit() << " : " << test2.toString( "%a %d.%b.%y" ).local8Bit() << std::endl; @@ -310,8 +310,8 @@ void test8() { } void test9() { - std::cout << "QDateTime : ExtDateTime: \n" << std::endl; - QDateTime q = QDateTime::currentDateTime(); + std::cout << "TQDateTime : ExtDateTime: \n" << std::endl; + TQDateTime q = TQDateTime::currentDateTime(); ExtDateTime e = ExtDateTime::currentDateTime(); std::cout << q.toString().local8Bit() << " : " << e.toString().local8Bit() << std::endl; diff --git a/libkdeedu/extdate/testwidget.cpp b/libkdeedu/extdate/testwidget.cpp index 4dcd91c8..0267ddeb 100644 --- a/libkdeedu/extdate/testwidget.cpp +++ b/libkdeedu/extdate/testwidget.cpp @@ -18,20 +18,20 @@ #include #include #include -#include -#include +#include +#include #include "extdatepicker.h" #include "extdatewidget.h" #include "testwidget.h" -TestWidget::TestWidget( QWidget *p=0, const char *name=0 ) : KMainWindow( p, name ) { - QWidget *w = new QWidget(this); +TestWidget::TestWidget( TQWidget *p=0, const char *name=0 ) : KMainWindow( p, name ) { + TQWidget *w = new TQWidget(this); - glay = new QGridLayout(w, 3, 2); + glay = new TQGridLayout(w, 3, 2); - QLabel *kdpLabel = new QLabel( QString("KDatePicker"), w ); - QLabel *edpLabel = new QLabel( QString("ExtDatePicker"), w ); + TQLabel *kdpLabel = new TQLabel( TQString("KDatePicker"), w ); + TQLabel *edpLabel = new TQLabel( TQString("ExtDatePicker"), w ); kdp = new KDatePicker(w); edp = new ExtDatePicker(w); kdpEdit = new KLineEdit(w); @@ -39,7 +39,7 @@ TestWidget::TestWidget( QWidget *p=0, const char *name=0 ) : KMainWindow( p, nam edpEdit = new KLineEdit(w); edpEdit->setReadOnly( TRUE ); - kdw = new KDateWidget( QDate::currentDate(), w ); + kdw = new KDateWidget( TQDate::currentDate(), w ); edw = new ExtDateWidget( ExtDate::currentDate(), w ); glay->addWidget( kdpLabel, 0, 0 ); @@ -53,11 +53,11 @@ TestWidget::TestWidget( QWidget *p=0, const char *name=0 ) : KMainWindow( p, nam setCentralWidget(w); - connect( kdp, SIGNAL( dateChanged(QDate) ), this, SLOT( slotKDateChanged(QDate) ) ); - connect( edp, SIGNAL( dateChanged(const ExtDate&) ), this, SLOT( slotExtDateChanged(const ExtDate&) ) ); + connect( kdp, TQT_SIGNAL( dateChanged(TQDate) ), this, TQT_SLOT( slotKDateChanged(TQDate) ) ); + connect( edp, TQT_SIGNAL( dateChanged(const ExtDate&) ), this, TQT_SLOT( slotExtDateChanged(const ExtDate&) ) ); } -void TestWidget::slotKDateChanged(QDate d) { +void TestWidget::slotKDateChanged(TQDate d) { kdpEdit->setText( d.toString() ); } diff --git a/libkdeedu/extdate/testwidget.h b/libkdeedu/extdate/testwidget.h index ef69f8b6..fce00a39 100644 --- a/libkdeedu/extdate/testwidget.h +++ b/libkdeedu/extdate/testwidget.h @@ -32,15 +32,15 @@ class ExtDate; class TestWidget : public KMainWindow { Q_OBJECT public: - TestWidget( QWidget *parent, const char *name ); + TestWidget( TQWidget *parent, const char *name ); ~TestWidget() {} public slots: - void slotKDateChanged(QDate); + void slotKDateChanged(TQDate); void slotExtDateChanged(const ExtDate&); private: - QGridLayout *glay; + TQGridLayout *glay; KDatePicker *kdp; ExtDatePicker *edp; ExtDateWidget *edw; diff --git a/libkdeedu/kdeeducore/keduvocdata.cpp b/libkdeedu/kdeeducore/keduvocdata.cpp index 6ffe1ebe..c59d7595 100644 --- a/libkdeedu/kdeeducore/keduvocdata.cpp +++ b/libkdeedu/kdeeducore/keduvocdata.cpp @@ -18,7 +18,7 @@ #include "keduvocdata.h" -#include +#include #include @@ -33,7 +33,7 @@ KEduVocDataItem::KEduVocDataItem() } -KEduVocDataItem::KEduVocDataItem(QDomElement &entry) +KEduVocDataItem::KEduVocDataItem(TQDomElement &entry) { domElement = entry; } @@ -43,39 +43,39 @@ KEduVocDataItem::~KEduVocDataItem() } -QString KEduVocDataItem::originalText() const +TQString KEduVocDataItem::originalText() const { return getText("o"); } -QString KEduVocDataItem::translatedText() const +TQString KEduVocDataItem::translatedText() const { return getText("t"); } // protected methods -QString KEduVocDataItem::getText(const QString &tagName) const +TQString KEduVocDataItem::getText(const TQString &tagName) const { if(!domElement.isNull()) { - QDomNodeList list = domElement.elementsByTagName(tagName); + TQDomNodeList list = domElement.elementsByTagName(tagName); if(list.count() > 0) { - QDomElement element = list.item(0).toElement(); + TQDomElement element = list.item(0).toElement(); if(!element.isNull()) { return element.text(); } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } else - return QString::null; + return TQString::null; } //////////////////////////////////////////////////////////////////////////////// @@ -84,21 +84,21 @@ QString KEduVocDataItem::getText(const QString &tagName) const // public static methods -KEduVocDataItemList KEduVocData::parse(const QString &fileName) +KEduVocDataItemList KEduVocData::parse(const TQString &fileName) { KEduVocDataItemList list; - QDomDocument document; - QFile file(fileName); + TQDomDocument document; + TQFile file(fileName); document.setContent(&file); - QDomNodeList entries = document.elementsByTagName("e"); + TQDomNodeList entries = document.elementsByTagName("e"); // loop through the "e" (entry) tags looking for data for(uint i = 0 ; i < entries.count() ; i++) { // get an entry to operate on - QDomElement entry = entries.item(i).toElement(); + TQDomElement entry = entries.item(i).toElement(); // if the "node" is in fact an element -- i.e. not null if(!entry.isNull()) { diff --git a/libkdeedu/kdeeducore/keduvocdata.h b/libkdeedu/kdeeducore/keduvocdata.h index 4284ff08..b8ac6676 100644 --- a/libkdeedu/kdeeducore/keduvocdata.h +++ b/libkdeedu/kdeeducore/keduvocdata.h @@ -19,33 +19,33 @@ #ifndef KEDUVOCDATA_H #define KEDUVOCDATA_H -#include -#include +#include +#include #include class KDE_EXPORT KEduVocDataItem { public: KEduVocDataItem(); - KEduVocDataItem(QDomElement &entry); + KEduVocDataItem(TQDomElement &entry); virtual ~KEduVocDataItem(); - QString originalText() const; - QString translatedText() const; + TQString originalText() const; + TQString translatedText() const; protected: - QString getText(const QString &tagName) const; + TQString getText(const TQString &tagName) const; private: - QDomElement domElement; + TQDomElement domElement; }; -typedef QValueList KEduVocDataItemList; +typedef TQValueList KEduVocDataItemList; class KDE_EXPORT KEduVocData { public: - static KEduVocDataItemList parse(const QString &fileName); + static KEduVocDataItemList parse(const TQString &fileName); }; #endif // KEDUVOCDATA_H diff --git a/libkdeedu/kdeeduplot/kplotaxis.cpp b/libkdeedu/kdeeduplot/kplotaxis.cpp index 0099e0c2..69af4673 100644 --- a/libkdeedu/kdeeduplot/kplotaxis.cpp +++ b/libkdeedu/kdeeduplot/kplotaxis.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include #include #include "kplotaxis.h" @@ -25,7 +25,7 @@ KPlotAxis::KPlotAxis() : m_visible(true), m_labelFieldWidth(0), m_labelFmt('g'), { } -KPlotAxis::KPlotAxis(const QString& label) : m_visible(true), m_label(label), +KPlotAxis::KPlotAxis(const TQString& label) : m_visible(true), m_label(label), m_labelFieldWidth(0), m_labelFmt('g'), m_labelPrec(2) { } diff --git a/libkdeedu/kdeeduplot/kplotaxis.h b/libkdeedu/kdeeduplot/kplotaxis.h index 3a82417c..107620b8 100644 --- a/libkdeedu/kdeeduplot/kplotaxis.h +++ b/libkdeedu/kdeeduplot/kplotaxis.h @@ -18,7 +18,7 @@ #ifndef KPLOTAXIS_H #define KPLOTAXIS_H -#include +#include #include @@ -34,7 +34,7 @@ public: KPlotAxis(); /**@short Constructor, constructs a labeled axis. */ - KPlotAxis(const QString& label); + KPlotAxis(const TQString& label); /**@short Destructor. */ virtual ~KPlotAxis() {} @@ -55,12 +55,12 @@ public: *@param label A short string describing the data plotted on the axis. *Set the label to an empty string to omit the axis label. */ - virtual void setLabel( const QString& label ) { m_label = label; } + virtual void setLabel( const TQString& label ) { m_label = label; } /**@short Returns the axis label. */ - virtual QString label() const { return m_label; } + virtual TQString label() const { return m_label; } - /**@short Set the number format for the tick labels, see QString::arg() for + /**@short Set the number format for the tick labels, see TQString::arg() for description of arguments. */ virtual void setLabelFormat(int fieldWidth, char fmt = 'g', int prec=-1) { @@ -78,9 +78,9 @@ public: private: bool m_visible; ///< Property "visible" defines if Axis is drawn or not. QString m_label; ///< The label of the axis. - int m_labelFieldWidth; ///< Field width for number labels, see QString::arg(). - char m_labelFmt; ///< Number format for number labels, see QString::arg(). - int m_labelPrec; ///< Number precision for number labels, see QString::arg(). + int m_labelFieldWidth; ///< Field width for number labels, see TQString::arg(). + char m_labelFmt; ///< Number format for number labels, see TQString::arg(). + int m_labelPrec; ///< Number precision for number labels, see TQString::arg(). }; #endif // KPLOTAXIS_H diff --git a/libkdeedu/kdeeduplot/kplotobject.cpp b/libkdeedu/kdeeduplot/kplotobject.cpp index 145f12c3..b5aaf8d8 100644 --- a/libkdeedu/kdeeduplot/kplotobject.cpp +++ b/libkdeedu/kdeeduplot/kplotobject.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include +#include #include #include "kplotobject.h" @@ -23,7 +23,7 @@ KPlotObject::KPlotObject() { KPlotObject( "", "white", POINTS ); } -KPlotObject::KPlotObject( const QString &n, const QString &c, PTYPE t, unsigned int s, unsigned int p ) { +KPlotObject::KPlotObject( const TQString &n, const TQString &c, PTYPE t, unsigned int s, unsigned int p ) { //We use the set functions because they may include data validation setName( n ); setColor( c ); diff --git a/libkdeedu/kdeeduplot/kplotobject.h b/libkdeedu/kdeeduplot/kplotobject.h index 52d79540..69fcd054 100644 --- a/libkdeedu/kdeeduplot/kplotobject.h +++ b/libkdeedu/kdeeduplot/kplotobject.h @@ -25,7 +25,7 @@ class QPainter; #include /**class DRect - *@short equivalent of QRect with double x,y coordinates + *@short equivalent of TQRect with double x,y coordinates *@author Jason Harris *@version 1.0 */ @@ -52,7 +52,7 @@ private: }; /**class DPoint - *@short equivalent of QPoint with double x,y coordinates + *@short equivalent of TQPoint with double x,y coordinates *@author Jason Harris *@version 1.0 */ @@ -65,10 +65,10 @@ public: double x() const { return X; } double y() const { return Y; } - QPoint qpoint( QRect pb, DRect db ) { + TQPoint qpoint( TQRect pb, DRect db ) { int px = pb.left() + int( pb.width()*( x() - db.x() )/db.width() ); int py = pb.top() + int( pb.height()*( db.y2() - y() )/db.height() ); - return QPoint( px, py ); + return TQPoint( px, py ); } void setX( double x ) { X = x; } @@ -83,9 +83,9 @@ private: *@author Jason Harris *@version 1.0 *Each KPlotObject consists of a list of QPoints, an object type, a color, a size, - *and a QString name. An additional integer (param) specifies something further + *and a TQString name. An additional integer (param) specifies something further *about the object's appearance, depending on its type. There is a draw function - *for plotting the object on a KPlotWidget's QPainter. + *for plotting the object on a KPlotWidget's TQPainter. */ class KDE_EXPORT KPlotObject{ public: @@ -111,7 +111,7 @@ public: /**Constructor. Create a KPlotObject according to the arguments. */ - KPlotObject( const QString &name, const QString &color, PTYPE otype, unsigned int size=2, unsigned int param=0 ); + KPlotObject( const TQString &name, const TQString &color, PTYPE otype, unsigned int size=2, unsigned int param=0 ); /**Destructor (empty) */ @@ -119,21 +119,21 @@ public: /**@return the KPlotObject's Name */ - QString name() const { return Name; } + TQString name() const { return Name; } /**@short set the KPlotObject's Name *@param n the new name */ - void setName( const QString &n ) { Name = n; } + void setName( const TQString &n ) { Name = n; } /**@return the KPlotObject's Color */ - QString color() const { return Color; } + TQString color() const { return Color; } /**@short set the KPlotObject's Color *@param c the new color */ - void setColor( const QString &c ) { Color = c; } + void setColor( const TQString &c ) { Color = c; } /**@return the KPlotObject's Type */ @@ -169,7 +169,7 @@ public: */ DPoint* point( unsigned int i ) { return pList.at(i); } - QPtrList* points() { return &pList; } + TQPtrList* points() { return &pList; } /**@short Add a point to the object's list. *@param p the DPoint to add. @@ -182,7 +182,7 @@ public: */ void addPoint( DPoint *p ) { pList.append( p ); } -/**@short remove the QPoint at position index from the list of points +/**@short remove the TQPoint at position index from the list of points *@param index the index of the point to be removed. */ void removePoint( unsigned int index ); @@ -196,10 +196,10 @@ public: void clearPoints() { pList.clear(); } private: - QPtrList pList; + TQPtrList pList; PTYPE Type; unsigned int Size, Parameter; - QString Color, Name; + TQString Color, Name; }; #endif diff --git a/libkdeedu/kdeeduplot/kplotwidget.cpp b/libkdeedu/kdeeduplot/kplotwidget.cpp index e2103509..99e9b321 100644 --- a/libkdeedu/kdeeduplot/kplotwidget.cpp +++ b/libkdeedu/kdeeduplot/kplotwidget.cpp @@ -17,34 +17,34 @@ #include //for log10(), pow(), modf() #include -#include -#include +#include +#include #include "kplotwidget.h" #include "kplotwidget.moc" -KPlotWidget::KPlotWidget( double x1, double x2, double y1, double y2, QWidget *parent, const char* name ) - : QWidget( parent, name, WNoAutoErase ), +KPlotWidget::KPlotWidget( double x1, double x2, double y1, double y2, TQWidget *parent, const char* name ) + : TQWidget( parent, name, WNoAutoErase ), dXtick(0.0), dYtick(0.0), nmajX(0), nminX(0), nmajY(0), nminY(0), ShowTickMarks( true ), ShowTickLabels( true ), ShowGrid( false ) { - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); //set DataRect setLimits( x1, x2, y1, y2 ); setDefaultPadding(); //Set PixRect (starts at (0,0) because we will translate by leftPadding(), topPadding() ) - PixRect = QRect( 0, 0, width() - leftPadding() - rightPadding(), + PixRect = TQRect( 0, 0, width() - leftPadding() - rightPadding(), height() - topPadding() - bottomPadding() ); - buffer = new QPixmap(); + buffer = new TQPixmap(); //default colors: - setBGColor( QColor( "black" ) ); - setFGColor( QColor( "white" ) ); - setGridColor( QColor( "grey" ) ); + setBGColor( TQColor( "black" ) ); + setFGColor( TQColor( "white" ) ); + setGridColor( TQColor( "grey" ) ); ObjectList.setAutoDelete( true ); } @@ -131,16 +131,16 @@ void KPlotWidget::updateTickmarks() { } //end for iaxis } -void KPlotWidget::resizeEvent( QResizeEvent* /* e */ ) { +void KPlotWidget::resizeEvent( TQResizeEvent* /* e */ ) { int newWidth = width() - leftPadding() - rightPadding(); int newHeight = height() - topPadding() - bottomPadding(); - PixRect = QRect( 0, 0, newWidth, newHeight ); + PixRect = TQRect( 0, 0, newWidth, newHeight ); buffer->resize( width(), height() ); } -void KPlotWidget::paintEvent( QPaintEvent* /* e */ ) { - QPainter p; +void KPlotWidget::paintEvent( TQPaintEvent* /* e */ ) { + TQPainter p; p.begin( buffer ); p.fillRect( 0, 0, width(), height(), bgColor() ); @@ -153,20 +153,20 @@ void KPlotWidget::paintEvent( QPaintEvent* /* e */ ) { bitBlt( this, 0, 0, buffer ); } -void KPlotWidget::drawObjects( QPainter *p ) { +void KPlotWidget::drawObjects( TQPainter *p ) { for ( KPlotObject *po = ObjectList.first(); po; po = ObjectList.next() ) { if ( po->points()->count() ) { //draw the plot object - p->setPen( QColor( po->color() ) ); + p->setPen( TQColor( po->color() ) ); switch ( po->type() ) { case KPlotObject::POINTS : { - p->setBrush( QColor( po->color() ) ); + p->setBrush( TQColor( po->color() ) ); for ( DPoint *dp = po->points()->first(); dp; dp = po->points()->next() ) { - QPoint q = dp->qpoint( PixRect, DataRect ); + TQPoint q = dp->qpoint( PixRect, DataRect ); int x1 = q.x() - po->size()/2; int y1 = q.y() - po->size()/2; @@ -184,7 +184,7 @@ void KPlotWidget::drawObjects( QPainter *p ) { case KPlotObject::CURVE : { - p->setPen( QPen( QColor( po->color() ), po->size(), (QPen::PenStyle)po->param() ) ); + p->setPen( TQPen( TQColor( po->color() ), po->size(), (TQPen::PenStyle)po->param() ) ); DPoint *dp = po->points()->first(); p->moveTo( dp->qpoint( PixRect, DataRect ) ); for ( dp = po->points()->next(); dp; dp = po->points()->next() ) @@ -194,17 +194,17 @@ void KPlotWidget::drawObjects( QPainter *p ) { case KPlotObject::LABEL : //draw label centered at point in x, and slightly below point in y. { - QPoint q = po->points()->first()->qpoint( PixRect, DataRect ); + TQPoint q = po->points()->first()->qpoint( PixRect, DataRect ); p->drawText( q.x()-20, q.y()+6, 40, 10, Qt::AlignCenter | Qt::DontClip, po->name() ); break; } case KPlotObject::POLYGON : { - p->setPen( QPen( QColor( po->color() ), po->size(), (QPen::PenStyle)po->param() ) ); + p->setPen( TQPen( TQColor( po->color() ), po->size(), (TQPen::PenStyle)po->param() ) ); p->setBrush( po->color() ); - QPointArray a( po->count() ); + TQPointArray a( po->count() ); unsigned int i=0; for ( DPoint *dp = po->points()->first(); dp; dp = po->points()->next() ) @@ -222,7 +222,7 @@ void KPlotWidget::drawObjects( QPainter *p ) { double KPlotWidget::dmod( double a, double b ) { return ( b * ( ( a / b ) - int( a / b ) ) ); } -void KPlotWidget::drawBox( QPainter *p ) { +void KPlotWidget::drawBox( TQPainter *p ) { //First, fill in padding region with bgColor() to mask out-of-bounds plot data p->setPen( bgColor() ); p->setBrush( bgColor() ); @@ -269,7 +269,7 @@ void KPlotWidget::drawBox( QPainter *p ) { double dminY = dYtick/nminY; //set small font for tick labels - QFont f = p->font(); + TQFont f = p->font(); int s = f.pointSize(); f.setPointSize( s - 2 ); p->setFont( f ); @@ -294,9 +294,9 @@ void KPlotWidget::drawBox( QPainter *p ) { double lab = x0 + ix*dXtick; if ( fabs(lab)/dXtick < 0.00001 ) lab = 0.0; //fix occassional roundoff error with "0.0" label - QString str = QString( "%1" ).arg( lab, BottomAxis.labelFieldWidth(), BottomAxis.labelFmt(), BottomAxis.labelPrec() ); + TQString str = TQString( "%1" ).arg( lab, BottomAxis.labelFieldWidth(), BottomAxis.labelFmt(), BottomAxis.labelPrec() ); if ( px > 0 && px < PixRect.width() ) { - QRect r( px - BIGTICKSIZE, PixRect.height()+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); + TQRect r( px - BIGTICKSIZE, PixRect.height()+BIGTICKSIZE, 2*BIGTICKSIZE, BIGTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } } @@ -315,7 +315,7 @@ void KPlotWidget::drawBox( QPainter *p ) { // Draw X Axis Label if ( ! BottomAxis.label().isEmpty() ) { - QRect r( 0, PixRect.height() + 2*YPADDING, PixRect.width(), YPADDING ); + TQRect r( 0, PixRect.height() + 2*YPADDING, PixRect.width(), YPADDING ); p->drawText( r, Qt::AlignCenter, BottomAxis.label() ); } @@ -340,9 +340,9 @@ void KPlotWidget::drawBox( QPainter *p ) { double lab = y0 + iy*dYtick; if ( fabs(lab)/dYtick < 0.00001 ) lab = 0.0; //fix occassional roundoff error with "0.0" label - QString str = QString( "%1" ).arg( lab, LeftAxis.labelFieldWidth(), LeftAxis.labelFmt(), LeftAxis.labelPrec() ); + TQString str = TQString( "%1" ).arg( lab, LeftAxis.labelFieldWidth(), LeftAxis.labelFmt(), LeftAxis.labelPrec() ); if ( py > 0 && py < PixRect.height() ) { - QRect r( -2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); + TQRect r( -2*BIGTICKSIZE, py-SMALLTICKSIZE, 2*BIGTICKSIZE, 2*SMALLTICKSIZE ); p->drawText( r, Qt::AlignCenter | Qt::DontClip, str ); } } @@ -367,7 +367,7 @@ void KPlotWidget::drawBox( QPainter *p ) { p->translate( -3*XPADDING, PixRect.height() ); p->rotate( -90.0 ); - QRect r( 0, 0, PixRect.height(), XPADDING ); + TQRect r( 0, 0, PixRect.height(), XPADDING ); p->drawText( r, Qt::AlignCenter, LeftAxis.label() ); //draw the label, now that we are sideways p->restore(); //restore translation/rotation state diff --git a/libkdeedu/kdeeduplot/kplotwidget.h b/libkdeedu/kdeeduplot/kplotwidget.h index b24e31bf..216e6209 100644 --- a/libkdeedu/kdeeduplot/kplotwidget.h +++ b/libkdeedu/kdeeduplot/kplotwidget.h @@ -18,7 +18,7 @@ #ifndef _KPLOTWIDGET_H_ #define _KPLOTWIDGET_H_ -#include +#include #include "kplotobject.h" #include "kplotaxis.h" @@ -38,7 +38,7 @@ class QPixmap; *tickmarks and labels and a list of KPlotObjects to be drawn. */ -class KDE_EXPORT KPlotWidget : public QWidget { +class KDE_EXPORT KPlotWidget : public TQWidget { Q_OBJECT public: /**@short Constructor. Sets the primary x and y limits in data units. @@ -49,7 +49,7 @@ public: *@param parent the parent widget *@param name name label for the KPlotWidget */ - KPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0, const char* name=0 ); + KPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, TQWidget *parent=0, const char* name=0 ); /**Destructor (empty) */ @@ -111,28 +111,28 @@ public: virtual KPlotObject *object( int i ) { return ObjectList.at(i); } /**@return the background color */ - virtual QColor bgColor() const { return cBackground; } + virtual TQColor bgColor() const { return cBackground; } /**@return the foreground color */ - virtual QColor fgColor() const { return cForeground; } + virtual TQColor fgColor() const { return cForeground; } /**@return the grid color */ - virtual QColor gridColor() const { return cGrid; } + virtual TQColor gridColor() const { return cGrid; } /**@short set the background color *@param bg the new background color */ - virtual void setBGColor( const QColor &bg ) { cBackground = bg; setBackgroundColor( bg ); } + virtual void setBGColor( const TQColor &bg ) { cBackground = bg; setBackgroundColor( bg ); } /**@short set the foreground color *@param fg the new foreground color */ - virtual void setFGColor( const QColor &fg ) { cForeground = fg; } + virtual void setFGColor( const TQColor &fg ) { cForeground = fg; } /**@short set the grid color *@param gc the new grid color */ - virtual void setGridColor( const QColor &gc ) { cGrid = gc; } + virtual void setGridColor( const TQColor &gc ) { cGrid = gc; } /**@short toggle whether plot axes are drawn. *@param show if true, axes will be drawn. @@ -157,13 +157,13 @@ public: *Set the label to an empty string to omit the axis label. *This function is deprecated, set the label property in the BottomAxis directly. */ - virtual void setXAxisLabel( QString xlabel ) { BottomAxis.setLabel(xlabel); } + virtual void setXAxisLabel( TQString xlabel ) { BottomAxis.setLabel(xlabel); } /**@short (Deprecated) Sets the Y-axis label *@param ylabel a short string describing the data plotted on the y-axis. *Set the label to an empty string to omit the axis label. *This function is deprecated, set the label property in the LeftAxis directly. */ - virtual void setYAxisLabel( QString ylabel ) { LeftAxis.setLabel(ylabel); } + virtual void setYAxisLabel( TQString ylabel ) { LeftAxis.setLabel(ylabel); } /**@returns the number of pixels to the left of the plot area. Padding values *are set to -1 by default; if unchanged, this function will try to guess @@ -214,23 +214,23 @@ public: protected: /**@short the paint event handler, executed when update() or repaint() is called. */ - virtual void paintEvent( QPaintEvent* /* e */ ); + virtual void paintEvent( TQPaintEvent* /* e */ ); /**@short the resize event handler, called when the widget is resized. */ - virtual void resizeEvent( QResizeEvent* /* e */ ); + virtual void resizeEvent( TQResizeEvent* /* e */ ); /**@short draws all of the objects onto the widget. Internal use only; one should simply call update() *to draw the widget with axes and all objects. *@param p pointer to the painter on which we are drawing */ - virtual void drawObjects( QPainter *p ); + virtual void drawObjects( TQPainter *p ); /**@short draws the plot axes and axis labels. Internal use only; one should simply call update() *to draw the widget with axes and all objects. *@param p pointer to the painter on which we are drawing */ - virtual void drawBox( QPainter *p ); + virtual void drawBox( TQPainter *p ); /**@short modulus function for double variables. *For example, dmod( 17.0, 7.0 ) returns 3.0 @@ -244,20 +244,20 @@ protected: int nmajX, nminX, nmajY, nminY; //Limits of the plot area in pixel units - QRect PixRect; + TQRect PixRect; //Limits of the plot area in data units DRect DataRect; //List of KPlotObjects - QPtrList ObjectList; + TQPtrList ObjectList; //Colors - QColor cBackground, cForeground, cGrid; + TQColor cBackground, cForeground, cGrid; //draw options bool ShowTickMarks, ShowTickLabels, ShowGrid; //padding int LeftPadding, RightPadding, TopPadding, BottomPadding; - QPixmap *buffer; + TQPixmap *buffer; }; #endif diff --git a/libkdeedu/kdeeduui/kdeeduglossary.cpp b/libkdeedu/kdeeduui/kdeeduglossary.cpp index 5efb8a6d..1b0902b1 100644 --- a/libkdeedu/kdeeduui/kdeeduglossary.cpp +++ b/libkdeedu/kdeeduui/kdeeduglossary.cpp @@ -20,14 +20,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include Glossary::Glossary() { @@ -39,9 +39,9 @@ Glossary::~Glossary() { } -bool Glossary::loadLayout( QDomDocument &Document, const KURL& url ) +bool Glossary::loadLayout( TQDomDocument &Document, const KURL& url ) { - QFile layoutFile( url.path() ); + TQFile layoutFile( url.path() ); if (!layoutFile.exists()) { @@ -70,9 +70,9 @@ bool Glossary::isEmpty() const } -Glossary* Glossary::readFromXML( const KURL& url, const QString& path ) +Glossary* Glossary::readFromXML( const KURL& url, const TQString& path ) { - QDomDocument doc( "document" ); + TQDomDocument doc( "document" ); Glossary *glossary = new Glossary(); @@ -80,7 +80,7 @@ Glossary* Glossary::readFromXML( const KURL& url, const QString& path ) if ( glossary->loadLayout( doc, url ) ) { - QValueList itemList; + TQValueList itemList; itemList = glossary->readItems( doc ); glossary->setItemlist( itemList ); glossary->fixImagePath(); @@ -92,10 +92,10 @@ Glossary* Glossary::readFromXML( const KURL& url, const QString& path ) void Glossary::fixImagePath() { kdDebug() << "Glossary::fixImagePath()" << endl; - QValueList::iterator it = m_itemlist.begin(); - const QValueList::iterator itEnd = m_itemlist.end(); - QString path = m_picturepath; - QString firstpart = "::iterator it = m_itemlist.begin(); + const TQValueList::iterator itEnd = m_itemlist.end(); + TQString path = m_picturepath; + TQString firstpart = " Glossary::readItems( QDomDocument &itemDocument ) +TQValueList Glossary::readItems( TQDomDocument &itemDocument ) { - QValueList list; + TQValueList list; - QDomNodeList itemList; - QDomNodeList refNodeList; - QDomElement itemElement; - QStringList reflist; + TQDomNodeList itemList; + TQDomNodeList refNodeList; + TQDomElement itemElement; + TQStringList reflist; itemList = itemDocument.elementsByTagName( "item" ); @@ -122,15 +122,15 @@ QValueList Glossary::readItems( QDomDocument &itemDocument ) reflist.clear(); GlossaryItem *item = new GlossaryItem(); - itemElement = ( const QDomElement& ) itemList.item( i ).toElement(); + itemElement = ( const TQDomElement& ) itemList.item( i ).toElement(); - QDomNode nameNode = itemElement.namedItem( "name" ); - QDomNode descNode = itemElement.namedItem( "desc" ); + TQDomNode nameNode = itemElement.namedItem( "name" ); + TQDomNode descNode = itemElement.namedItem( "desc" ); - QString picName = itemElement.namedItem( "picture" ).toElement().text(); - QDomElement refNode = ( const QDomElement& ) itemElement.namedItem( "references" ).toElement(); + TQString picName = itemElement.namedItem( "picture" ).toElement().text(); + TQDomElement refNode = ( const TQDomElement& ) itemElement.namedItem( "references" ).toElement(); - QString desc = i18n( descNode.toElement().text().utf8() ); + TQString desc = i18n( descNode.toElement().text().utf8() ); if ( !picName.isEmpty() ) desc.prepend("[img]"+picName +"[/img]" ); @@ -162,7 +162,7 @@ QValueList Glossary::readItems( QDomDocument &itemDocument ) -GlossaryDialog::GlossaryDialog( bool folded, QWidget *parent, const char *name) +GlossaryDialog::GlossaryDialog( bool folded, TQWidget *parent, const char *name) : KDialogBase( Plain, i18n( "Glossary" ), Close, NoDefault, parent, name, false ) { //this string will be used for all items. If a backgroundpicture should @@ -171,17 +171,17 @@ GlossaryDialog::GlossaryDialog( bool folded, QWidget *parent, const char *name) m_folded = folded; - QVBoxLayout *vbox = new QVBoxLayout( plainPage(), 0, KDialog::spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( plainPage(), 0, KDialog::spacingHint() ); vbox->activate(); - QHBoxLayout *hbox = new QHBoxLayout( 0L, 0, KDialog::spacingHint() ); + TQHBoxLayout *hbox = new TQHBoxLayout( 0L, 0, KDialog::spacingHint() ); hbox->activate(); - QToolButton *clear = new QToolButton( plainPage() ); + TQToolButton *clear = new TQToolButton( plainPage() ); clear->setIconSet( SmallIconSet( "locationbar_erase" ) ); hbox->addWidget( clear ); - QLabel *lbl = new QLabel( plainPage() ); + TQLabel *lbl = new TQLabel( plainPage() ); lbl->setText( i18n( "Search:" ) ); hbox->addWidget( lbl ); @@ -190,7 +190,7 @@ GlossaryDialog::GlossaryDialog( bool folded, QWidget *parent, const char *name) vbox->addLayout( hbox ); setFocusProxy(m_search); - QSplitter *vs = new QSplitter( plainPage() ); + TQSplitter *vs = new TQSplitter( plainPage() ); vbox->addWidget( vs ); m_glosstree = new KListView( vs, "treeview" ); @@ -203,9 +203,9 @@ GlossaryDialog::GlossaryDialog( bool folded, QWidget *parent, const char *name) m_htmlpart = new KHTMLPart( vs, "html-part" ); - connect( m_htmlpart->browserExtension(), SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), this, SLOT( displayItem( const KURL &, const KParts::URLArgs & ) ) ); - connect( m_glosstree, SIGNAL(clicked( QListViewItem * )), this, SLOT(slotClicked( QListViewItem * ))); - connect( clear, SIGNAL(clicked()), m_search, SLOT(clear())); + connect( m_htmlpart->browserExtension(), TQT_SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), this, TQT_SLOT( displayItem( const KURL &, const KParts::URLArgs & ) ) ); + connect( m_glosstree, TQT_SIGNAL(clicked( TQListViewItem * )), this, TQT_SLOT(slotClicked( TQListViewItem * ))); + connect( clear, TQT_SIGNAL(clicked()), m_search, TQT_SLOT(clear())); resize( 600, 400 ); } @@ -214,7 +214,7 @@ GlossaryDialog::~GlossaryDialog() { } -void GlossaryDialog::keyPressEvent(QKeyEvent* e) +void GlossaryDialog::keyPressEvent(TQKeyEvent* e) { if (e->key() == Qt::Key_Return) { e->ignore(); @@ -225,12 +225,12 @@ void GlossaryDialog::keyPressEvent(QKeyEvent* e) void GlossaryDialog::displayItem( const KURL& url, const KParts::URLArgs& ) { // using the "host" part of a kurl as reference - QString myurl = url.host().lower(); + TQString myurl = url.host().lower(); m_search->setText( "" ); m_search->updateSearch( "" ); - QListViewItem *found = 0; - QListViewItemIterator it( m_glosstree ); - QListViewItem *item; + TQListViewItem *found = 0; + TQListViewItemIterator it( m_glosstree ); + TQListViewItem *item; while ( it.current() ) { item = it.current(); @@ -253,16 +253,16 @@ void GlossaryDialog::updateTree() { m_glosstree->clear(); - QValueList::const_iterator itGl = m_glossaries.begin(); - const QValueList::const_iterator itGlEnd = m_glossaries.end(); + TQValueList::const_iterator itGl = m_glossaries.begin(); + const TQValueList::const_iterator itGlEnd = m_glossaries.end(); for ( ; itGl != itGlEnd ; ++itGl ) { - QValueList items = ( *itGl )->itemlist(); - QValueList::iterator it = items.begin(); - const QValueList::iterator itEnd = items.end(); + TQValueList items = ( *itGl )->itemlist(); + TQValueList::iterator it = items.begin(); + const TQValueList::iterator itEnd = items.end(); - QListViewItem *main = new QListViewItem( m_glosstree, ( *itGl )->name() ); + TQListViewItem *main = new TQListViewItem( m_glosstree, ( *itGl )->name() ); main->setExpandable( true ); main->setSelectable( false ); //XXX TMP!!! @@ -272,18 +272,18 @@ void GlossaryDialog::updateTree() { if ( foldinsubtrees ) { - QChar thisletter = ( *it )->name().upper()[0]; - QListViewItem *thisletteritem = findTreeWithLetter( thisletter, main ); + TQChar thisletter = ( *it )->name().upper()[0]; + TQListViewItem *thisletteritem = findTreeWithLetter( thisletter, main ); if ( !thisletteritem ) { - thisletteritem = new QListViewItem( main, thisletter ); + thisletteritem = new TQListViewItem( main, thisletter ); thisletteritem->setExpandable( true ); thisletteritem->setSelectable( false ); } - new QListViewItem( thisletteritem, ( *it )->name() ); + new TQListViewItem( thisletteritem, ( *it )->name() ); } else - new QListViewItem( main, ( *it )->name() ); + new TQListViewItem( main, ( *it )->name() ); } main->sort(); } @@ -301,9 +301,9 @@ void GlossaryDialog::addGlossary( Glossary* newgloss ) updateTree(); } -QListViewItem* GlossaryDialog::findTreeWithLetter( const QChar& l, QListViewItem* i ) +TQListViewItem* GlossaryDialog::findTreeWithLetter( const TQChar& l, TQListViewItem* i ) { - QListViewItem *it = i->firstChild(); + TQListViewItem *it = i->firstChild(); while ( it ) { if ( it->text(0)[0] == l ) @@ -313,7 +313,7 @@ QListViewItem* GlossaryDialog::findTreeWithLetter( const QChar& l, QListViewItem return 0; } -void GlossaryDialog::slotClicked( QListViewItem *item ) +void GlossaryDialog::slotClicked( TQListViewItem *item ) { if ( !item ) return; @@ -323,18 +323,18 @@ void GlossaryDialog::slotClicked( QListViewItem *item ) * in the m_itemList. When it is found the HTML will be * generated */ - QValueList::iterator itGl = m_glossaries.begin(); - const QValueList::iterator itGlEnd = m_glossaries.end(); + TQValueList::iterator itGl = m_glossaries.begin(); + const TQValueList::iterator itGlEnd = m_glossaries.end(); bool found = false; GlossaryItem *i = 0; - QString bg_picture; + TQString bg_picture; while ( !found && itGl != itGlEnd ) { - QValueList items = ( *itGl )->itemlist(); - QValueList::const_iterator it = items.begin(); - const QValueList::const_iterator itEnd = items.end(); + TQValueList items = ( *itGl )->itemlist(); + TQValueList::const_iterator it = items.begin(); + const TQValueList::const_iterator itEnd = items.end(); while ( !found && it != itEnd ) { if ( ( *it )->name() == item->text( 0 ) ) @@ -349,7 +349,7 @@ void GlossaryDialog::slotClicked( QListViewItem *item ) } if ( found && i ) { - QString html; + TQString html; if ( !bg_picture.isEmpty() ) { html = "" + m_desc; + TQString code = "

" + m_name + "

" + m_desc; if ( !m_ref.isEmpty() ) { - QString refcode = parseReferences(); + TQString refcode = parseReferences(); code += refcode; } return code; } -QString GlossaryItem::parseReferences() const +TQString GlossaryItem::parseReferences() const { - QString htmlcode = "

" + i18n( "References" ) + "

"; + TQString htmlcode = "

" + i18n( "References" ) + "

"; bool first = true; for ( uint i = 0; i < m_ref.size(); i++ ) @@ -396,7 +396,7 @@ QString GlossaryItem::parseReferences() const htmlcode += "
"; else first = false; - htmlcode += QString( "%2" ).arg( m_ref[i], m_ref[i] ); + htmlcode += TQString( "%2" ).arg( m_ref[i], m_ref[i] ); } return htmlcode; diff --git a/libkdeedu/kdeeduui/kdeeduglossary.h b/libkdeedu/kdeeduui/kdeeduglossary.h index 418967f6..d6628d99 100644 --- a/libkdeedu/kdeeduui/kdeeduglossary.h +++ b/libkdeedu/kdeeduui/kdeeduglossary.h @@ -47,7 +47,7 @@ class Glossary m_itemlist.append( item ); } - QValueList itemlist()const{ + TQValueList itemlist()const{ return m_itemlist; } @@ -67,21 +67,21 @@ class Glossary * Every glossary can have a name. It will be * set to @p name */ - void setName( const QString& name ){ + void setName( const TQString& name ){ m_name = name; } /** * @returns the name of the glossary */ - QString name()const{ + TQString name()const{ return m_name; } /** * sets the internal list of items to @p list */ - void setItemlist( QValueList list ){ + void setItemlist( TQValueList list ){ m_itemlist = list; } @@ -94,18 +94,18 @@ class Glossary * @return a pointer to the loaded glossary. Even in case of * error, this won't return 0 but an empty Glossary. */ - static Glossary* readFromXML( const KURL& url, const QString& path = 0 ); + static Glossary* readFromXML( const KURL& url, const TQString& path = 0 ); /** * Every glossaryitem can show pictures. [img src="foo.png] * will look for the file foo.png in the path defined be * @p path */ - void setPicturePath( const QString& path ){ + void setPicturePath( const TQString& path ){ m_picturepath = path; } - QString picturePath()const{ + TQString picturePath()const{ return m_picturepath; } @@ -114,7 +114,7 @@ class Glossary * of the htmlview. The dialog * will use the file specifiec by the @p filename */ - void setBackgroundPicture( const QString& filename ){ + void setBackgroundPicture( const TQString& filename ){ m_backgroundpicture = filename; } @@ -122,7 +122,7 @@ class Glossary * @return the picuture used as the background in * this background */ - QString backgroundPicture()const{ + TQString backgroundPicture()const{ return m_backgroundpicture; } @@ -130,11 +130,11 @@ class Glossary /** * This methods parses the given xml-code. It will extract * the information of the items and return them as a - * QValueList + * TQValueList */ - virtual QValueList readItems( QDomDocument &itemDocument ); + virtual TQValueList readItems( TQDomDocument &itemDocument ); - QString m_backgroundpicture; + TQString m_backgroundpicture; /** * replaces the [img]-pseudocode with valid html. The path where @@ -145,26 +145,26 @@ class Glossary /** * the path in which pictures of the glossary will be searched */ - QString m_picturepath; + TQString m_picturepath; /** * Load the layout from an XML file. * - * @param doc The QDomDocument which will contain the read XML + * @param doc The TQDomDocument which will contain the read XML * contents. * @param url The path of the file to load * * @return a bool indicating whether the loading of the XML was * successfull or not */ - bool loadLayout( QDomDocument& doc, const KURL& url ); + bool loadLayout( TQDomDocument& doc, const KURL& url ); - QValueList m_itemlist; + TQValueList m_itemlist; /** * the name of the glossary */ - QString m_name; + TQString m_name; }; /** @@ -182,54 +182,54 @@ class GlossaryItem GlossaryItem(){} ~GlossaryItem(){} - void setName( const QString& s ){ + void setName( const TQString& s ){ m_name = s; } - void setDesc( const QString& s){ + void setDesc( const TQString& s){ m_desc = s; } - void setRef( const QStringList& s){ + void setRef( const TQStringList& s){ m_ref = s; } - void setPictures( const QString& s ){ + void setPictures( const TQString& s ){ m_pic = s; } - QString name() const { + TQString name() const { return m_name; } - QString desc() const { + TQString desc() const { return m_desc; } - QStringList ref() const { + TQStringList ref() const { return m_ref; } - QStringList pictures() const { + TQStringList pictures() const { return m_pic; } /** * @return the formated HTML code for current item. **/ - QString toHtml() const; + TQString toHtml() const; /** * This method parses the references. * @return the HTML code with the references as HTML links */ - QString parseReferences() const; + TQString parseReferences() const; private: - QString m_name; - QString m_desc; - QStringList m_ref; - QStringList m_pic; + TQString m_name; + TQString m_desc; + TQStringList m_ref; + TQStringList m_pic; }; /** @@ -242,10 +242,10 @@ class GlossaryDialog : public KDialogBase Q_OBJECT public: - GlossaryDialog( bool folded = true, QWidget *parent=0, const char *name=0); + GlossaryDialog( bool folded = true, TQWidget *parent=0, const char *name=0); ~GlossaryDialog(); - void keyPressEvent(QKeyEvent*); + void keyPressEvent(TQKeyEvent*); /** * add a new glossary @@ -255,7 +255,7 @@ class GlossaryDialog : public KDialogBase void addGlossary( Glossary* newgloss ); private: - QValueList m_glossaries; + TQValueList m_glossaries; /** * if true the items will be displayed folded @@ -266,16 +266,16 @@ class GlossaryDialog : public KDialogBase KHTMLPart *m_htmlpart; KListView *m_glosstree; - QString m_htmlbasestring; + TQString m_htmlbasestring; KActionCollection* m_actionCollection; - QListViewItem* findTreeWithLetter( const QChar&, QListViewItem* ); + TQListViewItem* findTreeWithLetter( const TQChar&, TQListViewItem* ); KListViewSearchLine *m_search; private slots: - void slotClicked( QListViewItem * ); + void slotClicked( TQListViewItem * ); /** * The user clicked on a href. Emit the corresponding item */ -- cgit v1.2.1

" << g->horizontalHeader()->label(0) << "

" + g->horizontalHeader()->label(1) << "

" << QString::number(i + 1) << "

" << TQString::number(i + 1) << "

" << g->text(i, 0) << "

" << g->text(i, 1) << "