Icons for tabs.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-07-12 17:19:53 +03:00
parent f5d9f1ff72
commit ad285ec4c9
12 changed files with 103 additions and 15 deletions

View File

@ -33,7 +33,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(icon); Q_INIT_RESOURCE(tapeicon);
QT_REQUIRE_VERSION(argc, argv, "5.0.0"); QT_REQUIRE_VERSION(argc, argv, "5.0.0");

View File

@ -45,7 +45,7 @@ MApplication::MApplication(int &argc, char **argv)
setOrganizationDomain(VER_COMPANYDOMAIN_STR); setOrganizationDomain(VER_COMPANYDOMAIN_STR);
// Setting the Application version // Setting the Application version
setApplicationVersion(APP_VERSION_STR); setApplicationVersion(APP_VERSION_STR);
setWindowIcon(QIcon(":/icon/64x64/logo.png")); setWindowIcon(QIcon(":/tapeicon/64x64/logo.png"));
const QString serverName = QCoreApplication::applicationName(); const QString serverName = QCoreApplication::applicationName();
QLocalSocket socket; QLocalSocket socket;

View File

@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/">
<file>icon/64x64/logo.png</file>
</qresource>
</RCC>

View File

@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/">
<file>tapeicon/64x64/logo.png</file>
<file>tapeicon/16x16/info.png</file>
<file>tapeicon/16x16/measurement.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -43,6 +43,9 @@ UI_DIR = uic
# Suport subdirectories. Just better project code tree. # Suport subdirectories. Just better project code tree.
include(tape.pri) include(tape.pri)
RESOURCES += \
share/resources/tapeicon.qrc
# Compilation will fail without this files after we added them to this section. # Compilation will fail without this files after we added them to this section.
OTHER_FILES += \ OTHER_FILES += \
share/resources/tape.rc \ # For Windows system. share/resources/tape.rc \ # For Windows system.
@ -161,6 +164,3 @@ noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
} }
} }
} }
RESOURCES += \
share/resources/icon.qrc

View File

@ -35,8 +35,9 @@ TMainWindow::TMainWindow(QWidget *parent)
ui(new Ui::TMainWindow) ui(new Ui::TMainWindow)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->tabWidget->setVisible(false); ui->tabWidget->setVisible(false);
SetupMenu();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -47,6 +48,13 @@ TMainWindow::~TMainWindow()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TMainWindow::LoadFile(const QString &path) void TMainWindow::LoadFile(const QString &path)
{
ui->labelToolTip->setVisible(false);
ui->tabWidget->setVisible(true);
}
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::SetupMenu()
{ {
} }

View File

@ -50,6 +50,8 @@ public slots:
private: private:
Q_DISABLE_COPY(TMainWindow) Q_DISABLE_COPY(TMainWindow)
Ui::TMainWindow *ui; Ui::TMainWindow *ui;
void SetupMenu();
}; };
#endif // TMAINWINDOW_H #endif // TMAINWINDOW_H

View File

@ -6,13 +6,17 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>531</width> <width>742</width>
<height>406</height> <height>520</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>TMainWindow</string> <string>TMainWindow</string>
</property> </property>
<property name="windowIcon">
<iconset resource="share/resources/tapeicon.qrc">
<normaloff>:/tapeicon/64x64/logo.png</normaloff>:/tapeicon/64x64/logo.png</iconset>
</property>
<widget class="QWidget" name="centralWidget"> <widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item alignment="Qt::AlignHCenter"> <item alignment="Qt::AlignHCenter">
@ -28,6 +32,10 @@
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tabMeasurements"> <widget class="QWidget" name="tabMeasurements">
<attribute name="icon">
<iconset resource="share/resources/tapeicon.qrc">
<normaloff>:/tapeicon/16x16/measurement.png</normaloff>:/tapeicon/16x16/measurement.png</iconset>
</attribute>
<attribute name="title"> <attribute name="title">
<string>Measuremnts</string> <string>Measuremnts</string>
</attribute> </attribute>
@ -38,6 +46,10 @@
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabInformation"> <widget class="QWidget" name="tabInformation">
<attribute name="icon">
<iconset resource="share/resources/tapeicon.qrc">
<normaloff>:/tapeicon/16x16/info.png</normaloff>:/tapeicon/16x16/info.png</iconset>
</attribute>
<attribute name="title"> <attribute name="title">
<string>Information</string> <string>Information</string>
</attribute> </attribute>
@ -51,10 +63,37 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>531</width> <width>742</width>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_File">
<property name="title">
<string>File</string>
</property>
<addaction name="actionNew"/>
<addaction name="actionOpen"/>
<addaction name="separator"/>
<addaction name="actionSave"/>
<addaction name="actionSaveAs"/>
<addaction name="separator"/>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menuWindow">
<property name="title">
<string>Window</string>
</property>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Help</string>
</property>
<addaction name="actionAboutQt"/>
<addaction name="actionAboutTape"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menuWindow"/>
<addaction name="menuHelp"/>
</widget> </widget>
<widget class="QToolBar" name="mainToolBar"> <widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea"> <attribute name="toolBarArea">
@ -65,8 +104,45 @@
</attribute> </attribute>
</widget> </widget>
<widget class="QStatusBar" name="statusBar"/> <widget class="QStatusBar" name="statusBar"/>
<action name="actionOpen">
<property name="text">
<string>Open ...</string>
</property>
</action>
<action name="actionSave">
<property name="text">
<string>Save</string>
</property>
</action>
<action name="actionSaveAs">
<property name="text">
<string>Save As ...</string>
</property>
</action>
<action name="actionQuit">
<property name="text">
<string>Quit</string>
</property>
</action>
<action name="actionAboutQt">
<property name="text">
<string>About &amp;Qt</string>
</property>
</action>
<action name="actionAboutTape">
<property name="text">
<string>About Tape</string>
</property>
</action>
<action name="actionNew">
<property name="text">
<string>New</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources/> <resources>
<include location="share/resources/tapeicon.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>