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 do I reset the border-radius?

How do I reset the border-radius?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 223 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1
    QString strStyle = "QFrame{border-radius:{data}px;	background-color: rgba(124, 146, 166, 100);}";
    strStyle.replace("{data}", QString::number((m_Size.width()-50) / 2));
    this->ui.circulat_bg->setStyleSheet(strStyle);
    

    How do I reset the border-radius?

    The widget is not fixed and I want to change the size to setFixed, but is there any way to make the frame smaller depending on the size of the widget as I changed the size of the widget to the original one?

    Pl45m4P 1 Reply Last reply
    0
    • I IknowQT
      QString strStyle = "QFrame{border-radius:{data}px;	background-color: rgba(124, 146, 166, 100);}";
      strStyle.replace("{data}", QString::number((m_Size.width()-50) / 2));
      this->ui.circulat_bg->setStyleSheet(strStyle);
      

      How do I reset the border-radius?

      The widget is not fixed and I want to change the size to setFixed, but is there any way to make the frame smaller depending on the size of the widget as I changed the size of the widget to the original one?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @IknowQT

      There's a better way to insert values to your stylesheet string :)
      You don't need string.replace. Try
      QString("QFrame{border-radius:%1px; background-color: rgba(124, 146, 166, 100);}").arg(data);

      You can reset a stylesheet by passing an empty string
      setStylesheet("");
      But it will reset everything. Then you have to set your color again.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2

      • Login

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