menu option not displayed
-
I have a file mainwindow.ui:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>935</width>
<height>296</height>
</rect>
</property>
<property name="windowTitle">
<string>DirtyPHP Obfuscator</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>dirtyphp.ico</normaloff>dirtyphp.ico</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QPushButton" name="pushButton_command">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Construct command Ctrl+1</string>
</property>
<property name="shortcut">
<string>Ctrl+1</string>
</property>
</widget>
<widget class="QLabel" name="label_1">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>61</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string><html><head/><body><p><span style=" font-weight:600;">Step 1:</span></p></body></html></string>
</property>
</widget>
<widget class="QTextBrowser" name="command_text">
<property name="geometry">
<rect>
<x>19</x>
<y>80</y>
<width>901</width>
<height>101</height>
</rect>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
<widget class="QLabel" name="label_command">
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<width>1181</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Command:</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_obfuscate">
<property name="geometry">
<rect>
<x>90</x>
<y>200</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Obfuscate application Ctrl+2</string>
</property>
<property name="shortcut">
<string>Ctrl+2</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>200</y>
<width>61</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string><html><head/><body><p><span style=" font-weight:600;">Step 2:</span></p></body></html></string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>935</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
<property name="title">
<string>&File</string>
</property>
<addaction name="actionChoose_application"/>
<addaction name="actionChoose_recent_application"/>
<addaction name="separator"/>
<addaction name="actionChoose_composer_s_vendor_folder"/>
<addaction name="actionChoose_framework"/>
<addaction name="actionChoose_3rd_party_libraries_folders"/>
<addaction name="separator"/>
<addaction name="actionEdit_configuration_file"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menu_Obfuscation">
<property name="title">
<string>&Obfuscation</string>
</property>
<addaction name="actionChoose_subdirectories_to_obfuscate"/>
<addaction name="actionChoose_MVC_folders"/>
<addaction name="actionChoose_result_folder"/>
<addaction name="actionSet_other_options"/>
<addaction name="separator"/>
<addaction name="actionObfuscate_application"/>
<addaction name="actionView_last_obfuscation_result"/>
<addaction name="separator"/>
<addaction name="actionClear_cache"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>&Help</string>
</property>
<addaction name="actionBeginner_mode"/>
<addaction name="actionAdvanced_mode"/>
<addaction name="separator"/>
<addaction name="actionDocumentation"/>
<addaction name="actionWeb_page"/>
<addaction name="actionReport_bug"/>
<addaction name="actionSuggest_improvement"/>
<addaction name="separator"/>
<addaction name="action_About_program"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_Obfuscation"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionChoose_application">
<property name="text">
<string>Choose &application...</string>
</property>
</action>
<action name="actionChoose_composer_s_vendor_folder">
<property name="text">
<string>Choose Composer's &vendor folder...</string>
</property>
</action>
<action name="actionChoose_framework">
<property name="text">
<string>Choose &framework...</string>
</property>
</action>
<action name="actionChoose_3rd_party_libraries_folders">
<property name="text">
<string>Choose 3rd party &libraries folders...</string>
</property>
</action>
<action name="actionEdit_configuration_file">
<property name="text">
<string>Edit frameworks &configuration file</string>
</property>
</action>
<action name="actionChoose_subdirectories_to_obfuscate">
<property name="text">
<string>Choose &subdirectories to obfuscate...</string>
</property>
</action>
<action name="actionChoose_result_folder">
<property name="text">
<string>Choose &result folder...</string>
</property>
</action>
<action name="actionSet_other_options">
<property name="text">
<string>Set other op&tions...</string>
</property>
</action>
<action name="actionObfuscate_application">
<property name="text">
<string>&Obfuscate application...</string>
</property>
</action>
<action name="actionExit">
<property name="text">
<string>E&xit</string>
</property>
</action>
<action name="actionDocumentation">
<property name="text">
<string>&Documentation</string>
</property>
</action>
<action name="actionReport_bug">
<property name="text">
<string>&Report bug</string>
</property>
</action>
<action name="action_About_program">
<property name="text">
<string>Abou&t DirtyPHP Obfuscator...</string>
</property>
</action>
<action name="actionChoose_MVC_folders">
<property name="text">
<string>Choose &MVC folders...</string>
</property>
</action>
<action name="actionWeb_page">
<property name="text">
<string>&WWW page</string>
</property>
</action>
<action name="actionBeginner_mode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>&Beginner's mode</string>
</property>
</action>
<action name="actionAdvanced_mode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&Advanced mode</string>
</property>
</action>
<action name="actionChoose_recent_application">
<property name="text">
<string>Choose &recent application...</string>
</property>
</action>
<action name="actionView_last_obfuscation_result">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&View last obfuscation result...</string>
</property>
</action>
<action name="actionClear_cache">
<property name="text">
<string>&Clear cache</string>
</property>
</action>
<action name="actionSuggest_improvement">
<property name="text">
<string>Suggest improvement</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>There's something wrong with "Help|Suggest improvement" option because action code in .h/.cpp was not automatically created and when I run my application, option "Suggest improvement" of Help menu is not displayed.
Please help. -
I have a file mainwindow.ui:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>935</width>
<height>296</height>
</rect>
</property>
<property name="windowTitle">
<string>DirtyPHP Obfuscator</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>dirtyphp.ico</normaloff>dirtyphp.ico</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QPushButton" name="pushButton_command">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Construct command Ctrl+1</string>
</property>
<property name="shortcut">
<string>Ctrl+1</string>
</property>
</widget>
<widget class="QLabel" name="label_1">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>61</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string><html><head/><body><p><span style=" font-weight:600;">Step 1:</span></p></body></html></string>
</property>
</widget>
<widget class="QTextBrowser" name="command_text">
<property name="geometry">
<rect>
<x>19</x>
<y>80</y>
<width>901</width>
<height>101</height>
</rect>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
<widget class="QLabel" name="label_command">
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<width>1181</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Command:</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_obfuscate">
<property name="geometry">
<rect>
<x>90</x>
<y>200</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Obfuscate application Ctrl+2</string>
</property>
<property name="shortcut">
<string>Ctrl+2</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>200</y>
<width>61</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string><html><head/><body><p><span style=" font-weight:600;">Step 2:</span></p></body></html></string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>935</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
<property name="title">
<string>&File</string>
</property>
<addaction name="actionChoose_application"/>
<addaction name="actionChoose_recent_application"/>
<addaction name="separator"/>
<addaction name="actionChoose_composer_s_vendor_folder"/>
<addaction name="actionChoose_framework"/>
<addaction name="actionChoose_3rd_party_libraries_folders"/>
<addaction name="separator"/>
<addaction name="actionEdit_configuration_file"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menu_Obfuscation">
<property name="title">
<string>&Obfuscation</string>
</property>
<addaction name="actionChoose_subdirectories_to_obfuscate"/>
<addaction name="actionChoose_MVC_folders"/>
<addaction name="actionChoose_result_folder"/>
<addaction name="actionSet_other_options"/>
<addaction name="separator"/>
<addaction name="actionObfuscate_application"/>
<addaction name="actionView_last_obfuscation_result"/>
<addaction name="separator"/>
<addaction name="actionClear_cache"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>&Help</string>
</property>
<addaction name="actionBeginner_mode"/>
<addaction name="actionAdvanced_mode"/>
<addaction name="separator"/>
<addaction name="actionDocumentation"/>
<addaction name="actionWeb_page"/>
<addaction name="actionReport_bug"/>
<addaction name="actionSuggest_improvement"/>
<addaction name="separator"/>
<addaction name="action_About_program"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_Obfuscation"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionChoose_application">
<property name="text">
<string>Choose &application...</string>
</property>
</action>
<action name="actionChoose_composer_s_vendor_folder">
<property name="text">
<string>Choose Composer's &vendor folder...</string>
</property>
</action>
<action name="actionChoose_framework">
<property name="text">
<string>Choose &framework...</string>
</property>
</action>
<action name="actionChoose_3rd_party_libraries_folders">
<property name="text">
<string>Choose 3rd party &libraries folders...</string>
</property>
</action>
<action name="actionEdit_configuration_file">
<property name="text">
<string>Edit frameworks &configuration file</string>
</property>
</action>
<action name="actionChoose_subdirectories_to_obfuscate">
<property name="text">
<string>Choose &subdirectories to obfuscate...</string>
</property>
</action>
<action name="actionChoose_result_folder">
<property name="text">
<string>Choose &result folder...</string>
</property>
</action>
<action name="actionSet_other_options">
<property name="text">
<string>Set other op&tions...</string>
</property>
</action>
<action name="actionObfuscate_application">
<property name="text">
<string>&Obfuscate application...</string>
</property>
</action>
<action name="actionExit">
<property name="text">
<string>E&xit</string>
</property>
</action>
<action name="actionDocumentation">
<property name="text">
<string>&Documentation</string>
</property>
</action>
<action name="actionReport_bug">
<property name="text">
<string>&Report bug</string>
</property>
</action>
<action name="action_About_program">
<property name="text">
<string>Abou&t DirtyPHP Obfuscator...</string>
</property>
</action>
<action name="actionChoose_MVC_folders">
<property name="text">
<string>Choose &MVC folders...</string>
</property>
</action>
<action name="actionWeb_page">
<property name="text">
<string>&WWW page</string>
</property>
</action>
<action name="actionBeginner_mode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>&Beginner's mode</string>
</property>
</action>
<action name="actionAdvanced_mode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&Advanced mode</string>
</property>
</action>
<action name="actionChoose_recent_application">
<property name="text">
<string>Choose &recent application...</string>
</property>
</action>
<action name="actionView_last_obfuscation_result">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&View last obfuscation result...</string>
</property>
</action>
<action name="actionClear_cache">
<property name="text">
<string>&Clear cache</string>
</property>
</action>
<action name="actionSuggest_improvement">
<property name="text">
<string>Suggest improvement</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>There's something wrong with "Help|Suggest improvement" option because action code in .h/.cpp was not automatically created and when I run my application, option "Suggest improvement" of Help menu is not displayed.
Please help.@Robert-M Try complete rebuild: delete everything in build folder, run qmake and build.
-
I guess your xml in not well formed since the ampersand is a special character in XML but you use it for simply marking the shortcut letters. Try replace all & (where not used in proper XML-syntax) with & ; AND remove the space between p and semicolon. (I just couldn't figure out how to type this sequence without being interpreted by the web site and displayed simply as & :-))
-
-
I had similator problem with widgets on mainwindow. I failed to solve it.
Could it be a bug in QtCreator? I use ver.6.0.1 in Windows 10.@Robert-M
Once you have a.ui
file Qt Creator is no longer relevant. So long as it produces a legal one, and I cannot spot what is wrong in yours.The usual at this point would be for you to start binary chopping out things from the
.ui
till it does work then figure out what might be wrong in the removed parts? -
@Robert-M this works on Linux. Rich text format has to be selected for html in qlabel.
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>935</width>
<height>296</height>
</rect>
</property>
<property name="windowTitle">
<string>DirtyPHP Obfuscator</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>dirtyphp.ico</normaloff>dirtyphp.ico</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QPushButton" name="pushButton_command">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Construct command Ctrl+1</string>
</property>
<property name="shortcut">
<string>Ctrl+1</string>
</property>
</widget>
<widget class="QLabel" name="label_1">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>61</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string><html><head/><body><p><span style=" font-weight:600;">Step 1:</span></p></body></html></string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
<widget class="QTextBrowser" name="command_text">
<property name="geometry">
<rect>
<x>19</x>
<y>80</y>
<width>901</width>
<height>101</height>
</rect>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
<widget class="QLabel" name="label_command">
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<width>1181</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Command:</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_obfuscate">
<property name="geometry">
<rect>
<x>90</x>
<y>200</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Obfuscate application Ctrl+2</string>
</property>
<property name="shortcut">
<string>Ctrl+2</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>200</y>
<width>61</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string><html><head/><body><p><span style=" font-weight:600;">Step 2:</span></p></body></html></string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>935</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
<property name="title">
<string>&File</string>
</property>
<addaction name="actionChoose_application"/>
<addaction name="actionChoose_recent_application"/>
<addaction name="separator"/>
<addaction name="actionChoose_composer_s_vendor_folder"/>
<addaction name="actionChoose_framework"/>
<addaction name="actionChoose_3rd_party_libraries_folders"/>
<addaction name="separator"/>
<addaction name="actionEdit_configuration_file"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menu_Obfuscation">
<property name="title">
<string>&Obfuscation</string>
</property>
<addaction name="actionChoose_subdirectories_to_obfuscate"/>
<addaction name="actionChoose_MVC_folders"/>
<addaction name="actionChoose_result_folder"/>
<addaction name="actionSet_other_options"/>
<addaction name="separator"/>
<addaction name="actionObfuscate_application"/>
<addaction name="actionView_last_obfuscation_result"/>
<addaction name="separator"/>
<addaction name="actionClear_cache"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>&Help</string>
</property>
<addaction name="actionBeginner_mode"/>
<addaction name="actionAdvanced_mode"/>
<addaction name="separator"/>
<addaction name="actionDocumentation"/>
<addaction name="actionWeb_page"/>
<addaction name="actionReport_bug"/>
<addaction name="actionSuggest_improvement"/>
<addaction name="separator"/>
<addaction name="action_About_program"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_Obfuscation"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionChoose_application">
<property name="text">
<string>Choose &application...</string>
</property>
</action>
<action name="actionChoose_composer_s_vendor_folder">
<property name="text">
<string>Choose Composer's &vendor folder...</string>
</property>
</action>
<action name="actionChoose_framework">
<property name="text">
<string>Choose &framework...</string>
</property>
</action>
<action name="actionChoose_3rd_party_libraries_folders">
<property name="text">
<string>Choose 3rd party &libraries folders...</string>
</property>
</action>
<action name="actionEdit_configuration_file">
<property name="text">
<string>Edit frameworks &configuration file</string>
</property>
</action>
<action name="actionChoose_subdirectories_to_obfuscate">
<property name="text">
<string>Choose &subdirectories to obfuscate...</string>
</property>
</action>
<action name="actionChoose_result_folder">
<property name="text">
<string>Choose &result folder...</string>
</property>
</action>
<action name="actionSet_other_options">
<property name="text">
<string>Set other op&tions...</string>
</property>
</action>
<action name="actionObfuscate_application">
<property name="text">
<string>&Obfuscate application...</string>
</property>
</action>
<action name="actionExit">
<property name="text">
<string>E&xit</string>
</property>
</action>
<action name="actionDocumentation">
<property name="text">
<string>&Documentation</string>
</property>
</action>
<action name="actionReport_bug">
<property name="text">
<string>&Report bug</string>
</property>
</action>
<action name="action_About_program">
<property name="text">
<string>Abou&t DirtyPHP Obfuscator...</string>
</property>
</action>
<action name="actionChoose_MVC_folders">
<property name="text">
<string>Choose &MVC folders...</string>
</property>
</action>
<action name="actionWeb_page">
<property name="text">
<string>&WWW page</string>
</property>
</action>
<action name="actionBeginner_mode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>&Beginner's mode</string>
</property>
</action>
<action name="actionAdvanced_mode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&Advanced mode</string>
</property>
</action>
<action name="actionChoose_recent_application">
<property name="text">
<string>Choose &recent application...</string>
</property>
</action>
<action name="actionView_last_obfuscation_result">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&View last obfuscation result...</string>
</property>
</action>
<action name="actionClear_cache">
<property name="text">
<string>&Clear cache</string>
</property>
</action>
<action name="actionSuggest_improvement">
<property name="text">
<string>Suggest improvement</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>