Qtリファレンス Alt Key 新しいページはコチラ

提供: yonewiki
移動: 案内, 検索
(API)
(API)
 
45行: 45行:
  
 
=== '''API''' ===
 
=== '''API''' ===
*<span style="color:#cccccc;">Include</span>(インクルードするファイル)
+
*'''<span style="color:#cccccc;">Include</span>(インクルードするファイル)'''
 
&#x23;include "alt_key.hpp"
 
&#x23;include "alt_key.hpp"
  
 
 <span style="color:#cccccc;">This includes the kuhn_munkres.hpp file.</span>(これはkuhn_munkres.hppファイルをインクルードします。) <span style="color:#cccccc;">Either copy the four files into your project or soft link them or add them to your include path.</span>(4つのファイルをプロジェクトにコピーするか、ソフトリンクするか、インクルードパスに追加します。 )
 
 <span style="color:#cccccc;">This includes the kuhn_munkres.hpp file.</span>(これはkuhn_munkres.hppファイルをインクルードします。) <span style="color:#cccccc;">Either copy the four files into your project or soft link them or add them to your include path.</span>(4つのファイルをプロジェクトにコピーするか、ソフトリンクするか、インクルードパスに追加します。 )
  
*Constant(定数)
+
*'''Constant(定数)'''
 
QString AQP::Alphabet
 
QString AQP::Alphabet
  
