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. How to create movable and resizable image ?
Forum Updated to NodeBB v4.3 + New Features

How to create movable and resizable image ?

Scheduled Pinned Locked Moved General and Desktop
qlabelqimage
2 Posts 2 Posters 1.4k Views 2 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
    Shanmugasundaram.V
    wrote on last edited by
    #1

    Hi Friends.,
    In my project i want to create user movable and resizable image in the QWidget, i used QLabel for moving the label ( drag ) and could not find how to set the QLabel in resizable.
    I mean user will select the Image and increase and decrease the image width and height using mouse. I need help for done this resizable options. i could not find any solutions.

    Thanks in advance.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      Hi, welcome to devnet.

      Here's one way:
      Override mousePressEvent. Inside check if the cursor is near the edge (use pos and rect for that). If it is then check which one and setOverrideCursor to something suitable. Remember the edge (or corner) that was pressed. Next, in the mouseMoveEvent setGeometry accordingly and handle mouseReleaseEvent to restoreOverrideCursor.

      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