sign: Open StreamStats as a Tabbed widget
PortStats and StreamStats Windows are presented as a tabbed widget. Multiple StreamStats windows are titled to include an id to hint at the sequence in which they were opened
This commit is contained in:
parent
4f8ee757b3
commit
3d7a459b5f
@ -234,14 +234,18 @@ void PortStatsWindow::on_tbGetStreamStats_clicked()
|
||||
model->portListFromIndex(selectedColumns(), portList);
|
||||
|
||||
if (portList.size()) {
|
||||
QDockWidget *dock = new QDockWidget(tr("Stream Statistics"),
|
||||
mainWindow);
|
||||
QDockWidget *dock = new QDockWidget(mainWindow);
|
||||
streamStatsModel = new StreamStatsModel(dock);
|
||||
dock->setWidget(new StreamStatsWindow(streamStatsModel, dock));
|
||||
dock->setWindowTitle(dock->widget()->windowTitle());
|
||||
dock->setObjectName("streamStatsDock");
|
||||
dock->setFloating(true);
|
||||
dock->setAttribute(Qt::WA_DeleteOnClose);
|
||||
QDockWidget *statsDock = mainWindow->findChild<QDockWidget*>(
|
||||
"statsDock");
|
||||
mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dock);
|
||||
mainWindow->tabifyDockWidget(statsDock, dock);
|
||||
dock->show();
|
||||
dock->raise();
|
||||
}
|
||||
|
||||
// Get stream stats for selected ports, portgroup by portgroup
|
||||
|
@ -22,14 +22,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QHeaderView>
|
||||
|
||||
static int id;
|
||||
static int count;
|
||||
|
||||
StreamStatsWindow::StreamStatsWindow(QAbstractItemModel *model, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
if (id)
|
||||
setWindowTitle(windowTitle() + QString("(%1)").arg(id));
|
||||
id++;
|
||||
count++;
|
||||
|
||||
streamStats->setModel(model);
|
||||
|
||||
streamStats->verticalHeader()->setHighlightSections(false);
|
||||
streamStats->verticalHeader()->setDefaultSectionSize(
|
||||
streamStats->verticalHeader()->minimumSectionSize());
|
||||
}
|
||||
|
||||
StreamStatsWindow::~StreamStatsWindow()
|
||||
{
|
||||
count--;
|
||||
if (count == 0)
|
||||
id = 0;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ class StreamStatsWindow: public QWidget, private Ui::StreamStatsWindow
|
||||
Q_OBJECT
|
||||
public:
|
||||
StreamStatsWindow(QAbstractItemModel *model, QWidget *parent = 0);
|
||||
~StreamStatsWindow();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Form</string>
|
||||
<string>Stream Statistics</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
|
Loading…
Reference in New Issue
Block a user