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. Building UI with QGraphics

Building UI with QGraphics

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 5.1k Views
  • 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.
  • D Offline
    D Offline
    decko
    wrote on last edited by
    #1

    Hi

    I'm trying to learn how to build custom ui's with the QGraphics classes. However there are a lot of those and I'm having trouble finding out where to start, and which of them I should be using.

    For testing out the various features I have chosen to make sort of a media center ui for browsing music albums and tracks. This should consist of 2 "pages".

    Page 1: "http://i55.tinypic.com/ac6e5v.png":http://i55.tinypic.com/ac6e5v.png
    Page 2: "http://i53.tinypic.com/2vkhh7s.png":http://i53.tinypic.com/2vkhh7s.png

    The first page would show album covers and a title, and the user should be able to scroll through these. When an album is picked, some transition should lead the user to the next page.

    How should I go about doing this? Should the pages be 2 GraphicsViews or GraphicsScenes or something completely different? Should the individual elements on the pages be grouped in GraphicsLayouts or GraphicsItemGroups?

    Thanks in advance.

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

      There are different ways to use graphics views, where I prefer using paged layouts where all pages are kept in memory, this wastes memory unnecessarily, so using single graphics view which gets every time you switch to different ”page” data parsed from source, for example using your own scene.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mario
        wrote on last edited by
        #3

        Have you considered using QML instead of QGraphics (if possible)?

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kalle
          wrote on last edited by
          #4

          Note that these days, you have quite a few options for creating custom UI screens in Qt:

          • Custom widgets with their own custom painting

          • Using stylesheets

          • Developing a custom QStyle

          • Using QGraphicsView

          • Using QML

          A lot of developers use QGraphicsView, because it's hot and new and cool (can something be both hot and cool?), but often what they do is not really what QGraphicsView was made for (which is many small independent objects, possibly moving, possibly animated). What you are trying to do could just as well be done using existing widgets and a custom style (and depending on the complexity beyond what you show in the screenshots, maybe even with stylesheets).

          Of course, if what you are really after is learning about QGV, then by all means go ahead and have fun, and in that case, I agree with Smar for relatively static scenes.

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            if u want to explore other widgets, u culd just use the QTabWidget.. with 2 tabs, 2nd tab gets the focus when you pick the album in the first

            1 Reply Last reply
            0
            • D Offline
              D Offline
              decko
              wrote on last edited by
              #6

              Thanks for all of your answers, much appreciated. I've tried to look at qml and it seems like it can accomplish what I want, and it is relatively simple as well.

              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