Important: Please read the Qt Code of Conduct -

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);
    connect(shortcutAlbumPlus, SIGNAL(activated()), this, SLOT(ctrlplusEntered()));

    QShortcut *shortcutAlbumMinus = new QShortcut(QKeySequence("Ctrl+-"), ui->albumView);
    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