Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: setVisible, -> token, problems

  1. #1
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default setVisible, -> token, problems

    Hi. I've got some annoying errors which appear in my Dialog.cpp file:
    Qt Code:
    1. #include <QtGui>
    2.  
    3. #include "Dialog.h"
    4.  
    5.  
    6.  
    7.  
    8. Dialog::Dialog(QWidget *parent)
    9. : QDialog(parent)
    10. {
    11. ui.setupUi(this);
    12.  
    13. fromLineEdit->hide();
    14. fromLabel->hide();
    15. whiteLabel->hide();
    16. toLabel->hide();
    17. convertButton->hide();
    18. exitButton_2->hide();
    19.  
    20.  
    21. connect(nextStepButton, SIGNAL(clicked()), this, SLOT(settingUp()));
    22.  
    23. }
    24.  
    25.  
    26.  
    27. bool Dialog::settingUp()
    28. {
    29. if (beaufortBox->isChecked() && beaufortBox_2->isChecked())
    30. {
    31. int ret = QMessageBox::information(this, tr("Speed Units Converter"),
    32. tr("You can't convert value to the same unit"),
    33. QMessageBox::Ok | QMessageBox::Default);
    34. if (ret == QMessageBox::Ok)
    35. {
    36. return false;
    37. }
    38.  
    39. }
    40.  
    41. // And few other which look almost the same
    42.  
    43.  
    44.  
    45. if (beaufortBox->isChecked() && knotBox_2->isChecked())
    46. {
    47. Dialog->setWindowTitle("Converting value from Beaufort to Knot");
    48. toLabel->setText("Knot(s)");
    49. fromLineEdit->hide();
    50. fromLabel->setVisible(bool);
    51. whiteLabel->setVisible(bool);
    52. toLabel->setVisible(bool);
    53. convertButton->setVisible(bool);
    54. exitButton_2->setVisible(bool);
    55. }
    56.  
    57. if (beaufortBox->isChecked() && mpsBox_2->isChecked())
    58. {
    59. Dialog->setWindowTitle("Converting value from Beaufort to Mps");
    60.  
    61. fromLabel->setVisible(bool);
    62. whiteLabel->setVisible(bool);
    63. toLabel->setVisible(bool);
    64. convertButton->setVisible(bool);
    65. exitButton_2->setVisible(bool);
    66. }
    67.  
    68. // And others which look almost the same
    69.  
    70.  
    71.  
    72.  
    73.  
    74. }
    To copy to clipboard, switch view to plain text mode 

    Errors are the same for each if instruction (exeptions are first if's which return false):
    In member function bool Dialog::settingUp()
    expected primary expression before "bool"
    expected primary expression before -> token

    I've got much this kind of errors, only the line which the error appears its different. When I was trying to do setVisible() instead of setVisible(bool) I reached errors that candidates are setVisible(bool) and a few others about setVisible()

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    Am... before coding with a programming language it is recommended to learn that language.
    Just as an example which comes all over your code:
    Qt Code:
    1. fromLabel->setVisible(bool); //<< you are using a mix of decleration and implementation syntax
    2. //should be:
    3. fromLabel->setVisible(true /* or - flase*/);
    To copy to clipboard, switch view to plain text mode 
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    Thanks, it solved the problem about bool, but I really don't understand what is this "expected primary expression before -> token" about. Regards

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    Was it the first error you got?
    I guess not.
    If its not the first error, then it probably means nothing coherent, since the errors that come after the first, might be "built" on the first error, since you didn't supply the compiler error output with line numbers, it really is hard to say.
    But gegenrally it means that if you have:
    Qt Code:
    1. somePointer->someMethog();
    To copy to clipboard, switch view to plain text mode 
    Then somePointer needs to be defined, and it is not, or, that its not a pointer that can be agregated. (no inner elements).
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    [QUOTE=high_flyer;40170]Was it the first error you got?
    I guess not.
    If its not the first error, then it probably means nothing coherent, since the errors that come after the first, might be "built" on the first error
    [quote]
    No, it was the first (and only) type of error, not to say error, because I've got many errors which look like this one. Line? Sure:
    Qt Code:
    1. Dialog->setWindowTitle("Converting value from Beaufort to Knot");
    To copy to clipboard, switch view to plain text mode 
    and this is the first line where errors appears, it appears in every Dialog->setWindowTitle() but it doesn't in e.g. toLabel->setText()

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setVisible, -> token, problems

    It's exactly what high_flyer said - Dialog is the name of the class, not a pointer to an instance of a class.

  7. #7
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    Hmm...But when I was looking to ui_Dialog.h code, I saw
    Qt Code:
    1. Dialog->setWindowTitle(...);
    To copy to clipboard, switch view to plain text mode 
    So, I don't understand why it doesn't work in my case

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    So, I don't understand why it doesn't work in my case
    Because you don't know the C++ syntax.
    Before using Qt, you should learn C++, and the first step is learning the systax.
    You can't code if you don't know the sytax.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  9. #9
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    I know C++, coauthored many (console) programs. Syntax is very wide definition. I know syntax, but I don't understand why it doesn't work (Don't say: "It means that you don't knot the syntax")

  10. #10
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    ok, then post ui_Dialog.h code here and I'll show you why it doesn't work when you use Dialog->something(). (all though wysota already answered that)
    Syntax is very wide definition
    No, its not, its very specific.
    http://en.wikipedia.org/wiki/Syntax
    and for programming:
    http://en.wikipedia.org/wiki/Syntax_...ming_languages
    Last edited by high_flyer; 12th June 2007 at 12:47.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  11. #11
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    Ok, here it goes:
    /************************************************** ******************************
    ** Form generated from reading ui file 'Dialog.ui'
    **
    ** Created: Mon 11. Jun 11:28:37 2007
    ** by: Qt User Interface Compiler version 4.2.3
    **
    ** WARNING! All changes made in this file will be lost when recompiling ui file!
    ************************************************** ******************************/

    #ifndef UI_DIALOG_H
    #define UI_DIALOG_H

    #include <QtCore/QVariant>
    #include <QtGui/QAction>
    #include <QtGui/QApplication>
    #include <QtGui/QButtonGroup>
    #include <QtGui/QDialog>
    #include <QtGui/QGroupBox>
    #include <QtGui/QLabel>
    #include <QtGui/QLineEdit>
    #include <QtGui/QPushButton>
    #include <QtGui/QRadioButton>

    class Ui_Dialog
    {
    public:
    QGroupBox *groupBox;
    QRadioButton *beaufortBox;
    QRadioButton *knotBox;
    QRadioButton *kphBox;
    QRadioButton *mphBox;
    QRadioButton *mpsBox;
    QGroupBox *groupBox_2;
    QRadioButton *beaufortBox_2;
    QRadioButton *knotBox_2;
    QRadioButton *mpsBox_2;
    QRadioButton *kphBox_2;
    QRadioButton *mphBox_2;
    QLabel *label;
    QLabel *salazaarLabel;
    QLabel *fromLabel;
    QLabel *whiteLabel;
    QLabel *toLabel;
    QLineEdit *fromLineEdit;
    QPushButton *convertButton;
    QPushButton *exitButton;
    QPushButton *exitButton_2;
    QPushButton *nextStepButton;

    void setupUi(QDialog *Dialog)
    {
    Dialog->setObjectName(QString::fromUtf8("Dialog"));
    Dialog->setWindowIcon(QIcon(QString::fromUtf8(":/new/prefix1/MainDialogIcon.jpg")));
    groupBox = new QGroupBox(Dialog);
    groupBox->setObjectName(QString::fromUtf8("groupBox"));
    groupBox->setGeometry(QRect(50, 40, 120, 131));
    beaufortBox = new QRadioButton(groupBox);
    beaufortBox->setObjectName(QString::fromUtf8("beaufortBox")) ;
    beaufortBox->setGeometry(QRect(10, 20, 83, 18));
    knotBox = new QRadioButton(groupBox);
    knotBox->setObjectName(QString::fromUtf8("knotBox"));
    knotBox->setGeometry(QRect(10, 40, 83, 18));
    kphBox = new QRadioButton(groupBox);
    kphBox->setObjectName(QString::fromUtf8("kphBox"));
    kphBox->setGeometry(QRect(10, 80, 83, 18));
    mphBox = new QRadioButton(groupBox);
    mphBox->setObjectName(QString::fromUtf8("mphBox"));
    mphBox->setGeometry(QRect(10, 100, 83, 18));
    mpsBox = new QRadioButton(groupBox);
    mpsBox->setObjectName(QString::fromUtf8("mpsBox"));
    mpsBox->setGeometry(QRect(10, 60, 83, 18));
    groupBox_2 = new QGroupBox(Dialog);
    groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
    groupBox_2->setGeometry(QRect(240, 40, 120, 131));
    beaufortBox_2 = new QRadioButton(groupBox_2);
    beaufortBox_2->setObjectName(QString::fromUtf8("beaufortBox_2")) ;
    beaufortBox_2->setGeometry(QRect(10, 20, 83, 18));
    knotBox_2 = new QRadioButton(groupBox_2);
    knotBox_2->setObjectName(QString::fromUtf8("knotBox_2"));
    knotBox_2->setGeometry(QRect(10, 40, 83, 18));
    mpsBox_2 = new QRadioButton(groupBox_2);
    mpsBox_2->setObjectName(QString::fromUtf8("mpsBox_2"));
    mpsBox_2->setGeometry(QRect(10, 60, 83, 18));
    kphBox_2 = new QRadioButton(groupBox_2);
    kphBox_2->setObjectName(QString::fromUtf8("kphBox_2"));
    kphBox_2->setGeometry(QRect(10, 80, 83, 18));
    mphBox_2 = new QRadioButton(groupBox_2);
    mphBox_2->setObjectName(QString::fromUtf8("mphBox_2"));
    mphBox_2->setGeometry(QRect(10, 100, 83, 18));
    label = new QLabel(Dialog);
    label->setObjectName(QString::fromUtf8("label"));
    label->setGeometry(QRect(80, 20, 71, 16));
    salazaarLabel = new QLabel(Dialog);
    salazaarLabel->setObjectName(QString::fromUtf8("salazaarLabel")) ;
    salazaarLabel->setGeometry(QRect(20, 410, 275, 16));
    salazaarLabel->setAutoFillBackground(false);
    salazaarLabel->setFrameShape(QFrame::StyledPanel);
    salazaarLabel->setFrameShadow(QFrame::Plain);
    salazaarLabel->setTextFormat(Qt::AutoText);
    salazaarLabel->setScaledContents(false);
    fromLabel = new QLabel(Dialog);
    fromLabel->setObjectName(QString::fromUtf8("fromLabel"));
    fromLabel->setGeometry(QRect(100, 270, 81, 16));
    whiteLabel = new QLabel(Dialog);
    whiteLabel->setObjectName(QString::fromUtf8("whiteLabel"));
    whiteLabel->setGeometry(QRect(190, 270, 46, 14));
    toLabel = new QLabel(Dialog);
    toLabel->setObjectName(QString::fromUtf8("toLabel"));
    toLabel->setGeometry(QRect(270, 270, 97, 16));
    fromLineEdit = new QLineEdit(Dialog);
    fromLineEdit->setObjectName(QString::fromUtf8("fromLineEdit") );
    fromLineEdit->setGeometry(QRect(40, 270, 51, 20));
    convertButton = new QPushButton(Dialog);
    convertButton->setObjectName(QString::fromUtf8("convertButton")) ;
    convertButton->setGeometry(QRect(200, 320, 75, 23));
    exitButton = new QPushButton(Dialog);
    exitButton->setObjectName(QString::fromUtf8("exitButton"));
    exitButton->setGeometry(QRect(300, 320, 75, 23));
    exitButton_2 = new QPushButton(Dialog);
    exitButton_2->setObjectName(QString::fromUtf8("exitButton_2") );
    exitButton_2->setGeometry(QRect(290, 190, 75, 23));
    nextStepButton = new QPushButton(Dialog);
    nextStepButton->setObjectName(QString::fromUtf8("nextStepButton") );
    nextStepButton->setGeometry(QRect(160, 190, 91, 23));

    retranslateUi(Dialog);

    QSize size(400, 426);
    size = size.expandedTo(Dialog->minimumSizeHint());
    Dialog->resize(size);

    QObject::connect(exitButton, SIGNAL(clicked()), Dialog, SLOT(close()));
    QObject::connect(exitButton_2, SIGNAL(clicked()), Dialog, SLOT(close()));

    QMetaObject::connectSlotsByName(Dialog);
    } // setupUi

    void retranslateUi(QDialog *Dialog)
    {
    Dialog->setWindowTitle(QApplication::translate("Dialog" , "Wind units converter", 0, QApplication::UnicodeUTF8));
    groupBox->setTitle(QApplication::translate("Dialog", "From", 0, QApplication::UnicodeUTF8));
    beaufortBox->setText(QApplication::translate("Dialog", "Beaufort", 0, QApplication::UnicodeUTF8));
    knotBox->setText(QApplication::translate("Dialog", "Knot", 0, QApplication::UnicodeUTF8));
    kphBox->setText(QApplication::translate("Dialog", "Kph", 0, QApplication::UnicodeUTF8));
    mphBox->setText(QApplication::translate("Dialog", "Mph", 0, QApplication::UnicodeUTF8));
    mpsBox->setText(QApplication::translate("Dialog", "Mps", 0, QApplication::UnicodeUTF8));
    groupBox_2->setTitle(QApplication::translate("Dialog", "To", 0, QApplication::UnicodeUTF8));
    beaufortBox_2->setText(QApplication::translate("Dialog", "Beaufort", 0, QApplication::UnicodeUTF8));
    knotBox_2->setText(QApplication::translate("Dialog", "Knot", 0, QApplication::UnicodeUTF8));
    mpsBox_2->setText(QApplication::translate("Dialog", "Mps", 0, QApplication::UnicodeUTF8));
    kphBox_2->setText(QApplication::translate("Dialog", "Kph", 0, QApplication::UnicodeUTF8));
    mphBox_2->setText(QApplication::translate("Dialog", "Mph", 0, QApplication::UnicodeUTF8));
    label->setText(QApplication::translate("Dialog", "Convert units:", 0, QApplication::UnicodeUTF8));
    salazaarLabel->setText(QApplication::translate("Dialog", "Salazaar Software Corporation - Speed Units Converter", 0, QApplication::UnicodeUTF8));
    fromLabel->setText(QApplication::translate("Dialog", "Beaufort(s) it's", 0, QApplication::UnicodeUTF8));
    whiteLabel->setText(QString());
    toLabel->setText(QApplication::translate("Dialog", "Meter(s) per second", 0, QApplication::UnicodeUTF8));
    convertButton->setText(QApplication::translate("Dialog", "Convert", 0, QApplication::UnicodeUTF8));
    exitButton->setText(QApplication::translate("Dialog", "Exit", 0, QApplication::UnicodeUTF8));
    exitButton_2->setText(QApplication::translate("Dialog", "Exit", 0, QApplication::UnicodeUTF8));
    nextStepButton->setText(QApplication::translate("Dialog", "Go to next step", 0, QApplication::UnicodeUTF8));
    Q_UNUSED(Dialog);
    } // retranslateUi

    };

    namespace Ui {
    class Dialog: public Ui_Dialog {};
    } // namespace Ui

    #endif // UI_DIALOG_H

  12. #12
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    right:
    So lets see:
    Qt Code:
    1. void setupUi(QDialog *Dialog)
    2. {
    3. Dialog->setObjectName(QString::fromUtf8("Dialog"));
    4. // the rest
    5. }
    6.  
    7. //and your code:
    8. bool Dialog::settingUp()
    9. {
    10. ...
    11. Dialog->setWindowTitle("Converting value from Beaufort to Knot");
    12. ....
    13. }
    To copy to clipboard, switch view to plain text mode 
    Now, since you know C++ syntax, why don't you explain to me the error in your code.
    If you can't I will.


    coauthored many (console) programs.
    I'd be interested to know which ones, would be great if you could supply links.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  13. #13
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    Quote Originally Posted by high_flyer View Post
    right:
    So lets see:
    Qt Code:
    1. void setupUi(QDialog *Dialog)
    2. {
    3. Dialog->setObjectName(QString::fromUtf8("Dialog"));
    4. // the rest
    5. }
    6.  
    7. //and your code:
    8. bool Dialog::settingUp()
    9. {
    10. ...
    11. Dialog->setWindowTitle("Converting value from Beaufort to Knot");
    12. ....
    13. }
    To copy to clipboard, switch view to plain text mode 
    Now, since you know C++ syntax, why don't you explain to me the error in your code.
    If you can't I will.
    How do you think, why am I asking this question? Obviously because I don't know the answer
    Quote Originally Posted by high_flyer View Post
    I'd be interested to know which ones, would be great if you could supply links.
    Important? But if you want to know, one was called Professional Friends Database with many useful functions. I don't supply link, because pure C++ programs are history...

  14. #14
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    How do you think, why am I asking this question? Obviously because I don't know the answer
    Well, if you don't know the answer, how can you claim you know C++ syntax?

    If you knew C++ then you would know that:
    Qt Code:
    1. void setupUi(QDialog *Dialog) //<< 'Dialog' pointer is defined.
    2. {
    3.  
    4. Dialog->setObjectName(QString::fromUtf8("Dialog")); //so this is ok.
    5. // the rest
    6. }
    To copy to clipboard, switch view to plain text mode 

    And as wasota gave the answer above:
    Qt Code:
    1. bool Dialog::settingUp() //Dialog is the name of the class
    2. {
    3. ...
    4. Dialog->setWindowTitle("Converting value from Beaufort to Knot"); //pointer 'Dialog' never defined, so Dialog-> is illegal.
    5. ....
    6. }
    To copy to clipboard, switch view to plain text mode 

    I don't supply link, because pure C++ programs are history...
    History??
    What do you mean?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  15. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setVisible, -> token, problems

    Quote Originally Posted by Salazaar View Post
    I know syntax, but I don't understand why it doesn't work (Don't say: "It means that you don't knot the syntax")
    Based on what I've seen in your posts, I strongly doubt that...

    Quote Originally Posted by Salazaar View Post
    Ok, here it goes:
    Next time please attach large amounts of code instead of pasting them directly.

    Quote Originally Posted by Salazaar View Post
    I don't supply link, because pure C++ programs are history...
    Well now... I... wouldn't say that....

  16. #16
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    How never defined?? It was defined in first code - QDialog * Dialog. So what's "legal"?
    I mean that console program doesn't exist, and I'm not programming purely in C++ but using Qt
    edit:
    wysota, I meant purely C++, without Qt

  17. #17
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    It was defined in first code - QDialog * Dialog. So what's "legal"?
    Heh???
    I don't see that nowhere in your code!
    And neither the compiler, so I guess you didn't define QDialog * Dialog.
    And in general, even if you have, its bad practice to use the class name as variable name, since it might confuse the compiler.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  18. #18
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setVisible, -> token, problems

    Lets review
    Qt Code:
    1. void setupUi(QDialog *Dialog)
    To copy to clipboard, switch view to plain text mode 
    So it should work, even if the name is the same as class name

  19. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setVisible, -> token, problems

    Quote Originally Posted by Salazaar View Post
    wysota, I meant purely C++, without Qt
    Yes, I meant that as well. 99% of your problems on this forum are C++ syntax problems and not Qt. You can't distinguish between static and non-static methods, objects and classes, you admitted you can't handle subclassing very well, you have problems with understanding scopes and you can't spot a difference between a declaration of an object and a method. All these problems have nothing to do with Qt, they are purely C++ related. Qt is not a language, it's a bunch of classes conforming to the C++ syntax (apart from the "signals", "slots" and "emit" keywords, but these are transparent to C++ compilers).

  20. #20
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setVisible, -> token, problems

    So it should work, even if the name is the same as class name
    No it should not.
    Because the decleration does not belong to the scope you are using it in.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  2. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.