Skip to content

Commit

Permalink
corrected static function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Bramble committed Jun 13, 2012
1 parent 8162ea5 commit f4bc519
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions frapmodel.cpp
Expand Up @@ -4,11 +4,12 @@ FrapModel::FrapModel(QObject *parent) :
QAbstractTableModel(parent)
{
experiment = new FrapTool::Frap();
rows = 0;
}

static std::string qStringToSTLString(const QString& qstring)
FrapModel::~FrapModel()
{
return qstring.toStdString();
delete experiment;
}

void FrapModel::setPrima(QString prima) {
Expand All @@ -21,27 +22,28 @@ void FrapModel::setClosed(QString closed) {

void FrapModel::doSelection(){
experiment->doselection();
//experiment->processdata();
//experiment->print_data();
}

void FrapModel::setImageList(QStringList image_string_list){
std::vector<std::string> ifiles;
rows = image_string_list.size();
ifiles.reserve(image_string_list.size()); // reserve vector space
std::transform(image_string_list.begin(),image_string_list.end(),std::back_inserter(ifiles),&qStringToSTLString);
std::transform(image_string_list.begin(),image_string_list.end(),std::back_inserter(ifiles),&FrapModel::qStringToSTLString);
experiment->setimagenames(ifiles);
}

int FrapModel::rowCount(const QModelIndex & /*parent*/) const
{
return 2;
return rows;
}

int FrapModel::columnCount(const QModelIndex & /*parent*/) const
{
return 5;
}



QVariant FrapModel::headerData(int section, Qt::Orientation orientation, int role) const
{

Expand Down
5 changes: 3 additions & 2 deletions frapmodel.h
Expand Up @@ -16,7 +16,7 @@ class FrapModel : public QAbstractTableModel
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;

~FrapModel();

signals:

Expand All @@ -28,8 +28,9 @@ public slots:

private:
FrapTool::Frap *experiment;
int rows;

static std::string qStringToSTLString(const QString& qstring);
static std::string qStringToSTLString(const QString& qstring){ return qstring.toStdString(); };

};

Expand Down
8 changes: 4 additions & 4 deletions qt-frap-tool.pro.user
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.4.1, 2012-06-13T18:39:56. -->
<!-- Written by Qt Creator 2.4.1, 2012-06-13T21:55:35. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
Expand Down Expand Up @@ -101,7 +101,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/DS/phyjpb/Programming/C/qt-frap-tool-build-desktop-Qt_4_8_1_in_PATH__System__Release</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/jon/Programming/C/qt-frap-tool-build-desktop-Qt_4_8_1_in_PATH__System__Release</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
Expand Down Expand Up @@ -151,7 +151,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/DS/phyjpb/Programming/C/qt-frap-tool-build-desktop-Qt_4_8_1_in_PATH__System__Debug</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/jon/Programming/C/qt-frap-tool-build-desktop-Qt_4_8_1_in_PATH__System__Debug</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
Expand Down Expand Up @@ -256,7 +256,7 @@
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{973957c6-bafc-4d27-9e1b-d91fb6b68c74}</value>
<value type="QString">{039551df-d4f3-45c0-a2ec-66c7eda81a9e}</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
Expand Down

0 comments on commit f4bc519

Please sign in to comment.