summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-09-13 10:26:03 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-09-13 10:46:16 (GMT)
commit06dc8791a70329dc8e985a0eed7e434d1f762ec5 (patch)
treef3a9f55307207088676d4c48ec67ec418fa56053 /src/gui/widgets
parent59a2ff150795e1281e6b4fea435e74d3434a5ad2 (diff)
parent31cc0b1820c0c8fdfdbc3d5b804f2dba2051c96f (diff)
downloadQt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.zip
Qt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.tar.gz
Qt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.tar.bz2
Merge remote branch 'qt/master' into lighthouse-master
Conflicts: configure src/corelib/global/qglobal.h src/corelib/tools/qsimd.cpp
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qcombobox.cpp3
-rw-r--r--src/gui/widgets/qdatetimeedit.cpp18
-rw-r--r--src/gui/widgets/qlinecontrol.cpp4
-rw-r--r--src/gui/widgets/qlineedit.cpp4
-rw-r--r--src/gui/widgets/qtoolbutton.cpp3
5 files changed, 10 insertions, 22 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 487d244..21dd127 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2857,7 +2857,8 @@ void QComboBox::mousePressEvent(QMouseEvent *e)
if (sc == QStyle::SC_ComboBoxArrow)
d->updateArrow(QStyle::State_Sunken);
#ifdef QT_KEYPAD_NAVIGATION
- if (!d->lineEdit) {
+ //if the container already exists, then d->viewContainer() is safe to call
+ if (d->container) {
#endif
// We've restricted the next couple of lines, because by not calling
// viewContainer(), we avoid creating the QComboBoxPrivateContainer.
diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp
index 3bc6412..36a3147 100644
--- a/src/gui/widgets/qdatetimeedit.cpp
+++ b/src/gui/widgets/qdatetimeedit.cpp
@@ -248,7 +248,7 @@ void QDateTimeEdit::setDateTime(const QDateTime &datetime)
/*!
\property QDateTimeEdit::date
- \brief the QDate that is set in the QDateTimeEdit
+ \brief the QDate that is set in the widget
By default, this property contains a date that refers to January 1, 2000.
@@ -279,7 +279,7 @@ void QDateTimeEdit::setDate(const QDate &date)
/*!
\property QDateTimeEdit::time
- \brief the QTime that is set in the QDateTimeEdit
+ \brief the QTime that is set in the widget
By default, this property contains a time of 00:00:00 and 0 milliseconds.
@@ -1561,13 +1561,6 @@ QTimeEdit::QTimeEdit(const QTime &time, QWidget *parent)
{
}
-/*!
- \property QTimeEdit::time
- \brief the QTime that is shown in the widget
-
- By default, this property contains a time of 00:00:00 and 0 milliseconds.
-*/
-
/*!
\class QDateEdit
@@ -1622,13 +1615,6 @@ QDateEdit::QDateEdit(const QDate &date, QWidget *parent)
{
}
-/*!
- \property QDateEdit::date
- \brief the QDate that is shown in the widget
-
- By default, this property contains a date referring to January 1, 2000.
-*/
-
// --- QDateTimeEditPrivate ---
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 6ed621b..f742d32 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -419,7 +419,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
int c = m_cursor; // cursor position after insertion of commit string
- if (event->replacementStart() == 0)
+ if (event->replacementStart() <= 0)
c += event->commitString().length() + qMin(-event->replacementStart(), event->replacementLength());
m_cursor += event->replacementStart();
@@ -527,7 +527,7 @@ void QLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &cl
int cursor = m_cursor;
if (m_preeditCursor != -1)
cursor += m_preeditCursor;
- if(!m_blinkPeriod || m_blinkStatus)
+ if (!m_hideCursor && (!m_blinkPeriod || m_blinkStatus))
m_textLayout.drawCursor(painter, offset, cursor, m_cursorWidth);
}
}
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 981e934..caaef68 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1929,7 +1929,11 @@ void QLineEdit::paintEvent(QPaintEvent *)
// text doesn't fit, text document is to the left of lineRect; align
// right
d->hscroll = widthUsed - lineRect.width() + 1;
+ } else {
+ //in case the text is bigger than the lineedit, the hscroll can never be negative
+ d->hscroll = qMax(0, d->hscroll);
}
+
// the y offset is there to keep the baseline constant in case we have script changes in the text.
QPoint topLeft = lineRect.topLeft() - QPoint(d->hscroll, d->control->ascent() - fm.ascent());
diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp
index 1822db8..c18f660 100644
--- a/src/gui/widgets/qtoolbutton.cpp
+++ b/src/gui/widgets/qtoolbutton.cpp
@@ -394,9 +394,6 @@ void QToolButton::initStyleOption(QStyleOptionToolButton *option) const
option->toolButtonStyle = Qt::ToolButtonTextOnly;
else if (option->toolButtonStyle != Qt::ToolButtonTextOnly)
option->toolButtonStyle = Qt::ToolButtonIconOnly;
- } else {
- if (d->text.isEmpty() && option->toolButtonStyle != Qt::ToolButtonIconOnly)
- option->toolButtonStyle = Qt::ToolButtonIconOnly;
}
option->pos = pos();