svnno****@sourc*****
svnno****@sourc*****
2009年 7月 18日 (土) 16:54:35 JST
Revision: 2425 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2425 Author: nogu Date: 2009-07-18 16:54:35 +0900 (Sat, 18 Jul 2009) Log Message: ----------- add ThreadListHeaderView Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/boardview.h kita/branches/KITA-KDE4/kita/src/threadlistview.cpp Modified: kita/branches/KITA-KDE4/kita/src/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/CMakeLists.txt 2009-07-18 07:54:35 UTC (rev 2425) @@ -20,6 +20,7 @@ mainwindow.cpp respopup.cpp threadlistview.cpp + threadlistheaderview.cpp threadlistviewitem.cpp threadtabwidget.cpp threadview.cpp Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-18 07:54:35 UTC (rev 2425) @@ -460,49 +460,6 @@ // subjectList->restoreLayout(&config, "Layout"); TODO } -bool BoardView::eventFilter(QObject* watched, QEvent* e) -{ - if (e->type() == QEvent::MouseButtonPress) { - QMouseEvent * mouseEvent = static_cast<QMouseEvent *>(e); - if (mouseEvent->button() == Qt::RightButton) { - KMenu popup; - for (int i = ColumnBegin; i <= ColumnEnd; i++) { - if (i != ColumnSubject - && i != ColumnMarkOrder - && i != ColumnIdOrder) { - KAction* action = new KAction(s_colAttr[ i ].itemName, this); - action->setCheckable(true); - action->setChecked(subjectList->columnWidth(i) != 0); - action->setData(QVariant(i)); - popup.addAction(action); - } - } - KAction* autoResizeAct = new KAction(i18n("Auto Resize"), this); - autoResizeAct->setCheckable(true); - autoResizeAct->setChecked(autoResize()); - popup.addAction(autoResizeAct); - - QAction* action = popup.exec(mouseEvent->globalPos()); - if (!action) { - return true; - } - if (action == autoResizeAct) { - setAutoResize(!action->isChecked()); - } else if (action->isChecked()) { - hideColumn(action->data().toInt()); - } else { - showColumn(action->data().toInt()); - } - saveHeaderOnOff(); - return true; - } else { - return false; - } - } else { - return false;//subjectList->header() ->eventFilter(watched, e);//TODO - } -} - void BoardView::saveHeaderOnOff() { QString configPath Modified: kita/branches/KITA-KDE4/kita/src/boardview.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/boardview.h 2009-07-18 07:54:35 UTC (rev 2425) @@ -57,7 +57,6 @@ void loadLayout(); void updateListViewItem(QTableWidgetItem* item, const KUrl& datURL, const QDateTime& current, int id, int order); - bool eventFilter(QObject* watched, QEvent* e); void saveHeaderOnOff(); void loadHeaderOnOff(); bool autoResize(); Modified: kita/branches/KITA-KDE4/kita/src/threadlistview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 07:11:43 UTC (rev 2424) +++ kita/branches/KITA-KDE4/kita/src/threadlistview.cpp 2009-07-18 07:54:35 UTC (rev 2425) @@ -14,6 +14,7 @@ #include <kurl.h> +#include "threadlistheaderview.h" #include "threadlistviewitem.h" #include "viewmediator.h" #include "libkita/kita_misc.h" @@ -47,8 +48,11 @@ ReloadButton->setIcon(SmallIcon("view-refresh")); closeButton->setIcon(SmallIcon("tab-close")); + ThreadListHeaderView* header = new ThreadListHeaderView; + subjectList->setColumnCount(ColumnEnd - ColumnBegin + 1); subjectList->setContextMenuPolicy(Qt::CustomContextMenu); + subjectList->setHorizontalHeader(header); subjectList->setShowGrid(false); subjectList->setSortingEnabled(true); subjectList->verticalHeader()->setVisible(false);