Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53855

Logical error in filling QTableWidget and filling all of nodes

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <mohsen@pahlevanzadeh.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:error': 0.03; '(all': 0.07; 'column': 0.07; 'rows': 0.09; 'skip:/ 10': 0.09; 'columns': 0.16; 'nodes': 0.16; 'skip:q 30': 0.16; 'skip:q 50': 0.16; 'widgets.': 0.16; 'skip:# 20': 0.16; 'all,': 0.19; 'import': 0.22; 'print': 0.22; 'question': 0.24; 'code': 0.31; 'node': 0.31; 'ok.': 0.31; 'skip:q 20': 0.31; 'subject:all': 0.32; 'but': 0.35; 'yours,': 0.36; 'filled': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'dear': 0.65; 'subject:Logical': 0.84
DKIM-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pahlevanzadeh.org; s=default; h=Content-Transfer-Encoding:Mime-Version:Content-Type:Date:To:From:Subject:Message-ID; bh=r2nqwlqZYdtixpMnAJqACzoUrDJjmUIBVIzedXnvkUw=; b=rDYZPckW9RiGMFK9vsMXWd751EpiwZJcU4uTLrqPKNt7QLZMpznEAwvgvc3uf001H7vrUEBxUfkqcBTOO7u0iI8CWkfvJ4ABFNHNrOs9i59SUwQ2BQ5XK6+yvy/yY8/7YwNMNOWLtxKsNCDw2k+mMqWjHMxNGJkLauibq54PO4s=;
Subject Logical error in filling QTableWidget and filling all of nodes
From Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org>
To python-list@python.org
Date Mon, 09 Sep 2013 09:45:16 +0430
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.4.4-4+b1
Mime-Version 1.0
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - part7.royal-servers.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - pahlevanzadeh.org
X-Get-Message-Sender-Via part7.royal-servers.com: authenticated_id: mohsen@pahlevanzadeh.org
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.163.1378703734.5461.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1378703734 news.xs4all.nl 15871 [2001:888:2000:d::a6]:48400
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53855

Show key headers only | View raw


Dear All,

I have the following code (PyQt):

/////////////////
searchFrameObject.tableWidget.setRowCount(rowCounter)
searchFrameObject.tableWidget.setColumnCount(5)

for row in range(rowCounter):
    for column in range(5):
        for result in query:

            item = QtGui.QTableWidgetItem(_fromUtf8(result.name))
            item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEnabled)
            searchFrameObject.tableWidget.setItem(row,column,item)

            #item = QtGui.QTableWidgetItem(String(result.bought_price))
            #item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEnabled)
            #searchFrameObject.tableWidget.setItem(row,column+1,item)

            #item = QtGui.QTableWidgetItem(result.bought_date)
            #item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEnabled)
            #searchFrameObject.tableWidget.setItem(row,column+2,item)

            item = QtGui.QTableWidgetItem(result.stock)
            item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEnabled)
            searchFrameObject.tableWidget.setItem(row,column+3,item)

            item = QtGui.QTableWidgetItem(result.minimum_bound)
            item.setFlags(item.flags() ^ QtCore.Qt.ItemIsEnabled)
            searchFrameObject.tableWidget.setItem(row,column+4,item)
////////////////

When i search in DB, i print result.name or print result.stock ,
everything is OK. But when i import them into QtableWidget i see just
node result.name addeed to widgets. (all of nodes filled from
result.name)

My Question is , How i fill rows and columns with my fields?


Yours,
Mohsen

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Logical error in filling QTableWidget and filling all of nodes Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-09-09 09:45 +0430

csiph-web