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 drag an image to the wdget?
Qt 6.11 is out! See what's new in the release blog

How to drag an image to the wdget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.3k 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.
  • G Offline
    G Offline
    Geng.Y
    wrote on last edited by
    #1

    I wanna drag an image to the widget to load it just like many image application(e.g. PS), which makes things much easier. How can I achieve this function?
    0_1500983472409_QQ截图20170725195001.jpg

    raven-worxR 1 Reply Last reply
    0
    • G Geng.Y

      I wanna drag an image to the widget to load it just like many image application(e.g. PS), which makes things much easier. How can I achieve this function?
      0_1500983472409_QQ截图20170725195001.jpg

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @Geng.Y
      from where does the drag come from? From the filesystem or from another application?
      Basically it is just a check for the mime-type. But also make sure to read about Drag-n-Drop in Qt.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Geng.Y
        wrote on last edited by
        #3

        For example, from desktop .

        raven-worxR 1 Reply Last reply
        0
        • G Geng.Y

          For example, from desktop .

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Geng.Y
          then check out the link i've posted before and check for the text/uri-list mime-type or use QMimeData::urls()

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          2
          • G Offline
            G Offline
            Geng.Y
            wrote on last edited by
            #5

            @raven-worx said in How to drag an image to the wdget?:

            text/uri-list

            Sorry,I don't understand this "text/uri-list"

            raven-worxR 1 Reply Last reply
            0
            • G Geng.Y

              @raven-worx said in How to drag an image to the wdget?:

              text/uri-list

              Sorry,I don't understand this "text/uri-list"

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @Geng.Y
              did you finally read the link i've posted?!
              do you understand what mime-types actually are?

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              1

              • Login

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