BlinCTSept. 15, 2023, 12:35 p.m.
Размеры полей в TreeView
Всем привет.
Пытаюсь сделать дерево вот такого вида
Пытаюсь организовать делегат для каждой строки в дереве. ТО есть отступ какого то размера и если при открытии есть подсписок то увеличивать наверное с каждым шагом по 2.
Но что-то не моуг правильно выстроить данные для строки.
Может кто поправить меня где ошибка у меня?
Вот часть кода:
Rectangle { SplitView.minimumWidth: root.width * 0.1 // SplitView.maximumWidth: root.width * 0.25 width: root.width * 0.5 color: "#5a5a5a" // TODO: need from C++ TreeView { id: treeViewBookmark anchors.fill: parent clip: true delegate: Item { id: treeDelegate required property int page required property point location required property real zoom // color: "yellow" // implicitWidth: padding + label.x + label.implicitWidth + padding implicitHeight: label.implicitHeight * 1.5 readonly property real indent: 20 readonly property real padding: 5 // // Assigned to by TreeView: required property TreeView treeView required property bool isTreeNode required property bool expanded required property int hasChildren required property int depth RowLayout { spacing: treeViewBookmark.width * 0.03 anchors.fill: parent Rectangle { id: name Layout.fillHeight: true width: treeDelegate.padding + (treeDelegate.depth * indicator.width) color: "yellow" // Layout.width: treeDelegate.padding + (treeDelegate.depth * treeDelegate.indent) } Rectangle { id: rectIndicator width: childrenRect.width Text { id: indicator visible: treeDelegate.isTreeNode && treeDelegate.hasChildren // x: padding + (treeDelegate.depth * treeDelegate.indent) anchors.verticalCenter: label.verticalCenter text: "▸" rotation: treeDelegate.expanded ? 90 : 0 } } Rectangle { id: rectTabel Text { id: label anchors.fill: parent clip: true text: model.display color: "#b7b7b7" } } } TapHandler { onTapped: { treeView.toggleExpanded(row) var qi = treeViewBookmark.index(row, 0) } } } model: PdfBookmarkModel { document: docPdf } ScrollBar.vertical: ScrollBar { } } }
Заранее благодарю
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.Do you like it? Share on social networks!
m
- molni99
- Oct. 26, 2024, 11:37 a.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:80points,
- Rating points4
m
- molni99
- Oct. 26, 2024, 11:29 a.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:20points,
- Rating points-10
Last comments
Fb3 file reader on Qt Creator Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
ИМ
Django - Lesson 064. How to write a Python Markdown extension Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
Игорь МаксимовOct. 5, 2024, 5:51 p.m.
QML - Lesson 016. SQLite database and the working with it in QML Qt Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…
Qt Linux - Lesson 001. Autorun Qt application under Linux как сделать автозапуск для флэтпака, который не даёт создавать файлы в ~/.config - вот это вопрос ))
АК
Qt WinAPI - Lesson 007. Working with ICMP Ping in Qt Без строки #include <QRegularExpressionValidator> в заголовочном файле не работает валидатор.
Анатолий КононенкоFeb. 5, 2024, 12:50 p.m.
Now discuss on the forum
Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…
добавить qlineseries в функции Пользователь может получить любые разъяснения по интересующим вопросам, касающимся обработки его персональных данных, обратившись к Оператору с помощью электронной почты https://topdecorpro.ru…
ИМ
Реализация навигации по разделам Спасибо Евгений!
Игорь МаксимовOct. 3, 2024, 2:05 p.m.
Indian Food Restaurant In Columbus OH| Layla’s Kitchen Indian Restaurant If you're looking for a truly authentic https://www.laylaskitchenrestaurantohio.com/ , Layla’s Kitchen Indian Restaurant is your go-to destination. Located at 6152 Cleveland Ave, Colu…
КГ
Не запускается программа на Qt: точка входа в процедуру не найдена в библиотеке DLL Написал программу на C++ Qt в Qt Creator, сбилдил Release с помощью MinGW 64-bit, бинарнику напихал dll-ки с помощью windeployqt.exe. При попытке запуска моей сбилженной программы выдаёт три оши…
Кирилл ГусаревSept. 27, 2024, 7:09 p.m.