Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt 5.14 errors #31

Open
docelic opened this issue May 27, 2020 · 12 comments
Open

Qt 5.14 errors #31

docelic opened this issue May 27, 2020 · 12 comments

Comments

@docelic
Copy link
Collaborator

docelic commented May 27, 2020

Initial output of trying to build for Qt 5.14:

=> Generating bindings for all platforms
(1/1) Generating linux-gnu-x86_64-qt5.14
Invalid alias name "QAbstractSpinBox::StepType" at Qt::Binding::QAbstractSpinBox::StepType
Invalid alias name "Qt::HighDpiScaleFactorRoundingPolicy" at Qt::Binding::Qt::HighDpiScaleFactorRoundingPolicy
Invalid alias name "QTextDocument::MarkdownFeatures" at Qt::Binding::QTextDocument::MarkdownFeatures
Invalid alias name "QGradient::Preset" at Qt::Binding::QGradient::Preset
Invalid alias name "QTextBlockFormat::MarkerType" at Qt::Binding::QTextBlockFormat::MarkerType
Result type QAbstractSpinBox::StepType is unreachable at Qt::Binding#stepType()
Argument 2 has unreachable type QAbstractSpinBox::StepType at Qt::Binding#setStepType(stepType)
Result type QAbstractSpinBox::StepType is unreachable at Qt::Binding#stepType()
Argument 2 has unreachable type QAbstractSpinBox::StepType at Qt::Binding#setStepType(stepType)
Argument 1 has unreachable type Qt::HighDpiScaleFactorRoundingPolicy at Qt::Binding.setHighDpiScaleFactorRoundingPolicy(policy)
Result type Qt::HighDpiScaleFactorRoundingPolicy is unreachable at Qt::Binding.highDpiScaleFactorRoundingPolicy()
Argument 2 has unreachable type QTextDocument::MarkdownFeatures at Qt::Binding#toMarkdown(features)
Argument 2 has unreachable type QTextDocument::MarkdownFeatures at Qt::Binding#toMarkdown(features)
Argument 3 has unreachable type QTextDocument::MarkdownFeatures at Qt::Binding#setMarkdown(markdown, features)
Argument 6 has unreachable type QGradient::Preset at Qt::Binding#fillRect(x, y, w, h, preset)
Argument 3 has unreachable type QGradient::Preset at Qt::Binding#fillRect(r, preset)
Argument 3 has unreachable type QGradient::Preset at Qt::Binding#fillRect(r, preset)
Argument 2 has unreachable type QTextBlockFormat::MarkerType at Qt::Binding#setMarker(marker)
Result type QTextBlockFormat::MarkerType is unreachable at Qt::Binding#marker()
Result type Binding::QAbstractSpinBox::StepType is unreachable at Qt::SpinBox#stepType()
Argument 1 has unreachable type Binding::QAbstractSpinBox::StepType at Qt::SpinBox#setStepType(stepType)
Result type Binding::QAbstractSpinBox::StepType is unreachable at Qt::DoubleSpinBox#stepType()
Argument 1 has unreachable type Binding::QAbstractSpinBox::StepType at Qt::DoubleSpinBox#setStepType(stepType)
Argument 1 has unreachable type Binding::Qt::HighDpiScaleFactorRoundingPolicy at Qt::GuiApplication.setHighDpiScaleFactorRoundingPolicy(policy)
Result type Binding::Qt::HighDpiScaleFactorRoundingPolicy is unreachable at Qt::GuiApplication.highDpiScaleFactorRoundingPolicy()
Argument 1 has unreachable type Binding::QTextDocument::MarkdownFeatures at Qt::TextEdit#toMarkdown(features)
Argument 1 has unreachable type Binding::QTextDocument::MarkdownFeatures at Qt::TextDocument#toMarkdown(features)
Argument 2 has unreachable type Binding::QTextDocument::MarkdownFeatures at Qt::TextDocument#setMarkdown(markdown, features)
Argument 5 has unreachable type Binding::QGradient::Preset at Qt::Painter#fillRect(x, y, w, h, preset)
Argument 2 has unreachable type Binding::QGradient::Preset at Qt::Painter#fillRect(r, preset)
Argument 2 has unreachable type Binding::QGradient::Preset at Qt::Painter#fillRect(r, preset)
Argument 1 has unreachable type Binding::QTextBlockFormat::MarkerType at Qt::TextBlockFormat#setMarker(marker)
Result type Binding::QTextBlockFormat::MarkerType is unreachable at Qt::TextBlockFormat#marker()
Found 33 errors. Aborting.
Failed to build linux-gnu-x86_64-qt5.14 using Qt5.14 on x86_64-unknown-linux-gnu - Abort.

