Created
August 7, 2018 08:41
-
-
Save hualet/049b490e0fa5f9dc784bb279089314c4 to your computer and use it in GitHub Desktop.
Use case example for https://codereview.qt-project.org/#/c/236219/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QApplication> | |
#include <QWidget> | |
#include <QLineEdit> | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
QWidget w; | |
w.setStyleSheet("background: grey"); | |
w.setFixedSize(200, 200); | |
QLineEdit edit(&w); | |
edit.setEchoMode(QLineEdit::Password); | |
edit.move(w.rect().center() - edit.rect().center()); | |
edit.setStyleSheet("background: rgba(255, 255, 255, 0.2); color: white; border: none"); | |
w.show(); | |
return a.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment