Skip to content

Commit b04531d

Browse files
committed
Removed some hacks unnecessary with Qt 5.5.1.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 1e1df1c commit b04531d

File tree

5 files changed

+81
-32
lines changed

5 files changed

+81
-32
lines changed

QtSharp/CompileInlinesPass.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ private bool CompileInlines()
6565
proBuilder.AppendFormat("QT += {0}\n",
6666
string.Join(" ",
6767
this.Driver.Options.Headers.Select(h => h.Substring("Qt".Length).ToLowerInvariant())));
68-
// HACK: work around https://bugreports.qt.io/browse/QTBUG-47569
69-
if (this.Driver.Options.InlinesLibraryName.StartsWith("QtWidgets")
70-
|| this.Driver.Options.InlinesLibraryName.StartsWith("QtDesigner")
71-
|| this.Driver.Options.InlinesLibraryName.StartsWith("QtUiTools"))
72-
{
73-
proBuilder.Append("DEFINES += QT_NO_ACCESSIBILITY\n");
74-
}
7568
proBuilder.Append("QMAKE_CXXFLAGS += -fkeep-inline-functions -std=c++0x\n");
7669
proBuilder.AppendFormat("TARGET = {0}\n", this.Driver.Options.InlinesLibraryName);
7770
proBuilder.Append("TEMPLATE = lib\n");

