I'm a designer, not a coder. I will try to understand the programming suggestions you guys give me.

I am using the QT5 designer to make a simple login page. Was about 80% done and decided to modify the StyleSheets of the buttons so they don't look so 2007.

I noticed 2 "bugs":
1. When I change the background color of the button, it doesn't update in the canvas/viewport. It' stays the default grey color until I run the program and the color shows up only in the live program.
2. When I add a slight amount of rounding to the corner of the burtons, they do not work at all. You can't press them, and hover doesn't work either. I would really like to keep the rounded corners but it's just not working for some reason.
I tried "bring to front" in case there was an invisible box obscuring them, and nothing changed.

Help? I have no clue how to fix this, I am not a programmer.



Qt Code:
  1. #include "mainwindow.h"
  2.  
  3. #include <QApplication>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8. MainWindow w;
  9. w.show();
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 


Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent)
  5. : QMainWindow(parent)
  6. , ui(new Ui::MainWindow)
  7. {
  8. ui->setupUi(this);
  9. }
  10.  
  11. MainWindow::~MainWindow()
  12. {
  13. delete ui;
  14. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ui version="4.0">
  3. <class>MainWindow</class>
  4. <widget class="QMainWindow" name="MainWindow">
  5. <property name="geometry">
  6. <rect>
  7. <x>0</x>
  8. <y>0</y>
  9. <width>800</width>
  10. <height>600</height>
  11. </rect>
  12. </property>
  13. <property name="windowTitle">
  14. <string>MainWindow</string>
  15. </property>
  16. <property name="styleSheet">
  17. <string notr="true">#centralwidget {background: qradialgradient(cx: 0.3, cy: -0.4, fx: 0.3, fy: -0.4, radius: 1.35, stop: 0 #962D3E, stop: 1 #343642);}
  18. </string>
  19. </property>
  20. <widget class="QWidget" name="centralwidget">
  21. <layout class="QVBoxLayout" name="verticalLayout">
  22. <item>
  23. <widget class="QWidget" name="TopPanel" native="true">
  24. <property name="sizePolicy">
  25. <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
  26. <horstretch>10</horstretch>
  27. <verstretch>0</verstretch>
  28. </sizepolicy>
  29. </property>
  30. <property name="styleSheet">
  31. <string notr="true"/>
  32. </property>
  33. <layout class="QHBoxLayout" name="horizontalLayout">
  34. <item>
  35. <widget class="QPushButton" name="Help">
  36. <property name="styleSheet">
  37. <string notr="true">font: 63 16pt &quot;Cocogoose&quot;;
  38. background-color: rgb(52, 136, 153);
  39. selection-background-color: rgb(150, 45, 62);
  40. color: rgb(255, 255, 255);
  41. border-color: rgb(255, 255, 255);
  42. border-radius: 5px;
  43. padding: 0 8px;</string>
  44. </property>
  45. <property name="text">
  46. <string>?</string>
  47. </property>
  48. </widget>
  49. </item>
  50. <item>
  51. <spacer name="horizontalSpacer">
  52. <property name="orientation">
  53. <enum>Qt::Horizontal</enum>
  54. </property>
  55. <property name="sizeHint" stdset="0">
  56. <size>
  57. <width>40</width>
  58. <height>20</height>
  59. </size>
  60. </property>
  61. </spacer>
  62. </item>
  63. <item>
  64. <widget class="QPushButton" name="Exit">
  65. <property name="styleSheet">
  66. <string notr="true">font: 63 16pt &quot;Cocogoose&quot;;
  67. background-color: rgb(150, 45, 62);
  68. color: rgb(255, 255, 255);
  69. border-color: rgb(255, 255, 255);
  70. border-radius: 5px;
  71. padding: 0 8px;</string>
  72. </property>
  73. <property name="text">
  74. <string>X</string>
  75. </property>
  76. </widget>
  77. </item>
  78. </layout>
  79. <zorder>horizontalSpacer</zorder>
  80. <zorder>Help</zorder>
  81. <zorder>Exit</zorder>
  82. </widget>
  83. </item>
  84. <item>
  85. <layout class="QHBoxLayout" name="horizontalLayout_2">
  86. <property name="topMargin">
  87. <number>0</number>
  88. </property>
  89. <item>
  90. <spacer name="verticalSpacer_2">
  91. <property name="orientation">
  92. <enum>Qt::Vertical</enum>
  93. </property>
  94. <property name="sizeHint" stdset="0">
  95. <size>
  96. <width>20</width>
  97. <height>40</height>
  98. </size>
  99. </property>
  100. </spacer>
  101. </item>
  102. <item>
  103. <widget class="QLabel" name="Logo">
  104. <property name="sizePolicy">
  105. <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
  106. <horstretch>0</horstretch>
  107. <verstretch>0</verstretch>
  108. .
  109. .
  110. .
  111. .
  112. <widget class="QWidget" name="loginform" native="true">
  113. <property name="minimumSize">
  114. <size>
  115. <width>35</width>
  116. <height>35</height>
  117. </size>
  118. </property>
  119. <property name="styleSheet">
  120. <string notr="true">background: rgba(0, 0, 0, 80);
  121. border-radius: 8px;</string>
  122. </property>
  123. <layout class="QVBoxLayout" name="verticalLayout_2">
  124. <property name="topMargin">
  125. <number>10</number>
  126. </property>
  127. <item>
  128. <layout class="QHBoxLayout" name="password">
  129. <property name="topMargin">
  130. <number>0</number>
  131. </property>
  132. <item>
  133. <widget class="QLineEdit" name="user">
  134. <property name="minimumSize">
  135. <size>
  136. <width>0</width>
  137. <height>30</height>
  138. </size>
  139. </property>
  140. <property name="styleSheet">
  141. <string notr="true">color: rgb(255, 255, 255);
  142. font: 25 12pt &quot;COCOGOOSE &quot;;</string>
  143. </property>
  144. </widget>
  145. </item>
  146. </layout>
  147. </item>
  148. <item>
  149. <layout class="QHBoxLayout" name="username">
  150. <property name="topMargin">
  151. <number>0</number>
  152. </property>
  153. <item>
  154. <widget class="QLineEdit" name="pass">
  155. <property name="minimumSize">
  156. <size>
  157. <width>0</width>
  158. <height>30</height>
  159. </size>
  160. </property>
  161. <property name="styleSheet">
  162. <string notr="true">color: rgb(255, 255, 255);
  163. font: 25 12pt &quot;COCOGOOSE &quot;;</string>
  164. </property>
  165. </widget>
  166. </item>
  167. </layout>
  168. </item>
  169. <item>
  170. <spacer name="verticalSpacer">
  171. <property name="orientation">
  172. <enum>Qt::Vertical</enum>
  173. </property>
  174. <property name="sizeType">
  175. <enum>QSizePolicy::Fixed</enum>
  176. </property>
  177. <property name="sizeHint" stdset="0">
  178. <size>
  179. <width>0</width>
  180. <height>10</height>
  181. </size>
  182. </property>
  183. </spacer>
  184. </item>
  185. <item>
  186. <layout class="QHBoxLayout" name="horizontalLayout_4">
  187. <property name="leftMargin">
  188. <number>180</number>
  189. </property>
  190. <property name="rightMargin">
  191. <number>180</number>
  192. </property>
  193. <property name="bottomMargin">
  194. <number>0</number>
  195. </property>
  196. <item>
  197. <widget class="QPushButton" name="Login">
  198. <property name="minimumSize">
  199. <size>
  200. <width>0</width>
  201. <height>30</height>
  202. </size>
  203. </property>
  204. <property name="styleSheet">
  205. <string notr="true">font: 63 16pt &quot;Cocogoose&quot;;
  206. background-color: rgb(52, 136, 153);
  207. selection-background-color: rgb(150, 45, 62);
  208. color: rgb(255, 255, 255);
  209. border-color: rgb(255, 255, 255);
  210. border-radius: 5px;
  211. padding: 0 8px;
  212. </string>
  213. </property>
  214. <property name="text">
  215. <string>LOGIN</string>
  216. </property>
  217. </widget>
  218. </item>
  219. </layout>
  220. </item>
  221. </layout>
  222. </widget>
  223. </item>
  224. </layout>
  225. </item>
  226. <item>
  227. <widget class="QCommandLinkButton" name="Forgot">
  228. <property name="styleSheet">
  229. <string notr="true">background-color: rgb(52, 54, 66);
  230. border-radius: 20px;
  231. color: rgb(150, 45, 62);</string>
  232. </property>
  233. <property name="text">
  234. <string>FORGOT PASSWORD?</string>
  235. </property>
  236. </widget>
  237. </item>
  238. </layout>
  239. </widget>
  240. <widget class="QMenuBar" name="menubar">
  241. <property name="geometry">
  242. <rect>
  243. <x>0</x>
  244. <y>0</y>
  245. <width>800</width>
  246. <height>21</height>
  247. </rect>
  248. </property>
  249. </widget>
  250. <widget class="QStatusBar" name="statusbar"/>
  251. </widget>
  252. <resources/>
  253. <connections/>
  254. </ui>
To copy to clipboard, switch view to plain text mode