1 | ///////////////////////////////////////////////////////////////////////////// |
---|---|
2 | // |
3 | // functions generating layout-aware widgets |
4 | // |
5 | ///////////////////////////////////////////////////////////////////////////// |
6 | |
7 | #include "newwidget.h" |
8 | |
9 | QLineEdit *newLineEdit(int visiblewidth, QWidget *parent) { |
10 | QLineEdit *l = new QLineEdit(parent); |
11 | if(visiblewidth == 0) |
12 | l->setMinimumWidth(l->sizeHint().width()); |
13 | else |
14 | l->setFixedWidth(l->fontMetrics().width( |
15 | |
16 | return l; |
17 | } |
18 |