diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kcontrol/joystick | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/joystick')
-rw-r--r-- | kcontrol/joystick/caldialog.cpp | 36 | ||||
-rw-r--r-- | kcontrol/joystick/caldialog.h | 6 | ||||
-rw-r--r-- | kcontrol/joystick/joydevice.cpp | 4 | ||||
-rw-r--r-- | kcontrol/joystick/joydevice.h | 14 | ||||
-rw-r--r-- | kcontrol/joystick/joystick.cpp | 4 | ||||
-rw-r--r-- | kcontrol/joystick/joystick.h | 2 | ||||
-rw-r--r-- | kcontrol/joystick/joywidget.cpp | 90 | ||||
-rw-r--r-- | kcontrol/joystick/joywidget.h | 22 | ||||
-rw-r--r-- | kcontrol/joystick/poswidget.cpp | 12 | ||||
-rw-r--r-- | kcontrol/joystick/poswidget.h | 6 |
10 files changed, 98 insertions, 98 deletions
diff --git a/kcontrol/joystick/caldialog.cpp b/kcontrol/joystick/caldialog.cpp index f8340d03c..095f18f41 100644 --- a/kcontrol/joystick/caldialog.cpp +++ b/kcontrol/joystick/caldialog.cpp @@ -22,10 +22,10 @@ #include "caldialog.h" #include "joydevice.h" -#include <qlabel.h> -#include <qtimer.h> -#include <qapplication.h> -#include <qvbox.h> +#include <tqlabel.h> +#include <tqtimer.h> +#include <tqapplication.h> +#include <tqvbox.h> #include <klocale.h> #include <kmessagebox.h> @@ -33,17 +33,17 @@ //-------------------------------------------------------------- -CalDialog::CalDialog(QWidget *parent, JoyDevice *joy) +CalDialog::CalDialog(TQWidget *parent, JoyDevice *joy) : KDialogBase(parent, "calibrateDialog", true, i18n("Calibration"), KDialogBase::Cancel|KDialogBase::User1, KDialogBase::User1, true, KGuiItem(i18n("Next"))), joydev(joy) { - QVBox *main = makeVBoxMainWidget(); + TQVBox *main = makeVBoxMainWidget(); - text = new QLabel(main); + text = new TQLabel(main); text->setMinimumHeight(200); - valueLbl = new QLabel(main); + valueLbl = new TQLabel(main); } //-------------------------------------------------------------- @@ -56,7 +56,7 @@ void CalDialog::calibrate() // calibrate precision (which min,max delivers the joystick in its center position) // get values through the normal idle procedure - QTimer ti; + TQTimer ti; ti.start(2000, true); // single shot in 2 seconds // normally I'd like to hide the 'Next' button in this step, @@ -67,15 +67,15 @@ void CalDialog::calibrate() { qApp->processEvents(2000); } - while ( ti.isActive() && (result() != QDialog::Rejected) ); + while ( ti.isActive() && (result() != TQDialog::Rejected) ); - if ( result() == QDialog::Rejected ) return; // user cancelled the dialog + if ( result() == TQDialog::Rejected ) return; // user cancelled the dialog joydev->calcPrecision(); int i, lastVal; int min[2], center[2], max[2]; - QString hint; + TQString hint; for (i = 0; i < joydev->numAxes(); i++) { @@ -93,12 +93,12 @@ void CalDialog::calibrate() "to continue with the next step.</qt>").arg(i+1).arg(hint)); waitButton(i, true, lastVal); - if ( result() == QDialog::Rejected ) return; // user cancelled the dialog + if ( result() == TQDialog::Rejected ) return; // user cancelled the dialog joydev->resetMinMax(i, lastVal); if ( result() != -2 ) waitButton(i, false, lastVal); - if ( result() == QDialog::Rejected ) return; // user cancelled the dialog + if ( result() == TQDialog::Rejected ) return; // user cancelled the dialog min[0] = joydev->axisMin(i); min[1] = joydev->axisMax(i); @@ -110,12 +110,12 @@ void CalDialog::calibrate() "to continue with the next step.</qt>").arg(i+1).arg(hint)); waitButton(i, true, lastVal); - if ( result() == QDialog::Rejected ) return; // user cancelled the dialog + if ( result() == TQDialog::Rejected ) return; // user cancelled the dialog joydev->resetMinMax(i, lastVal); if ( result() != -2 ) waitButton(i, false, lastVal); - if ( result() == QDialog::Rejected ) return; // user cancelled the dialog + if ( result() == TQDialog::Rejected ) return; // user cancelled the dialog center[0] = joydev->axisMin(i); center[1] = joydev->axisMax(i); @@ -127,12 +127,12 @@ void CalDialog::calibrate() "to continue with the next step.</qt>").arg(i+1).arg(hint)); waitButton(i, true, lastVal); - if ( result() == QDialog::Rejected ) return; // user cancelled the dialog + if ( result() == TQDialog::Rejected ) return; // user cancelled the dialog joydev->resetMinMax(i, lastVal); if ( result() != -2 ) waitButton(i, false, lastVal); - if ( result() == QDialog::Rejected ) return; // user cancelled the dialog + if ( result() == TQDialog::Rejected ) return; // user cancelled the dialog max[0] = joydev->axisMin(i); max[1] = joydev->axisMax(i); diff --git a/kcontrol/joystick/caldialog.h b/kcontrol/joystick/caldialog.h index 678a0a2d1..02e151e45 100644 --- a/kcontrol/joystick/caldialog.h +++ b/kcontrol/joystick/caldialog.h @@ -34,7 +34,7 @@ class CalDialog : public KDialogBase Q_OBJECT public: - CalDialog(QWidget *parent, JoyDevice *joy); + CalDialog(TQWidget *parent, JoyDevice *joy); void calibrate(); @@ -47,8 +47,8 @@ class CalDialog : public KDialogBase private: JoyDevice *joydev; - QLabel *text; - QLabel *valueLbl; + TQLabel *text; + TQLabel *valueLbl; }; #endif diff --git a/kcontrol/joystick/joydevice.cpp b/kcontrol/joystick/joydevice.cpp index 2c1a16ce7..76067ee17 100644 --- a/kcontrol/joystick/joydevice.cpp +++ b/kcontrol/joystick/joydevice.cpp @@ -36,7 +36,7 @@ //-------------------------------------------------------------- -JoyDevice::JoyDevice(const QString &devicefile) +JoyDevice::JoyDevice(const TQString &devicefile) : devName(devicefile), joyFd(-1), buttons(0), axes(0), amin(0), amax(0), corr(0), origCorr(0) { @@ -44,7 +44,7 @@ JoyDevice::JoyDevice(const QString &devicefile) //-------------------------------------------------------------- -QString JoyDevice::errText(ErrorCode code) const +TQString JoyDevice::errText(ErrorCode code) const { switch ( code ) { diff --git a/kcontrol/joystick/joydevice.h b/kcontrol/joystick/joydevice.h index b84464241..29d4c49ce 100644 --- a/kcontrol/joystick/joydevice.h +++ b/kcontrol/joystick/joydevice.h @@ -21,7 +21,7 @@ #ifndef _JOYDEVICE_H_ #define _JOYDEVICE_H_ -#include <qstring.h> +#include <tqstring.h> #include <sys/types.h> #undef __STRICT_ANSI__ @@ -55,24 +55,24 @@ class JoyDevice }; // devicefile to use, e.g. "/dev/js0" - JoyDevice(const QString &devicefile); + JoyDevice(const TQString &devicefile); ~JoyDevice(); // returns one of the error-codes from above ErrorCode open(); // return descriptive error text for given error code - QString errText(ErrorCode code) const; + TQString errText(ErrorCode code) const; int fd() const { return joyFd; } void close(); ErrorCode restoreCorr(); // return devicefilename from constructor - const QString &device() const { return devName; } + const TQString &device() const { return devName; } // descriptive text for this device read from the driver - QString text() const { return descr; } + TQString text() const { return descr; } int numButtons() const { return buttons; } int numAxes() const { return axes; } @@ -94,8 +94,8 @@ class JoyDevice ErrorCode applyCalibration(); private: - QString devName; // device filename - QString descr; // descriptive text + TQString devName; // device filename + TQString descr; // descriptive text int joyFd; int buttons; diff --git a/kcontrol/joystick/joystick.cpp b/kcontrol/joystick/joystick.cpp index 75115fcb7..3ffc0e1d7 100644 --- a/kcontrol/joystick/joystick.cpp +++ b/kcontrol/joystick/joystick.cpp @@ -30,7 +30,7 @@ //--------------------------------------------------------------------------------------------- -typedef KGenericFactory<joystick, QWidget> JoystickFactory; +typedef KGenericFactory<joystick, TQWidget> JoystickFactory; K_EXPORT_COMPONENT_FACTORY(kcm_joystick, JoystickFactory("joystick")) extern "C" @@ -66,7 +66,7 @@ extern "C" //--------------------------------------------------------------------------------------------- -joystick::joystick(QWidget *parent, const char *name, const QStringList &) +joystick::joystick(TQWidget *parent, const char *name, const TQStringList &) : KCModule(JoystickFactory::instance(), parent, name) { setAboutData( new KAboutData("kcmjoystick", I18N_NOOP("KDE Joystick Control Module"), "1.0", diff --git a/kcontrol/joystick/joystick.h b/kcontrol/joystick/joystick.h index 819a5f70d..bebb8115d 100644 --- a/kcontrol/joystick/joystick.h +++ b/kcontrol/joystick/joystick.h @@ -30,7 +30,7 @@ class joystick: public KCModule Q_OBJECT public: - joystick(QWidget *parent = 0, const char *name = 0, const QStringList &list = QStringList()); + joystick(TQWidget *parent = 0, const char *name = 0, const TQStringList &list = TQStringList()); virtual void load(); virtual void defaults(); diff --git a/kcontrol/joystick/joywidget.cpp b/kcontrol/joystick/joywidget.cpp index a4d42e3f1..cfc293b89 100644 --- a/kcontrol/joystick/joywidget.cpp +++ b/kcontrol/joystick/joywidget.cpp @@ -23,16 +23,16 @@ #include "poswidget.h" #include "caldialog.h" -#include <qhbox.h> -#include <qvbox.h> -#include <qtable.h> -#include <qlabel.h> -#include <qcombobox.h> -#include <qlistbox.h> -#include <qcheckbox.h> -#include <qtimer.h> -#include <qfontmetrics.h> -#include <qpushbutton.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqtable.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqlistbox.h> +#include <tqcheckbox.h> +#include <tqtimer.h> +#include <tqfontmetrics.h> +#include <tqpushbutton.h> #include <klocale.h> #include <kdialog.h> @@ -40,57 +40,57 @@ #include <kiconloader.h> //-------------------------------------------------------------- -static QString PRESSED = I18N_NOOP("PRESSED"); +static TQString PRESSED = I18N_NOOP("PRESSED"); //-------------------------------------------------------------- -JoyWidget::JoyWidget(QWidget *parent, const char *name) - : QWidget(parent, name), idle(0), joydev(0) +JoyWidget::JoyWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name), idle(0), joydev(0) { - QVBox *mainVbox = new QVBox(parent); + TQVBox *mainVbox = new TQVBox(parent); mainVbox->setSpacing(KDialog::spacingHint()); // create area to show an icon + message if no joystick was detected { - messageBox = new QHBox(mainVbox); + messageBox = new TQHBox(mainVbox); messageBox->setSpacing(KDialog::spacingHint()); - QLabel *icon = new QLabel(messageBox); + TQLabel *icon = new TQLabel(messageBox); icon->setPixmap(KGlobal::iconLoader()->loadIcon("messagebox_warning", KIcon::NoGroup, KIcon::SizeMedium, KIcon::DefaultState, 0, true)); icon->setFixedSize(icon->sizeHint()); - message = new QLabel(messageBox); + message = new TQLabel(messageBox); messageBox->hide(); } - QHBox *devHbox = new QHBox(mainVbox); - new QLabel(i18n("Device:"), devHbox); - device = new QComboBox(true, devHbox); - device->setInsertionPolicy(QComboBox::NoInsertion); - connect(device, SIGNAL(activated(const QString &)), this, SLOT(deviceChanged(const QString &))); + TQHBox *devHbox = new TQHBox(mainVbox); + new TQLabel(i18n("Device:"), devHbox); + device = new TQComboBox(true, devHbox); + device->setInsertionPolicy(TQComboBox::NoInsertion); + connect(device, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(deviceChanged(const TQString &))); devHbox->setStretchFactor(device, 3); - QHBox *hbox = new QHBox(mainVbox); + TQHBox *hbox = new TQHBox(mainVbox); hbox->setSpacing(KDialog::spacingHint()); - QVBox *vboxLeft = new QVBox(hbox); + TQVBox *vboxLeft = new TQVBox(hbox); vboxLeft->setSpacing(KDialog::spacingHint()); - new QLabel(i18n("Position:"), vboxLeft); + new TQLabel(i18n("Position:"), vboxLeft); xyPos = new PosWidget(vboxLeft); - trace = new QCheckBox(i18n("Show trace"), mainVbox); - connect(trace, SIGNAL(toggled(bool)), this, SLOT(traceChanged(bool))); + trace = new TQCheckBox(i18n("Show trace"), mainVbox); + connect(trace, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(traceChanged(bool))); - QVBox *vboxMid = new QVBox(hbox); + TQVBox *vboxMid = new TQVBox(hbox); vboxMid->setSpacing(KDialog::spacingHint()); - QVBox *vboxRight = new QVBox(hbox); + TQVBox *vboxRight = new TQVBox(hbox); vboxRight->setSpacing(KDialog::spacingHint()); // calculate the column width we need - QFontMetrics fm(font()); + TQFontMetrics fm(font()); int colWidth = QMAX(fm.width(PRESSED), fm.width("-32767")) + 10; // -32767 largest string - new QLabel(i18n("Buttons:"), vboxMid); - buttonTbl = new QTable(0, 1, vboxMid); + new TQLabel(i18n("Buttons:"), vboxMid); + buttonTbl = new TQTable(0, 1, vboxMid); buttonTbl->setReadOnly(true); buttonTbl->horizontalHeader()->setLabel(0, i18n("State")); buttonTbl->horizontalHeader()->setClickEnabled(false); @@ -99,8 +99,8 @@ JoyWidget::JoyWidget(QWidget *parent, const char *name) buttonTbl->verticalHeader()->setResizeEnabled(false); buttonTbl->setColumnWidth(0, colWidth); - new QLabel(i18n("Axes:"), vboxRight); - axesTbl = new QTable(0, 1, vboxRight); + new TQLabel(i18n("Axes:"), vboxRight); + axesTbl = new TQTable(0, 1, vboxRight); axesTbl->setReadOnly(true); axesTbl->horizontalHeader()->setLabel(0, i18n("Value")); axesTbl->horizontalHeader()->setClickEnabled(false); @@ -110,13 +110,13 @@ JoyWidget::JoyWidget(QWidget *parent, const char *name) axesTbl->setColumnWidth(0, colWidth); // calibrate button - calibrate = new QPushButton(i18n("Calibrate"), mainVbox); - connect(calibrate, SIGNAL(clicked()), this, SLOT(calibrateDevice())); + calibrate = new TQPushButton(i18n("Calibrate"), mainVbox); + connect(calibrate, TQT_SIGNAL(clicked()), this, TQT_SLOT(calibrateDevice())); calibrate->setEnabled(false); // set up a timer for idle processing of joystick events - idle = new QTimer(this); - connect(idle, SIGNAL(timeout()), this, SLOT(checkDevice())); + idle = new TQTimer(this); + connect(idle, TQT_SIGNAL(timeout()), this, TQT_SLOT(checkDevice())); // check which devicefiles we have init(); @@ -170,7 +170,7 @@ void JoyWidget::init() // we found one - device->insertItem(QString("%1 (%2)").arg(joy->text()).arg(joy->device())); + device->insertItem(TQString("%1 (%2)").arg(joy->text()).arg(joy->device())); // display values for first device if ( first ) @@ -186,7 +186,7 @@ void JoyWidget::init() if ( device->count() == 0 ) { messageBox->show(); - message->setText(QString("<qt><b>%1</b></qt>").arg( + message->setText(TQString("<qt><b>%1</b></qt>").arg( i18n("No joystick device automatically found on this computer.<br>" "Checks were done in /dev/js[0-4] and /dev/input/js[0-4]<br>" "If you know that there is one attached, please enter the correct device file."))); @@ -212,7 +212,7 @@ void JoyWidget::restoreCurrDev() else { // try to find the current open device in the combobox list - QListBoxItem *item; + TQListBoxItem *item; item = device->listBox()->findItem(joydev->device(), Qt::Contains); if ( !item ) // the current open device is one the user entered (not in the list) @@ -224,11 +224,11 @@ void JoyWidget::restoreCurrDev() //-------------------------------------------------------------- -void JoyWidget::deviceChanged(const QString &dev) +void JoyWidget::deviceChanged(const TQString &dev) { // find "/dev" in given string int start, stop; - QString devName; + TQString devName; if ( (start = dev.find("/dev")) == -1 ) { @@ -315,7 +315,7 @@ void JoyWidget::checkDevice() if ( number == 1 ) // y-axis xyPos->changeY(value); - axesTbl->setText(number, 0, QString("%1").arg(int(value))); + axesTbl->setText(number, 0, TQString("%1").arg(int(value))); } } @@ -348,7 +348,7 @@ void JoyWidget::calibrateDevice() dlg.calibrate(); // user cancelled somewhere during calibration, therefore the device is in a bad state - if ( dlg.result() == QDialog::Rejected ) + if ( dlg.result() == TQDialog::Rejected ) joydev->restoreCorr(); idle->start(0); // continue with event getting diff --git a/kcontrol/joystick/joywidget.h b/kcontrol/joystick/joywidget.h index 5f561c0e5..d857229e8 100644 --- a/kcontrol/joystick/joywidget.h +++ b/kcontrol/joystick/joywidget.h @@ -21,7 +21,7 @@ #ifndef _JOYWIDGET_H_ #define _JOYWIDGET_H_ -#include <qwidget.h> +#include <tqwidget.h> class JoyDevice; @@ -40,7 +40,7 @@ class JoyWidget : public QWidget Q_OBJECT public: - JoyWidget(QWidget *parent = 0, const char *name = 0); + JoyWidget(TQWidget *parent = 0, const char *name = 0); ~JoyWidget(); @@ -53,7 +53,7 @@ class JoyWidget : public QWidget private slots: void checkDevice(); - void deviceChanged(const QString &dev); + void deviceChanged(const TQString &dev); void traceChanged(bool); void calibrateDevice(); @@ -62,16 +62,16 @@ class JoyWidget : public QWidget void restoreCurrDev(); // restores the content of the combobox to reflect the current open device private: - QHBox *messageBox; - QLabel *message; // in case of no device, show here a message rather than in a dialog - QComboBox *device; + TQHBox *messageBox; + TQLabel *message; // in case of no device, show here a message rather than in a dialog + TQComboBox *device; PosWidget *xyPos; - QTable *buttonTbl; - QTable *axesTbl; - QCheckBox *trace; - QPushButton *calibrate; + TQTable *buttonTbl; + TQTable *axesTbl; + TQCheckBox *trace; + TQPushButton *calibrate; - QTimer *idle; + TQTimer *idle; JoyDevice *joydev; }; diff --git a/kcontrol/joystick/poswidget.cpp b/kcontrol/joystick/poswidget.cpp index 54e619d7a..eb24ece23 100644 --- a/kcontrol/joystick/poswidget.cpp +++ b/kcontrol/joystick/poswidget.cpp @@ -20,15 +20,15 @@ ***************************************************************************/ #include "poswidget.h" -#include <qpainter.h> +#include <tqpainter.h> #define XY_WIDTH 220 #define MARK_WIDTH 10 //----------------------------------------------------------------- -PosWidget::PosWidget(QWidget *parent, const char *name) - : QWidget(parent, name, WRepaintNoErase), x(0), y(0), trace(false) +PosWidget::PosWidget(TQWidget *parent, const char *name) + : TQWidget(parent, name, WRepaintNoErase), x(0), y(0), trace(false) { setMinimumSize(XY_WIDTH, XY_WIDTH); setMaximumSize(XY_WIDTH, XY_WIDTH); @@ -37,9 +37,9 @@ PosWidget::PosWidget(QWidget *parent, const char *name) //----------------------------------------------------------------- -void PosWidget::paintEvent(QPaintEvent *) +void PosWidget::paintEvent(TQPaintEvent *) { - QPainter paint(this); + TQPainter paint(this); paint.drawRect(0, 0, width(), height()); paint.setPen(Qt::gray); @@ -106,7 +106,7 @@ void PosWidget::showTrace(bool t) void PosWidget::eraseOld() { - QPainter paint(this); + TQPainter paint(this); //paint.eraseRect(x - MARK_WIDTH/2, y - MARK_WIDTH/2, MARK_WIDTH + 1, MARK_WIDTH + 1); diff --git a/kcontrol/joystick/poswidget.h b/kcontrol/joystick/poswidget.h index 9151da57f..a4d57117e 100644 --- a/kcontrol/joystick/poswidget.h +++ b/kcontrol/joystick/poswidget.h @@ -21,7 +21,7 @@ #ifndef _POSWIDGET_H_ #define _POSWIDGET_H_ -#include <qwidget.h> +#include <tqwidget.h> /** Widget to display the joystick-selected (x,y) position @@ -31,7 +31,7 @@ class PosWidget : public QWidget Q_OBJECT public: - PosWidget(QWidget *parent = 0, const char *name = 0); + PosWidget(TQWidget *parent = 0, const char *name = 0); void changeX(int x); void changeY(int y); @@ -42,7 +42,7 @@ class PosWidget : public QWidget void showTrace(bool t); protected: - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); private: void eraseOld(); |