68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
#pragma once
|
||
|
||
#include <QWidget>
|
||
#include <QTreeWidget>
|
||
#include <QTreeWidgetItem>
|
||
#include <QLineEdit>
|
||
#include <QLabel>
|
||
#include <QVBoxLayout>
|
||
#include <QHBoxLayout>
|
||
#include <QPushButton>
|
||
#include <QComboBox>
|
||
#include <QFutureWatcher>
|
||
#include <QString>
|
||
|
||
#include "FunctionScanner.h"
|
||
|
||
// ---------------------------------------------------------------------------
|
||
// FunctionListPanel – Zeigt alle im Projekt definierten Funktionen
|
||
// als durchsuchbare, sortierbare Liste.
|
||
//
|
||
// Gruppierung: nach Datei oder nach Klasse
|
||
// Klick: öffnet Datei und springt zur Definition
|
||
// Aktualisierung: automatisch nach jedem Speichern
|
||
// ---------------------------------------------------------------------------
|
||
class FunctionListPanel : public QWidget
|
||
{
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit FunctionListPanel(QWidget *parent = nullptr);
|
||
|
||
void setProjectRoot(const QString &path);
|
||
|
||
public slots:
|
||
void refresh();
|
||
void activate();
|
||
|
||
signals:
|
||
void fileLineRequested(const QString &filePath, int line);
|
||
|
||
private slots:
|
||
void onScanFinished();
|
||
void onItemActivated(QTreeWidgetItem *item, int column);
|
||
void onFilterChanged(const QString &text);
|
||
void onGroupingChanged(int index);
|
||
|
||
private:
|
||
void setupUi();
|
||
void populateTree(const QList<FunctionScanner::FunctionInfo> &functions);
|
||
void applyFilter(const QString &text);
|
||
static void formatFunctionItem(QTreeWidgetItem *item,
|
||
const FunctionScanner::FunctionInfo &f);
|
||
|
||
QString m_projectRoot;
|
||
|
||
QLineEdit *m_filterEdit = nullptr;
|
||
QComboBox *m_groupCombo = nullptr;
|
||
QPushButton *m_btnRefresh = nullptr;
|
||
QLabel *m_statusLabel = nullptr;
|
||
QTreeWidget *m_tree = nullptr;
|
||
|
||
FunctionScanner *m_scanner = nullptr;
|
||
QFutureWatcher<QList<FunctionScanner::FunctionInfo>> *m_watcher = nullptr;
|
||
|
||
// Letztes Scan-Ergebnis für Filter ohne Neuscan
|
||
QList<FunctionScanner::FunctionInfo> m_lastResult;
|
||
};
|