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:
parent
fe0b03fdb7
commit
dbec199ea8
9
src/lib/3rdparty/lineedit.cpp
vendored
9
src/lib/3rdparty/lineedit.cpp
vendored
@ -25,9 +25,12 @@
|
|||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QFocusEvent>
|
#include <QFocusEvent>
|
||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
#include <QInputContext>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
|
#include <QInputContext>
|
||||||
|
#endif
|
||||||
|
|
||||||
SideWidget::SideWidget(QWidget* parent)
|
SideWidget::SideWidget(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
@ -106,7 +109,7 @@ bool LineEdit::event(QEvent* event)
|
|||||||
return QLineEdit::event(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
|
// Modified QLineEdit::createStandardContextMenu to support icons and PasteAndGo action
|
||||||
QMenu* LineEdit::createContextMenu(QAction* pasteAndGoAction)
|
QMenu* LineEdit::createContextMenu(QAction* pasteAndGoAction)
|
||||||
@ -166,7 +169,7 @@ QMenu* LineEdit::createContextMenu(QAction* pasteAndGoAction)
|
|||||||
action->setEnabled(!text().isEmpty() && selectedText() == text());
|
action->setEnabled(!text().isEmpty() && selectedText() == text());
|
||||||
connect(action, SIGNAL(triggered()), SLOT(selectAll()));
|
connect(action, SIGNAL(triggered()), SLOT(selectAll()));
|
||||||
|
|
||||||
#if !defined(QT_NO_IM)
|
#if !defined(QT_NO_IM) && QT_VERSION < 0x050000
|
||||||
QInputContext* qic = inputContext();
|
QInputContext* qic = inputContext();
|
||||||
if (qic) {
|
if (qic) {
|
||||||
QList<QAction*> imActions = qic->actions();
|
QList<QAction*> imActions = qic->actions();
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
|
#include <QStyleOptionFrameV3>
|
||||||
|
|
||||||
LocationBar::LocationBar(BrowserWindow* window)
|
LocationBar::LocationBar(BrowserWindow* window)
|
||||||
: LineEdit(window)
|
: LineEdit(window)
|
||||||
@ -580,6 +581,9 @@ void LocationBar::hideProgress()
|
|||||||
|
|
||||||
void LocationBar::paintEvent(QPaintEvent* event)
|
void LocationBar::paintEvent(QPaintEvent* event)
|
||||||
{
|
{
|
||||||
|
LineEdit::paintEvent(event);
|
||||||
|
|
||||||
|
// Show loading progress
|
||||||
if (qzSettings->showLoadingProgress && m_progressVisible) {
|
if (qzSettings->showLoadingProgress && m_progressVisible) {
|
||||||
QStyleOptionFrameV3 option;
|
QStyleOptionFrameV3 option;
|
||||||
initStyleOption(&option);
|
initStyleOption(&option);
|
||||||
@ -590,8 +594,6 @@ void LocationBar::paintEvent(QPaintEvent* event)
|
|||||||
QRect contentsRect = style()->subElementRect(QStyle::SE_LineEditContents, &option, this);
|
QRect contentsRect = style()->subElementRect(QStyle::SE_LineEditContents, &option, this);
|
||||||
contentsRect.adjust(lm, tm, -rm, -bm);
|
contentsRect.adjust(lm, tm, -rm, -bm);
|
||||||
|
|
||||||
LineEdit::paintEvent(event);
|
|
||||||
|
|
||||||
QColor bg = m_progressColor;
|
QColor bg = m_progressColor;
|
||||||
if (!bg.isValid() || bg.alpha() == 0) {
|
if (!bg.isValid() || bg.alpha() == 0) {
|
||||||
bg = Colors::mid(palette().color(QPalette::Base), palette().color(QPalette::Text), m_progressStyle > 0 ? 4 : 8, 1);
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LineEdit::paintEvent(event);
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user