00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "Name_Abbrev_wdgt.h"
00021
00022 #define SPACE 8
00023
00024 NameAbbrevWidget::NameAbbrevWidget(int nameWidth
00025 ,QString nameLabel
00026 ,int abbrevWidth
00027 ,QString abbrevLabel
00028 ,QWidget * widgetParent
00029 ,QBoxLayout * layoutParent
00030 ,QDialog * dialogParent)
00031 : QWidget(widgetParent)
00032 {
00033 int frameHeight, dialogHeight;
00034 int frameWidth, dialogWidth;
00035
00036 wdgt.setupUi(this);
00037 setNameLabel(nameLabel);
00038 setAbbrevLabel(abbrevLabel);
00039 setNameLength(nameWidth);
00040 setAbbrevLength(abbrevWidth);
00041
00042 vboxLayout = new QVBoxLayout();
00043 vboxLayout->setSpacing(6);
00044 vboxLayout->setMargin(0);
00045 vboxLayout->addWidget(this);
00046 layoutParent->addLayout(vboxLayout);
00047
00048 frameHeight = height();
00049 dialogHeight = dialogParent->height() + frameHeight;
00050 frameWidth = SPACE+width()+SPACE;
00051 if (widgetParent->width() > frameWidth)
00052 frameWidth = widgetParent->width();
00053 dialogWidth = SPACE+frameWidth+SPACE;
00054
00055 dialogParent->resize(dialogWidth,dialogHeight);
00056 widgetParent->resize(frameWidth,frameHeight);
00057 dialogParent->setMaximumSize(dialogWidth,dialogHeight);
00058 dialogParent->setMinimumSize(dialogWidth,dialogHeight);
00059
00060 }