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 create border around modal window
Qt 6.11 is out! See what's new in the release blog

How to create border around modal window

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 369 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.
  • M Offline
    M Offline
    masa4
    wrote on last edited by
    #1

    I want to create border around my modal which inherits from QWidget. I tried setting stylesheet to top layout but it doesnt create a border. I tried this:

    QHBoxLayout#layoutbox {
         background-color: red;
         border-style: outset;
         border-width: 2px;
         border-radius: 10px;
         border-color: beige;
         font: bold 14px;
         min-width: 10em;
         padding: 6px;
     }
    

    How can i do that?

    JoeCFDJ 1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @masa4 It would be new to me that layouts can have styles. Layouts are not widgets and have no graphical representation. You need to set stylesheet on your widget.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M masa4

        I want to create border around my modal which inherits from QWidget. I tried setting stylesheet to top layout but it doesnt create a border. I tried this:

        QHBoxLayout#layoutbox {
             background-color: red;
             border-style: outset;
             border-width: 2px;
             border-radius: 10px;
             border-color: beige;
             font: bold 14px;
             min-width: 10em;
             padding: 6px;
         }
        

        How can i do that?

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3
        This post is deleted!
        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