]> git.lyx.org Git - lyx.git/commitdiff
Get rid of setSectionResizeMode helper functions.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 19 Nov 2022 14:04:38 +0000 (15:04 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 19 Nov 2022 14:04:38 +0000 (15:04 +0100)
src/frontends/qt/GuiCompleter.cpp
src/frontends/qt/GuiDocument.cpp
src/frontends/qt/PanelStack.cpp
src/frontends/qt/qt_helpers.cpp
src/frontends/qt/qt_helpers.h

index 281ff355bb176db8e5e97d0478a70c4fbd0208d3..2aee43691231e0b243f28e95f38714a462cbfcfc 100644 (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
index 8dff8b53a9b8e5d72117fba4a7b104f404657044..83581d0bd53f54646780fbf3fe1f9f22c40e233e 100644 (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,
index 745442b6530fcff03c17a5cdf4072d8d80772987..c70c7ae5434d40cd723d23e2979081c8d286e846 100644 (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());
 
index a123035866126969dab7bd955adcf99edfba6961..6891c3088a8a7615be6657fd4910929c2cc88eee 100644 (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())
index 08d50fa582b5cd411bdff09bc6bbe1e9303b4ce6..77c14b8c88e21de7a4d385137c1417a73bb10b69 100644 (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