Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#generated files in build folder
Source/Debug/
Source/Release/
Source/Bin/
Dll/Debug/
Dll/Release/
Dll/Bin/

#generated files in demo folder
Demos/ForStaticLib/holloworldforqt/debug
Demos/ForStaticLib/holloworldforqt/release
56 changes: 56 additions & 0 deletions Demos/ForStaticLib/holloworldforqt/holloworld.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include "holloworld.h"
#include "ui_holloworld.h"

holloworld::holloworld(QWidget *parent) :
QWidget(parent),
ui(new Ui::holloworld)
{
//set chart instance name and size
resize(800, 600);
setWindowTitle(tr("Paint Demo"));
// m_ChartWnd.Attach((HWND)this->winId(), kTypeXY);
// m_ChartWnd.GetChart()->AddPoint2D(1, 1);
// m_ChartWnd.GetChart()->AddPoint2D(2, 2);

// pototype a function pointer pfunction
// double (*pfunction)(double , double);
// pfunction = contourmap;


//contour map
// m_ChartWnd.Attach((HWND)this->winId(), kTypeContourLine);
// m_ChartWnd.GetChart()->SetFieldFcn(contourmap);
// m_ChartWnd.GetChart()->SetPlotRange(-2.0, 2.0, -2.0, 2.0);
// m_ChartWnd.GetChart()->SetContourPrecision(8);


m_ChartWnd.Attach((HWND)this->winId(), kTypeXY);

m_ChartWnd.GetChart()->SetAxisTitle(_T("x-axis"), 1);
m_ChartWnd.GetChart()->SetAxisTitle(_T("y-axis"), 0);

double pX[360], pY[360];
double Pi = 3.1415926536;
int i;

//add 1 courve
for(i=0; i<360; i++)
{
pX[i] = i;
pY[i] = 2.0*sin(i*2.0*Pi/360.0*3.0);
}
m_ChartWnd.GetChart()->AddCurve(pX, pY, 360);

ui->setupUi(this);
}


double contourmap(double x, double y)
{
return 1.0/((x-1.0)*(x-1.0)+y*y+1.0);
}

holloworld::~holloworld()
{
delete ui;
}
38 changes: 38 additions & 0 deletions Demos/ForStaticLib/holloworldforqt/holloworld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef HOLLOWORLD_H
#define HOLLOWORLD_H

#include <QWidget>
#include<tchar.h>


#include "../../ForDynamicLib/PreCompiled/Chart.h"
#if defined (_UNICODE) || defined(UNICODE)
#pragma comment(lib,"../../ForDynamicLib/PreCompiled/CChartu.lib")
#else
#pragma comment(lib,"../../ForDynamicLib/PreCompiled/CChart.lib")
#endif
using namespace NsCChart;


#pragma comment(lib,"user32.lib")

namespace Ui {
class holloworld;
}

class holloworld : public QWidget
{
Q_OBJECT

public:
explicit holloworld(QWidget *parent = 0);
~holloworld();

private:
Ui::holloworld *ui;
CChartWnd m_ChartWnd;
};

#endif // HOLLOWORLD_H

double contourmap(double x, double y);
20 changes: 20 additions & 0 deletions Demos/ForStaticLib/holloworldforqt/holloworld.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<ui version="4.0">
<class>holloworld</class>
<widget class="QWidget" name="holloworld" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>holloworld</string>
</property>
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
23 changes: 23 additions & 0 deletions Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#-------------------------------------------------
#
# Project created by QtCreator 2020-09-13T14:10:23
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = holloworldforqt
TEMPLATE = app


SOURCES += main.cpp\
holloworld.cpp

HEADERS += holloworld.h

FORMS += holloworld.ui

LIBS += -L../../ForDynamicLib/PreCompiled/ -lCChart
LIBS += -L../../ForDynamicLib/PreCompiled/ -lCChartu
259 changes: 259 additions & 0 deletions Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro.user

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Demos/ForStaticLib/holloworldforqt/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "holloworld.h"
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
holloworld w;
w.show();

return a.exec();
}
49 changes: 49 additions & 0 deletions Demos/ForStaticLib/holloworldforqt/ui_holloworld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/********************************************************************************
** Form generated from reading UI file 'holloworld.ui'
**
** Created by: Qt User Interface Compiler version 5.5.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef UI_HOLLOWORLD_H
#define UI_HOLLOWORLD_H

#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QWidget>

QT_BEGIN_NAMESPACE

class Ui_holloworld
{
public:

void setupUi(QWidget *holloworld)
{
if (holloworld->objectName().isEmpty())
holloworld->setObjectName(QStringLiteral("holloworld"));
holloworld->resize(400, 300);

retranslateUi(holloworld);

QMetaObject::connectSlotsByName(holloworld);
} // setupUi

void retranslateUi(QWidget *holloworld)
{
holloworld->setWindowTitle(QApplication::translate("holloworld", "holloworld", 0));
} // retranslateUi

};

namespace Ui {
class holloworld: public Ui_holloworld {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_HOLLOWORLD_H