QLineEdit+icon+input text

QAction * pAction_Account = New QAction(ui.lineEdit_Account);

pAction_Account->setIcon(QIcon(":/ICON/user.png"));

ui.lineEdit_Account->addAction(pAction_Account,QLineEdit::LeadingPosition);

ui.lineEdit_Account->setFocus();

 

QAction *pAction_Pwd = new QAction(ui.lineEdit_Pwd);

pAction_pwd->setIcon(QIcon(":/ICON/passord.png"));

ui.lineEdit_Passord->addAction(pAction_pwd, QLineEdit::LeadingPosition);

 

setTabOrder(ui.lineEdit_Account, ui.lineEdit_Passord);

setTabOrder(ui.lineEdit_Passord,ui.pushButton_Login);

ui>pushButton_Close->setFocusPolicy(Qt::NoFocus):

ui>pushButton_Mini->setFocusPolicy(Qt::NoFocus):

 

 

 

你可能感兴趣的:(Qt工作中经验总结)