Comments (38)
So, for now I have to work with migration, during this process usually I need something or I don't know how to implement this with QtnProperty. I think It would be nice to have this hot editing with finishEditing signal if I well remember this is an equivalent for valueChanged or sliderMoved signals of QScrollBar. I will try today to do the color picking and buttons.
from qtnproperty.
Sorry I don't remember any talks about propertyDidFinishEditing signal.
Is it not sufficient to have propertyDidChange signal?
Please describe this feature in details, may be using new issue :o)
from qtnproperty.
Ok, no problem. Consider that your program has do to some heavy calculations each time you change some parameter. And now consider you have a scrollbar like button, which value can be changed by mouse dragging -- my version of QtnProperty. Then for example when you want to change value from 0 to 100 with step 1, now with propertyDidChange there will be 100 signals sent between 0 and 100, which is very uncomfortable, since it will require to run 100 calculations, which slow down the program. That is why I think it would be nice to have a signal which is send when user finish editing property, for example in case of Qscrollbar there is a special signal which is send when mouse after dragging is released. It is clear?
from qtnproperty.
All right, I've got it now.
I think it could be done by using special edit mode. I call it "live" edit. In this mode all modifications are propagating to the property. Otherwise we set final value to the property only at editor exit.
Is this "non live" edit mode is suitable for your needs?
Also keep in mind that if you will change such property by keyboard or by scrolling mouse - you will face the same problem - multiple propertyDidChange signal invokations. There is no such point as finish editing for modifications by keyboard or mouse wheel.
May be it's better to find out general solution there. Apply recalculation if user didn't changed property for some amount of time (for example 0.5 sec). Or stop recalculation if user changed property value again (if recalculations are running in non GUI thread).
from qtnproperty.
Would it be possible to have click action for ColorPoperty? Same as in Button case.
from qtnproperty.
You can disable color-selection panel with editor attribute:
QColor QColorProperty
{
description = "Property to hold QColor value.";
value = Qt::blue;
slot propertyDidChange
{
qDebug() << Q_FUNC_INFO << "Property has changed: " <<
&QColorProperty;
}
delegate {
-
editor = QtnColorDelegateEditorNone;* rgbSubItems = true; }
}
On Tue, Jan 19, 2016 at 9:07 PM, Krzysztof Kolasinski <
[email protected]> wrote:
Would it be possible to have click action for ColorPoperty? Same as in
Button case.—
Reply to this email directly or view it on GitHub
#6 (comment).
More:
(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)
from qtnproperty.
Would it be possible to have click action for ColorPoperty? Same as in Button case.
Why do you need this? Do you need to show different editors for different Color properties?
from qtnproperty.
I need to have ability to pick color from image in AB, but this require special signal which will disable some of the features during the picking.
from qtnproperty.
I think this is non-general feature for QColor properties, so I made derived ABColor property and delegate. I placed them to Demo project under /AB folder.
Please copy them into your AwesomeBump source folder (may be create sub-folder for further QtnProperty customizations) and use as regular properties. Don't forget to call regABColorDelegates(); in your main function to register custom property delegates.
example of usage is similar as Button property:
ABColor RGBColor
{
description = "ABColor property with RGB components";
value = QColor(123, 150, 10);
clickHandler = [](const QtnPropertyABColor* color) {
qDebug() << Q_FUNC_INFO << "Color has clicked: " << color;
};
delegate { rgbSubItems = true; }
}
from qtnproperty.
My idea - custom editor type and open signal, like this:
QColor QColorProperty
{
description = "Property to hold QColor value.";
value = Qt::blue;
delegate {
-
editor = QtnColorDelegateEditorCustom;* rgbSubItems = true; } slot propertyEditorDidClicked { // open custom editor }
}
What do you think @lexxmark? May I implement this?
Regards
P.
On Wed, Jan 20, 2016 at 9:48 AM, Krzysztof Kolasinski <
[email protected]> wrote:
I need to have ability to pick color from image in AB, but this require
special signal which will disable some of the features during the picking.—
Reply to this email directly or view it on GitHub
#6 (comment).
More:
(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)
from qtnproperty.
You can implement it by modifying ABColor property that I've created.
Then we see your implementation and decide if it general solution or not.
Now I don't see a big difference between your and my solutions.
Like Button property, ABProperty has a signal click.
Where do you plan to add propertyEditorDidClicked signal?
To QtnPropertyBase class?
If we decide to use new type of slot in *.pef files we have to change PEG generator.
from qtnproperty.
Hi - ABColor is good - I will work on this example. My idea was just a
quick thought - what you did implement is I think sufficient :)
Regards
Pawel
On Thu, Jan 21, 2016 at 8:07 AM, Alex Zhondin [email protected]
wrote:
You can implement it by modifying ABColor property that I've created.
Then we see your implementation and decide if it general solution or not.Now I don't see a big difference between your and my solutions.
Like Button property, ABProperty has a signal click.Where do you plan to add propertyEditorDidClicked signal?
To QtnPropertyBase class?
If we decide to use new type of slot in *.pef files we have to change PEG
generator.—
Reply to this email directly or view it on GitHub
#6 (comment).
More:
(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)
from qtnproperty.
@ppiecuch, @kmkolasinski we can adopt SliderBox delegates for color components: Red/Green/Blue.
What do you think?
from qtnproperty.
Correct - this is what I just started to implement in ABColor :) Have got
something yet?
Regards
Pawel
On Mon, Jan 25, 2016 at 8:31 AM, Alex Zhondin [email protected]
wrote:
@ppiecuch https://github.com/ppiecuch, @kmkolasinski
https://github.com/kmkolasinski we can adopt SliderBox delegates for
color components: Red/Green/Blue.
What do you think?—
Reply to this email directly or view it on GitHub
#6 (comment).
More:
(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)
from qtnproperty.
Hi @ppiecuch - I've just finished with SliderBox for any numeric property and modified Demo application to use them:
You can paste this code to ABColor's delegate constructor:
QtnPropertyDelegateInfo delegateInfo;
delegateInfo.name = "SliderBox";
delegateInfo.attributes["liveUpdate"] = true;
{
auto subProperty = qtnCreateRedProperty(0, &owner());
delegateInfo.attributes["fillColor"] = QColor::fromRgb(255, 100, 100);
subProperty->setDelegate(delegateInfo);
addSubProperty(subProperty);
}
{
auto subProperty = qtnCreateGreenProperty(0, &owner());
delegateInfo.attributes["fillColor"] = QColor::fromRgb(100, 255, 100);
subProperty->setDelegate(delegateInfo);
addSubProperty(subProperty);
}
{
auto subProperty = qtnCreateBlueProperty(0, &owner());
delegateInfo.attributes["fillColor"] = QColor::fromRgb(100, 100, 255);
subProperty->setDelegate(delegateInfo);
addSubProperty(subProperty);
}
from qtnproperty.
In my case it does not want to compile I have following error:
AwesomeBump/Sources/utils/QtnProperty/Demo/AB/PropertyDelegateABColor.cpp:53:68:
error: no match for call to '(QtnPropertyABColor) ()'
auto subProperty = qtnCreateBlueProperty(0, &owner());
I change the code a little bit since in the constructor parameter there is already owner object
QtnPropertyDelegateABColor::QtnPropertyDelegateABColor(QtnPropertyABColor& owner)
and my compilator is too stupid to see the difference between owner and owner() function few lines below. Or I do something wrong?
After change from
QtnPropertyDelegateABColor::QtnPropertyDelegateABColor(QtnPropertyABColor& owner)
to
QtnPropertyDelegateABColor::QtnPropertyDelegateABColor(QtnPropertyABColor& _owner)
: QtnPropertyDelegateQColor(_owner),
m_owner(_owner)
it compiles, but Demo program crashes with message:
ASSERT: "jt != createItem.createFunctions.end()" in file
AwesomeBump/Sources/utils/QtnProperty/PropertyWidget/Delegates/PropertyDelegateFactory.cpp,
line 51
Do you have an idea where is the problem?
from qtnproperty.
Another question, @lexxmark are you going to keep ABColor classes within Demo project? If not -- I will have to make a copy of those files to keep them inside my project.
from qtnproperty.
Another question, @lexxmark are you going to keep ABColor classes within Demo project? If not -- I will have to make a copy of those files to keep them inside my project.
Yes, ABColor is a reference implementation for you. Just copy it to AwesomeBump project and modify as you want.
If needed I will help you with this custom property and delegates there (directly in AwesomeBump project ).
from qtnproperty.
Or I do something wrong?
I think you are correct.
Do you have an idea where is the problem?
It seems you are already fixed the problem here.
I will handle this case (cannot find appropriate delegate) in more safe and verbose way.
from qtnproperty.
No I didn't fix this problem, here I have problem in ABColor in Demo project. There (another issue) I was talking about AB project in which for now I haven't used ABColor property yet.
from qtnproperty.
I've just pushed some modifications.
ASSERT in Demo was changed with diagnostic info in output and some stub delegate with red error in PropertyView.
Please check.
from qtnproperty.
Ok, I will check it in the evening. Thanks again.
from qtnproperty.
Ok, so the Demo is now working fine, but AB does not want to compile. It says:
In file included from ../AwesomeBump/Sources/properties/propertydelegateabfloatslider.cpp:1:0:
../AwesomeBump/Sources/properties/propertydelegateabfloatslider.h:35:33: error: 'QtnPropertyDelegateDrawContext' has not been declared
bool createSubItemValueImpl(QtnPropertyDelegateDrawContext& context, QtnPropertyDelegateSubItem& subItemValue) override
Where can I find: QtnPropertyDelegateDrawContext ?
from qtnproperty.
Sorry I renamed classes to shorter ones:
QtnPropertyDelegateDrawContext -> QtnDrawContext
QtnPropertyDelegateEventContext -> QtnEventContext
QtnPropertyDelegateSubItem -> QtnSubItem
from qtnproperty.
Ok, so you really change a lot ;) Are you going to do such big updates in near future?
from qtnproperty.
Ok, I update all source code of QtnPropery, because last time only some of the files were updated...
But not it does want to compile
AwesomeBump/Sources/utils/QtnProperty/PropertyWidget/Delegates/Utils/PropertyDelegateSliderBox.h:67: error: there are no arguments to 'owner' that depend on a template parameter, so a declaration of 'owner' must be available [-fpermissive]
ValueType valueInterval = owner().maxValue() - owner().minValue();
^
Do you know where is the problem?
from qtnproperty.
Are you going to do such big updates in near future?
Well I hope I've finished with huge modifications. So I guess no.
Do you know where is the problem?
It seems SsliderBox delegate is applied to property type which doesn't have maxValue/minValue functions. Please give the full error log.
from qtnproperty.
Ok, but not today :) I was trying to compile your project, so you should
also see similar problems, or my Qt does not see some dependencies...
from qtnproperty.
Replace owner() with this->owner() in subclass.
P.
from qtnproperty.
OK, will do it in a few hours (when reach my home computer).
from qtnproperty.
Change owner() to this->owner(). GCC and clang are more strict about
templates than ms cl.
P.
On Thu, Jan 28, 2016 at 8:22 PM, Krzysztof Kolasinski <
[email protected]> wrote:
Ok, I update all source code of QtnPropery, because last time only some of
the files were updated...
But not it does want to compileAwesomeBump/Sources/utils/QtnProperty/PropertyWidget/Delegates/Utils/PropertyDelegateSliderBox.h:67: error: there are no arguments to 'owner' that depend on a template parameter, so a declaration of 'owner' must be available [-fpermissive]
ValueType valueInterval = owner().maxValue() - owner().minValue();
^Do you know where is the problem?
—
Reply to this email directly or view it on GitHub
#6 (comment).
More:
(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)
from qtnproperty.
Change owner() to this->owner(). GCC and clang are more strict about
templates than ms cl.
It's done. Please check.
Also I've played with SliderBox delegate a bit. This is list of possible attributes
qtnGetAttribute(attributes, "fillColor", m_boxFillColor);
qtnGetAttribute(attributes, "liveUpdate", m_liveUpdate);
qtnGetAttribute(attributes, "drawBorder", m_drawBorder);
qtnGetAttribute(attributes, "updateByScroll", m_updateByScroll);
qtnGetAttribute(attributes, "animate", m_animate);
I added animations there to check if current delegate API is complete.
Try to expand RGBColor property in Demo and click on its color box.
from qtnproperty.
Hi, sorry for late answer. I check your last commit and now it works, however I cannot build AB. I have linker problems and I don't know where to add some include or path to fix it. Here is the example error I have:
../AwesomeBump/workdir/linux-g++-dgb-gl4/obj/QtnPropertyUnity.o: In function `QtnPropertyButton::invokeClick()':
../AwesomeBump/Sources/utils/QtnProperty/Core/GUI/PropertyButton.cpp:21: undefined reference to `QtnPropertyButton::click(QtnPropertyButton const*)'
Guy do you have the same linker problems what I do ?
If this will work I think I can start to work with AB finally.
from qtnproperty.
Hi @kmkolasinski,
I tried to build your last changes in AB and there is no issues there. I was able to successfully compile and link it.
from qtnproperty.
Hi, thanks for checking it for me, I will try to find where is the problem.
from qtnproperty.
Hi @kmkolasinski
I've tried to build AB project with my last changes see fork.
I could successfully build AB but not run (because of intel video chipset). So please check if it's OK.
from qtnproperty.
Hi, thanks. I will check it, but currently I'm quite busy so I will slow down with updates and all the staff.
I will try to check your fork today and give you a feedback. Thanks.
from qtnproperty.
Hmm, Yours fork is building perfectly fine.
So I maybe it would be nice if you could pull request your fork to mine, I would save some time for searching possible bug.
Thanks in advance.
from qtnproperty.
Related Issues (20)
- implement sub-attributes for property delegates
- remove QtScript module dependency HOT 5
- refactor QPen property delegate and add QBrush property and delegate
- Support Tab navigation HOT 8
- Doccumentation issue HOT 3
- LINK : fatal error LNK1181: cannot open input file 'release\QtnCoreUnity.obj' HOT 5
- ASSERT: "data.ptr->ref.isStatic()" in file kernel\qmetaobject.cpp, line 152 in debug mode HOT 4
- Improved QtnProperties HOT 1
- Does not support msvc2013? HOT 2
- Cannot find default delegate for property "" HOT 5
- Add virtual method to QtnPropertySet HOT 2
- Can you provide me the precompiled binary?
- when use QObjectPropertyWidget show object property, then drag splitter crash HOT 3
- How enter and display properties of double type in scientific notation HOT 2
- QtnPropertyQColorLineEditBttnHandler::onToolButtonClicked crash HOT 1
- Inplace editing must start by both Key_Return and Key_Enter HOT 5
- Inplace editing is possible only after updating visuals
- Use existing delegate for custom data type HOT 2
- Qt 5.14.2 Error while building/deploying project QtnProperty
- Qt 5.15.2 MinGW build error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtnproperty.