#include <projecteditor.h>
Public Member Functions | |
UnitEditor (QWidget *parent=0) |
Editor for units.
UnitEditor::UnitEditor | ( | QWidget * | parent = 0 |
) | [inline] |
: MappedBaseEditor(parent) { setObjectName("UnitEditor"); setWindowTitle("Unit editor"); //set source setTable("tbl_units", "unit_name", Qt::AscendingOrder); // widget setup QLabel *name = new QLabel("&Name*:", this); QLabel *symbol = new QLabel("&Symbol*:", this); QLineEdit *nameEdit = new QLineEdit(this); QLineEdit *symbolEdit = new QLineEdit(this); name->setBuddy(nameEdit); symbol->setBuddy(symbolEdit); // add widgets addWidget(name, 0, 0, 1, 1); addWidget(nameEdit, 0, 1, 1, 1, "unit_name"); addWidget(symbol, 1, 0, 1, 1); addWidget(symbolEdit, 1, 1, 1, 1, "unit_symbol"); // setup connections connect(nameEdit, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); connect(symbolEdit, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); // update changes select(); }