diff --git a/src/lib/3rdparty/lineedit.cpp b/src/lib/3rdparty/lineedit.cpp index e8278b44b..6d88ed0e5 100644 --- a/src/lib/3rdparty/lineedit.cpp +++ b/src/lib/3rdparty/lineedit.cpp @@ -25,9 +25,12 @@ #include #include #include -#include #include +#if QT_VERSION < 0x050000 +#include +#endif + SideWidget::SideWidget(QWidget* parent) : QWidget(parent) { @@ -106,7 +109,7 @@ bool LineEdit::event(QEvent* event) return QLineEdit::event(event); } -#define ACCEL_KEY(k) QLatin1Char('\t') + QString(QKeySequence(k)) +#define ACCEL_KEY(k) QLatin1Char('\t') + QKeySequence(k).toString() // Modified QLineEdit::createStandardContextMenu to support icons and PasteAndGo action QMenu* LineEdit::createContextMenu(QAction* pasteAndGoAction) @@ -166,7 +169,7 @@ QMenu* LineEdit::createContextMenu(QAction* pasteAndGoAction) action->setEnabled(!text().isEmpty() && selectedText() == text()); connect(action, SIGNAL(triggered()), SLOT(selectAll())); -#if !defined(QT_NO_IM) +#if !defined(QT_NO_IM) && QT_VERSION < 0x050000 QInputContext* qic = inputContext(); if (qic) { QList imActions = qic->actions(); diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index f711b3cd1..ae3f753c5 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -39,6 +39,7 @@ #include #include #include +#include LocationBar::LocationBar(BrowserWindow* window) : LineEdit(window) @@ -580,6 +581,9 @@ void LocationBar::hideProgress() void LocationBar::paintEvent(QPaintEvent* event) { + LineEdit::paintEvent(event); + + // Show loading progress if (qzSettings->showLoadingProgress && m_progressVisible) { QStyleOptionFrameV3 option; initStyleOption(&option); @@ -590,8 +594,6 @@ void LocationBar::paintEvent(QPaintEvent* event) QRect contentsRect = style()->subElementRect(QStyle::SE_LineEditContents, &option, this); contentsRect.adjust(lm, tm, -rm, -bm); - LineEdit::paintEvent(event); - QColor bg = m_progressColor; if (!bg.isValid() || bg.alpha() == 0) { bg = Colors::mid(palette().color(QPalette::Base), palette().color(QPalette::Text), m_progressStyle > 0 ? 4 : 8, 1); @@ -631,9 +633,5 @@ void LocationBar::paintEvent(QPaintEvent* event) default: break; } - - return; } - - LineEdit::paintEvent(event); }