Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-08 Thread Tobias Doerffel
Hi, try using m_outerColor.isValid() instead. It should return false if m_outerColor was default-constructed but not initialized explicitely. Thanks Toby -- Put Bad Developers to Shame Dominate Development with Jenkins

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-08 Thread Johannes Lorenz
I just wanted to de-pointerize "m_outerColor", but I hit this code: if( m_outerColor ) { QRadialGradient gradient( centerPoint(), outerRadius() ); gradient.setColorAt(0.4, _p->pen().brush().color() );

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-06 Thread Vesa
On 04/06/2014 11:51 PM, Tobias Doerffel wrote: > I think messing with pointers always should be avoided as often as > possible. In this specific case, it IMHO adds no value. Using pointers > here increases code complexity and makes things more crash-prone. > QColor is a very light-weight class (bas

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-06 Thread Tobias Doerffel
I think messing with pointers always should be avoided as often as possible. In this specific case, it IMHO adds no value. Using pointers here increases code complexity and makes things more crash-prone. QColor is a very light-weight class (basically it's just an enumeration and a union of 5 16-bit

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-06 Thread Vesa
On 04/06/2014 11:12 PM, Tobias Doerffel wrote: > 2014-04-05 13:44 GMT+02:00 Vesa : >>> QColor lineColor() const; >>> void setlineColor( const QColor & _c ); >>> ... >>> QColor * m_lineColor; //!< unused yet >>> ... >>> Q_PROPERTY(QColor lineColor READ lineColor WRITE setline

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-06 Thread Tobias Doerffel
2014-04-05 13:44 GMT+02:00 Vesa : >> QColor lineColor() const; >> void setlineColor( const QColor & _c ); >> ... >> QColor * m_lineColor; //!< unused yet >> ... >> Q_PROPERTY(QColor lineColor READ lineColor WRITE setlineColor) >> >> So this is the same as for outerColor. Is

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-05 Thread Vesa
Also, about the knob types: If you register the knobtype enum with Q_ENUMS() then the knobtype enum can be used in the qproperty. Then the enum values can be used as strings in the property set function. Might be easier to use that way in QtDesigner or whatever... http://qt-project.org/doc/qt-4.8

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-05 Thread Vesa
On 04/05/2014 02:33 PM, Johannes Lorenz wrote: >> Set the default value at 1, the "standard knob", which is the most >> commonly used in LMMS - or "knobBright_26" if you use the enum names. > Thanks. The question is also valid for other widgets: > > (a) lcd_spinbox (number of digits) > (b) led_ch

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-05 Thread Johannes Lorenz
> Set the default value at 1, the "standard knob", which is the most > commonly used in LMMS - or "knobBright_26" if you use the enum names. Thanks. The question is also valid for other widgets: (a) lcd_spinbox (number of digits) (b) led_checkbox (text right to the checkbox) Would you also sug

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-05 Thread Vesa
On 04/05/2014 12:44 PM, Johannes Lorenz wrote: > Hey, > > currently, I'm about to implement this for the knob class. One question: > should the knob number have a default value, or should we enforce the > programmer to always choose one in qt designer? I think the last one would be > more relaxi

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-04-05 Thread Johannes Lorenz
Hey, currently, I'm about to implement this for the knob class. One question: should the knob number have a default value, or should we enforce the programmer to always choose one in qt designer? I think the last one would be more relaxing for programmers... If we do not use default values, sh

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-20 Thread Vesa
On 03/20/2014 10:33 AM, Jonathan Aquilina wrote: > You mention finding the code. If you are on linux you could probably > grep what you want to find in a particular code base if you know what > you are looking for. > Eh, no need for that really. It's easy to just go through all the GUI code, it's

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-20 Thread Jonathan Aquilina
You mention finding the code. If you are on linux you could probably grep what you want to find in a particular code base if you know what you are looking for. On Thu, Mar 20, 2014 at 9:31 AM, Vesa wrote: > On 03/20/2014 10:17 AM, Jonathan Aquilina wrote: > > I couldnt agree more with you on th

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-20 Thread Vesa
On 03/20/2014 10:17 AM, Jonathan Aquilina wrote: > I couldnt agree more with you on the stable API for theming. My > question and challenge for you is this is there alot of work to go > into migrating every aspect of a theme to css? > Mostly it's just finding every paintevent in the code, adding q

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-20 Thread Jonathan Aquilina
I couldnt agree more with you on the stable API for theming. My question and challenge for you is this is there alot of work to go into migrating every aspect of a theme to css? On Thu, Mar 20, 2014 at 9:16 AM, Vesa wrote: > On 03/20/2014 10:03 AM, Jonathan Aquilina wrote: > > Have any of these

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-20 Thread Vesa
On 03/20/2014 10:03 AM, Jonathan Aquilina wrote: > Have any of these that have been mentioned been filed as enhancement > requests in the tracker? Also are these set as milestones for 1.1? > No these aren't filed in the tracker yet but I might put them there at some point, maybe. These are definit

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-20 Thread Jonathan Aquilina
Have any of these that have been mentioned been filed as enhancement requests in the tracker? Also are these set as milestones for 1.1? On Wed, Mar 19, 2014 at 6:07 PM, Vesa wrote: > On 03/19/2014 06:37 PM, Johannes Lorenz wrote: > > Hi again, > > > > so you'd suggest to simply add > > > >

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Vesa
On 03/19/2014 08:50 PM, Johannes Lorenz wrote: >> We also need to ensure that these changes don't break any existing UI >> elements. So if we make changes to how widgets are initialized, then all >> the parts of the UI using that widget need to be adapted to those changes. > Yes, though the number

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Lukas W.
Tres, to be honest, I don't understand what you are suggesting here. Qt Designer has nothing to with any bundled libraries or the OS you're building on. Qt is cross-platform, it supports Mac natively. How is there a need for MacPorts? Also, this is off topic, we should continue discussing your ide

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Tres Finocchiaro
> > If it is just about library dependencies, CMake should be able to do the > same. > Asking more questions here... doesn't QT Designer come bundled with the proper libraries for this? The reason I ask is because the MacPorts approach looks like a -- pardon my language here -- a bloated mess. We

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Johannes Lorenz
> I know we spoke briefly about qmake and I don't understand enough to speak > on it's behalf, but from what I've read QT Designer can tremendously help > with creating OSX builds. You can use both Qt Designer, Qt Creator and qmake independently. So we can use Qt Designer without switching to qmak

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Johannes Lorenz
> We also need to ensure that these changes don't break any existing UI > elements. So if we make changes to how widgets are initialized, then all > the parts of the UI using that widget need to be adapted to those changes. Yes, though the number of changes will be very small (existing code will ju

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Vesa
On 03/19/2014 07:51 PM, Tres Finocchiaro wrote: > Would QT Designer modeling potentially move GUI development into an IDE? Well, optionally at least. I guess it's up to each developer which tools they want to use. -- Lear

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Tres Finocchiaro
Would QT Designer modeling potentially move GUI development into an IDE? I know we spoke briefly about qmake and I don't understand enough to speak on it's behalf, but from what I've read QT Designer can tremendously help with creating OSX builds. Again, this is speculative on my part, but from w

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Vesa
On 03/19/2014 06:37 PM, Johannes Lorenz wrote: > Hi again, > > so you'd suggest to simply add > > overloaded ctors with less parameters + > setter functions + > properties using these setters? > > If yes, I could do that. > > We also need to ensure that these changes don't break any ex

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Tobias Doerffel
Yes, that would be the most straight forward design. Thanks in advance! Toby -- Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications.

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Johannes Lorenz
Hi again, so you'd suggest to simply add overloaded ctors with less parameters + setter functions + properties using these setters? If yes, I could do that. - Johannes > Hi, > > yes properties are better than value templates as the latter one lead > to massive bloat, at least if

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Tobias Doerffel
Hi, yes properties are better than value templates as the latter one lead to massive bloat, at least if you do not move the existing class to a non-templated parent class. I guess however that using template-classes is rather inconvenient, especially in Qt Designer even though I admit that paramet

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-19 Thread Johannes Lorenz
> It doesn't have to. Knob pixmap initialization etc. could be moved > into a setter function for the knob type property. As long as the knob > type is not set, the background is not drawn. While I understand what you mean, I don't think it's good. A good example is probably the lcd widget: There

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-17 Thread Tobias Doerffel
2014-03-16 15:06 GMT+01:00 Johannes Lorenz : > not sure about what you mean. Let's take the knob type, which is passed to the > knob's ctor. Of course, we can "wrap" a Q_PROPERTY "around" it. Still, the > knob type must be known in the constructor. It doesn't have to. Knob pixmap initialization et

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-03-16 Thread Johannes Lorenz
> However I disagree about the specializations. Properties like "number > of digits" etc. should be made real properties (Q_PROPERTY) so they > eventually can be changed inside the Qt Designer. Hi, not sure about what you mean. Let's take the knob type, which is passed to the knob's ctor. Of cou

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-02-09 Thread Tobias Doerffel
Yes, it'd be a good thing to have all of our widgets available in Qt Designer so we can replace lots of code with code that is generated from the UI files. Do you have ambitions for implementing this, you're welcome to do so :-) However I disagree about the specializations. Properties like "number

Re: [LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2014-02-09 Thread Johannes Lorenz
This topic is half a year old, but can someone please give comments? Do you think it is useful? Imo it would be only a few lines of code and would help us to build new UI widget way faster (and cleaner). > Hey, > > We have many widgets that don't just take a parent. Thus, they can not be > use

[LMMS-devel] Proposal: Fitting UI elements to be used in Qt Designer

2013-09-28 Thread Johannes Lorenz
Hey, We have many widgets that don't just take a parent. Thus, they can not be used in Qt Designer (AFAIK). I propose the following changes to remove additional parameters from constructors: * The knob class has an int describing its style. Since there are only 4 types (and mostly only one typ