-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
askSkelPairDialog.cpp
57 lines (39 loc) · 1.25 KB
/
askSkelPairDialog.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
56
57
#include <vector>
#include "askSkelPairDialog.h"
#include "ui_askSkelPairDialog.h"
AskSkelPairDialog::AskSkelPairDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::askSkelPairDialog)
{
ui->setupUi(this);
connect(ui->skelTo,SIGNAL(currentIndexChanged(int)),this,SLOT(update()));
}
int AskSkelPairDialog::exec(){
//ui->skelTo->setCurrentIndex(1);
update();
return QDialog::exec();
}
void AskSkelPairDialog::update()
{
ui->nboneFrom->display(numBoneInAni);
int a=ui->skelTo->currentIndex();
QVariant ud = ui->skelTo->itemData ( a, Qt::UserRole );
ui->nboneTo->display(ud.toSize().width());
}
int AskSkelPairDialog::skelFrom() const{
QVariant ud = ui->skelFrom->itemData( ui->skelFrom->currentIndex() , Qt::UserRole );
return ud.toSize().height();
}
int AskSkelPairDialog::skelTo() const{
QVariant ud = ui->skelTo->itemData( ui->skelTo->currentIndex() , Qt::UserRole );
return ud.toSize().height();
}
void AskSkelPairDialog::addSkeleton(QString name, int nbone, int index){
QVariant data(QSize(nbone,index));
if (nbone==numBoneInAni) ui->skelFrom->addItem(name,data);
ui->skelTo->addItem(name,data);
}
AskSkelPairDialog::~AskSkelPairDialog()
{
delete ui;
}