Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Drawing a line in between QVBoxLayout
Forum Updated to NodeBB v4.3 + New Features

Drawing a line in between QVBoxLayout

Scheduled Pinned Locked Moved Mobile and Embedded
3 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.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by
    #1

    I need to draw a line between each LED in QVBoxlayout or QHBoxlayout. In below link, any idea?
    http://qt-project.org/doc/qt-5/qtwidgets-statemachine-trafficlight-example.html

    Another question, can the width and height of the Ellipse determined.
    painter.drawEllipse(0, 0, width(), height());

    1 Reply Last reply
    0
    • GianlucaG Offline
      GianlucaG Offline
      Gianluca
      wrote on last edited by
      #2

      I have several ideas.
      You can follow the example of LightWidget and create a LineWidget that draw a line and put into the QVBoxLayout between the LEDs.
      Or you can draw the line directly on the LightWidget on top and bottom and add two boolean property for enable the display of the line above or below
      Or you can use a default empty QWidget with a fixed height representing the height of your line and use the Qt Style Sheet to set the background of the QWidget that will correspond to the color of the line.
      Or you can use a QFrame and setting the border style and dimension in such way that will appear as a single line.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        houmingc
        wrote on last edited by
        #3

        thanks, i got it

        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