Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > setTextAlignment function Qtablewidget PyQt

Reply
Thread Tools

setTextAlignment function Qtablewidget PyQt

 
 
Zabin
Guest
Posts: n/a
 
      01-11-2010
Hey!

I am trying to align contents of some table cells but find the code
below working for some fields and not for others. I am stuck as to why
this is happening. Help will be gretly appreciated!

setTextAlignment(QtCore.Qt.AlignVCenter)

Cheers
Zabin
 
Reply With Quote
 
 
 
 
Zabin
Guest
Posts: n/a
 
      01-11-2010
On Jan 11, 1:10*pm, Zabin <(E-Mail Removed)> wrote:
> Hey!
>
> I am trying to align contents of some table cells but find the code
> below working for some fields and not for others. I am stuck as to why
> this is happening. Help will be gretly appreciated!
>
> setTextAlignment(QtCore.Qt.AlignVCenter)
>
> Cheers
> Zabin


Figured it out!
It was just the '\n' character being read with the line from the text
file that messed up the formatting.
just needed to use the line.strip() function before passing it to the
table as a table widget item.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[PyQt4] QTableWidget non editable Antonio Valentino Python 1 06-22-2008 03:37 PM
Re: PyQT / QDate / QTableWidget David Boddie Python 1 03-31-2008 10:02 PM
Setting the value of one cell in QTableWidget fills everything. Constantly Distracted Python 3 03-29-2008 08:46 AM
PyQT / QDate / QTableWidget wrightee Python 0 03-26-2008 02:13 PM
[PY GUI] interest function in python GUI(wxpython,pyqt) program.wxpython,pyqt ulysses Python 4 10-22-2003 03:28 PM



Advertisments