Skip to content
Snippets Groups Projects
Commit 42378830 authored by Olivier Langella's avatar Olivier Langella
Browse files

use QVariant to store fastafile pointer

parent 16e7d124
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ FIND_PACKAGE( Pappsomspp REQUIRED )
# SET (PAPPSOMSPP_DIR "/home/olivier/eclipse/git/pappsomspp")
# SET (PAPPSOMSPP_DIR "/home/langella/developpement/git/pappsomspp")
# SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
# SET (PAPPSOMSPP_QT5_LIBRARY "${PAPPSOMSPP_DIR}/cbuild/src/libpappsomspp-qt5.so")
# SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/cbuild/src/libpappsomspp-qt4.so")
......@@ -210,7 +211,7 @@ MESSAGE("XTPCPP_SRCS: ${XTPCPP_SRCS}")
ADD_EXECUTABLE(xtpcpp main.cpp ${CPP_FILES} ${XTPCPP_SRCS} ${GUI_UI_HDRS} ${XTPCPP_MOC_SRCS} ${xtpcpp_RCC_SRCS})
target_include_directories (xtpcpp PUBLIC ${Pwiz_INCLUDE_DIR} ${PAPPSOMSPP_INCLUDE_DIR} ${ODSSTREAM_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_QTGUI_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/gui/peptide_detail_view/spectrum_widget ${CMAKE_CURRENT_SOURCE_DIR}/gui/peptide_detail_view/spectrum_widget)
target_compile_definitions(xtpcpp PUBLIC ${QT_DEFINITIONS})
......
......@@ -32,7 +32,7 @@ public:
};
void setSequence(const QString& description, const QString& sequence) override {
//qDebug() << "PeptideReader::setSequence " << description << " " <<sequence;
qDebug() << "PeptideReader::setSequence " << description << " " <<sequence;
QStringList descr_split = description.simplified().split(" ");
QString accession = descr_split.at(0);
_protein_store.setContaminantAccession(accession);
......
......@@ -55,4 +55,5 @@ private :
};
Q_DECLARE_METATYPE(FastaFile *)
#endif // FASTAFILE_H
......@@ -284,8 +284,13 @@ void ProjectWindow::doAutomaticFilterParametersChanged(AutomaticFilterParameters
if (index_list.size() > 0) {
_project_sp.get()->getProteinStore().clearContaminants();
for (QModelIndex index :index_list) {
FastaFile fasta_file (_p_fasta_str_li->itemFromIndex(index)->data(Qt::UserRole).toString());
fasta_file.setContaminants(_project_sp.get()->getProteinStore());
if (index.data(Qt::UserRole).canConvert<FastaFile *>()) {
FastaFile * p_fasta_file = index.data(Qt::UserRole).value<FastaFile *>();
p_fasta_file->setContaminants(_project_sp.get()->getProteinStore());
}
else {
throw pappso::PappsoException(QObject::tr("can not convert to FastaFile index.data().canConvert<FastaFile *>()"));
}
}
}
else {
......@@ -471,8 +476,9 @@ void ProjectWindow::setProjectSp(ProjectSp project_sp) {
QStandardItem *item;
item = new QStandardItem(QString("%1").arg(fasta_file.get()->getFilename()));
item->setEditable(false);
item->setData(QVariant::fromValue(fasta_file.get()), Qt::UserRole);
_p_fasta_str_li->appendRow(item);
item->setData(QVariant(QString("%1").arg(fasta_file.get()->getAbsoluteFilePath())),Qt::UserRole);
//item->setData(QVariant(QString("%1").arg(fasta_file.get()->getAbsoluteFilePath())),Qt::UserRole);
}
for (auto && p_window :_ptm_island_list_window_collection) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment