Click here to Skip to main content
15,886,137 members
Articles / Desktop Programming / QT

A Graphical Documentation System for C/C++ projects

Rate me:
Please Sign up or sign in to vote.
4.93/5 (13 votes)
23 Aug 2012CPOL20 min read 54.4K   1.5K   43  
A concept-tool to create interactive documentations for C/C++ projects
#ifndef DIAGRAMWIDGET_H
#define DIAGRAMWIDGET_H

#include "GraphCore_global.h"
#include <QtGui>

enum OP {ADD, SUB, MUL, DIV, POW};
enum TYPE {X, OPERATION, OPERAND};
struct operationOrOperand
{
    TYPE type;
    OP operation;
    qreal operand;
};

class expression
{
public:
    QVector<operationOrOperand> steps;
};

class GRAPHCORESHARED_EXPORT DiagramWidget : public QWidget
{
    Q_OBJECT
public:
    explicit DiagramWidget(QWidget *parent = 0);

    void drawFunc(QString fun);

protected:
    void paintEvent(QPaintEvent *);

private:
    qreal XtoPlanCoords(qreal xcoord);
    qreal YtoScreenCoords(qreal ycoord);
    qreal applyExp(int index, qreal x);
    bool m_functionSet;
    expression myExp;

signals:

public slots:

};

extern "C" GRAPHCORESHARED_EXPORT DiagramWidget* createWidget();

#endif // DIAGRAMWIDGET_H

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Italy Italy
I'm a Computer Science Engineer and I've been programming with a large variety of technologies for years. I love writing software with C/C++, CUDA, .NET and playing around with reverse engineering

Comments and Discussions