//**************************************************** //* Constructor //**************************************************** TagEditorNewTag::TagEditorNewTag(QWidget *parent) : QLineEdit(parent) { QLOG_TRACE_IN() << typeid(*this).name(); account = 0; this->setCursor(Qt::PointingHandCursor); // Setup the note title editor QPalette pal; pal.setColor(backgroundRole(), QPalette::Base); setPalette(pal); this->setFont(global.getGuiFont(font())); inactiveColor = "QLineEdit {background-color: transparent; border-radius: 0px;} "; activeColor = "QLineEdit {border: 1px solid #808080; background-color: white; border-radius: 4px;} "; this->setStyleSheet(inactiveColor); this->setPlaceholderText(tr("Click to add tag...")); connect(this, SIGNAL(textChanged(QString)), this, SLOT(textModified(QString))); // connect(this, SIGNAL(focussed(bool)), this, SLOT(gainedFocus(bool))); completer = new QCompleter(this); connect(completer, SIGNAL(activated(QString)), this, SLOT(mouseCompleterSelection(QString))); loadCompleter(); connect(this, SIGNAL(returnPressed()), this, SLOT(enterPressed())); hide(); QLOG_TRACE_OUT() << typeid(*this).name(); }
//**************************************************** //* Constructor //**************************************************** TagEditorNewTag::TagEditorNewTag(QWidget *parent) : QLineEdit(parent) { account = 0; this->setCursor(Qt::PointingHandCursor); // Setup the note title editor QPalette pal; pal.setColor(backgroundRole(), QPalette::Base); setPalette(pal); QFont f = font(); f.setPointSize(8); setFont(f); inactiveColor = "QLineEdit {background-color: transparent; border-radius: 0px;} "; activeColor = "QLineEdit {border: 1px solid #808080; background-color: white; border-radius: 4px;} "; this->setStyleSheet(inactiveColor); defaultText = QString(tr("Click to add...")); connect(this, SIGNAL(textChanged(QString)), this, SLOT(textModified(QString))); this->textModified(defaultText); connect(this, SIGNAL(focussed(bool)), this, SLOT(gainedFocus(bool))); completer = NULL; loadCompleter(); hide(); }
void TagEditorNewTag::notebookSelectionChanged(qint32 notebook) { QLOG_TRACE_IN() << typeid(*this).name(); account = notebook; loadCompleter(); QLOG_TRACE_OUT() << typeid(*this).name(); }
//******************************************************* //* Add a new tag to the completer list //******************************************************* void TagEditorNewTag::addTag(QString s) { QLOG_TRACE_IN() << typeid(*this).name(); currentTags.append(s); loadCompleter(); QLOG_TRACE_OUT() << typeid(*this).name(); }
//******************************************************* //* Set the list of valid tags for the completer //******************************************************* void TagEditorNewTag::setTags(QStringList s) { QLOG_TRACE_IN() << typeid(*this).name(); currentTags = s; loadCompleter(); QLOG_TRACE_OUT() << typeid(*this).name(); }
void TagEditorNewTag::notebookSelectionChanged(qint32 notebook) { account = notebook; loadCompleter(); }
//******************************************************* //* Add a new tag to the completer list //******************************************************* void TagEditorNewTag::addTag(QString s) { currentTags.append(s); loadCompleter(); }
//******************************************************* //* Set the list of valid tags for the completer //******************************************************* void TagEditorNewTag::setTags(QStringList s) { currentTags = s; loadCompleter(); }