Skip to content

Commit

Permalink
Добавлены ресурсы иконок
Browse files Browse the repository at this point in the history
  • Loading branch information
forth32 committed Nov 10, 2014
1 parent 1e2422d commit ab6f4ac
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: qtcalc
# Generated by qmake (2.01a) (Qt 4.8.6) on: ?? ??? 10 19:45:02 2014
# Generated by qmake (2.01a) (Qt 4.8.6) on: ?? ??? 10 21:38:55 2014
# Project: qtcalc.pro
# Template: app
# Command: /usr/lib/i386-linux-gnu/qt4/bin/qmake -o Makefile qtcalc.pro
Expand Down Expand Up @@ -53,7 +53,8 @@ SOURCES = calc.cpp \
encrypt_6.cpp \
encrypt_7.cpp \
encrypt_v1.cpp \
main.cpp moc_calcdialog.cpp
main.cpp moc_calcdialog.cpp \
qrc_huaweicalc.cpp
OBJECTS = calc.o \
calcdialog.o \
encrypt_1.o \
Expand All @@ -65,7 +66,8 @@ OBJECTS = calc.o \
encrypt_7.o \
encrypt_v1.o \
main.o \
moc_calcdialog.o
moc_calcdialog.o \
qrc_huaweicalc.o
DIST = /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/common/gcc-base.conf \
Expand Down Expand Up @@ -183,7 +185,7 @@ qmake: FORCE

dist:
@$(CHK_DIR_EXISTS) .tmp/qtcalc1.0.0 || $(MKDIR) .tmp/qtcalc1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/qtcalc1.0.0/ && $(COPY_FILE) --parents calcdialog.h encrypt.h .tmp/qtcalc1.0.0/ && $(COPY_FILE) --parents calc.cpp calcdialog.cpp encrypt_1.cpp encrypt_2.cpp encrypt_3.cpp encrypt_4.cpp encrypt_5_v2.cpp encrypt_6.cpp encrypt_7.cpp encrypt_v1.cpp main.cpp .tmp/qtcalc1.0.0/ && $(COPY_FILE) --parents calc.ui .tmp/qtcalc1.0.0/ && (cd `dirname .tmp/qtcalc1.0.0` && $(TAR) qtcalc1.0.0.tar qtcalc1.0.0 && $(COMPRESS) qtcalc1.0.0.tar) && $(MOVE) `dirname .tmp/qtcalc1.0.0`/qtcalc1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qtcalc1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/qtcalc1.0.0/ && $(COPY_FILE) --parents calcdialog.h encrypt.h .tmp/qtcalc1.0.0/ && $(COPY_FILE) --parents huaweicalc.qrc .tmp/qtcalc1.0.0/ && $(COPY_FILE) --parents calc.cpp calcdialog.cpp encrypt_1.cpp encrypt_2.cpp encrypt_3.cpp encrypt_4.cpp encrypt_5_v2.cpp encrypt_6.cpp encrypt_7.cpp encrypt_v1.cpp main.cpp .tmp/qtcalc1.0.0/ && $(COPY_FILE) --parents calc.ui .tmp/qtcalc1.0.0/ && (cd `dirname .tmp/qtcalc1.0.0` && $(TAR) qtcalc1.0.0.tar qtcalc1.0.0 && $(COMPRESS) qtcalc1.0.0.tar) && $(MOVE) `dirname .tmp/qtcalc1.0.0`/qtcalc1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qtcalc1.0.0


clean:compiler_clean
Expand Down Expand Up @@ -211,8 +213,13 @@ moc_calcdialog.cpp: ui_calc.h \
calcdialog.h
/usr/lib/i386-linux-gnu/qt4/bin/moc $(DEFINES) $(INCPATH) calcdialog.h -o moc_calcdialog.cpp

compiler_rcc_make_all:
compiler_rcc_make_all: qrc_huaweicalc.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_huaweicalc.cpp
qrc_huaweicalc.cpp: huaweicalc.qrc \
icon.png
/usr/lib/i386-linux-gnu/qt4/bin/rcc -name huaweicalc huaweicalc.qrc -o qrc_huaweicalc.cpp

compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
Expand All @@ -230,7 +237,7 @@ compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_uic_clean

####### Compile

Expand Down Expand Up @@ -274,6 +281,9 @@ main.o: main.cpp calcdialog.h \
moc_calcdialog.o: moc_calcdialog.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_calcdialog.o moc_calcdialog.cpp

qrc_huaweicalc.o: qrc_huaweicalc.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_huaweicalc.o qrc_huaweicalc.cpp

####### Install

install: FORCE
Expand Down
8 changes: 7 additions & 1 deletion calc.ui
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<property name="windowTitle">
<string>Huawei calculator</string>
</property>
<property name="windowIcon">
<iconset resource="huaweicalc.qrc">
<normaloff>:/icon/icon.png</normaloff>:/icon/icon.png</iconset>
</property>
<widget class="QPushButton" name="calcbutton">
<property name="geometry">
<rect>
Expand Down Expand Up @@ -395,7 +399,9 @@
</property>
</widget>
</widget>
<resources/>
<resources>
<include location="huaweicalc.qrc"/>
</resources>
<connections>
<connection>
<sender>calcbutton</sender>
Expand Down
5 changes: 5 additions & 0 deletions huaweicalc.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="icon">
<file>icon.png</file>
</qresource>
</RCC>
Binary file added icon.ico
Binary file not shown.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion qtcalc.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ SOURCES += calc.cpp \
encrypt_7.cpp \
encrypt_v1.cpp \
main.cpp
LIBS += -lcrypto
LIBS += -lcrypto
RESOURCES = huaweicalc.qrc
3 changes: 3 additions & 0 deletions ui_calc.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class Ui_CalcDialog
brush1.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush1);
CalcDialog->setPalette(palette);
QIcon icon;
icon.addFile(QString::fromUtf8(":/icon/icon.png"), QSize(), QIcon::Normal, QIcon::Off);
CalcDialog->setWindowIcon(icon);
calcbutton = new QPushButton(CalcDialog);
calcbutton->setObjectName(QString::fromUtf8("calcbutton"));
calcbutton->setGeometry(QRect(250, 60, 94, 24));
Expand Down

0 comments on commit ab6f4ac

Please sign in to comment.