Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello :) #5

Closed
ppiecuch opened this issue Jan 15, 2016 · 11 comments
Closed

Hello :) #5

ppiecuch opened this issue Jan 15, 2016 · 11 comments

Comments

@ppiecuch
Copy link
Contributor

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

@lexxmark
Copy link
Collaborator

Hi Pawel,

I'm planning to complete new features for property delegates at weekends (we have three days off so I hope it's enough time).

For now you could implement delegate for "Button" property in old style - just show button caption and show button as inplace editor on mouse click activation.
Later we will show "live" button there, so user won't have to activate property to push button.

Each property has two cells on property view:

  1. Name cell - label with name of property
  2. Value cell - delegate shows property content there

How do you think "Button" property should be shown on property view?
"Button" property looks like not regular property - it doesn't have any associated value.
Do you want to merge these two cells for "Button" property into the single one? Just show large button which occupies whole property row on view? Or like other regular properties: button with caption next to property name label?

Also we should decide how to merge your modifications in main repository. Some code should go to main repository and some to AwesomeBump as customizations of QtnProperty for this particular project.

Regards,
Alex

@ppiecuch
Copy link
Contributor Author

Thanks - I think I will implement that way for now.

In my opinion button should look like this - spanning across two columns.
Probably it make no sense to keep label for button.
[image: Inline image 1]
There is no much changes in my fork - mostly related to static
building/including library. There are also some OS X ui changes -
displaying smaller fonts.

Regards
Pawel

On Fri, Jan 15, 2016 at 3:34 PM, Alex Zhondin notifications@github.com
wrote:

Hi Pawel,

I'm planning to complete new features for property delegates at weekends
(we have three days off so I hope it's enough time).

For now you could implement delegate for "Button" property in old style -
just show button caption and show button as inplace editor on mouse click
activation.
Later we will show "live" button there, so user won't have to activate
property to push button.

Each property has two cells on property view:

  1. Name cell - label with name of property
  2. Value cell - delegate shows property content there

How do you think "Button" property should be shown on property view?
"Button" property looks like not regular property - it doesn't have any
associated value.
Do you want to merge these two cells for "Button" property into the single
one? Just show large button which occupies whole property row on view? Or
like other regular properties: button with caption next to property name
label?

Also we should decide how to merge your modifications in main repository.
Some code should go to main repository and some to AwesomeBump as
customizations of QtnProperty for this particular project.

Regards,
Alex


Reply to this email directly or view it on GitHub
#5 (comment).

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@lexxmark
Copy link
Collaborator

Hi Pawel,

More I think about improved delegates - more it seems they are very similar to View/Controller classes from my another project qt-items. There are a lot of different kinds of Views, including buttons, links, texts, progress bars etc. And it's easily customizable.

A brief description of this project you can see in the article. It's auto-translation from russian to english. The only problem is a lot of short source files, so build time is not perfect.

Do you know if it's possible to have unity build for Qt projects? I expect some problems with MOC compiler, but may be i'm wrong. Also it would be useful for QtnProperty project itself.

So now I'm considering three possible ways to improve delegates (to make them interactive like little embedded widgets):

  1. Implement in PropertyView subset of qt-items functionality - just duplicate code.
  2. Implement PropertyView on the qt-items basis and reuse it's code.
  3. Try to implement delegates using real Qt widgets - embed them in PropertyView and track it's position and visibility.

What do you think?

Regards,
Alex

@ppiecuch
Copy link
Contributor Author

Hello - yes, I know that project qt-items - it is quite impressive. I am
not sure if properties require such advanced ui elements. I rather think
about improving keyboard navigation, e.g.: using key arrow up/down for
changing values etc.

I am using that unbuild concept quite frequently - seems to be fine for qt
too. I made some changes in my fork: there is a Unity.cpp file and
QtnProperty.pri. Indeed it is compile faster (but it is quite fast anyway
on my Mac).

Regards
Pawel

On Sat, Jan 16, 2016 at 10:18 AM, Alex Zhondin notifications@github.com
wrote:

Hi Pawel,

More I think about improved delegates - more it seems they are very
similar to View
https://github.com/lexxmark/qt-items/blob/master/src/core/View.h#L65/
Controller
https://github.com/lexxmark/qt-items/blob/master/src/core/ControllerMouse.h#L55
classes from my another project qt-items
https://github.com/lexxmark/qt-items. There are a lot of different
kinds of Views, including buttons, links, texts, progress bars etc. And
it's easily customizable.

A brief description of this project you can see in the article
https://translate.google.com/translate?sl=ru&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F255573%2F&edit-text=&act=url.
It's auto-translation from russian to english. The only problem is a lot of
short source files, so build time is not perfect.

Do you know if it's possible to have unity build
http://buffered.io/posts/the-magic-of-unity-builds/ for Qt projects? I
expect some problems with MOC compiler, but may be i'm wrong. Also it would
be useful for QtnProperty project itself.

So now I'm considering three possible ways to improve delegates (to make
them interactive like little embedded widgets):

  1. Implement in PropertyView subset of qt-items functionality - just
    duplicate code.
  2. Implement PropertyView on the qt-items basis and reuse it's code.
  3. Try to implement delegates using real Qt widgets - embed them in
    PropertyView and track it's position and visibility.

