[QGIS Commit] r9650 - trunk/qgis/src/gui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Nov 17 10:28:36 EST 2008


Author: wonder
Date: 2008-11-17 10:28:36 -0500 (Mon, 17 Nov 2008)
New Revision: 9650

Modified:
   trunk/qgis/src/gui/qgsdetaileditemdata.cpp
   trunk/qgis/src/gui/qgsdetaileditemdata.h
   trunk/qgis/src/gui/qgsdetaileditemdelegate.cpp
Log:
QgsDetailedItemData - support enabled/disabled states


Modified: trunk/qgis/src/gui/qgsdetaileditemdata.cpp
===================================================================
--- trunk/qgis/src/gui/qgsdetaileditemdata.cpp	2008-11-17 14:34:42 UTC (rev 9649)
+++ trunk/qgis/src/gui/qgsdetaileditemdata.cpp	2008-11-17 15:28:36 UTC (rev 9650)
@@ -20,6 +20,7 @@
 QgsDetailedItemData::QgsDetailedItemData()
 {
   mRenderAsWidgetFlag = false;
+  mEnabledFlag = true;
 }
 
 QgsDetailedItemData::~QgsDetailedItemData()
@@ -83,3 +84,12 @@
   return mRenderAsWidgetFlag;
 }
 
+void QgsDetailedItemData::setEnabled( bool theFlag )
+{
+  mEnabledFlag = theFlag;
+}
+
+bool QgsDetailedItemData::isEnabled() const
+{
+  return mEnabledFlag;
+}

Modified: trunk/qgis/src/gui/qgsdetaileditemdata.h
===================================================================
--- trunk/qgis/src/gui/qgsdetaileditemdata.h	2008-11-17 14:34:42 UTC (rev 9649)
+++ trunk/qgis/src/gui/qgsdetaileditemdata.h	2008-11-17 15:28:36 UTC (rev 9650)
@@ -37,6 +37,7 @@
     void setIcon( const QPixmap theIcon );
     void setCheckable( const bool theFlag );
     void setChecked( const bool theFlag );
+    void setEnabled( bool theFlag );
     /** This is a hint to the delegate to render using
      * a widget rather than manually painting every
      * part of the list item.
@@ -50,6 +51,7 @@
     QPixmap icon() const;
     bool isCheckable() const;
     bool isChecked() const;
+    bool isEnabled() const;
     bool isRenderedAsWidget() const;
 
   private:
@@ -59,6 +61,7 @@
     QPixmap mPixmap;
     bool mCheckableFlag;
     bool mCheckedFlag;
+    bool mEnabledFlag;
     bool mRenderAsWidgetFlag;
 };
 

Modified: trunk/qgis/src/gui/qgsdetaileditemdelegate.cpp
===================================================================
--- trunk/qgis/src/gui/qgsdetaileditemdelegate.cpp	2008-11-17 14:34:42 UTC (rev 9649)
+++ trunk/qgis/src/gui/qgsdetaileditemdelegate.cpp	2008-11-17 15:28:36 UTC (rev 9650)
@@ -102,6 +102,7 @@
   //
   //bool myCheckState = theIndex.model()->data(theIndex, Qt::CheckStateRole).toBool();
   mpCheckBox->setChecked( theData.isChecked() );
+  mpCheckBox->setEnabled( theData.isEnabled() );
   QPixmap myCbxPixmap( mpCheckBox->size() );
   mpCheckBox->render( &myCbxPixmap ); //we will draw this onto the widget further down
 



More information about the QGIS-commit mailing list