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. Get the brush color of objects in QgraphicsViews (For Squish testing)
Qt 6.11 is out! See what's new in the release blog

Get the brush color of objects in QgraphicsViews (For Squish testing)

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.4k 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by Qt Enthusiast
    #1

    Hi I have QTreeView and QGraphisview. From QtreeView I send a notification to QGrapphicsView and called setBrush to fill the colors in the selected items in QGraphicsView .

    For squish testing I want to get the color of Selected objects in in QgraphicsView

    Can someone guide for this

    raven-worxR 1 Reply Last reply
    0
    • Y Offline
      Y Offline
      YuriQ
      wrote on last edited by
      #2

      I'm not sure I understand what you are doing... Do you use your own graphics items or standard graphics items (e.g. QGraphicsRectItem)? How exactly you filling items in QGraphicsView?

      1 Reply Last reply
      0
      • Q Qt Enthusiast

        Hi I have QTreeView and QGraphisview. From QtreeView I send a notification to QGrapphicsView and called setBrush to fill the colors in the selected items in QGraphicsView .

        For squish testing I want to get the color of Selected objects in in QgraphicsView

        Can someone guide for this

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

        @Qt-Enthusiast said:

        For squish testing I want to get the color of Selected objects in in QgraphicsView

        i haven't used Squish for a while now so i am not much of a help here. But IIRC Squish hooks into the application and accessing the object directly in the memory space.
        So i am afraid you will only see what Froglogic wants you to see in the test suite.

        But isn't there also python scripting available? Maybe this way you can access more properties?

        Anyway Froglogic most probably can answer you this question the best.

        --- 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
        • Q Offline
          Q Offline
          Qt Enthusiast
          wrote on last edited by Qt Enthusiast
          #4

          class Myitem : public QGraphicsItem
          {
          }

          foreach (QGraphicsItem* item, scene()->selectedItems()) {
          if (MyItem* pItem = static_cast<MyItem*>(item)) {
          pItem->setBrushStyle(Qt::SolidPattern, true);
          pItem->setBrushColor(color);
          }
          }
          Please see how I am coloring the items

          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