Hi all!
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.
//slot
function doubleClicked(&$index)
{
print_r($index);
}
prints:
QObject Object
(
[0] => 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:
$this->connect($this->tblSearchResults,
SIGNAL("doubleClicked(QModelIndex)"), $this,
SLOT("doubleClicked(QModelIndex)"));
Many thanks in advance,
Ferenc
|