Re: [Qt-creator] Poll: Contents / styling of editor toolbars

2023-04-04 Thread Jaroslaw Kobus via Qt-creator
> > 1. I never use what occupies the most of the toolbar, i.e. the
> > combobox in the middle, containing the tree of namespaces / classes /
> > methods.
> 
> I never use them either, actually. The only thing that I occasionally
> looks at it the 'column' information.
> 
> > Maybe this functionality could be merged into "class view" on
> > the left side, showing the content of the current editor (instead of
> > showing everything from the current project, like it's now - probably
> > it could be configurable).
> 
> One could think of making "any" action from Environment->Keyboard
> "pinnable" to the toolbar. But would /you/ actually /use/ it,
> instead of triggering it by the keyboard shortcut?

The thing is that I don't have a good memory when it comes to shortcuts, 
especially
when I don't trigger them a couple of times a day. For most often actions I 
remember just
couple of shortcuts.

The issue with shortcuts is sometimes that I don't know how to trigger them, 
even when I see it.
E.g. I would love to use a shortcut for "Tools | Git | Current File | Diff", 
for which the shortcut is:
"Alt+G, Alt+D". This means you need to press (exactly in this order), without 
releasing any key
in meantime: Alt key, G key, D key. Then you may release all 3 keys. Very 
cumbersome. If you
do it like: Alt key, D key (and you are about to press the 3rd G key), a 
"Debug" menu is being
open instead (since the Alt D accelerator).
-- 
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Poll: Contents / styling of editor toolbars

2023-04-04 Thread Jaroslaw Kobus via Qt-creator
> > 3. I would replace the current weird icon for "Remove Split" in the
> > top right corner with the "X" icon. Not sure what to do with the "X"
> > icon next to the filename combobox, though. But it should be rather
> > clear that "X" next to the filename means we close the filename (in
> > all splits), with "X" in the top right corned means we close the
> > window (i.e. close the split).
> 
> "How" make this clear?
> 
> Ok, I am using FakeVim, I personally really /never/ look up there,
> it's all vsp/sp/Ctrl-W  for me, so I don't really know
> what an icon with a "good" visual hint looks like. Is  [x] a good
> enough hint for "get rid of $thing, whatever $thing is" ?

I just wanted to make a note that nearly always a window / dock / something 
"closable"
has a "X" button in the top right corner and it's intuitive that this "X" 
closes it.
Having a different icon for this action introduces an unneded delay in 
ergonomics I guess.

From: A. Pönitz 
Sent: Tuesday, April 4, 2023 7:53 PM
To: Jaroslaw Kobus
Cc: qt-creator@qt-project.org; Friedemann Kleint
Subject: Re: [Qt-creator] Poll: Contents / styling of editor toolbars

On Tue, Apr 04, 2023 at 05:34:30PM +, Jaroslaw Kobus via Qt-creator
wrote:
> 1. I never use what occupies the most of the toolbar, i.e. the
> combobox in the middle, containing the tree of namespaces / classes /
> methods.

I never use them either, actually. The only thing that I occasionally
looks at it the 'column' information.

> Maybe this functionality could be merged into "class view" on
> the left side, showing the content of the current editor (instead of
> showing everything from the current project, like it's now - probably
> it could be configurable).

One could think of making "any" action from Environment->Keyboard
"pinnable" to the toolbar. But would /you/ actually /use/ it,
instead of triggering it by the keyboard shortcut?

> 2. I never use encoding combo, which also occupies some place, so I'd
> hide it deeper (maybe inside file menu?)

Ok...

> 3. I would replace the current weird icon for "Remove Split" in the
> top right corner with the "X" icon. Not sure what to do with the "X"
> icon next to the filename combobox, though. But it should be rather
> clear that "X" next to the filename means we close the filename (in
> all splits), with "X" in the top right corned means we close the
> window (i.e. close the split).

"How" make this clear?

Ok, I am using FakeVim, I personally really /never/ look up there,
it's all vsp/sp/Ctrl-W  for me, so I don't really know
what an icon with a "good" visual hint looks like. Is  [x] a good
enough hint for "get rid of $thing, whatever $thing is" ?

> 4. I would add much more actions for text editing, like "to lower /
> upper", "visualize spaces", etc..., which are currently deeply hidden
> in menu structure or in settings. Make it configurable?

This is close to the first request, right?

Andre'
-- 
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Poll: Contents / styling of editor toolbars

