forked from qt-creator/qt-creator
coreplugin: Make RightPaneWidget more widely usable.
RightPaneWidget now has setWidget() and is no longer intimately tied to the help plugin. Help plugin now uses setWidget(). Reviewed-By: dt
This commit is contained in:
@@ -47,13 +47,6 @@ namespace Core {
|
||||
class IMode;
|
||||
class RightPaneWidget;
|
||||
|
||||
// TODO: The right pane works only for the help plugin atm. It can't cope
|
||||
// with more than one plugin publishing objects they want in the right pane
|
||||
// For that the API would need to be different. (Might be that instead of
|
||||
// adding objects to the pool, there should be a method
|
||||
// RightPaneWidget::setWidget(QWidget *w) Anyway if a second plugin wants to
|
||||
// show something there, redesign this API
|
||||
|
||||
class CORE_EXPORT RightPanePlaceHolder : public QWidget
|
||||
{
|
||||
friend class Core::RightPaneWidget;
|
||||
@@ -73,21 +66,6 @@ private:
|
||||
static RightPanePlaceHolder* m_current;
|
||||
};
|
||||
|
||||
|
||||
class CORE_EXPORT BaseRightPaneWidget : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BaseRightPaneWidget(QWidget *widget);
|
||||
~BaseRightPaneWidget();
|
||||
QWidget *widget() const;
|
||||
|
||||
private:
|
||||
QWidget *m_widget;
|
||||
};
|
||||
|
||||
|
||||
class CORE_EXPORT RightPaneWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -104,18 +82,18 @@ public:
|
||||
|
||||
static RightPaneWidget *instance();
|
||||
|
||||
void setWidget(QWidget *widget);
|
||||
|
||||
int storedWidth();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
private slots:
|
||||
void objectAdded(QObject *obj);
|
||||
void aboutToRemoveObject(QObject *obj);
|
||||
|
||||
private:
|
||||
void clearWidget();
|
||||
bool m_shown;
|
||||
int m_width;
|
||||
QWidget *m_widget;
|
||||
static RightPaneWidget *m_instance;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user