From frank at ohufx.com Tue May 2 10:21:41 2017 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 2 May 2017 20:21:41 +1200 Subject: [PySide] filling model via QRunnable creates extra rows Message-ID: Hi all, I just ran int this issue where I'm trying to fill a model via QRunnable, but when I do so, it seems to add extra rows for some mysterious reasons. If I run the respective process in in the main thread I get the expected results. Can somebody please help? Test code attached. Cheers, frank -------------- next part -------------- A non-text attachment was scrubbed... Name: tests.py Type: text/x-python-script Size: 2528 bytes Desc: not available URL: From me at the-compiler.org Tue May 2 10:25:25 2017 From: me at the-compiler.org (Florian Bruhin) Date: Tue, 2 May 2017 10:25:25 +0200 Subject: [PySide] filling model via QRunnable creates extra rows In-Reply-To: References: Message-ID: <20170502082524.3g5znmw457rqnoqk@hooch.localdomain> On Tue, May 02, 2017 at 08:21:41PM +1200, Frank Rueter | OHUfx wrote: > Hi all, > > I just ran int this issue where I'm trying to fill a model via QRunnable, > but when I do so, it seems to add extra rows for some mysterious reasons. > If I run the respective process in in the main thread I get the expected > results. > Can somebody please help? > Test code attached. Your model needs to be modified from the main thread: http://blog.hostilefork.com/qt-model-view-different-threads/ Florian -- https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc I love long mails! | https://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From frank at ohufx.com Tue May 2 10:29:55 2017 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 2 May 2017 20:29:55 +1200 Subject: [PySide] filling model via QRunnable creates extra rows In-Reply-To: <20170502082524.3g5znmw457rqnoqk@hooch.localdomain> References: <20170502082524.3g5znmw457rqnoqk@hooch.localdomain> Message-ID: <17a59f3f-4215-e966-8e0c-348c242e40aa@ohufx.com> Oh, damn. How do I show progress bars and counters etc. while scanning the file tree then? I will read your link properly in the morning, it's late over here. frank On 2/05/17 8:25 PM, Florian Bruhin wrote: > On Tue, May 02, 2017 at 08:21:41PM +1200, Frank Rueter | OHUfx wrote: >> Hi all, >> >> I just ran int this issue where I'm trying to fill a model via QRunnable, >> but when I do so, it seems to add extra rows for some mysterious reasons. >> If I run the respective process in in the main thread I get the expected >> results. >> Can somebody please help? >> Test code attached. > Your model needs to be modified from the main thread: > http://blog.hostilefork.com/qt-model-view-different-threads/ > > Florian > From timr at probo.com Tue May 2 18:40:14 2017 From: timr at probo.com (Tim Roberts) Date: Tue, 2 May 2017 09:40:14 -0700 Subject: [PySide] filling model via QRunnable creates extra rows In-Reply-To: <17a59f3f-4215-e966-8e0c-348c242e40aa@ohufx.com> References: <20170502082524.3g5znmw457rqnoqk@hooch.localdomain> <17a59f3f-4215-e966-8e0c-348c242e40aa@ohufx.com> Message-ID: <40e7d050-8934-aad5-e006-86a654fc8cda@probo.com> Frank Rueter | OHUfx wrote: > Oh, damn. > How do I show progress bars and counters etc. while scanning the file > tree then? You use slots and signals to send update messages back to the main thread. This is a standard practice in every current user interface framework. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From frank at ohufx.com Tue May 2 22:45:53 2017 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 3 May 2017 08:45:53 +1200 Subject: [PySide] filling model via QRunnable creates extra rows In-Reply-To: <40e7d050-8934-aad5-e006-86a654fc8cda@probo.com> References: <20170502082524.3g5znmw457rqnoqk@hooch.localdomain> <17a59f3f-4215-e966-8e0c-348c242e40aa@ohufx.com> <40e7d050-8934-aad5-e006-86a654fc8cda@probo.com> Message-ID: <63a5326b-04b8-32dd-17f8-2d6b7ae8effc@ohufx.com> Yes, I know. But since it was mentioned that I can't fill my model in a different thread from the UI this doesn't quite apply. If I filled my model in the main thread, I wouldn't be able to update it during the processing. However, since I am creating a tree model, I guess I can just add the root item to the model in the main thread after the worker thread is finished creating and linking all items (and sending signals for the UI updates during the heavy lifting). On 3/05/17 4:40 AM, Tim Roberts wrote: > Frank Rueter | OHUfx wrote: >> Oh, damn. >> How do I show progress bars and counters etc. while scanning the file >> tree then? > You use slots and signals to send update messages back to the main > thread. This is a standard practice in every current user interface > framework. > From tismer at stackless.com Tue May 9 08:17:36 2017 From: tismer at stackless.com (Christian Tismer) Date: Tue, 9 May 2017 08:17:36 +0200 Subject: [PySide] Merging pyside-setup, shiboken and pyside Message-ID: Hi all, you know that the PySide(2) project is sub-divided into three main parts (no tools or examples): pyside-setup, shiboken and pyside. We have been fighting with this structure quite often. It is sometimes really hard to keep the repositories in sync when we have several open branches in the workings. ================= The PySide Merger ================= To simplify our work, and also to make it easier for everybody to work with the project, we are considering to merge the three repositories into one: PySide. It is not planned to change the project structure in any way; the three pieces stay logically apart as they are now: We will just merge the repositories! ------------------------------------ It will also still be possible to use the parts alone. But they now come in one chunk. I know there are people who are using shiboken separately. They need to change their workflow a little bit, because they now need to checkout pyside and copy shiboken out of it. If you see a problem with that, please contact us now. We will for sure find a solution together. Cheers -- Chris -- Christian Tismer :^) tismer at stackless.com Software Consulting : http://www.stackless.com/ Karl-Liebknecht-Str. 121 : https://github.com/PySide 14482 Potsdam : GPG key -> 0xFB7BEE0E phone +49 173 24 18 776 fax +49 (30) 700143-0023 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: OpenPGP digital signature URL: From schampailler at skynet.be Tue May 9 09:11:26 2017 From: schampailler at skynet.be (Stefan Champailler) Date: Tue, 9 May 2017 09:11:26 +0200 Subject: [PySide] Merging pyside-setup, shiboken and pyside In-Reply-To: References: Message-ID: <20170509091126.42a422f7@debian.lan> Well, Shiboken being just a tool to build PySide, this makes sense :-) thanks fot he good work stF On Tue, 9 May 2017 08:17:36 +0200 Christian Tismer wrote: > Hi all, > > you know that the PySide(2) project is sub-divided into three > main parts (no tools or examples): > > pyside-setup, shiboken and pyside. > > We have been fighting with this structure quite often. > It is sometimes really hard to keep the repositories in sync > when we have several open branches in the workings. > > ================= > The PySide Merger > ================= > > To simplify our work, and also to make it easier for everybody > to work with the project, we are considering to merge the three > repositories into one: PySide. > > It is not planned to change the project structure in any way; > the three pieces stay logically apart as they are now: > > We will just merge the repositories! > ------------------------------------ > > It will also still be possible to use the parts alone. > But they now come in one chunk. > > I know there are people who are using shiboken separately. > They need to change their workflow a little bit, because > they now need to checkout pyside and copy shiboken out of it. > > If you see a problem with that, please contact us now. > We will for sure find a solution together. > > Cheers -- Chris > > -- > Christian Tismer :^) tismer at stackless.com > Software Consulting : http://www.stackless.com/ > Karl-Liebknecht-Str. 121 : https://github.com/PySide > 14482 Potsdam : GPG key -> 0xFB7BEE0E > phone +49 173 24 18 776 fax +49 (30) 700143-0023 > From tismer at stackless.com Wed May 10 10:12:47 2017 From: tismer at stackless.com (Christian Tismer) Date: Wed, 10 May 2017 10:12:47 +0200 Subject: [PySide] Merging pyside-setup, shiboken and pyside In-Reply-To: <17fa586b-71ee-a8db-2b6a-c1e4014c8c92@gmail.com> References: <20170509091126.42a422f7@debian.lan> <17fa586b-71ee-a8db-2b6a-c1e4014c8c92@gmail.com> Message-ID: <07e54d76-b370-4359-e5b5-7b7d203ac4eb@stackless.com> Hi Matthew, I appreciate your input very much! Which part of """We will just merge the repositories! It will also still be possible to use the parts alone. But they now come in one chunk.""" did you not understand? Kind regards -- Chris On 09.05.17 19:08, Matthew Woehlke wrote: > On 2017-05-09 03:11, Stefan Champailler wrote: >> On Tue, 9 May 2017 08:17:36 +0200 Christian Tismer wrote: >>> We have been fighting with this structure quite often. >>> It is sometimes really hard to keep the repositories in sync >>> when we have several open branches in the workings. >>> >>> To simplify our work, and also to make it easier for everybody >>> to work with the project, we are considering to merge the three >>> repositories into one: PySide. >> >> Well, Shiboken being just a tool to build PySide, this makes sense :-) > > But... > >>> I know there are people who are using shiboken separately. >>> They need to change their workflow a little bit, because >>> they now need to checkout pyside and copy shiboken out of it. > > ...shiboken *isn't* "just a tool to build PySide". It's a tool to build > *Python bindings*. It's true that PySide is the most obvious user > (perhaps even the "original customer") of said tool, and that Shiboken > certainly gets features added specifically to support PySide, but > Shiboken is a good tool that is useful to projects *besides* PySide, > some of which definitely don't want to be burdened by having to build > PySide in order to produce Python bindings. > > I haven't been involved recently to have an understanding of how the > current setup is causing problems, so I can't offer any meaningful > suggestions, but I do worry this will hurt other users of Shiboken. > > At least, I would like to see that a) distributions can easily package > Shiboken and PySide separately, and b) Shiboken can be built from source > without also building PySide. > -- Christian Tismer :^) tismer at stackless.com Software Consulting : http://www.stackless.com/ Karl-Liebknecht-Str. 121 : https://github.com/PySide 14482 Potsdam : GPG key -> 0xFB7BEE0E phone +49 173 24 18 776 fax +49 (30) 700143-0023 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: OpenPGP digital signature URL: From mwoehlke.floss at gmail.com Wed May 10 16:17:30 2017 From: mwoehlke.floss at gmail.com (Matthew Woehlke) Date: Wed, 10 May 2017 10:17:30 -0400 Subject: [PySide] Merging pyside-setup, shiboken and pyside In-Reply-To: <07e54d76-b370-4359-e5b5-7b7d203ac4eb@stackless.com> References: <20170509091126.42a422f7@debian.lan> <17fa586b-71ee-a8db-2b6a-c1e4014c8c92@gmail.com> <07e54d76-b370-4359-e5b5-7b7d203ac4eb@stackless.com> Message-ID: <88a5d92b-cbff-81ed-6f2f-3947ec3a9aae@gmail.com> On 2017-05-10 04:12, Christian Tismer wrote: > Hi Matthew, > > I appreciate your input very much! > Which part of > > """We will just merge the repositories! > It will also still be possible to use the parts alone. > But they now come in one chunk.""" > > did you not understand? Perhaps I did not read "use" as "build"... I hope that users that only care about Shiboken won't be too impacted by the repository also containing PySide, but I'd be lying if I said I wasn't *at all* concerned about that. Mostly, though, I was replying to Stefan's comment. -- Matthew From bpjobin at gmail.com Fri May 12 22:18:50 2017 From: bpjobin at gmail.com (Bruno-Pierre Jobin) Date: Fri, 12 May 2017 16:18:50 -0400 Subject: [PySide] QTableWidget update setRowCount through QComboBox Message-ID: Hi, I'm sure this is an easy one for you guys. How can I make the QComboBox drive the amount of rows of the QTableWidget. For example, I want the amount of rows to reflect the selected index of the comboBox and it needs to reset itself every time I select a new index. Thanks! from PySide.QtGui import * from PySide.QtCore import * class Panel(QWidget): def __init__(self): super(Panel, self).__init__() self.combo = QComboBox() self.combo.addItems(['1','2','3','4']) self.vlayout = QVBoxLayout() self.vlayout.addWidget(self.combo) self.vlayout.addWidget(self.buildTable(self.combo.currentText())) self.setLayout(self.vlayout) self.resize(400,200) self.combo.currentIndexChanged.connect(lambda:self.buildTable(self.combo.currentText())) def buildTable(self, date): self.table = QTableWidget() self.table.setColumnCount(2) print 'set rows : ', int(date) self.table.setRowCount(int(date)) return self.table def start(): start.panel = Panel() start.panel.show() start() -- Bruno-Pierre Jobin www.bpjobin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bpjobin at gmail.com Fri May 12 22:38:43 2017 From: bpjobin at gmail.com (Bruno-Pierre Jobin) Date: Fri, 12 May 2017 16:38:43 -0400 Subject: [PySide] QCalendar current week Message-ID: Hi, Is there a way I can only have the current week shown in the QCalendarWidget? Thank you -- Bruno-Pierre Jobin www.bpjobin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri May 12 23:00:19 2017 From: timr at probo.com (Tim Roberts) Date: Fri, 12 May 2017 14:00:19 -0700 Subject: [PySide] QTableWidget update setRowCount through QComboBox In-Reply-To: References: Message-ID: Bruno-Pierre Jobin wrote: > > I'm sure this is an easy one for you guys. How can I make the > QComboBox drive the amount of rows of the QTableWidget. For example, I > want the amount of rows to reflect the selected index of the comboBox > and it needs to reset itself every time I select a new index. You haven't thought through your code. Look at what you are doing. Every time you change the combo box, you are creating a BRAND NEW table object. That's clearly not what you want. Just create the table in its initial state, and only update the row count in the combo box handler: from PySide.QtGui import * from PySide.QtCore import * class Panel(QWidget): def __init__(self): super(Panel, self).__init__() self.table = QTableWidget() self.table.setColumnCount(2) self.table.setRowCount(1) self.combo = QComboBox() self.combo.addItems(['1','2','3','4']) self.vlayout = QVBoxLayout() self.vlayout.addWidget(self.combo) self.vlayout.addWidget(self.table) self.setLayout(self.vlayout) self.resize(400,200) self.combo.currentIndexChanged.connect(lambda:self.buildTable(self.combo.currentText())) def buildTable(self, date): print 'set rows : ', int(date) self.table.setRowCount(int(date)) def start(): start.panel = Panel() start.panel.show() import sys app = QApplication(sys.argv) start() app.exec_() -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandru.croitor at qt.io Tue May 23 14:52:19 2017 From: alexandru.croitor at qt.io (Alexandru Croitor) Date: Tue, 23 May 2017 12:52:19 +0000 Subject: [PySide] Pyside repos merge Message-ID: <98B8F3EE-2BC8-45E3-9292-D4F0B921F723@qt.io> Hi all, The merging of the pyside-setup, shiboken and pyside2 repos is imminent. The old repos will stay around for some time, and eventually get deleted, and the repository that should be used from now on is pyside-setup. The examples, tools, and wiki submodules will remain as usual. The good side of things is that shiboken / pyside / pyside-setup changes can happen in single atomic commits. All git history is saved. And management of the CI side of things should be much simpler now. There are a few downsides: - there are going to be a couple bogus merge commits for the actual repo merging, which will have a non-buildable state. - git bisect will not work properly for commits before the repo merge, because checking out a previous revision of a submodule will only contain the sources of that submodule, and not of the whole super tree. If you want to do a build of previous commits, you will have to jump through some hoops, mainly manually replicating the 3 previous submodule file structures, either by git cloning 3 times, or setting up self-referential submodules with different SHA1s. - builds of previous commits won't work unless you do the steps outlined above. - all existing un-merged gerrit changes will have to be rebased. The best way I see for this is using git-format-patch, modifying the files paths in the generated patches, and applying them in the new repo. - maybe something else which I'm currently not seeing. Regards, Alex. --- Alexandru Croitor Software Engineer The Qt Company GmbH Rudower Chaussee 13 D-12489 Berlin alexandru.croitor at qt.io http://qt.io Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B --- From chgans at gna.org Wed May 24 09:18:19 2017 From: chgans at gna.org (Ch'Gans) Date: Wed, 24 May 2017 19:18:19 +1200 Subject: [PySide] Pyside repos merge In-Reply-To: <98B8F3EE-2BC8-45E3-9292-D4F0B921F723@qt.io> References: <98B8F3EE-2BC8-45E3-9292-D4F0B921F723@qt.io> Message-ID: On 24 May 2017 at 00:52, Alexandru Croitor wrote: > Hi all, > > The merging of the pyside-setup, shiboken and pyside2 repos is imminent. > The old repos will stay around for some time, and eventually get deleted, and the repository that should be used from now on is pyside-setup. > > The examples, tools, and wiki submodules will remain as usual. > > The good side of things is that shiboken / pyside / pyside-setup changes can happen in single atomic commits. > All git history is saved. > And management of the CI side of things should be much simpler now. Sounds great! Congrats! Chris > > There are a few downsides: > - there are going to be a couple bogus merge commits for the actual repo merging, which will have a non-buildable state. > > - git bisect will not work properly for commits before the repo merge, because checking out a previous revision of a submodule will only contain the sources of that submodule, and not of the whole super tree. If you want to do a build of previous commits, you will have to jump through some hoops, mainly manually replicating the 3 previous submodule file structures, either by git cloning 3 times, or setting up self-referential submodules with different SHA1s. > > - builds of previous commits won't work unless you do the steps outlined above. > > - all existing un-merged gerrit changes will have to be rebased. The best way I see for this is using git-format-patch, modifying the files paths in the generated patches, and applying them in the new repo. > > - maybe something else which I'm currently not seeing. > > Regards, > Alex. > > > --- > Alexandru Croitor > Software Engineer > > The Qt Company GmbH > Rudower Chaussee 13 > D-12489 Berlin > alexandru.croitor at qt.io > http://qt.io > > Geschäftsführer: Mika Pälsi, > Juha Varelius, Mika Harjuaho > Sitz der Gesellschaft: Berlin, > Registergericht: Amtsgericht > Charlottenburg, HRB 144331 B > --- > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From alkabaila at gmail.com Tue May 9 09:45:16 2017 From: alkabaila at gmail.com (Algis Kabaila) Date: Tue, 09 May 2017 07:45:16 -0000 Subject: [PySide] Merging pyside-setup, shiboken and pyside In-Reply-To: References: Message-ID: Hi, It appears that I have overlooked the awakening of pyside. I did present some simplistic examples in the first life of pyside, when the bulk of system programming was done in Brasil and Matti Airas was leading the development. I want to bring up to date those old examples, particularly the "simplicissimus" bunch of examples for the beginner. How do I go about access permissions. Al Kabaila PS: I am an Australian, retired university (UNSW) professor of Civil Engineering and an admirer/user of python and pyside. Al. On 09/05/17 16:17, Christian Tismer wrote: > Hi all, > > you know that the PySide(2) project is sub-divided into three > main parts (no tools or examples): > > pyside-setup, shiboken and pyside. > > We have been fighting with this structure quite often. > It is sometimes really hard to keep the repositories in sync > when we have several open branches in the workings. > > ================= > The PySide Merger > ================= > > To simplify our work, and also to make it easier for everybody > to work with the project, we are considering to merge the three > repositories into one: PySide. > > It is not planned to change the project structure in any way; > the three pieces stay logically apart as they are now: > > We will just merge the repositories! > ------------------------------------ > > It will also still be possible to use the parts alone. > But they now come in one chunk. > > I know there are people who are using shiboken separately. > They need to change their workflow a little bit, because > they now need to checkout pyside and copy shiboken out of it. > > If you see a problem with that, please contact us now. > We will for sure find a solution together. > > Cheers -- Chris > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -- Dr A. Kabaila Villa 3 St Vincent Villas 7 Bindel St Aranda ACT 2614 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwoehlke.floss at gmail.com Tue May 9 19:08:45 2017 From: mwoehlke.floss at gmail.com (Matthew Woehlke) Date: Tue, 9 May 2017 13:08:45 -0400 Subject: [PySide] Merging pyside-setup, shiboken and pyside In-Reply-To: <20170509091126.42a422f7@debian.lan> References: <20170509091126.42a422f7@debian.lan> Message-ID: <17fa586b-71ee-a8db-2b6a-c1e4014c8c92@gmail.com> On 2017-05-09 03:11, Stefan Champailler wrote: > On Tue, 9 May 2017 08:17:36 +0200 Christian Tismer wrote: >> We have been fighting with this structure quite often. >> It is sometimes really hard to keep the repositories in sync >> when we have several open branches in the workings. >> >> To simplify our work, and also to make it easier for everybody >> to work with the project, we are considering to merge the three >> repositories into one: PySide. > > Well, Shiboken being just a tool to build PySide, this makes sense :-) But... >> I know there are people who are using shiboken separately. >> They need to change their workflow a little bit, because >> they now need to checkout pyside and copy shiboken out of it. ...shiboken *isn't* "just a tool to build PySide". It's a tool to build *Python bindings*. It's true that PySide is the most obvious user (perhaps even the "original customer") of said tool, and that Shiboken certainly gets features added specifically to support PySide, but Shiboken is a good tool that is useful to projects *besides* PySide, some of which definitely don't want to be burdened by having to build PySide in order to produce Python bindings. I haven't been involved recently to have an understanding of how the current setup is causing problems, so I can't offer any meaningful suggestions, but I do worry this will hurt other users of Shiboken. At least, I would like to see that a) distributions can easily package Shiboken and PySide separately, and b) Shiboken can be built from source without also building PySide. -- Matthew From mwoehlke.floss at gmail.com Wed May 10 16:17:30 2017 From: mwoehlke.floss at gmail.com (Matthew Woehlke) Date: Wed, 10 May 2017 10:17:30 -0400 Subject: [PySide] Merging pyside-setup, shiboken and pyside In-Reply-To: <07e54d76-b370-4359-e5b5-7b7d203ac4eb@stackless.com> References: <20170509091126.42a422f7@debian.lan> <17fa586b-71ee-a8db-2b6a-c1e4014c8c92@gmail.com> <07e54d76-b370-4359-e5b5-7b7d203ac4eb@stackless.com> Message-ID: <88a5d92b-cbff-81ed-6f2f-3947ec3a9aae@gmail.com> On 2017-05-10 04:12, Christian Tismer wrote: > Hi Matthew, > > I appreciate your input very much! > Which part of > > """We will just merge the repositories! > It will also still be possible to use the parts alone. > But they now come in one chunk.""" > > did you not understand? Perhaps I did not read "use" as "build"... I hope that users that only care about Shiboken won't be too impacted by the repository also containing PySide, but I'd be lying if I said I wasn't *at all* concerned about that. Mostly, though, I was replying to Stefan's comment. -- Matthew From bpjobin at gmail.com Wed May 24 21:38:15 2017 From: bpjobin at gmail.com (Bruno-Pierre Jobin) Date: Wed, 24 May 2017 15:38:15 -0400 Subject: [PySide] (no subject) Message-ID: Hi all, I want to create a footer on a TableWidget so I'm trying to stack a single row QTableWidget (self.footer) on top of the original one (self.table). Right now, I can see both table using the setStackingMode(QStackedLayout.StackAll) but I'm unable to move the footer at the bottom of self.table. Any suggestion for this? Also, I'm pretty sure there is a cleaner way to set flags to multiple table at once. Maybe a for loop that acts on a type of widget? Or I could also just make a list of those two tables a itterate through that list.. I'm thinking as I type. Any suggestions are welcome! Thank you from PySide.QtGui import * from PySide.QtCore import * class TableWidget(QWidget): def __init__(self): super(TableWidget, self).__init__() self.setMinimumSize(400, 300) self.table = QTableWidget() self.table.setColumnCount(2) self.table.setRowCount(5) self.table.setSelectionMode(QTableView.ExtendedSelection) self.table.setSelectionBehavior(QTableView.SelectRows) self.table.setSortingEnabled(1) self.table.setAlternatingRowColors(True) self.table.horizontalHeader().setStretchLastSection(True) self.table.verticalHeader().setVisible(False) self.table.setColumnWidth(0, 180) self.table.horizontalHeader().setVisible(False) self.table.setEditTriggers(QAbstractItemView.NoEditTriggers) self.footer = QTableWidget() self.footer.setRowCount(1) self.footer.setColumnCount(2) self.footer.setSelectionMode(QTableView.ExtendedSelection) self.footer.setSelectionBehavior(QTableView.SelectRows) self.footer.setSortingEnabled(1) self.footer.setAlternatingRowColors(True) self.footer.horizontalHeader().setStretchLastSection(True) self.footer.verticalHeader().setVisible(False) self.footer.setColumnWidth(0, 180) self.footer.horizontalHeader().setVisible(False) self.footer.setEditTriggers(QAbstractItemView.NoEditTriggers) self.footer.setMaximumHeight(35) self.footer.move(0,200) self.table_stack = QStackedLayout() self.table_stack.addWidget(self.table) self.table_stack.addWidget(self.footer) self.table_stack.setStackingMode(QStackedLayout.StackAll) self.setLayout(self.table_stack) a = TableWidget() a.show() -- Bruno-Pierre Jobin www.bpjobin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed May 24 22:24:58 2017 From: timr at probo.com (Tim Roberts) Date: Wed, 24 May 2017 13:24:58 -0700 Subject: [PySide] (no subject) In-Reply-To: References: Message-ID: Bruno-Pierre Jobin wrote: > > I want to create a footer on a TableWidget so I'm trying to stack a > single row QTableWidget (self.footer) on top of the original one > (self.table). Right now, I can see both table using the > setStackingMode(QStackedLayout.StackAll) but I'm unable to move the > footer at the bottom of self.table. Any suggestion for this? What are you actually trying to achieve here? The stacking widget stacks widgets on top of each other, like sheets in a ream of paper. Only the one on top is visible. If you want the footer to always be at the bottom, perhaps you want to add both of them to a QVBoxLayout, or even a grid. > Also, I'm pretty sure there is a cleaner way to set flags to multiple > table at once. Maybe a for loop that acts on a type of widget? Or I > could also just make a list of those two tables a itterate through > that list.. I'm thinking as I type. You can certainly do something like: for table in self.table, self.footer: table.commonAttribute1() table.commonAttribute2() -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From schampailler at skynet.be Thu May 25 10:27:26 2017 From: schampailler at skynet.be (Stefan Champailler) Date: Thu, 25 May 2017 10:27:26 +0200 Subject: [PySide] (no subject) In-Reply-To: References: Message-ID: <20170525102726.24860ac0@debian> Hi Bruno, QVBoxLayout as proposed elesewhere ? But the trouble you (may) have is to make sure the columns of the table are aligned on those of the footer table. That may be tricky to achieve. stF On Wed, 24 May 2017 15:38:15 -0400 Bruno-Pierre Jobin wrote: > Hi all, > > I want to create a footer on a TableWidget so I'm trying to stack a single > row QTableWidget (self.footer) on top of the original one (self.table). > Right now, I can see both table using the > setStackingMode(QStackedLayout.StackAll) but I'm unable to move the footer > at the bottom of self.table. Any suggestion for this? > > Also, I'm pretty sure there is a cleaner way to set flags to multiple table > at once. Maybe a for loop that acts on a type of widget? Or I could also > just make a list of those two tables a itterate through that list.. I'm > thinking as I type. > > Any suggestions are welcome! > Thank you > > > > from PySide.QtGui import * > from PySide.QtCore import * > > class TableWidget(QWidget): > def __init__(self): > super(TableWidget, self).__init__() > self.setMinimumSize(400, 300) > > self.table = QTableWidget() > self.table.setColumnCount(2) > self.table.setRowCount(5) > self.table.setSelectionMode(QTableView.ExtendedSelection) > self.table.setSelectionBehavior(QTableView.SelectRows) > self.table.setSortingEnabled(1) > self.table.setAlternatingRowColors(True) > self.table.horizontalHeader().setStretchLastSection(True) > self.table.verticalHeader().setVisible(False) > self.table.setColumnWidth(0, 180) > self.table.horizontalHeader().setVisible(False) > self.table.setEditTriggers(QAbstractItemView.NoEditTriggers) > > self.footer = QTableWidget() > self.footer.setRowCount(1) > self.footer.setColumnCount(2) > self.footer.setSelectionMode(QTableView.ExtendedSelection) > self.footer.setSelectionBehavior(QTableView.SelectRows) > self.footer.setSortingEnabled(1) > self.footer.setAlternatingRowColors(True) > self.footer.horizontalHeader().setStretchLastSection(True) > self.footer.verticalHeader().setVisible(False) > self.footer.setColumnWidth(0, 180) > self.footer.horizontalHeader().setVisible(False) > self.footer.setEditTriggers(QAbstractItemView.NoEditTriggers) > self.footer.setMaximumHeight(35) > self.footer.move(0,200) > > self.table_stack = QStackedLayout() > self.table_stack.addWidget(self.table) > self.table_stack.addWidget(self.footer) > self.table_stack.setStackingMode(QStackedLayout.StackAll) > > self.setLayout(self.table_stack) > a = TableWidget() > a.show() > > > > > > > > -- > Bruno-Pierre Jobin > www.bpjobin.com -- Timeo Danaos et dona ferentes Twitter : @Arakowa1