qtinuum / qtnproperty Goto Github PK
View Code? Open in Web Editor NEWExtended properties for Qt5
License: Apache License 2.0
Extended properties for Qt5
License: Apache License 2.0
Hi,
another question: Is there a possibility to change for example Float property using mouse movement, I was thinking about similar sliders like in gimp 2.8, such that one can change the value with mouse additionaly the property is filled with "progress like" bar rectangle depending on the current, min and max values of given property.
Thanks in advance.
As has been told on AwesomeBump github, would be good to have a "Button" property - action you could start from QtnProperty (for example "Recalculate " - as it might be some time consuming operations, should not executed immediately after parameters have been changed). I would like to implement such think - could you give recommendations how could I start with that?
Regards
Pawel
Building the demo application with Qt 5.15.2 and MinGW 11 causes the following error
make -f Makefile.Release
make[1]: Entering directory 'C:/CodingXP/QtnProperty/build/Demo'
g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQTN_DYNAMIC_IMPORT -DNDEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SCRIPT_LIB -DQT_SCRIPTTOOLS_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\..\Demo -I. -I..\..\..\QtnProperty -I. -I..\..\..\Qt\5.15.2\mingw81_64\include -I..\..\..\Qt\5.15.2\mingw81_64\include\QtWidgets -I..\..\..\Qt\5.15.2\mingw81_64\include\QtGui -I..\..\..\Qt\5.15.2\mingw81_64\include\QtANGLE -I..\..\..\Qt\5.15.2\mingw81_64\include\QtScript -I..\..\..\Qt\5.15.2\mingw81_64\include\QtScriptTools -I..\..\..\Qt\5.15.2\mingw81_64\include\QtCore -I. -I/include -I..\..\..\Qt\5.15.2\mingw81_64\mkspecs\win32-g++ -o release\MainWindow.o ..\..\Demo\MainWindow.cpp
..\..\Demo\MainWindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
..\..\Demo\MainWindow.cpp:44:56: warning: 'const QRect QDesktopWidget::availableGeometry(int) const' is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
44 | move(QApplication::desktop()->availableGeometry().center() -
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from ..\..\..\Qt\5.15.2\mingw81_64\include\QtWidgets/QDesktopWidget:1,
from ..\..\Demo\MainWindow.cpp:5:
..\..\..\Qt\5.15.2\mingw81_64\include\QtWidgets/qdesktopwidget.h:88:67: note: declared here
88 | QT_DEPRECATED_X("Use QGuiApplication::screens()") const QRect availableGeometry(int screen = -1) const;
| ^~~~~~~~~~~~~~~~~
In file included from C:/CodingXP/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/string:48,
from ..\..\..\Qt\5.15.2\mingw81_64\include/QtCore/qbytearray.h:52,
from ..\..\..\Qt\5.15.2\mingw81_64\include/QtCore/qstring.h:50,
from ..\..\..\Qt\5.15.2\mingw81_64\include/QtCore/qobject.h:47,
from ..\..\..\Qt\5.15.2\mingw81_64\include/QtWidgets/qwidget.h:45,
from ..\..\..\Qt\5.15.2\mingw81_64\include\QtWidgets/qmainwindow.h:44,
from ..\..\..\Qt\5.15.2\mingw81_64\include\QtWidgets/QMainWindow:1,
from ..\..\Demo\MainWindow.h:4,
from ..\..\Demo\MainWindow.cpp:1:
C:/CodingXP/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/stl_function.h: In instantiation of 'bool std::equal_to<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = MyColor]':
..\..\..\QtnProperty/QtnProperty/Auxiliary/PropertyTemplates.h:282:18: required from 'bool QtnSinglePropertyBaseAs<QtnSinglePropertyBaseType, ActualValueType, EqPred>::isValueEqualImpl(QtnSinglePropertyBaseAs<QtnSinglePropertyBaseType, ActualValueType, EqPred>::ValueType) [with QtnSinglePropertyBaseType = QtnPropertyQColorBase; ActualValueType = MyColor; EqPred = std::equal_to<MyColor>; QtnSinglePropertyBaseAs<QtnSinglePropertyBaseType, ActualValueType, EqPred>::ValueType = MyColor]'
..\..\..\QtnProperty/QtnProperty/Auxiliary/PropertyTemplates.h:280:15: required from here
C:/CodingXP/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/stl_function.h:356:20: error: no match for 'operator==' (operand types are 'const MyColor' and 'const MyColor')
356 | { return __x == __y; }
| ~~~~^~~~~~
QtnPropertyDelegateWithValueEditor::acceptKeyPressedForInplaceEditImpl
I can't build out by myself..
My QT version Qt\5.11.2\msvc2015
#include <QApplication>
#include "PropertyCore.h"
#include "PropertyWidget.h""
#include "QObjectPropertySet.h"
#include <QHBoxLayout>
#include <QString>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget w;
w.setLayout(new QHBoxLayout);
QtnPropertyWidget *centralWidget = new QtnPropertyWidget();
auto m_propertySet = new QtnPropertySet(centralWidget);
w.layout()->addWidget(centralWidget);
auto floatValue = new QtnPropertyFloat(m_propertySet);
floatValue->setName(QObject::tr("Value"));
floatValue->setDescription(QObject::tr("Float value"));
floatValue->setMaxValue(1.f);
floatValue->setMinValue(0.f);
floatValue->setStepValue(0.1f);
floatValue->setValue(0.3f);
auto m_propertySet2 = new QtnPropertySet(centralWidget);
m_propertySet2->setName("ololo");
m_propertySet->addChildProperty(m_propertySet2);
centralWidget->setPropertySet(m_propertySet);
w.show();
return a.exec();
//QtnPropertyEnum* EnumProperty = new QtnPropertyEnum(nullptr);
}
if uncomment //QtnPropertyEnum* EnumProperty = new QtnPropertyEnum(nullptr); it will works.
if exclude all enums from Demo.pef, it will give the same exeption.
I think something wrong with initQtnPropertyWidgetLibrary in PropertyDelegateFactory.cpp.
I use visual studio 2017 x64 and Qt 5.10.1.
editorBase() will destoryed which is QColorDialog's parent
why not use as flow
auto property = &this->property();
auto reason = delegate()->editReason();
QColorDialog dlg(property->value());
if (dlg.exec() == QDialog::Accepted)
{
property->setValue(dlg.currentColor(), reason);
}
Implement mechanism to notify delegate if mouse over or pushed on the delegate.
For example to make pushing Button's delegate more natural.
Hello. Working with QtnPropertySetXXX i created own method QtnPropertySetXXX::method() in pef file. I need to operate it from base class.
If topic name solution isnt suitable, how could it be achieved without casting?
What should be done in QtnProperty project now to be included in AwesomeBump?
delegate is colored rectangle with editing by left click
I almost didn't bother with this project because it says that it's licensed under the GPL on Qt apps :)
However, it was a pleasant surprise to see that the license has changed to Apache.
Could you perhaps change the information?
Thanks!
FYI
I've made CheckBox interactive. It doesn't popup checkbox control on mouse click but toggles Bool property.
LINK : fatal error LNK1181: cannot open input file 'release\QtnCoreUnity.obj'
jom: C:\Users\User\Documents\Visual Studio 2015\Projects\build-Property-Desktop_Qt_5_8_0_MSVC2015_64bit-Release\Core\Makefile.Release [C:\Users\User\Documents\Visual Studio 2015\Projects\QtnProperty\bin-win\QtnPropertyCore.lib] Error 1181
jom: C:\Users\User\Documents\Visual Studio 2015\Projects\build-Property-Desktop_Qt_5_8_0_MSVC2015_64bit-Release\Core\Makefile [release] Error 2
jom: C:\Users\User\Documents\Visual Studio 2015\Projects\build-Property-Desktop_Qt_5_8_0_MSVC2015_64bit-Release\Makefile [sub-Core-make_first] Error 2
17:30:25: The process "C:\Qt\Qt5.8.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project Property (kit: Desktop Qt 5.8.0 MSVC2015_64bit)
When executing step "Make"
17:30:25: Elapsed time: 00:36.
Hey guys, seems like a great project and would like to use it in mine, but I'm getting this error while trying to compile it.
I'm on Windows 10 64bit, Qt 5.8 with msvc2015_64 also tried on Qt5.8.0-mingw-5-3.
I tried compiling through the Qt Creator and also with cmake. Nmake commands also didn't help.
Does Qt 5.8 works with this one? or the libraries here needs to be updated?
I have some custom types which closely resemble Qt types with property delegates already implemented. E.g. Colour -> QColor, glm::vec2 -> QPointF. I would like to reuse existing delegates and write as little bridge code as possible. In a perfect case there would be only two methods to convert between these types back and forth. What is the easiest way to reuse delegates right now? Are some improvements possible?
Hi, Alex Zhondin.
First, thanks for your QtnProperty library. It's nice.
And can you support Tab (Shift + Tab) to navigate to input next field?
Regards,
Eric.
Hi,
I want to add QtnProperty to my project in which I have a set of parameters which control the application. I would like to add the possibility to update the application each time one of the parameters has changed. Normally, I would write a signal "parameterChanged" for each property and detect this signal in main class. The question is: How can I do it with QtnProperty ?
Thanks in advance.
to declare attributes for child properties in parent property:
for example:
QPen pen
{
delegate
{
Style:showNoPen = true;
}
}
My Qt version is 5.4.2.
Use subproperties to build up QPen string representation, like QFont
@kmkolasinski and @ppiecuch I will notify you and give an example when complete this feature.
QtnPropertyWidget* centralWidget;
QtnPropertySet* m_propertySet;
centralWidget = new QtnPropertyWidget();
m_propertySet = new QtnPropertySet(centralWidget);
layout()->addWidget(centralWidget);
centralWidget->setPropertySet(m_propertySet);
new QtnPropertyBool(m_propertySet); // this produce Cannot find default delegate for property "" Did you forget to register default delegate for QtnPropertyBase type?
if i swap this lines
centralWidget->setPropertySet(m_propertySet);
new QtnPropertyBool(m_propertySet);
this problem is gone.
Hi, at first I would like to thank you for all the help you done to integrate Qtn in AwesomeBump project. I slowly introduce changes in GUI and everything works perfect.
However today I've tried to implement saving feature which is done in following way. I have multiple propertysets which are separate, but I want to keep all the data in one file. So to do that I decided to make another property set which I will use to keep all the data in one place:
property_set AwesomeBump{
extern property_set FormImageProp Diffuse{}
extern property_set FormImageProp Specular{}
}
In future I'm going to add more properties to it. Then during save I do
abSettings->Diffuse.copyValues(diffuseImageProp->imageProp.properties);
abSettings->Specular.copyValues(specularImageProp->imageProp.properties);
QFile file( "test.dat" );
QDataStream stream( &file );
abSettings->save(stream);
Which causes this assert:
ASSERT: "false && "serializable properties should have unique ids"" in file ../AwesomeBump/Sources/utils/QtnProperty/Core/PropertySet.cpp, line 332
However I tried to use:
QTextStream stream(&file);
QString data;
abSettings->toStr(data);
stream << data;
But only the first property FormImageProp Diffuse was written into file. Do you know how to fix it?
When calling propertyView()->setActiveProperty() sub-items are not created immediately. So if I send fake Enter key to the view synchronously it doesn't start inplace editing. I have to send it async at the next frame.
Is it possible to fix this? Is it also possible to create a method for triggering inplace editor without having user to send fake keyboard events? Would like something like this:
propertyView()->setActiveProperty(...);
propertyView()->startEditingActiveProperty(); // create inplace editor and focus on it
See also:
cegui/ceed-cpp@c7c2f3a#diff-583c1e7f1eb64f6f91c4b799dcca092a8388a8c63cca38f694237d404224cbbcR1352
this code:
QtnPropertySet* set = new QtnPropertySet(this);
ui->propertyWidget->setPropertySet(set);
QtnPropertyQColor* textColor = new QtnPropertyQColor(set);
textColor->setName(tr("textColor"));
textColor->setDescription(tr("Foreground text color"));
textColor->setValue(QColor(0, 0, 0));
produces following:
textColor Delegate <> unknown;
I've spent an hour and still can't find how to attach a delegate.
Anyway, the project really misses documentation.
Hi!
I operate with small values which should be entered in scientific notation. For example 0.000000001 is more convenient when written as 1.0e-9.
Is it possible to set up display format for qtnCreateProperty?
I've noticed that https://github.com/kusharami/QtnProperty has a lot of improvements/refactorings that could be interesting/beneficial for users.
@kusharami May I paste a link to your project in my README.md with a short description of changes/improvements available there?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.