Dateien, die als Parameter übergeben werden, werden nach dem Start direkt geladen
This commit is contained in:
67
barecode/src/editor/FunctionListPanel.h
Normal file
67
barecode/src/editor/FunctionListPanel.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#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;
|
||||
};
|
||||
Reference in New Issue
Block a user