From 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 00:15:53 +0000 Subject: TQt4 port piklab This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/progs/tbl_bootloader/base/tbl_bootloader.cpp | 24 +++++++++++----------- src/progs/tbl_bootloader/base/tbl_bootloader.h | 2 +- .../tbl_bootloader/base/tbl_bootloader_data.h | 4 ++-- .../tbl_bootloader/base/tbl_bootloader_prog.h | 5 +++-- src/progs/tbl_bootloader/gui/tbl_bootloader_ui.cpp | 16 +++++++-------- src/progs/tbl_bootloader/gui/tbl_bootloader_ui.h | 5 +++-- .../xml/xml_tbl_bootloader_parser.cpp | 8 ++++---- 7 files changed, 33 insertions(+), 31 deletions(-) (limited to 'src/progs/tbl_bootloader') diff --git a/src/progs/tbl_bootloader/base/tbl_bootloader.cpp b/src/progs/tbl_bootloader/base/tbl_bootloader.cpp index 419ad86..9c52fb7 100644 --- a/src/progs/tbl_bootloader/base/tbl_bootloader.cpp +++ b/src/progs/tbl_bootloader/base/tbl_bootloader.cpp @@ -43,7 +43,7 @@ void TinyBootloader::Config::writeRetries(uint nb) } //----------------------------------------------------------------------------- -TinyBootloader::Hardware::Hardware(::Programmer::Base &base, const QString &portDevice) +TinyBootloader::Hardware::Hardware(::Programmer::Base &base, const TQString &portDevice) : ::Bootloader::Hardware(base, new Port::Serial(portDevice, Port::Serial::NoProperty, base)) { Config config; @@ -76,17 +76,17 @@ bool TinyBootloader::Hardware::internalConnectHardware() bool TinyBootloader::Hardware::verifyDeviceId() { uchar id = data(device().name()).id; - QValueVector list = _base.group().supportedDevices(); - QStringList devices; + TQValueVector list = _base.group().supportedDevices(); + TQStringList devices; for (uint i=0; i(_port); } bool verifyDeviceId(); virtual bool write(Pic::MemoryRangeType type, const Device::Array &data); diff --git a/src/progs/tbl_bootloader/base/tbl_bootloader_data.h b/src/progs/tbl_bootloader/base/tbl_bootloader_data.h index 51be528..d8e7f79 100644 --- a/src/progs/tbl_bootloader/base/tbl_bootloader_data.h +++ b/src/progs/tbl_bootloader/base/tbl_bootloader_data.h @@ -14,8 +14,8 @@ namespace TinyBootloader struct Data { uchar id; }; - extern bool isSupported(const QString &device); - extern const Data &data(const QString &device); + extern bool isSupported(const TQString &device); + extern const Data &data(const TQString &device); } // namespace #endif diff --git a/src/progs/tbl_bootloader/base/tbl_bootloader_prog.h b/src/progs/tbl_bootloader/base/tbl_bootloader_prog.h index 75b986d..08cbf3f 100644 --- a/src/progs/tbl_bootloader/base/tbl_bootloader_prog.h +++ b/src/progs/tbl_bootloader/base/tbl_bootloader_prog.h @@ -18,6 +18,7 @@ namespace TinyBootloader class ProgrammerBase : public ::Bootloader::ProgrammerBase { Q_OBJECT + TQ_OBJECT public: ProgrammerBase(const Programmer::Group &group, const Pic::Data *data); virtual bool verifyDeviceId() { return static_cast(hardware()).verifyDeviceId(); } @@ -27,8 +28,8 @@ public: class Group : public ::Bootloader::Group { public: - virtual QString name() const { return "tbl_bootloader"; } - virtual QString label() const { return i18n("Tiny Bootloader"); } + virtual TQString name() const { return "tbl_bootloader"; } + virtual TQString label() const { return i18n("Tiny Bootloader"); } virtual ::Programmer::Properties properties() const { return ::Programmer::Programmer; } virtual ::Programmer::TargetPowerMode targetPowerMode() const { return ::Programmer::TargetSelfPowered; } virtual bool isPortSupported(PortType type) const { return type==PortType::Serial; } diff --git a/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.cpp b/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.cpp index 5b576b9..f0c1725 100644 --- a/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.cpp +++ b/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.cpp @@ -12,29 +12,29 @@ #include "common/port/serial.h" //----------------------------------------------------------------------------- -TinyBootloader::ConfigWidget::ConfigWidget(const::Programmer::Group &group, QWidget *parent) - : ::Programmer::ConfigWidget(group, parent) +TinyBootloader::ConfigWidget::ConfigWidget(const::Programmer::Group &group, TQWidget *tqparent) + : ::Programmer::ConfigWidget(group, tqparent) { uint row = numRows(); - QLabel *label = new QLabel(i18n("Port Speed:"), this); + TQLabel *label = new TQLabel(i18n("Port Speed:"), this); addWidget(label, row,row, 0,0); _speed = new KComboBox(this); for (uint i=0; iinsertItem(QString::number(Port::Serial::SPEED_VALUES[i])); + _speed->insertItem(TQString::number(Port::Serial::SPEED_VALUES[i])); } addWidget(_speed, row,row, 1,1); row++; - label = new QLabel(i18n("Timeout (ms):"), this); + label = new TQLabel(i18n("Timeout (ms):"), this); addWidget(label, row,row, 0,0); _timeout = new KIntNumInput(this); _timeout->setMinValue(0); addWidget(_timeout, row,row, 1,1); row++; - label = new QLabel(i18n("No of Retries:"), this); + label = new TQLabel(i18n("No of Retries:"), this); addWidget(label, row,row, 0,0); _retries = new KIntNumInput(this); _retries->setMinValue(0); @@ -74,7 +74,7 @@ void TinyBootloader::ConfigWidget::loadConfig() } //----------------------------------------------------------------------------- -::Programmer::ConfigWidget *TinyBootloader::GroupUI::createConfigWidget(QWidget *parent) const +::Programmer::ConfigWidget *TinyBootloader::GroupUI::createConfigWidget(TQWidget *tqparent) const { - return new ConfigWidget(static_cast(group()), parent); + return new ConfigWidget(static_cast(group()), tqparent); } diff --git a/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.h b/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.h index d0285af..442b879 100644 --- a/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.h +++ b/src/progs/tbl_bootloader/gui/tbl_bootloader_ui.h @@ -20,8 +20,9 @@ namespace TinyBootloader class ConfigWidget: public ::Programmer::ConfigWidget { Q_OBJECT + TQ_OBJECT public: - ConfigWidget(const ::Programmer::Group &group, QWidget *parent); + ConfigWidget(const ::Programmer::Group &group, TQWidget *tqparent); virtual void loadConfig(); virtual void saveConfig(); @@ -34,7 +35,7 @@ private: class GroupUI : public ::Bootloader::GroupUI { public: - virtual ::Programmer::ConfigWidget *createConfigWidget(QWidget *parent) const; + virtual ::Programmer::ConfigWidget *createConfigWidget(TQWidget *tqparent) const; }; } // namespace diff --git a/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp b/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp index 62ed806..0960cd1 100644 --- a/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp +++ b/src/progs/tbl_bootloader/xml/xml_tbl_bootloader_parser.cpp @@ -22,11 +22,11 @@ public: XmlToData() : Programmer::XmlToData("tbl_bootloader", "TinyBootloader") {} private: - virtual void parseData(QDomElement element, Data &data); - virtual void outputData(const Data &data, QTextStream &s) const; + virtual void parseData(TQDomElement element, Data &data); + virtual void outputData(const Data &data, TQTextStream &s) const; }; -void TinyBootloader::XmlToData::parseData(QDomElement element, Data &data) +void TinyBootloader::XmlToData::parseData(TQDomElement element, Data &data) { const Device::Data *ddata = Device::lister().data(currentDevice()); if ( ddata->group().name()!="pic" ) qFatal("non-pic device not supported"); @@ -37,7 +37,7 @@ void TinyBootloader::XmlToData::parseData(QDomElement element, Data &data) if ( !ok ) qFatal("Invalid \"id\" tag"); } -void TinyBootloader::XmlToData::outputData(const Data &data, QTextStream &s) const +void TinyBootloader::XmlToData::outputData(const Data &data, TQTextStream &s) const { s << data.id; } -- cgit v1.2.1