Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
68f8af6
Graph window with floating toolbar
mahmoodzaker Jul 13, 2025
db93af5
Limit floating window to main windows boundaries
mahmoodzaker Jul 13, 2025
31c8f1c
Setup glyph buttons
mahmoodzaker Jul 13, 2025
9a0490d
Draggable toolbar buttons.
mahmoodzaker Jul 13, 2025
f41bd81
Toolbox Docking
mahmoodzaker Jul 13, 2025
52b735e
Scene creation separation
mahmoodzaker Jul 13, 2025
e93d25d
DataFlowGraphicsScene
mahmoodzaker Jul 13, 2025
da69d2a
Model basics
mahmoodzaker Jul 14, 2025
18e1453
Video input/output models
mahmoodzaker Jul 14, 2025
fd1be0d
Control mandatory nodes deletion
mahmoodzaker Jul 14, 2025
b4f4716
Dynamic ports
mahmoodzaker Jul 14, 2025
af76a47
Delete unused model
mahmoodzaker Jul 14, 2025
f40667e
Multi Port Process node
mahmoodzaker Jul 14, 2025
defa4f3
Implementing node limitations.
mahmoodzaker Jul 14, 2025
8018089
Refactor DataFlowModel
mahmoodzaker Jul 15, 2025
0bedfa9
Add QtPropertyBrowser as external library
mahmoodzaker Jul 16, 2025
64f99bf
Add dockable panel for properties
mahmoodzaker Jul 16, 2025
7c61112
Add Properties to Properties Panel
mahmoodzaker Jul 16, 2025
e1ed663
Refactoring floating panel class
mahmoodzaker Jul 16, 2025
de7f661
Add buildlib
mahmoodzaker Jul 16, 2025
8bf41e6
Adjust input height in property editor
mahmoodzaker Jul 16, 2025
8eba1a4
Adjust property row height
mahmoodzaker Jul 16, 2025
c6befcc
Node selection detection
mahmoodzaker Jul 16, 2025
97ca546
Adding new node types
mahmoodzaker Jul 17, 2025
9eb2a19
Add nodes to toolbar
mahmoodzaker Jul 17, 2025
dd5a919
Set selected node in property manager
mahmoodzaker Jul 17, 2025
7ecc161
Setup Properties in node base class
mahmoodzaker Jul 17, 2025
bce298f
Property changing event
mahmoodzaker Jul 17, 2025
21287d8
Add property to node base class
mahmoodzaker Jul 17, 2025
3716a83
property browser styling
mahmoodzaker Jul 17, 2025
3b08dde
Set Property manager row height
mahmoodzaker Jul 18, 2025
8e860f1
Adding basic name property to all nodes
mahmoodzaker Jul 18, 2025
61d78ca
Slider buffer properties
mahmoodzaker Jul 18, 2025
5e62da1
No attributes
mahmoodzaker Jul 18, 2025
c46001d
Generate default name for each new node
mahmoodzaker Jul 18, 2025
604de72
Automatic property browsing for QObjects
mahmoodzaker Jul 21, 2025
6ac25f1
Cleaning up
mahmoodzaker Jul 21, 2025
70016ab
Add properties to nodes
mahmoodzaker Jul 21, 2025
a37b517
Expandable categories
mahmoodzaker Jul 21, 2025
6aab79f
Nodes in category/subcategory
mahmoodzaker Jul 21, 2025
7265b39
Node name based on class name
mahmoodzaker Jul 21, 2025
c29dc22
Remove node type enum
mahmoodzaker Jul 21, 2025
a2de856
Adding nodes to categories
mahmoodzaker Jul 21, 2025
b6796da
Add int node types
mahmoodzaker Jul 21, 2025
56e5b70
Double scalars
mahmoodzaker Jul 21, 2025
4ebb207
float ui
mahmoodzaker Jul 21, 2025
f55785e
Fixed buffers
mahmoodzaker Jul 21, 2025
ac83cd9
Replace Property manager with fetch content
mahmoodzaker Jul 21, 2025
d6ee5d7
Color types
mahmoodzaker Jul 21, 2025
100a626
Array nodes
mahmoodzaker Jul 21, 2025
7edf4d5
Use float property type
mahmoodzaker Jul 22, 2025
ca0d546
Using uint qtPropertyManager
mahmoodzaker Jul 22, 2025
82d082b
Adding array fixed buffer value field
mahmoodzaker Jul 22, 2025
277d46c
Process node left nodes +,- buttons
mahmoodzaker Jul 22, 2025
67fd275
Add right Buffer/Image buttons to process node
mahmoodzaker Jul 22, 2025
f4d2f93
Add process out port labels
mahmoodzaker Jul 22, 2025
84fc283
Grid/Block size to process node
mahmoodzaker Jul 22, 2025
e6a6b8c
Object property parse
mahmoodzaker Jul 22, 2025
799a840
fix object parse issue
mahmoodzaker Jul 22, 2025
328056a
Add color object to float4 components
mahmoodzaker Jul 22, 2025
a37810b
Callback Managed Buffer
mahmoodzaker Jul 22, 2025
22652c9
Add Image/Buffer to left ports of process node
mahmoodzaker Jul 22, 2025
81fc789
Process node styling
mahmoodzaker Jul 22, 2025
c1da52c
Fixing deleted node bug
mahmoodzaker Jul 22, 2025
a89a192
Add combo to toolbar
mahmoodzaker Jul 22, 2025
5643065
Changing toolbar panel layout
mahmoodzaker Jul 22, 2025
655f76d
Disable right click menu
mahmoodzaker Jul 23, 2025
c8d9ecd
Restrict drop are for process nodes
mahmoodzaker Jul 23, 2025
b569369
Process node movement and placement Restrictions
mahmoodzaker Jul 23, 2025
f2461b1
Manage node connection types
mahmoodzaker Jul 23, 2025
85b45c0
Video output node
mahmoodzaker Jul 23, 2025
06ae3ab
Fix port insertion bug
mahmoodzaker Jul 23, 2025
935bed2
Add remove left/right selectable ports in process node
mahmoodzaker Jul 23, 2025
ba990a1
Set process node ports properties
mahmoodzaker Jul 23, 2025
d3b7d49
code editor dockable panel
mahmoodzaker Jul 28, 2025
5e1cc80
Adding QScintilla Library
mahmoodzaker Jul 28, 2025
621b353
Apply QScintilla to code editor
mahmoodzaker Jul 28, 2025
52ae6c5
Improvements in code editor
mahmoodzaker Jul 28, 2025
56cb221
Add error highlighter to editor
mahmoodzaker Jul 28, 2025
cc13c5f
Move all panels files to panels folder
mahmoodzaker Jul 30, 2025
0e7e84c
Add compilers to code editor
mahmoodzaker Jul 30, 2025
a65b4b7
Update lexer colors after switching to dark mode
mahmoodzaker Aug 4, 2025
9b38f4a
Remove GLSL from languages
mahmoodzaker Aug 4, 2025
2e8bcb3
Remove GLSL compiler codes
mahmoodzaker Aug 4, 2025
0902fe2
Runtime detecting compilers
mahmoodzaker Aug 4, 2025
6c9209e
Split compilers classes
mahmoodzaker Aug 4, 2025
211b999
Resoving opencl flags
mahmoodzaker Aug 4, 2025
026bafd
Seperating lexer and code editor classes
mahmoodzaker Aug 4, 2025
01bb204
Remove error highlighter
mahmoodzaker Aug 4, 2025
16ff409
Set panel priority
mahmoodzaker Aug 5, 2025
3966a95
Show/Hide code editor after selecting process node
mahmoodzaker Aug 5, 2025
86c1b9b
maximizing code editor panel
mahmoodzaker Aug 5, 2025
9acbc37
Separate code editor logic from panel
mahmoodzaker Aug 5, 2025
0cd8a13
hide maximize button in floating mode in code editor panel
mahmoodzaker Aug 5, 2025
7f2c802
Adjust panel resizing
mahmoodzaker Aug 5, 2025
d304043
Refactor Process node class
mahmoodzaker Aug 5, 2025
d75450d
Store/Fetch code from process node object
mahmoodzaker Aug 5, 2025
b61bb66
make some lines readonly in qscentilla
mahmoodzaker Aug 6, 2025
8e03ef2
Make declaration of functions readonly, set function name as process …
mahmoodzaker Aug 6, 2025
04b962a
Fix function naming issue
mahmoodzaker Aug 6, 2025
6aebbc1
Refactor port classes
mahmoodzaker Aug 7, 2025
0360be6
Improve Process node port insertion
mahmoodzaker Aug 7, 2025
9acba43
Generate program prototype dynamicly
mahmoodzaker Aug 7, 2025
f8563b2
Add Parameters to code template
mahmoodzaker Aug 7, 2025
6c87877
allow user to edit codes despite compiler not exists
mahmoodzaker Aug 7, 2025
5e553ae
Metal/Cuda Prototypes
mahmoodzaker Aug 7, 2025
afa079f
Adding callback managed array buffers
mahmoodzaker Aug 7, 2025
03d3942
Buffer image nodes
mahmoodzaker Aug 7, 2025
6f35727
Editable prototype for metal code
mahmoodzaker Aug 7, 2025
0c09d49
Output image type with access type property
mahmoodzaker Aug 7, 2025
4764002
parse enum property
mahmoodzaker Aug 7, 2025
02c6e59
Output image access type
mahmoodzaker Aug 8, 2025
f5fc6d7
Base buffer class
mahmoodzaker Aug 8, 2025
9a47249
Input buffer base class
mahmoodzaker Aug 8, 2025
890305e
Add buffer ports to function prototype
mahmoodzaker Aug 8, 2025
0531052
Scalar variable types defination
mahmoodzaker Aug 8, 2025
39cf7d5
Array buffer data types
mahmoodzaker Aug 8, 2025
e8e8a75
Fix wrong node types
mahmoodzaker Aug 8, 2025
862df4c
Fix connection issue for process nodes
mahmoodzaker Aug 8, 2025
1da538d
Fix array input parameters
mahmoodzaker Aug 8, 2025
818476b
Set default port names
mahmoodzaker Aug 12, 2025
87b9f84
Remove property editor for selected port
mahmoodzaker Aug 12, 2025
9891e9f
Remove process port property, Change process node connection approach
mahmoodzaker Aug 13, 2025
17fe1b8
Add write/readWrite toggle to process node output ports
mahmoodzaker Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.pyc
CMakeLists.txt.user

