Commit baa73639 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

fix compile warnings

parent 3fa50b24
...@@ -50,7 +50,7 @@ void AutomaticDataLoader1D::previewOfGraph(QCustomPlot* plotWidget) const ...@@ -50,7 +50,7 @@ void AutomaticDataLoader1D::previewOfGraph(QCustomPlot* plotWidget) const
QVector<double> rVec; QVector<double> rVec;
auto& axis = outputData->axis(0); auto& axis = outputData->axis(0);
for (auto i = 0; i < size; i++) { for (size_t i = 0; i < size; i++) {
qVec << axis.binCenter(i); // axis.bincenter is same as operator[] for pointwise. qVec << axis.binCenter(i); // axis.bincenter is same as operator[] for pointwise.
// getAxisValue() calls opertor[] // getAxisValue() calls opertor[]
rVec << dataValues[i]; rVec << dataValues[i];
......
...@@ -73,20 +73,6 @@ QVector<QPair<int, int>> expandLineNumberPattern(const QString& pattern, bool* o ...@@ -73,20 +73,6 @@ QVector<QPair<int, int>> expandLineNumberPattern(const QString& pattern, bool* o
return result; return result;
} }
struct Palette {
static QColor backgroundColorFileContent;
static QColor backgroundColorRawContent;
static QColor backgroundColorProcessedContent;
static QColor backgroundColorErrors;
static QColor skippedLineTextColor;
};
QColor Palette::backgroundColorFileContent(239, 237, 248);
QColor Palette::backgroundColorRawContent(247, 240, 210);
QColor Palette::backgroundColorProcessedContent(191, 232, 242);
QColor Palette::backgroundColorErrors(247, 140, 146);
QColor Palette::skippedLineTextColor(Qt::lightGray);
} // namespace } // namespace
QREDataLoader::QREDataLoader() : m_propertiesWidget(nullptr) QREDataLoader::QREDataLoader() : m_propertiesWidget(nullptr)
...@@ -287,7 +273,6 @@ QString QREDataLoader::processContents() ...@@ -287,7 +273,6 @@ QString QREDataLoader::processContents()
m_item->specularDataItem()->setOutputData(nullptr); m_item->specularDataItem()->setOutputData(nullptr);
}; };
const bool settingsChanged = m_importResult.importSettings != m_importSettings;
const bool parsingSettingsChanged = const bool parsingSettingsChanged =
m_importResult.importSettings.headerPrefix != m_importSettings.headerPrefix m_importResult.importSettings.headerPrefix != m_importSettings.headerPrefix
|| m_importResult.importSettings.linesToSkip != m_importSettings.linesToSkip || m_importResult.importSettings.linesToSkip != m_importSettings.linesToSkip
...@@ -421,7 +406,7 @@ void QREDataLoader::parseFileContent() const ...@@ -421,7 +406,7 @@ void QREDataLoader::parseFileContent() const
: m_importSettings.headerPrefix.split(","); : m_importSettings.headerPrefix.split(",");
const auto lineIsHeader = [headerPrefixes](const QString& line) { const auto lineIsHeader = [headerPrefixes](const QString& line) {
for (const auto prefix : headerPrefixes) { for (const auto& prefix : headerPrefixes) {
if (line.startsWith(prefix.trimmed())) if (line.startsWith(prefix.trimmed()))
return true; return true;
} }
...@@ -525,9 +510,6 @@ void QREDataLoader::calculateFromParseResult() const ...@@ -525,9 +510,6 @@ void QREDataLoader::calculateFromParseResult() const
const double e = const double e =
eColIsValid ? rawValues[eCol] * eFactor : std::numeric_limits<double>::quiet_NaN(); eColIsValid ? rawValues[eCol] * eFactor : std::numeric_limits<double>::quiet_NaN();
const bool lineContainsNaN =
(std::isnan(q) || std::isnan(r) || (std::isnan(e) && errorColumnIsEnabled));
if (std::isnan(q)) { if (std::isnan(q)) {
m_importResult.addError(lineNr, ErrorDefinition::columnDoesNotContainValidNumber, m_importResult.addError(lineNr, ErrorDefinition::columnDoesNotContainValidNumber,
qCol + 1); qCol + 1);
......
...@@ -73,7 +73,7 @@ void RealDataPropertiesWidget::setItem(RealDataItem* item) ...@@ -73,7 +73,7 @@ void RealDataPropertiesWidget::setItem(RealDataItem* item)
return; return;
m_currentDataItem->mapper()->setOnPropertyChange( m_currentDataItem->mapper()->setOnPropertyChange(
[this](const QString& name) { onRealDataPropertyChanged(); }, this); [this](const QString&) { onRealDataPropertyChanged(); }, this);
m_currentDataItem->mapper()->setOnItemDestroy( m_currentDataItem->mapper()->setOnItemDestroy(
[this](SessionItem*) { m_currentDataItem = nullptr; }, this); [this](SessionItem*) { m_currentDataItem = nullptr; }, this);
...@@ -85,7 +85,7 @@ void RealDataPropertiesWidget::setItem(RealDataItem* item) ...@@ -85,7 +85,7 @@ void RealDataPropertiesWidget::setItem(RealDataItem* item)
//! Processes user interaction with instrument selector combo. If there is realDataItem, //! Processes user interaction with instrument selector combo. If there is realDataItem,
//! it will be linked with selected instrument. //! it will be linked with selected instrument.
void RealDataPropertiesWidget::onInstrumentComboIndexChanged(int index) void RealDataPropertiesWidget::onInstrumentComboIndexChanged(int /*index*/)
{ {
if (!m_currentDataItem) if (!m_currentDataItem)
return; return;
......
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent) RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent)
: QWidget(parent) : QWidget(parent)
, m_itemTree(new QTreeView) , m_itemTree(new QTreeView)
, m_itemTreeModel(new RealDataTreeModel)
, m_propertiesWidget(new RealDataPropertiesWidget) , m_propertiesWidget(new RealDataPropertiesWidget)
, m_import2dDataAction(new QAction(this)) , m_import2dDataAction(new QAction(this))
, m_import1dDataAction(new QAction(this)) , m_import1dDataAction(new QAction(this))
, m_renameDataAction(new QAction(this)) , m_renameDataAction(new QAction(this))
, m_removeDataAction(new QAction(this)) , m_removeDataAction(new QAction(this))
, m_rotateDataAction(new QAction(this)) , m_rotateDataAction(new QAction(this))
, m_itemTreeModel(new RealDataTreeModel)
{ {
setMinimumSize(128, 600); setMinimumSize(128, 600);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
......
...@@ -64,14 +64,14 @@ private: ...@@ -64,14 +64,14 @@ private:
QModelIndex currentIndex(); QModelIndex currentIndex();
private: private:
QTreeView* m_itemTree;
RealDataTreeModel* m_itemTreeModel;
RealDataPropertiesWidget* m_propertiesWidget;
QAction* m_import2dDataAction; QAction* m_import2dDataAction;
QAction* m_import1dDataAction; QAction* m_import1dDataAction;
QAction* m_renameDataAction; QAction* m_renameDataAction;
QAction* m_removeDataAction; QAction* m_removeDataAction;
QAction* m_rotateDataAction; QAction* m_rotateDataAction;
QTreeView* m_itemTree;
RealDataTreeModel* m_itemTreeModel;
RealDataPropertiesWidget* m_propertiesWidget;
}; };
#endif // BORNAGAIN_GUI_COREGUI_VIEWS_IMPORTDATAWIDGETS_REALDATASELECTORWIDGET_H #endif // BORNAGAIN_GUI_COREGUI_VIEWS_IMPORTDATAWIDGETS_REALDATASELECTORWIDGET_H
...@@ -176,7 +176,7 @@ QModelIndex RealDataTreeModel::parent(const QModelIndex& index) const ...@@ -176,7 +176,7 @@ QModelIndex RealDataTreeModel::parent(const QModelIndex& index) const
return create2DHeadlineIndex(); return create2DHeadlineIndex();
} }
int RealDataTreeModel::columnCount(const QModelIndex& parent) const int RealDataTreeModel::columnCount(const QModelIndex& /*parent*/) const
{ {
return 1; return 1;
} }
...@@ -209,7 +209,6 @@ int RealDataTreeModel::rowCount(const QModelIndex& parent) const ...@@ -209,7 +209,6 @@ int RealDataTreeModel::rowCount(const QModelIndex& parent) const
QVariant RealDataTreeModel::data(const QModelIndex& index, int role) const QVariant RealDataTreeModel::data(const QModelIndex& index, int role) const
{ {
const bool has1D = !m_items1D.isEmpty(); const bool has1D = !m_items1D.isEmpty();
const bool has2D = !m_items2D.isEmpty();
if (isHeadline(index)) { if (isHeadline(index)) {
const QString title = (index.row() == 0 && has1D) ? "1D Data" : "2D Data"; const QString title = (index.row() == 0 && has1D) ? "1D Data" : "2D Data";
...@@ -313,7 +312,6 @@ QModelIndex RealDataTreeModel::indexForItem(RealDataItem* item) const ...@@ -313,7 +312,6 @@ QModelIndex RealDataTreeModel::indexForItem(RealDataItem* item) const
return QModelIndex(); return QModelIndex();
if (item->isSpecularData()) { if (item->isSpecularData()) {
auto index = m_items1D.indexOf(item);
if (auto index = m_items1D.indexOf(item); index >= 0) if (auto index = m_items1D.indexOf(item); index >= 0)
return createIndex(index, 0, item); return createIndex(index, 0, item);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment