1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Fixed building with Qt5

This commit is contained in:
nowrep 2014-03-16 13:55:37 +01:00
parent fe0b03fdb7
commit dbec199ea8
2 changed files with 10 additions and 9 deletions

View File

@ -25,9 +25,12 @@
#include <QClipboard>
#include <QFocusEvent>
#include <QStyleOption>
#include <QInputContext>
#include <QApplication>
#if QT_VERSION < 0x050000
#include <QInputContext>
#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<QAction*> imActions = qic->actions();

View File

@ -39,6 +39,7 @@
#include <QCompleter>
#include <QStringListModel>
#include <QContextMenuEvent>
#include <QStyleOptionFrameV3>
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);
}