QCAD

Free, open-source 2D CAD application for Windows, macOS, and Linux with DXF/DWG support and JavaScript scripting.

1.8Kstars
482forks
Custom / Unknown
C++

QCAD is a cross-platform, open-source 2D computer-aided design application that has been in continuous development since 1999. Built on a C++ and Qt foundation, it delivers a professional drafting environment for creating technical drawings including architectural plans, mechanical schematics, electrical diagrams, and general-purpose 2D designs. The application runs natively on Windows, macOS, and Linux without requiring a subscription or license key.

At its core, QCAD implements a layered plugin architecture where the document model, geometry engine, and user interface are cleanly separated. DXF format support is built in through the bundled dxflib library, and optional DWG support is available through a proprietary plugin. A complete ECMAScript/JavaScript scripting interface exposes the entire C++ API to scripts, enabling automation, custom tools, and batch processing workflows directly within the application.

QCAD includes over 40 construction tools and 20 modification tools covering the full range of 2D drafting needs — from basic lines and circles to splines, hatches, and complex dimensioning. A built-in part library provides more than 4,800 reusable CAD components. Command-line tools like dwg2pdf and dwg2svg allow headless batch conversion of DXF and DWG files without launching the GUI.

What You Get

  • Native DXF Import and Export - Read and write DXF files in all common versions using the bundled dxflib parser, with optional DWG format support available through a proprietary plugin for AutoCAD file compatibility.
  • Over 40 Construction Tools - Draft precise geometry including points, lines, arcs, circles, ellipses, splines, polylines, and text using dedicated tools designed for technical drawing workflows.
  • Over 20 Modification Tools - Edit and refine drawings with move, rotate, scale, mirror, trim, extend, fillet, chamfer, and explode operations for detailed iterative design work.
  • Layer and Block Management - Organize complex drawings using unlimited named layers with color and linetype control, and create reusable block definitions to maintain consistency across documents.
  • ECMAScript/JavaScript Scripting Engine - Automate repetitive tasks, build custom drawing tools, and integrate QCAD into larger workflows using a full-featured JavaScript API that exposes all document and entity operations.
  • Part Library with 4,800+ Components - Access a built-in library of mechanical and architectural CAD parts including bolts, gears, symbols, and ISO-standard components to accelerate drawing creation.
  • Screen-Based Linetype Rendering - Display linetype dash patterns consistently at any zoom level using pixel-based scaling rather than drawing-unit-based patterns, giving accurate visual representation across view scales.
  • Headless Command-Line Tools - Batch convert DXF and DWG files to PDF, SVG, PNG, and other formats using dwg2pdf and dwg2svg without launching the GUI, suitable for server-side or CI workflows.
  • Print-to-Scale and Multi-Page Output - Control output scale precisely and split large drawings across multiple printed pages using configurable paper size and margin settings.
  • Extensive Font Support - Use TrueType system fonts or 35 built-in CAD-specific fonts for annotations, labels, and title blocks in technical drawings.

Common Use Cases

  • Architectural floor plan drafting - Architects draw building layouts using layers for walls, doors, windows, and furniture, then use print-to-scale output to produce dimensionally accurate construction documents.
  • Mechanical part schematics - Engineers design components and assemblies using precise snapping, dimensioning tools, and the part library for standard fasteners and hardware symbols.
  • Batch DXF-to-PDF conversion - Developers integrate the dwg2pdf command-line tool into CI pipelines or manufacturing workflows to automatically render drawing files as PDFs when source DXF files change.
  • Custom CAD tool development - Tool builders write JavaScript add-ons that appear as native QCAD menu items, automating repetitive annotation tasks, generating geometry from spreadsheet data, or connecting to external databases.
  • Educational CAD instruction - Technical schools deploy QCAD as a zero-cost, fully-featured alternative to proprietary CAD software for teaching 2D drafting, allowing students to work on personal machines without institutional licensing.
  • CNC machining drawing preparation - Machinists use QCAD to prepare DXF drawings with precise geometry that CNC controllers and CAM software consume directly, leveraging its accurate spline and polyline tools.

