#ifndef QMYSTACKEDWIDGET_H #define QMYSTACKEDWIDGET_H #include #include class QMyStackedWidget : public QStackedWidget { Q_OBJECT public: QMyStackedWidget(QWidget *parent = 0); ~QMyStackedWidget(); void addWidget( QWidget * pWidget, const QString & strWidgetName ); void removeWidget( QWidget * pWidget ); void removeWidget( const QString & strWidgetName ); void showWidget( const QString & strWidgetName ); void showWidget( int index ); protected Q_SLOTS: private: private: //Ui::QMyStackedWidget ui; QHash m_subWidgetTable; //×Ó´°¿Úhash±í }; #endif // QMYSTACKEDWIDGET_H