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
27 #include <q3intdict.h>
36 * This widget is very much like a QTabWidget, but it uses a combo box above
37 * the tab pages rather than a ( scrolled ) one-line row of tabs.
39 class QY2ComboTabWidget : public Q3VBox
46 * Constructor. 'combo_box_label' is the user-visible label of the combo
47 * box that is used to switch between the different tab pages.
49 QY2ComboTabWidget( const QString & combo_box_label,
51 const char * name = 0 );
56 virtual ~QY2ComboTabWidget();
59 * Add a page. 'page_label' will be the user-visible combo box entry for
62 void addPage( const QString & page_label, QWidget * page );
68 * Emitted when the current page changes.
69 * NOT emitted initially for the very first page that is shown.
71 void currentChanged( QWidget * newCurrentPage );
77 * Show a page. Updates the combo box contents accordingly.
78 * This is an expensive operation: All combo box items are searched for the
79 * item that corresponds to this page.
81 void showPage( QWidget * page );
88 * Show a page identified by its index. Does NOT update the combo box
91 void showPage( int index );
96 QComboBox * combo_box;
98 Q3WidgetStack * widget_stack;
99 Q3IntDict<QWidget> pages;
102 #endif // QY2ComboTabWidget_h