2011-09-27 11:59:26 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2019-01-10 14:39:01 +01:00
|
|
|
** Copyright (C) 2019 The Qt Company Ltd.
|
2016-01-15 14:51:16 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-09-27 11:59:26 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** This file is part of the Qt Creator documentation.
|
2011-09-27 11:59:26 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-09-27 11:59:26 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** GNU Free Documentation License Usage
|
2011-09-27 11:59:26 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
2016-01-15 14:51:16 +01:00
|
|
|
** Foundation and appearing in the file included in the packaging of
|
|
|
|
|
** this file. Please review the following information to ensure
|
|
|
|
|
** the GNU Free Documentation License version 1.3 requirements
|
|
|
|
|
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
2011-09-27 11:59:26 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// NOTE: the sections are not ordered by their logical order to avoid
|
|
|
|
|
// reshuffling the file each time the index order changes (i.e., often).
|
|
|
|
|
// Run the fixnavi.pl script to adjust the links to the index order.
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-09-03 17:34:43 +02:00
|
|
|
\previouspage creator-exporting-qml.html
|
2011-09-27 11:59:26 +02:00
|
|
|
\page creator-using-qt-designer.html
|
2011-12-13 11:52:47 +01:00
|
|
|
\nextpage adding-plugins.html
|
2011-09-27 11:59:26 +02:00
|
|
|
|
|
|
|
|
\title Developing Widget Based Applications
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\QC automatically opens all .ui files in the integrated \QD, in \uicontrol Design
|
2011-09-27 11:59:26 +02:00
|
|
|
mode.
|
|
|
|
|
|
|
|
|
|
\image qtcreator-formedit.png
|
|
|
|
|
|
2013-11-25 17:37:19 +01:00
|
|
|
For more information about \QD, see the \l{Qt Designer Manual}.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
|
|
|
|
Generally, the integrated \QD contains the same functions as the standalone
|
|
|
|
|
\QD. The following sections describe the differences.
|
|
|
|
|
|
|
|
|
|
\section1 Code Editor Integration
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
To switch between forms (\uicontrol Design mode) and code (\uicontrol Edit mode),
|
2011-09-27 11:59:26 +02:00
|
|
|
press \key Shift+F4.
|
|
|
|
|
|
|
|
|
|
You can use \QC to create stub implementations of slot functions. In the
|
2014-12-11 15:43:19 +01:00
|
|
|
\uicontrol Design mode, right-click a widget to open a context menu, and then
|
|
|
|
|
select \uicontrol {Go to Slot}. Select a signal in the list to go to an existing
|
2011-09-27 11:59:26 +02:00
|
|
|
slot function or to create a new slot function.
|
|
|
|
|
|
|
|
|
|
\section1 Managing Image Resources
|
|
|
|
|
|
|
|
|
|
In standalone \QD, image resources are created using the built-in
|
2014-12-11 15:43:19 +01:00
|
|
|
\uicontrol {Resource Editor}. In \QC, .ui files are usually part of a project,
|
2011-09-27 11:59:26 +02:00
|
|
|
which may contain several resource files (.qrc). They are created and
|
2014-12-11 15:43:19 +01:00
|
|
|
maintained by using the \QC Resource Editor. The \QD \uicontrol {Resource Editor}
|
2011-09-27 11:59:26 +02:00
|
|
|
is de-activated and the image resources are displayed in the \QD
|
2014-12-11 15:43:19 +01:00
|
|
|
\uicontrol {Resource Browser}.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
|
|
|
|
\section1 Specifying Settings for Qt Designer
|
|
|
|
|
|
2014-07-16 11:01:53 +02:00
|
|
|
You can drag and drop the views in \QD to new positions on the screen.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
|
|
|
|
To specify settings for \QD:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Designer.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Specify settins for generating classes and code in \uicontrol {Class
|
2011-09-27 11:59:26 +02:00
|
|
|
Generation}.
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li Specify embedded device profiles, that determine style, font, and
|
2014-12-11 15:43:19 +01:00
|
|
|
screen resolution, for example, in \uicontrol{Embedded Design}.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Specify settings for the grid and previewing forms in \uicontrol Forms.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Specify an additional folder for saving templates in \uicontrol{Template
|
2011-09-27 11:59:26 +02:00
|
|
|
Paths}.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
To preview the settings, select \uicontrol Tools > \uicontrol{Form Editor} >
|
|
|
|
|
\uicontrol Preview, or press \key Alt+Shift+R.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
|
|
|
|
\section1 Previewing Forms Using Device Skins
|
|
|
|
|
|
|
|
|
|
A \e {device skin} is a set of configuration files that describe a mobile
|
|
|
|
|
device. It includes a border image that surrounds the form and depicts a
|
|
|
|
|
mobile device with its buttons.
|
|
|
|
|
|
|
|
|
|
To preview your form using device skins:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Designer.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Select the \uicontrol{Print/Preview Configuration} check box.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In the \uicontrol {Device skin} field, select a device skin.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li When the form is open in \uicontrol Design mode, press \key Alt+Shift+R.
|
2011-09-27 11:59:26 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li To end the preview, right-click the skin and select \uicontrol Close in
|
2011-09-27 11:59:26 +02:00
|
|
|
the context menu.
|
|
|
|
|
|
|
|
|
|
\endlist
|
2013-11-04 17:25:24 +01:00
|
|
|
|
|
|
|
|
\section1 Adding Widgets
|
|
|
|
|
|
|
|
|
|
You can use Qt APIs to create plugins that extend Qt applications. This
|
|
|
|
|
enables you to add your own widgets to \QD. For more information, see
|
2013-11-26 12:52:42 +01:00
|
|
|
\l{Adding Qt Designer Plugins}.
|
2011-09-27 11:59:26 +02:00
|
|
|
*/
|