Scribus Forums

Development => Code => Topic started by: Gibbz on October 04, 2018, 03:06:29 am

Title: Compiling scribus with qt creator
Post by: Gibbz on October 04, 2018, 03:06:29 am
Ok so im trying to build scribus so I can make some fixes.

I found this:
https://github.com/aoloe/scribus-manual-development/blob/master/content/getting-started/getting-started.md

So i have checked out the repo, open the project in qtcreator. When I try to build i get the error:

Code: [Select]
actionmanager.h:34: error: QActionGroup: No such file or directory
 #include <QActionGroup>

I cant seem to find any info on this online...
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 04, 2018, 09:16:28 am
I haven't checked it in a while...

If I recall it correctly, it should work...
I'm trying it out right now.

At first sight it looks more like a Qt misconfiguration rather than a Scribus issue... but I cannot be sure.

One question: what is your Operating System?

ciao
a.l.e
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 04, 2018, 10:43:59 am
Ok, I got it to compile but... it does not install correctly and the binary, then, cannot find the icons and shuts down...

- On the one side: what are you doing differntly? Are you on Linux? OS X? Windows?
- I will try to track what's the issue with the binary not being "make install"ed correctly
- I've added a section about Qt Creator: https://github.com/aoloe/scribus-manual-development/blob/master/content/qt-creator/qt-creator.md
  (for now, only a hint on how to get faster compiles by adding the -j4 flag for make)

(feel free to suggest edits and additions through pull requests, tickets, or comments in this thread...)
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 04, 2018, 12:40:50 pm
I've updated https://github.com/aoloe/scribus-manual-development/blob/master/content/qt-creator/qt-creator.md with the instruction that got me a running Scribus compiled through Qt Creator:

- Building with -j4 to speed up the process.
- Corretly installed in a custom path (avoid /usr/local, as your parents always told you...).