build*/
build/
.vscode/

tags
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.11)
cmake_policy(SET CMP0072 NEW) # new in 3.11. The NEW behavior for this policy is to set OpenGL_GL_PREFERENCE to GLVND.
cmake_policy(SET CMP0068 NEW) # new in 3.9. The NEW behavior of this policy is to ignore the RPATH settings for install_name on macOS.

include(FetchContent)

project(QtNodesLibrary CXX)

Expand Down Expand Up @@ -53,6 +54,16 @@ else()
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets)
endif()

FetchContent_Declare(
qt-property-browser
GIT_REPOSITORY https://github.com/ramin-raeisi/qt-property-browser.git
GIT_TAG epen/6.9.1
GIT_SHALLOW TRUE
SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/qt-property-browser"
BINARY_DIR "${CMAKE_BINARY_DIR}/external/qt-property-browser"
)
FetchContent_MakeAvailable(qt-property-browser)

find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Gui OpenGL)
message(STATUS "QT_VERSION: ${QT_VERSION}, QT_DIR: ${QT_DIR}")

Expand Down
21 changes: 12 additions & 9 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
add_subdirectory(simple_graph_model)
#add_subdirectory(simple_graph_model)

add_subdirectory(vertical_layout)
#add_subdirectory(vertical_layout)

