1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
9 | contributed Qt widgets |
11 \----------------------------------------------------------------------/
13 File: QY2ComboTabWidget.h
15 Author: Stefan Hundhammer <sh@suse.de>
17 This is a pure Qt widget - it can be used independently of YaST2.
22 #ifndef QY2ComboTabWidget_h
23 #define QY2ComboTabWidget_h
35 * This widget is very much like a QTabWidget, but it uses a combo box above
36 * the tab pages rather than a ( scrolled ) one-line row of tabs.
38 class QY2ComboTabWidget : public QWidget
45 * Constructor. 'combo_box_label' is the user-visible label of the combo
46 * box that is used to switch between the different tab pages.
48 QY2ComboTabWidget( const QString & combo_box_label,
50 const char * name = 0 );
55 virtual ~QY2ComboTabWidget();
58 * Add a page. 'page_label' will be the user-visible combo box entry for
61 void addPage( const QString & page_label, QWidget * page );
67 * Emitted when the current page changes.
68 * NOT emitted initially for the very first page that is shown.
70 void currentChanged( QWidget * newCurrentPage );
76 * Show a page. Updates the combo box contents accordingly.
77 * This is an expensive operation: All combo box items are searched for the
78 * item that corresponds to this page.
80 void showPage( QWidget * page );
87 * Show a page identified by its index. Does NOT update the combo box
90 void showPage( int index );
95 QComboBox * combo_box;
97 QStackedWidget * widget_stack;
98 QHash<int, QWidget *> pages;
101 #endif // QY2ComboTabWidget_h