From 41702d8455a9e88ac70108e500a10e7bd4df2771 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Mon, 21 Oct 2019 21:23:08 +0200 Subject: Honor alpha for SH_Table_GridLineColor Make sure to honor the alpha channel for the color returned by SH_Table_GridLineColor. Fixes: QTBUG-74909 Change-Id: If9688329e5e2ab41833dfeb7e6292fdfcbf63aa1 Reviewed-by: Richard Moe Gustavsen --- src/widgets/doc/snippets/javastyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/doc/snippets') diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp index 8657d5ed29..3d1b1e0030 100644 --- a/src/widgets/doc/snippets/javastyle.cpp +++ b/src/widgets/doc/snippets/javastyle.cpp @@ -2589,7 +2589,7 @@ int JavaStyle::styleHint(StyleHint hint, const QStyleOption *option, switch (hint) { case SH_Table_GridLineColor: { - ret = static_cast(option->palette.color(QPalette::Mid).rgb()); + ret = static_cast(option->palette.color(QPalette::Mid).rgba()); break; } case QStyle::SH_Menu_Scrollable: -- cgit v1.2.3 From 54d5ca0c2766e915c960fa437cee6c20a324c1a7 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sat, 16 Nov 2019 16:53:08 +0100 Subject: Doc: improve Using Model Indexes in Model View Programming guide The current example using QFileSystemModel doesn't take into account the asynchronous nature of that model. This puts people on the wrong path on how to use it. This patch improves the snippet as well as the explanation steps. Change-Id: I5c7a3c19aad48847f0b965b5eb69b492d6263f51 Reviewed-by: Paul Wicking --- src/widgets/doc/snippets/simplemodel-use/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/widgets/doc/snippets') diff --git a/src/widgets/doc/snippets/simplemodel-use/main.cpp b/src/widgets/doc/snippets/simplemodel-use/main.cpp index 3e106c8eea..940669e101 100644 --- a/src/widgets/doc/snippets/simplemodel-use/main.cpp +++ b/src/widgets/doc/snippets/simplemodel-use/main.cpp @@ -79,8 +79,11 @@ int main(int argc, char *argv[]) //! [0] QFileSystemModel *model = new QFileSystemModel; - QModelIndex parentIndex = model->index(QDir::currentPath()); - int numRows = model->rowCount(parentIndex); + connect(model, &QFileSystemModel::directoryLoaded, [model](const QString &directory) { + QModelIndex parentIndex = model->index(directory); + int numRows = model->rowCount(parentIndex); + }); + model->setRootPath(QDir::currentPath); //! [0] //! [1] -- cgit v1.2.3