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. [solved] Removing borders
Qt 6.11 is out! See what's new in the release blog

[solved] Removing borders

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 3.0k 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.
  • T Offline
    T Offline
    ThaRez
    wrote on last edited by
    #1

    Hello
    I'm new to -QT- Qt and would have a following question.

    I've developed a simple widget that only consists of a label with a pixmap set to it, attached to a QBoxLayout combined with some functions. I'm trying to get it to cover the whole screen in an embedded device, but when I show it there are narrow borders around the picture set to the label. I tried removes these with the following line

    a.setStyleSheet("* {margin: 0px;border:0px;padding:0px;}");

    without any success. Could you please advice me how to display the picture to cover the complete screen area? The widget is showed on its own, not attached to a mainwindow. Thank you!
    Best regards
    Richard

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alfah
      wrote on last edited by
      #2

      richard,

      wat is a?

      alfah

      1 Reply Last reply
      0
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        Hi ThaRez,

        Welcom to the devnet forums.

        A similar question has been asked before. The solution is you draw on border-image using a stylesheet.
        If you have a look in "the following topic":http://developer.qt.nokia.com/forums/viewthread/8542/, you will see all the details and links to the docs that describe why it is like that.

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • T Offline
          T Offline
          ThaRez
          wrote on last edited by
          #4

          Hello
          Thank you for the responses! Sorry for not being clear, a is the QApplication

          QApplication a(argc, argv);

          I manage to get it working, the magic was the following line:

          mainLayout->setContentsMargins(0, 0, 0, 0);

          applied to the QVBoxLayout to which the label was added.
          Best regards
          Richard

          1 Reply Last reply
          0
          • EddyE Offline
            EddyE Offline
            Eddy
            wrote on last edited by
            #5

            We are glad you solved it. thanks for letting us know and showing the solution so others can benefit from it.

            Could you please edit your title and ad [solved] in front of it? This is a workaround.
            A better solution is in the making for marking a topic as solved.

            Qt Certified Specialist
            www.edalsolutions.be

            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