Commit 526a5a10 authored by Leander Schulten's avatar Leander Schulten
Browse files

make compilable with msvc.

IMPORTANT: Warnings were commented out
parent d5872d96
......@@ -47,6 +47,7 @@ SOURCES += main.cpp \
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += _USE_MATH_DEFINES
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
......
#include "colorplot.h"
Colorplot::Colorplot()
{
}
#ifndef COLORPLOT_H
#define COLORPLOT_H
class Colorplot
{
public:
Colorplot();
};
#endif // COLORPLOT_H
\ No newline at end of file
......@@ -58,7 +58,7 @@ protected:
public:
GroupModel(DataModel * deviceModel = DataModel::singletone());
enum GroupModelRoles{
EnableDataRole = IDBaseDataModel<Programm*>::ItemDataRole + 1
EnableDataRole = IDBaseDataModel<Programm>::ItemDataRole + 1
};
const std::vector<bool>& getEnabledVector()const{return enabled;}
void setEnabled(int index, bool enabled = true){
......
......@@ -15,7 +15,7 @@ public:
};
const std::vector<Channel*>& getChannel()const{return channels;}
std::vector<Channel*>& getChannel(){return channels;}
virtual int rowCount(const QModelIndex &) const override{return channels.size();}
virtual int rowCount(const QModelIndex &) const override{return static_cast<int>(channels.size());}
virtual QVariant data(const QModelIndex &index, int role) const override{
if(index.row()>=0&&index.row()<int(channels.size())){
switch(role){
......@@ -80,7 +80,7 @@ public:
static QString syncServiceClassName;
DevicePrototype(const QJsonObject &o);
DevicePrototype(QString name, QString description=""):NamedObject(name,description,&syncServiceClassName){}
int getNumberOfChannels()const{return channels.getChannel().size();}
int getNumberOfChannels()const{return static_cast<int>(channels.getChannel().size());}
/**
* @brief removeChannels Entfernt Channel bis zu einem bestimmten Index
* @param newMaxIndex Der neue Maximale Index (Inclusiv)
......
#include "graph.h"
Graph::Graph()
{
}
#ifndef GRAPH_H
#define GRAPH_H
#include <QQuickItem>
class Graph : public QQuickItem
{
Q_OBJECT
public:
Graph();
signals:
public slots:
};
#endif // GRAPH_H
\ No newline at end of file
......@@ -17,9 +17,9 @@ namespace detail{
template<typename Subclass>
struct IDBaseComperator{
typedef std::true_type is_transparent;
bool operator()(const IDBase<Subclass> *l,const IDBase<Subclass> *r);
bool operator()(const ID::value_type l,const IDBase<Subclass> *r);
bool operator()(const IDBase<Subclass> *l,const ID::value_type r);
inline bool operator()(const IDBase<Subclass> *l,const IDBase<Subclass> *r)const;
inline bool operator()(const ID::value_type l,const IDBase<Subclass> *r)const;
inline bool operator()(const IDBase<Subclass> *l,const ID::value_type r)const;
};
template<typename Subclass>
......@@ -139,17 +139,17 @@ public:
};
namespace detail{
template<typename Subclass>
bool IDBaseComperator<Subclass>::operator()(const IDBase<Subclass> *l,const IDBase<Subclass> *r){
bool IDBaseComperator<Subclass>::operator()(const IDBase<Subclass> *l,const IDBase<Subclass> *r)const{
return l->getID().value()<r->getID().value();
}
template<typename Subclass>
bool IDBaseComperator<Subclass>::operator()(const ID::value_type l,const IDBase<Subclass> *r){
bool IDBaseComperator<Subclass>::operator()(const ID::value_type l,const IDBase<Subclass> *r)const{
return l<r->getID().value();
}
template<typename Subclass>
bool IDBaseComperator<Subclass>::operator()(const IDBase<Subclass> *l,const ID::value_type r){
bool IDBaseComperator<Subclass>::operator()(const IDBase<Subclass> *l,const ID::value_type r)const{
return l->getID().value()<r;
}
......
......@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
QFile file(settings.getJsonSettingsFilePath());
file.copy(settings.getJsonSettingsFilePath()+"_"+QDateTime::currentDateTime().toString("dd.MM.YYYY HH:mm:ss"));
#warning Dont use IDBase<xxxxx>::getAllIDBases() in this file. It will crash the aplication when its closing
//#warning Dont use IDBase<xxxxx>::getAllIDBases() in this file. It will crash the aplication when its closing
auto after = ApplicationData::loadData(file);
......
......@@ -21,7 +21,7 @@ public:
const std::vector<Type*>& getVector()const{return model;}
std::vector<Type*>& getVector(){return model;}
typename std::vector<Type*>::size_type size()const{return model.size();}
virtual int rowCount(const QModelIndex &) const override{return model.size();}
virtual int rowCount(const QModelIndex &) const override{return static_cast<int>(model.size());}
/**
* @brief data Return always, if the index is valid, a QVarient that contains the data at the vector
* @param index the Index in the vector
......
#include "oscillogram.h"
Oscillogram::Oscillogram()
{
}
#ifndef OSCILLOGRAM_H
#define OSCILLOGRAM_H
#include <QQuickItem>
class Oscillogram : public QQuickItem
{
Q_OBJECT
public:
Oscillogram();
signals:
public slots:
};
#endif // OSCILLOGRAM_H
\ No newline at end of file
......@@ -5,7 +5,9 @@
#include <algorithm>
#include <QJsonArray>
#include <cstring>
#ifdef _MSC_VER
#include <corecrt_math_defines.h>
#endif
Polygon::Polygon(QString name):name(name)
{
......@@ -129,7 +131,7 @@ QSGNode* Polygon::updatePaintNode(QSGNode *oldNode , UpdatePaintNodeData *){
QSGGeometry *geometry = nullptr;
constexpr auto fiveDegrees = 10/180.*M_PI;
const auto fiveDegrees = 10/180.*M_PI;
int extraVertexCountForArcs = 0;
for(const auto a : arcs){
......@@ -187,7 +189,7 @@ QSGNode* Polygon::updatePaintNode(QSGNode *oldNode , UpdatePaintNodeData *){
const auto startLength = std::sqrt(startVector.x*startVector.x+startVector.y*startVector.y);
const auto endLength = std::sqrt(endVector.x*endVector.x+endVector.y*endVector.y);
const auto lengthDiff = (endLength-startLength)/startLength;
#warning Mögliche Division durch null
//#warning Mögliche Division durch null
const auto lengthXDiff = lengthDiff ;
const auto lengthYDiff = lengthDiff ;
const int needExtraVertices = angle / fiveDegrees;
......
......@@ -5,6 +5,9 @@
#include <QQuickItem>
#include <cmath>
#include <QJsonObject>
#ifdef _MSC_VER
#include <corecrt_math_defines.h>
#endif
namespace Primitives {
......
......@@ -109,7 +109,7 @@ void Programm::fill(unsigned char *data, size_t length, double time){
for(const auto cp : dp->getProgrammPrototyp()->getChannelProgramms()){
const auto channelNummer = dp->device->getStartDMXChannel() + cp->channel->getIndex();
if(channelNummer<length){
#warning Fix distorstion:
//#warning Fix distorstion:
// original : cause NAN : cp->getValueForTime(p->getTimeDistortion()->distort(time * p->getSpeed()) * dp->getSpeed()+ dp->getOffset())
data[channelNummer] = cp->getValueForTime((time * p->getSpeed()) * dp->getSpeed()+ dp->getOffset());
}
......
......@@ -55,7 +55,7 @@ public:
};
const std::vector<ChannelProgramm*>& getChannelProgramms()const{return channels;}
std::vector<ChannelProgramm*>& getChannelProgramms(){return channels;}
virtual int rowCount(const QModelIndex &) const override{return channels.size();}
virtual int rowCount(const QModelIndex &) const override{return static_cast<int>(channels.size());}
virtual QVariant data(const QModelIndex &index, int role) const override{
if(index.row()>=0&&index.row()<int(channels.size())){
switch(role){
......
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