Get rid of setSectionResizeMode helper functions.

This commit is contained in:
Jean-Marc Lasgouttes 2022-11-19 15:04:38 +01:00
parent 11369131ee
commit a3327f576c
5 changed files with 7 additions and 25 deletions

View File

@ -455,8 +455,8 @@ void GuiCompleter::asyncUpdatePopup()
// has a bad memory about it and we have to tell him again and again.
QTreeView * listView = static_cast<QTreeView *>(popup());
listView->header()->setStretchLastSection(false);
setSectionResizeMode(listView->header(), 0, QHeaderView::Stretch);
setSectionResizeMode(listView->header(), 1, QHeaderView::Fixed);
listView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
listView->header()->setSectionResizeMode(1, QHeaderView::Fixed);
listView->header()->resizeSection(1, 22);
// show/update popup

View File

@ -1351,7 +1351,7 @@ GuiDocument::GuiDocument(GuiView & lv)
numberingModule->tocTW->headerItem()->setText(0, qt_("Example"));
numberingModule->tocTW->headerItem()->setText(1, qt_("Numbered"));
numberingModule->tocTW->headerItem()->setText(2, qt_("Appears in TOC"));
setSectionResizeMode(numberingModule->tocTW->header(), QHeaderView::ResizeToContents);
numberingModule->tocTW->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
connect(numberingModule->linenoCB, SIGNAL(toggled(bool)),
this, SLOT(linenoToggled(bool)));
connect(numberingModule->linenoCB, SIGNAL(clicked()),
@ -1441,7 +1441,7 @@ GuiDocument::GuiDocument(GuiView & lv)
headers << qt_("Package") << qt_("Load automatically")
<< qt_("Load always") << qt_("Do not load");
mathsModule->packagesTW->setHorizontalHeaderLabels(headers);
setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), QHeaderView::Stretch);
mathsModule->packagesTW->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
map<string, string> const & packages = BufferParams::auto_packages();
mathsModule->packagesTW->setRowCount(packages.size());
int packnum = 0;
@ -1644,10 +1644,10 @@ GuiDocument::GuiDocument(GuiView & lv)
// Modules
modulesModule = new UiWidget<Ui::ModulesUi>(this);
modulesModule->availableLV->header()->setVisible(false);
setSectionResizeMode(modulesModule->availableLV->header(), QHeaderView::ResizeToContents);
modulesModule->availableLV->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
modulesModule->availableLV->header()->setStretchLastSection(false);
modulesModule->selectedLV->header()->setVisible(false);
setSectionResizeMode(modulesModule->selectedLV->header(), QHeaderView::ResizeToContents);
modulesModule->selectedLV->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
modulesModule->selectedLV->header()->setStretchLastSection(false);
selectionManager =
new ModuleSelectionManager(this, modulesModule->availableLV,

View File

@ -61,7 +61,7 @@ PanelStack::PanelStack(QWidget * parent)
list_->setRootIsDecorated(false);
list_->setColumnCount(1);
list_->header()->hide();
setSectionResizeMode(list_->header(), QHeaderView::ResizeToContents);
list_->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
list_->header()->setStretchLastSection(false);
list_->setMinimumSize(list_->viewport()->size());

View File

@ -269,18 +269,6 @@ void setMessageColour(list<QWidget *> highlighted, list<QWidget *> plain)
}
/// FIXME KILLQT4: kill this function
/// wrapper to hide the change of method name to setSectionResizeMode
void setSectionResizeMode(QHeaderView * view,
int logicalIndex, QHeaderView::ResizeMode mode) {
view->setSectionResizeMode(logicalIndex, mode);
}
/// FIXME KILLQT4: kill this function
void setSectionResizeMode(QHeaderView * view, QHeaderView::ResizeMode mode) {
view->setSectionResizeMode(mode);
}
void showDirectory(FileName const & directory)
{
if (!directory.exists())

View File

@ -89,12 +89,6 @@ void focusAndHighlight(QAbstractItemView * w);
void setMessageColour(std::list<QWidget *> highlighted,
std::list<QWidget *> plain);
/// Qt5 changed setSectionMode to setSectionResizeMode
/// These wrappers work for Qt4 and Qt5
void setSectionResizeMode(QHeaderView * view,
int logicalIndex, QHeaderView::ResizeMode mode);
void setSectionResizeMode(QHeaderView * view,
QHeaderView::ResizeMode mode);
/// Shows a directory in OSs file browser
void showDirectory(support::FileName const & directory);
/// handle request for showing citation content - shows pdf/ps or