Explorar o código

BUG: Fixed duplicate "Search" placeholder text in ctkSearchBox

CTK rendered placeholderText even when built with Qt versions >= 4.7, while in these Qt versions Qt rendered placeholder text already.
On hi-DPI screens with Qt5, Qt rendered placeholderText in a slightly shifted position, which made duplicate rendering of the placeholderText by CTK and Qt very visible.

Fixed it by correcting the Qt version check (CTK paints placeholderText only when Qt version < 4.7).
Andras Lasso %!s(int64=7) %!d(string=hai) anos
pai
achega
c78828ea4f
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      Libs/Widgets/ctkSearchBox.cpp

+ 1 - 5
Libs/Widgets/ctkSearchBox.cpp

@@ -226,15 +226,11 @@ void ctkSearchBox::paintEvent(QPaintEvent * event)
   QRect cRect = d->clearRect();
   QRect cRect = d->clearRect();
   QRect sRect = d->showSearchIcon ? d->searchRect() : QRect();
   QRect sRect = d->showSearchIcon ? d->searchRect() : QRect();
 
 
-#if QT_VERSION >= 0x040700
+#if QT_VERSION < 0x040700
   QRect r = rect();
   QRect r = rect();
   QPalette pal = palette();
   QPalette pal = palette();
 
 
-#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
   QStyleOptionFrameV2 panel;
   QStyleOptionFrameV2 panel;
-#else
-  QStyleOptionFrame panel;
-#endif
   initStyleOption(&panel);
   initStyleOption(&panel);
   r = this->style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
   r = this->style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
   r.setX(r.x() + this->textMargins().left());
   r.setX(r.x() + this->textMargins().left());