[rkward] rkward/misc: Some cleanups

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Nov 4 14:31:59 UTC 2015


Git commit dd48c270c76db92f49d92891028c320aa7e3ba6a by Thomas Friedrichsmeier.
Committed on 04/11/2015 at 13:47.
Pushed by tfry into branch 'master'.

Some cleanups

M  +3    -20   rkward/misc/rkaccordiontable.cpp

http://commits.kde.org/rkward/dd48c270c76db92f49d92891028c320aa7e3ba6a

diff --git a/rkward/misc/rkaccordiontable.cpp b/rkward/misc/rkaccordiontable.cpp
index 9c3691e..c71afdd 100644
--- a/rkward/misc/rkaccordiontable.cpp
+++ b/rkward/misc/rkaccordiontable.cpp
@@ -184,7 +184,6 @@ public slots:
 		emit (dataChanged (mapFromSource (from), mapFromSource (to)));
 	}
 	void r_layoutChanged () {
- 		RK_DEBUG (MISC, DL_ERROR, "reset");
 		emit (layoutChanged());
 	}
 };
@@ -235,11 +234,7 @@ public:
 				RK_ASSERT (false);
 				return;
 			}
-			if (table->isExpanded (index)) {
-				v4->icon = expanded;
-			} else {
-				v4->icon = collapsed;
-			}
+			v4->icon = table->isExpanded (index) ? expanded : collapsed;
 			v4->features |= QStyleOptionViewItemV2::HasDecoration;
 		}
 	}
@@ -277,15 +272,12 @@ RKAccordionTable::RKAccordionTable (QWidget* parent) : QTreeView (parent) {
 	setExpandsOnDoubleClick (false);   // we expand on single click, instead
 	setItemsExpandable (false);        // custom handling
 	setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-	setViewportMargins (20, 0, 0, 0);
-/*	QPalette pal = palette ();
-	pal.setBrush (QPalette::Highlight, pal.window ());
-	pal.setBrush (QPalette::HighlightedText, pal.windowText ());
-	setPalette (pal); */
+
 	pmodel = new RKAccordionDummyModel (0);
 	RKAccordionDelegate* delegate = new RKAccordionDelegate (this);
 	delegate->pmodel = pmodel;
 	setItemDelegateForColumn (0, delegate);
+
 	connect (this, SIGNAL (expanded(QModelIndex)), this, SLOT (rowExpanded(QModelIndex)));
 	connect (this, SIGNAL (clicked(QModelIndex)), this, SLOT (rowClicked(QModelIndex)));
 }
@@ -308,7 +300,6 @@ void RKAccordionTable::drawRow (QPainter* painter, const QStyleOptionViewItem& o
 	} else {
 		QTreeView::drawRow (painter, option, index);
 		if (isExpanded (index)) {
-//		if (index.row () != 0) {
 			painter->drawLine (option.rect.topLeft (), option.rect.topRight ());
 		}
 	}
@@ -521,14 +512,6 @@ void RKAccordionTable::setModel (QAbstractItemModel* model) {
 	updateGeometry ();   // TODO: Not so clean to call this, here. But at this point we know the display_widget has been constructed, too
 }
 
-
-// TODO
-// - index column, RKOptionSet::display_show_index
-// - expand / collapse indicator?
-// - drag-reordering?
-//   - will this make per-item add buttons obsolete?
-// - improve scrolling behavior
-
 // KF5 TODO: remove:
 #include "rkaccordiontable.moc"
 #include "rkaccordiontablemodel_moc.cpp"



More information about the rkward-tracker mailing list