@ZaWertun
Copy link
Contributor

To fix this you has to modify config/enums.yml, like in this commit that fixes build for Qt-5.13:
ZaWertun@87b1471.
See that I've added mappings for QGradient::Preset and QAbstractSpinBox::StepType.

@ZaWertun
Copy link
Contributor

I'll try to fix this and make PR.

@docelic
Copy link
Collaborator Author

docelic commented May 27, 2020

Hey, sure, just listed it here due to a question in #20. I already added some, but will wait for your PR then not to duplicate effort. Thanks!

@docelic
Copy link
Collaborator Author

docelic commented May 27, 2020

@ZaWertun speaking of which, are you aware of a way to add entries depending on version? From what I see here, once we add e.g. new enum entries, older versions no longer build, erroring out with:

Enum doesn't have any constants at <enum name>

@ZaWertun
Copy link
Contributor

@ZaWertun speaking of which, are you aware of a way to add entries depending on version? From what I see here, once we add e.g. new enum entries, older versions no longer build, erroring out with:

Enum doesn't have any constants at <enum name>

Didn't think about it. I think we need some enum mappings defined only in Qt >= 5.13 for example.
Could it be done in current bindgen version?

@ZaWertun
Copy link
Contributor

@ZaWertun speaking of which, are you aware of a way to add entries depending on version? From what I see here, once we add e.g. new enum entries, older versions no longer build, erroring out with:

Enum doesn't have any constants at <enum name>

Or maybe that check is wrong...

@docelic
Copy link
Collaborator Author

docelic commented May 27, 2020

I think we need some enum mappings defined only in Qt >= 5.13 for example.
Could it be done in current bindgen version?

I did a quick search and didn't find an example of it. It seems that if_* can only compare against strings and regexes.
I also wonder how Stefan was able to generate bindings for those 4 or 5 Qt versions without needing this feature.

@ZaWertun
Copy link
Contributor

ZaWertun commented May 27, 2020

I think we need some enum mappings defined only in Qt >= 5.13 for example.
Could it be done in current bindgen version?

I did a quick search and didn't find an example of it. It seems that if_* can only compare against strings and regexes.
I also wonder how Stefan was able to generate bindings for those 4 or 5 Qt versions without needing this feature.

Maybe we need something like this conditions syntax in YML files for bindgen:

  • version_gte - version >= given (string param must be parsed with Bindgen::FindPath::GenericVersion);
  • version_lte - version <= given;
    Maybe same for version_gt (>) + version_lt (<).

@Papierkorb
Copy link
Owner

@ZaWertun Yeah that would be the ideal addition. The syntax I chose is X_(is|isnt|match)_Y to be as readable as possible (Without the reader scouring some docs on that syntax). Maybe there's a syntax possible in that vein like X_olderthan_Y.
Why it's not there yet? I guess I didn't need it, can't remember really.

@ZaWertun
Copy link
Contributor

@ZaWertun Yeah that would be the ideal addition. The syntax I chose is X_(is|isnt|match)_Y to be as readable as possible (Without the reader scouring some docs on that syntax). Maybe there's a syntax possible in that vein like X_olderthan_Y.
Why it's not there yet? I guess I didn't need it, can't remember really.

Maybe just call it newer / older? (newer_or_equals / older_or_equals)

@docelic
Copy link
Collaborator Author

docelic commented May 28, 2020

Hey how about we just rename newer and older to newer_or and older_or before this gets used in practice?
This small rename could better capture the inclusion of equal (">="/"<="), and also it would not clash with possible future addition of real newer/older which does not imply the "=".

@ZaWertun
Copy link
Contributor

Hey how about we just rename newer and older to newer_or and older_or before this gets used in practice?
This small rename could better capture the inclusion of equal (">="/"<="), and also it would not clash with possible future addition of real newer/older which does not imply the "=".

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants