Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add icon

  • Loading branch information...
commit 338dee788afc0fc2963756262f86d478db987c3d 1 parent f640317
Pavol Rusnak authored August 29, 2011
BIN  software/icon.png
13  software/mainwindow.cpp
@@ -2,6 +2,7 @@
2 2
 #include "ui_mainwindow.h"
3 3
 #include <gst/gst.h>
4 4
 #include <gst/interfaces/xoverlay.h>
  5
+#include <QMessageBox>
5 6
 
6 7
 MainWindow::MainWindow(QWidget *parent) :
7 8
     QMainWindow(parent),
@@ -30,3 +31,15 @@ MainWindow::MainWindow(QWidget *parent) :
30 31
 MainWindow::~MainWindow()
31 32
 {
32 33
 }
  34
+
  35
+void MainWindow::on_pushExit_clicked()
  36
+{
  37
+    close();
  38
+}
  39
+
  40
+void MainWindow::on_pushAbout_clicked()
  41
+{
  42
+    QMessageBox aboutBox(QMessageBox::NoIcon, "About µView", QString::fromUtf8("µView\n\nhackerspace brmlab - http://brmlab.cz/\n\nSee README for more info and COPYING for the license." ), QMessageBox::Ok, this);
  43
+    aboutBox.setIconPixmap(QPixmap(":/icons/icon.png"));
  44
+    aboutBox.exec();
  45
+}
3  software/mainwindow.h
@@ -17,6 +17,9 @@ class MainWindow : public QMainWindow
17 17
 
18 18
 private slots:
19 19
 
  20
+    void on_pushExit_clicked();
  21
+    void on_pushAbout_clicked();
  22
+
20 23
 private:
21 24
     Ui::MainWindow *ui;
22 25
 };
12  software/mainwindow.ui
@@ -13,6 +13,10 @@
13 13
   <property name="windowTitle">
14 14
    <string>µView</string>
15 15
   </property>
  16
+  <property name="windowIcon">
  17
+   <iconset resource="resources.qrc">
  18
+    <normaloff>:/icons/icon.png</normaloff>:/icons/icon.png</iconset>
  19
+  </property>
16 20
   <widget class="QWidget" name="centralWidget">
17 21
    <widget class="VideoView" name="wgtVideo" native="true">
18 22
     <property name="geometry">
@@ -128,7 +132,7 @@
128 132
      <string>E&amp;xit</string>
129 133
     </property>
130 134
    </widget>
131  
-   <widget class="QPushButton" name="pushAbout_2">
  135
+   <widget class="QPushButton" name="pushAbout">
132 136
     <property name="geometry">
133 137
      <rect>
134 138
       <x>660</x>
@@ -159,9 +163,11 @@
159 163
   <tabstop>pushZoomIn</tabstop>
160 164
   <tabstop>pushZoomOut</tabstop>
161 165
   <tabstop>pushSnap</tabstop>
162  
-  <tabstop>pushAbout_2</tabstop>
  166
+  <tabstop>pushAbout</tabstop>
163 167
   <tabstop>pushExit</tabstop>
164 168
  </tabstops>
165  
- <resources/>
  169
+ <resources>
  170
+  <include location="resources.qrc"/>
  171
+ </resources>
166 172
  <connections/>
167 173
 </ui>
3  software/microview.pro
@@ -23,3 +23,6 @@ unix {
23 23
     CONFIG += link_pkgconfig
24 24
     PKGCONFIG += gstreamer-0.10 gstreamer-interfaces-0.10
25 25
 }
  26
+
  27
+RESOURCES += \
  28
+    resources.qrc
5  software/resources.qrc
... ...
@@ -0,0 +1,5 @@
  1
+<RCC>
  2
+  <qresource prefix="icons">
  3
+    <file>icon.png</file>
  4
+  </qresource>
  5
+</RCC>

0 notes on commit 338dee7

Please sign in to comment.
Something went wrong with that request. Please try again.