Skip to content

Commit 854d490

Browse files
committed
little change
1 parent 90235f3 commit 854d490

1 file changed

Lines changed: 31 additions & 39 deletions

File tree

src/mainwindow.cpp

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ MainWindow::MainWindow(QWidget *parent)
3939
{
4040
setWindowTitle("Voxel Forge");
4141

42-
// Set modern techno font for the entire application
4342
QFont appFont("Rajdhani", 10);
4443
appFont.setStyleHint(QFont::SansSerif);
4544
QApplication::setFont(appFont);
@@ -125,7 +124,7 @@ MainWindow::MainWindow(QWidget *parent)
125124
setupVideoExtractorThread();
126125
setupPipelineThread();
127126

128-
// default style/theme
127+
// default theme
129128
setTheme(0);
130129
}
131130

@@ -162,7 +161,6 @@ void MainWindow::createMenuBar()
162161
QAction *aboutAct = help->addAction("About");
163162
connect(aboutAct, &QAction::triggered, this, &MainWindow::showAbout);
164163

165-
// subtle styling for menu bar
166164
mb->setStyleSheet(
167165
"QMenuBar { background: transparent; color: #eaeaea; } QMenuBar::item { spacing: 6px; padding: 4px 12px; }");
168166
}
@@ -174,7 +172,7 @@ QWidget *MainWindow::createHomePage()
174172
mainLayout->setContentsMargins(40, 30, 40, 30);
175173
mainLayout->setSpacing(20);
176174

177-
// Logo at the top
175+
//logo
178176
QWidget *imageContainer = new QWidget;
179177
imageContainer->setFixedSize(800, 400);
180178

@@ -197,7 +195,7 @@ QWidget *MainWindow::createHomePage()
197195

198196
mainLayout->addSpacing(15);
199197

200-
// Title section below logo
198+
// title below logo
201199
QLabel *title = new QLabel("VOXEL FORGE");
202200
title->setAlignment(Qt::AlignCenter);
203201
title->setStyleSheet(
@@ -220,7 +218,7 @@ QWidget *MainWindow::createHomePage()
220218

221219
mainLayout->addSpacing(15);
222220

223-
// Features - horizontal compact list
221+
// horizontal
224222
QHBoxLayout *featuresLayout = new QHBoxLayout;
225223
featuresLayout->setSpacing(15);
226224

@@ -287,7 +285,7 @@ QWidget *MainWindow::createProjectManagerPage()
287285
mainPageLayout->addWidget(title);
288286
mainPageLayout->addSpacing(10);
289287

290-
// Project management section
288+
// project management
291289
QHBoxLayout *projectControls = new QHBoxLayout();
292290

293291
selectProjectButton = new QPushButton("Select Project");
@@ -327,7 +325,7 @@ QWidget *MainWindow::createProjectManagerPage()
327325
projectControls->addStretch();
328326
mainPageLayout->addLayout(projectControls);
329327

330-
// Current project display
328+
// current project show
331329
currentProjectLabel = new QLabel("No project selected");
332330
currentProjectLabel->setStyleSheet(
333331
"QLabel { "
@@ -370,12 +368,12 @@ QWidget *MainWindow::createProjectManagerPage()
370368
"border: 1px solid #444; "
371369
"}");
372370

373-
// Connect project buttons
371+
// connect project buttons
374372
connect(selectProjectButton, &QPushButton::clicked, this, &MainWindow::selectProject);
375373
connect(createProjectButton, &QPushButton::clicked, this, &MainWindow::createNewProject);
376374
connect(cancelPipelineButton, &QPushButton::clicked, this, &MainWindow::cancelPipeline);
377375

378-
// Reconstruction cards with clickable buttons
376+
// cards
379377
QHBoxLayout *cardsLayout = new QHBoxLayout();
380378
cardsLayout->setSpacing(25);
381379

@@ -473,7 +471,7 @@ QWidget *MainWindow::createProjectManagerPage()
473471
connect(denseReconButton, &QPushButton::clicked, this, &MainWindow::runDenseReconstruction);
474472
connect(view3DModelButton, &QPushButton::clicked, this, &MainWindow::goTo3DModelsPage);
475473

476-
// Pipeline log viewer with cancel button
474+
// log viewer
477475
QHBoxLayout *logHeaderLayout = new QHBoxLayout();
478476
QLabel *logLabel = new QLabel("Pipeline Log:");
479477
logLabel->setStyleSheet("font-size: 14px; color: #ffffff; font-weight: 600;");
@@ -517,7 +515,7 @@ QWidget *MainWindow::createImageManagerPage()
517515
header->addWidget(title);
518516
header->addStretch();
519517

520-
// Add Video button
518+
521519
addVideoButton = new QPushButton("+ Add Video");
522520
addVideoButton->setCursor(Qt::PointingHandCursor);
523521
addVideoButton->setFixedHeight(36);
@@ -540,7 +538,6 @@ QWidget *MainWindow::createImageManagerPage()
540538
"color: #ccc; "
541539
"}");
542540

