~oif-team/ubuntu/natty/qt4-x11/xi2.1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Qt 4.0: mainwindow.h Example File (widgets/icons/mainwindow.h)</title>
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }</style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">mainwindow.h Example File<br /><small><small>widgets/icons/mainwindow.h</small></small></h1>
<pre>&nbsp;   /****************************************************************************
    **
    ** Copyright (C) 2005-2005 Trolltech AS. All rights reserved.
    **
    ** This file is part of the documentation of the Qt Toolkit.
    **
    ** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
**   information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
    **
    ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    **
    ****************************************************************************/

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include &lt;QIcon&gt;
    #include &lt;QList&gt;
    #include &lt;QMainWindow&gt;
    #include &lt;QPixmap&gt;

    class QAction;
    class QActionGroup;
    class QGroupBox;
    class QMenu;
    class QRadioButton;
    class QTableWidget;
    class IconPreviewArea;
    class IconSizeSpinBox;

    class MainWindow : public QMainWindow
    {
        Q_OBJECT

    public:
        MainWindow();

    private slots:
        void about();
        void changeStyle(bool checked);
        void changeSize();
        void changeIcon();
        void addImage();
        void removeAllImages();

    private:
        void createPreviewGroupBox();
        void createImagesGroupBox();
        void createIconSizeGroupBox();
        void createActions();
        void createMenus();
        void createContextMenu();
        void checkCurrentStyle();

        QWidget *centralWidget;

        QGroupBox *previewGroupBox;
        IconPreviewArea *previewArea;

        QGroupBox *imagesGroupBox;
        QTableWidget *imagesTable;

        QGroupBox *iconSizeGroupBox;
        QRadioButton *smallRadioButton;
        QRadioButton *largeRadioButton;
        QRadioButton *toolBarRadioButton;
        QRadioButton *listViewRadioButton;
        QRadioButton *iconViewRadioButton;
        QRadioButton *otherRadioButton;
        IconSizeSpinBox *otherSpinBox;

        QMenu *fileMenu;
        QMenu *viewMenu;
        QMenu *helpMenu;
        QAction *addImageAct;
        QAction *removeAllImagesAct;
        QAction *exitAct;
        QAction *guessModeStateAct;
        QActionGroup *styleActionGroup;
        QAction *aboutAct;
        QAction *aboutQtAct;
    };

    #endif</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
</tr></table></div></address></body>
</html>