add_subdirectory(calculator)
#add_subdirectory(calculator)

add_subdirectory(text)
#add_subdirectory(text)

add_subdirectory(resizable_images)
#add_subdirectory(resizable_images)

add_subdirectory(styles)
#add_subdirectory(styles)

add_subdirectory(connection_colors)
#add_subdirectory(connection_colors)

add_subdirectory(dynamic_ports)
#add_subdirectory(dynamic_ports)

add_subdirectory(lock_nodes_and_connections)
#add_subdirectory(lock_nodes_and_connections)

add_subdirectory(epen_graph_editor)

add_subdirectory(demo)
14 changes: 14 additions & 0 deletions examples/demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
file(GLOB_RECURSE CPPS ./*.cpp )
file(GLOB_RECURSE HPPS ./*.h )

find_package(Qt6 REQUIRED COMPONENTS Core Widgets)

add_executable(demo ${CPPS} ${HPPS})

target_include_directories(demo
PUBLIC
include
)

target_link_libraries(demo PRIVATE Qt6PropertyBrowser QtNodes Qt6::Core
Qt6::Widgets)
8 changes: 8 additions & 0 deletions examples/demo/demo.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<RCC version="1.0">
<qresource prefix="/demo">
<file>images/up.png</file>
<file>images/down.png</file>
<file>images/right.png</file>
<file>images/left.png</file>
</qresource>
</RCC>
Binary file added examples/demo/images/down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/demo/images/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/demo/images/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/demo/images/up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions examples/demo/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Solutions component.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include <QApplication>
#include <QScrollArea>
#include <QGridLayout>
#include <QLabel>
#include <QIcon>
#include <QMap>
#include "qtpropertymanager.h"
#include "qteditorfactory.h"
#include "qttreepropertybrowser.h"
#include "qtbuttonpropertybrowser.h"
#include "qtgroupboxpropertybrowser.h"

int main(int argc, char **argv)
{
QApplication app(argc, argv);

QWidget *w = new QWidget();

QtIntPropertyManager *intManager = new QtIntPropertyManager(w);
QObject::connect(intManager,&QtIntPropertyManager::valueChanged,[=](QtProperty* property, int val){
qDebug()<<"VVV"<<val;
});

QtEnumPropertyManager *enumManager = new QtEnumPropertyManager(w);


QtProperty *item8 = enumManager->addProperty("direction");
QStringList enumNames;
enumNames << "Up" << "Right" << "Down" << "Left";
enumManager->setEnumNames(item8, enumNames);
QMap<int, QIcon> enumIcons;
enumIcons[0] = QIcon(":/demo/images/up.png");
enumIcons[1] = QIcon(":/demo/images/right.png");
enumIcons[2] = QIcon(":/demo/images/down.png");
enumIcons[3] = QIcon(":/demo/images/left.png");
enumManager->setEnumIcons(item8, enumIcons);


QtProperty *item9 = intManager->addProperty("value");
intManager->setRange(item9, -100, 100);



QtSpinBoxFactory *spinBoxFactory = new QtSpinBoxFactory(w);

QtEnumEditorFactory *comboBoxFactory = new QtEnumEditorFactory(w);

QtAbstractPropertyBrowser *editor1 = new QtTreePropertyBrowser();
editor1->setFactoryForManager(intManager, spinBoxFactory);
editor1->setFactoryForManager(enumManager, comboBoxFactory);

editor1->addProperty(item8);
editor1->addProperty(item9);



QGridLayout *layout = new QGridLayout(w);


layout->addWidget(editor1, 1, 0);
w->show();

int ret = app.exec();
delete w;
return ret;
}
37 changes: 37 additions & 0 deletions examples/epen_graph_editor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
file(GLOB_RECURSE CPPS ./src/*.cpp )
file(GLOB_RECURSE HPPS ./include/*.hpp )

find_package(Qt6 REQUIRED COMPONENTS Core Widgets)

# Always build with all compiler support
# The runtime will check availability
add_definitions(-DALWAYS_INCLUDE_ALL_COMPILERS)

add_executable(epen_graph_editor ${CPPS} ${HPPS})

target_include_directories(epen_graph_editor
PUBLIC
include
)

# Base libraries
set(BASE_LIBS QtPropertyBrowser QtNodes Qt6::Core Qt6::Widgets ${QSCINTILLA_TARGET_NAME})

target_link_libraries(epen_graph_editor PRIVATE ${BASE_LIBS})

# Platform-specific settings
if(APPLE)
# On macOS, we might need to link against system frameworks for dynamic loading
find_library(DL_LIBRARY dl)
if(DL_LIBRARY)
target_link_libraries(epen_graph_editor PRIVATE ${DL_LIBRARY})
endif()
endif()

if(UNIX AND NOT APPLE)
# On Linux, we need libdl for dynamic loading
target_link_libraries(epen_graph_editor PRIVATE dl)
endif()

# Always enable runtime detection for all compilers
add_definitions(-DRUNTIME_GPU_DETECTION)
Binary file added examples/epen_graph_editor/include/.DS_Store
Binary file not shown.
135 changes: 135 additions & 0 deletions examples/epen_graph_editor/include/CodeEditor.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
#ifndef CODEEDITOR_HPP
#define CODEEDITOR_HPP

#include <memory>
#include <QKeyEvent>
#include <QString>
#include <QStringList>
#include <QWidget>
#include <Qsci/qsciscintilla.h>

class Process;
class QsciScintilla;
class GPULanguageLexer;
class QsciAPIs;

class ReadOnlyLinesEditor : public QsciScintilla
{
public:
ReadOnlyLinesEditor(QWidget *parent = nullptr)
: QsciScintilla(parent)
{
// Define a marker for background color
markerDefine(QsciScintilla::Background, READONLY_MARKER);

// Set grey background color for read-only lines
setMarkerBackgroundColor(QColor(220, 220, 220), READONLY_MARKER); // Light grey
}

void setReadonlyLines(QSet<int> readOnlyLines)
{
_readOnlyLines = readOnlyLines;
markerDeleteAll(READONLY_MARKER);
for (int line : _readOnlyLines) {
markerAdd(line, READONLY_MARKER);
}
}

protected:
void keyPressEvent(QKeyEvent *event) override
{
// Get current line
int line, col;
getCursorPosition(&line, &col);

// If on read-only line and not navigation key
if (_readOnlyLines.contains(line) && event->key() != Qt::Key_Up
&& event->key() != Qt::Key_Down && event->key() != Qt::Key_Left
&& event->key() != Qt::Key_Right && event->key() != Qt::Key_Home
&& event->key() != Qt::Key_End && event->key() != Qt::Key_PageUp
&& event->key() != Qt::Key_PageDown) {
// Block the key press
return;
}

// Otherwise, normal handling
QsciScintilla::keyPressEvent(event);
}

private:
QSet<int> _readOnlyLines;
static const int READONLY_MARKER = 1;
};

class CodeEditor : public QWidget
{
Q_OBJECT

public:
explicit CodeEditor(QWidget *parent = nullptr);
~CodeEditor();

// Code management
void setCode(const QString &code);
QString getCode() const;

// Language management
void setLanguage(const QString &language);
QString getCurrentLanguage() const;
QStringList getSupportedLanguages() const { return m_supportedLanguages; }

// Editor settings
void setReadOnly(bool readOnly);
bool isReadOnly() const;

// Theme management
void setDarkMode(bool dark);
bool isDarkMode() const { return m_isDarkMode; }

// Editor access (for advanced operations)
QsciScintilla *editor() { return m_editor; }
const QsciScintilla *editor() const { return m_editor; }

// Cursor and selection
void setCursorPosition(int line, int column);
void getCursorPosition(int &line, int &column) const;
void ensureLineVisible(int line);
void highlightLine(int line, int duration = 2000);
void setProcessNode(Process *processNode);
// Focus
void setFocus();

void updateCode();
signals:
void codeChanged();
void languageChanged(const QString &language);

private slots:
void onTextChanged();

private:
void setupEditor();
void setupCommonEditorFeatures();
void updateHighlighter();
void updateLexerColors();
void forceRefreshLexer();
void applyDarkTheme();
void applyLightTheme();
void setupAutoCompletion();
void setReadOnlyLines();
// Default code generators
QString getDefaultCode(const QString &language) const;

// UI elements
ReadOnlyLinesEditor *m_editor;
GPULanguageLexer *m_lexer;

// State
QString m_currentLanguage;
QStringList m_supportedLanguages;
bool m_isDarkMode;
Process *_processNode;
bool _codeUpdateLock = false;
};

#endif // CODEEDITOR_HPP
Loading
Loading