File indexing completed on 2023-05-30 10:42:09
0001 /* 0002 This file is part of Kiten, a KDE Japanese Reference Tool... 0003 SPDX-FileCopyrightText: 2001 Jason Katz-Brown <jason@katzbrown.com> 0004 SPDX-FileCopyrightText: 2005 Paul Temple <paul.temple@gmx.net> 0005 SPDX-FileCopyrightText: 2006 Joseph Kerian <jkerian@gmail.com> 0006 SPDX-FileCopyrightText: 2006 Eric Kjeldergaard <kjelderg@gmail.com> 0007 0008 SPDX-License-Identifier: GPL-2.0-or-later 0009 */ 0010 0011 #include "entrylistview.h" 0012 0013 #include <QHeaderView> 0014 0015 // These are the ratios for how much space the word and reading headers should 0016 // take. The meaning will always stretch and take up the remaining space. 0017 #define WORDRATIO 0.2 0018 #define READINGRATIO 0.2 0019 0020 EntryListView::EntryListView(QWidget *parent) 0021 : QTableView(parent) 0022 { 0023 horizontalHeader()->setStretchLastSection(true); 0024 } 0025 0026 void EntryListView::resizeEvent(QResizeEvent *event) 0027 { 0028 Q_UNUSED(event); 0029 QHeaderView *header = horizontalHeader(); 0030 header->resizeSection(0, float(width()) * WORDRATIO); 0031 header->resizeSection(1, float(width()) * READINGRATIO); 0032 } 0033 0034 void EntryListView::setEmptyModel() 0035 { 0036 // TODO: implement me 0037 }