Hi all,
I am also following this book and I have a question regarding this exact same example.
I was trying to play with it making it display the prefix "0x" by adding the line
setPrefix("0x")
setPrefix("0x")
To copy to clipboard, switch view to plain text mode
to the HexSpinbox default constructor as so:
HexSpinBox
::HexSpinBox (QWidget *parent
){
setPrefix("0x");
setRange(0,255);
}
HexSpinBox::HexSpinBox (QWidget *parent)
: QSpinBox(parent)
{
setPrefix("0x");
setRange(0,255);
validator = new QRegExpValidator(QRegExp("[0-9A-Fa-f]{1,8}"), this);
}
To copy to clipboard, switch view to plain text mode
Unfortunately this compiles but immediately gives me a seg fault:
The inferior stopped because it received a signal from the Operating System.
Signal name : SIGSEGV
Signal meaning : Segmentation fault
Does this have anything to do with the validator getting the prefix value? Is it fixable?
Thanks in advance,
Manu
Bookmarks