Resizing Items in QListView



  • Hi,
    I have QListView and I want it to resize the items( iconSize() & gridSize() ) when I press ctrl + "+" or ctrl + "-" or ctrl + mousewheel. How should I do that?



  • I found a way to set the Ctrl++ & Ctrl+- shortcuts:

    QShortcut *shortcutAlbumPlus = new QShortcut(QKeySequence("Ctrl++"), ui->albumView);
    shortcutAlbumPlus->setContext(Qt::WidgetShortcut);
    connect(shortcutAlbumPlus, SIGNAL(activated()), this, SLOT(ctrlplusEntered()));

    QShortcut *shortcutAlbumMinus = new QShortcut(QKeySequence("Ctrl+-"), ui->albumView);
    shortcutAlbumMinus->setContext(Qt::WidgetShortcut);
    connect(shortcutAlbumMinus, SIGNAL(activated()), this, SLOT(ctrlminusEntered()));
    

    but I have a problem with Ctrl+Roll(mousewheel). how do I know if it is wheeling down or up?



  • Did you try to redefine wheelEvent of your list view?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.