Scaffold Qt6 Widgets app for Milestone 0
This commit is contained in:
45
src/session_window.cpp
Normal file
45
src/session_window.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "session_window.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QLabel>
|
||||
#include <QTabWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
SessionWindow::SessionWindow(const QString& profileName, QWidget* parent)
|
||||
: QMainWindow(parent), m_tabs(new QTabWidget(this))
|
||||
{
|
||||
setWindowTitle(QStringLiteral("OrbitHub Session - %1").arg(profileName));
|
||||
resize(900, 600);
|
||||
|
||||
setCentralWidget(m_tabs);
|
||||
addPlaceholderTab(profileName);
|
||||
}
|
||||
|
||||
void SessionWindow::addPlaceholderTab(const QString& profileName)
|
||||
{
|
||||
auto* container = new QWidget(this);
|
||||
auto* layout = new QVBoxLayout(container);
|
||||
|
||||
auto* titleLabel = new QLabel(QStringLiteral("Profile: %1").arg(profileName), container);
|
||||
auto* surfaceLabel = new QLabel(QStringLiteral("OrbitHub Native Surface"), container);
|
||||
|
||||
QFont titleFont = titleLabel->font();
|
||||
titleFont.setBold(true);
|
||||
titleLabel->setFont(titleFont);
|
||||
|
||||
QFont surfaceFont = surfaceLabel->font();
|
||||
surfaceFont.setPointSize(surfaceFont.pointSize() + 6);
|
||||
surfaceFont.setBold(true);
|
||||
surfaceLabel->setFont(surfaceFont);
|
||||
|
||||
surfaceLabel->setAlignment(Qt::AlignCenter);
|
||||
surfaceLabel->setMinimumHeight(200);
|
||||
surfaceLabel->setStyleSheet(
|
||||
QStringLiteral("border: 1px solid #8a8a8a; background-color: #f5f5f5;"));
|
||||
|
||||
layout->addWidget(titleLabel);
|
||||
layout->addWidget(surfaceLabel, 1);
|
||||
|
||||
m_tabs->addTab(container, profileName);
|
||||
}
|
||||
Reference in New Issue
Block a user