Gibbz, if you need further help, you might come to the Scribus irc channel... (#scribus in freenode)
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 05, 2018, 03:05:42 am
Cool, adding the repo via qtcreator worked.
I had to use https://github.com/scribusproject/scribus.git instead as git one in the tutorial didnt have permission.

Im using manjaro linux (arch based)

Edit:
No icons found :(
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 05, 2018, 03:45:04 am
I have made it so it will load without icons.
However the scripter menu entry is not showing in my custom build.

What ide do the team usually use?
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 05, 2018, 11:08:57 am
I've modified the tutorial to first mention the https link and then -- for those who have setup the ssh workflow -- the ssh one. thanks for the feedback.

Now, concerning the icons: you have to install scribus before running it:

https://github.com/aoloe/scribus-manual-development/blob/master/content/qt-creator/qt-creator.md#running-your-own-build-of-scribus

explains you how to do it (it took me some time to find all steps but, now, it should be correct!).

After having gone through those two steps, Scribus will find its icons and correctly run (I've tested it!)


Finally, about the IDE:

- personally, i don't use any (but that was not the question, since i'm not in the team; and i would probably use Qt Creator if i needed to use one...).
- Jean uses visual studio on windows
- Craig probably uses QT Creator (i don't think he is using X Code, even if he works on a mac)
- No idea about the others.
- as far as i know, most people compile from the command line or use Qt Creator on Linux.

May I ask you what are your plans with Scribus? : - )
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 05, 2018, 11:09:46 am
Concerning the Scripter entry: you probably need to install libpython-dev ...
(or it might be a python2 / python3 issue...)
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 11, 2018, 07:16:29 am
Yeah sure, I am trialing using scribus at work to replace coreldraw. So mostly advertising materials, newsletters and basic graphics.

Ive posted a bug, and now made a patch file (https://bugs.scribus.net/view.php?id=15441) what is the process of getting these changes included? As Im very keen to start using this fix :)

Also have some other bugs I want to look into from a usability standpoint before I can encourage the transition at work...
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 11, 2018, 09:14:58 am
hi gibbz,

i only skimmed through the patch... it looks mostly good!

there is only one detail:

- there are some tabs/spaces mismatch ("sadly" scribus uses hard tabs, not 4 spaces)

when working on the scribus you will have to configurate the project to use hard tabs...

and, of course, patches are always welcome!

ciao
a.l.e
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 11, 2018, 12:19:09 pm
ah thanks! I thought qt creator defaulted to tabs!

Is that ok for those 2 patches ive done to be cleaned up manually by whoever import them?
Ive changed the setting so shouldnt be a problem in the future!
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 11, 2018, 03:31:31 pm
i've converted the spaces to tabs in a new patch.

since you're using git, for the future, you could try to learn about branches and making patches by using git diff among branches ...

a big advantage of this method is that you then have multiple versions of scribus installed (i have two), one with the master that you use for work and one with the patch you're currently working on and the other with the master for real work.

depending on how important a patch is for your current work, you can apply it to your master, but you will then have probably have merging issues when the patch is accepted upstream.

if you don't know much about how to work with git branches and want me to further explain how i do work with, just ask : - )

ciao
a.l.e
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 13, 2018, 07:25:03 am
I cant get the debug build working in qt creator.
Do you have a guide on configuring the options to get the debug mode working?

I get the following error:

This does not seem to be a "Debug" build.
Setting breakpoints by file name and line number may fail.

Section .debug_info: Not found.
Section .debug_abbrev: Not found.
Section .debug_line: Not found.
Section .debug_str: Not found.
Section .debug_loc: Not found.
Section .debug_range: Not found.
Section .gdb_index: Not found.
Section .note.gnu.build-id: Found.
Section .gnu.hash: Found.
Section .gnu_debuglink: Not found.
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 14, 2018, 11:14:00 am
i get the same message...

i have to dig into this.
(normally, i only use the "designer" part of qt creator... and not even that often...)
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 23, 2018, 03:26:31 am
Cool thanks! Let me know what you find.
I'd like to work on a few more patches, but I need the debugger for the one as its a bit more complicated.....
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 24, 2018, 05:17:22 pm
found: you have to set WANT_DEBUG=1 in the "Debug" build configuration...

more information in here:

https://github.com/aoloe/scribus-manual-development/blob/master/content/qt-creator/qt-creator.md#debugging
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 29, 2018, 10:38:05 am
How are you adding the setting in QT?
Is it a boolean or a string?
If I add an entry using the add button it doesnt appear in the CMAKE section.
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 29, 2018, 10:45:15 am
i did not manage to get it to appear in the CMAKE sesion. i have no idea if prefixing with CMAKE_ will work...

but, yes, just adding as you did worked for me.
but i had to delete the current build directory and let qt creator create a new one.

i would be interested in knowing if it works for you and if it does, then we can improve the wording of the explanation : - )
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 30, 2018, 05:08:56 am
Hrmm, I cant get the setting to stick in there in qt.

Under debug build I click > Add > String > Edit the <UNSET> fields WANT_DEBUG and 1
Click file > save all

Close qt creator, reopen and my setting is no applied. If i try and build without restarting, I get the not a debug build error.

Can you check if this setting is being written to a file somewhere? If i can change that file, I may be able to work around the issue.
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 30, 2018, 07:50:04 am
eh eh... if i understand you correct,y that's one of the weak points of that dialog: i also needed many tries and help on irc to understand it:

(https://github.com/aoloe/scribus-manual-development/raw/master/content/qt-creator/images/qt-creator-cmake-install-prefix.png)

you have to click on the "apply" button below the list...
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on October 30, 2018, 09:32:13 am
awesome! Thats the button! Who would have thought the apply button was there! :)

Thanks for the help! Its all working now!
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on October 30, 2018, 11:21:41 am
... eh eh... i've added in the documentation that one should click on the apply button...