Re: [Qt-creator] code completion anomaly

2010-01-30 Thread Mark Brand

>> Code completion in the does not seem to work right for member class
>> "aaa->" triggers code completion but should not. "aaa." should
>> trigger code completion but does not.

> My advice is to report the bug using our Qt bug tracker so I can look at 
> problem and eventually fix it.
>
> ciao robe
>   

Thanks. I found some issues that are speculatively related, but nothing
that was clearly the same. So I made a new issue.

http://bugreports.qt.nokia.com/browse/QTCREATORBUG-649

___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


Re: [Qt-creator] code completion anomaly

2010-01-29 Thread Eike Ziller

On Jan 29, 2010, at 2:14 PM, ext Danny Price wrote:

> Creator seems to have issues with nested classes. It actually used to crash 
> in this case but that bug was fixed (once I finally convinced Nokia it was a 
> problem...).

I don't think you convinced "the company Nokia" - most of the company will not 
even read your bugreport or this mailing list. You might have convinced some Qt 
Creator devs though.

>> Some people actually like to use trivial nested classes to aid in code 
>> completion. It can be convenient to type in something like "aaa." and then 
>> quickly choose what you want. Think of it as a namespace within a class.
> 
> You should write code based on best coding and design practice, not to adhere 
> to the whims of a particular IDE's syntax completion.

What does that have to do with any particular IDE?

> Class nesting is like function nesting in old C - it get's out of control 
> fast. Pmpl is an exception (and in that case the class is defined within the 
> cpp file anyway). For most other cases, class friendships are better.


Friend declarations get out of control even faster.
As with almost all programing concepts it's all about having guidelines for the 
concept's uses, so they don't get out of control.
That applies to the examples above too, both friend declarations and nested 
classes.
BTW, nested classes (and structs and enums in classes) are used at several 
places throughout Qt and Qt Creator, exactly for namespacing + encapsulation.

-- 
Eike Ziller
Software Engineer
Nokia, Qt Development Frameworks

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori




___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


Re: [Qt-creator] code completion anomaly

2010-01-29 Thread roberto.raggi

Hi,

On Jan 29, 2010, at 2:33 PM, ext Danny Price wrote:



On Fri, Jan 29, 2010 at 1:27 PM, 
mailto:roberto.ra...@nokia.com>> wrote:

Hi,

On Jan 29, 2010, at 2:14 PM, ext Danny Price wrote:

> Creator seems to have issues with nested classes. It actually used to crash 
> in this case but that bug was fixed (once I finally convinced Nokia it was a 
> problem...).

or maybe because the bug was reported and I had time to fix it.

>
> My adivce is to not use nested classes.

My advice is to report the bug using our Qt bug tracker so I can look at 
problem and eventually fix it.

I reported the crash-bug both on this list (several times) and here 
http://bugreports.qt.nokia.com/browse/QTCREATORBUG-199 but it was reported 
'un-reproducable'. Sometime later it was magically fixed!

Because it wasn't reproducible. The crash had nothing to do with nested 
classes, the C++ parser or Qt Creator. It's some old weird bug in  Qt/Carbon

http://qt.gitorious.org/qt-creator/qt-creator/commit/e2925540675b3c723f46f4f6a21a0cbf3dff26ad


ciao robe

___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


Re: [Qt-creator] code completion anomaly

2010-01-29 Thread Danny Price
On Fri, Jan 29, 2010 at 1:33 PM, Mark Brand  wrote:

>
>  "aaa->" triggers code completion but should not.
>>
>> "aaa." should trigger code completion but does not.
>>
>>
> Creator seems to have issues with nested classes. It actually used to crash
> in this case but that bug was fixed (once I finally convinced Nokia it was a
> problem...).
>
> My adivce is to not use nested classes.
>
>
> Some people actually like to use trivial nested classes to aid in code
> completion. It can be convenient to type in something like "aaa." and then
> quickly choose what you want. Think of it as a namespace within a class.
>

You should write code based on best coding and design practice, not to
adhere to the whims of a particular IDE's syntax completion. Class nesting
is like function nesting in old C - it get's out of control fast. Pmpl is an
exception (and in that case the class is defined within the cpp file
anyway). For most other cases, class friendships are better.


>
> Two new discoveries:
>
> 1) Code completion is not the only problem.  "Find usages" doesn't work
> either.
>
> 2) If you separate the member declaration from the nested class
> declaration, neither problem occurs. This a good workaround. See example
> below:
>
>
> class MainWindow : public QMainWindow {
> Q_OBJECT
> public:
> explicit MainWindow(QWidget *parent = 0);
> ~MainWindow();
>
> private:
> Ui::MainWindow *ui;
>
> class AAA
> {
> public:
> int a;
> int b;
> int c;
> } aaa;  //code completion and "find usages" don't work
>
> AAA bbb; //code completion and "find usages" work
> };
>
>
>
> ___
> Qt-creator mailing list
> Qt-creator@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
>
___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


