Search Results

Search found 4 results on 1 pages for 'olorin'.

Page 1/1 | 1 

  • Python repl in python application

    - by Olorin
    Hello i am learning python(so i can use qt with python not only c++) and i'm curios if it would be possible to embed a python interpreter in my application as a repl. I would like to give users to possibility to script the app using python either loading a file (and that file to act as a plugin for the app) or by evaluating code entered in a text box or something like that. Just like you can embed the interpreter in C or C++ and script the app using python can this be done if the application is itself written in python(and made a stand-alone binary using py2exe or something similar)? something like Anders did with the C# repl or Miguel with mono. Thanks.

    Read the article

  • QObject cloning

    - by Olorin
    I know that Qobjects are supposed to be identities not values eg you cannot copy them and by default the copy constructor and asignment are disabled as explained in qt documentation. But is it possible to create a new Qobject from an existing one using a clone method? Would this be a logic error ? If i say QObject b; QObject a; b.cloneFrom(a); or QObject a = new QBject(); QObject b = new QBject(); b->cloneFrom(a); and the clone method copyes stuff like members etc would this be wrong? And if this is ok can i write my own copy constructor and asignment operator that does just that? Note: i actually want to try this with classes that inherit qobject.

    Read the article

  • Qt Graphics Scene mouse event propagation

    - by Olorin
    hello i'm learning qt and i'm doing the folowing to add some widgets to a graphics scene void MainWindow::addWidgets(QList<QWidget *> &list, int code) { if(code == CODE_INFO) { QWidget *layoutWidget = new QWidget(); QVBoxLayout *layout = new QVBoxLayout(); foreach(QWidget *w, list) { layout->addWidget(w); this->connect(((ProductInfo*)w), SIGNAL(productClicked()), this, SLOT(getProductDetails())); } layoutWidget->setLayout(layout); this->scene->addWidget(layoutWidget); } } my ProductInfo class processes mouse release and emits a signal void ProductInfo::mouseReleaseEvent(QMouseEvent *e) { QWidget::mouseReleaseEvent(e); emit productClicked(); } the problem is after adding the widgets to the scene they no longer get the mouse release event and don't emit productClicked signal but if i add them to the main window(not to the scene) they work as expected. What am i doing wrong?

    Read the article

  • C++ function overloading and dynamic binding compile problem

    - by Olorin
    #include <iostream> using namespace std; class A { public: virtual void foo(void) const { cout << "A::foo(void)" << endl; } virtual void foo(int i) const { cout << i << endl; } virtual ~A() {} }; class B : public A { public: void foo(int i) const { this->foo(); cout << i << endl; } }; class C : public B { public: void foo(void) const { cout << "C::foo(void)" << endl; } }; int main(int argc, char ** argv) { C test; test.foo(45); return 0; } The above code does not compile with: $>g++ test.cpp -o test.exe test.cpp: In member function 'virtual void B::foo(int) const': test.cpp:17: error: no matching function for call to 'B::foo() const' test.cpp:17: note: candidates are: virtual void B::foo(int) const test.cpp: In function 'int main(int, char**)': test.cpp:31: error: no matching function for call to 'C::foo(int)' test.cpp:23: note: candidates are: virtual void C::foo() const It compiles if method "foo(void)" is changed to "goo(void)". Why is this so? Is it possible to compile the code without changing the method name of "foo(void)"? Thanks.

    Read the article

1