57行: 57行:
  
  
 <span style="color:#cccccc;">All the functions that take an alphabet argument use this as their default value.</span>(アルファベット引数を取るすべての関数は、これをデフォルト値として使用します) <span style="color:#cccccc;">If you choose to use a different alphabet you may only use uppercase letters</span>(別のアルファベットを使用する場合は、大文字のみを使用できます ) (or no-case letters for languages that don't distinguish case) ((あるいは大小を持たない、大文字と小文字を区別しない言語 )).
+
 <span style="color:#cccccc;">All the functions that take an alphabet argument use this as their default value.</span>(アルファベット引数を取るすべての関数は、これをデフォルト値として使用します) <span style="color:#cccccc;">If you choose to use a different alphabet you may only use uppercase letters</span>(別のアルファベットを使用する場合は、大文字のみを使用できます ) (<span style="color:#cccccc;">or no-case letters for languages that don't distinguish case</span>) ((あるいは大小を持たない、大文字と小文字を区別しない言語 )).
(Actually this is now an instance of the private AQP::_Alphabet class; the class provides a single method which is a QString conversion function, so in most cases it can be used wherever a QString is expected. The reason for this change is to make the alphabet string translatable.)
+
(<span style="color:#cccccc;">Actually this is now an instance of the private AQP::_Alphabet class;</span>(実際、これは今、プライベートなAQP::_Alphabet クラスは実在している。) <span style="color:#cccccc;">the class provides a single method which is a QString conversion function</span>(このクラスはQString互換関数のシングルメソッド提供します。), <span style="color:#cccccc;">so in most cases it can be used wherever a QString is expected.</span>(だから、ほとんどの場合、QStringが期待されるのであれば、それは使用することができます。 ) <span style="color:#cccccc;">The reason for this change is to make the alphabet string translatable.</span>(この変更理由は、翻訳可能なアルファベット文字列を作ることにあります。))
  
  
Main Functions
+
*'''<span style="color:#cccccc;">Main Functions</span>(メインファンクション)'''
  
These are the most commonly used functions provided by the Alt_Key library.
+
<span style="color:#cccccc;">These are the most commonly used functions provided by the Alt_Key library.</span>(これらの最も一般的なAlt_Key ライブラリによって提供される関数の使い方)
  
  
void AQP::accelerateActions(QList<QAction*> actions, const QString &alphabet=Alphabet)
+
*'''<span style="color:deeppink;">void</span> <span style="color:darkblue;">AQP::accelerateActions</span>(<span style="color:deeppink;">QList<QAction*></span> actions, <span style="color:deeppink;">const QString&</span>  alphabet=Alphabet)'''
  
  
This function takes a list of actions and optionally an alphabet. It adds keyboard accelerators to every action's text wherever possible. Existing accelerators are respected as are plain ampersands (which are represented by "&&" in strings).
+
 <span style="color:#cccccc;">This function takes a list of actions and optionally an alphabet. It adds keyboard accelerators to every action's text wherever possible.</span>(この関数は、アクションのリストと、オプションでアルファベットを取ります。 可能な限り、すべてのアクションのテキストにキーボードアクセラレータを追加します。 )<span style="color:#cccccc;">Existing accelerators are respected as are plain ampersands</span>(プレーンアンパサンドと同様に、既存のアクセラレータが尊重されます ) (<span style="color:#cccccc;">which are represented by "&&" in strings</span>).
  
  
void AQP::accelerateMenu(QWidget *menuOrMenuBar, const QString &alphabet=Alphabet)
+
*'''<span style="color:deeppink;">void</span> <span style="color:darkblue;">AQP::accelerateMenu</span>(<span style="color:deeppink;">QWidget*</span> menuOrMenuBar, <span style="color:deeppink;">const QString&</span> alphabet=Alphabet)'''
  
  
This function takes a menu (including context menus) or a main window's menu bar and optionally an alphabet. It adds keyboard accelerators to every menu item's text wherever possible. The function works recursively, adding accelerators to submenus and subsubmenus. Existing accelerators are respected as are plain ampersands (which are represented by "&&" in strings).
+
 <span style="color:#cccccc;">This function takes a menu (including context menus) or a main window's menu bar and optionally an alphabet. It adds keyboard accelerators to every menu item's text wherever possible. </span>(この関数は、メニュー(コンテキストメニューを含む)またはメインウィンドウのメニューバーと、オプションでアルファベットを取ります。 可能な限り、すべてのメニュー項目のテキストにキーボードアクセラレータを追加します。 )<span style="color:#cccccc;">The function works recursively, adding accelerators to submenus and subsubmenus. </span>(関数は再帰的に機能し、サブメニューとサブサブメニューにアクセラレータを追加します。 )<span style="color:#cccccc;">Existing accelerators are respected as are plain ampersands</span>(プレーンアンパサンドと同様に、既存のアクセラレータが尊重されます ) (<span style="color:#cccccc;">which are represented by "&&" in strings).</span>(文字列の&&によってあらわされるかどちかです。)
  
  
void AQP::accelerateWidget(QWidget *widget, const QString &alphabet=Alphabet)
+
*'''<span style="color:deeppink;">void</span> <span style="color:darkblue;">AQP::accelerateWidget</span>(<span style="color:deeppink;">QWidget*</span> widget, <span style="color:deeppink;">const QString&</span> alphabet=Alphabet)'''
  
  
This function takes a widget (such as a QDialog subclass) and optionally an alphabet. It adds keyboard accelerators to every buddy label, button (i.e., all QAbstractButton subclasses apart from QToolButton), checkbox, checkable group box, and radio button, that is a child of the widget (or grandchild, recursively), wherever possible. Existing accelerators are respected as are plain ampersands (which are represented by "&&" in strings).
+
 <span style="color:#cccccc;">This function takes a widget (such as a QDialog subclass) and optionally an alphabet. It adds keyboard accelerators to every buddy label, button (i.e., all QAbstractButton subclasses apart from QToolButton), checkbox, checkable group box, and radio button, that is a child of the widget (or grandchild, recursively), wherever possible. </span>(この関数は、ウィジェット(QDialogサブクラスなど)とオプションでアルファベットを取ります。 可能な限り、すべてのバディラベル、ボタン(つまり、QToolButtonを除くすべてのQAbstractButtonサブクラス)、チェックボックス、チェック可能なグループボックス、およびウィジェットの子(または孫、再帰的)であるラジオボタンにキーボードアクセラレータを追加します。 )<span style="color:#cccccc;">Existing accelerators are respected as are plain ampersands</span>(プレーンアンパサンドと同様に、既存のアクセラレータが尊重されます ) (<span style="color:#cccccc;">which are represented by "&&" in strings</span>).(文字列の&&によってあらわされるかどちかです。)
  
  
void AQP::accelerateWidgets(QList<QWidget*> widgets, const QString &alphabet=Alphabet)
+
*'''<span style="color:deeppink;">void</span> <span style="color:darkblue;">AQP::accelerateWidgets</span>(<span style="color:deeppink;">QList<QWidget*></span> widgets, <span style="color:deeppink;">const QString &</span> alphabet=Alphabet)'''
  
  
This function takes a list of widgets (for example, all the widgets on a particular tab widget page) and optionally an alphabet. It adds keyboard accelerators to every suitable widget, (i.e., to every buddy label and button), wherever possible. Existing accelerators are respected as are plain ampersands (which are represented by "&&" in strings).
+
 <span style="color:#cccccc;">This function takes a list of widgets (for example, all the widgets on a particular tab widget page) and optionally an alphabet. It adds keyboard accelerators to every suitable widget, (i.e., to every buddy label and button), wherever possible. </span>(この関数は、ウィジェットのリスト(たとえば、特定のタブウィジェットページ上のすべてのウィジェット)と、オプションでアルファベットを取ります。 可能な限り、すべての適切なウィジェット(つまり、すべてのバディラベルとボタン)にキーボードアクセラレータを追加します。 )<span style="color:#cccccc;">Existing accelerators are respected as are plain ampersands</span>(プレーンアンパサンドと同様に、既存のアクセラレータが尊重されます ) (<span style="color:#cccccc;">which are represented by "&&" in strings</span>).(文字列の&&によってあらわされるかどちかです。)
Auxiliary Functions
+
These functions are occassionally useful.
+
  
  
QStringList AQP::accelerated(const QStringList &strings, const QString &alphabet=Alphabet)
+
*'''<span style="color:#cccccc;">Auxiliary Functions</span>(拡張関数)'''
 +
<span style="color:#cccccc;">These functions are occassionally useful.</span>(これらの関数は時折、役に立ちます。)
  
  
This function takes a list of strings and optionally an alphabet. It returns a new string list with a keyboard accelerator added to every string wherever possible. Existing accelerators are respected as are plain ampersands (which are represented by "&&" in strings).
+
*'''<span style="color:deeppink;">QStringList</span> <span style="color:darkblue;">AQP::accelerated</span>(<span style="color:deeppink;">const QStringList&</span> strings, <span style="color:deeppink;">const QString&</span> alphabet=Alphabet)'''
  
  
bool AQP::isValid(const QStringList &strings, QPair<int, int> *where=0, const QString &alphabet=Alphabet)
+
 <span style="color:#cccccc;">This function takes a list of strings and optionally an alphabet. </span>(この関数は、文字列のリストと、オプションでアルファベットを受け取ります。 )<span style="color:#cccccc;">It returns a new string list with a keyboard accelerator added to every string wherever possible. </span>(可能な限りすべての文字列にキーボードアクセラレータが追加された新しい文字列リストを返します。 )<span style="color:#cccccc;">Existing accelerators are respected as are plain ampersands</span>(プレーンアンパサンドと同様に、既存のアクセラレータが尊重されます ) (<span style="color:#cccccc;">which are represented by "&&" in strings</span>).(文字列の&&によってあらわされるかどちかです。)
  
  
This function returns true if the given list of strings has valid accelerators. Valid includes no accelerators, but does not include duplicate accelerators. If the where pair is passed and the function returns false the pair's ints are set to the index of the first string in the list and the index of the character within the string where a problem (e.g., duplicate accelerators) occurred.
+
*'''<span style="color:deeppink;">bool</span> <span style="color:darkblue;">AQP::isValid</span>(<span style="color:deeppink;">const QStringList&</span> strings, <span style="color:deeppink;">QPair<int, int>*</span> where=0, <span style="color:deeppink;">const QString&</span> alphabet=Alphabet)'''
  
  
int AQP::numberAccelerated(const QStringList &strings)
+
 <span style="color:#cccccc;">This function returns true if the given list of strings has valid accelerators. </span>(指定された文字列リストに有効なアクセラレータがある場合、この関数はtrueを返します。 )<span style="color:#cccccc;">Valid includes no accelerators, but does not include duplicate accelerators. </span>(有効なアクセラレータには含まれないものですが、重複するアクセラレータは含まれません。)<span style="color:#cccccc;">If the where pair is passed and the function returns false the pair's ints are set to the index of the first string in the list and the index of the character within the string where a problem (e.g., duplicate accelerators) occurred.</span>(whereペアが渡され、関数がfalseを返す場合、ペアのintは、リストの最初の文字列のインデックスと、問題(アクセラレータの重複など)が発生した文字列内の文字のインデックスに設定されます。 )
  
  
This function returns the number of strings in the string list that have accelerators.
+
*'''<span style="color:deeppink;">int</span> <span style="color:darkblue;">AQP::numberAccelerated</span>(<span style="color:deeppink;">const QStringList&</span> strings)'''
double AQP::quality(const QStringList &strings)
+
 
This function returns a rough guide to accelerator quality. For each string the best quality is when the string has an accelerator for its first character, second best is an accelerator for the start of a word, third best is any accelerator at all, and worst is no accelerator. The quality computation accounts for the overall quality of all the strings in the list and returns a value that ranges from 0.0 (worst) to 1.0 (best).
+
 
 +
 <span style="color:#cccccc;">This function returns the number of strings in the string list that have accelerators.</span>(この関数は、アクセラレータを持つ文字列リスト内の文字列の数を返します。)
 +
 
 +
 
 +
*'''<span style="color:deeppink;">double</span> <span style="color:darkblue;">AQP::quality</span>(<span style="color:deeppink;">const QStringList&</span> strings)'''
 +
 
 +
 
 +
 <span style="color:#cccccc;">This function returns a rough guide to accelerator quality. </span>(この関数は、アクセラレータの品質の大まかなガイドを返します。)<span style="color:#cccccc;">For each string the best quality is when the string has an accelerator for its first character, second best is an accelerator for the start of a word, third best is any accelerator at all, and worst is no accelerator. </span>(各文字列について、最高の品質は、文字列の最初の文字にアクセラレータがある場合、2番目に良いのは単語の先頭のアクセラレータ、3番目に良いのはすべてのアクセラレータ、最悪なケースはアクセラレータがない場合です。 )<span style="color:#cccccc;">The quality computation accounts for the overall quality of all the strings in the list and returns a value that ranges from 0.0 (worst) to 1.0 (best).</span>(品質計算は、リスト内のすべての文字列の全体的な品質を考慮し、0.0(最低)から1.0(最高)の範囲の値を返します。 )
  
 
 
 
 
  
 
[[Qt#Qtリファレンス|Qtリファレンス]]へ戻る
 
[[Qt#Qtリファレンス|Qtリファレンス]]へ戻る

2021年3月2日 (火) 00:00時点における最新版



個人用ツール
名前空間

変種
操作
案内
ツールボックス