persisting QDoubeSpinBox

Please use this forum to post feedback and suggestions related to QCAD.

Moderator: andrew

Post Reply
smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

persisting QDoubeSpinBox

Post by smf » Sun Dec 14, 2014 9:53 pm

Hi,

it would be nice if QDoubleSpinBox could be part of a persistent widget like QSpinBox is. As far as I can see, therefore three additions would be neccessary in scripts/WidgetFactory.js:

Code: Select all

  //lines 283..265:
  if (isOfType(c, QSpinBox) || isOfType(c, QDoubleSpinBox)) { //previously: if (isOfType(c, QSpinBox)) {
    value = c.value;
  }
and

Code: Select all

  //lines 456..459:
  if (!isOfType(c, QSpinBox) && !isOfType(c, QDoubleSpinBox) //previously: if (!isOfType(c, QSpinBox) &&
    !isOfType(c, QComboBox) &&
    !isOfType(c, QPlainTextEdit) &&
    !isOfType(c, RMathLineEdit)) {
and

Code: Select all

  //lines 740..756 duplicated and slightly adopted, starting with
  if (isOfType(c, QDoubleSpinBox)) { //directly after if (isOfType(c, QSpinBox)) {
Best regards,
Stefan

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: persisting QDoubeSpinBox

Post by andrew » Mon Dec 15, 2014 2:22 pm

Thanks. I've implemented these changes in:
https://github.com/qcad/qcad/commit/c9d ... 186857d864

On a side note: QCAD never uses QDoubleSpinBox but RMathLineEdit instead. RMathLineEdit allows the user to enter mathematical expressions such as "17.5/2" or "sin(32.5)*37".

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: persisting QDoubeSpinBox

Post by smf » Mon Dec 15, 2014 2:59 pm

Thank you for implementing and especially for hinting about RMathLineEdit. :D

Of course Qt-designer, which I'm designing my dialogs with, does not know anything about RMathLineEdit. But I will try to replace them after design is complete. :)

Post Reply

Return to “QCAD Suggestions and Feedback”