Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Resizing Items in QListView
Forum Updated to NodeBB v4.3 + New Features

Resizing Items in QListView

Scheduled Pinned Locked Moved Unsolved General and Desktop
qlistview
3 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shahriar25
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      shahriar25
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • CharbyC Offline
        CharbyC Offline
        Charby
        wrote on last edited by
        #3

        Did you try to redefine wheelEvent of your list view?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved