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. [SOLVED] Prevent users from moving Icons in QListWidget (IconMode)
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Prevent users from moving Icons in QListWidget (IconMode)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.5k 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.
  • A Offline
    A Offline
    Adelost
    wrote on 18 May 2013, 20:43 last edited by
    #1

    I have a QListWidget with icon mode enabled:
    @setViewMode(QListView::IconMode);
    setResizeMode(QListWidget::ResizeMode::Adjust);
    setEditTriggers(QAbstractItemView::NoEditTriggers);
    @

    !http://i.imgur.com/2YAGNOn.png(QListWidget IconMode)!

    However, I am still able to move and rearrange the icons. I would like to prevent this. I thought "NoEditTriggers" would solve the problem, but it appears not.

    Any suggestions?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      PeerS
      wrote on 19 May 2013, 11:43 last edited by
      #2

      Without trying it, just from the docu I would try
      @
      setMovement(QListView::Static)
      @

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Adelost
        wrote on 19 May 2013, 18:45 last edited by
        #3

        Thanks, that solved it!

        I was begin fearing I would have to do something crazy, like installing an EventFilter. Perhaps I should look through the documentation more carefully next time.

        1 Reply Last reply
        0

        1/3

        18 May 2013, 20:43

        • Login

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