-
Notifications
You must be signed in to change notification settings - Fork 55
/
toolswidget.cpp
55 lines (39 loc) · 1.42 KB
/
toolswidget.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "toolswidget.h"
#include <QLabel>
#include <QSqlQuery>
#include <QVBoxLayout>
#include <QSplitter>
#include <QDebug>
ToolsWidget::ToolsWidget(QWidget *parent) :
QWidget(parent)
{
QWidget *tools_widget;
QWidget *main_widget;
QSplitter * main_splitter;
tools_widget = new QWidget(this);
main_widget = new QWidget(this);
QPalette palette;
tools_widget->setAutoFillBackground(true);
main_widget->setAutoFillBackground(true);
palette.setColor(QPalette::Background,QColor(155,225,123));
tools_widget->setPalette(palette);
tools_widget->setFixedHeight(20);
main_splitter = new QSplitter(this);
main_splitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
main_splitter->setOrientation(Qt::Vertical);
main_splitter->setHandleWidth(0);
main_splitter->setStyleSheet("QSplitter::handle{background:lightgray;}");
main_splitter->addWidget(tools_widget);
main_splitter->addWidget(main_widget);
for(int i = 0; i<main_splitter->count();i++)
{
QSplitterHandle *handle = main_splitter->handle(i);
handle->setEnabled(false);
}
qDebug() << "content_ widget ok";
QHBoxLayout *main_layout = new QHBoxLayout();
main_layout->addWidget(main_splitter);
main_layout->setSpacing(0);
main_layout->setContentsMargins(0, 0, 0, 0);
setLayout(main_layout);
}