2023-04-04 Thread Jaroslaw Kobus via Qt-creator
1. I never use what occupies the most of the toolbar, i.e. the combobox in the 
middle, containing the tree of namespaces / classes / methods. Maybe this 
functionality could be merged into "class view" on the left side, showing the 
content of the current editor (instead of showing everything from the current 
project, like it's now - probably it could be configurable).

2. I never use encoding combo, which also occupies some place, so I'd hide it 
deeper (maybe inside file menu?)

3. I would replace the current weird icon for "Remove Split" in the top right 
corner with the "X" icon. Not sure what to do with the "X" icon next to the 
filename combobox, though. But it should be rather clear that "X" next to the 
filename means we close the filename (in all splits), with "X" in the top right 
corned means we close the window (i.e. close the split).

4. I would add much more actions for text editing, like "to lower / upper", 
"visualize spaces", etc..., which are currently deeply hidden in menu structure 
or in settings. Make it configurable?


From: Qt-creator  on behalf of Friedemann 
Kleint via Qt-creator 
Sent: Tuesday, April 4, 2023 7:05 PM
To: qt-creator@qt-project.org
Subject: Re: [Qt-creator] Poll: Contents / styling of editor toolbars

Hi,

files in tabs, please...

Regards, Friedemann

--
Friedemann Kleint
The Qt Company GmbH

--
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator
-- 
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Utils::QtcProcess

2023-02-14 Thread Jaroslaw Kobus via Qt-creator
>> 2. When using QtcProcess it is also safe to destruct it while underlaying
>> QProcess is still being run. QtcProcess takes care about safe termination
>> through Utils::ProcessReaper in the background.
>
> What does this do other than terminating the process? How is this more safe?
> Can/should this be upstreamed to QtCore if it's such a general important
> improvement?

When you destruct running QProcess, it:
1. Prints a warning
2. Calls kill()
3. Calls blocking waitForFinished() - this may possibly block your UI thread 
for longer time.

When you destruct running QtcProcess, it:
1. Doesn't print a warining
2. Moves a running process into another thread (ProcessReaper's thread)
3. Calls terminate (a gentle way of stopping the process)
4. After desired time (500ms by default), when process didn't finish, it calls 
kill()
5. The destructor of QtcProcess doesn't block at all.
6. When the ProcessReaper is being destructed (when leaving main() function) it 
waits until all processes being reaped are finished inside a ProcessReaper.

Not sure if the above solution may be easily adopted by QProcess, as the latter 
is designed to work also without an event loop, while the current 
implementation of ProcessReaper relies on having spinning event loop. However, 
maybe it can be easily bypassed somehow. Feel free to open a ticket for 
QProcess feature, if you find it useful.

Jarek
-- 
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Utils::QtcProcess

2023-01-25 Thread Jaroslaw Kobus via Qt-creator
Hi,

QtcProcess is a wrapper around QProcess. It has some advantages over the 
QProcess:

1. On linux, when starting a new QProcess, the whole callee's application is 
being forked.
The bigger the application is, the longer the fork takes place. And QtCreator 
is a really huge.
So, QtcProcess comes with a solution: all the processes are being started not 
directly by QtCreator,
but with helper application called qtcreator_processlauncher. All start 
requests of all QtcProcesses
are redirected to that application. Since qtcreator_processlauncher is much 
smaller that QtCreator,
processes start faster. You may turn off this by behaviour by launching Creator 
with QTC_USE_QPROCESS=true
variable set - in this case the process launcher won't be used, but QProcess 
directly.
You may also hardcode the underlaying implementation for your particular 
instance of QtcProcess
by calling QtcProcess::setProcessImpl(ProcessImpl::QProcess).

2. When using QtcProcess it is also safe to destruct it while underlaying 
QProcess is still being run.
QtcProcess takes care about safe termination through Utils::ProcessReaper in 
the background.

3. There are much more advantages over bare QProcess, e.g. it enables running 
applications
on remote devices transparently. All you need to do is to specify the remote 
FilePath to your
executable inside QtcProcess::setCommandLine() and that's all.

I hope this helps

Regards

Jarek


From: Qt-creator  on behalf of Knut Petter 
Svendsen via Qt-creator 
Sent: Wednesday, January 25, 2023 4:22 PM
To: Qt-creator@qt-project.org
Subject: [Qt-creator] Utils::QtcProcess

What's the idea with Utils::QtcProcess? Why does QtCreator use QtcProcess
over simply using QProcess?

Also, when trying to debug a ClearCasePlugin which I haven't tested since
QtC 4.xx I'm having a hard time actually finding out where the command is
actually executed. I'm having problems with stepping in the code to find
out why the plugin is failing in my environment.

In my own plugin I use QProcess and it works - is there any reason I
should start using the more complicated QtcProcess (which I'm having
problems with in ClearCasePlugin...)

Knut

___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator
-- 
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Getting results from network in LocatorFilter

2021-03-09 Thread Jaroslaw Kobus
Hi Mikhail,

1. The results of your processing should be returned in matchesFor() function, 
as a return value. Please note, that this function is invoked in non-main 
thread.
2. Right, you should create network manager and requests for it in the same 
thread, as well as reading from replies should be done in the same thread. 
There is also a helpful virtual method of ILocatorFilter: prepareSearch(), 
which is invoked in the main thread, and it's being guaranteed that it will 
always precede a call to matchesFor() in other thread (matchesFor() will be 
called after prepareSearch() has finished). I think that something similar to 
your case is done inside WorkspaceLocatorFilter. The prepareSearch() could 
start the QNetworkRequest and connect to its QNetworkReply::finished signal, 
when the signal comes we collect the result and mark the flag, meaning we have 
received the reply. This would be main thread. And matchesFor() could just 
check if the flag was set - in this case we return the result collected in main 
thread, otherwise we wait for it with additional event loop.

Jarek


From: Qt-creator  on behalf of Mikhail 
Bryukhovets 
Sent: Sunday, March 7, 2021 11:16 AM
To: qt-creator@qt-project.org
Subject: [Qt-creator] Getting results from network in LocatorFilter

Hello!

I am trying to add suggestions functionality to my QtCerator plugin: When user 
types search request in the locator there will be a displayed list of suggested 
search queries based on entered text. Similar as it is done in browsers or 
search engines. Suggestions are obtained from network as results of GET 
requests to remote server. For example:
QNetworkRequest request;
request.setUrl(QUrl::fromUserInput("https://example.com/user_input?action=suggest;));
auto reply = network_manager_.get(request);
QObject::connect(reply, ::readyRead, [&](){
qDebug() << "reply:" << reply->readAll();
});

So as I understand it I should make a network request inside matchesFor() 
function of my class derived from Core::ILocatorFilter.
The first issue is: How and where do I obtain a result of a request to return 
it to the user?
The second is: It seems that QNetworkAccessManager can't process 
QNetworkRequest created in another thread (QObject: Cannot create children for 
a parent that is in a different thread.
(Parent is QNetworkAccessManager(0x163c4d0), parent's thread is 
QThread(0x6cc0d0), current thread is QThread(0x28b5810))
I didn't find similar cases in plugins provided with QtCreator so I hope 
someone can point me in the right direction.

Mikhail.
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Jumpy find occurrences?

2019-01-31 Thread Jaroslaw Kobus
This is probably related to QTCREATORBUG-21388.

Regards

Jarek


From: Qt-creator  on behalf of Nikos 
Chantziaras 
Sent: Monday, January 28, 2019 7:46:53 PM
To: qt-creator@qt-project.org
Subject: Re: [Qt-creator] Jumpy find occurrences?

On 28/01/2019 20:10, Jason H wrote:
> Has anyone else noticed that after doing a find, and scrolling that *some* of 
> the green find locations in the scroll bar move up or down by a *few* pixels 
> while scrolling?

Yep. It's not just find. It happens with all scrollbar marks, like
warning and error locations.

___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator
___
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator


Re: [Qt-creator] Show unsaved changes?

2018-04-26 Thread Jaroslaw Kobus
Ctrl+H - show unsaved changes for the current file

Ctrl+Shift+H - show unsaved changes for all opened files


>From menu: Tools | Diff | ...


Regards


Jarek


From: Qt-creator  on 
behalf of Jason H 
Sent: Thursday, April 26, 2018 5:04:21 PM
To: Jason H
Cc: qt-creatorqt-project.org
Subject: Re: [Qt-creator] Show unsaved changes?

> Sent: Thursday, April 26, 2018 at 10:35 AM
> From: "Jason H" 
> To: "qt-creatorqt-project.org" 
> Subject: [Qt-creator] Show unsaved changes?
>
> Is there a way to show unsaved changes to a file in QtC? Currently, I have to 
> use undo/redo for figure out what I changed.


I found that if I close a file without saving, it'll show me, but I can't do it 
at will?
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] 回复: How to add custom property type to the designer?

2018-04-03 Thread Jaroslaw Kobus
No, uic is not extensible.


From: Jarvis <390246...@qq.com>
Sent: Tuesday, April 3, 2018 10:34:33 AM
To: Jaroslaw Kobus
Subject: 回复: [Qt-creator] How to add custom property type to the designer?

OK,thanks. QT is there an example of uic extension(plugin)?

-- 原始邮件 --
发件人: "Jaroslaw Kobus"<jaroslaw.ko...@qt.io>;
发送时间: 2018年4月3日(星期二) 下午4:28
收件人: "Jarvis"<390246...@qq.com>;"qt-creator"<qt-creator@qt-project.org>;
主题: Re: [Qt-creator] How to add custom property type to the designer?


Yes, QDesigner supports only types it knows. However, the list of known types 
is quite large.


Taking into account that uic needs to convert an xml based property values into 
the C++ code, it wouldn't be easily possible without any plugin architecture / 
extension system of uic.


From: Qt-creator <qt-creator-bounces+jaroslaw.kobus=qt...@qt-project.org> on 
behalf of Jarvis <390246...@qq.com>
Sent: Friday, March 23, 2018 12:41:37 PM
To: qt-creator
Subject: [Qt-creator] How to add custom property type to the designer?

Hello,I want to add custom property type to the designer.

I'm trying to do that:


struct TestType
{
int x;
int y;
};
Q_DECLARE_METATYPE(TestType)

class ...
{
Q_OBJECT
Q_PROPERTY(TestType Test
   READ Test
   WRITESetTest)
...
};


But the property do not appear in the designer.

Property type can only be Qt's own?(and Q_ENUM、Q_FLAGS)
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] How to add custom property type to the designer?

2018-04-03 Thread Jaroslaw Kobus
Yes, QDesigner supports only types it knows. However, the list of known types 
is quite large.


Taking into account that uic needs to convert an xml based property values into 
the C++ code, it wouldn't be easily possible without any plugin architecture / 
extension system of uic.


From: Qt-creator  on 
behalf of Jarvis <390246...@qq.com>
Sent: Friday, March 23, 2018 12:41:37 PM
To: qt-creator
Subject: [Qt-creator] How to add custom property type to the designer?

Hello,I want to add custom property type to the designer.

I'm trying to do that:


struct TestType
{
int x;
int y;
};
Q_DECLARE_METATYPE(TestType)

class ...
{
Q_OBJECT
Q_PROPERTY(TestType Test
   READ Test
   WRITESetTest)
...
};


But the property do not appear in the designer.

Property type can only be Qt's own?(and Q_ENUM、Q_FLAGS)
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Missing shortcut for jump to start/end of document?

2018-02-12 Thread Jaroslaw Kobus
Hi,


Please feel free to file a suggestion task for this missing functionality at 
https://bugreports.qt.io.


Regards


Jarek

System Dashboard - Qt Bug Tracker
bugreports.qt.io
System Dashboard . Tools. View as wallboard




From: Qt-creator  on 
behalf of Henry Skoglund 
Sent: Saturday, February 10, 2018 1:36:01 AM
To: qt-creator@qt-project.org; rea...@gmail.com
Subject: Re: [Qt-creator] Missing shortcut for jump to start/end of document?

On 2018-02-09 23:49, Nikos Chantziaras wrote:
> In the keyboard shortcuts editor, I can't seem to find entries for
> changing the shortcuts to jump to the start and end of the current file.
>
> I occasionally need to use Creator on a Mac, and am trying to bind
> Ctrl+Home/Ctrl+End for this. I have changed the shortcuts for things
> like begin/end of line, next/previous word, etc, and this is one of the
> last missing pieces.
>
> Is there a way I can change these shortcuts?

Hi, I also faced this problem when I started using Qt Creator a few
years ago, couldn't find any editable shortcuts for jumping to start and
end of a document, Solved it by writing a simple Qt Creator plugin
https://github.com/tungware/GeezerEditQt
Because I'm so used to Wordstar (i.e. "sudo apt install joe") my plugin
uses ^Qr and ^Qc, but it should be easy to change to Ctrl+Home/End.

Also, once you've taken the plugin approach, you can also stash your
other custom shortcuts there, for example I use lots of shortcuts for
the common Qxx classes, instead of typing 'qDebug() << ' I hit ^q^qd,
for QByteArray I use ^q^qb, for QString I use ^q^qs. Perhaps you're
missing insert date/time (i.e. F5 in Notepad in Windows), easily fixed
as well.

Finally, there are some nice functions inside Qt Creator which are not
exposed in the menus, for example if you are on a 4K screen like me, you
can increase the width of the text cursor with a shortcut.

Rgrds Henry


___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator