#include <projecteditor.h>
Public Member Functions | |
ProjectEditor (QWidget *parent=0) | |
Protected Member Functions | |
virtual void | onCurrentRecordChange (int row) |
Editor for projects.
To be able to make new projets you either need the "Create project" privilege, or the administrator credential. A projects owner is the one who made it.
ProjectEditor::ProjectEditor | ( | QWidget * | parent = 0 |
) | [inline] |
: MappedBaseEditor(parent), privView(new PrivilegeEditor(this)) { setObjectName("ProjectEditor"); setWindowTitle("Project editor"); //set source setTable("tbl_projects", "proj_name", Qt::AscendingOrder); // widget setup QLabel *name = new QLabel("&Name*:", this); QLabel *desc = new QLabel("&Description*:", this); QLabel *owner = new QLabel("&Owner:", this); QLabel *priv = new QLabel("User &rights:", this); QLineEdit *nameEdit = new QLineEdit(this); QTextEdit *descEdit = new QTextEdit(this); QComboBox *ownerEdit = new QComboBox(this); name->setBuddy(nameEdit); desc->setBuddy(descEdit); owner->setBuddy(ownerEdit); priv->setBuddy(privView); // privileges hide columns privView->hideColumn("proj_name"); privView->hideColumn("owner"); // add widgets addWidget(name, 0, 0, 1, 1); addWidget(nameEdit, 0, 1, 1, 1, "proj_name"); addWidget(owner, 1, 0, 1, 1); addWidget(ownerEdit, 1, 1, 1, 1, QSqlRelation("tbl_users", "user_name", "user_name"), "rls_owner"); addWidget(desc, 2, 0, 1, 2); addWidget(descEdit, 3, 0, 1, 2, "proj_desc", "plainText"); addWidget(priv, 0, 2, 1, 1); addWidget(privView, 1, 2, 3, 1); // setup connections connect(nameEdit, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); connect(descEdit, SIGNAL(textChanged()), this, SLOT(updateButtons())); connect(ownerEdit, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButtons())); // update changes select(); privView->select(); }
virtual void ProjectEditor::onCurrentRecordChange | ( | int | row | ) | [inline, protected, virtual] |
Reimplemented from MappedBaseEditor.
{ MappedBaseEditor::onCurrentRecordChange(row); updatePrivilegesView(); }