Skip to content

Instantly share code, notes, and snippets.

@hualet
Created August 7, 2018 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hualet/049b490e0fa5f9dc784bb279089314c4 to your computer and use it in GitHub Desktop.
Save hualet/049b490e0fa5f9dc784bb279089314c4 to your computer and use it in GitHub Desktop.
#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