Comments::Comments(QWidget *pParent, const char *name) : QWidget(pParent) { setObjectName(name); _sourceid = -1; _editable = true; if (_strMap.isEmpty()) { (void)commentMap(); } _verboseCommentList = false; QVBoxLayout *vbox = new QVBoxLayout(this); QHBoxLayout *hbox = new QHBoxLayout(); hbox->setMargin(0); hbox->setSpacing(7); _verbose = new XCheckBox(tr("Verbose Text"), this); _verbose->setObjectName("_verbose"); _verboseCommentList = _verbose->isChecked(); vbox->addWidget(_verbose); vbox->addLayout(hbox); QWidget *buttons = new QWidget(this); QVBoxLayout * buttonsLayout = new QVBoxLayout(buttons); buttonsLayout->setMargin(0); buttonsLayout->setSpacing(0); _comment = new XTreeWidget(this); _comment->setObjectName("_comment"); _comment->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); _comment->addColumn(tr("Date/Time"), _timeDateColumn, Qt::AlignCenter,true, "comment_date"); _comment->addColumn(tr("Type"), _itemColumn, Qt::AlignCenter,true, "type"); _comment->addColumn(tr("Source"), _itemColumn, Qt::AlignCenter,true, "comment_source"); _comment->addColumn(tr("User Account"), _userColumn, Qt::AlignCenter,true, "comment_user"); _comment->addColumn(tr("Comment"), -1, Qt::AlignLeft, true, "first"); _comment->addColumn(tr("Public"), _ynColumn, Qt::AlignLeft, false, "comment_public"); hbox->addWidget(_comment); _browser = new QTextBrowser(this); _browser->setObjectName("_browser"); _browser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); _browser->setOpenLinks(false); hbox->addWidget(_browser); _newComment = new QPushButton(tr("New"), buttons); _newComment->setObjectName("_newComment"); buttonsLayout->addWidget(_newComment); _viewComment = new QPushButton(tr("View"), buttons); _viewComment->setObjectName("_viewComment"); _viewComment->setEnabled(false); buttonsLayout->addWidget(_viewComment); _editComment = new QPushButton(tr("Edit"), buttons); _editComment->setObjectName("_editComment"); _editComment->setEnabled(false); buttonsLayout->addWidget(_editComment); QSpacerItem *_buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); buttonsLayout->addItem(_buttonSpacer); buttons->setLayout(buttonsLayout); hbox->addWidget(buttons); _editmap = new QMultiMap<int, bool>(); _editmap2 = new QMultiMap<int, bool>(); connect(_newComment, SIGNAL(clicked()), this, SLOT( sNew())); connect(_viewComment, SIGNAL(clicked()), this, SLOT( sView())); connect(_editComment, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_comment, SIGNAL(valid(bool)), this, SLOT(sCheckButtonPriv(bool))); connect(_comment, SIGNAL(itemSelected(int)), _viewComment, SLOT(animateClick())); connect(_browser, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); connect(_verbose, SIGNAL(toggled(bool)), this, SLOT(setVerboseCommentList(bool))); setFocusProxy(_comment); setVerboseCommentList(_verboseCommentList); }
Comments::Comments(QWidget *pParent, const char *name) : QWidget(pParent, name) { _source = Uninitialized; _sourceid = -1; _verboseCommentList = false; if(_x_metrics) _verboseCommentList = _x_metrics->boolean("VerboseCommentList"); QHBoxLayout *main = new QHBoxLayout(this); main->setMargin(0); main->setSpacing(7); QWidget *buttons = new QWidget(this); QVBoxLayout * buttonsLayout = new QVBoxLayout(buttons); buttonsLayout->setMargin(0); buttonsLayout->setSpacing(0); _comment = new XTreeWidget(this); _comment->setObjectName("_comment"); _comment->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); _comment->addColumn(tr("Date/Time"), _timeDateColumn, Qt::AlignCenter,true, "comment_date"); _comment->addColumn(tr("Type"), _itemColumn, Qt::AlignCenter,true, "type"); _comment->addColumn(tr("User"), _userColumn, Qt::AlignCenter,true, "comment_user"); _comment->addColumn(tr("Comment"), -1, Qt::AlignLeft, true, "first"); main->addWidget(_comment); _browser = new QTextBrowser(this); _browser->setObjectName("_browser"); _browser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); _browser->setOpenLinks(false); main->addWidget(_browser); _newComment = new QPushButton(tr("New"), buttons, "_newComment"); buttonsLayout->addWidget(_newComment); _viewComment = new QPushButton(tr("View"), buttons, "_viewComment"); _viewComment->setEnabled(FALSE); buttonsLayout->addWidget(_viewComment); _editComment = new QPushButton(tr("Edit"), buttons, "_editComment"); _editComment->setEnabled(false); buttonsLayout->addWidget(_editComment); QSpacerItem *_buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); buttonsLayout->addItem(_buttonSpacer); buttons->setLayout(buttonsLayout); main->addWidget(buttons); setLayout(main); connect(_newComment, SIGNAL(clicked()), this, SLOT( sNew())); connect(_viewComment, SIGNAL(clicked()), this, SLOT( sView())); connect(_editComment, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_comment, SIGNAL(valid(bool)), this, SLOT(sCheckButtonPriv(bool))); connect(_comment, SIGNAL(itemSelected(int)), _viewComment, SLOT(animateClick())); connect(_browser, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); setFocusProxy(_comment); setVerboseCommentList(_verboseCommentList); }