Changeset 561 for trunk/tools/designer/src/uitools/quiloader.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/designer/src/uitools/quiloader.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the Qt Designer of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 260 260 const int col_cnt = tablew->columnCount(); 261 261 for (int j = 0; j < col_cnt; ++j) 262 reTranslateTableItem(tablew-> verticalHeaderItem(j), m_className);262 reTranslateTableItem(tablew->alHeaderItem(j), m_className); 263 263 for (int i = 0; i < row_cnt; ++i) { 264 reTranslateTableItem(tablew-> horizontalHeaderItem(i), m_className);264 reTranslateTableItem(tablew->alHeaderItem(i), m_className); 265 265 for (int j = 0; j < col_cnt; ++j) 266 266 reTranslateTableItem(tablew->item(i, j), m_className); … … 573 573 \inmodule QtUiTools 574 574 575 \brief The QUiLoader class allows standalone applications dynamically576 create user interfaces at run-time using the information stored in577 .ui files or specifiedplugin paths.578 579 In addition, you can customize o f creating an user interface by575 \brief The QUiLoader class 576 577 plugin paths. 578 579 In addition, you can customize on user interface by 580 580 deriving your own loader class. 581 581 582 If you have a custom component or an application that embeds Qt583 Designer, you can also use the QFormBuilder class provided by the584 QtDesigner module to create user interfaces from .uifiles.585 586 The QUiLoader class provides a collection of functions that allows587 you to create widgets based on the information stored in \c .ui588 files (created with Qt Designer) or available in the specified589 p lugin paths. The specified plugin paths can be retrieved using590 the pluginPaths() function. You can retrieve the contents of an \c591 .ui file using the load() function. Forexample:582 If you have a custom component or an application that embeds 583 e 584 files. 585 586 The QUiLoader class provides a collection of functions 587 588 589 p 590 591 example: 592 592 593 593 \snippet doc/src/snippets/quiloader/mywidget.cpp 0 594 594 595 By including the user interface in the form's resources (\c myform.qrc), 596 weensure that it will be present at run-time:595 By including the user interface in the form's resources (\c myform.qrc), 596 ensure that it will be present at run-time: 597 597 598 598 \quotefile doc/src/snippets/quiloader/mywidget.qrc 599 599 600 The availableWidgets() function returns a QStringList with the 601 class names of the widgets available in the specified plugin 602 paths. You can create any of these widgets using the 603 createWidget() function. For example: 600 The availableWidgets() function returns a QStringList with the class names 601 of the widgets available in the specified plugin paths. To create these 602 widgets, simply use the createWidget() function. For example: 604 603 605 604 \snippet doc/src/snippets/quiloader/main.cpp 0 606 605 607 You can make a custom widget available to the loader using the 608 addPluginPath() function, and you can remove all the available widgets 609 by calling the clearPluginPaths() function. 610 611 The createAction(), createActionGroup(), createLayout() and 612 createWidget() functions are used internally by the QUiLoader class 613 whenever it has to create an action, action group, layout or 614 widget respectively. For that reason, you can subclass the QUiLoader 615 class and reimplement these functions to intervene the process of 616 constructing an user interface. For example, you might want to 617 create a list of the actions created when loading a form or 618 creating a custom widget. 619 620 For a complete example using the QUiLoader class, see the \l 621 {designer/calculatorbuilder}{Calculator Builder} example. 606 To make a custom widget available to the loader, you can use the 607 addPluginPath() function; to remove all available widgets, you can call 608 the clearPluginPaths() function. 609 610 The createAction(), createActionGroup(), createLayout(), and createWidget() 611 functions are used internally by the QUiLoader class whenever it has to 612 create an action, action group, layout, or widget respectively. For that 613 reason, you can subclass the QUiLoader class and reimplement these 614 functions to intervene the process of constructing a user interface. For 615 example, you might want to have a list of the actions created when loading 616 a form or creating a custom widget. 617 618 For a complete example using the QUiLoader class, see the 619 \l{Calculator Builder Example}. 622 620 623 621 \sa QtUiTools, QFormBuilder … … 650 648 QUiLoader::~QUiLoader() 651 649 { 652 delete d_ptr; 653 } 654 655 /*! 656 Loads a form from the given \a device and creates a new widget with the given 657 \a parentWidget to hold its contents. 650 } 651 652 /*! 653 Loads a form from the given \a device and creates a new widget with the 654 given \a parentWidget to hold its contents. 658 655 659 656 \sa createWidget() … … 669 666 670 667 /*! 671 Returns a list naming the paths the loader searches when locating672 custom widget plugins.668 Returns a list naming the paths 669 custom widget plugins. 673 670 674 671 \sa addPluginPath(), clearPluginPaths() … … 681 678 682 679 /*! 683 Clears the list of paths the loader searcheswhen locating680 Clears the list of paths when locating 684 681 plugins. 685 682 … … 693 690 694 691 /*! 695 Adds the given \a path to the list of paths the loader searches692 Adds the given \a path to the list of paths 696 693 when locating plugins. 697 694 … … 705 702 706 703 /*! 707 Creates a new widget with the given \a parent and \a name708 using the class specified by \a className. You can use this709 function to create any of the widgets returned by the710 availableWidgets() function. 711 712 The function is also used internally by the QUiLoader class whenever713 it has to create a widget. For that reason, you can subclass the714 QUiLoader class and reimplement this function to intervene in the715 process of constructing a user interface or widget.716 717 \sa availableWidgets(), load()704 705 706 707 708 The function is also used internally by the QUiLoader class whenever it 709 710 711 712 t. 713 714 \sa availableWidgets(), load() 718 715 */ 719 716 QWidget *QUiLoader::createWidget(const QString &className, QWidget *parent, const QString &name) … … 724 721 725 722 /*! 726 Creates a new layout with the given \a parent and \a name 727 using the class specified by \a className. 728 729 The function is used internally by the QUiLoader class whenever it 730 has to create a layout. For that reason, you can subclass the 731 QUiLoader class and reimplement this function to intervene the 732 process of constructing an user interface or widget. 723 Creates a new layout with the given \a parent and \a name using the class 724 specified by \a className. 725 726 The function is also used internally by the QUiLoader class whenever it 727 creates a widget. Hence, you can subclass QUiLoader and reimplement this 728 function to intervene process of constructing a user interface or widget. 729 However, in your implementation, ensure that you call QUiLoader's version 730 first. 733 731 734 732 \sa createWidget(), load() … … 743 741 Creates a new action group with the given \a parent and \a name. 744 742 745 The function is used internally by the QUiLoader class whenever it 746 has to create an action group. For that reason, you can subclass 747 the QUiLoader class and reimplement this function to intervene the 748 process of constructing an user interface or widget. 743 The function is also used internally by the QUiLoader class whenever it 744 creates a widget. Hence, you can subclass QUiLoader and reimplement this 745 function to intervene process of constructing a user interface or widget. 746 However, in your implementation, ensure that you call QUiLoader's version 747 first. 749 748 750 749 \sa createAction(), createWidget(), load() … … 759 758 Creates a new action with the given \a parent and \a name. 760 759 761 The function is used internally by the QUiLoader class whenever it 762 has to create an action. For that reason, you can subclass the 763 QUiLoader class and reimplement this function to intervene the 764 process of constructing an user interface or widget. 760 The function is also used internally by the QUiLoader class whenever it 761 creates a widget. Hence, you can subclass QUiLoader and reimplement this 762 function to intervene process of constructing a user interface or widget. 763 However, in your implementation, ensure that you call QUiLoader's version 764 first. 765 765 766 766 \sa createActionGroup(), createWidget(), load() … … 773 773 774 774 /*! 775 Returns a list naming the available widgets that can be built776 using the createWidget() function, i.e all the widgets specified777 within the givenplugin paths.775 Returns a list naming 776 777 plugin paths. 778 778 779 779 \sa pluginPaths(), createWidget() … … 796 796 797 797 /*! 798 Returns a list naming the available layouts that can be built 799 using the createLayout() function 798 \since 4.5 799 Returns a list naming all available layouts that can be built using the 800 createLayout() function 800 801 801 802 \sa createLayout() 802 \since 4.5803 803 */ 804 804 … … 817 817 818 818 /*! 819 Sets the working directory of the loader to \a dir. The loader 820 looks for other resources, such as icons and resource files,821 in paths relative tothis directory.819 Sets the working directory of the loader to \a dir. The loader 820 821 this directory. 822 822 823 823 \sa workingDirectory() … … 843 843 844 844 /*! 845 Sets whether the execution of scripts is enabled to \a enabled.845 846 846 \since 4.3 847 848 849 850 851 852 853 854 855 856 857 858 859 860 847 861 \internal 848 */ 849 850 void QUiLoader::setScriptingEnabled(bool enabled) 851 { 852 Q_D(QUiLoader); 853 d->builder.setScriptingEnabled(enabled); 854 } 855 856 /*! 857 Returns whether the execution of scripts is enabled. 858 \sa setScriptingEnabled() 859 \since 4.3 860 \internal 862 \since 4.3 863 864 Returns true if execution of scripts is enabled; returns false otherwise. 865 866 \sa setScriptingEnabled() 861 867 */ 862 868 … … 868 874 869 875 /*! 870 Sets whether user interfaces loaded by this loader automatically871 retranslate themselves upon receiving a language change event or not,872 depending on \a enabled.873 874 876 \since 4.5 877 878 879 880 881 882 875 883 */ 876 884 … … 882 890 883 891 /*! 884 Returns whether dynamic retranslation on language change is enabled. 885 \sa setLanguageChangeEnabled() 886 \since 4.5 892 \since 4.5 893 894 Returns true if dynamic retranslation on language change is enabled; 895 returns false otherwise. 896 897 \sa setLanguageChangeEnabled() 887 898 */ 888 899 … … 895 906 /*! 896 907 \internal 897 898 Sets whether user interfaces loaded by this loader are translated899 at all. Note that this is orthogonal to languageChangeEnabled.900 901 908 \since 4.5 909 910 911 912 913 914 915 902 916 */ 903 917 … … 910 924 /*! 911 925 \internal 912 913 Returns whether translation is enabled. 926 \since 4.5 927 928 Returns true if translation is enabled; returns false otherwise. 929 914 930 \sa setTranslationEnabled() 915 916 \since 4.5917 931 */ 918 932
Note:
See TracChangeset
for help on using the changeset viewer.