forked from GLDsuh-a/qt-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.cpp
27 lines (21 loc) · 741 Bytes
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "mainwindow.h"
#include "GTableWidget.h"
#include "ui_mainwindow.h"
#include <QVBoxLayout>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
TableWidget *pTableWidget = new TableWidget(3, 3,this);
pTableWidget->setStyleSheet("QTableCornerButton::section{background-color: red;}");
pTableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background: green}");
pTableWidget->verticalHeader()->setStyleSheet("QHeaderView::section{background: green}");
QVBoxLayout *pLayout = new QVBoxLayout(this);
pLayout->addWidget(pTableWidget);
ui->centralWidget->setLayout(pLayout);
}
MainWindow::~MainWindow()
{
delete ui;
}