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 implement Grid/Dots in Qwidget background
Servers for Qt installer are currently down

How to implement Grid/Dots in Qwidget background

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.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.
  • V Offline
    V Offline
    vicky12
    wrote on 6 May 2014, 12:59 last edited by
    #1

    !http://i.imgur.com/I7HR9is.png(http://i.imgur.com/I7HR9is)!

    can any body help me with how to implement this dots or gris form in backround or Qwidget or any other ?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 6 May 2014, 14:59 last edited by
      #2

      You could look at how QtDesigner does it, but it seems simple enough to me. Subclass a QWidget, reimplement the paintEvent, and simply fill the widget area with a pattern. You can do that by creating a small QImage in which you draw a single dot, set that image on a QBrush, and use that brush to fill the widget rect with QPainter.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andreyc
        wrote on 6 May 2014, 15:50 last edited by
        #3

        Take a look on "Undo Framework example":http://qt-project.org/doc/qt-5/qtwidgets-tools-undo-example.html they show grid background.
        You can do something similar to have dotted background.

        1 Reply Last reply
        0

        1/3

        6 May 2014, 12:59

        • Login

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