// TableBody: the table body, scrollable in all ways TableBody::TableBody(HeadedTable *parent) : QtTableView(parent), htable(parent) { // setTableFlags(Tbl_autoScrollBars | Tbl_smoothScrolling); setTableFlags(Tbl_snapToVGrid); // works setTableFlags(Tbl_hScrollBar | Tbl_vScrollBar); first_drag_row = prev_drag_row = -1; autoscrolling = false; gadget_click = false; setMouseTracking(true); QStyle *s = QStyleFactory::create("windows"); if (s) setStyle(s); }
DiffView::DiffView( KConfig& cfg, bool withlinenos, bool withmarker, QWidget *parent, const char *name ) : QtTableView(parent, name, Qt::WNoAutoErase) , linenos(withlinenos) , marker(withmarker) , textwidth(0) , partner(0) , partConfig(cfg) { setNumRows(0); setNumCols( 1 + (withlinenos?1:0) + (withmarker?1:0) ); setTableFlags( Tbl_autoVScrollBar|Tbl_autoHScrollBar| Tbl_smoothVScrolling ); setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); setBackgroundRole( QPalette::Base ); configChanged(); QFontMetrics fm(font()); setCellHeight(fm.lineSpacing()); setCellWidth(0); const KConfigGroup group(&partConfig, "General"); m_tabWidth = group.readEntry("TabWidth", 8); items.setAutoDelete(true); connect(CervisiaSettings::self(), SIGNAL(configChanged()), this, SLOT(configChanged())); }
FingerList::FingerList(TabTrack *p, QWidget *parent, const char *name): #if QT_VERSION < 300 QTableView(parent, name) #else QGridView(parent, name) #endif { parm = p; #if QT_VERSION < 300 setTableFlags(Tbl_autoVScrollBar | Tbl_smoothScrolling); #else setVScrollBarMode(QScrollView::Auto); #endif setFrameStyle(Panel | Sunken); setBackgroundMode(PaletteBase); setFocusPolicy(StrongFocus); num = 0; curSel = -1; oldCol = 0; oldRow = 0; setCellWidth(ICONCHORD); setCellHeight(ICONCHORD); setMinimumSize(ICONCHORD + 2, ICONCHORD + 2); resize(width(), 3 * ICONCHORD + 2); repaint(); }
// TableHead: the horizontally scrollable table head TableHead::TableHead(HeadedTable *parent) : QtTableView(parent), htable(parent), dragging(false) { setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); // setSizePolicy(QSizePolicy // (QSizePolicy::Minimum,QSizePolicy::Expanding)); // setTableFlags(Tbl_smoothHScrolling | Tbl_scrollLastHCell); setTableFlags(Tbl_scrollLastHCell); // ? setNumRows(1); setMouseTracking(true); // for tooltip floatHead = new FloatingHead(parent); // tiny memory leak! don't care. floatHead->hide(); // setMinimumHeight(20);//cellHeight()); //ZERO!! fault }
KFinderWin::KFinderWin( KFinder *_finder ) : QTableView( _finder ) { node = 0L; itemList.setAutoDelete( FALSE ); finder = _finder; setNumCols( finder->buttonList.count()!=0 ? finder->buttonList.count() : 1 ); setNumRows( 0 ); setCellHeight( CELL_HEIGHT ); setTableFlags( Tbl_autoScrollBars | /* Tbl_clipCellPainting | */ Tbl_smoothScrolling ); dropZone = new KDNDDropZone( this , DndURL ); connect( dropZone, SIGNAL( dropAction( KDNDDropZone *) ), this, SLOT( slotDropEvent( KDNDDropZone *) ) ); }
MarkListTable::MarkListTable( QWidget * parent , const char * name ) : QTableView( parent, name ), sel(-1), drag(-1), items() { setFrameStyle( Panel | Sunken ); setTableFlags( Tbl_autoVScrollBar | Tbl_cutCellsV | Tbl_snapToVGrid | Tbl_clipCellPainting); setLineWidth( 1 ); setCellHeight( fontMetrics().lineSpacing()+4 ); setNumCols( 2 ); // setBackgroundColor( colorGroup().normal().light(120) ); pup = new QPopupMenu(0, "pup"); pup->insertItem( i18n("Mark current page"), this, SLOT(markSelected()) ); pup->insertItem( i18n("Mark all pages"), this, SLOT(markAll()) ); pup->insertItem( i18n("Mark even pages"), this, SLOT(markEven()) ); pup->insertItem( i18n("Mark odd pages"), this, SLOT(markOdd()) ); pup->insertItem( i18n("Toggle page marks"), this, SLOT(toggleMarks()) ); pup->insertItem( i18n("Remove page marks"), this, SLOT(removeMarks()) ); // items.setAutoDelete( TRUE ); selectColor = QColor( black ); selectTextColor = QColor( white ); }
TodoView::TodoView(CalObject *cal, QWidget *parent, const char *name) : KTabListBox(parent, name, 5) { calendar = cal; // set up filter for events lbox.installEventFilter(this); // set up the widget to have 4 columns (one hidden), and // only a vertical scrollbar clearTableFlags(Tbl_hScrollBar); clearTableFlags(Tbl_autoHScrollBar); // BL: autoscrollbar in not working... setTableFlags(Tbl_hScrollBar); setAutoUpdate(TRUE); adjustColumns(); // insert pictures for use to show a checked/not checked todo dict().insert("CHECKED", new QPixmap(Icon("checkedbox.xpm"))); dict().insert("EMPTY", new QPixmap(Icon("emptybox.xpm"))); dict().insert("CHECKEDMASK", new QPixmap(Icon("checkedbox-mask.xpm"))); dict().insert("EMPTYMASK", new QPixmap(Icon("emptybox-mask.xpm"))); // this is the thing that lets you edit the todo text. editor = new QLineEdit(this); editor->hide(); connect(editor, SIGNAL(returnPressed()), this, SLOT(updateSummary())); connect(editor, SIGNAL(returnPressed()), editor, SLOT(hide())); connect(editor, SIGNAL(textChanged(const char *)), this, SLOT(changeSummary(const char *))); connect(this, SIGNAL(selected(int, int)), this, SLOT(updateItem(int, int))); connect(this, SIGNAL(highlighted(int, int)), this, SLOT(hiliteAction(int, int))); priList = new QListBox(this); priList->hide(); priList->insertItem("1"); priList->insertItem("2"); priList->insertItem("3"); priList->insertItem("4"); priList->insertItem("5"); priList->setFixedHeight(priList->itemHeight()*5+5); priList->setFixedWidth(priList->maxItemWidth()+5); connect(priList, SIGNAL(highlighted(int)), priList, SLOT(hide())); connect(priList, SIGNAL(highlighted(int)), this, SLOT(changePriority(int))); QPixmap pixmap; rmbMenu1 = new QPopupMenu; pixmap = Icon("checkedbox.xpm"); rmbMenu1->insertItem(pixmap, i18n("New Todo"), this, SLOT(newTodo())); pixmap = Icon("delete.xpm"); rmbMenu1->insertItem(pixmap, i18n("Purge Completed "), this, SLOT(purgeCompleted())); rmbMenu2 = new QPopupMenu; pixmap = Icon("checkedbox.xpm"); rmbMenu2->insertItem(pixmap, i18n("New Todo"), this, SLOT (newTodo())); rmbMenu2->insertItem(i18n("Edit Todo"), this, SLOT (editTodo())); pixmap = Icon("delete.xpm"); rmbMenu2->insertItem(pixmap, i18n("Delete Todo"), this, SLOT (deleteTodo())); rmbMenu2->insertItem(i18n("Purge Completed "), this, SLOT(purgeCompleted())); editingFlag = FALSE; connect(this, SIGNAL(headerClicked(int)), this, SLOT(headerAction(int))); updateConfig(); prevRow = updatingRow = -1; }