Re: [Qt-creator] Tabs vs Spaces?
Hi Jason, You can use git smudge and clean filters so that local versions appear to have spaces, but the remote has tabs. Having said that, I've fiddled with them in the past for formatting they are a little scary IMHO. Best plan is just to choose a format and get everyone to use it, regardless of personal preference. 'this is the project format - suck it up.' As the others have said clang-format is a popular formatter at the moment, and is quite nicely integrated in QTC. There are more than a few pre and post commit hooks out out on the Web to auto clang format to the configuration in the root of the project directory, the only shortfall I've seen in some is that they fail to format the working version at the same time so the dev will see a difference between the working version and the committed version that they might not anticipate. HTH, B. On Fri, 6 Mar 2020, 16:38 Jason H, wrote: > I am a tabs guy. I change the Qt style to use tabs. I tab all the things!! > > Anyway, I now have other contributors to my project that are spaces > people. How can we live in harmony? One side effect is that it seems git > considers whitespace changes so his code is indented with spaces, mine are > tabs and it's making a mess in git. > > > Or should this be handled by git? (And if so, how?) > > > ___ > 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] Tabs vs Spaces?
I will echo Henry and say that clang-format and git-clang-format in combination with QtCreator 4.10 and newer have let our project all live with the same formatting rules. As I type code QtCreator uses our clang-format file to format my code. Git-clang-format for changes made through other text editors. -- Mike Jackson On 3/6/20, 12:04 PM, "Qt-creator on behalf of Miller Henry" wrote: The obvious thing is to create a clang-format rule that formats things to your preferences, and then back to the repo preferences. A git hook can reformat files to the repo preferences before you check them in, though I'm not sure how you reformat to your preferences. Beware that if you do this you need to get everybody to agree to the repo format and run the tool before their checkins as well, otherwise 'git blame' will put your name on most of the code when your only contribution was to change whitespace to what it should have been in the first place. Clang-format is the best-known tool for this today. I've also used uncrustify in the past for formatting, and I've seen a few other tools. Your project can choose. -Original Message- From: Qt-creator On Behalf Of Jason H Sent: Friday, March 6, 2020 10:38 AM To: qt-creator Subject: [Qt-creator] Tabs vs Spaces? I am a tabs guy. I change the Qt style to use tabs. I tab all the things!! Anyway, I now have other contributors to my project that are spaces people. How can we live in harmony? One side effect is that it seems git considers whitespace changes so his code is indented with spaces, mine are tabs and it's making a mess in git. Or should this be handled by git? (And if so, how?) ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] Using Qt Enums as QML object keys... Qt6?
Sorry, all this should have gone to interest - please continue any discussion there. /my bad > Sent: Friday, March 06, 2020 at 12:23 PM > From: "Jason H" > To: qt-creator > Subject: [Qt-creator] Using Qt Enums as QML object keys... Qt6? > > First, sometimes I find that not all Qt enums are exported to QML. > Like the QProcess::ProcessState, IIRC. Are these bugs? Shouldn't all Qt enums > in QObject recived classes be Q_ENUM()ed? > > Next, QML's uage of these is normally an int, when I print these with > console.log() they come out as 0,1,2,3, etc. However, I was going to [ab]use > this and tried > var nameForState = { > QProcess.NotRunning: "QProcess::NotRunning", > QProcess.Starting: "QProcess::Starting", > QProcess.Running: "QProcess::Running", > } > > But instead I have to provide an array: > var nameForState = [ > "QProcess::NotRunning","QProcess::Starting","QProcess::Running"] > then index. > console.log("process state", index, nameForState[state]); > But this is a weaker binding and sometimes the table in the docs is not > present, or if is present aren't ways in sorted order. Also QFlags are not > possible to do this way. > > I am hoping for Qt6, we can console.log() without this additional lookup? Or > at least use the object-based lookup and not the array version? > > > > > > ___ > 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
[Qt-creator] Using Qt Enums as QML object keys... Qt6?
First, sometimes I find that not all Qt enums are exported to QML. Like the QProcess::ProcessState, IIRC. Are these bugs? Shouldn't all Qt enums in QObject recived classes be Q_ENUM()ed? Next, QML's uage of these is normally an int, when I print these with console.log() they come out as 0,1,2,3, etc. However, I was going to [ab]use this and tried var nameForState = { QProcess.NotRunning: "QProcess::NotRunning", QProcess.Starting: "QProcess::Starting", QProcess.Running: "QProcess::Running", } But instead I have to provide an array: var nameForState = [ "QProcess::NotRunning","QProcess::Starting","QProcess::Running"] then index. console.log("process state", index, nameForState[state]); But this is a weaker binding and sometimes the table in the docs is not present, or if is present aren't ways in sorted order. Also QFlags are not possible to do this way. I am hoping for Qt6, we can console.log() without this additional lookup? Or at least use the object-based lookup and not the array version? ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] Tabs vs Spaces?
06.03.2020, 19:39, "Jason H" : > I am a tabs guy. I change the Qt style to use tabs. I tab all the things!! > > Anyway, I now have other contributors to my project that are spaces people. > How can we live in harmony? One side effect is that it seems git considers > whitespace changes so his code is indented with spaces, mine are tabs and > it's making a mess in git. > > Or should this be handled by git? (And if so, how?) https://stackoverflow.com/a/2318063/12485958 Note that this advices assumes GNU implementations of expand and unexpand, BSD/macOS implementations don't support same arguments so adjustment may be needed -- Regards, Konstantin ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] Tabs vs Spaces?
The obvious thing is to create a clang-format rule that formats things to your preferences, and then back to the repo preferences. A git hook can reformat files to the repo preferences before you check them in, though I'm not sure how you reformat to your preferences. Beware that if you do this you need to get everybody to agree to the repo format and run the tool before their checkins as well, otherwise 'git blame' will put your name on most of the code when your only contribution was to change whitespace to what it should have been in the first place. Clang-format is the best-known tool for this today. I've also used uncrustify in the past for formatting, and I've seen a few other tools. Your project can choose. -Original Message- From: Qt-creator On Behalf Of Jason H Sent: Friday, March 6, 2020 10:38 AM To: qt-creator Subject: [Qt-creator] Tabs vs Spaces? I am a tabs guy. I change the Qt style to use tabs. I tab all the things!! Anyway, I now have other contributors to my project that are spaces people. How can we live in harmony? One side effect is that it seems git considers whitespace changes so his code is indented with spaces, mine are tabs and it's making a mess in git. Or should this be handled by git? (And if so, how?) ___ 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
[Qt-creator] Tabs vs Spaces?
I am a tabs guy. I change the Qt style to use tabs. I tab all the things!! Anyway, I now have other contributors to my project that are spaces people. How can we live in harmony? One side effect is that it seems git considers whitespace changes so his code is indented with spaces, mine are tabs and it's making a mess in git. Or should this be handled by git? (And if so, how?) ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] Create SplitView in EditorManager programmatically
Yes Andre, I referred this plugin too but I found there is no separate preview pane here instead the preview was happening directly in the editor. I was looking to develop a side by side viewer with the text editor and preview pane where the preview pane will remain read only Vidhya On Fri, 6 Mar 2020 at 8:08 PM, André Hartmann wrote: > Dear Vidhya Arun, > > Please note that there is currently a markdown viewer in development / > review: https://codereview.qt-project.org/c/qt-creator/qt-creator/+/287928 > > Maybe your plugin and the markdown viewer can join forces - after all > the use case should be similar. > > Regards, André > > Am 06.03.20 um 15:33 schrieb Eike Ziller: > > > > > >> On 6. Mar 2020, at 15:29, Eike Ziller wrote: > >> > >> > >> > >>> On 6. Mar 2020, at 15:15, Vidhya Arun wrote: > >>> > >>> Hello All > >>> > >>> I am creating a plugin for ascii doc preview for which I need to > create a splitView in the EditorManager. > >>> My idea is to create a plainTextEdit in one side of Editor and a > previewer in the other split. > >>> > >>> Are there any methods exposed directly from TextEditor or > EditorManager plugin to create this split view (The split Side by side > functionality that we are able to do it manually in QtCreator editor is > what am trying to call programatically ) > >> > >> The only options that you have programmatically are > "EditorManager::openEditor(filename, Id(), > EditorManager::OpenInOtherSplit)” (opens document in “next” split view, > creates split view if there is none yet), > > > > That is available for any editor-opening method, like > EditorManager::openEditorWithContents, which might be more appropriate if > you create an in-memory preview. > > > >> and possibly "EditorManager::openEditor(, > EditorManager::SwitchSplitIfAlreadyVisible)", which does not open the > document in the current view, if it is already visible in a different view. > >> Otherwise splits are currently not exposed to the outside. > > > > > -- > Dipl.-Ing. (FH) André Hartmann > Softwareentwicklung / Software Development > > E-Mail: andre.hartm...@iseg-hv.de | Tel: +49 351 26996-43 | Fax: +49 351 > 26996-21 > > iseg Spezialelektronik GmbH - HIGH VOLTAGE. EXACTLY. > iseg-hv.de | iseg-hv.com | download.iseg-hv.com > > Bautzner Landstr. 23, 01454 Radeberg / Rossendorf, Germany > Geschäftsführer / Managing directors: Dr. Frank Gleisberg, Dr. Joachim > Pöthig > Amtsgericht / Lower district court: Dresden HRB 16250 > Umsatzsteuer-Id: / VAT-ID: DE812508942 > > News / Information > https://iseg-hv.com/en/products/control#isegControl2 isegControl2 - > Unified Control Software > https://iseg-hv.com/en/products/detail/EHS EHS FLEX - Customize and keep > the price > https://iseg-hv.com/en/products/detail/EHS EHS STACK - Perfect for GEM > Detectors > https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf NEW! > Product catalog 2017 / 2018 released > https://iseg-hv.com/en/products/detail/NHR NHR - NIM HV-Supply with > reversible polarity > > Links > https://www.linkedin.com/company/12726924 iseg on LINKEDIN | Let's stay > connected! > https://www.youtube.com/channel/UC5AL-ZgOqSim_1gYNnndyzQ iseg on YOUTUBE > | Tutorials and more ... > https://www.twitter.com/iseg_hv iseg on TWITTER | please follow! > https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf iseg > CATALOG | download product catalog as PDF > http://download.iseg-hv.com/ iseg DOWNLOADS | manuals, software, > firmware and more... > > Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte > Informationen. Wenn Sie nicht der richtige > Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren > Sie bitte sofort den Absender und > vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte > Weitergabe dieser Mail ist nicht > gestattet. > > This e-mail may contain confidential and/or privileged information. If > you are not the intended recipient > (or have received this e-mail in error) please notify the sender > immediately and destroy this e-mail. > Any unauthorized copying, disclosure or distribution of the material in > this e-mail is strictly forbidden. > ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] Create SplitView in EditorManager programmatically
Dear Vidhya Arun, Please note that there is currently a markdown viewer in development / review: https://codereview.qt-project.org/c/qt-creator/qt-creator/+/287928 Maybe your plugin and the markdown viewer can join forces - after all the use case should be similar. Regards, André Am 06.03.20 um 15:33 schrieb Eike Ziller: On 6. Mar 2020, at 15:29, Eike Ziller wrote: On 6. Mar 2020, at 15:15, Vidhya Arun wrote: Hello All I am creating a plugin for ascii doc preview for which I need to create a splitView in the EditorManager. My idea is to create a plainTextEdit in one side of Editor and a previewer in the other split. Are there any methods exposed directly from TextEditor or EditorManager plugin to create this split view (The split Side by side functionality that we are able to do it manually in QtCreator editor is what am trying to call programatically ) The only options that you have programmatically are "EditorManager::openEditor(filename, Id(), EditorManager::OpenInOtherSplit)” (opens document in “next” split view, creates split view if there is none yet), That is available for any editor-opening method, like EditorManager::openEditorWithContents, which might be more appropriate if you create an in-memory preview. and possibly "EditorManager::openEditor(, EditorManager::SwitchSplitIfAlreadyVisible)", which does not open the document in the current view, if it is already visible in a different view. Otherwise splits are currently not exposed to the outside. -- Dipl.-Ing. (FH) André Hartmann Softwareentwicklung / Software Development E-Mail: andre.hartm...@iseg-hv.de | Tel: +49 351 26996-43 | Fax: +49 351 26996-21 iseg Spezialelektronik GmbH - HIGH VOLTAGE. EXACTLY. iseg-hv.de | iseg-hv.com | download.iseg-hv.com Bautzner Landstr. 23, 01454 Radeberg / Rossendorf, Germany Geschäftsführer / Managing directors: Dr. Frank Gleisberg, Dr. Joachim Pöthig Amtsgericht / Lower district court: Dresden HRB 16250 Umsatzsteuer-Id: / VAT-ID: DE812508942 News / Information https://iseg-hv.com/en/products/control#isegControl2 isegControl2 - Unified Control Software https://iseg-hv.com/en/products/detail/EHS EHS FLEX - Customize and keep the price https://iseg-hv.com/en/products/detail/EHS EHS STACK - Perfect for GEM Detectors https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf NEW! Product catalog 2017 / 2018 released https://iseg-hv.com/en/products/detail/NHR NHR - NIM HV-Supply with reversible polarity Links https://www.linkedin.com/company/12726924 iseg on LINKEDIN | Let's stay connected! https://www.youtube.com/channel/UC5AL-ZgOqSim_1gYNnndyzQ iseg on YOUTUBE | Tutorials and more ... https://www.twitter.com/iseg_hv iseg on TWITTER | please follow! https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf iseg CATALOG | download product catalog as PDF http://download.iseg-hv.com/ iseg DOWNLOADS | manuals, software, firmware and more... Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] Create SplitView in EditorManager programmatically
> On 6. Mar 2020, at 15:29, Eike Ziller wrote: > > > >> On 6. Mar 2020, at 15:15, Vidhya Arun wrote: >> >> Hello All >> >> I am creating a plugin for ascii doc preview for which I need to create a >> splitView in the EditorManager. >> My idea is to create a plainTextEdit in one side of Editor and a previewer >> in the other split. >> >> Are there any methods exposed directly from TextEditor or EditorManager >> plugin to create this split view (The split Side by side functionality that >> we are able to do it manually in QtCreator editor is what am trying to call >> programatically ) > > The only options that you have programmatically are > "EditorManager::openEditor(filename, Id(), EditorManager::OpenInOtherSplit)” > (opens document in “next” split view, creates split view if there is none > yet), That is available for any editor-opening method, like EditorManager::openEditorWithContents, which might be more appropriate if you create an in-memory preview. > and possibly "EditorManager::openEditor(, > EditorManager::SwitchSplitIfAlreadyVisible)", which does not open the > document in the current view, if it is already visible in a different view. > Otherwise splits are currently not exposed to the outside. -- Eike Ziller Principal Software Engineer The Qt Company GmbH Erich-Thilo-Straße 10 D-12489 Berlin eike.zil...@qt.io http://qt.io Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] Create SplitView in EditorManager programmatically
> On 6. Mar 2020, at 15:15, Vidhya Arun wrote: > > Hello All > > I am creating a plugin for ascii doc preview for which I need to create a > splitView in the EditorManager. > My idea is to create a plainTextEdit in one side of Editor and a previewer in > the other split. > > Are there any methods exposed directly from TextEditor or EditorManager > plugin to create this split view (The split Side by side functionality that > we are able to do it manually in QtCreator editor is what am trying to call > programatically ) The only options that you have programmatically are "EditorManager::openEditor(filename, Id(), EditorManager::OpenInOtherSplit)” (opens document in “next” split view, creates split view if there is none yet), and possibly "EditorManager::openEditor(, EditorManager::SwitchSplitIfAlreadyVisible)", which does not open the document in the current view, if it is already visible in a different view. Otherwise splits are currently not exposed to the outside. -- Eike Ziller Principal Software Engineer The Qt Company GmbH Erich-Thilo-Straße 10 D-12489 Berlin eike.zil...@qt.io http://qt.io Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
[Qt-creator] Create SplitView in EditorManager programmatically
Hello All I am creating a plugin for ascii doc preview for which I need to create a splitView in the EditorManager. My idea is to create a plainTextEdit in one side of Editor and a previewer in the other split. Are there any methods exposed directly from TextEditor or EditorManager plugin to create this split view (The split Side by side functionality that we are able to do it manually in QtCreator editor is what am trying to call programatically ) ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator