Scribus Forums

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

Title: Compiling scribus with qt creator
Post by: Gibbz on October 04, 2018, 02: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:

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, 08: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, 09: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, 11:40:50 AM
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, 02: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, 02: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, 10: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, 10: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, 06: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, 08: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, 11:19:09 AM
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, 02: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, 06: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, 10: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, 02: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, 04: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, 09: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, 09: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, 04: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, 06: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, 08: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, 10:21:41 AM
... eh eh... i've added in the documentation that one should click on the apply button...
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on January 21, 2019, 02:35:40 AM
Trying to get this running under the updated QT Creator....

Ive had to add the following to the scribus.pro file:
CONFIG += qt
QT += widgets

And i'm getting the error:
:-1: error: No rule to make target 'scribus/ui/test_xyz.ui', needed by 'ui_test_xyz.h'.  Stop.

Any idea how to fix this error?
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on January 21, 2019, 02:48:03 AM
Removed from the scribus.pro file got me past the error, the files no longer exist:

           scribus/ui/test_xyz.h \

         scribus/ui/test_xyz.ui \
         scribus/ui/test_xyzbase.ui \

           scribus/ui/test_xyz.cpp \

         scribus/ui/xyz.ui \
         scribus/ui/xyz2.ui \
         scribus/ui/xyz3.ui \
         scribus/ui/xyz4.ui \
         scribus/ui/xyz5.ui \
         scribus/ui/xyz_dw.ui \
         scribus/ui/xyz_vert.ui \
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on January 21, 2019, 03:01:00 AM
Argh, still broken, stuck with some colorwheel thing... Not sure whats going on then....
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on January 21, 2019, 08:31:08 AM
the qmake file has been used many years ago to bootstrap the qt creator project... i think...

nowadays, you should use the cmake workflow.
(no idea why the qmake file is in the repository, really...)

instructions for compiling scribus with qt creator are here (for linux and probably for mac os):

https://github.com/aoloe/scribus-manual-development/blob/master/content/qt-creator/qt-creator.md


as soon as i have the windows instructions ready, i will publish the three "development" document in a better form...
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on January 22, 2019, 08:32:54 AM
@gibbz, did you get it to work?
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on January 23, 2019, 06:01:25 AM
Looks like its building now!

1. I guess it helps to have cmake installed :)
2. Then in qtcreator I clicked open file or project > Cmake.txt

It might be a good idea to remove the qt creator files sometime. Its a little confusing :)
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on January 23, 2019, 03:04:27 PM
I've filled a ticket.

The reply is that the scribus.pro file is needed for updating the translation files.

We will see if something can be done...
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on January 23, 2019, 06:50:22 PM
out of curiosity: gibbz, what's your goal after you got scribus to compile?
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on January 24, 2019, 05:50:40 AM
Quote from: a.l.e on January 23, 2019, 06:50:22 PM
out of curiosity: gibbz, what's your goal after you got scribus to compile?

Look at fixing the annoyances that I deal with daily.
Do let me know if any of these have been fixed at all, or point me to the area of code where I can look into... Or if anyone can give me a hand to fix some of these up!

- Improve the snapping tool to snap to nearest object to the mouse
- fix the alternate selection modes (shift + alt + ctrl)
- improve resizing modes (shift + ctl + alt)
- improve the right click drag copy to show the object as the user drags
- line spacing to have an option for 1.0x a values a multiplier of the font size
- click and drag from a page to object off the page will not select it, and vice-versa
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on January 24, 2019, 09:04:23 AM
nice!

QuoteImprove the snapping tool to snap to nearest object to the mouse

can you say more about it?

what do you think about the idea of "removing" the current "snap to item" mode and replace it with an "on demand" snapping?

instead of turning the snapping on and off, one could press the shift key while dragging to temporarily turning the snapping on.

harder to discover, but in my workflow i prefer to rely on the guides for snapping.
the snapping to items tends to snap too much and i only notice that i could used it, while i'm already dragging an item...

i think i've already made a patch for that... but i'm not sure that i have submitted it...

Quoteimprove the right click drag copy to show the object as the user drags

as you might have read in the bug tracker, i would rather see this "feature" to be removed...
... i'm still looking for somebody explaining me, why this way of copying an item is useful...

in my eyes it is hard to discover, awkward to perform, and needs more clicks than the alternatives...

the only reason i can think of, is to perform the task with the mouse only. practical for a one handed person, but:

- there is not much you can do with scribus, without touching the keyboard.
- the strength of scribus seems to be in having one hand on the keyboard and one on the mouse.

if scribus should have something in that direction, i would like to have the drag+space for multiple copies like in inkscape. (i still prefer the ctrl-d + mouse or keyboard move... but i see why this feature is useful for other workflows / persons)

Quotefix the alternate selection modes (shift + alt + ctrl)

a greedy selection mode has been added recently (press the alt key).

what do you plan to fix?

Quoteimprove resizing modes (shift + ctl + alt)

in which "direction"?

Quoteline spacing to have an option for 1.0x a values a multiplier of the font size

i would not add a new mode for that.

on the one side, it might be possible to enhance the current "automatic linespacing" to have a 1.0 value. setting the value to 1.5 would give you a multiplier.

but, in my experience, for DTP, the automatic linespacing should be sparely used, the baseline and fixed linespacing being the preferred ones.
the automatic linespacing can be handy from time to time, but it's always a feature that "promotes" bad layouts.

i must admit that i have sometimes missed the 1 1/2 times setting, but the workaround is simple enough and the end result is then better...

mixed feelings here...


all this having being said: nice to see that you want to improve scribus!
Title: Re: Compiling scribus with qt creator
Post by: Gibbz on January 24, 2019, 11:20:01 PM
- Improve the snapping tool to snap to nearest object to the mouse
AFAIK shift is used to constrain the axis while moving an object. So using this to toggle snap wouldnt work that great. The way I would like it to work is that it will only snap to the closest object under the mouse cursor. So the user is basically mousing over what they want it to snap to by moving the cursor. Currently it snaps to any object on the page, even if its not visible. This method works excellent in corel draw, and meas there is no need to toggle snap on and off constantly.


- fix the alternate selection modes (shift + alt + ctrl)
shift select should invert selection, which it does when clicking a individual object. But not when holding shift + selecting a region


- improve resizing modes (shift + ctl + alt)
shift + resize drag - should scale around the centre of the object. For example: If a user selects say the left edge, with shift + resize this should increase the width equally on both sides.

shift to constrain doesnt always work correctly, seems to be overwritten by the snap, but it shouldnt be


- improve the right click drag copy to show the object as the user drags
Great, a duplicate shortcut would also work for this! I agree that would be a better solution


- line spacing to have an option for 1.0x a values a multiplier of the font size (or percentage as 100% default)
Automatic line spacing seems to never behave correctly with large fonts or small fonts.
I thought to add another option to the drop down maybe called 'proportionate' or 'scale' which would be a multiple of the font size.


- click and drag from a page to object off the page will not select it, and vice-versa
This seems to be working except on a new document without moving the canvas the user cannot select right to left or bottom to top with a selection box. Just seems to be a minor glitch :)
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on January 25, 2019, 09:11:06 AM
Hi gibbz

congratulations for your first patch!

i will stop here this discussion, since it does not match the title of this thread any more.

but i'd like to continue the discussion on some of the topics in separate threads.

i'll open a thread for the snapping.
Title: Re: Compiling scribus with qt creator
Post by: YtterX on March 10, 2024, 11:08:31 AM
Hi,

I was wondering if there was a more up-to-date guide on how to setup Scribus with QtCreator.
I'm on Linux and was trying to follow https://wiki.scribus.net/canvas/QtCreator_-_workflow_for_Scribus_and_Git_repository_under_Linux but I think QtCreator has changed too much since this was written for me to follow...

If there is a better guide available please let me know.
Title: Re: Compiling scribus with qt creator
Post by: a.l.e on March 10, 2024, 11:32:21 AM
a few years ago i've written:

https://github.com/aoloe/scribus-manual-development/blob/master/content/compiling-with-qt-creator-en.md

it should be mostly correct, but contributions / feedback are welcome!

only the linked list of dependencies is probably outdated.