Beispiel #1
0
SearchToolBar::SearchToolBar(QupZilla* mainClass, QWidget* parent)
    : AnimatedWidget(AnimatedWidget::Up, 300, parent)
    , ui(new Ui::SearchToolbar)
    , p_QupZilla(mainClass)
    , m_findFlags(0)
{
    setAttribute(Qt::WA_DeleteOnClose);
    ui->setupUi(widget());
    ui->closeButton->setIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton));

    ui->next->setIcon(IconProvider::standardIcon(QStyle::SP_ArrowForward));

    ui->previous->setIcon(IconProvider::standardIcon(QStyle::SP_ArrowBack));

    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(hide()));
    connect(ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(findNext()));
    connect(ui->next, SIGNAL(clicked()), this, SLOT(findNext()));
    connect(ui->previous, SIGNAL(clicked()), this, SLOT(findPrevious()));
    connect(ui->highligh, SIGNAL(clicked()), this, SLOT(highlightChanged()));
    connect(ui->caseSensitive, SIGNAL(clicked()), this, SLOT(caseSensitivityChanged()));
    startAnimation();

    QShortcut* findNextAction = new QShortcut(QKeySequence("F3"), this);
    connect(findNextAction, SIGNAL(activated()), this, SLOT(findNext()));

    QShortcut* findPreviousAction = new QShortcut(QKeySequence("Shift+F3"), this);
    connect(findPreviousAction, SIGNAL(activated()), this, SLOT(findPrevious()));

    p_QupZilla->actionStop()->setEnabled(false);
    qApp->installEventFilter(this);
}
void RegExpRole::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
{
    if (this->caseSensitivity() == caseSensitivity)
        return;

    m_regularExpression.setPatternOptions(m_regularExpression.patternOptions() ^ QRegularExpression::CaseInsensitiveOption); //toggle the option
    Q_EMIT caseSensitivityChanged();
}
void LinkBackFilter::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
{
  if (caseSensitivity != m_caseSensitivity)
  {
    m_caseSensitivity = caseSensitivity;
    for (int i=0; i<m_expressions->size(); ++i)
    {
      m_expressions->at(i)->setCaseSensitivity(m_caseSensitivity);
    }
    emit caseSensitivityChanged(caseSensitivity);
  }
}