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. Image view question
Forum Updated to NodeBB v4.3 + New Features

Image view question

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.2k 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.
  • N Offline
    N Offline
    Nevering
    wrote on last edited by
    #1

    I'm looking for the right classes to use for a specific task. I'd like to have a view in a window that displays an image of a form, say a real estate form, and be able to lay various type of fields on top of that representing data to be filled out according to the form's requirements. This part of the app should support scrolling and resizing of the form and the associated field location to be pegged to the location on the form.
    This is likely be a desktop app, so I've started looking at the imageviewer example and will play with that. If anyone has a suggestion on which direction I should take, or if QT will even support this. I'm assuming yes, since most things that C++ or C#.net can do QT can do also. I'm able to do this in C#.net.

    thanks for any help on this

    raven-worxR 1 Reply Last reply
    0
    • N Nevering

      I'm looking for the right classes to use for a specific task. I'd like to have a view in a window that displays an image of a form, say a real estate form, and be able to lay various type of fields on top of that representing data to be filled out according to the form's requirements. This part of the app should support scrolling and resizing of the form and the associated field location to be pegged to the location on the form.
      This is likely be a desktop app, so I've started looking at the imageviewer example and will play with that. If anyone has a suggestion on which direction I should take, or if QT will even support this. I'm assuming yes, since most things that C++ or C#.net can do QT can do also. I'm able to do this in C#.net.

      thanks for any help on this

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

      @Nevering
      I hope i got you correctly:

      1. subclass QWidget/QFrame and reimplement the paintEvent() handler (see below)
      2. construct your widget placement by setting a layout on this widget
      void MyWidget::paintEvent( QPaintEvnet* event )
      {
              QPixmap pix(...);
      
             QRect rect = rect();
             QSize size = pix.size();
                  size.scale( rect.size(), Qt::KeepAspectRatio );
             QRect targetRect( QPoint(0,0), size );
                 targetRect.moveLeft( (rect.width() - size.width()) / 2 );
      
           QPainter p(this);
            p.drawPixmap( targetRect, pix );
      }
      

      --- 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
      • N Offline
        N Offline
        Nevering
        wrote on last edited by Nevering
        #3

        I'm new to QT, so obviously I'm struggling. The best example of what I'm looking for is a PDF document with fill-able fields on it.

        Can the image be put into the background with fields on top ? And image and field data are printable at normal page size with fields in correct locations ? I've been looking for an example of this, seems this would have been done before.

        thanks

        1 Reply Last reply
        0
        • N Offline
          N Offline
          Nevering
          wrote on last edited by
          #4

          Is LIKE a PDF fill-able document. Image with fields on it.

          1 Reply Last reply
          0
          • jerome_isAviableJ Offline
            jerome_isAviableJ Offline
            jerome_isAviable
            wrote on last edited by
            #5

            Hi Nevering,
            Not sure i well understand, but i think it is a job for QGraphicsView.
            The idea is to create a QGraphicsView, then add a QGraphicsItem in a scene. Each item is a kind of graphic (it could be video images, or texts, etc...) who are linked in a scene has you need. from there, you can modify each item in the scene or move them... dynamically.
            Look at example around qgraphicsview from qt examples, i think it is what you need to use (if i well understand).

            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