[PC-BSD Commits] r21127 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Thu Jan 24 09:42:54 PST 2013


Author: kenmoore
Date: 2013-01-24 17:42:54 +0000 (Thu, 24 Jan 2013)
New Revision: 21127

Modified:
   pcbsd-projects/PCDM/loginWidget.cpp
   pcbsd-projects/PCDM/loginWidget.h
Log:
Change over the login widget to using QToolButtons instead of QPushButtons



Modified: pcbsd-projects/PCDM/loginWidget.cpp
===================================================================
--- pcbsd-projects/PCDM/loginWidget.cpp	2013-01-24 17:28:30 UTC (rev 21126)
+++ pcbsd-projects/PCDM/loginWidget.cpp	2013-01-24 17:42:54 UTC (rev 21127)
@@ -18,8 +18,10 @@
   //Create the items
   listUsers = new QComboBox;
   linePassword = new QLineEdit;
-  pushLogin = new QPushButton;
-  pushViewPassword = new QPushButton;
+  pushLogin = new QToolButton;
+	//pushLogin->setDefaultAction( new QAction() );
+  pushViewPassword = new QToolButton;
+	//pushViewPassword->setDefaultAction( new QAction() );
   displayIcon = new QLabel;
   //Add the items to the grid
   layout->addWidget(displayIcon,0,0);
@@ -149,8 +151,8 @@
 void LoginWidget::changeButtonIcon(QString button, QString iconFile){
   if(!QFile::exists(iconFile)){ qDebug() << "LoginWidget: invalid image file"<<iconFile; return; }
   if(button.toLower() == "display"){ displayIcon->setPixmap(QPixmap(iconFile)); }
-  else if(button.toLower() == "login"){ pushLogin->setIcon(QIcon(iconFile)); }
-  else if(button.toLower() == "pwview"){ pushViewPassword->setIcon(QIcon(iconFile)); }
+  else if(button.toLower() == "login"){ pushLogin->defaultAction()->setIcon(QIcon(iconFile)); }
+  else if(button.toLower() == "pwview"){ pushViewPassword->defaultAction()->setIcon(QIcon(iconFile)); }
   else{ 
     qDebug() << "LoginWidget: Cannot change the icon for button" << button << " - valid buttons are \"display\", \"login\", and \"pwview\""; 
   }

Modified: pcbsd-projects/PCDM/loginWidget.h
===================================================================
--- pcbsd-projects/PCDM/loginWidget.h	2013-01-24 17:28:30 UTC (rev 21126)
+++ pcbsd-projects/PCDM/loginWidget.h	2013-01-24 17:42:54 UTC (rev 21127)
@@ -8,6 +8,7 @@
 #include <QWidget>
 #include <QFile>
 #include <QPushButton>
+#include <QToolButton>
 #include <QGridLayout>
 #include <QPixmap>
 #include <QDebug>
@@ -15,6 +16,7 @@
 #include <QComboBox>
 #include <QLineEdit>
 #include <QKeyEvent>
+#include <QAction>
 
 class LoginWidget : public QWidget
 {
@@ -41,8 +43,8 @@
   private:
   	QComboBox* listUsers;
   	QLineEdit* linePassword;
-	QPushButton* pushLogin;
-	QPushButton* pushViewPassword;
+	QToolButton* pushLogin;
+	QToolButton* pushViewPassword;
 	QLabel* displayIcon;
 
 	QStringList idL;



More information about the Commits mailing list