jiveaxe
8th January 2008, 18:13
Hi and happy new year,
this is my problem:
my mainDialog has a qlistview. When I click on an item a modeless dialog is open showing some informations related to the item. What i want is that pressing, for example, PagDown it shows me informations on the next item of the qlistview (so having the focus on the informationDialog and without clicking on the item).
I have created this event:
void informationDialog::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_PageUp){
emit previousTitle();
}
else if (event->key() == Qt::Key_PageDown){
emit nextTitle();
}
}
and in mainDialog:
void MainDialog::viewTitle(const QModelIndex& current)
{
if(!informationDialog) {
informationDialog = new InformationDialog;
connect(informationDialog, SIGNAL(previuosTitle()), this, SLOT(showPreviuosTitle()));
connect(informationDialog, SIGNAL(nextTitle()), this, SLOT(showNextTitle()));
}
informationDialog->currentSelected(current);
}
Which code I have to put in showPreviuosTitle()?
Thanks
this is my problem:
my mainDialog has a qlistview. When I click on an item a modeless dialog is open showing some informations related to the item. What i want is that pressing, for example, PagDown it shows me informations on the next item of the qlistview (so having the focus on the informationDialog and without clicking on the item).
I have created this event:
void informationDialog::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_PageUp){
emit previousTitle();
}
else if (event->key() == Qt::Key_PageDown){
emit nextTitle();
}
}
and in mainDialog:
void MainDialog::viewTitle(const QModelIndex& current)
{
if(!informationDialog) {
informationDialog = new InformationDialog;
connect(informationDialog, SIGNAL(previuosTitle()), this, SLOT(showPreviuosTitle()));
connect(informationDialog, SIGNAL(nextTitle()), this, SLOT(showNextTitle()));
}
informationDialog->currentSelected(current);
}
Which code I have to put in showPreviuosTitle()?
Thanks