Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #57259
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <vincent.vandevyvre@swing.be> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'url:launchpad': 0.05; 'app,': 0.09; 'buttons': 0.09; 'rows': 0.09; 'skip:/ 10': 0.09; 'python': 0.11; 'cheers': 0.12; 'archive': 0.14; 'complaining': 0.16; 'context:': 0.16; 'from:addr:swing.be': 0.16; 'from:addr:vincent.vandevyvre': 0.16; 'from:name:vincent vande vyvre': 0.16; 'message-id:@swing.be': 0.16; 'missing?': 0.16; 'oqapy': 0.16; 'paqager': 0.16; 'received:mobistar.be': 0.16; 'there...': 0.16; 'ui,': 0.16; 'url:oqapy': 0.16; 'url:paqager': 0.16; 'url:qarte': 0.16; 'v.v.': 0.16; '\xe9crit': 0.16; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'looks': 0.24; "i've": 0.25; 'this:': 0.26; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'designer': 0.30; "i'm": 0.30; 'loads': 0.31; 'skip:= 20': 0.31; 'file': 0.32; 'run': 0.32; 'url:python': 0.33; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'really': 0.36; 'changing': 0.37; 'so,': 0.37; 'list': 0.37; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'is.': 0.60; 'simple': 0.61; 'show': 0.63; 'name': 0.63; 'within': 0.65; 'life': 0.66; 'layout.': 0.84 |
| Date | Tue, 22 Oct 2013 15:41:07 +0200 |
| From | Vincent Vande Vyvre <vincent.vandevyvre@swing.be> |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: PY QT |
| References | <1382446886842-5036684.post@n6.nabble.com> |
| In-Reply-To | <1382446886842-5036684.post@n6.nabble.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1353.1382449278.18130.python-list@python.org> (permalink) |
| Lines | 57 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1382449278 news.xs4all.nl 15892 [2001:888:2000:d::a6]:58598 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:57259 |
Show key headers only | View raw
Le 22/10/2013 15:01, Forsgren a écrit : > I'm really embarrassed to be asking this, I feel that there is a really > simple answer to this, but I cant for the life of me find it. > So, I have this app, which loads a ui, which has a scrollarea that is a > parent to a gridlayout. > > So in QT designer it looks like this: > > />someParentWidgets >> scrollArea >> myGridLayout/ > > I then want to add a couple of Qtool buttons to the GridLayout within my > python code, so i run a forloop: > > /> for name in mylist: >> btn =QtGui.QToolButton() >> btn.setText(str(name)) >> >> cols = self.myGridLayout.count()%6 >> rows = int(self.myGridLayout.count()/6) >> self.myGridLayout.addWidget(btn,rows,cols)/ > No errors, no complaining what so ever, but the buttons isn't showing in the > layout. > The thing is if I change my ui file to > > />someParentWidgets >> myGridLayout > / > > The buttons show perfectly fine! What am I missing? I've tried changing the > GridLayout to a verticalLayout, but same thing there... > > > > > > > > -- > View this message in context: http://python.6.x6.nabble.com/PY-QT-tp5036684.html > Sent from the Python - python-list mailing list archive at Nabble.com. Why are you using % 6 on QLayout.count() ? QLayout.count() returns the number of the items into the layout but not where are is. If you want to know the number of rows and columns, you have rowCount() and columnCount(). Cheers -- Vincent V.V. Oqapy <https://launchpad.net/oqapy> . Qarte <https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: PY QT Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2013-10-22 15:41 +0200
csiph-web