Code Monkey home page Code Monkey logo

Comments (20)

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Perfect I would like to have something like that :) How to use it?

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

I've implemented 1st draft of "SliderBox" delegate for Float property. Please try it.
You can change property value by keyboard only now. I used "+" and "-" keys to increase and decrease values. Arrow up/down/left/right keys are reserved to navigation between properties. I think it's not a good idea to override them. Mouse manipulation is on the go.

image

fillColor attribute is optional - in case you want have different colors for different properties.

    Float FloatPropertySliderBox
    {
        description = "Property to hold float values in range [0, 10].";
        value = 1.f;
        minValue = 0;
        maxValue = 10.f;
        stepValue = 0.1f;

        delegate SliderBox
        {
            fillColor = QColor::fromRgb(170, 170, 255);
        }
    }

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Wow, its really cool! I will wait for mouse control. BTW: I usually work with AB late at night after work.

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

Mouse wheel and mouse single click is implemented.
Mouse drag is on the go.

BTW: I usually work with AB late at night after work.

I also worked at night but in USA timezone.

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

@kmkolasinski and @ppiecuch - I'm finished with SliderBox delegate.
Please test it and if everything is OK - close the issue.

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Hi, thanks I'm going to check it right now.

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Hi, for me is ok, however I will customize it a little bit to have it like I want ;)
I don't want to bother you anymore in this case, since every person
has his own vision how such button should look like.
I prefer that styl in AwesomeBump :) slider

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Hi, I'm trying to override the even implementation for mouse dragging

bool QtnPropertyDelegateFloatSlideBox::event(QtnPropertyDelegateEventContext& context, const QtnPropertyDelegateSubItem& item)
{
    switch (context.eventType())
    {

but I cannot force it to work with mouse dragging. It seems that all events are blocked if for example mouse is pressed. Do you know how to solve it?

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

Hi, does my QtnPropertyDelegateFloatSlideBox class work?
Do you want to customize delegate behavior? It should be pretty much similar as your version.
I only see difference in display (draw function).

It's strange that you have troubles with event function, may be you don't call trackState() during sub item creation

bool QtnPropertyDelegateFloatSlideBox::createSubItemValueImpl(QtnPropertyDelegateDrawContext&, QtnPropertyDelegateSubItem& subItemValue)
{
    subItemValue.trackState();
    subItemValue.drawHandler = qtnMemFn(this, &QtnPropertyDelegateFloatSlideBox::draw);
    subItemValue.eventHandler = qtnMemFn(this, &QtnPropertyDelegateFloatSlideBox::event);
    return true;
}

May be you can just push your code in you fork of QtnProperty, so I will be able pull it and debug.

Anyway I'm planning to generalize this delegate to be basis for all numeric properties Int, Uint, Double, Float. And polish it a bit.
After this you could just grab the code and modify it as you want.

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

@kmkolasinski - I've stabilize QtnPropertyDelegateSlideBox code.
Please try now and in case any problems push your version to your fork of QtnProperty

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Hi,
QtnPropertyDelegateFloatSlideBox yes it works :) I copied the QtnPropertyDelegateFloatSlideBox from your repository and created a new files in my project. I wanted to customize Slider behaviour and appearance. I did it yesterday in the evening but I did not want to push not polished code.
For me it seems that "mouse drag" event (mouse movement + mouse pressed) is not even tracked by event handler - only mouse movement is detected.
I will try this evening to add, lets hope it will work

subItemValue.trackState();

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Hi, my last anwser is about your question from yesterday :) Not this:

@kmkolasinski - I've stabilize QtnPropertyDelegateSlideBox code.
Please try now and in case any problems push your version to your fork of QtnProperty

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024
Please try now and in case any problems push your version to your fork of QtnProperty

I just add one line of QDebug() in the event function to see what kind of events are catched,

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

I copied the QtnPropertyDelegateFloatSlideBox from your repository and created a new files in my project.

Did you copied all other files? There are huge modifications in PropertyDelegate.h/cpp; PropeetyView.h/cpp and other files

I did not want to push not polished code

I mean you can "play" with my modifications in you fork of QtnProperty project. It's independent from AB project. So you can easily push and debug code there.

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024
Did you copied all other files? There are huge modifications in PropertyDelegate.h/cpp; PropeetyView.h/cpp and other files

No I just created separate class file copying the QtnPropertyDelegateSlideBox class which I then called QtnPropertyDelegateABFloatSlider class, the content is exactly the same as QtnPropertyDelegateSlideBox class but I started to play with event method, to see what I can change or not.

I mean you can "play" with my modifications in you fork of QtnProperty project. It's independent from AB project. So you can easily push and debug code there.

Yes you are right.

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

Now you can find QtnPropertyDelegateSlideBox class in PropertyDelegate.h file.
There are some new Event types in event function:

  1. QtnSubItemEvent::Activated - mouse enters slidebox rect
  2. QtnSubItemEvent::PressMouse - user pressed mouse button
  3. QtnSubItemEvent::ReleaseMouse - user released mouse button -> end edit

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Great I will pull the code and try it later ! Thanks!

from qtnproperty.

lexxmark avatar lexxmark commented on July 30, 2024

OK I'm finished for now.

Just play with new code in QtnProperty and push your modifications, so I will be able to help you.

Bye

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

Ok, thanks again.

from qtnproperty.

kmkolasinski avatar kmkolasinski commented on July 30, 2024

OMG, this new one is perfect :) Thanks!

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.