void LocationBar::setText(const QString &text) { m_oldTextLength = text.length(); m_currentTextLength = m_oldTextLength; LineEdit::setText(text); refreshTextFormat(); }
void LocationBar::focusOutEvent(QFocusEvent* event) { // Context menu or completer popup were opened // Let's block focusOutEvent to trick QLineEdit and paint cursor properly if (event->reason() == Qt::PopupFocusReason) { return; } LineEdit::focusOutEvent(event); setGoIconVisible(false); if (text().trimmed().isEmpty()) { clear(); } refreshTextFormat(); }
void LocationBar::focusOutEvent(QFocusEvent* event) { // Context menu or completer popup were opened // Let's block focusOutEvent to trick QLineEdit and paint cursor properly if (event->reason() == Qt::PopupFocusReason) { return; } LineEdit::focusOutEvent(event); setGoIconVisible(false); if (text().trimmed().isEmpty()) { clear(); } refreshTextFormat(); if (Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) { m_window->bookmarksToolbar()->hide(); } }
void LocationBar::showUrl(const QUrl &url) { if (hasFocus() || url.isEmpty()) { return; } const QString stringUrl = convertUrlToText(url); if (text() == stringUrl) { home(false); refreshTextFormat(); return; } // Set converted url as text setText(stringUrl); // Move cursor to the start home(false); m_bookmarkIcon->checkBookmark(url); }
void LocationBar::showEvent(QShowEvent* event) { LineEdit::showEvent(event); refreshTextFormat(); }
void LocationBar::setText(const QString &text) { LineEdit::setText(text); refreshTextFormat(); }