From 647b75f168f315015e96386567a22d3199478785 Mon Sep 17 00:00:00 2001 From: snt Date: Sun, 16 Jun 2024 18:17:47 +0200 Subject: [PATCH] mend --- src/.vscode/c_cpp_properties.json | 18 ---------- src/.vscode/launch.json | 24 ------------- src/.vscode/settings.json | 59 ------------------------------- src/cuetracklistwidget.h | 54 ++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 101 deletions(-) delete mode 100644 src/.vscode/c_cpp_properties.json delete mode 100644 src/.vscode/launch.json delete mode 100644 src/.vscode/settings.json create mode 100644 src/cuetracklistwidget.h diff --git a/src/.vscode/c_cpp_properties.json b/src/.vscode/c_cpp_properties.json deleted file mode 100644 index c2098a2..0000000 --- a/src/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "configurations": [ - { - "name": "linux-gcc-x64", - "includePath": [ - "${workspaceFolder}/**" - ], - "compilerPath": "/usr/bin/gcc", - "cStandard": "${default}", - "cppStandard": "${default}", - "intelliSenseMode": "linux-gcc-x64", - "compilerArgs": [ - "" - ] - } - ], - "version": 4 -} \ No newline at end of file diff --git a/src/.vscode/launch.json b/src/.vscode/launch.json deleted file mode 100644 index 070b7eb..0000000 --- a/src/.vscode/launch.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "C/C++ Runner: Debug Session", - "type": "cppdbg", - "request": "launch", - "args": [], - "stopAtEntry": false, - "externalConsole": false, - "cwd": "/home/snt/Documentos/lab/lms/lms-audio/src", - "program": "/home/snt/Documentos/lab/lms/lms-audio/src/build/Debug/outDebug", - "MIMode": "gdb", - "miDebuggerPath": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - } - ] -} \ No newline at end of file diff --git a/src/.vscode/settings.json b/src/.vscode/settings.json deleted file mode 100644 index 3e5eb95..0000000 --- a/src/.vscode/settings.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "C_Cpp_Runner.cCompilerPath": "gcc", - "C_Cpp_Runner.cppCompilerPath": "g++", - "C_Cpp_Runner.debuggerPath": "gdb", - "C_Cpp_Runner.cStandard": "", - "C_Cpp_Runner.cppStandard": "", - "C_Cpp_Runner.msvcBatchPath": "", - "C_Cpp_Runner.useMsvc": false, - "C_Cpp_Runner.warnings": [ - "-Wall", - "-Wextra", - "-Wpedantic", - "-Wshadow", - "-Wformat=2", - "-Wcast-align", - "-Wconversion", - "-Wsign-conversion", - "-Wnull-dereference" - ], - "C_Cpp_Runner.msvcWarnings": [ - "/W4", - "/permissive-", - "/w14242", - "/w14287", - "/w14296", - "/w14311", - "/w14826", - "/w44062", - "/w44242", - "/w14905", - "/w14906", - "/w14263", - "/w44265", - "/w14928" - ], - "C_Cpp_Runner.enableWarnings": true, - "C_Cpp_Runner.warningsAsError": false, - "C_Cpp_Runner.compilerArgs": [], - "C_Cpp_Runner.linkerArgs": [], - "C_Cpp_Runner.includePaths": [], - "C_Cpp_Runner.includeSearch": [ - "*", - "**/*" - ], - "C_Cpp_Runner.excludeSearch": [ - "**/build", - "**/build/**", - "**/.*", - "**/.*/**", - "**/.vscode", - "**/.vscode/**" - ], - "C_Cpp_Runner.useAddressSanitizer": false, - "C_Cpp_Runner.useUndefinedSanitizer": false, - "C_Cpp_Runner.useLeakSanitizer": false, - "C_Cpp_Runner.showCompilationTime": false, - "C_Cpp_Runner.useLinkTimeOptimization": false, - "C_Cpp_Runner.msvcSecureNoWarnings": false -} \ No newline at end of file diff --git a/src/cuetracklistwidget.h b/src/cuetracklistwidget.h new file mode 100644 index 0000000..e6c529a --- /dev/null +++ b/src/cuetracklistwidget.h @@ -0,0 +1,54 @@ +#ifndef CUETRACKLISTWIDGET_H +#define CUETRACKLISTWIDGET_H +#include +#include +#include + +#include "cuetrackwidget.h" + +class CueTrackListWidget : public QWidget { + Q_OBJECT +public: + size_t size = 0; + + explicit CueTrackListWidget(QWidget *parent = nullptr) : QWidget(parent) { + layout = new QVBoxLayout(); + containerWidget = new QWidget(); + containerWidget->setLayout(layout); + + scrollArea = new QScrollArea(this); + scrollArea->setWidgetResizable(true); + scrollArea->setWidget(containerWidget); + + QVBoxLayout* mainLayout = new QVBoxLayout(this); + mainLayout->addWidget(scrollArea); + setLayout(mainLayout); + } + + void addCueTrackWidget(CueTrackWidget* widget) { + layout->addWidget(widget); + size++; + } + + void clear() { + QLayoutItem* item; + while ((item = layout->takeAt(0)) != nullptr) { + delete item->widget(); + delete item; + } + size = 0; + } + + CueTrackWidget* getTrackAtIndex(size_t index) { + if (index < this->size) { + return qobject_cast(layout->itemAt(index)->widget()); + } + return nullptr; + } + +private: + QScrollArea* scrollArea; + QWidget* containerWidget; + QVBoxLayout* layout; +}; +#endif