@@ -17,6 +17,14 @@ mod ffi {
1717 type SplitBehaviorFlags = crate :: SplitBehaviorFlags ;
1818 }
1919
20+ #[ cfg( cxxqt_qt_version_major = "6" ) ]
21+ unsafe extern "C++" {
22+ include ! ( "cxx-qt-lib/qtypes.h" ) ;
23+
24+ #[ cxx_name = "qsizetype" ]
25+ type QSizeType = crate :: QSizeType ;
26+ }
27+
2028 unsafe extern "C++" {
2129 include ! ( "cxx-qt-lib/qbytearray.h" ) ;
2230 type QByteArray = crate :: QByteArray ;
@@ -43,6 +51,23 @@ mod ffi {
4351 #[ rust_name = "ends_with" ]
4452 fn endsWith ( self : & QString , s : & QString , cs : CaseSensitivity ) -> bool ;
4553
54+ /// Returns the index position of the first occurrence of the string str in this string,
55+ /// searching forward from index position from. Returns -1 if str is not found.
56+ #[ cfg( cxxqt_qt_version_major = "5" ) ]
57+ #[ rust_name = "index_of" ]
58+ fn indexOf ( self : & QString , str : & QString , from : i32 , cs : CaseSensitivity ) -> i32 ;
59+
60+ /// Returns the index position of the first occurrence of the string str in this string,
61+ /// searching forward from index position from. Returns -1 if str is not found.
62+ #[ cfg( cxxqt_qt_version_major = "6" ) ]
63+ #[ rust_name = "index_of" ]
64+ fn indexOf (
65+ self : & QString ,
66+ str : & QString ,
67+ from : QSizeType ,
68+ cs : CaseSensitivity ,
69+ ) -> QSizeType ;
70+
4671 /// Returns true if the string has no characters; otherwise returns false.
4772 #[ rust_name = "is_empty" ]
4873 fn isEmpty ( self : & QString ) -> bool ;
@@ -124,14 +149,6 @@ mod ffi {
124149 #[ rust_name = "qstring_arg" ]
125150 fn qstringArg ( string : & QString , a : & QString ) -> QString ;
126151 #[ doc( hidden) ]
127- #[ rust_name = "qstring_index_of" ]
128- fn qstringIndexOf (
129- string : & QString ,
130- str : & QString ,
131- from : isize ,
132- cs : CaseSensitivity ,
133- ) -> isize ;
134- #[ doc( hidden) ]
135152 #[ rust_name = "qstring_insert" ]
136153 fn qstringInsert < ' a > ( string : & ' a mut QString , pos : isize , str : & QString )
137154 -> & ' a mut QString ;
@@ -302,12 +319,6 @@ impl QString {
302319 self . compare_i32 ( other, cs) . cmp ( & 0 )
303320 }
304321
305- /// Returns the index position of the first occurrence of the string str in this string,
306- /// searching forward from index position from. Returns -1 if str is not found.
307- pub fn index_of ( & self , str : & QString , from : isize , cs : ffi:: CaseSensitivity ) -> isize {
308- ffi:: qstring_index_of ( self , str, from, cs)
309- }
310-
311322 /// Inserts the string str at the given index position and returns a mutable reference to this string.
312323 pub fn insert < ' a > ( & ' a mut self , pos : isize , str : & Self ) -> & ' a mut Self {
313324 ffi:: qstring_insert ( self , pos, str)
0 commit comments