Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • Windows Service with QT Gui and Tray Icon

    6
    0 Votes
    6 Posts
    7k Views
    M
    Thanks for your reply, i was looking something for IPC that's better then my "loopshit" and i think Named Pipes would be the best for me. Now i just need to create the IPC with the two processes. Thanks for your help, mr_einsa
  • Non-static plugin segmentation error

    3
    0 Votes
    3 Posts
    2k Views
    W
    hello mlong, thanks for the reply! the error occours when i emit a virtual funktion of my interface class. that happens only if i have more than one .dll in my plugins folder. if i have only one .dll plugin in it exactly this virtual funktion works perfect. i have tried it with the plug & paint example and there i have the same error if i build a second plugin. this is my interface: @#ifndef HERBERTPLUGINTERFACE_H #define HERBERTPLUGINTERFACE_H #include <QString> #include <QtCore> #include <QMainWindow> class HerbertplugInterface { public: virtual ~HerbertplugInterface() {} virtual QString echoherbertplug(const QString &messageHerbert) = 0; }; Q_DECLARE_INTERFACE(HerbertplugInterface,"com.quins.QuinsMaster.HerbertplugInterface/1.0") #endif // HERBERTPLUGINTERFACE_H@ and here my pro file of the plugin: @QT += core gui sql TEMPLATE = lib CONFIG += plugin INCLUDEPATH += ../Test HEADERS += herbertPlugin.h SOURCES += herbertPlugin.cpp TARGET = $$qtLibraryTarget(herbertplug) DESTDIR = ../plugins FORMS +=@
  • Best practice for passing pointers as sender for async signals

    6
    0 Votes
    6 Posts
    13k Views
    L
    [quote author="Rebell" date="1334246541"]QNetworkAccessManager::finished() also passes heap objects without being tracked by a shared pointer, isn't it? How is reply getting managed when I dont call deleteLater().[/quote]It isn't. If you don't delete the reply you are leaking memory. [quote author="Rebell" date="1334246541"]What should I do, when I want to pass a smart pointer and I dont know, if this object already got referenced counted by another shared pointer.[/quote]There is basically nothing you can do. It is your responsibility as the developer to define the lifetime of objects, who creates them, who deletes them and wheter you are using smart pointers to do (a part of) this job for you. If an object created by you leaves your authority you either have to let it leave as a smart pointer (as in your example) so that it is clear that this object is managed by a smart pointer or you document the lifetime of the object and who is responsible for deleting it. [quote]"QNetworkAccessManager":http://qt-project.org/doc/qt-4.8/qnetworkaccessmanager.html#details ... Note: After the request has finished, it is the responsibility of the user to delete the QNetworkReply object at an appropriate time. Do not directly delete it inside the slot connected to finished(). You can use the deleteLater() function. ...[/quote]
  • 0 Votes
    7 Posts
    8k Views
    Y
    Thanks for help. I can solve the problem with your advice, RaubTieR. This is the right source code. Menuadm.h @ #ifndef MENUADM_H #define MENUADM_H #include <QMainWindow> #include <menudaftar.h> namespace Ui { class MenuAdm; } class MenuDaftar; //add this code class MenuAdm : public QMainWindow { Q_OBJECT public: explicit MenuAdm(QWidget *parent = 0); MenuDaftar *objmain7; ~MenuAdm(); private slots: void btnaction6(); private: Ui::MenuAdm *ui; }; #endif // MENUADM_H @ Menudaftar.h @ #ifndef MENUDAFTAR_H #define MENUDAFTAR_H #include <QMainWindow> #include <menuadm.h> namespace Ui { class MenuDaftar; } class MenuAdm; //add this code class MenuDaftar : public QMainWindow { Q_OBJECT public: explicit MenuDaftar(QWidget *parent = 0); MenuAdm *objmain; //this is an error ~MenuDaftar(); private slots: void btnaction(); private: Ui::MenuDaftar *ui; }; #endif // MENUDAFTAR_H @
  • Facing performance issue with QGraphicsScene and QGraphicsview

    4
    0 Votes
    4 Posts
    3k Views
    A
    What resolution does your screen have, if you need to draw over 80000 line segments? You can probably reduce the number of lines actually drawn quite a bit, without changing a single pixel in the resulting screen output.
  • Object::connect: No such slot QGroupBox::lcs_slot(bool)

    6
    0 Votes
    6 Posts
    4k Views
    A
    Never alter the generated ui_*.h files. From the top of my head, there is even a warning at the top of this file to tell you so. The file will be overwritten the next time you build the application... You can solve this by making the connection in the extensionDlg.cpp file, right after your setupUi() call.
  • How to make a label mouse selectable

    5
    0 Votes
    5 Posts
    7k Views
    A
    You can call: @ theLineEdit->setFrame(false); @ Then, you could also make it disabled. However, that will make the text look greyed out too, so you'd have to eiter set the palette or a style sheet. All in all, I think the QLabel::setTextInteractionFlags() is an easier and better solution.
  • ActiveQt and MVC pattern

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    2 Posts
    4k Views
    V
    Figured out the cause for Runtime Error!! I was build a debug version but executing the application with Qwt release dll. When I build release version and execute it with Qwt release dll, everything this fine and I could see the Qwt Plot
  • Accesing mainWindow variable in a Dialog Window

    6
    0 Votes
    6 Posts
    4k Views
    V
    bq. tanny007 wrote: i took the input filename in the MainWindow,but i wanted to access the filename in the dialog Window as well How did you get the file name? If it isn't a property of Parent (that too a public property), then I guess you might not access as you did @ui->lineEdit->insert(parent->fileName);@ Easiest way would be to pass the file name to Dialog ~veeraps
  • How us qunicodetables.cpp generated?

    1
    0 Votes
    1 Posts
    827 Views
    No one has replied
  • How can we simulate a mousemoveEvent

    2
    0 Votes
    2 Posts
    2k Views
    M
    Look at "postEvent":/doc/qt-4.8/qcoreapplication.html#postEvent and "sendEvent":/doc/qt-4.8/qcoreapplication.html#sendEvent in the QCoreApplication documentation.
  • QGraphicsView - how to organize scene and items

    11
    0 Votes
    11 Posts
    5k Views
    M
    I defined the struct as: @class Joystick : public QObject, public QGraphicsEllipseItem { Q_OBJECT public: Joystick(int posx, int posy, int radiusvalues, bool fixX=false, bool fixY=false); private: signals: void updateSticks(int x, int y); public slots: void updatedSticks(int t, int y); };@ @Joystick::Joystick(int x, int y, int radiusLimitParam, bool fixX, bool fixY) : QGraphicsEllipseItem(0, 0, 100, 100) { //... //do stuff //... stick = new StickItem(this, fixX, fixY); }@ @class StickItem : public QObject, public QGraphicsEllipseItem { Q_OBJECT public: Stick( QGraphicsItem * parent = 0, bool fixX=false, bool fixY=false); private: signals: void updateSticks(int x, int y); };@ @int main(int argc, char **argv) { QGraphicsScene scene; QGraphicsView view(&scene); left = new Joystick(/*...*/) right = new Joystick(/*...*/) scene.addItem(left); scene.addItem(right); //... //do stuff //... return app.exec&#40;&#41;; }@ My last doubt (I hope lol) is how I should set the Joystick position and size instead of use the fix values? Instead of QGraphicsEllipseItem(0, 0, 100, 100) can I create it with all zeros, and after set the position and size? something like: @Joystick::Joystick(int x, int y, int radius, bool fixX, bool fixY) : QGraphicsEllipseItem(0, 0, 0, 0) { this.setRect(x,y,radius,radius) //... //do stuff //... stick = new StickItem(this, fixX, fixY); }@ To change the height and width of the ellipse it is normal to use setRect?
  • 0 Votes
    4 Posts
    3k Views
    A
    You could just put them both inside another widget, and put them in a layout together...
  • Swipe in Listview

    5
    0 Votes
    5 Posts
    4k Views
    A
    Perhaps this can be an inspiration? http://labs.qt.nokia.com/2008/11/15/flick-list-or-kinetic-scrolling/
  • Using standard local socket code with QLocalServer

    2
    0 Votes
    2 Posts
    2k Views
    L
    after messing around a bit, I did get this to work. my initial coding attempt must have had an error. a standard linux PF_LOCAL socket can connect to a Qt QLocalServer
  • Excel Groups with Qt

    10
    0 Votes
    10 Posts
    4k Views
    O
    Understood
  • Inverting mask example

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    8 Posts
    5k Views
    I
    qRegisterMetaType() registers type with namespace prefix, if any. You can't change it. qRegisterMetaType (const char *typeName) allows to set particular name, so you can register type w/o namespace prefix
  • Anchor layout QGraphicsView

    11
    0 Votes
    11 Posts
    5k Views
    T
    I just moved to this "thread":http://qt-project.org/forums/viewthread/16310/.