完成发布
This commit is contained in:
@@ -81,6 +81,14 @@ int PanelWidget::getColumnCount()
|
||||
return this->columnCount;
|
||||
}
|
||||
|
||||
void PanelWidget::clearWidgets()
|
||||
{
|
||||
foreach (QWidget* w, widgets) {
|
||||
delete w;
|
||||
}
|
||||
widgets.clear();
|
||||
}
|
||||
|
||||
void PanelWidget::setWidget(QList<QWidget *> widgets, int columnCount)
|
||||
{
|
||||
this->widgets = widgets;
|
||||
@@ -94,7 +102,6 @@ void PanelWidget::setWidget(QList<QWidget *> widgets, int columnCount)
|
||||
foreach (QWidget *widget, widgets) {
|
||||
gridLayout->removeWidget(widget);
|
||||
widget->setVisible(false);
|
||||
delete widget;
|
||||
}
|
||||
|
||||
//重新添加到布局中并可见
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
|
||||
QList<QWidget *> getWidgets();
|
||||
int getColumnCount();
|
||||
void clearWidgets();
|
||||
|
||||
|
||||
public Q_SLOTS:
|
||||
@@ -70,6 +71,7 @@ public Q_SLOTS:
|
||||
void setAutoWidth(bool autoWidth);
|
||||
void setAutoHeight(bool autoHeight);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // PANELWIDGET_H
|
||||
|
||||
Reference in New Issue
Block a user