Skip to content

Commit fe28397

Browse files
committed
[Misc] Ensure the program can run correctly on Ubuntu
- Fix loottablefunction.ui storing wrong infomation, which caused ExtendedTableWidget not to work correctly.
1 parent 74cb0bc commit fe28397

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

src/loottablefunction.ui

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -755,22 +755,14 @@
755755
<widget class="QWidget" name="set_banner_pattern">
756756
<layout class="QVBoxLayout" name="verticalLayout">
757757
<item>
758-
<widget class="ExtendedTableWidget" name="setPattern_table" native="true">
759-
<property name="columnTitles" stdset="0">
758+
<widget class="ExtendedTableWidget" name="setPattern_table">
759+
<property name="columnTitles">
760760
<stringlist>
761761
<string>Pattern</string>
762762
<string>Color</string>
763763
</stringlist>
764764
</property>
765765
<widget class="QFrame" name="container_2">
766-
<property name="geometry">
767-
<rect>
768-
<x>0</x>
769-
<y>0</y>
770-
<width>100</width>
771-
<height>30</height>
772-
</rect>
773-
</property>
774766
<layout class="QFormLayout" name="formLayout_13">
775767
<item row="0" column="0">
776768
<widget class="QLabel" name="label_39">
@@ -876,7 +868,7 @@
876868
</item>
877869
<item row="0" column="1">
878870
<widget class="NumberProvider" name="setCount_countInput">
879-
<property name="minLimit" stdset="0">
871+
<property name="minLimit">
880872
<number>-2147483647</number>
881873
</property>
882874
</widget>
@@ -917,22 +909,14 @@
917909
<widget class="QWidget" name="set_enchantments">
918910
<layout class="QGridLayout" name="gridLayout_11">
919911
<item row="0" column="0">
920-
<widget class="ExtendedTableWidget" name="setEnchant_table" native="true">
921-
<property name="columnTitles" stdset="0">
912+
<widget class="ExtendedTableWidget" name="setEnchant_table">
913+
<property name="columnTitles">
922914
<stringlist>
923915
<string>Enchantment</string>
924916
<string>Level</string>
925917
</stringlist>
926918
</property>
927919
<widget class="QFrame" name="container">
928-
<property name="geometry">
929-
<rect>
930-
<x>0</x>
931-
<y>0</y>
932-
<width>100</width>
933-
<height>30</height>
934-
</rect>
935-
</property>
936920
<layout class="QFormLayout" name="formLayout_6">
937921
<item row="0" column="0">
938922
<widget class="QLabel" name="label_37">
@@ -1416,6 +1400,7 @@
14161400
<class>ExtendedTableWidget</class>
14171401
<extends>QWidget</extends>
14181402
<header>extendedtablewidget.h</header>
1403+
<addpagemethod>setContainer</addpagemethod>
14191404
<container>1</container>
14201405
</customwidget>
14211406
<customwidget>

src/main.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@ int main(int argc, char *argv[]) {
1717

1818
/*Q_INIT_RESOURCE(application); */
1919

20-
QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << QStringLiteral(
21-
":/icon"));
22-
QIcon::setFallbackThemeName(QStringLiteral("default"));
23-
if (QIcon::themeName().isEmpty())
24-
QIcon::setThemeName(QStringLiteral("default"));
25-
2620
QApplication a(argc, argv);
2721
qInfo() << "Appication started.";
2822

2923
QFontDatabase::addApplicationFont(QStringLiteral(
3024
":/fonts/Monocraft/Monocraft.otf"));
3125

26+
QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << QStringLiteral(
27+
":/icon"));
28+
QIcon::setFallbackThemeName(QStringLiteral("default"));
29+
if (QIcon::themeName().isEmpty() || !QIcon::hasThemeIcon("list-add"))
30+
QIcon::setThemeName(QStringLiteral("default"));
31+
if (!QIcon::hasThemeIcon("list-add")) {
32+
QIcon::setThemeSearchPaths({":/icons"});
33+
QIcon::setThemeName(QStringLiteral("default"));
34+
}
35+
3236
QCommandLineParser parser;
3337
parser.setApplicationDescription(QCoreApplication::applicationName());
3438
parser.addHelpOption();

0 commit comments

Comments
 (0)