From 1a1d52c51308995e505f7c39028661b74f4306b1 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 20 Mar 2014 14:19:50 +0100 Subject: [PATCH 1/3] fixed a column ID problem --- apps/opencs/model/world/columnimp.hpp | 5 ++--- apps/opencs/model/world/columns.cpp | 3 ++- apps/opencs/model/world/columns.hpp | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/world/columnimp.hpp b/apps/opencs/model/world/columnimp.hpp index def225018f..b1c61b76a5 100644 --- a/apps/opencs/model/world/columnimp.hpp +++ b/apps/opencs/model/world/columnimp.hpp @@ -37,7 +37,6 @@ namespace CSMWorld } }; - /// \note Shares ID with IdColumn. A table can not have both. template struct StringIdColumn : public Column { @@ -838,11 +837,11 @@ namespace CSMWorld } }; - /// \note Shares ID with StringIdColumn. A table can not have both. template struct IdColumn : public Column { - IdColumn() : Column (Columns::ColumnId_Id, ColumnBase::Display_String) {} + IdColumn() : Column (Columns::ColumnId_ReferenceableId, + ColumnBase::Display_Referenceable) {} virtual QVariant get (const Record& record) const { diff --git a/apps/opencs/model/world/columns.cpp b/apps/opencs/model/world/columns.cpp index 2f3911270e..7410780e08 100644 --- a/apps/opencs/model/world/columns.cpp +++ b/apps/opencs/model/world/columns.cpp @@ -172,7 +172,8 @@ namespace CSMWorld { ColumnId_Rank, "Rank" }, { ColumnId_Gender, "Gender" }, { ColumnId_PcRank, "PC Rank" }, - { ColumnId_Scope, "Scope", }, + { ColumnId_Scope, "Scope" }, + { ColumnId_ReferenceableId, "Referenceable ID" }, { ColumnId_UseValue1, "Use value 1" }, { ColumnId_UseValue2, "Use value 2" }, diff --git a/apps/opencs/model/world/columns.hpp b/apps/opencs/model/world/columns.hpp index 52e022e789..855e89cade 100644 --- a/apps/opencs/model/world/columns.hpp +++ b/apps/opencs/model/world/columns.hpp @@ -166,6 +166,7 @@ namespace CSMWorld ColumnId_Gender = 153, ColumnId_PcRank = 154, ColumnId_Scope = 155, + ColumnId_ReferenceableId = 156, // Allocated to a separate value range, so we don't get a collision should we ever need // to extend the number of use values. From 10ce47938b3de5f6a556b72acfbf4aef41c6a491 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 21 Mar 2014 11:22:43 +0100 Subject: [PATCH 2/3] update preview on reference/referenceable changes --- apps/opencs/view/render/previewwidget.cpp | 134 ++++++++++++++++++---- apps/opencs/view/render/previewwidget.hpp | 30 +++-- apps/opencs/view/render/scenewidget.cpp | 5 + apps/opencs/view/render/scenewidget.hpp | 2 + 4 files changed, 139 insertions(+), 32 deletions(-) diff --git a/apps/opencs/view/render/previewwidget.cpp b/apps/opencs/view/render/previewwidget.cpp index 43d45f4cb9..9b64cf6f4e 100644 --- a/apps/opencs/view/render/previewwidget.cpp +++ b/apps/opencs/view/render/previewwidget.cpp @@ -4,36 +4,55 @@ #include #include "../../model/world/data.hpp" +#include "../../model/world/idtable.hpp" -void CSVRender::PreviewWidget::setup (const std::string& id) +void CSVRender::PreviewWidget::setup() { setNavigation (&mOrbit); - int column = mData.getReferenceables().findColumnIndex (CSMWorld::Columns::ColumnId_Model); - - int row = mData.getReferenceables().getIndex (id); - - QVariant value = mData.getReferenceables().getData (row, column); - - if (!value.isValid()) - return; - - std::string model = value.toString().toUtf8().constData(); - - if (model.empty()) - return; - mNode = getSceneManager()->getRootSceneNode()->createChildSceneNode(); mNode->setPosition (Ogre::Vector3 (0, 0, 0)); - mObject = NifOgre::Loader::createObjects (mNode, "Meshes\\" + model); + setModel(); + + QAbstractItemModel *referenceables = + mData.getTableModel (CSMWorld::UniversalId::Type_Referenceables); + + connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), + this, SLOT (ReferenceableDataChanged (const QModelIndex&, const QModelIndex&))); + connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), + this, SLOT (ReferenceableAboutToBeRemoved (const QModelIndex&, int, int))); } -void CSVRender::PreviewWidget::adjust (const std::string& id) +void CSVRender::PreviewWidget::setModel() { if (mNode) { - int row = mData.getReferences().getIndex (id); + mObject.setNull(); + + int column = mData.getReferenceables().findColumnIndex (CSMWorld::Columns::ColumnId_Model); + + int row = mData.getReferenceables().getIndex (mReferenceableId); + + QVariant value = mData.getReferenceables().getData (row, column); + + if (!value.isValid()) + return; + + std::string model = value.toString().toUtf8().constData(); + + if (model.empty()) + return; + + mObject = NifOgre::Loader::createObjects (mNode, "Meshes\\" + model); + } +} + +void CSVRender::PreviewWidget::adjust() +{ + if (mNode) + { + int row = mData.getReferences().getIndex (mReferenceId); float scale = mData.getReferences().getData (row, mData.getReferences(). findColumnIndex (CSMWorld::Columns::ColumnId_Scale)).toFloat(); @@ -56,17 +75,82 @@ void CSVRender::PreviewWidget::adjust (const std::string& id) } } -CSVRender::PreviewWidget::PreviewWidget (const CSMWorld::Data& data, +CSVRender::PreviewWidget::PreviewWidget (CSMWorld::Data& data, const std::string& referenceableId, QWidget *parent) -: SceneWidget (parent), mData (data), mNode (0) +: SceneWidget (parent), mData (data), mNode (0), mReferenceableId (referenceableId) { - setup (referenceableId); + setup(); } -CSVRender::PreviewWidget::PreviewWidget (const CSMWorld::Data& data, +CSVRender::PreviewWidget::PreviewWidget (CSMWorld::Data& data, const std::string& referenceableId, const std::string& referenceId, QWidget *parent) -: SceneWidget (parent), mData (data) +: SceneWidget (parent), mData (data), mReferenceableId (referenceableId), + mReferenceId (referenceId) { - setup (referenceableId); - adjust (referenceId); + setup(); + + adjust(); + + QAbstractItemModel *references = + mData.getTableModel (CSMWorld::UniversalId::Type_References); + + connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), + this, SLOT (ReferenceDataChanged (const QModelIndex&, const QModelIndex&))); + connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), + this, SLOT (ReferenceAboutToBeRemoved (const QModelIndex&, int, int))); +} + +void CSVRender::PreviewWidget::ReferenceableDataChanged (const QModelIndex& topLeft, + const QModelIndex& bottomRight) +{ + CSMWorld::IdTable& referenceables = dynamic_cast ( + *mData.getTableModel (CSMWorld::UniversalId::Type_Referenceables)); + + QModelIndex index = referenceables.getModelIndex (mReferenceableId, 0); + + if (index.row()>=topLeft.row() && index.row()<=bottomRight.row()) + { + /// \todo possible optimisation; check columns and only update if relevant columns have + /// changed + setModel(); + flagAsModified(); + } +} + +void CSVRender::PreviewWidget::ReferenceableAboutToBeRemoved (const QModelIndex& parent, int start, + int end) +{ + +} + +void CSVRender::PreviewWidget::ReferenceDataChanged (const QModelIndex& topLeft, + const QModelIndex& bottomRight) +{ + CSMWorld::IdTable& references = dynamic_cast ( + *mData.getTableModel (CSMWorld::UniversalId::Type_References)); + + int columnIndex = references.findColumnIndex (CSMWorld::Columns::ColumnId_ReferenceableId); + + QModelIndex index = references.getModelIndex (mReferenceId, columnIndex); + + if (index.row()>=topLeft.row() && index.row()<=bottomRight.row()) + { + /// \todo possible optimisation; check columns and only update if relevant columns have + /// changed + adjust(); + + if (index.column()>=topLeft.column() && index.column()<=bottomRight.row()) + { + mReferenceableId = references.data (index).toString().toUtf8().constData(); + setModel(); + } + + flagAsModified(); + } +} + +void CSVRender::PreviewWidget::ReferenceAboutToBeRemoved (const QModelIndex& parent, int start, + int end) +{ + } diff --git a/apps/opencs/view/render/previewwidget.hpp b/apps/opencs/view/render/previewwidget.hpp index b3abd55879..2b6517e715 100644 --- a/apps/opencs/view/render/previewwidget.hpp +++ b/apps/opencs/view/render/previewwidget.hpp @@ -7,6 +7,8 @@ #include "navigationorbit.hpp" +class QModelIndex; + namespace CSMWorld { class Data; @@ -18,28 +20,42 @@ namespace CSVRender { Q_OBJECT - const CSMWorld::Data& mData; + CSMWorld::Data& mData; CSVRender::NavigationOrbit mOrbit; NifOgre::ObjectScenePtr mObject; Ogre::SceneNode *mNode; + std::string mReferenceId; + std::string mReferenceableId; - void setup (const std::string& id); - ///< \param id ID of the referenceable to be viewed + void setup(); - void adjust (const std::string& id); - ///< \param id ID of the reference to be viewed + void setModel(); + + void adjust(); + ///< Adjust referenceable preview according to the reference public: - PreviewWidget (const CSMWorld::Data& data, const std::string& referenceableId, + PreviewWidget (CSMWorld::Data& data, const std::string& referenceableId, QWidget *parent = 0); - PreviewWidget (const CSMWorld::Data& data, const std::string& referenceableId, + PreviewWidget (CSMWorld::Data& data, const std::string& referenceableId, const std::string& referenceId, QWidget *parent = 0); signals: void closeRequest(); + + private slots: + + void ReferenceableDataChanged (const QModelIndex& topLeft, + const QModelIndex& bottomRight); + + void ReferenceableAboutToBeRemoved (const QModelIndex& parent, int start, int end); + + void ReferenceDataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight); + + void ReferenceAboutToBeRemoved (const QModelIndex& parent, int start, int end); }; } diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 5eec702d3d..6b2ca85b5e 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -118,6 +118,11 @@ namespace CSVRender return mSceneMgr; } + void SceneWidget::flagAsModified() + { + mUpdate = true; + } + void SceneWidget::paintEvent(QPaintEvent* e) { if (!mWindow) diff --git a/apps/opencs/view/render/scenewidget.hpp b/apps/opencs/view/render/scenewidget.hpp index 05b06b2873..375c877d22 100644 --- a/apps/opencs/view/render/scenewidget.hpp +++ b/apps/opencs/view/render/scenewidget.hpp @@ -36,6 +36,8 @@ namespace CSVRender Ogre::SceneManager *getSceneManager(); + void flagAsModified(); + private: void paintEvent(QPaintEvent* e); void resizeEvent(QResizeEvent* e); From fc8ae2b9b563d7713b909333ad2c228764b0e53b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 21 Mar 2014 11:56:48 +0100 Subject: [PATCH 3/3] fixed encoding problems --- apps/opencs/editor.cpp | 8 ++++---- apps/opencs/model/tools/tools.cpp | 2 +- apps/opencs/model/world/tablemimedata.cpp | 4 ++-- apps/opencs/view/doc/opendialog.cpp | 2 +- apps/opencs/view/doc/subview.cpp | 2 +- apps/opencs/view/filter/editwidget.cpp | 4 ++-- apps/opencs/view/world/dialoguesubview.cpp | 14 +++++++------- apps/opencs/view/world/scriptedit.cpp | 6 +++--- apps/opencs/view/world/table.cpp | 6 +++--- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 942780c32b..87660a60bc 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -61,7 +61,7 @@ void CS::Editor::setupDataFiles (const Files::PathContainer& dataDirs) { for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) { - QString path = QString::fromStdString(iter->string()); + QString path = QString::fromUtf8 (iter->string().c_str()); mFileDialog.addFiles(path); } } @@ -148,7 +148,7 @@ void CS::Editor::openFiles (const boost::filesystem::path &savePath) std::vector files; foreach (const QString &path, mFileDialog.selectedFilePaths()) - files.push_back(path.toStdString()); + files.push_back(path.toUtf8().constData()); CSMDoc::Document *document = mDocumentManager.addDocument (files, savePath, false); @@ -161,10 +161,10 @@ void CS::Editor::createNewFile (const boost::filesystem::path &savePath) std::vector files; foreach (const QString &path, mFileDialog.selectedFilePaths()) { - files.push_back(path.toStdString()); + files.push_back(path.toUtf8().constData()); } - files.push_back(mFileDialog.filename().toStdString()); + files.push_back(mFileDialog.filename().toUtf8().constData()); CSMDoc::Document *document = mDocumentManager.addDocument (files, savePath, true); diff --git a/apps/opencs/model/tools/tools.cpp b/apps/opencs/model/tools/tools.cpp index 79a09dcb48..d3d8f5fadd 100644 --- a/apps/opencs/model/tools/tools.cpp +++ b/apps/opencs/model/tools/tools.cpp @@ -143,6 +143,6 @@ void CSMTools::Tools::verifierMessage (const QString& message, int type) std::map::iterator iter = mActiveReports.find (type); if (iter!=mActiveReports.end()) - mReports[iter->second]->add (message.toStdString()); + mReports[iter->second]->add (message.toUtf8().constData()); } diff --git a/apps/opencs/model/world/tablemimedata.cpp b/apps/opencs/model/world/tablemimedata.cpp index 9dcecf3bc1..ccd6fb4964 100644 --- a/apps/opencs/model/world/tablemimedata.cpp +++ b/apps/opencs/model/world/tablemimedata.cpp @@ -8,7 +8,7 @@ CSMWorld::TableMimeData::TableMimeData (UniversalId id, const CSMDoc::Document& mDocument(document) { mUniversalId.push_back (id); - mObjectsFormats << QString::fromStdString ("tabledata/" + id.getTypeName()); + mObjectsFormats << QString::fromUtf8 (("tabledata/" + id.getTypeName()).c_str()); } CSMWorld::TableMimeData::TableMimeData (std::vector< CSMWorld::UniversalId >& id, const CSMDoc::Document& document) : @@ -16,7 +16,7 @@ CSMWorld::TableMimeData::TableMimeData (std::vector< CSMWorld::UniversalId >& id { for (std::vector::iterator it (mUniversalId.begin()); it != mUniversalId.end(); ++it) { - mObjectsFormats << QString::fromStdString ("tabledata/" + it->getTypeName()); + mObjectsFormats << QString::fromUtf8 (("tabledata/" + it->getTypeName()).c_str()); } } diff --git a/apps/opencs/view/doc/opendialog.cpp b/apps/opencs/view/doc/opendialog.cpp index 7b62aafa31..d107b198c6 100644 --- a/apps/opencs/view/doc/opendialog.cpp +++ b/apps/opencs/view/doc/opendialog.cpp @@ -40,7 +40,7 @@ OpenDialog::OpenDialog(QWidget * parent) : QDialog(parent) mCfgMgr.processPaths(mDataLocal); // Set the charset for reading the esm/esp files - QString encoding = QString::fromStdString(variables["encoding"].as()); + QString encoding = QString::fromUtf8 (variables["encoding"].as().c_str()); Files::PathContainer dataDirs; dataDirs.insert(dataDirs.end(), mDataDirs.begin(), mDataDirs.end()); diff --git a/apps/opencs/view/doc/subview.cpp b/apps/opencs/view/doc/subview.cpp index dcd85945fc..7fd0057173 100644 --- a/apps/opencs/view/doc/subview.cpp +++ b/apps/opencs/view/doc/subview.cpp @@ -4,7 +4,7 @@ CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id) { /// \todo add a button to the title bar that clones this sub view - setWindowTitle (mUniversalId.toString().c_str()); + setWindowTitle (QString::fromUtf8 (mUniversalId.toString().c_str())); } CSMWorld::UniversalId CSVDoc::SubView::getUniversalId() const diff --git a/apps/opencs/view/filter/editwidget.cpp b/apps/opencs/view/filter/editwidget.cpp index cc1578bdd9..b163297f9a 100644 --- a/apps/opencs/view/filter/editwidget.cpp +++ b/apps/opencs/view/filter/editwidget.cpp @@ -120,7 +120,7 @@ void CSVFilter::EditWidget::createFilterRequest (std::vector< std::pair< std::st { ss<<"!or("; } else { - ss << orAnd << oldContent.toStdString() << ','; + ss << orAnd << oldContent.toUtf8().constData() << ','; } for (unsigned i = 0; i < count; ++i) @@ -137,7 +137,7 @@ void CSVFilter::EditWidget::createFilterRequest (std::vector< std::pair< std::st } else { if (!replaceMode) { - ss << orAnd << oldContent.toStdString() <<','; + ss << orAnd << oldContent.toUtf8().constData() <<','; } else { ss<<'!'; } diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index ae7c5923b1..1627bc5f4f 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -444,7 +444,7 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSM mMainLayout = new QVBoxLayout(mainWidget); mEditWidget = new EditWidget(mainWidget, mRow, mTable, mUndoStack, false); - connect(mEditWidget, SIGNAL(tableMimeDataDropped(QWidget*, const QModelIndex&, const CSMWorld::UniversalId&, const CSMDoc::Document*)), + connect(mEditWidget, SIGNAL(tableMimeDataDropped(QWidget*, const QModelIndex&, const CSMWorld::UniversalId&, const CSMDoc::Document*)), this, SLOT(tableMimeDataDropped(QWidget*, const QModelIndex&, const CSMWorld::UniversalId&, const CSMDoc::Document*))); mMainLayout->addWidget(mEditWidget); @@ -490,7 +490,7 @@ void CSVWorld::DialogueSubView::prevId() { mEditWidget->remake(newRow); setUniversalId(CSMWorld::UniversalId (static_cast (mTable->data (mTable->index (newRow, 2)).toInt()), - mTable->data (mTable->index (newRow, 0)).toString().toStdString())); + mTable->data (mTable->index (newRow, 0)).toString().toUtf8().constData())); mRow = newRow; mEditWidget->setDisabled(mLocked); return; @@ -522,7 +522,7 @@ void CSVWorld::DialogueSubView::nextId() { mEditWidget->remake(newRow); setUniversalId(CSMWorld::UniversalId (static_cast (mTable->data (mTable->index (newRow, 2)).toInt()), - mTable->data (mTable->index (newRow, 0)).toString().toStdString())); + mTable->data (mTable->index (newRow, 0)).toString().toUtf8().constData())); mRow = newRow; mEditWidget->setDisabled(mLocked); return; @@ -580,7 +580,7 @@ void CSVWorld::DialogueSubView::revertRecord() if (state!=CSMWorld::RecordBase::State_BaseOnly) { - mUndoStack.push(new CSMWorld::RevertCommand(*mTable, mTable->data(mTable->index (mRow, 0)).toString().toStdString())); + mUndoStack.push(new CSMWorld::RevertCommand(*mTable, mTable->data(mTable->index (mRow, 0)).toString().toUtf8().constData())); } if (rows != mTable->rowCount()) { @@ -613,7 +613,7 @@ void CSVWorld::DialogueSubView::deleteRecord() mRow < rows && mBottom->canCreateAndDelete()) { - mUndoStack.push(new CSMWorld::DeleteCommand(*mTable, mTable->data(mTable->index (mRow, 0)).toString().toStdString())); + mUndoStack.push(new CSMWorld::DeleteCommand(*mTable, mTable->data(mTable->index (mRow, 0)).toString().toUtf8().constData())); if (rows != mTable->rowCount()) { if (mTable->rowCount() == 0) @@ -639,7 +639,7 @@ void CSVWorld::DialogueSubView::requestFocus (const std::string& id) void CSVWorld::DialogueSubView::cloneRequest () { - mBottom->cloneRequest(mTable->data(mTable->index (mRow, 0)).toString().toStdString(), + mBottom->cloneRequest(mTable->data(mTable->index (mRow, 0)).toString().toUtf8().constData(), static_cast(mTable->data(mTable->index(mRow, 2)).toInt())); } @@ -647,7 +647,7 @@ void CSVWorld::DialogueSubView::showPreview () { if (mTable->hasPreview() && mRow < mTable->rowCount()) { - emit focusId(CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Preview, mTable->data(mTable->index (mRow, 0)).toString().toStdString()), ""); + emit focusId(CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Preview, mTable->data(mTable->index (mRow, 0)).toString().toUtf8().constData()), ""); } } diff --git a/apps/opencs/view/world/scriptedit.cpp b/apps/opencs/view/world/scriptedit.cpp index fccac75b41..b1528d5254 100644 --- a/apps/opencs/view/world/scriptedit.cpp +++ b/apps/opencs/view/world/scriptedit.cpp @@ -71,9 +71,9 @@ void CSVWorld::ScriptEdit::dropEvent (QDropEvent* event) { if (stringNeedsQuote(it->getId())) { - insertPlainText(QString::fromStdString ('"' + it->getId() + '"')); + insertPlainText(QString::fromUtf8 (('"' + it->getId() + '"').c_str())); } else { - insertPlainText(QString::fromStdString (it->getId())); + insertPlainText(QString::fromUtf8 (it->getId().c_str())); } } } @@ -82,7 +82,7 @@ void CSVWorld::ScriptEdit::dropEvent (QDropEvent* event) bool CSVWorld::ScriptEdit::stringNeedsQuote (const std::string& id) const { - const QString string(QString::fromStdString(id)); // is only for c++11, so let's use qregexp for now. + const QString string(QString::fromUtf8(id.c_str())); // is only for c++11, so let's use qregexp for now. //I'm not quite sure when do we need to put quotes. To be safe we will use quotes for anything other than… return !(string.contains(mWhiteListQoutes)); } diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index cd9138c357..a2927c2f09 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -289,7 +289,7 @@ CSMWorld::UniversalId CSVWorld::Table::getUniversalId (int row) const { return CSMWorld::UniversalId ( static_cast (mProxyModel->data (mProxyModel->index (row, 2)).toInt()), - mProxyModel->data (mProxyModel->index (row, 0)).toString().toStdString()); + mProxyModel->data (mProxyModel->index (row, 0)).toString().toUtf8().constData()); } void CSVWorld::Table::revertRecord() @@ -533,7 +533,7 @@ void CSVWorld::Table::mouseMoveEvent (QMouseEvent* event) } drag->setMimeData (mime); - drag->setPixmap (QString::fromStdString (mime->getIcon())); + drag->setPixmap (QString::fromUtf8 (mime->getIcon().c_str())); drag->exec(Qt::CopyAction); } @@ -588,7 +588,7 @@ std::vector CSVWorld::Table::getColumnsWithDisplay(CSMWorld::Column if (display == columndisplay) { - titles.push_back(mModel->headerData (i, Qt::Horizontal).toString().toStdString()); + titles.push_back(mModel->headerData (i, Qt::Horizontal).toString().toUtf8().constData()); } } return titles;