Hi guys,
I need to make a login GUI in Houdini so that users can input their usename and password to log into our internal server to download assets for editing. The username control is easy but the password one is hard in that it needs to mask the input, e.g. with ‘*’. Is there any way to make this happen? Thanks for any inputs!
I'm working on Houdini 16.5 and our plugin needs to know the login status, so it's better that the suggested way can communicate the status between C++ code.
Thanks,
Quan
How to make a password control in Houdini?
1823 6 0- quchen
- Member
- 75 posts
- Joined: Oct. 2018
- Offline
- quchen
- Member
- 75 posts
- Joined: Oct. 2018
- Offline
I also tried to get the password control and then addInterest to its VALUE CHANGE event, by following the doc here:
https://www.sidefx.com/docs/hdk/_h_d_k__u_i_native.html#HDK_UINative_Glue_GetGadget [www.sidefx.com]
But the problem is that, in my Houdini 16.5 Core installation, I couldn't find the actual definition of UI_Feel. Any thoughts?
https://www.sidefx.com/docs/hdk/_h_d_k__u_i_native.html#HDK_UINative_Glue_GetGadget [www.sidefx.com]
But the problem is that, in my Houdini 16.5 Core installation, I couldn't find the actual definition of UI_Feel. Any thoughts?
Edited by quchen - March 18, 2019 04:46:44
- quchen
- Member
- 75 posts
- Joined: Oct. 2018
- Offline
- quchen
- Member
- 75 posts
- Joined: Oct. 2018
- Offline
Although I could get the UI_Feel object of the password control by doing this in the .ui file and corresponding .c file:
in .ui
password.gad = STRING_FIELD “Password”:LABEL_WIDTH VALUE(password.val) HSTRETCH;
in .c:
myPasswordGad = getFeelSymbol(“password.gad”);
But the problem is that I couldn't register a value change event for it as UI_Feel is not derived from the UI_Object:
//myPasswordVal.addInterest(myPasswordGad, CHANGECB(passwordValChanged)); ==> this won't compile.
So the new question is: how can I register a callback to handle the value change event of an edit control?
in .ui
password.gad = STRING_FIELD “Password”:LABEL_WIDTH VALUE(password.val) HSTRETCH;
in .c:
myPasswordGad = getFeelSymbol(“password.gad”);
But the problem is that I couldn't register a value change event for it as UI_Feel is not derived from the UI_Object:
//myPasswordVal.addInterest(myPasswordGad, CHANGECB(passwordValChanged)); ==> this won't compile.
So the new question is: how can I register a callback to handle the value change event of an edit control?
- goldfarb
- Staff
- 3455 posts
- Joined: July 2005
- Offline
- mabelzile
- Staff
- 396 posts
- Joined: Feb. 2018
- Offline
Hi,
Following Michael's suggestion, here's a little demo for implementing a tool password dialog with python
Following Michael's suggestion, here's a little demo for implementing a tool password dialog with python
import hou from PySide2 import QtWidgets from PySide2.QtWidgets import QApplication, QDialog, QLineEdit, QPushButton class PasswordDialog(QDialog): def __init__(self, parent=None): super(Form, self).__init__(parent) self.setWindowTitle("Type a password") pw = QtWidgets.QLineEdit() pw.setEchoMode(QtWidgets.QLineEdit.Password) vlayout = QtWidgets.QVBoxLayout() vlayout.addWidget(pw) self.setLayout(vlayout) pwd= PasswordDialog(hou.ui.mainQtWindow()) pwd.show()
- quchen
- Member
- 75 posts
- Joined: Oct. 2018
- Offline
-
- Quick Links