Quote Originally Posted by d_stranz View Post
Because you are using a dark mode, I can't really see what the boundaries of your line edit are. Try adding a 1px white border to your style sheet so you can tell what is actually happening.

Qt Code:
  1. QLineEdit { border: 1px solid white }
To copy to clipboard, switch view to plain text mode 
Sure - to recap, the code now looks like this:
Qt Code:
  1. MainWindow::MainWindow(CoreDictionary const& dict)
  2. : QMainWindow(nullptr), dict{ dict }
  3. {
  4. ui.setupUi(this);
  5. ui.searchField->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
  6. ui.searchField->setText(QString("Type something here!"));
  7. ui.searchField->setTextMargins(QMargins(0, 0, 0, 6));
  8. ui.searchField->setStyleSheet("QLineEdit { padding: 0px 0px 0px 0px; border: 1px solid white;}");
  9. }
To copy to clipboard, switch view to plain text mode 

And the result is this (side by side the version with bottom margin 0 and bottom margin 6):
Attachment 13851

Also a thing worth noticing is that the "g" bottom part is being clipped when the bottom margin is raised (right picture), with and without Qt::AlignVCenter which is another thing I find strange, because one would think the text has still room to be moved upward without clipping - but probably that issue is besides the point because probably I don't need to be messing with the margin to begin with (although I have no idea)