Code Monkey home page Code Monkey logo

Comments (38)

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Would it be possible to have click action for ColorPoperty? Same as in Button case.

from qtnproperty.

ppiecuch avatar ppiecuch commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

image

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.

ppiecuch avatar ppiecuch commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

ppiecuch avatar ppiecuch commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

@ppiecuch, @kmkolasinski we can adopt SliderBox delegates for color components: Red/Green/Blue.
What do you think?

from qtnproperty.

ppiecuch avatar ppiecuch commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

Hi @ppiecuch - I've just finished with SliderBox for any numeric property and modified Demo application to use them:
image

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Ok, I will check it in the evening. Thanks again.

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

Sorry I renamed classes to shorter ones:

QtnPropertyDelegateDrawContext -> QtnDrawContext
QtnPropertyDelegateEventContext -> QtnEventContext
QtnPropertyDelegateSubItem -> QtnSubItem

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Ok, so you really change a lot ;) Are you going to do such big updates in near future?

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

ppiecuch avatar ppiecuch commented on July 30, 2024

Replace owner() with this->owner() in subclass.

P.

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

OK, will do it in a few hours (when reach my home computer).

from qtnproperty.

ppiecuch avatar ppiecuch commented on July 30, 2024

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 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?


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.

lexxmark avatar lexxmark commented on July 30, 2024

@ppiecuch and @kmkolasinski

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Hi, thanks for checking it for me, I will try to find where is the problem.

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.