From edlipsongm at gmail.com Fri Apr 9 13:29:58 2021 From: edlipsongm at gmail.com (Ed Lipson) Date: Fri, 9 Apr 2021 07:29:58 -0400 Subject: [PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored? Message-ID: How would one set the background color of the QTableView (QtHorizontal orientation) header? I have tried the 'mail title' action, where I see the role being used. I just don't get the color. I used the same concept in data() and the cells take on the background color as appropriate for the state. PySide2 5.15.2 Python3.9.1 Thanks, Ed PS: Where is it appropriate to ask such questions? JIRA does not have a question type defined and doing it there may be too much noise in the bug tracking system. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjm at pmeonline.net Fri Apr 9 14:04:40 2021 From: hjm at pmeonline.net (Hans =?UTF-8?Q?J=C3=B6rg?= Maurer) Date: Fri, 09 Apr 2021 14:04:40 +0200 Subject: [PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored? In-Reply-To: References: Message-ID: I think you have to use .setStyleSheet(QHeaderView:section{background - color: green}) Take a look at https://doc.qt.io/archives/qt-5.9/stylesheet.html Regards Hans Am Freitag, den 09.04.2021 um 13:29 schrieb Ed Lipson: How would one set the background color of the QTableView (QtHorizontal orientation) header? I have tried the 'mail title' action, where I see the role being used. I just don't get the color. I used the same concept in data() and the cells take on the background color as appropriate for the state. PySide2 5.15.2 Python3.9.1  Thanks, Ed PS: Where is it appropriate to ask such questions? JIRA does not have a question type defined and doing it there may be too much noise in the bug tracking system. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cristian.Maureira-Fredes at qt.io Fri Apr 9 15:15:28 2021 From: Cristian.Maureira-Fredes at qt.io (=?UTF-8?Q?Cristi=c3=a1n_Maureira-Fredes?=) Date: Fri, 9 Apr 2021 15:15:28 +0200 Subject: [PySide] Qt for Python 6.0.3 released! Message-ID: <9537c28c-147c-da99-a9b9-b09919f11c87@qt.io> Hey all!, It took us some extra time, but the new bug-fix release of 6.0 is finally out! You can get 6.0.3 as always with: pip install pyside6 or updating pip install -U pyside6 You can check the details of the main changes here: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/dist/changes-6.0.3 We are focusing in 6.1 and 6.2 at the moment, so let's know if there are any priority issues in our JIRA, so we can try to fix them before the next minor version releases: https://bugreports.qt.io/projects/PYSIDE Have a nice weekend! Cheers -- Dr. Cristián Maureira-Fredes R&D Manager The Qt Company GmbH Erich-Thilo-Str. 10 D-12489 Berlin Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B From edlipsongm at gmail.com Fri Apr 9 21:43:46 2021 From: edlipsongm at gmail.com (Ed Lipson) Date: Fri, 9 Apr 2021 15:43:46 -0400 Subject: [PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored? In-Reply-To: References: Message-ID: Then why would there be a background role call to the headerData method? I'll give the stylesheet a try. Maybe I can understand it. Thanks, Ed On Fri, Apr 9, 2021 at 8:04 AM Hans Jörg Maurer wrote: > I think you have to use > > .setStyleSheet(QHeaderView:section{background - color: green}) > Take a look at https://doc.qt.io/archives/qt-5.9/stylesheet.html > > Regards > Hans > > > > Am Freitag, den 09.04.2021 um 13:29 schrieb Ed Lipson: > > How would one set the background color of the QTableView (QtHorizontal > orientation) header? I have tried the 'mail title' action, where I see the > role being used. I just don't get the color. > > I used the same concept in data() and the cells take on the background > color as appropriate for the state. > > PySide2 5.15.2 Python3.9.1 > > Thanks, > Ed > > PS: Where is it appropriate to ask such questions? JIRA does not have a > question type defined and doing it there may be too much noise in the bug > tracking system. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From edlipsongm at gmail.com Fri Apr 9 22:23:06 2021 From: edlipsongm at gmail.com (Ed Lipson) Date: Fri, 9 Apr 2021 16:23:06 -0400 Subject: [PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored? In-Reply-To: References: Message-ID: I tried - self.my_tableView.horizontalHeader().setStyleSheet("background-color: gray"), no effect. I get a little lost with the c++ to python translations. I tried ("{background-color: gray;}") too and that did not work either. I saw a post about using a QPalette, but I'm not sure how that would help or be applied. Thanks, Ed On Fri, Apr 9, 2021 at 3:43 PM Ed Lipson wrote: > Then why would there be a background role call to the headerData method? > I'll give the stylesheet a try. Maybe I can understand it. > > Thanks, > Ed > > > On Fri, Apr 9, 2021 at 8:04 AM Hans Jörg Maurer wrote: > >> I think you have to use >> >> .setStyleSheet(QHeaderView:section{background - color: green}) >> Take a look at https://doc.qt.io/archives/qt-5.9/stylesheet.html >> >> Regards >> Hans >> >> >> >> Am Freitag, den 09.04.2021 um 13:29 schrieb Ed Lipson: >> >> How would one set the background color of the QTableView (QtHorizontal >> orientation) header? I have tried the 'mail title' action, where I see the >> role being used. I just don't get the color. >> >> I used the same concept in data() and the cells take on the background >> color as appropriate for the state. >> >> PySide2 5.15.2 Python3.9.1 >> >> Thanks, >> Ed >> >> PS: Where is it appropriate to ask such questions? JIRA does not have a >> question type defined and doing it there may be too much noise in the bug >> tracking system. >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cristian.Maureira-Fredes at qt.io Mon Apr 12 00:03:16 2021 From: Cristian.Maureira-Fredes at qt.io (=?UTF-8?Q?Cristi=c3=a1n_Maureira-Fredes?=) Date: Mon, 12 Apr 2021 00:03:16 +0200 Subject: [PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored? In-Reply-To: References: Message-ID: Hello, Nothing to worry about C++, if you have a QTableView object, you can just use: .setStyleSheet("QHeaderView::section{background-color: green;}") on the object. For example, modifying the example: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/widgets/itemviews/addressbook Precisely the "addreswidget.py" file, adding the same line under the declaration "tableView = QTableView()" Produces: https://imgur.com/a/iWo5rdM Cheers PS: There is a small tutorial regarding stylesheet on the docs: https://doc.qt.io/qtforpython/tutorials/basictutorial/widgetstyling.html On 4/9/21 10:23 PM, Ed Lipson wrote: > I tried > - self.my_tableView.horizontalHeader().setStyleSheet("background-color: > gray"), no effect. I get a little lost with the c++ to python > translations. I tried ("{background-color: gray;}") too and that did not > work either. > > I saw a post about using a QPalette, but I'm not sure how that would > help or be applied. > > Thanks, > Ed > > > On Fri, Apr 9, 2021 at 3:43 PM Ed Lipson > wrote: > > Then why would there be a background role call to the headerData > method? I'll give the stylesheet a try. Maybe I can understand it. > > Thanks, > Ed > > > On Fri, Apr 9, 2021 at 8:04 AM Hans Jörg Maurer > wrote: > > I think you have to use > > .setStyleSheet(QHeaderView:section{background - color: green}) > Take a look at https://doc.qt.io/archives/qt-5.9/stylesheet.html > > > Regards > Hans > > > > Am Freitag, den 09.04.2021 um 13:29 schrieb Ed Lipson: > > How would one set the background color of the QTableView > (QtHorizontal orientation) header? I have tried the 'mail > title' action, where I see the role being used. I just don't > get the color. > > I used the same concept in data() and the cells take on the > background color as appropriate for the state. > > PySide2 5.15.2 Python3.9.1 > > Thanks, > Ed > > PS: Where is it appropriate to ask such questions? JIRA does > not have a question type defined and doing it there may be > too much noise in the bug tracking system. > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > https://lists.qt-project.org/listinfo/pyside > -- Dr. Cristián Maureira-Fredes R&D Manager The Qt Company GmbH Erich-Thilo-Str. 10 D-12489 Berlin Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B From edlipsongm at gmail.com Mon Apr 12 13:29:48 2021 From: edlipsongm at gmail.com (Ed Lipson) Date: Mon, 12 Apr 2021 07:29:48 -0400 Subject: [PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored? In-Reply-To: References: Message-ID: It worked, colored both Horizontal and Vertical headers. I would have made the assumption that the section keyword would refer to a column/row of the header. Clearly it refers to the whole header. Where would I find documentation regarding this? If I wanted just the Horizontal header to be colored, for example. I did not see anything in the QHeaderView or QAbstractItemView documentation for just the section keyword. Is there any doc on the syntactic sugar of passing in what appears (to me) to be a C++ string? Thanks, Ed On Sun, Apr 11, 2021 at 6:03 PM Cristián Maureira-Fredes < Cristian.Maureira-Fredes at qt.io> wrote: > Hello, > > Nothing to worry about C++, > if you have a QTableView object, you can just use: > > .setStyleSheet("QHeaderView::section{background-color: green;}") > > on the object. > > For example, > modifying the example: > > > https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/widgets/itemviews/addressbook > > Precisely the "addreswidget.py" file, adding the same line > under the declaration "tableView = QTableView()" > > Produces: > > https://imgur.com/a/iWo5rdM > > > Cheers > > > PS: There is a small tutorial regarding stylesheet on the docs: > https://doc.qt.io/qtforpython/tutorials/basictutorial/widgetstyling.html > > On 4/9/21 10:23 PM, Ed Lipson wrote: > > I tried > > - self.my_tableView.horizontalHeader().setStyleSheet("background-color: > > gray"), no effect. I get a little lost with the c++ to python > > translations. I tried ("{background-color: gray;}") too and that did not > > work either. > > > > I saw a post about using a QPalette, but I'm not sure how that would > > help or be applied. > > > > Thanks, > > Ed > > > > > > On Fri, Apr 9, 2021 at 3:43 PM Ed Lipson > > wrote: > > > > Then why would there be a background role call to the headerData > > method? I'll give the stylesheet a try. Maybe I can understand it. > > > > Thanks, > > Ed > > > > > > On Fri, Apr 9, 2021 at 8:04 AM Hans Jörg Maurer > > wrote: > > > > I think you have to use > > > > .setStyleSheet(QHeaderView:section{background - color: green}) > > Take a look at https://doc.qt.io/archives/qt-5.9/stylesheet.html > > > > > > Regards > > Hans > > > > > > > > Am Freitag, den 09.04.2021 um 13:29 schrieb Ed Lipson: > > > > How would one set the background color of the QTableView > > (QtHorizontal orientation) header? I have tried the 'mail > > title' action, where I see the role being used. I just don't > > get the color. > > > > I used the same concept in data() and the cells take on the > > background color as appropriate for the state. > > > > PySide2 5.15.2 Python3.9.1 > > > > Thanks, > > Ed > > > > PS: Where is it appropriate to ask such questions? JIRA does > > not have a question type defined and doing it there may be > > too much noise in the bug tracking system. > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > https://lists.qt-project.org/listinfo/pyside > > > > -- > Dr. Cristián Maureira-Fredes > R&D Manager > > The Qt Company GmbH > Erich-Thilo-Str. 10 > D-12489 Berlin > > Geschäftsführer: Mika Pälsi, > Juha Varelius, Jouni Lintunen > Sitz der Gesellschaft: Berlin, > Registergericht: Amtsgericht > Charlottenburg, HRB 144331 B > _______________________________________________ > PySide mailing list > PySide at qt-project.org > https://lists.qt-project.org/listinfo/pyside > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cristian.Maureira-Fredes at qt.io Mon Apr 12 13:45:22 2021 From: Cristian.Maureira-Fredes at qt.io (=?UTF-8?Q?Cristi=c3=a1n_Maureira-Fredes?=) Date: Mon, 12 Apr 2021 13:45:22 +0200 Subject: [PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored? In-Reply-To: References: Message-ID: <583f2d49-93da-0e7d-c3c4-532c169a7ac6@qt.io> Hello Ed, I'd say the style-sheet reference is the best place to find information about "what to modify" regarding the styling: https://doc.qt.io/qt-6/stylesheet-reference.html from which you can see a link to: https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qtableview and https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qheaderview which highlights some of the options. What you write there is QSS, which is similar to CSS, maybe if you are not familiar to CSS it looks strange. Were you referring to that with the C++ comment? Cheers On 4/12/21 1:29 PM, Ed Lipson wrote: > > It worked, colored both Horizontal and Vertical headers. > > I would have made the assumption that the section keyword would refer to > a column/row of the header. Clearly it refers to the whole header. Where > would I find documentation regarding this? If I wanted just the > Horizontal header to be colored, for example. I did not see anything in > the QHeaderView or QAbstractItemView documentation for just the section > keyword. > > Is there any doc on the syntactic sugar of passing in what appears (to > me) to be a C++ string? > > Thanks, > Ed > > > On Sun, Apr 11, 2021 at 6:03 PM Cristián Maureira-Fredes > > > wrote: > > Hello, > > Nothing to worry about C++, > if you have a QTableView object, you can just use: > > .setStyleSheet("QHeaderView::section{background-color: green;}") > > on the object. > > For example, > modifying the example: > > https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/widgets/itemviews/addressbook > > > Precisely the "addreswidget.py" file, adding the same line > under the declaration "tableView = QTableView()" > > Produces: > > https://imgur.com/a/iWo5rdM > > > Cheers > > > PS: There is a small tutorial regarding stylesheet on the docs: > https://doc.qt.io/qtforpython/tutorials/basictutorial/widgetstyling.html > > > On 4/9/21 10:23 PM, Ed Lipson wrote: > > I tried > > > - self.my_tableView.horizontalHeader().setStyleSheet("background-color: > > gray"), no effect. I get a little lost with the c++ to python > > translations. I tried ("{background-color: gray;}") too and that > did not > > work either. > > > > I saw a post about using a QPalette, but I'm not sure how that would > > help or be applied. > > > > Thanks, > > Ed > > > > > > On Fri, Apr 9, 2021 at 3:43 PM Ed Lipson > > >> wrote: > > > >     Then why would there be a background role call to the headerData > >     method? I'll give the stylesheet a try. Maybe I can > understand it. > > > >     Thanks, > >     Ed > > > > > >     On Fri, Apr 9, 2021 at 8:04 AM Hans Jörg Maurer > > >     >> wrote: > > > >         I think you have to use > > > >         .setStyleSheet(QHeaderView:section{background - color: > green}) > >         Take a look at > https://doc.qt.io/archives/qt-5.9/stylesheet.html > > >          > > > > >         Regards > >         Hans > > > > > > > >         Am Freitag, den 09.04.2021 um 13:29 schrieb Ed Lipson: > > > >             How would one set the background color of the QTableView > >             (QtHorizontal orientation) header? I have tried the 'mail > >             title' action, where I see the role being used. I > just don't > >             get the color. > > > >             I used the same concept in data() and the cells take > on the > >             background color as appropriate for the state. > > > >             PySide2 5.15.2 Python3.9.1 > > > >             Thanks, > >             Ed > > > >             PS: Where is it appropriate to ask such questions? > JIRA does > >             not have a question type defined and doing it there > may be > >             too much noise in the bug tracking system. > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > https://lists.qt-project.org/listinfo/pyside > > > > > -- > Dr. Cristián Maureira-Fredes > R&D Manager > > The Qt Company GmbH > Erich-Thilo-Str. 10 > D-12489 Berlin > > Geschäftsführer: Mika Pälsi, > Juha Varelius, Jouni Lintunen > Sitz der Gesellschaft: Berlin, > Registergericht: Amtsgericht > Charlottenburg, HRB 144331 B > _______________________________________________ > PySide mailing list > PySide at qt-project.org > https://lists.qt-project.org/listinfo/pyside > > -- Dr. Cristián Maureira-Fredes R&D Manager The Qt Company GmbH Erich-Thilo-Str. 10 D-12489 Berlin Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B