ForGE Qt is a comprehensive, Qt-equivalent application framework for Fortran, providing everything from GUI widgets to networking, database access, and threading - all with a Fortran-native API.
ForGE Qt aims to bring Qt-level functionality to Fortran applications, including:
- 50+ Widget Types (20 implemented, more coming)
- Signals & Slots - Qt-style event handling β
- QString & Containers - Advanced data structures β
- Networking - HTTP client, TCP/UDP sockets β API
- Threading - QThread, mutexes, semaphores β API
- JSON/XML - Modern data formats β API
- Multi-Platform - Windows β , Linux (planned), macOS (planned), Platform-Agnostic β
- ForgeML - Declarative UI language (planned)
- Visual Designer - GUI builder tool (planned)
- Modern Fortran: Built with Fortran 2008/2018 features (OOP, abstract interfaces, submodules)
- Cross-Platform: Runs on Linux, Windows, and macOS
- Multiple Backends: Pluggable backend system (Custom GUI, Platform-Agnostic, Windows β , Linux/macOS planned)
- Clean API: Intuitive, object-oriented interface with builder pattern support
- Event-Driven: Comprehensive event handling system with Qt-style Signals & Slots
- Flexible Layouts: Grid, Box, and Stack layout managers
- Rich Widgets: 20+ widget types including buttons, checkboxes, comboboxes, menus, and more
- Modern Build Systems: Support for both fpm and CMake
- Well Documented: Extensive inline documentation and examples
- Qt-Equivalent: Signals & Slots, QString, QList, QMap, networking, threading APIs
# Clone the repository
git clone https://github.com/Galactic-FaaS/fortran-forge.git
cd fortran-forge
# Build with fpm
fpm build
# Run an example
fpm run --example hello_world# Clone the repository
git clone https://github.com/Galactic-FaaS/fortran-forge.git
cd fortran-forge
# Configure and build
mkdir build
cd build
cmake ..
cmake --build .
# Run an example
./hello_worldprogram my_gui_app
use forge_qt
implicit none
type(QApplication) :: app
type(QPushButton) :: button
type(forge_connection) :: conn
! Initialize application
call app%init()
! Create a button with Qt-style signals
button = QPushButton()
call button%set_label("Click Me!")
! Connect signal to slot
conn = button%clicked%connect(on_button_clicked)
! Run the event loop
call app%run()
contains
subroutine on_button_clicked()
print *, "Button was clicked!"
end subroutine
end program my_gui_app- API Documentation - Complete API reference
- Tutorials - Step-by-step guides
- GUI Framework Comparison - Backend options analysis
- Migration Guide - Transitioning from ForGE v0.4 (GTK2)
- Examples - Working example programs
fortran-forge/
βββ src/ # Library source code
β βββ core/ # Core utilities
β β βββ forge_string_utils.f90 # QString implementation
β β βββ forge_containers.f90 # QList, QMap, QStack, QQueue
β β βββ forge_json.f90 # JSON support
β βββ gui/widgets/ # Widget implementations (20+ types)
β β βββ forge_checkbox.f90
β β βββ forge_combobox.f90
β β βββ ... (18 more widgets)
β βββ network/ # Networking stack
β β βββ forge_socket.f90 # TCP/UDP sockets
β β βββ forge_http.f90 # HTTP client
β βββ concurrent/ # Threading support
β β βββ forge_thread.f90 # QThread, QMutex
β βββ backends/custom/ # Custom GUI backend
β β βββ forge_platform_windows.f90 # Win32 integration β
β β βββ forge_platform_null.f90 # Platform-agnostic β
β β βββ forge_rendering.f90 # Cairo 2D graphics
β βββ forge_signals.f90 # Qt-style signals & slots β
β βββ forge_qt.f90 # Unified Qt module β
β βββ ... (8 core modules)
βββ examples/ # Example applications (7 working)
βββ test/ # Test suite (2 test files)
βββ docs/ # Documentation (16 files)
βββ fpm.toml # FPM manifest
βββ CMakeLists.txt # CMake configuration
- Window: Main application window with title, size, position control
- Button: Clickable buttons with event handlers
- Label: Static text display
- Entry: Single-line text input
- TextView: Multi-line text editor
- ProgressBar: Visual progress indicator
- CheckBox: Check/uncheck with tristate support
- RadioButton: Mutually exclusive selection with button groups
- ComboBox: Dropdown selection with editable option
- SpinBox: Integer/double numeric input with increment/decrement
- Slider: Value selection slider (horizontal/vertical)
- GroupBox: Titled frame for grouping controls
- TabWidget: Tabbed interface for multiple pages
- ScrollArea: Scrollable container for large content
- MenuBar: Application menu bar
- Menu: Popup menus with submenus
- Action: Menu items with shortcuts and checkable states
- ListView: Model-view list widget
- ListWidget: Simple list widget
- MessageBox: Standard dialogs (Information, Warning, Error, Question)
- StatusBar: Status messages and widget display
- Separator: Visual divider (horizontal/vertical)
Total: 20 widget types implemented!
fpm run --example hello_worldCreates a simple window with a label.
fpm run --example button_demoDemonstrates button creation and click event handling.
custom_window- Native Win32 window creationcairo_rendering- 2D graphics rendering with Cairointeractive_button- Mouse interaction and hover statessignals_demo- Qt-style signals & slots demonstrationtodo_app- Multi-widget application with signalscalculator- Full calculator with 20+ buttons
- gfortran 9.0+ (recommended)
- Intel Fortran (ifort/ifx)
- NAG Fortran
- fpm (Fortran Package Manager) - recommended, or
- CMake 3.20+
Depending on which backend you use:
- Custom Backend: Cairo 2D graphics library (for rendering)
- Windows Backend: Win32 API (built-in to Windows)
- Platform-Agnostic Backend: No dependencies (framebuffer-only)
- Stub Backend: No dependencies (testing only)
Version: 1.0.0-qt-alpha
This is a complete modernization/rewrite of the original ForGE project into a Qt-equivalent framework. The current release includes:
- Qt-Equivalent Core: Signals & Slots, QString, QList, QMap, QStack, QQueue
- 20 Widget Types: Buttons, checkboxes, comboboxes, menus, dialogs, and more
- Networking API: QTcpSocket, QUdpSocket, QHttpClient
- Threading API: QThread, QMutex, QSemaphore, QWaitCondition
- JSON Support: QJsonValue, QJsonObject, QJsonArray
- Custom GUI Backend: Native Windows + Cairo 2D rendering
- Platform-Agnostic Backend: Unique framebuffer-only option
- Build Systems: fpm + CMake with CI/CD
- 7 Working Examples: Including interactive GUIs
- 2 Test Suites: Core functionality tests
- 16 Documentation Files: Comprehensive guides
- JSON parser implementation (70% β 100%)
- Socket implementation (Winsock2 integration)
- HTTP client implementation
- Additional widgets (30+ total)
- Linux/X11 backend
- macOS/Cocoa backend
- ForgeML declarative UI language
- Visual Designer tool
- Database drivers (SQLite, PostgreSQL)
- SSL/TLS networking
- Advanced graphics (scene graph, animation)
- ForGE Qt 1.0.0 release
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Tcl/Tk backend implementation
- Additional widget types
- Layout manager functionality
- Test coverage
- Documentation improvements
ForGE is released under the GNU General Public License v3.0 or later. See LICENSE for details.
ForGE originated as a GTK2-based GUI library (v0.1 - v0.4.0) and has been completely modernized into ForGE Qt, a Qt-equivalent framework with:
- Modern Fortran 2008/2018 features and OOP
- Qt-style Signals & Slots event system
- QString, QList, QMap, QStack, QQueue containers
- 20+ widget types with Qt-equivalent APIs
- Networking (QTcpSocket, QUdpSocket, QHttpClient)
- Threading (QThread, QMutex, QSemaphore)
- JSON support (QJsonValue, QJsonObject, QJsonArray)
- Custom GUI backend with Cairo 2D rendering
- Platform-agnostic backend (unique feature!)
- Active development and comprehensive documentation
See CHANGELOG.md for version history.
- Original ForGE project by John N. Shahbazian
- gtk-fortran project for inspiration
- Fortran-lang community for tools and support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: forge-dev@example.com
Note: ForGE Qt is under active development. The API may change as we implement and refine features. We're working towards a stable 1.0.0 release with full Qt-equivalent functionality across all platforms.