Commit Graph

305 Commits (b41b1be3369cc58719c45bcab918c416d3641f6b)

Author SHA1 Message Date
Jos van den Oever b41b1be336 Add anonymous parameter placeholders to generated code
As of Rust 1.31, missing parameter placeholders in functions
give a compile error. This commit adds more of them.
2018-12-10 00:12:49 +01:00
Jos van den Oever 319991e77f Add anonymous parameter placeholders to generated code
As of Rust 1.31, missing parameter placeholders in functions
give a compile error. This commit adds them.
2018-12-09 23:45:46 +01:00
Owen Nelson 325ffc2a2c Add support for Rust 2018 edition projects.
Summary:
After enabling 2018 edition on my cargo project, the use statements
generated in the interface module no longer resolve.

Prefixing module paths with `crate::` brings things back into alignment.

Unsure if this is how you'd like to approach the issue, but I'm happy to revise the patch based on your feedback.

Test Plan:
STEPS TO REPRODUCE
1. create a new cargo project based on the template
2. update your toolchain to >= 1.31
3. add `edition = "2018"` to the package section of your Cargo.toml
4. run `cargo build`

OBSERVED RESULT

Build fails since generated code tries to import crate-local modules as if they are top level crates.

EXPECTED RESULT

Build completes successfully.

Reviewers: vandenoever

Differential Revision: https://phabricator.kde.org/D17447
2018-12-09 23:34:40 +01:00
Jos van den Oever 4acf7e3176 Resolve resource path relative to qrc path 2018-11-24 12:46:47 +01:00
Jos van den Oever f678d441e9 Fix building with MSVC
BUG:400716
2018-11-11 16:03:29 +01:00
Carl Schwan ec81047ac1
Use pattern matching instead of if and else that return true and false
Differential Revision: https://phabricator.kde.org/D16576
2018-11-01 10:30:05 +01:00
l10n daemon script b8ebcfae05 GIT_SILENT made messages (after extraction) 2018-10-30 03:48:18 +01:00
Jos van den Oever e6d220bc18 Increase version number and add ChangeLog 2018-10-29 22:41:14 +01:00
Jos van den Oever 037322f270 Cleanup code 2018-10-29 22:40:57 +01:00
Jos van den Oever 89c86642f8 Print the c++ library that cargo should link against
This is used when calling "cargo build" when no actual recompile is needed.

BUG: 400393
2018-10-28 22:05:20 +01:00
Jos van den Oever ed2de05492 Add a template that is built by Cargo 2018-10-27 21:18:54 +02:00
Jos van den Oever c1a0bd7bfb Top processes have no parent 2018-10-26 11:28:08 +02:00
Jos van den Oever aa7e6c7e3b Remove unneeded enum value 2018-10-26 09:04:50 +02:00
Jos van den Oever 385ae17bb7 Pass the emitter as mutable. It is pointless otherwise. 2018-10-26 00:32:02 +02:00
Jos van den Oever fa337c37b1 Adapt code to changes in generator 2018-10-25 22:24:04 +02:00
Jos van den Oever b603a2262b Only allow mutable objects to call back into C++
When an object calls into C++, that C++ code may again call into Rust.
The original call might have an immutable reference and the nested
call could receive a mutable reference. That is not allowed and
undefined behaviour. For this reason, calling into C++ is only allowed
from mutable objects.
2018-10-25 18:06:19 +02:00
Jos van den Oever a78f8c9b73 Fix description and increase version number 2018-10-10 00:31:45 +02:00
Jos van den Oever 67c9cf122e Add metadata to Cargo.toml 2018-10-10 00:22:56 +02:00
Jos van den Oever 4a38793882 Add documentation and tweak function name 2018-10-10 00:07:25 +02:00
Jos van den Oever 5d5745bac0 Merge branch 'master' of git://anongit.kde.org/rust-qt-binding-generator 2018-10-09 18:11:47 +02:00
Jos van den Oever 08876fd757 Take changes in .h and .cpp files into account during build 2018-10-09 18:11:37 +02:00
Jos van den Oever ea876ec81d Add functions for building Qt applications with Cargo 2018-10-09 00:05:56 +02:00
Jos van den Oever 59d0092e55 Build even when CMAKE_DL_LIBS is not defined 2018-10-09 00:05:29 +02:00
l10n daemon script 5568fb11d4 GIT_SILENT made messages (after extraction) 2018-10-06 03:52:15 +02:00
Jos van den Oever df91226979 Expose function for reading the configuration 2018-09-30 00:10:22 +02:00
Jos van den Oever fac04fd6d4 Remove unneeded annotations 2018-09-29 23:47:23 +02:00
Jos van den Oever ca8f870e5e Update generate file 2018-09-29 23:29:06 +02:00
Jos van den Oever 13d8d1cf1d Use AtomicPtr instead of Mutex 2018-09-29 23:28:24 +02:00
Jos van den Oever 49f67ffc61 Slightly update sysinfo
A full update to 0.6.0 is not possible easily because the fields are
shielded by getters.
So the summing of used CPU time is not possible without adding a separate
field for that.
2018-09-29 18:20:49 +02:00
Jos van den Oever fe9731819f Use the version number from Cargo.toml 2018-09-28 23:54:42 +02:00
Jos van den Oever 6ee8ca626d Add function to create bindings from runtime Config object 2018-09-28 23:38:44 +02:00
Jos van den Oever baaa8f230c Use full include path to Qt headers 2018-09-28 22:36:56 +02:00
Jos van den Oever cbf66a128c Fix draggin of scrollbar in SplitView 2018-09-28 21:48:15 +02:00
Jos van den Oever 83e5f01fe0 Specify the dependency differently to (try to) appease CMake 3.12 2018-09-28 19:28:59 +02:00
Jos van den Oever d7860d9031 Also check for module directory 2018-09-28 18:40:01 +02:00
Jos van den Oever 034e5526cf Add missing ? 2018-09-28 18:08:19 +02:00
Jos van den Oever b3e43ae1d2 Handle result of write! and writeln!
This is probably the patch with the largest amount of question marks added to code ever.
2018-09-28 18:05:10 +02:00
Jos van den Oever cb27f4c5ce Add missing dependency 2018-09-28 12:25:32 +02:00
Jos van den Oever d6e88b0ab6 Add missing file 2018-09-28 12:24:30 +02:00
Jos van den Oever d7e4f1362d Port rust_qt_binding_generator from C++ to Rust 2018-09-28 12:11:57 +02:00
Jos van den Oever 0294ed948b Add a link to a presentation 2018-09-25 21:49:20 +02:00
Jos van den Oever ad8dd32235 Add two more links to tutorials 2018-09-25 21:47:12 +02:00
Friedrich W. H. Kossebau d5029d7217 Use Q_SIGNALS/Q_EMIT instead of signals/emit in generated sources
Summary:
Avoid potential clashes on symbols/macros from other libraries
Allows to use the generated header in projects which have
DQT_NO_SIGNALS_SLOTS_KEYWORDS or DQT_NO_KEYWORDS set

Reviewers: vandenoever

Reviewed By: vandenoever

Differential Revision: https://phabricator.kde.org/D15545
2018-09-16 19:25:26 +02:00
Friedrich W. H. Kossebau c970b1c417 Remove unused QWidget dependecy from Todo example app
Reviewers: vandenoever

Reviewed By: vandenoever

Differential Revision: https://phabricator.kde.org/D15552
2018-09-16 19:18:25 +02:00
Friedrich W. H. Kossebau dff4e2a0d2 Use nullptr in generated C++ sources
Reviewers: vandenoever

Reviewed By: vandenoever

Differential Revision: https://phabricator.kde.org/D15553
2018-09-16 19:14:54 +02:00
Friedrich W. H. Kossebau 1ce86bd5d5 Add break; statements in the generated switch code for model::data()
Summary:
Compiler complains about generated code with
warning: this statement may fall through
and is slightly right, as the code might fall through if a role is used
which is not catched for a column.

Reviewers: vandenoever

Reviewed By: vandenoever

Differential Revision: https://phabricator.kde.org/D15541
2018-09-15 22:02:17 +02:00
Jos van den Oever 0192124c70 Fix some clippy issues in written and generated code 2018-09-11 23:29:06 +02:00
Jos van den Oever 9549c50217 Automatically update index when calling layoutChanged 2018-09-11 23:06:52 +02:00
Jos van den Oever f0eb78457b Make the model struct that emits model signals clonable 2018-09-08 23:13:20 +02:00
Jos van den Oever 96376517c6 Add bindings for layoutAboutToBeChanged and layoutChanged 2018-09-08 22:48:59 +02:00