moved icons to qrc file

pull/12/head
mandlm 2018-05-18 20:12:48 +02:00
parent 64400a0e94
commit 639e1b21e2
6 changed files with 33 additions and 11 deletions

View File

@ -5,11 +5,15 @@ project(LogoTest LANGUAGES CXX)
find_package(Qt5Widgets REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
qt5_wrap_ui(UI_HEADERS
mainwindow.ui
MetaDataWidget.ui
)
qt5_add_resources(UI_RESOURCES
mainwindow.qrc
)
add_executable(${PROJECT_NAME}
LogoTest.cpp
@ -18,6 +22,7 @@ add_executable(${PROJECT_NAME}
mainwindow.cpp
MetaDataWidget.cpp
${UI_HEADERS}
${UI_RESOURCES}
)
set_target_properties(${PROJECT_NAME}

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -17,13 +17,8 @@ MainWindow::MainWindow(QWidget *parent)
{
ui->setupUi(this);
ui->actionSave_as->setIcon(QIcon::fromTheme("document-save-as",
QIcon("/usr/share/gtk-doc/html/gtk2/document-save-as.png")));
ui->actionLoad->setIcon(QIcon::fromTheme("document-open",
QIcon("/usr/share/gtk-doc/html/gtk2/document-open.png")));
connect(ui->actionSave_as, SIGNAL(triggered()), this, SLOT(saveAs()));
connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(load()));
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(load()));
ui->metaDataWidget->setModel(&m_dataModel->m_metaData);
}

6
source/mainwindow.qrc Normal file
View File

@ -0,0 +1,6 @@
<RCC>
<qresource>
<file>images/document-open.png</file>
<file>images/document-save-as.png</file>
</qresource>
</RCC>

View File

@ -52,8 +52,8 @@
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="actionOpen"/>
<addaction name="actionSave_as"/>
<addaction name="actionLoad"/>
</widget>
<addaction name="menuFile"/>
</widget>
@ -68,20 +68,34 @@
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionOpen"/>
<addaction name="actionSave_as"/>
<addaction name="actionLoad"/>
</widget>
<action name="actionSave_as">
<property name="icon">
<iconset resource="mainwindow.qrc">
<normaloff>:/images/document-save-as.png</normaloff>:/images/document-save-as.png</iconset>
</property>
<property name="text">
<string>Save as...</string>
</property>
<property name="toolTip">
<string>Save as...</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="actionLoad">
<action name="actionOpen">
<property name="icon">
<iconset resource="mainwindow.qrc">
<normaloff>:/images/document-open.png</normaloff>:/images/document-open.png</iconset>
</property>
<property name="text">
<string>Load</string>
<string>Open</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
</action>
</widget>
@ -93,6 +107,8 @@
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="mainwindow.qrc"/>
</resources>
<connections/>
</ui>