Меню

Ошибка unicodeutf8 is not a member of qapplication

  • Home
  • Forum
  • Qt
  • Qt Programming
  • error: ‘UnicodeUTF8’ is not a member of ‘QApplication’

  1. 17th August 2013, 09:50


    #1

    Default error: ‘UnicodeUTF8’ is not a member of ‘QApplication’

    I am running a program I wrote in qt 4.7 with qt 5.0.1 I get the above error. Can I resolve this error?


  2. 17th August 2013, 13:47


    #2

    Default Re: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’

    Refer this Deprecation

    Just in case the link is missing

    This enum type used to define the 8-bit encoding of character string arguments to translate(). This enum is now obsolete and UTF-8 will be used in all cases. So remove all instances of QCoreApplication::UnicodeUTF8.

    So just remove it, and don’t use it (inthe function parameters)

    When you know how to do it then you may do it wrong.
    When you don’t know how to do it then it is not that you may do it wrong but you may not do it right.


  3. The following user says thank you to Santosh Reddy for this useful post:

    atenakid (18th February 2014)


Similar Threads

  1. Replies: 2

    Last Post: 19th December 2011, 07:32

  2. Replies: 6

    Last Post: 6th March 2009, 22:16

  3. Replies: 3

    Last Post: 19th February 2008, 14:10

  4. Replies: 7

    Last Post: 5th February 2008, 12:26

  5. Replies: 4

    Last Post: 19th June 2006, 16:21

Bookmarks

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
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.

Hello guys,

I am new to the Klayout community. I hope I can learn as much as possible from you B)

I was trying to install Klayout on my Linux (Fedora 26) but I encountered some problems during the build process.

The error that I got during the building process is the following:

In file included from ../../../src/laybasic/laybasic/layBookmarkManagementForm.h:28:0,
from moc_layBookmarkManagementForm.cpp:9:
./ui_BookmarkManagementForm.h: In member function ‘void Ui_BookmarkManagementForm::retranslateUi(QDialog*)’:
./ui_BookmarkManagementForm.h:148:135: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’
late(«BookmarkManagementForm», «Manage Bookmarks», 0, QApplication::UnicodeUTF8));
^~~
./ui_BookmarkManagementForm.h:149:129: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’
gementForm», «Double-click to edit bookmark name», 0, QApplication::UnicodeUTF8));
^~~
./ui_BookmarkManagementForm.h:150:109: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’
ion::translate(«BookmarkManagementForm», «Delete», 0, QApplication::UnicodeUTF8));
^~~
./ui_BookmarkManagementForm.h:151:101: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’
ication::translate(«BookmarkManagementForm», «OK», 0, QApplication::UnicodeUTF8));
^~~
./ui_BookmarkManagementForm.h:152:109: error: ‘UnicodeUTF8’ is not a member of ‘QApplication’
ion::translate(«BookmarkManagementForm», «Cancel», 0, QApplication::UnicodeUTF8));
^~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-reserved-user-defined-literal’
gmake[2]: *** [Makefile:12804: moc_layBookmarkManagementForm.o] Error 1
gmake[2]: Leaving directory ‘/home/kalosu/Documents/Nazca/klayout-0.26/build-release/laybasic/laybasic’
gmake[1]: *** [Makefile:46: sub-laybasic-make_first] Error 2
gmake[1]: Leaving directory ‘/home/kalosu/Documents/Nazca/klayout-0.26/build-release/laybasic’
gmake: *** [Makefile:276: sub-laybasic-make_first] Error 2

Any idea about what could I do to solve this?

Cheers,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <QMainWindow>
#include <QApplication>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWidget>
#include <QInputDialog>

class Form1 : public QMainWindow
{
    Q_OBJECT

public:
    explicit Form1(QWidget *parent = 0) : QMainWindow(parent) // Stuff to draw the window
    {
        centralWidget  = new QWidget(this);
        verticalLayout = new QVBoxLayout(centralWidget);
        Button1        = new QPushButton(centralWidget);
        label1         = new QLabel(centralWidget);

        Button1->setObjectName(QString::fromUtf8("Button1"));
        Button1->setText(QApplication::translate("Form1", "Push me", 0, QApplication::UnicodeUTF8));

        verticalLayout->addWidget(Button1);
        verticalLayout->addWidget(label1);

        this->setCentralWidget(centralWidget);

        QMetaObject::connectSlotsByName(this);
    }

private slots:
    void on_Button1_clicked()
    {
        Numberhidden = rand() % 100 + 1;
        Numberguess  = QInputDialog::getInteger(this, "", "Please enter your first guess", 50, 1, 100);

        while (Numberhidden != Numberguess && mycounter < 5)
        {
            if (Numberhidden > Numberguess)
                Numberguess = QInputDialog::getInteger(this, "", "Try a higher number, and enter your new guess", 0, 1, 100);
            else if (Numberhidden < Numberguess)
                Numberguess = QInputDialog::getInteger(this, "", "Try a lower number, and enter your new guess", 0, 1, 100);

            ++mycounter;
        }

        if (Numberhidden == Numberguess)
            label1->setText("You guessed it correct");
        else
            label1->setText("You have run out of opportunites");
    }

private:
    QWidget*     centralWidget;
    QVBoxLayout* verticalLayout;
    QPushButton* Button1;
    QLabel*      label1;

    int Numberhidden;
    int Numberguess;
    int mycounter = 0;
};

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Form1 w;
    w.show();
    
    return a.exec();
}

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка unhandled exception occurred see log for details dead air
  • Ошибка unhandled exception occurred see log for details call of chernobyl