QtSharp/Documentation.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,7 @@ public void DocumentFunction(Function function)
190190
{
191191
var id = link[1].Split('-');
192192
var key = EscapeId(function.IsAmbiguous && node.Attribute("access").Value == "private" ? id[0] : link[1]);
193-
var containsKey = this.membersDocumentation[file].ContainsKey(key);
194-
if (!containsKey)
195-
{
196-
// HACK: work around https://bugreports.qt.io/browse/QTBUG-46153
197-
containsKey = this.membersDocumentation[file].ContainsKey(key += "x");
198-
}
199-
if (containsKey)
193+
if (this.membersDocumentation[file].ContainsKey(key))
200194
{
201195
var docs = this.membersDocumentation[file][key];
202196
var i = 0;
@@ -489,13 +483,7 @@ public void DocumentVariable(Declaration variable)
489483
if (this.membersDocumentation.ContainsKey(file))
490484
{
491485
var key = link[1];
492-
var containsKey = this.membersDocumentation[file].ContainsKey(key);
493-
if (!containsKey)
494-
{
495-
// HACK: work around https://bugreports.qt.io/browse/QTBUG-48126
496-
containsKey = this.membersDocumentation[file].ContainsKey(key += "x");
497-
}
498-
if (containsKey)
486+
if (this.membersDocumentation[file].ContainsKey(key))
499487
{
500488
var docs = this.membersDocumentation[file][key];
501489
// TODO: create links in the "See Also" section
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
namespace QtGui
2+
{
3+
/// <summary>
4+
/// <para>The QAccessibleActionInterface class implements support for invocable actions in the interface.</para>
5+
/// </summary>
6+
/// <remarks>
7+
/// <para>Accessible objects should implement the action interface if they support user interaction. Usually this interface is implemented by classes that also implement QAccessibleInterface.</para>
8+
/// <para>The supported actions should use the predefined actions offered in this class unless they do not fit a predefined action. In that case a custom action can be added.</para>
9+
/// <para>When subclassing QAccessibleActionInterface you need to provide a list of actionNames which is the primary means to discover the available actions. Action names are never localized. In order to present actions to the user there are two functions that need to return localized versions of the name and give a description of the action. For the predefined action names use QAccessibleActionInterface::localizedActionName() and QAccessibleActionInterface::localizedActionDescription() to return their localized counterparts.</para>
10+
/// <para>In general you should use one of the predefined action names, unless describing an action that does not fit these:</para>
11+
/// <para></para>
12+
/// <para>Action nameDescription</para>
13+
/// <para>toggleAction() toggles the item (checkbox, radio button, switch, ...)</para>
14+
/// <para>decreaseAction() decrease the value of the accessible (e.g. spinbox)</para>
15+
/// <para>increaseAction() increase the value of the accessible (e.g. spinbox)</para>
16+
/// <para>pressAction() press or click or activate the accessible (should correspont to clicking the object with the mouse)</para>
17+
/// <para>setFocusAction() set the focus to this accessible</para>
18+
/// <para>showMenuAction() show a context menu, corresponds to right-clicks</para>
19+
/// <para></para>
20+
/// <para>In order to invoke the action, doAction() is called with an action name.</para>
21+
/// <para>Most widgets will simply implement pressAction(). This is what happens when the widget is activated by being clicked, space pressed or similar.</para>
22+
/// <para>IAccessible2 Specification</para>
23+
/// </remarks>
24+
public unsafe partial interface IQAccessibleActionInterface
25+
{
26+
/// <summary>
27+
/// <para>Returns a localized action name of actionName.</para>
28+
/// <para>For custom actions this function has to be re-implemented. When using one of the default names, you can call this function in QAccessibleActionInterface to get the localized string.</para>
29+
/// <para>See also actionNames() and localizedActionDescription().</para>
30+
/// </summary>
31+
string LocalizedActionName(string actionName);
32+
33+
/// <summary>
34+
/// <para>Returns a localized action description of the action actionName.</para>
35+
/// <para>When using one of the default names, you can call this function in QAccessibleActionInterface to get the localized string.</para>
36+
/// <para>See also actionNames() and localizedActionName().</para>
37+
/// </summary>
38+
string LocalizedActionDescription(string actionName);
39+
40+
/// <summary>
41+
/// <para>Invokes the action specified by actionName. Note that actionName is the non-localized name as returned by actionNames() This function is usually implemented by calling the same functions that other user interaction, such as clicking the object, would trigger.</para>
42+
/// <para>See also actionNames().</para>
43+
/// </summary>
44+
void DoAction(string actionName);
45+
46+
/// <summary>
47+
/// <para>Returns a list of the keyboard shortcuts available for invoking the action named actionName.</para>
48+
/// <para>This is important to let users learn alternative ways of using the application by emphasizing the keyboard.</para>
49+
/// <para>See also actionNames().</para>
50+
/// </summary>
51+
QtCore.QStringList KeyBindingsForAction(string actionName);
52+
53+
global::System.IntPtr __Instance { get; }
54+
55+
/// <summary>
56+
/// <para>Returns the list of actions supported by this accessible object. The actions returned should be in preferred order, i.e. the action that the user most likely wants to trigger should be returned first, while the least likely action should be returned last.</para>
57+
/// <para>The list does only contain actions that can be invoked. It won't return disabled actions, or actions associated with disabled UI controls.</para>
58+
/// <para>The list can be empty.</para>
59+
/// <para>Note that this list is not localized. For a localized representation re-implement localizedActionName() and localizedActionDescription()</para>
60+
/// <para>See also doAction(), localizedActionName(), and localizedActionDescription().</para>
61+
/// </summary>
62+
QtCore.QStringList ActionNames { get; }
63+
}
64+
}

QtSharp/QtSharp.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.IO;
43
using System.Linq;
54
using System.Reflection;
@@ -150,11 +149,6 @@ public void Setup(Driver driver)
150149
{
151150
driver.Options.GeneratorKind = GeneratorKind.CSharp;
152151
var qtModule = "Qt" + this.module;
153-
// HACK: work around https://bugreports.qt.io/browse/QTBUG-47569
154-
if (this.module == "Widgets" || this.module == "Designer")
155-
{
156-
driver.Options.addDefines("QT_NO_ACCESSIBILITY");
157-
}
158152
driver.Options.MicrosoftMode = false;
159153
driver.Options.NoBuiltinIncludes = true;
160154
driver.Options.TargetTriple = this.target;
@@ -182,11 +176,17 @@ public void Setup(Driver driver)
182176
driver.Options.addLibraryDirs(this.libraryPath);
183177
driver.Options.Libraries.Add(this.library);
184178
string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
185-
if (this.module == "Core")
179+
switch (this.module)
186180
{
187-
driver.Options.CodeFiles.Add(Path.Combine(dir, "QObject.cs"));
188-
driver.Options.CodeFiles.Add(Path.Combine(dir, "QChar.cs"));
189-
driver.Options.CodeFiles.Add(Path.Combine(dir, "_iobuf.cs"));
181+
case "Core":
182+
driver.Options.CodeFiles.Add(Path.Combine(dir, "QObject.cs"));
183+
driver.Options.CodeFiles.Add(Path.Combine(dir, "QChar.cs"));
184+
driver.Options.CodeFiles.Add(Path.Combine(dir, "_iobuf.cs"));
185+
break;
186+
case "Gui":
187+
// HACK: work around https://github.com/mono/CppSharp/issues/582
188+
driver.Options.CodeFiles.Add(Path.Combine(dir, "IQAccessibleActionInterface.cs"));
189+
break;
190190
}
191191
var extension = Path.GetExtension(this.library);
192192
this.LibraryName = driver.Options.LibraryName + extension;

QtSharp/QtSharp.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
<Compile Include="GenerateEventEventsPass.cs" />
6969
<Compile Include="GenerateSignalEventsPass.cs" />
7070
<Compile Include="GetCommentsFromQtDocsPass.cs" />
71+
<None Include="IQAccessibleActionInterface.cs">
72+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
73+
</None>
7174
<Compile Include="Properties\AssemblyInfo.cs" />
7275
<Compile Include="ProcessHelper.cs" />
7376
<None Include="packages.config" />
@@ -86,6 +89,7 @@
8689
<Compile Include="QString.cs">
8790
<SubType>Code</SubType>
8891
</Compile>
92+
<Compile Include="QtModuleInfo.cs" />
8993
<Compile Include="QtSharp.cs" />
9094
</ItemGroup>
9195
<ItemGroup>

0 commit comments

Comments
 (0)