2018-06-01 09:36:01 +00:00
|
|
|
#ifndef QMYSTACKEDWIDGET_H
|
|
|
|
#define QMYSTACKEDWIDGET_H
|
|
|
|
|
2018-06-02 09:47:28 +00:00
|
|
|
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
|
|
|
|
|
|
|
|
#include <QtCore/qhash.h>
|
2018-06-01 09:36:01 +00:00
|
|
|
#include <QtWidgets/QStackedWidget>
|
|
|
|
|
|
|
|
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<QString, QWidget *> m_subWidgetTable; //子窗口hash表
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QMYSTACKEDWIDGET_H
|