What do you think?

Regards,
Alex


Reply to this email directly or view it on GitHub
#5 (comment).

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@lexxmark
Copy link
Collaborator

I've merged your modifications. There is only missing PropertyQAction.cpp and PropertyDelegateQAction.cpp files, so I commented out these includes in unity files.
If this merge is OK I will start to improve delegates then.

Did you tried to make unity files for generated moc_XXX.cpp files? Is it possible?

Also I tried to build AwesomeBump on windows (now I don't have any linux pc).
Finally it's successfully built but it crashed with access violation (access by null pointer).
Any thoughts?

@lexxmark
Copy link
Collaborator

Hi @ppiecuch and @kmkolasinski

I've made some changes in QtnPrroperty project to support general customizations.
Now any property and property set can fill it's row with arbitrary content.
It took a few days to implement and now it's usable (almost all) so you can use it but it still draft.
I've added Button property and customization for QColor property (see pic below).

image

This is code for new features:

    Button ButtonProperty
    {
        clickHandler = [](const QtnPropertyButton* bttn) {
            qDebug() << Q_FUNC_INFO << "Button has clicked: " << bttn;
        };

        delegate { title = "Click me"; }
    }

    QColor RGBColor
    {
        description = "QColor property with RGB components";
        value = QColor(123, 150, 10);
        delegate { rgbSubItems = true; }
    }

@ppiecuch it seems we are doing the same job. I think we should rethink the way we interact.

@ppiecuch and @kmkolasinski let's create separate issues for every little independent task for QtnProperties. Thus we would not mix different requests in one thread - otherwise it's hard to track all requests. When particular request will be complete we just close the issue and continue to discuss and keep tracking the others.

Now I'm opening new issues, so let's go there and continue our collaboration.
Please open issues if I forget some requests.

Regards,
Alex

@kmkolasinski
Copy link
Contributor

Hi, nice job! I have a question: How can I access the clickHandler from other class?

@lexxmark
Copy link
Collaborator

In C++ code you have two options:

  1. call
ButtonProperty.setClickHandler([](const QtnPropertyButton*){
           // you code here
}); 

and pass function there

  1. connect to signal
QObject::connect(&ButtonProperty, &QtnPropertyButton::click, &receiver, &Receiver::SlotFunc);

See PropertyButton.h

@kmkolasinski
Copy link
Contributor

Great! I didn't know that there is a click signal, thanks.

@ppiecuch
Copy link
Contributor Author

No problem - I will merge your changes. One think - would it be possible to
have button rendered as link? In my opinion, full-cell buttons somehow
overwhelming the view, especially if there are more buttons shown.

Regards
P.

On Tue, Jan 19, 2016 at 9:54 AM, Alex Zhondin notifications@github.com
wrote:

In C++ code you have two options:

  1. call

ButtonProperty.setClickHandler([](const QtnPropertyButton*){
// you code here
});

and pass function there

  1. connect to signal

QObject::connect(&ButtonProperty, &QtnPropertyButton::click, &receiver, &Receiver::SlotFunc);

See PropertyButton.h
https://github.com/lexxmark/QtnProperty/blob/master/Core/GUI/PropertyButton.h#L41


Reply to this email directly or view it on GitHub
#5 (comment).

More:

(http://komsoft.ath.cx/ http://komsoft.ath.cx/spider.html)
(http://pawelp.ath.cx/ http://komsoft.ath.cx/spider.html)

@lexxmark
Copy link
Collaborator

have button rendered as link?

Sure. Will do it.

You are welcome, it's quite late now.
See you tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants