[rkward-cvs] SF.net SVN: rkward:[3441] trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Feb 16 12:46:15 UTC 2011


Revision: 3441
          http://rkward.svn.sourceforge.net/rkward/?rev=3441&view=rev
Author:   tfry
Date:     2011-02-16 12:46:14 +0000 (Wed, 16 Feb 2011)

Log Message:
-----------
Add some tooltips and show column nubmers

Modified Paths:
--------------
    trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp

Modified: trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp
===================================================================
--- trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp	2011-02-16 12:28:03 UTC (rev 3440)
+++ trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp	2011-02-16 12:46:14 UTC (rev 3441)
@@ -21,6 +21,7 @@
 
 #include <QColor>
 #include <QTimer>
+#include <QFont>
 
 #include "../core/rcontainerobject.h"
 #include "../core/rkmodificationtracker.h"
@@ -364,7 +365,8 @@
 
 	if (orientation == Qt::Horizontal) {
 		if (section >= objects.size ()) return i18n ("#New Variable#");
-		return objects[section]->getShortName ();
+		if (section < var_col_offset) return i18n ("Row names");
+		return (QString::number (section - var_col_offset + 1));
 	}
 
 	if (section < rownames->getLength ()) {
@@ -554,6 +556,12 @@
 		if (row == LevelsRow) return var->getValueLabelString ();
 	}
 
+	if ((role == Qt::FontRole) && (row == NameRow)) {
+		QFont font;
+		font.setBold (true);
+		return (font);
+	}
+
 	return QVariant ();
 }
 
@@ -662,6 +670,13 @@
 		if (section == FormatRow) return (i18n ("Format"));
 		if (section == LevelsRow) return (i18n ("Levels"));
 	}
+	if (role == Qt::ToolTipRole) {
+		if (section == NameRow) return (i18n ("Edit these fields to rename variables."));
+		if (section == LabelRow) return (i18n ("A descriptive label for each column (optional)."));
+		if (section == TypeRow) return (i18n ("Type of data."));
+		if (section == FormatRow) return (i18n ("Double click on these fields to customize data display."));
+		if (section == LevelsRow) return (i18n ("Double click on these fields to edit factor levels."));
+	}
 
 	return QVariant ();
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list