Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • [SOLVED] Possible security threat in Qt 5.3.2 installer?

    3
    0 Votes
    3 Posts
    1k Views
    X
    Thank you for the feedback. In fact, my system works pretty well (no memory issues). I just wanted to discard any risk :)
  • 0 Votes
    5 Posts
    5k Views
    JeroentjehomeJ
    No, you have to implement/overwrite the setHeaderData your self and store the information in your model.
  • Get the instance when a window is closed

    1
    0 Votes
    1 Posts
    450 Views
    No one has replied
  • What is the format of the data saved by QMainWindow::saveState()?

    4
    0 Votes
    4 Posts
    2k Views
    JKSHJ
    Hi, It's a custom binary format. You can examine the source code here to see how the byte stream is constructed: http://code.woboq.org/qt5/qtbase/src/widgets/widgets/qmainwindow.cpp.html#_ZNK11QMainWindow9saveStateEi The code browser is interactive. Click on the functions to jump to their definitions. (You will eventually find QToolBarAreaLayout::saveState() and QDockAreaLayout::saveState() which do the writing. These are internal classes, so they are undocumented)
  • How to create desktop componet for Qt Creator?

    3
    0 Votes
    3 Posts
    743 Views
    R
    Yes, that's right Thank andrey
  • [solved] Class object in mainwindow.h

    13
    0 Votes
    13 Posts
    3k Views
    S
    Oh man! Thank you . really thanks a lot. you are a saviour!! it works now.
  • How to stop a command that is taking a long time?

    3
    0 Votes
    3 Posts
    814 Views
    ealioneE
    Hey sierdzio, This command is simply db.open() for a new database. In case there is something wrong with the credentials for example it may take up to 30 seconds just staying there trying to connect. thread.quit() did nothing for me and I am not sure I want to use terminate() as I am not a brave man. The last suggestion won't help because it is not a mater of informing the worker that I went to stop, but the act of stoping itself.
  • QGraphicsItem mouse Press event return

    3
    0 Votes
    3 Posts
    2k Views
    D
    HI thanx for the replay. It got me thinking and solved it in a way :). As far did I only added singles that can be emitted white parameters. is there some ware a list of mouse events that i can use for a QGraphicsItem. Like : right mouse button pressed. moved into QGraphicsItem. moved out QGraphicsItem. so this is my square.cpp now @#include "square.h" square::square(int x, int y, QGraphicsObject *parent) : QGraphicsObject(parent) { Pressed = false; setFlag(ItemIsSelectable); X = x; Y = y; } QRectF square::boundingRect() const { return QRectF(X,Y,30,30); } void square::mousePressEvent(QGraphicsSceneMouseEvent *ev) { Pressed = true; update(); QGraphicsItem::mousePressEvent(ev); emit Mouse_Pressed(X,Y); } void square::mouseReleaseEvent(QGraphicsSceneMouseEvent *ev) { Pressed = false; update(); QGraphicsItem::mousePressEvent(ev); emit Mouse_Released(X,Y); } void square::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { QRectF rec = boundingRect(); QBrush brush(Qt::blue); if(Pressed) { brush.setColor(Qt::red); } else { brush.setColor(Qt::blue); } painter->fillRect(rec,brush); painter->drawRect(rec); }@ and mij Dialog.cpp looks like. @#include "dialog.h" #include "ui_dialog.h" #include "square.h" #include <QLabel> Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); LineCounter = 0; for (int i = 0; i < 25; ++i) { if (i==0){ Hoog = i*30; } else { Hoog = Hoog +30; } if (LineCounter == 5){ links = links+30; Hoog = 0; LineCounter = 1; } else{ LineCounter = LineCounter +1; } sq = new square(links,Hoog); scene->addItem(sq); connect(sq,SIGNAL(Mouse_Pressed(int,int)),this,SLOT(Mouse_Pressed(int,int))); connect(sq,SIGNAL(Mouse_Released(int,int)),this,SLOT(Mouse_Released(int,int))); } } Dialog::~Dialog() { delete ui; } void Dialog::Mouse_Pressed(int x,int y) { ui->label->setText(QString("Pressed X= %1, Y= %2 ").arg(x).arg(y)); } void Dialog::Mouse_Released(int x, int y) { ui->label->setText(QString("Released X= %1, Y= %2 ").arg(x).arg(y)); }@
  • How to promote with a Open Source Licensing?

    2
    0 Votes
    2 Posts
    612 Views
    sierdzioS
    I can see you do not understand what Free means in Free Software. That word there is about the freedom of the users of your software. This is not about cost at all. You can sell your software without any legal problems, and you are not required to restrict yourself to "small price". I'll try explaining the details in a simple manner, although it is not so easy. In general, you have 2 options: GPL or LGPL license for Qt. If you choose GPL: your application needs to be GPL, too you can sell your product you can use static linking of Qt into your application you have to distribute the source code to your clients on request (and they can distribute it, too) you do not need to publish the source code to everybody - you can if you want to, but it is not a requirement If you choose LGPL: you can choose any license for your own source code (that is, your application can even have a commercial license) you can sell your product you cannot use static linking of Qt into your application you need to inform your clients that Qt is being used (in readme, some about box, etc.), provide it's license and allow them to swap the libraries for their own you do not need to give your source code to anybody (depends on which license you choose for your own sources) Of course, there are many more details to this, and the lawyers always have the final word here, but it should give you a base to refer to.
  • [SOLVED]Custom QGraphicsItemGroup: boundingRect is not drawn properly

    9
    0 Votes
    9 Posts
    4k Views
    V
    OK, let's consider it a bug. Thanks for your reply!
  • Qt app auto-update alternatives

    3
    0 Votes
    3 Posts
    3k Views
    C
    Thanks, looks like another alternative. I'm already integrating Sparkle/WinSparkle. Thanks for the information!
  • How to find other machine's IP Address in Qt ??

    8
    0 Votes
    8 Posts
    2k Views
    A
    Hi andreyc!! Thank u for your reply. As your suggestion, I am searching for mayne library on Windows. Will you please provide me the link for mayne libary. Thank you.
  • Header prototype mistake .. any help?

    6
    0 Votes
    6 Posts
    1k Views
    S
    could you please correct me the code mistake because i can not do it and i gave up ..
  • Modal dialogs not working on Android

    1
    0 Votes
    1 Posts
    853 Views
    No one has replied
  • Slots for main.cpp

    4
    0 Votes
    4 Posts
    6k Views
    SGaistS
    The header is not enough you need to have an instance of the class you want to use. By the way, button being never deleted you have a memory leak. Then why the private slot if you want to access it from outside of the class. Note that slots should not have a return value.
  • Updating QTableWidget

    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    row is a static variable. as well as column and columnNumber. By the way, why ?
  • QSplitter Styling

    2
    0 Votes
    2 Posts
    864 Views
    SGaistS
    Hi, AFAIK, you'd have to update the style when you start/stop moving using e.g. the mouseMouve function. Hope it helps
  • 0 Votes
    3 Posts
    1k Views
    SGaistS
    Hi, To embed the search field in your application you can have a look at QMacCocoaViewContainer which provides an example exactly with that widget. Can you give more detail about what you are trying to do with the buttons ?
  • Very simple files scroller window

    Locked
    2
    0 Votes
    2 Posts
    554 Views
    SGaistS
    Hi, Please don't post the same thread in multiple sub forum, one is enough. "Duplicate":http://qt-project.org/forums/viewthread/51094/
  • Editor for QAbstractTableModel closes prematurely

    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    What kind of widget is your QpxPatternEditor ?