Under The Hood

Architecture QCAD is organized as a layered plugin system with a dependency-injected document core at its center. The RDocument class coordinates two injected abstractions — RStorage for persistence and RSpatialIndex for spatial entity lookups — making both backends fully swappable without touching application logic. Entities follow a strict Data/Entity split: geometry classes like RArcData hold pure math while RArcEntity wraps them with document identity and layer membership, enforcing a clean boundary between geometric computation and document semantics. All user interactions are implemented as RAction subclasses following the Command pattern, with JavaScript-driven EAction providing a scripting layer directly on top of the C++ RActionAdapter. This three-tier separation of document model, action commands, and rendering makes the codebase extensible at multiple levels simultaneously.

Tech Stack The application is built in C++ against Qt 6 (with Qt 5 backward compatibility maintained through multiple bundled QtScript generator versions) for cross-platform GUI, 2D graphics, event handling, and file I/O. DXF format parsing is handled by the embedded dxflib library under GPL, while OpenNURBS is bundled for advanced spline geometry operations. The JavaScript scripting engine uses Qt’s QtScript bindings, with SWIG-style generated wrappers exposing the full C++ entity API to scripts. DWG support is delivered as a separate proprietary plugin excluded from this repository. The build system is QMake for legacy compatibility, with CMake being incrementally introduced. The application ships as a fully standalone desktop binary with no external runtime dependencies.

Code Quality The codebase lacks an automated test suite; directories labeled as tests contain DXF sample files used for manual visual comparison rather than executable assertions. Error handling follows Qt’s exception-minimal conventions with return values and optional out-parameters, though coverage is inconsistent across the scripting layer where guard clauses are often absent. The C++ headers carry comprehensive Doxygen documentation comments explaining intent and contracts, and naming conventions are uniformly applied using the Qt-style R prefix for core engine classes. No CI configuration or automated linting toolchain exists in the repository, placing quality assurance burden on code review and manual testing.

What Makes It Unique QCAD’s deepest technical differentiation is its tight ECMAScript integration: by generating complete Qt script wrappers around the C++ entity model, it allows JavaScript running inside the application to create, modify, and export CAD entities with the same capabilities as native C++ plugins. This architecture enables the entire drawing tool suite — line tools, dimension tools, block management — to be implemented as JavaScript add-ons that ship alongside the binary and can be modified or extended without recompilation. The screen-based linetype rendering system, where dash patterns scale with pixel density rather than drawing units, is a practical engineering choice that solves a long-standing usability problem with zoom-dependent linetype display present in many competing open-source CAD implementations.

Self-Hosting

QCAD’s source code is released under the GNU General Public License version 3 with a linking exception. The GPL v3 grants the right to use, study, modify, and distribute the software freely, including for commercial purposes, provided that any distributed modifications remain under the same license. The linking exception is significant for plugin developers: it explicitly permits linking proprietary C++ plugins or scripts against the QCAD libraries without those plugins being required to adopt the GPL, which is why Ribbonsoft can offer a proprietary DWG plugin alongside the open-source core.

Running QCAD yourself means compiling from source or using community-maintained packages. The build requires a C++ toolchain and Qt 6 development headers, and compilation is documented on the project website. Because QCAD is a desktop application rather than a server service, operational overhead is minimal — there is no database to maintain, no server process to monitor, and no network exposure by default. Updates are managed by compiling newer releases or waiting for your Linux distribution to update its package. The primary ongoing effort is staying current with Qt version upgrades and tracking DXF format changes.

Ribbonsoft, the company behind QCAD, sells QCAD Professional, a commercial release that includes the proprietary DWG read/write plugin, a professional part library, and premium support. The open-source community edition available on GitHub does not include DWG support. Self-hosters who need DWG compatibility must purchase the DWG plugin separately or use an alternative conversion path. There are no managed cloud or SaaS tiers — QCAD is purely a desktop application, so hosted deployment, cloud storage integration, and web-based collaboration features that some commercial CAD platforms offer are not available.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search