8,182 questions
Advice
0
votes
6
replies
61
views
Can the Mac file-picker filter by the whole file name?
I know you can set the Info.plist to match files by extension, MIME type, or UTI. Is there a way to add custom matching, like adding a filter function that looks at the entire name?
13
votes
4
answers
1k
views
Why doesn't C++ allow virtual function overrides to be constrained by a concept/requires clause?
I tried to write the following code and it was rejected by the compiler:
#include <type_traits>
struct Base {
virtual void f() {}
};
template <typename T>
struct Derived : Base {
...
Advice
3
votes
7
replies
219
views
C# calling new methods instead of overriding methods
As this problem never gets stated as an article anywhere else, I wanted to state it here.
C# when calling a method of a derived object, it will not see the derived methods instantly. It will firstly ...
0
votes
2
answers
55
views
In CMake, how can I check whether an option was set explicitly?
CMake options get their default value, or they are set explicitly (mostly via the command-line).
Now, in my CMakeLists.txt, I can get the current value of an option; but - I want to know if the option ...
1
vote
0
answers
41
views
fmx override DoChange procedure (not working) to preserve the inherited code (eg: TEdit)
I want to implement a custom Tedit box and override the OnChange handler (rather than set the OnChange property). I want to do it that way so I can preserve the inherited OnChange code
I found this ...
Best practices
1
vote
4
replies
129
views
In Java, should I use `@Override` for record fields?
If my record implements an interface, with a field accessor implicitly implementing a method, it should be an instance of what the @Override annotation is meant to cover.
interface I { int f(); }
...
Advice
0
votes
9
replies
140
views
Why the inherited method output parent's data?
Explain please why the output is "Base" ? Isn't getClassName method inherited?
class Base {
public String className = "Base";
public String getClassName() {
...
0
votes
0
answers
53
views
Linter Errors When Overriding Container's orientation Methods in Python GTK4
Problem Statement
I'm subclassing Gtk4 container widgets so I can add functionality to various property changes. For this question I'll use set_orientation from Gtk.Box and the Gtk.Orientable ...
0
votes
2
answers
201
views
C# : overriding listview view property
I'm trying to override the View property in a derived class from Listview:
public class CustListview : System.Windows.Forms.ListView
{
private CustView mView = new CustView();
public enum ...
1
vote
2
answers
177
views
Why does overriding a method with different async behavior cause subtle bugs in Python's inheritance?
I recently ran into something weird while working with inheritance in Python. I had a base class method that was synchronous, but in the subclass, I accidentally overrode it as an async method (...
-1
votes
1
answer
112
views
Why doesn’t method overriding in Python affect the base class instance?
I'm a bit confused about how method overriding works in Python.
Let's say I have a base class with a method, and I override that method in a subclass. When I call the method from the subclass, the ...
1
vote
0
answers
49
views
XmlSchemaSet fails to add xsd file with xs:override element
The example.xsd file contains this fragment:
<xs:override schemaLocation="../base/definitions.xsd">
<xs:simpleType name="MessageTypeEnum">
<xs:annotation&...
3
votes
0
answers
102
views
How to override a varargs java method in a scala class which is still callable in both scala and java variadically?
Assume there is a base class in a Java library which cannot be modified
public class BaseClass {
public Something function(int... args){ ... }
}
Typically, this would be overridden in Scala by ...
0
votes
3
answers
117
views
Overloading inherited method for indirect usage [duplicate]
I am trying to overload a method from a base class in an inherited class, which is used indirectly through another method in the base class. I have tried a bunch of combinations of using, override and ...
1
vote
0
answers
53
views
Overloading Powerbuilder Native functions, optional parameters
We've been plagued for years by the GetFileOpenName and GetFileSaveName functions that open Windows dialog boxes. When the user closes them, the application's current directory has changed. Afterward, ...