diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
commit | bd0f3345a938b35ce6a12f6150373b0955b8dd12 (patch) | |
tree | 7a520322212d48ebcb9fbe1087e7fca28b76185c /tools/designer/examples/addressbook | |
download | qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.tar.gz qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.zip |
Add Qt3 development HEAD version
Diffstat (limited to 'tools/designer/examples/addressbook')
-rw-r--r-- | tools/designer/examples/addressbook/addressbook.pro | 14 | ||||
-rw-r--r-- | tools/designer/examples/addressbook/addressbook.ui | 324 | ||||
-rw-r--r-- | tools/designer/examples/addressbook/addressbook.ui.h | 137 | ||||
-rw-r--r-- | tools/designer/examples/addressbook/addressdetails.ui | 243 | ||||
-rw-r--r-- | tools/designer/examples/addressbook/addressdetails.ui.h | 24 | ||||
-rw-r--r-- | tools/designer/examples/addressbook/images/editcut.png | bin | 0 -> 163 bytes | |||
-rw-r--r-- | tools/designer/examples/addressbook/images/filenew.png | bin | 0 -> 150 bytes | |||
-rw-r--r-- | tools/designer/examples/addressbook/images/fileopen.png | bin | 0 -> 179 bytes | |||
-rw-r--r-- | tools/designer/examples/addressbook/images/filesave.png | bin | 0 -> 157 bytes | |||
-rw-r--r-- | tools/designer/examples/addressbook/images/searchfind.png | bin | 0 -> 587 bytes | |||
-rw-r--r-- | tools/designer/examples/addressbook/main.cpp | 11 | ||||
-rw-r--r-- | tools/designer/examples/addressbook/search.ui | 136 | ||||
-rw-r--r-- | tools/designer/examples/addressbook/search.ui.h | 13 |
13 files changed, 902 insertions, 0 deletions
diff --git a/tools/designer/examples/addressbook/addressbook.pro b/tools/designer/examples/addressbook/addressbook.pro new file mode 100644 index 0000000..70b805a --- /dev/null +++ b/tools/designer/examples/addressbook/addressbook.pro @@ -0,0 +1,14 @@ +TEMPLATE = app +LANGUAGE = C++ + +CONFIG += qt warn_on release +unix { + UI_DIR = .ui + MOC_DIR = .moc + OBJECTS_DIR = .obj +} + +SOURCES += main.cpp +FORMS = addressbook.ui addressdetails.ui search.ui +IMAGES = images/filenew.png images/fileopen.png images/filesave.png images/searchfind.png images/editcut.png +DBFILE = addressbook.db diff --git a/tools/designer/examples/addressbook/addressbook.ui b/tools/designer/examples/addressbook/addressbook.ui new file mode 100644 index 0000000..54a4303 --- /dev/null +++ b/tools/designer/examples/addressbook/addressbook.ui @@ -0,0 +1,324 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>AddressBook</class> +<widget class="QMainWindow"> + <property name="name"> + <cstring>AddressBook</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>480</height> + </rect> + </property> + <property name="caption"> + <string>Address Book</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QListView"> + <column> + <property name="text"> + <string>Last Name</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>First Name</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Phone Number</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Street </string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>City</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Country</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Zip Code</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>addressView</cstring> + </property> + <property name="selectionMode"> + <enum>Extended</enum> + </property> + <property name="allColumnsShowFocus"> + <bool>true</bool> + </property> + </widget> + </hbox> +</widget> +<menubar> + <property name="name"> + <cstring>menubar</cstring> + </property> + <item text="&File" name="fileMenu"> + <action name="fileNewAction"/> + <action name="fileOpenAction"/> + <action name="fileSaveAction"/> + <action name="fileSaveAsAction"/> + <separator/> + <action name="fileExitAction"/> + </item> + <item text="&Edit" name="editMenu"> + <action name="actionDeleteAddress"/> + <separator/> + <action name="editFindAction"/> + </item> +</menubar> +<toolbars> + <toolbar dock="2"> + <property name="name"> + <cstring>toolBar</cstring> + </property> + <property name="label"> + <string>Tools</string> + </property> + <action name="fileNewAction"/> + <action name="fileOpenAction"/> + <action name="fileSaveAction"/> + <separator/> + <action name="actionDeleteAddress"/> + <action name="editFindAction"/> + </toolbar> +</toolbars> +<actions> + <action> + <property name="name"> + <cstring>fileNewAction</cstring> + </property> + <property name="iconSet"> + <iconset>filenew.png</iconset> + </property> + <property name="text"> + <string>New</string> + </property> + <property name="menuText"> + <string>&New</string> + </property> + <property name="accel"> + <number>4194382</number> + </property> + </action> + <action> + <property name="name"> + <cstring>fileOpenAction</cstring> + </property> + <property name="iconSet"> + <iconset>fileopen.png</iconset> + </property> + <property name="text"> + <string>Open</string> + </property> + <property name="menuText"> + <string>&Open...</string> + </property> + <property name="accel"> + <number>4194383</number> + </property> + </action> + <action> + <property name="name"> + <cstring>fileSaveAction</cstring> + </property> + <property name="iconSet"> + <iconset>filesave.png</iconset> + </property> + <property name="text"> + <string>Save</string> + </property> + <property name="menuText"> + <string>&Save</string> + </property> + <property name="accel"> + <number>4194387</number> + </property> + </action> + <action> + <property name="name"> + <cstring>fileSaveAsAction</cstring> + </property> + <property name="text"> + <string>Save As</string> + </property> + <property name="menuText"> + <string>Save &As...</string> + </property> + <property name="accel"> + <number>0</number> + </property> + </action> + <action> + <property name="name"> + <cstring>fileExitAction</cstring> + </property> + <property name="text"> + <string>Exit</string> + </property> + <property name="menuText"> + <string>E&xit</string> + </property> + <property name="accel"> + <number>0</number> + </property> + </action> + <action> + <property name="name"> + <cstring>editFindAction</cstring> + </property> + <property name="iconSet"> + <iconset>searchfind.png</iconset> + </property> + <property name="text"> + <string>Find</string> + </property> + <property name="menuText"> + <string>&Find...</string> + </property> + <property name="accel"> + <number>4194374</number> + </property> + </action> + <action> + <property name="name"> + <cstring>actionDeleteAddress</cstring> + </property> + <property name="iconSet"> + <iconset>editcut.png</iconset> + </property> + <property name="text"> + <string>Delete</string> + </property> + </action> +</actions> +<connections> + <connection> + <sender>fileNewAction</sender> + <signal>activated()</signal> + <receiver>AddressBook</receiver> + <slot>fileNew()</slot> + </connection> + <connection> + <sender>fileOpenAction</sender> + <signal>activated()</signal> + <receiver>AddressBook</receiver> + <slot>fileOpen()</slot> + </connection> + <connection> + <sender>fileSaveAction</sender> + <signal>activated()</signal> + <receiver>AddressBook</receiver> + <slot>fileSave()</slot> + </connection> + <connection> + <sender>fileSaveAsAction</sender> + <signal>activated()</signal> + <receiver>AddressBook</receiver> + <slot>fileSaveAs()</slot> + </connection> + <connection> + <sender>fileExitAction</sender> + <signal>activated()</signal> + <receiver>AddressBook</receiver> + <slot>fileExit()</slot> + </connection> + <connection> + <sender>editFindAction</sender> + <signal>activated()</signal> + <receiver>AddressBook</receiver> + <slot>editFind()</slot> + </connection> + <connection> + <sender>actionDeleteAddress</sender> + <signal>activated()</signal> + <receiver>AddressBook</receiver> + <slot>deleteAddress()</slot> + </connection> +</connections> +<includes> + <include location="local" impldecl="in implementation">addressbook.ui.h</include> +</includes> +<variables> + <variable>QString currentFileName;</variable> +</variables> +<slots> + <slot>fileNew()</slot> + <slot>insertAddress( const QString & firstName, const QString & lastName, const QString & phoneNumber, const QString & street, const QString & city, const QString & country, const QString & zipCode )</slot> + <slot>deleteAddress()</slot> + <slot>fileOpen()</slot> + <slot>fileSave()</slot> + <slot>fileSaveAs()</slot> + <slot>fileExit()</slot> + <slot>editFind()</slot> + <slot>searchAddress( const QString & expr )</slot> +</slots> +<pixmapinproject/> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/tools/designer/examples/addressbook/addressbook.ui.h b/tools/designer/examples/addressbook/addressbook.ui.h new file mode 100644 index 0000000..0d4bd88 --- /dev/null +++ b/tools/designer/examples/addressbook/addressbook.ui.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + +#include "addressdetails.h" +#include "search.h" +#include <qfile.h> +#include <qtextstream.h> +#include <qfiledialog.h> +#include <qapplication.h> + +void AddressBook::fileNew() +{ + AddressDetails dia( this, 0, TRUE ); + connect( &dia, SIGNAL( newAddress( const QString &, + const QString &, + const QString &, + const QString &, + const QString &, + const QString &, + const QString & ) ), + this, SLOT( insertAddress( const QString &, + const QString &, + const QString &, + const QString &, + const QString &, + const QString &, + const QString & ) ) ); + dia.exec(); +} + +void AddressBook::insertAddress( const QString &firstName, + const QString &lastName, + const QString &phoneNumber, + const QString &street, + const QString &city, + const QString &country, + const QString &zipCode ) +{ + QListViewItem *i = new QListViewItem( addressView ); + i->setText( 0, firstName ); + i->setText( 1, lastName ); + i->setText( 2, phoneNumber ); + i->setText( 3, street ); + i->setText( 4, city ); + i->setText( 5, country ); + i->setText( 6, zipCode ); +} + +void AddressBook::deleteAddress() +{ + QListViewItemIterator it( addressView ); + while ( it.current() ) { + QListViewItem *i = it.current(); + ++it; + if ( i->isSelected() ) + delete i; + } +} + +void AddressBook::fileOpen() +{ + addressView->clear(); + QString fn = QFileDialog::getOpenFileName(); + if ( fn.isEmpty() ) + return; + currentFileName = fn; + QFile f( currentFileName ); + if ( !f.open( IO_ReadOnly ) ) + return; + QTextStream ts( &f ); + + while ( !ts.eof() ) { + QListViewItem *item = new QListViewItem( addressView ); + for ( int i = 0; i < 7; ++i ) + item->setText( i, ts.readLine() ); + } + +} + +void AddressBook::fileSave() +{ + if ( currentFileName.isEmpty() ) + fileSaveAs(); + QFile f( currentFileName ); + if ( !f.open( IO_WriteOnly ) ) + return; + QTextStream ts( &f ); + + QListViewItemIterator it( addressView ); + while ( it.current() ) { + for ( int i = 0; i < 7; ++i ) + ts << it.current()->text( i ) << endl; + ++it; + } + + f.close(); +} + +void AddressBook::fileSaveAs() +{ + QString fn = QFileDialog::getSaveFileName(); + if ( fn.isEmpty() ) + return; + currentFileName = fn; + fileSave(); +} + +void AddressBook::fileExit() +{ + qApp->exit(); +} + +void AddressBook::editFind() +{ + SearchDialog dia( this, 0, TRUE ); + connect( &dia, SIGNAL( searchAddress( const QString & ) ), + this, SLOT( searchAddress( const QString & ) ) ); + dia.exec(); +} + +void AddressBook::searchAddress( const QString &expr ) +{ + addressView->clearSelection(); + QListViewItemIterator it( addressView ); + while ( it.current() ) { + for ( int i = 0; i < 7; ++i ) { + if ( it.current()->text( i ).find( expr ) != -1 ) + addressView->setSelected( it.current(), TRUE ); + } + ++it; + } +}
\ No newline at end of file diff --git a/tools/designer/examples/addressbook/addressdetails.ui b/tools/designer/examples/addressbook/addressdetails.ui new file mode 100644 index 0000000..d321a0c --- /dev/null +++ b/tools/designer/examples/addressbook/addressdetails.ui @@ -0,0 +1,243 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>AddressDetails</class> +<widget class="QDialog"> + <property name="name"> + <cstring>AddressDetails</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>216</width> + <height>252</height> + </rect> + </property> + <property name="caption"> + <string>Enter Address</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout2</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>TextLabel8</cstring> + </property> + <property name="text"> + <string>Street</string> + </property> + </widget> + <widget class="QLineEdit" row="3" column="1"> + <property name="name"> + <cstring>editStreet</cstring> + </property> + </widget> + <widget class="QLineEdit" row="2" column="1"> + <property name="name"> + <cstring>editPhoneNumber</cstring> + </property> + </widget> + <widget class="QLabel" row="4" column="0"> + <property name="name"> + <cstring>TextLabel7</cstring> + </property> + <property name="text"> + <string>City</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Last Name</string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>TextLabel6</cstring> + </property> + <property name="text"> + <string>Phone Number</string> + </property> + </widget> + <widget class="QLineEdit" row="5" column="1"> + <property name="name"> + <cstring>editCountry</cstring> + </property> + </widget> + <widget class="QLabel" row="6" column="0"> + <property name="name"> + <cstring>TextLabel10</cstring> + </property> + <property name="text"> + <string>Zip Code</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>editLastName</cstring> + </property> + </widget> + <widget class="QLineEdit" row="6" column="1"> + <property name="name"> + <cstring>editZipCode</cstring> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel4</cstring> + </property> + <property name="text"> + <string>First Name</string> + </property> + </widget> + <widget class="QLineEdit" row="4" column="1"> + <property name="name"> + <cstring>editCity</cstring> + </property> + </widget> + <widget class="QLabel" row="5" column="0"> + <property name="name"> + <cstring>TextLabel9</cstring> + </property> + <property name="text"> + <string>Country</string> + </property> + </widget> + <widget class="QLineEdit" row="1" column="1"> + <property name="name"> + <cstring>editFirstName</cstring> + </property> + </widget> + </grid> + </widget> + <spacer> + <property name="name" stdset="0"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name" stdset="0"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButton2</cstring> + </property> + <property name="text"> + <string>OK</string> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButton3</cstring> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </hbox> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>PushButton2</sender> + <signal>clicked()</signal> + <receiver>AddressDetails</receiver> + <slot>okClicked()</slot> + </connection> + <connection> + <sender>PushButton3</sender> + <signal>clicked()</signal> + <receiver>AddressDetails</receiver> + <slot>reject()</slot> + </connection> +</connections> +<tabstops> + <tabstop>editLastName</tabstop> + <tabstop>editFirstName</tabstop> + <tabstop>editPhoneNumber</tabstop> + <tabstop>editStreet</tabstop> + <tabstop>editCity</tabstop> + <tabstop>editCountry</tabstop> + <tabstop>editZipCode</tabstop> + <tabstop>PushButton2</tabstop> + <tabstop>PushButton3</tabstop> +</tabstops> +<includes> + <include location="local" impldecl="in implementation">addressdetails.ui.h</include> +</includes> +<signals> + <signal>newAddress( const QString &, const QString &, const QString &, const QString &, const QString &, const QString &, const QString & );</signal> +</signals> +<slots> + <slot>init()</slot> + <slot>okClicked()</slot> +</slots> +<pixmapinproject/> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/tools/designer/examples/addressbook/addressdetails.ui.h b/tools/designer/examples/addressbook/addressdetails.ui.h new file mode 100644 index 0000000..e6c1ff5 --- /dev/null +++ b/tools/designer/examples/addressbook/addressdetails.ui.h @@ -0,0 +1,24 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + +void AddressDetails::init() +{ + editLastName->setFocus(); +} + +void AddressDetails::okClicked() +{ + emit newAddress( editLastName->text(), + editFirstName->text(), + editPhoneNumber->text(), + editStreet->text(), + editCity->text(), + editCountry->text(), + editZipCode->text() ); + close(); +}
\ No newline at end of file diff --git a/tools/designer/examples/addressbook/images/editcut.png b/tools/designer/examples/addressbook/images/editcut.png Binary files differnew file mode 100644 index 0000000..9c7fb3c --- /dev/null +++ b/tools/designer/examples/addressbook/images/editcut.png diff --git a/tools/designer/examples/addressbook/images/filenew.png b/tools/designer/examples/addressbook/images/filenew.png Binary files differnew file mode 100644 index 0000000..d898107 --- /dev/null +++ b/tools/designer/examples/addressbook/images/filenew.png diff --git a/tools/designer/examples/addressbook/images/fileopen.png b/tools/designer/examples/addressbook/images/fileopen.png Binary files differnew file mode 100644 index 0000000..7e49adb --- /dev/null +++ b/tools/designer/examples/addressbook/images/fileopen.png diff --git a/tools/designer/examples/addressbook/images/filesave.png b/tools/designer/examples/addressbook/images/filesave.png Binary files differnew file mode 100644 index 0000000..77d9f50 --- /dev/null +++ b/tools/designer/examples/addressbook/images/filesave.png diff --git a/tools/designer/examples/addressbook/images/searchfind.png b/tools/designer/examples/addressbook/images/searchfind.png Binary files differnew file mode 100644 index 0000000..f18b029 --- /dev/null +++ b/tools/designer/examples/addressbook/images/searchfind.png diff --git a/tools/designer/examples/addressbook/main.cpp b/tools/designer/examples/addressbook/main.cpp new file mode 100644 index 0000000..9a58f60 --- /dev/null +++ b/tools/designer/examples/addressbook/main.cpp @@ -0,0 +1,11 @@ +#include <qapplication.h> +#include "addressbook.h" + +int main( int argc, char ** argv ) +{ + QApplication a( argc, argv ); + AddressBook *w = new AddressBook; + w->show(); + a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); + return a.exec(); +} diff --git a/tools/designer/examples/addressbook/search.ui b/tools/designer/examples/addressbook/search.ui new file mode 100644 index 0000000..4329048 --- /dev/null +++ b/tools/designer/examples/addressbook/search.ui @@ -0,0 +1,136 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>SearchDialog</class> +<widget class="QDialog"> + <property name="name"> + <cstring>SearchDialog</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>216</width> + <height>76</height> + </rect> + </property> + <property name="caption"> + <string>Search</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout3</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel12</cstring> + </property> + <property name="text"> + <string>Search</string> + </property> + </widget> + <widget class="QLineEdit"> + <property name="name"> + <cstring>editSearch</cstring> + </property> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout4</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name" stdset="0"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButton4</cstring> + </property> + <property name="text"> + <string>Search</string> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButton5</cstring> + </property> + <property name="text"> + <string>Close</string> + </property> + </widget> + </hbox> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>PushButton5</sender> + <signal>clicked()</signal> + <receiver>SearchDialog</receiver> + <slot>reject()</slot> + </connection> + <connection> + <sender>PushButton4</sender> + <signal>clicked()</signal> + <receiver>SearchDialog</receiver> + <slot>search()</slot> + </connection> +</connections> +<includes> + <include location="local" impldecl="in implementation">search.ui.h</include> +</includes> +<signals> + <signal>searchAddress( const QString & )</signal> +</signals> +<slots> + <slot>search()</slot> +</slots> +<pixmapinproject/> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/tools/designer/examples/addressbook/search.ui.h b/tools/designer/examples/addressbook/search.ui.h new file mode 100644 index 0000000..8b3a8d5 --- /dev/null +++ b/tools/designer/examples/addressbook/search.ui.h @@ -0,0 +1,13 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + +void SearchDialog::search() +{ + emit searchAddress( editSearch->text() ); + close(); +}
\ No newline at end of file |