summaryrefslogtreecommitdiff
path: root/DebugModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'DebugModel.cpp')
-rw-r--r--DebugModel.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/DebugModel.cpp b/DebugModel.cpp
index 2a7b173..5afa3ba 100644
--- a/DebugModel.cpp
+++ b/DebugModel.cpp
@@ -31,7 +31,7 @@ QVariant DebugModel::data( const QModelIndex& index, int role ) const
int row,column;
row=index.row();
column=index.column();
- if(index.parent()!=QModelIndex() || row < 0 || row >= list.count() || column < 0 || column >= COLUMN_COUNT)
+ if(index.parent()!=QModelIndex() || row < 0 || row >= (int)list.size() || column < 0 || column >= COLUMN_COUNT)
return QVariant();
const DebugItem& item = list.at(row);
@@ -45,16 +45,16 @@ QVariant DebugModel::data( const QModelIndex& index, int role ) const
return item.time;
break;
case 1:
- return item.file;
+ return QString::fromStdString(item.file);
break;
case 2:
- return item.function;
+ return QString::fromStdString(item.function);
break;
case 3:
- return item.location;
+ return QString::fromStdString(item.location);
break;
case 4:
- return item.text;
+ return QString::fromStdString(item.text);
break;
default:
return QVariant();
@@ -89,7 +89,7 @@ QVariant DebugModel::data( const QModelIndex& index, int role ) const
int DebugModel::rowCount( const QModelIndex& parent ) const
{
- return parent == QModelIndex() ? list.count() : 0;
+ return parent == QModelIndex() ? list.size() : 0;
}
QVariant DebugModel::headerData( int section, Qt::Orientation orientation, int role ) const
@@ -117,16 +117,16 @@ bool DebugModel::setData( const QModelIndex&, const QVariant&, int)
return false;
}
-void DebugModel::addDebugInformation(const int &time,const DebugLevel_custom &level,const QString& function,const QString& text,const QString &file,const int& ligne,const QString& location)
+void DebugModel::addDebugInformation(const int &time, const DebugLevel_custom &level, const std::string &function, const std::string &text, const std::string &file, const unsigned int& ligne, const std::string &location)
{
DebugItem item;
item.time=time;
item.level=level;
item.function=function;
item.text=text;
- item.file=QStringLiteral("%1:%2").arg(file).arg(ligne);
+ item.file=file+":"+std::to_string(ligne);
item.location=location;
- list << item;
+ list.push_back(item);
if(!displayed)
{
displayed=true;