LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
TrackedTabs.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <QTabWidget>
4#include <QWidget>
5
6#include <map>
7#include <string>
8
9namespace ui::qt::utils
10{
11
18inline void RemoveTrackedTabs(QTabWidget* tabs, std::map<std::string, QWidget*>& tracked)
19{
20 for (const auto& [id, page] : tracked)
21 {
22 if (!page)
23 continue;
24 if (tabs)
25 {
26 const int index = tabs->indexOf(page);
27 if (index >= 0)
28 tabs->removeTab(index);
29 }
30 page->deleteLater();
31 }
32 tracked.clear();
33}
34
35} // namespace ui::qt::utils
Definition AppDataDir.hpp:14
void RemoveTrackedTabs(QTabWidget *tabs, std::map< std::string, QWidget * > &tracked)
Definition TrackedTabs.hpp:18