543-
// Cancel Video button
544541
cancelVideoButton = new QPushButton("Cancel Extraction");
545542
cancelVideoButton->setCursor(Qt::PointingHandCursor);
546543
cancelVideoButton->setFixedHeight(36);
@@ -644,7 +641,7 @@ QWidget *MainWindow::createImageManagerPage()
644641
// spacer - push other buttons to right
645642
header->addStretch();
646643

647-
// Add other buttons on the right
644+
// other buttons on the right
648645
header->addWidget(addImageButton);
649646
header->addWidget(addVideoButton);
650647
header->addWidget(cancelVideoButton);
@@ -655,7 +652,7 @@ QWidget *MainWindow::createImageManagerPage()
655652
// middle section with image list and preview
656653
QHBoxLayout *middleLayout = new QHBoxLayout();
657654

658-
// image list as icon grid
655+
// image list - icon grid
659656
imageList = new QListWidget;
660657
imageList->setViewMode(QListView::IconMode);
661658
imageList->setIconSize(QSize(160, 120));
@@ -672,7 +669,7 @@ QWidget *MainWindow::createImageManagerPage()
672669
"QListWidget::item:hover { background: rgba(255,255,255,0.08); }");
673670
middleLayout->addWidget(imageList, 2);
674671

675-
// Image preview
672+
// image preview
676673
imagePreviewLabel = new QLabel("Image Preview");
677674
imagePreviewLabel->setMinimumSize(400, 300);
678675
imagePreviewLabel->setAlignment(Qt::AlignCenter);
@@ -685,7 +682,7 @@ QWidget *MainWindow::createImageManagerPage()
685682

686683
outer->addLayout(middleLayout, 2);
687684

688-
// Image/Video Log viewer
685+
// log viewer [image/video logs]
689686
QLabel *imageLogLabel = new QLabel("Image/Video Log:");
690687
imageLogLabel->setStyleSheet("font-size: 14px; color: #ffffff; font-weight: 600;");
691688
outer->addWidget(imageLogLabel);
@@ -705,7 +702,7 @@ QWidget *MainWindow::createImageManagerPage()
705702
"}");
706703
outer->addWidget(imageLogViewer, 1);
707704

708-
// connections
705+
// connect
709706
connect(addImageButton, &QPushButton::clicked, this, &MainWindow::addImages);
710707
connect(addVideoButton, &QPushButton::clicked, this, &MainWindow::addVideo);
711708
connect(cancelVideoButton, &QPushButton::clicked, this, &MainWindow::cancelVideoExtraction);
@@ -724,7 +721,6 @@ QWidget *MainWindow::create3DModelsPage()
724721
outer->setSpacing(12);
725722
outer->setContentsMargins(25, 25, 25, 25);
726723

727-
// Header with title and Open Model button
728724
QHBoxLayout *header = new QHBoxLayout;
729725
QLabel *title = new QLabel("3D MODELS");
730726
title->setStyleSheet(
@@ -765,7 +761,7 @@ QWidget *MainWindow::create3DModelsPage()
765761
QHBoxLayout *contentLayout = new QHBoxLayout();
766762
contentLayout->setSpacing(15);
767763

768-
// Left side - Model list
764+
// Left - Model list
769765
QVBoxLayout *listLayout = new QVBoxLayout();
770766

771767
QLabel *listLabel = new QLabel("Available Models:");
@@ -802,7 +798,7 @@ QWidget *MainWindow::create3DModelsPage()
802798
listLayout->addWidget(modelList);
803799
contentLayout->addLayout(listLayout, 1);
804800

805-
// Right side - 3D Model Viewer
801+
// Right - 3D Model Viewer
806802
QVBoxLayout *viewerLayout = new QVBoxLayout();
807803

808804
QLabel *viewerLabel = new QLabel("3D Model Viewer:");
@@ -818,7 +814,6 @@ QWidget *MainWindow::create3DModelsPage()
818814
"border-radius: 8px; "
819815
"}");
820816

821-
// For now, add a label that will show model info
822817
QVBoxLayout *viewerContentLayout = new QVBoxLayout(modelViewerWidget);
823818
modelViewerLabel = new QLabel("No model loaded\n\nSelect a model from the list and click 'Open Model'");
824819
modelViewerLabel->setAlignment(Qt::AlignCenter);
@@ -836,7 +831,7 @@ QWidget *MainWindow::create3DModelsPage()
836831

837832
outer->addLayout(contentLayout);
838833

839-
// Connect signals
834+
// connect
840835
connect(modelList, &QListWidget::itemClicked, this, &MainWindow::onModelItemClicked);
841836
connect(openModelButton, &QPushButton::clicked, this, &MainWindow::openSelectedModel);
842837

@@ -1004,7 +999,7 @@ void MainWindow::addImages()
1004999
item->setText(fi.fileName());
10051000
item->setToolTip(dest);
10061001
item->setData(Qt::UserRole, dest); // store full path
1007-
imageList->addItem(item); // <-- missing line before
1002+
imageList->addItem(item);
10081003
}
10091004
}
10101005

@@ -1068,13 +1063,13 @@ void MainWindow::saveSelectedImages()
10681063
}
10691064
void MainWindow::changeFolder(const QString &path)
10701065
{
1071-
// Update the current image folder
1066+
// update the current image folder
10721067
currentImageFolder = path;
10731068

1074-
// Clear existing list
1069+
// clear existing list
10751070
imageList->clear();
10761071

1077-
// Populate images from the new folder
1072+
// populate images from the new folder
10781073
QDir dir(path);
10791074
QStringList filters = {"*.png", "*.jpg", "*.jpeg", "*.bmp", "*.tiff"};
10801075
QFileInfoList files = dir.entryInfoList(filters, QDir::Files);
@@ -1129,21 +1124,21 @@ void MainWindow::refreshImageList()
11291124
return;
11301125
}
11311126

1132-
// Clear current image list
1127+
// clear current image list
11331128
imageList->clear();
11341129

1135-
// Clear preview
1130+
// clear preview
11361131
if (imagePreviewLabel)
11371132
{
11381133
imagePreviewLabel->clear();
11391134
imagePreviewLabel->setText("Image Preview\n\nClick an image to preview");
11401135
imagePreviewLabel->setAlignment(Qt::AlignCenter);
11411136
}
11421137

1143-
// Reload images from project folder
1138+
// reload images from project folder
11441139
loadProjectImages();
11451140

1146-
// Show confirmation message
1141+
// confirmation message
11471142
int count = imageList->count();
11481143
imageLogViewer->append(QString("<span style='color:#2ecc71;'>✓ Refreshed image list - Found %1 image(s)</span>").arg(count));
11491144
}
@@ -1161,7 +1156,6 @@ void MainWindow::onImageItemClicked(QListWidgetItem *item)
11611156
if (pixmap.isNull())
11621157
return;
11631158

1164-
// Scale to fit preview label
11651159
QPixmap scaled = pixmap.scaled(imagePreviewLabel->size(),
11661160
Qt::KeepAspectRatio,
11671161
Qt::SmoothTransformation);
@@ -1185,7 +1179,7 @@ void MainWindow::addVideo()
11851179

11861180
projectFullPath = currentProjectFolder;
11871181

1188-
// Disable add video button and enable cancel button
1182+
//disable add video button, enable cancel button
11891183
addVideoButton->setEnabled(false);
11901184
cancelVideoButton->setEnabled(true);
11911185

@@ -1198,7 +1192,7 @@ void MainWindow::addVideo()
11981192
return;
11991193
}
12001194

1201-
// Start extraction on worker thread
1195+
// start extraction on worker thread
12021196
QMetaObject::invokeMethod(videoExtractor, "extractFrames",
12031197
Qt::QueuedConnection,
12041198
Q_ARG(QString, destVideoPath),
@@ -1276,7 +1270,7 @@ void MainWindow::updateProjectDisplay()
12761270
"font-weight: 500; "
12771271
"}");
12781272

1279-
// Clear image list when no project
1273+
// clear image list when no project
12801274
imageList->clear();
12811275
}
12821276
else
@@ -1518,7 +1512,6 @@ void MainWindow::load3DModels()
15181512
return;
15191513
}
15201514

1521-
// Supported 3D model formats
15221515
QStringList filters = {"*.obj", "*.ply", "*.stl", "*.fbx", "*.dae", "*.3ds", "*.gltf", "*.glb"};
15231516
QFileInfoList modelFiles = modelsDir.entryInfoList(filters, QDir::Files, QDir::Name);
15241517

@@ -1575,8 +1568,7 @@ void MainWindow::openSelectedModel()
15751568
return;
15761569
}
15771570

1578-
// For now, show model info in the label
1579-
// In a full implementation, you would use Qt3D or another 3D rendering library
1571+
// temp- show model info, TODO: 3D rendering
15801572
QString modelInfo = QString(
15811573
"Model Loaded:\n\n"
15821574
"Name: %1\n"
@@ -1597,7 +1589,7 @@ void MainWindow::openSelectedModel()
15971589
"border: none; "
15981590
"}");
15991591

1600-
// Optional: Launch external viewer
1592+
16011593
QMessageBox::StandardButton reply = QMessageBox::question(
16021594
this,
16031595
"Open in External Viewer?",

0 commit comments

Comments
 (0)