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_checkbox (text right to the checkbox) > > Would you also suggest default values here? I.e. probably 1 (for a) and "" > (for b)?
Sure. > > In general, are default values better, or should we have none and force the > user to specify them (using qFatal())? Default values sounds good to me. > One more question: In case we use default values (like a default knob type), > should we use Q_PROPERTY's RESET attribute and call the reset function from > the ctor, or just initialize them via ctor initializer lists? The first seems > cleaner to me. A RESET attribute just seems like more code, that probably wouldn't be used anywhere else, though... IMO better to just set the defaults in the constructor. > >> Note also that I was going to put some GUI colour things in qproperties, >> as part of the "making things stylable" thing. The knob class needs >> "lineColor" and "arcColor" qproperties, for defining the line/arc colors >> for the "regular" knobs. Since you're editing the class, you could add >> these while you're at it... they don't need to be effective yet, I can >> add the GUI code to utilize them later. > Ok, I have added code like this now: > > 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 this what you need? Yeah. That works. ------------------------------------------------------------------------------ _______________________________________________ LMMS-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lmms-devel
