SelectionDialog::SelectionDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) , m_ui(new Ui::SelectionDialog()) , m_includeAmbiguous(false) , m_caseSensitive(false) , m_regExpValid(false) , m_selectNonVisible(false) { setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); m_ui->setupUi(this); // set default state slotCaseSensitive(false); slotSelectNonVisible(false); move(parent->window()->mapToGlobal(parent->window()->rect().center()) - mapToGlobal(rect().center())); // NOTE the connections are made in the UI file m_regExp.setPatternSyntax(QRegExp::WildcardUnix); }
void KTreeViewSearchLine::contextMenuEvent( QContextMenuEvent *event ) { QMenu *popup = KLineEdit::createStandardContextMenu(); popup->addSeparator(); QMenu *optionsSubMenu = popup->addMenu( i18n("Search Options") ); QAction* caseSensitiveAction = optionsSubMenu->addAction( i18nc("Enable case sensitive search in the side navigation panels", "Case Sensitive"), this, SLOT(slotCaseSensitive()) ); caseSensitiveAction->setCheckable( true ); caseSensitiveAction->setChecked( d->caseSensitive ); QAction* regularExpressionAction = optionsSubMenu->addAction( i18nc("Enable regular expression search in the side navigation panels", "Regular Expression"), this, SLOT(slotRegularExpression()) ); regularExpressionAction->setCheckable( true ); regularExpressionAction->setChecked( d->regularExpression ); popup->exec( event->globalPos() ); delete popup; }