summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_gui_kernel_qwidget.cpp
blob: 6c2f83a446c195f2fbfe1455241dee62abcf8f46 (plain)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

//! [0]
w->setWindowState(w->windowState() ^ Qt::WindowFullScreen);
//! [0]


//! [1]
w->setWindowState(w->windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
//! [1]


//! [2]
width = baseSize().width() + i * sizeIncrement().width();
height = baseSize().height() + j * sizeIncrement().height();
//! [2]


//! [3]
aWidget->window()->setWindowTitle("New Window Title");
//! [3]


//! [4]
QFont font("Helvetica", 12, QFont::Bold);
setFont(font);
//! [4]


//! [5]
QFont font;
font.setBold(false);
setFont(font);
//! [5]


//! [6]
setCursor(Qt::IBeamCursor);
//! [6]


//! [7]
QPixmap pixmap(widget->size());
widget->render(&pixmap);
//! [7]


//! [8]
QPainter painter(this);
...
painter.end();
myWidget->render(this);
//! [8]


//! [9]
setTabOrder(a, b); // a to b
setTabOrder(b, c); // a to b to c
setTabOrder(c, d); // a to b to c to d
//! [9]


//! [10]
// WRONG
setTabOrder(c, d); // c to d
setTabOrder(a, b); // a to b AND c to d
setTabOrder(b, c); // a to b to c, but not c to d
//! [10]


//! [11]
void MyWidget::closeEvent(QCloseEvent *event)
{
    QSettings settings("MyCompany", "MyApp");
    settings.setValue("geometry", saveGeometry());
    QWidget::closeEvent(event);
}
//! [11]


//! [12]
QSettings settings("MyCompany", "MyApp");
myWidget->restoreGeometry(settings.value("myWidget/geometry").toByteArray());
//! [12]


//! [13]
setUpdatesEnabled(false);
bigVisualChanges();
setUpdatesEnabled(true);
//! [13]


//! [14]
...
extern void qt_x11_set_global_double_buffer(bool);
qt_x11_set_global_double_buffer(false);
...
//! [14]
g Tk is a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages.
summaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Reverse previous commit for alpha channel data in image because of newly disc...bug_99b84e49ff_8_5Kevin Walzer2014-06-234-136/+113
* Fix for images with alpha channel data on Mavericks; thanks to Mark Culler fo...Kevin Walzer2014-06-225-114/+137
* ttk::entry, ttk::combobox: proposed fix for [a80f5d7165]:jenglish2014-05-271-6/+32
* Provide full Tk patchlevel to tk.pc and move private libs to "Libs.private".jan.nijtmans2014-04-091-3/+4
* Fix [http://core.tcl.tk/tcl/info/5bcb5026ad|5bcb5026ad]: Undefined autotools ...jan.nijtmans2014-04-012-3/+5
* Fix [http://core.tcl.tk/tcl/info/2f7cbd01c3|2f7cbd01c3]: tcl8.6.1 fails to bu...jan.nijtmans2014-03-202-26/+18
* Update configure files on Aqua to remove garbage collection flag, which is no...Kevin Walzer2014-03-163-2/+4
* Fix [52ca3e7f55]: XkbOpenDisplay macro incorrect when HAVE_XKBKEYCODETOKEYSYM...jan.nijtmans2014-02-111-1/+1
* Ticket [3279221]: Fixed setup of popup menu to prevent immediateandreask2014-02-061-0/+1
* Satisfy required position of __stdcall from VC++jan.nijtmans2014-02-041-2/+2
* Add missing __stdcall (which crashes on win32)jan.nijtmans2014-02-041-1/+2
* Fix [http://core.tcl.tk/tcl/info/651e828a52|651e828a52]: Wrong Windows versio...jan.nijtmans2014-02-041-9/+20
* Squash problem with native AIX cc not allowing direct macro redefinition.jan.nijtmans2014-02-031-0/+3
* Fix TK_SHLIB_LD_EXTRAS for FreeBSD (and Cygwin), reported by Pietro Ceruttijan.nijtmans2014-01-252-0/+4
* Put -lfontconfig in XFT_LIBS, not XLIBSW flagjan.nijtmans2014-01-232-2/+2
* Fix [3606644]: Static build misses fontconfigjan.nijtmans2014-01-232-0/+90
* Some bit of Windows 8.1 compatibility: See [http://msdn.microsoft.com/en-us/l...jan.nijtmans2013-11-204-12/+34
* Cygwin: In stead of checking whether the win32 part is configured properly, j...jan.nijtmans2013-11-183-14/+26
* Fix "creative writing" flaw.dgp2013-11-121-1/+1
* Fix uninitialized variable in 16-bit PPM handling. [1632447] follow-up.jan.nijtmans2013-11-111-1/+1
* Fix [0aa5e852dc]: Accept newline characters as value in Tk option filesjan.nijtmans2013-11-113-10/+23
* Add test-case for bug [f214b8ad5b], in order to prove that Tk 8.5 doesn't suf...jan.nijtmans2013-11-111-0/+11
* Fix [http://core.tcl.tk/tcl/info/426679ef7d|426679ef7d]: Having man.macros af...jan.nijtmans2013-11-05