Questions tagged [qspinbox]

The QSpinBox class, part of the Qt framework, provides a spin box widget.

QSpinBox allows the user to choose a value by clicking the up/down buttons or pressing up/down on the keyboard to increase/decrease the value currently displayed.

147 questions
2
votes
1 answer

Disable validation in QSpinBox

Hence I have a QSpinBox, and want to unset validation for writing not only int values, but also string in it. Please help me to fix this. I have tried this, but it does not work: class Spinbox:public QSpinBox { public: Spinbox(QWidget*…
Eduard Rostomyan
  • 7,050
  • 2
  • 37
  • 76
2
votes
1 answer

Make QSpinBox value change to min value when right-mouse-click Pyside + Python

How can I make the spinner that is right-clicked have it's value changed to the minimum value of that particular QSpinBox? This should work for each spinner in this UI. So the top spinner's value would change to 1 when right-clicked and the bottom…
JokerMartini
  • 5,674
  • 9
  • 83
  • 193
2
votes
1 answer

QDoubleSpinBox prefix position

I'm making a financial program with qt. I just added a QDoubleSpinBox to my dialog, in this spin box the user must insert the price of some products, so I set the prefix to my currency symbol. Now I wanted to ask if there's a way to put the prefix…
user1709665
  • 142
  • 7
2
votes
1 answer

Qt inherit QSpinBox and QPushButton

I would like create my CustomQSpinBox . This CustomQSpinBox must inherit of QPushButton and QSpinBox but when I compile this code : #include #include class CustomQSpinBox : public QSpinBox, public QPushButton { …
artoon
  • 729
  • 2
  • 14
  • 41
2
votes
5 answers

Validation in QSpinBox

I have QSpinBox which should take only odd numbers, so I've set initial value to 3 and step to 2. QSpinBox* spinBox = new QSpinBox; spinBox->setValue(3); spinBox->setSingleStep(2); When I'm using spin box arrows to modify value everything is ok.…
krzych
  • 2,126
  • 7
  • 31
  • 50
2
votes
2 answers

Setting border-radius for QSpinBox/QComboBox has unexpected side effect on up/down controls

I'm using PyQt4 to make an interface with a number of QLineEdit and QSpinBox inputs. I want to give both a nice rounded appearance, but this gives a problem in the case of the spinboxes. The relevant bits of the stylesheet looks like this: QDialog…
Junuxx
  • 14,011
  • 5
  • 41
  • 71
1
vote
1 answer

PyQt4 : Sync between QSpinbox and QSlider

I make a relation between QSpinbox and QSlider. QSpinbox has a range -10.0 to 10.0, and QSlider has a range -100 to 100. So, the value of QSlider divided by 10 is connect to QSpinbox, and vice versa. I use "valueChanged()" SIGNAL to each other. And…
Hyun-geun Kim
  • 919
  • 3
  • 22
  • 37
1
vote
2 answers

How to capture signal from Q(double)spinbox

I'm writing a mini application by means of Qt 4.7. And I have a reoccurring problem with some QSpinBoxes and QDoubleSpinBoxes. I set the editingFinished() signal and when I change the value in any of these fields they send two signals: when the…
Neru
  • 679
  • 6
  • 19
1
vote
1 answer

QSpinBox - both buttons incrementing value when using custom stylesheet

I need to style QSpinBox like this: But when I did it with stylesheet, both down-button and up-button were incrementing value, where down-button should have decremented it. Stylesheet: QSpinBox { border: 1px solid gray; border-radius: 3px; …
vladik
  • 33
  • 5
1
vote
1 answer

QTimeEdit locks hour spining with range less than one hour with keyboardTracking deactivated

I have a QTimeEdit in Python with a predefined range less than one hour, let's say from 08:45:00 to 09:15:00. I read about the problematic of entering a new value which gets out these limits when keying…
dmjf08
  • 143
  • 7
1
vote
2 answers

Make a QSpinBox which requires a double-click to edit

I would like to make a spin-box which only is editable after double-clicking in the digit display area. My attempt below disables the focus in all cases except when the increment/decrement buttons are pressed. I want increment/decrement to perform…
Techniquab
  • 843
  • 7
  • 22
1
vote
1 answer

How do you display greek characters on a PyQt4 GUI?

I am a bit of a noob, so forgive me if this is a simple question. I am writing a program to perform scientific simulations, some of the parameters for which are measured in micrometres. The suffix for such parameters is µm where the greek symbol mu…
Ben
  • 5,525
  • 8
  • 42
  • 66
1
vote
1 answer

How to call changeValue of QSpinBox only when user changed value

This is my QSpinBox slot method: void MainWindow::on_sbObjectSize_valueChanged(int arg1) { /*do something*/; } I need to distinguish when this value was changed by user (by typing value or click on arrows) and when it was changed from the code…
rainbow
  • 1,161
  • 3
  • 14
  • 29
1
vote
1 answer

How to display QSpinBox in QTableView when it is not in the edit mode

I was able to add the QSpinBox widget in a QTreeView using QStyledItemDelegate. QWidget *NoteDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { if (index.column() == 2) { …
Jude
  • 11
  • 1
1
vote
2 answers

QSpinbox editingFInished signal on up/down arrow press

I went through a lot of posts regarding QSpinBox signals editingFinished and valueChanged, but not able solve my problem, ie, I want editingFinished signal to be emitted, when user enters any value and presses "Enter".[DONE] The user can change…
Sayan Bera
  • 135
  • 2
  • 16