# HG changeset patch # User Jeandet Alexis # Date 2014-06-17 22:25:56 # Node ID 0723523bf195001e857a3eef6c47b5c4ba415a41 # Parent e435c5434f2c7c02c1a6285903c0ad4c5c9a9f30 moved QTableWidgetIntItem to genericBinaryFiles diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,4 +1,4 @@ 2c82d72694590cbc2aebb946667f11f60ea89afe src/SocExplorerEngine/PeripheralWidget -ddf415685f8b47b4336d88975ceaac4dfe5f2760 src/common/genericBinaryFiles +792782cb7421744ce931903441bc006e6afe0114 src/common/genericBinaryFiles 2dce25b198558be573f56c1cf337aa95ddd666d6 src/common/lppserial a4274329c9f05c742b3eb9753e77c47d27e838e9 src/common/qhexedit diff --git a/src/common/common.pro b/src/common/common.pro --- a/src/common/common.pro +++ b/src/common/common.pro @@ -91,7 +91,6 @@ HEADERS += \ PySocExplorer.h \ SocExplorerPlot.h \ genericBinaryFiles/elf/elffilewidget.h \ - qtablewidgetintitem.h \ genericBinaryFiles/srec/srecfile.h \ genericBinaryFiles/srec/srecfilewidget.h \ genericBinaryFiles/abstractbinfile.h \ @@ -116,7 +115,6 @@ SOURCES += \ qipdialogbox.cpp \ SocExplorerPlot.cpp \ genericBinaryFiles/elf/elffilewidget.cpp \ - qtablewidgetintitem.cpp \ genericBinaryFiles/srec/srecfile.cpp \ genericBinaryFiles/srec/srecfilewidget.cpp \ genericBinaryFiles/abstractbinfile.cpp \ diff --git a/src/common/qtablewidgetintitem.cpp b/src/common/qtablewidgetintitem.cpp deleted file mode 100644 --- a/src/common/qtablewidgetintitem.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "qtablewidgetintitem.h" - -QTableWidgetIntItem::QTableWidgetIntItem(const QString &text,int Type) - :QTableWidgetItem(text,Type) -{ -} - -bool QTableWidgetIntItem::operator <(const QTableWidgetItem& other) const -{ - return toInt() < toInt(other); -} - -bool QTableWidgetIntItem::operator >(const QTableWidgetItem &other) const -{ - return toInt() > toInt(other); -} - -bool QTableWidgetIntItem::operator ==(const QTableWidgetItem &other) const -{ - return toInt() == toInt(other); -} - -int QTableWidgetIntItem::toInt() const -{ - bool ok=true; - if(type()==DecimalItem) - { - return text().toInt(); - } - else if(type()==HexaDecimalItem) - { - return text().replace("0x","").toInt(&ok,16); - } - return 0; -} - -int QTableWidgetIntItem::toInt(const QTableWidgetItem &item) const -{ - bool ok=true; - if(item.type()==DecimalItem) - { - return item.text().toInt(); - } - else if(item.type()==HexaDecimalItem) - { - return item.text().replace("0x","").toInt(&ok,16); - } - return 0; -} - - diff --git a/src/common/qtablewidgetintitem.h b/src/common/qtablewidgetintitem.h deleted file mode 100644 --- a/src/common/qtablewidgetintitem.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef QTABLEWIDGETINTITEM_H -#define QTABLEWIDGETINTITEM_H - -#include - -#define DecimalItem 0 -#define HexaDecimalItem 1 - -class QTableWidgetIntItem : public QTableWidgetItem -{ - -public: - explicit QTableWidgetIntItem(const QString& text, int Type); - bool operator <(const QTableWidgetItem &other)const; - bool operator >(const QTableWidgetItem &other)const; - bool operator ==(const QTableWidgetItem &other)const; - int toInt() const; - int toInt(const QTableWidgetItem &item) const; - -}; - -#endif // QTABLEWIDGETINTITEM_H