-
Notifications
You must be signed in to change notification settings - Fork 0
/
HorizontalHeaderSettingDlg.cpp
33 lines (25 loc) · 1.21 KB
/
HorizontalHeaderSettingDlg.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
#include "HorizontalHeaderSettingDlg.h"
#include <QLayout>
#include <QPropertyAnimation>
#include "HorizontalHeaderSettingDlgListView.h"
#include "HorizontalHeaderSettingDlgModel.h"
HorizontalHeaderSettingDlg::HorizontalHeaderSettingDlg(QMap<int,ColumnObject>& columnMap,const QPoint& point, QWidget* parent):QDialog(parent)
{
HorizontalHeaderSettingDlgListView* listView = new HorizontalHeaderSettingDlgListView(columnMap,this);
HorizontalHeaderSettingDlgModel* itemModel = new HorizontalHeaderSettingDlgModel(columnMap,this);
listView->setModel(itemModel);
QGridLayout* layout = new QGridLayout();
layout->addWidget(listView,0,Qt::AlignHCenter|Qt::AlignVCenter);
setLayout(layout);
this->move(point);
this->SetSizeAnimation(QSize(LASTHEIGHT,FRISTHEIGHT),QSize(LASTHEIGHT,LASTHEIGHT));
connect(listView,SIGNAL(SetHeaderColumnHideOrShow(int,bool)),parent->parent(),SLOT(SetHeaderColumnHideOrShow(int,bool)));
}
void HorizontalHeaderSettingDlg::SetSizeAnimation(const QSize& beginSize,const QSize& endSize)
{
QPropertyAnimation *animation = new QPropertyAnimation(this, "size");
animation->setDuration(DURATION);
animation->setStartValue(beginSize);
animation->setEndValue(endSize);
animation->start();
}