diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ad00134 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/Demos/ForStaticLib/holloworldforqt/holloworld.cpp b/Demos/ForStaticLib/holloworldforqt/holloworld.cpp new file mode 100644 index 0000000..8e1e5e2 --- /dev/null +++ b/Demos/ForStaticLib/holloworldforqt/holloworld.cpp @@ -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; +} diff --git a/Demos/ForStaticLib/holloworldforqt/holloworld.h b/Demos/ForStaticLib/holloworldforqt/holloworld.h new file mode 100644 index 0000000..728a5a9 --- /dev/null +++ b/Demos/ForStaticLib/holloworldforqt/holloworld.h @@ -0,0 +1,38 @@ +#ifndef HOLLOWORLD_H +#define HOLLOWORLD_H + +#include +#include + + +#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); diff --git a/Demos/ForStaticLib/holloworldforqt/holloworld.ui b/Demos/ForStaticLib/holloworldforqt/holloworld.ui new file mode 100644 index 0000000..7e0e41b --- /dev/null +++ b/Demos/ForStaticLib/holloworldforqt/holloworld.ui @@ -0,0 +1,20 @@ + + holloworld + + + + 0 + 0 + 400 + 300 + + + + holloworld + + + + + + + diff --git a/Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro b/Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro new file mode 100644 index 0000000..5665361 --- /dev/null +++ b/Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro @@ -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 \ No newline at end of file diff --git a/Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro.user b/Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro.user new file mode 100644 index 0000000..8e296ab --- /dev/null +++ b/Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro.user @@ -0,0 +1,259 @@ + + + + + + EnvironmentId + {072818f2-625c-46af-8c61-c48b7c8bcc46} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.5.1 MSVC2013 32bit + Desktop Qt 5.5.1 MSVC2013 32bit + qt.55.win32_msvc2013_kit + 0 + 0 + 0 + + D:/GITHUB/CChart/Demos/ForStaticLib/holloworldforqt + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + D:/GITHUB/CChart/Demos/ForStaticLib/Error in " Util.asciify("build-holloworldforqt-Desktop_Qt_5_5_1_MSVC2013_32bit-Release")": TypeError: Property 'asciify' of object Core::Internal::UtilsJsExtension(0x8cc918) is not a function + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 2 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + holloworldforqt + + Qt4ProjectManager.Qt4RunConfiguration:D:/GITHUB/CChart/Demos/ForStaticLib/holloworldforqt/holloworldforqt.pro + + holloworldforqt.pro + false + false + + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/Demos/ForStaticLib/holloworldforqt/main.cpp b/Demos/ForStaticLib/holloworldforqt/main.cpp new file mode 100644 index 0000000..6add147 --- /dev/null +++ b/Demos/ForStaticLib/holloworldforqt/main.cpp @@ -0,0 +1,11 @@ +#include "holloworld.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + holloworld w; + w.show(); + + return a.exec(); +} diff --git a/Demos/ForStaticLib/holloworldforqt/ui_holloworld.h b/Demos/ForStaticLib/holloworldforqt/ui_holloworld.h new file mode 100644 index 0000000..38e4d4f --- /dev/null +++ b/Demos/ForStaticLib/holloworldforqt/ui_holloworld.h @@ -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 +#include +#include +#include +#include +#include + +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