Results 1 to 7 of 7

Thread: QT Creator Spin Box for hex values

  1. #1
    Join Date
    Apr 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QT Creator Spin Box for hex values

    I am new to C++ and QT. I am using QT Creator 1.0.0 to create a GUI. I have a hex value I need to lookup and display to the user and allow the user to change that value.

    Basically, I am looking for the Microsoft Visual Studio NumericUpDown Hexadecimal properties equivelant in QT.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    518
    Thanks
    13
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator Spin Box for hex values

    Hi, you can subclass QSpinBox and show your hex value with it.

    Ginsengelf

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QT Creator Spin Box for hex values

    J-P Nurmi

  4. #4
    Join Date
    Apr 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT Creator Spin Box for hex values

    Thank you for your reply.

    I do not see this property in the QT Creator Property table. Can it be set from QT Creator. As I mentioned, I am new to C++ and QT, so QT Creator is the simplest and fastest solution for me.

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QT Creator Spin Box for hex values

    Don't expect to find any simple property in Qt Creator for this. Ginsengelf suggested that you subclass QSpinBox and reimplement textFromValue() and valueFromText() to show hexadecimal values. I pointed out that such class already exists in Qxt - an extension library for Qt (it is not part of Qt, but a separate community driven amateur project to provide most often requested features that are missing from Qt).
    J-P Nurmi

  6. #6
    Join Date
    Jul 2006
    Location
    Atlanta, GA
    Posts
    86
    Thanks
    26
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT Creator Spin Box for hex values

    There is an example of a Hex Spinbox in the C++ GUI Programming with Qt 4 book. Google has these pages here.
    fnmblot
    --------------------------------------
    Gee Ricky, I'm sorry your mom blew up.

  7. #7
    Join Date
    Apr 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT Creator Spin Box for hex values

    Thanks for the information. I am new to C++ and OOP programming in general, so I am somewhat reliant on Qt Creator.

    Is there a way to "promote" a spinbox on the toolbar in Qt Creator or to add a new hex spinbox widget to the toolbar in Qt Creator?

Similar Threads

  1. QComboBox values?
    By dbrmik in forum Newbie
    Replies: 8
    Last Post: 9th January 2009, 08:32
  2. How to change the values of the pixels in an Qimage?
    By kid17 in forum Qt Programming
    Replies: 8
    Last Post: 23rd November 2008, 20:52
  3. Replies: 8
    Last Post: 25th February 2008, 17:00
  4. Qtopia-4.2 Restoring the Saved Values for QComboBoxes
    By arunvv in forum Qt Programming
    Replies: 10
    Last Post: 7th May 2007, 19:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.