From: Ferenc Veres <lion@ne...> - 2006-11-29 00:17:29
First of all: the current php_qt versions is very great! I tried a lot
of controls and functions. :-) Congratulations! ;-)
My questions may be general Qt questions, but I hope it's acceptable on
this list. Is it?
1. Html like tables?
Can I make a QTableView (or something related) which works like a HTML
table? (I am a web programmer, did not make any GUI stuff in this
century!) I mean: the table cell would expand if the text is longer than
it could fit. Cell would break the lines and expand vertically to
display all text. Can I do that with any kind of tables in Qt?
(My program displays English and translated strings in two columns, and
it is important to see the complete text, because the aim of the program
is to choose from previous translations. Maybe I should re-think the idea.)
2. Connect doubleClick of tables?
I use the doubleClicked signal of QTableView (it is inherited from
QAbstractItemView). My slot function is called, but the argument is not
the right type. According to documentation it should be QModelIndex, but
I think I get QObject.
 => 168
If I define the function with specifying the type of the $index
(QModelIndex &$index), I get PHP error about wrong type when called. If
I try to print $index->row(), program quits.
Ok, maybe PHP print_r prints the base class of the class, but I don't
know how to test it. (?) Printing $index->isValid() also stops the
program. (I think this signal is never emitted with not valid index.)
Signal documentation says:
void doubleClicked ( const QModelIndex & index )
my Connect command is:
Many thanks in advance,
From: Ferenc Veres <lion@ne...> - 2006-12-08 20:53:55
I solved the problems.
Ferenc Veres wrote, On 2006-11-29 01:27:
> 1. Html like tables?
I copy the selected row's content to two (wordwrap true) QLabels above
the table, that can display long text too, thus users can read the long
text entries from the table by selecting the row. (Maybe I'll change
those to two read-only QTextEdits later. (To allow scrolling of even
longer text entries.)
> 2. Connect doubleClick of tables?
I use QTableWidget, which has cellCliked and cellDoubleClicked, these
functions return X,Y to the click. Thus I can get the content by
->item(y,x). (This signal gives the X value in both variables, that may
be a little bug in php_qt, or something in my program, I'll keep on
debugging. :) )