Coder Social home page Coder Social logo

ironman-nam / qschematic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simulton/qschematic

0.0 0.0 0.0 24.84 MB

A library that allows creating diagrams such as flowcharts or even proper engineering schematics within a Qt application.

Home Page: https://simulton.com

License: MIT License

C++ 96.26% CMake 3.67% C 0.07%

qschematic's Introduction

Build Status Build Status

Introduction

QSchematic is a library to draw diagrams & schematics with Qt. It uses Qt's graphics view framework.

The library provides base classes for objects such as nodes and wires and implements logic to move objects around while keeping the wires connected, generating netlists and so on. A typical application would include this library and subclass the Item class to implement custom items.

Feature overview:

  • Add, remove, move, resize nodes
  • Connect nodes with wires
  • Undo/redo
  • Drag'n'Drop
  • Template based netlist generation
  • Serialization to/from XML (powered by GPDS)
  • Completely customizable by inheriting from the provided classes

Technical stuff:

  • Written in C++17
  • Everything is contained within the QSchematic namespace
  • Tested with Qt5
  • No dependencies other than Qt5 and a C++17 compatible compiler
  • MIT licensed

Licensing

This library is MIT licensed.

Credits

This library was originally designed, implemented and maintained by Joel Bodenmann in 2015. It was handed over to Simulton GmbH in late 2018.

Special thank goes to Professor François Corthay (Switzerland) for initially privately funding this project.

Screenshots

The library allows complete customization of every visual aspect. Therefore, screenshots are not really a telling thing as they are just showing an application specific implementation of the paint functions. But meh... I guess people still want to see some stuff so here we go: Screenshot 04 Screenshot 05

For more, check out the docs/screenshots folder.

Instructions

This is built using cmake.

Building

The following targets are provided:

Target Description
qschematic-objs A cmake OBJECT library. This can be helpful for integration into other cmake projects.
qschematic-static Builds a static library.
qschematic-shared Builds a shared/dynamic library.
qschematic-demo Builds a simple demo application.

Dependencies:

  • Qt5
  • GPDS for (de)serialization.

If the cmake option QSCHEMATIC_DEPENDENCY_GPDS_DOWNLOAD is enabled, cmake will automatically pull the GPDS dependency. Therefore, assuming a system with a working Qt5 installation, all you have to do is:

git clone https://github.com/simulton/qschematic
cd qschematic
mkdir .build
cd .build
cmake ..
make -j4

Integration

CMake

This library can be integrated easily into other cmake projects. There are two main mechanisms available:

  • Using FetchContent_Declare()
  • Install the library and use find_package()

fetchContent_Declare()

include(FetchContent)

# Fetch QSchematic
FetchContent_Declare(
    qschematic
    GIT_REPOSITORY https://github.com/simulton/qschematic
    GIT_TAG        1.0.1
)
FetchContent_MakeAvailable(qschematic)

# Link to your application/library
target_link_libraries(
    my_app
    PRIVATE
        qschematic-static
)

To change options & variables, the call to FetchContent_MakeAvailable() shown above can be replaced with:

FetchContent_Declare(
    qschematic
    GIT_REPOSITORY https://github.com/simulton/qschematic
    GIT_TAG        1.0.1
)
FetchContent_GetProperties(qschematic)
if(NOT qschematic_POPULATED)
    FetchContent_Populate(qschematic)
    
    set(QSCHEMATIC_BUILD_DEMO OFF CACHE INTERNAL "")
    set(QSCHEMATIC_DEPENDENCY_GPDS_DOWNLOAD OFF CACHE INTERNAL "")
    set(QSCHEMATIC_DEPENDENCY_GPDS_TARGET "gpds-shared" CACHE INTERNAL "")
    
    add_subdirectory(${qschematic_SOURCE_DIR} ${qschematic_BINARY_DIR})
endif()

find_package()

The QSchematic static & shared library cmake targets are exported which allows for easy integration into a client application/library. After successfully building & installing the QSchematic library targets, use find_package() to include the QSchematic targets and target_link_libraries() to add the corresponding target to your client application/library:

find_package(QSchematic REQUIRED)

add_executable(my_application "")
target_link_libraries(my_application qschematic::qschematic-static)

Other build systems

Use the cmake scripts that ship with this library to build either the static library (cmake target qschematic-static) or the shared library (cmake target qschematic-shared) and link the resulting library into your client application/library using whatever mechanism the build system of your choosing provides.

Architecture

Did someone say UML?!

The class diagramm below shows the overall architecture of the system: System

All items that are part of the Scene inherit from the Item class. There are built-in specialized classes for nodes, wires and so on: Items

qschematic's People

Contributors

tectu avatar xenotrix avatar ozra avatar chehrlic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.