Comments (20)
Perfect I would like to have something like that :) How to use it?
from qtnproperty.
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.
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.
Wow, its really cool! I will wait for mouse control. BTW: I usually work with AB late at night after work.
from qtnproperty.
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.
@kmkolasinski and @ppiecuch - I'm finished with SliderBox delegate.
Please test it and if everything is OK - close the issue.
from qtnproperty.
Hi, thanks I'm going to check it right now.
from qtnproperty.
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.
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.
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.
@kmkolasinski - I've stabilize QtnPropertyDelegateSlideBox code.
Please try now and in case any problems push your version to your fork of QtnProperty
from qtnproperty.
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.
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.
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.
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.
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.
Now you can find QtnPropertyDelegateSlideBox class in PropertyDelegate.h file.
There are some new Event types in event function:
- QtnSubItemEvent::Activated - mouse enters slidebox rect
- QtnSubItemEvent::PressMouse - user pressed mouse button
- QtnSubItemEvent::ReleaseMouse - user released mouse button -> end edit
from qtnproperty.
Great I will pull the code and try it later ! Thanks!
from qtnproperty.
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.
Ok, thanks again.
from qtnproperty.
OMG, this new one is perfect :) Thanks!
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.