Re: [Qt-creator] code completion anomaly

2010-01-29 Thread Danny Price
On Fri, Jan 29, 2010 at 1:27 PM,  wrote:

>
> Hi,
>
> On Jan 29, 2010, at 2:14 PM, ext Danny Price wrote:
>
> > Creator seems to have issues with nested classes. It actually used to
> crash in this case but that bug was fixed (once I finally convinced Nokia it
> was a problem...).
>
> or maybe because the bug was reported and I had time to fix it.
>

> >
> > My adivce is to not use nested classes.
>
> My advice is to report the bug using our Qt bug tracker so I can look at
> problem and eventually fix it.
>

I reported the crash-bug both on this list (several times) and here
http://bugreports.qt.nokia.com/browse/QTCREATORBUG-199 but it was reported
'un-reproducable'. Sometime later it was magically fixed!

>
> ciao robe
>
>
> ___
> Qt-creator mailing list
> Qt-creator@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


Re: [Qt-creator] code completion anomaly

2010-01-29 Thread Mark Brand

> "aaa->" triggers code completion but should not.
>
> "aaa." should trigger code completion but does not.
>

> Creator seems to have issues with nested classes. It actually used to
> crash in this case but that bug was fixed (once I finally convinced
> Nokia it was a problem...).
>
> My adivce is to not use nested classes.

Some people actually like to use trivial nested classes to aid in code
completion. It can be convenient to type in something like "aaa." and
then quickly choose what you want. Think of it as a namespace within a
class.

Two new discoveries:

1) Code completion is not the only problem.  "Find usages" doesn't work
either.

2) If you separate the member declaration from the nested class
declaration, neither problem occurs. This a good workaround. See example
below:

class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

private:
Ui::MainWindow *ui;

class AAA
{
public:
int a;
int b;
int c;
} aaa;  //code completion and "find usages" don't work

AAA bbb; //code completion and "find usages" work
};


___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


Re: [Qt-creator] code completion anomaly

2010-01-29 Thread roberto.raggi

Hi,

On Jan 29, 2010, at 2:14 PM, ext Danny Price wrote:

> Creator seems to have issues with nested classes. It actually used to crash 
> in this case but that bug was fixed (once I finally convinced Nokia it was a 
> problem...).

or maybe because the bug was reported and I had time to fix it.

> 
> My adivce is to not use nested classes.

My advice is to report the bug using our Qt bug tracker so I can look at 
problem and eventually fix it.

ciao robe


___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


Re: [Qt-creator] code completion anomaly

2010-01-29 Thread Danny Price
Creator seems to have issues with nested classes. It actually used to crash
in this case but that bug was fixed (once I finally convinced Nokia it was a
problem...).

My adivce is to not use nested classes.

On Fri, Jan 29, 2010 at 1:03 PM, Mark Brand  wrote:

> Hi,
>
> This is a question about code completion in Qt Creator. I have been
> enjoying using Qt Creator built from the latest git sources.
>
> Here is the issue:
>
> Code completion in the does not seem to work right for member class
> declarations. For the example below:
>
> "aaa->" triggers code completion but should not.
>
> "aaa." should trigger code completion but does not.
>
> Is this really wrong, or is there more to this than meets the eye.
>
> regards,
>
> Mark
>
> #ifndef MAINWINDOW_H
> #define MAINWINDOW_H
>
> #include 
>
> namespace Ui {
>class MainWindow;
> }
>
> class MainWindow : public QMainWindow {
>Q_OBJECT
> public:
>explicit MainWindow(QWidget *parent = 0);
>~MainWindow();
>
> protected:
>void changeEvent(QEvent *e);
>
> private:
>Ui::MainWindow *ui;
>
>class AAA
>{
>public:
>int a;
>int b;
>int c;
>} aaa;
> };
>
> #endif // MAINWINDOW_H
>
> ___
> Qt-creator mailing list
> Qt-creator@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator


[Qt-creator] code completion anomaly

2010-01-29 Thread Mark Brand
Hi,

This is a question about code completion in Qt Creator. I have been
enjoying using Qt Creator built from the latest git sources.

Here is the issue:

Code completion in the does not seem to work right for member class
declarations. For the example below:

"aaa->" triggers code completion but should not.

"aaa." should trigger code completion but does not.

Is this really wrong, or is there more to this than meets the eye.

regards,

Mark

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include 

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

protected:
void changeEvent(QEvent *e);

private:
Ui::MainWindow *ui;

class AAA
{
public:
int a;
int b;
int c;
} aaa;
};

#endif // MAINWINDOW_H

___
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator