Skip to content
  • 0 Votes
    5 Posts
    5k Views
    Tom NaerlandT
    @krzaq I'm surprised anything changed at all with the c++14 flag. Are you using 5.6.0-rc ? In my caseCONFIG += c++11 c++14 doesn't seem to do anything at all when compiling to Android. I'm using 5.6.0-rc and with CONFIG += c++11 c++14 I'm just getting -std=c++11. With Qt 5.5.1 CONFIG += c++11 c++14 I get -std=c++1y added to the mix and I can use relevant functionality (std::make_unique).
  • 1 Votes
    11 Posts
    7k Views
    kshegunovK
    @alex_malyu The original post is some 2 months old. So I wrote a whole lot of a post in reply to the original question ... well didn't my ears burn, when I noticed the post time ... I felt like a complete idiot. :)
  • Integrating QtQuick with c++ code

    Solved QML and Qt Quick qtquick c++11
    9
    0 Votes
    9 Posts
    4k Views
    C
    I went on #qt-quick on free node, and w00t helped me. Here's the fixed code: test.h: #ifndef TEST_H #define TEST_H #include <QObject> class Test : public QObject { Q_OBJECT Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) public: explicit Test(QObject *parent = 0); QString text() const; void setText(QString txt); signals: void textChanged(); public slots: void testSlot(); protected: QString m_text = "Default String"; }; #endif // TEST_H test.cpp: #include "test.h" #include <QDebug> using namespace std; Test::Test(QObject *parent) : QObject(parent) { } void Test::testSlot() { qDebug() << "Test::testSlot called" << endl; this->setText("test slot called"); } QString Test::text() const { return this->m_text; } void Test::setText(QString txt) { this->m_text = txt; emit textChanged(); } main.cpp: #include <QApplication> #include <QQmlApplicationEngine> #include <QtQml> #include <test.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); QQmlApplicationEngine engine; Test t; engine.rootContext()->setContextProperty("Test", &t); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); QObject *item = engine.rootObjects().at(0); QObject::connect(item, SIGNAL(buttonPressed()), &t, SLOT(testSlot())); return app.exec(); } main.qml: import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Dialogs 1.2 ApplicationWindow { id: mainWindow visible: true width: 640 height: 480 title: qsTr("Hello World") signal buttonPressed(); menuBar: MenuBar { Menu { title: qsTr("File") MenuItem { text: qsTr("&Open") onTriggered: console.log("Open action triggered"); } MenuItem { text: qsTr("Exit") onTriggered: Qt.quit(); } } } MainForm { anchors.fill: parent button1.onClicked: block.text = "prev clicked" button2.onClicked: mainWindow.buttonPressed() block.text: Test.text } MessageDialog { id: messageDialog title: qsTr("May I have your attention, please?") function show(caption) { messageDialog.text = caption; messageDialog.open(); } } } Thanks everyone!
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    10 Posts
    4k Views
    D
    @DRivkin anyone interested can send an email to jobs@next.audio and I can take it from there.
  • 0 Votes
    4 Posts
    3k Views
    K
    Thx so much @kshegunov , I had Q_OBJECT in abstract class, but I forgot to put it as well in derived class. This solve my problem :) As a side note: I saw several times in the forums here that people are not declaring their overrides as virtual, this is syntactically correct, but I would suggest doing it (makes the code more readable) or even better is to use C++11's override specifier. Thx for this tip so much, I like this kind of notes which helps me improve the code. Yeah you're ride it looks more readable right now :) Parent public slots: virtual void itemToAdd(AbstractFood* item)=0; Child: public slots: void itemToAdd(AbstractFood* item) override; void pizzaToCustomize(Pizza *pizza); and we exactly know what was overriden from parent. Many thx
  • Accordion Widget for Qt5

    Unsolved Showcase qt5 accordion cmake c++11
    4
    2 Votes
    4 Posts
    9k Views
    S
    This is great!, but is there any implementation in Python, not C++? Or, how can I port it in Python, pyqt5? Thanks in advance for your help. Cheers,
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • Should I be concerned about "is a C++11 extension"?

    Solved General and Desktop c++11 compiler
    6
    0 Votes
    6 Posts
    11k Views
    M
    @mcosta I'm using the XCode on OSX in this case.
  • The problem of QtCreator on win

    General and Desktop qtcreator qt5.4 msvc13 c++11
    23
    0 Votes
    23 Posts
    13k Views
    J
    @SGaist No warning from the setup interface, now use the MinGW are all normal
  • 0 Votes
    4 Posts
    2k Views
    K
    Just added a bug report to JIRA Apparently in the previous forum a similar error had been reported but this is already closed.
  • Looking for a remote job

    Jobs c++ c++11
    1
    0 Votes
    1 Posts
    934 Views
    No one has replied
  • 0 Votes
    9 Posts
    9k Views
    J
    @Chris-Kawa Hi, Mr. Chris-Kawa. Yes, I had enabled the c++11 by adding QMAKE_CXXFLAGS += -std=c++11 into my .pro file, so this isn't the real problem. Finally my code has passed the compiling, by adding ## as the prefix of macro __VA_ARGS__. I think there are multiple errors in my first version of code that bothered me and covered the real problem : In struct RuntimeClass, I took a return type to the member pointer of function which is different with the function I filled to that member; In class TestClass , I didn't declare the member function TestFunc as static. This cause the member function has a different type with RuntimeClass::m_pfnFunction, and make compiler report error on filling it into instance of RuntimeClass In the macros DECL_RUNTIMECLASS and IMPL_RUNTIMECLASS, I didn't prefix macro __VA_ARGS__ with ##. This make a redundant comma be left in template parameter list after macro expansion, which will cause the compiling error of template argument 2 is invalid. The source code you corrected notified me the above two problems. And with your selfless help I finally sovled the compiling error in my design! Thank you very much !
  • 0 Votes
    7 Posts
    3k Views
    sierdzioS
    @blazar said: BTW, is that I need to register another account for bugreport only? Separate from forum account? I'm not sure what is the current status. Previously, you needed separate accounts for pretty much all Qt services (Qt Account, forum account, JIRA account, etc.). The plan is to unify all those logins under a single one (Qt Account). This is already done for the forum, but seemingly the bugtracker is not there yet. If you want to know more, Tero Kojo probably has detailed information, he is one of the admins and is employed by Qt Company to update the various web services, as far as I am aware.
  • 0 Votes
    12 Posts
    5k Views
    G
    maybe you should also try finding the problem (in the release version) the old fashion way: just place cout<<"line X" statements here and there and pinpoint the line where the problem occurs
  • 0 Votes
    2 Posts
    2k Views
    JKSHJ
    @shavera said: I'd suggest adding these kind of constructions into the documentation, given their utility. They are :-) Scroll to the bottom of http://doc.qt.io/qt-5/qtconcurrentmap.html But what other ways might one use member functions within QtConcurrent? The examples provided make use of global functions which are a little trivial to extend. See the same link
  • 0 Votes
    3 Posts
    2k Views
    D
    @Chris-Kawa Ubuntu 14.04 x64, gcc 4.9.2 UPD: if I set clang as code completion tool - everything works, but slow.