Esempio n. 1
0
//****************************************************
//* 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();
}
Esempio n. 2
0
//****************************************************
//* 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();
}
Esempio n. 3
0
void TagEditorNewTag::notebookSelectionChanged(qint32 notebook) {
    QLOG_TRACE_IN() << typeid(*this).name();
    account = notebook;
    loadCompleter();
    QLOG_TRACE_OUT() << typeid(*this).name();
}
Esempio n. 4
0
//*******************************************************
//* 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();
}
Esempio n. 5
0
//*******************************************************
//* 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();
}
Esempio n. 6
0
void TagEditorNewTag::notebookSelectionChanged(qint32 notebook) {
    account = notebook;
    loadCompleter();
}
Esempio n. 7
0
//*******************************************************
//* Add a new tag to the completer list
//*******************************************************
void TagEditorNewTag::addTag(QString s) {
    currentTags.append(s);
    loadCompleter();
}
Esempio n. 8
0
//*******************************************************
//* Set the list of valid tags for the completer
//*******************************************************
void TagEditorNewTag::setTags(QStringList s) {
    currentTags = s;
    loadCompleter();
}