commit a3327f576ca4742963faa10b1a2962c3f4b21747
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Sat Nov 19 15:04:38 2022 +0100
Get rid of setSectionResizeMode helper functions.
---
src/frontends/qt/GuiCompleter.cpp | 4 ++--
src/frontends/qt/GuiDocument.cpp | 8 ++++----
src/frontends/qt/PanelStack.cpp | 2 +-
src/frontends/qt/qt_helpers.cpp | 12 ------------
src/frontends/qt/qt_helpers.h | 6 ------
5 files changed, 7 insertions(+), 25 deletions(-)
diff --git a/src/frontends/qt/GuiCompleter.cpp
b/src/frontends/qt/GuiCompleter.cpp
index 281ff35..2aee436 100644
--- a/src/frontends/qt/GuiCompleter.cpp
+++ b/src/frontends/qt/GuiCompleter.cpp
@@ -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
diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index 8dff8b5..83581d0 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -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,
diff --git a/src/frontends/qt/PanelStack.cpp b/src/frontends/qt/PanelStack.cpp
index 745442b..c70c7ae 100644
--- a/src/frontends/qt/PanelStack.cpp
+++ b/src/frontends/qt/PanelStack.cpp
@@ -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());
diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp
index a123035..6891c30 100644
--- a/src/frontends/qt/qt_helpers.cpp
+++ b/src/frontends/qt/qt_helpers.cpp
@@ -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())
diff --git a/src/frontends/qt/qt_helpers.h b/src/frontends/qt/qt_helpers.h
index 08d50fa..77c14b8 100644
--- a/src/frontends/qt/qt_helpers.h
+++ b/src/frontends/qt/qt_helpers.h
@@ -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
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs