QLineEdit - wrong placeholderText's color on Linux Mint dark theme
-
Thank you @cristian-adam . Found something interesting. The
QPalette::Mid
was too much alike to edit background so I played with different types to get something close to GTK placeholder color. Finally did something stupid just for curiosity:int main(int argc, char *argv[]) { QApplication a(argc, argv); //QApplication::setStyle(new PhantomStyle); QPalette pal = QApplication::palette(); pal.setColor(QPalette::PlaceholderText, pal.color(QPalette::PlaceholderText)); QApplication::setPalette(pal); MainWindow w; w.show(); return a.exec(); }
And the result is:
What happened there? Palette don't have initialized color for
QPalette::PlaceholderText
color role? -
It looks like a bug. Please do open up a bug report at https://bugreports.qt.io
Hopefully the Qt Widgets maintainers have more ideas why this is happening. But now you have a workaround.
Does:
QPalette pal = QApplication::palette(); QApplication::setPalette(pal);
work? Or you have to explicitly set
QPalette::PlaceholderText
? -
-
You should check it with a recent Qt version first before creating a bug report
-
In your images above you use Qt5
-
Ok, then all is fine, create a bug report. Looks like a problem with the gtk platform plugin.
Maybe it's also related to https://bugreports.qt.io/browse/QTBUG-86195 -
Created ticket if someone come here with similar problem:
https://bugreports.qt.io/browse/QTBUG-136075 -
Ok, then all is fine, create a bug report. Looks like a problem with the gtk platform plugin.
Maybe it's also related to https://bugreports.qt.io/browse/QTBUG-86195@Christian-Ehrlicher said in QLineEdit - wrong placeholderText's color on Linux Mint dark theme:
Ok, then all is fine, create a bug report. Looks like a problem with the gtk platform plugin.
Maybe it's also related to https://bugreports.qt.io/browse/QTBUG-86195Weird, I searched first for placeholdertext keyword and didn't find anything. Anyway, that one is for Windows 10 reported in 2023
-
@Christian-Ehrlicher said in QLineEdit - wrong placeholderText's color on Linux Mint dark theme:
Ok, then all is fine, create a bug report. Looks like a problem with the gtk platform plugin.
Maybe it's also related to https://bugreports.qt.io/browse/QTBUG-86195Weird, I searched first for placeholdertext keyword and didn't find anything. Anyway, that one is for Windows 10 reported in 2023
@Kobid said in QLineEdit - wrong placeholderText's color on Linux Mint dark theme:
Anyway, that one is for Windows 10 reported in 2023
Please read the full bug report. It's also for linux.