Results 1 to 4 of 4

Thread: custom button-panel widget; subclass advice?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Location
    Rakovnik, Czech Republic
    Posts
    175
    Thanks
    43
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default custom button-panel widget; subclass advice?

    I need to design a custom panel that will pop-up next to some of my QPushButtons when they are mouseOver'ed. Initially, the panels will contain only 2 types of widgets: varying numbers of QPushButtons and a QSlider, although I'd like to keep open the option to include additional widgets later.

    So I figure I'll create a new BuPanel subclass... but looking over chapter 5 in "C++ GUI Programming with Qt4" I'm not sure what approach I should take. Their HexSpinBox example is a simple sub-class from QSpinBox, but in my case I'll have at least 2 primary widgets... would you recommend creating a new class derived from both QPushButton and QSlider? (or just QPushButton, and include a "class QSlider;" declaration in the header?) And will I have to include a parameter in the constructor which sets the number of buttons in a given panel?

    edit: here's an example-

    http://www.beg.utexas.edu/coastal/wrl/del/panel.png

    mousing over "shorelines" brings up the panel with buttons & slider (red triangle) to the right. User can either click buttons or drag the slider to change selection.
    Last edited by vonCZ; 11th November 2007 at 12:38.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.