| Line 1: | Line 1: | ||
| + | {{Template:I18n/Language Navigation Bar|Development/Tutorials/Using Qt Creator}} | ||
| + | |||
| + | QtCreator is an IDE from Nokia for Qt. It contains QtDesigner for UI design. | ||
| + | |||
| + | = Creating a new program = | ||
| + | |||
| + | Qt Designer is a graphical program which allows you to easily build user interfaces, using a ''drag n drop'' interface. Here is a short example how it can go, for more information read the [http://qt.nokia.com/doc/designer-manual.html user documentation]. | ||
| + | |||
| + | ;Step 0: | ||
| + | Call Qt Designer from within the [http://labs.trolltech.com/page/Projects/Tools/QtCreator QtCreator] [http://en.wikipedia.org/wiki/Integrated_development_environment IDE]: | ||
| + | qtcreator | ||
| + | |||
| + | ;Step 1: | ||
| + | Add the widgets you want by drag-and-drop | ||
| + | |||
| + | [[File:Designer-step1.png|200px]] | ||
| + | |||
| + | ;Step 2: | ||
| + | Select the mainwindow. This is the one un-intuitive step. To lay out the objects in the mainwindow, you do not select the objects in the mainwindow, but the mainwindow itself. | ||
| + | |||
| + | [[File:Designer-step2.png|200px]] | ||
| + | |||
| + | ;Step 3: | ||
| + | Select Form -> Lay Out in a <u>G</u>rid | ||
| + | |||
| + | [[File:Designer-step3.png|200px]] | ||
| + | |||
| + | ;Result: | ||
| + | You get a decent look, and if you resize the window, the widgets resize as well. | ||
| + | |||
| + | [[File:Designer-result.png|200px]] | ||
| + | |||
| + | == Adding a toolbar == | ||
| + | To add a toolbar, right-click on the UI and choose "Add Toolbar". Then you can set icons and text in your mainwindow's constructor with code like this: | ||
| + | ui->toolBar->addAction(QIcon("/usr/share/icons/oxygen/22x22/apps/ktip.png"),"hello world"); | ||
| + | |||
= See also = | = See also = | ||
* [[Development/Tutorials/Using Qt Designer]] | * [[Development/Tutorials/Using Qt Designer]] | ||
* [[Getting_Started/Set_up_KDE_4_for_development#QtCreator]] | * [[Getting_Started/Set_up_KDE_4_for_development#QtCreator]] | ||
Contents |
Languages: عربي | Asturianu | Català | Česky | Kaszëbsczi | Dansk | Deutsch | English | Esperanto | Español | Eesti | فارسی | Suomi | Français | Galego | Italiano | 日本語 | 한국어 | Norwegian | Polski | Português Brasileiro | Română | Русский | Svenska | Slovenčina | Slovenščina | српски | Türkçe | Tiếng Việt | Українська | 简体中文 | 繁體中文
QtCreator is an IDE from Nokia for Qt. It contains QtDesigner for UI design.
Qt Designer is a graphical program which allows you to easily build user interfaces, using a drag n drop interface. Here is a short example how it can go, for more information read the user documentation.
Call Qt Designer from within the QtCreator IDE:
qtcreator
Add the widgets you want by drag-and-drop
Select the mainwindow. This is the one un-intuitive step. To lay out the objects in the mainwindow, you do not select the objects in the mainwindow, but the mainwindow itself.
Select Form -> Lay Out in a Grid
You get a decent look, and if you resize the window, the widgets resize as well.
To add a toolbar, right-click on the UI and choose "Add Toolbar". Then you can set icons and text in your mainwindow's constructor with code like this:
ui->toolBar->addAction(QIcon("/usr/share/icons/oxygen/22x22/apps/ktip.png"),"hello world");