Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Hi how to get standalone exe in qt?

    5
    0 Votes
    5 Posts
    11k Views
    G
    And please, do yourself a favor and grab the plain sources from the "download pages":http://qt.nokia.com/downloads/downloads#qt-lib (the source code is linked in the 2nd paragraph). Do not try to recompile the libs from the SDK or any prebuilt binary package!
  • [Solved]Hide Applicationfrom Application Bar

    5
    0 Votes
    5 Posts
    5k Views
    G
    If you need to hide the app from the menu bar, the wiki article "OS X application without menu bar":http://developer.qt.nokia.com/wiki/OS_X_application_without_menu_bar provides you with a recipe.
  • How to disable the automatic selectioning in a QGraphicsscene? [Solved]

    5
    0 Votes
    5 Posts
    5k Views
    M
    Be sure and edit the title of your post to add [Solved]. Thanks!
  • [Resolved] Strange Hover-Only transparency losing effects on a button

    2
    0 Votes
    2 Posts
    3k Views
    R
    Turns out that while @setAttribute(Qt::WA_NoSystemBackground);@ is good enough for OS X... On windows you should also add: @setAttribute(Qt::WA_TranslucentBackground);@ That took care of it.
  • 2 QTcpSockets (1 reads another writes) in 2 applications doesn't work

    10
    0 Votes
    10 Posts
    4k Views
    A
    u can also have one server and 2 clients if u strictly wish to use 2 clients its really better to first understand the fortune examples very well
  • [SOLVED] QDir setNameFilter problem, it does not filter

    3
    0 Votes
    3 Posts
    3k Views
    E
    It is worked, thanks
  • 0 Votes
    8 Posts
    11k Views
    A
    Your last reply in that tread was "OK, I will try that". How is that "not getting a useful answer"? Anyway, please continue the discussion on this issue in that topic, not here.
  • Write/read to the same object, multiThreading

    7
    0 Votes
    7 Posts
    4k Views
    K
    another option may be "QReadWriteLocker":http://doc.qt.nokia.com/4.7/qreadwritelock.html if this is your "problem":http://en.wikipedia.org/wiki/Readers-writers_problem
  • How to set focus to a combo box on a key press event?

    8
    0 Votes
    8 Posts
    15k Views
    S
    When I modify your example so that it is complete and I also set focus to the mainwindow, then it takes alpha-numeric keys. Is it for your comboboxes or for your mainwindow you don't receive the keys? If the example below does not give you the behavior you need, then can you make sure to send a complete example that can be run so that I can see the exact problem you are having? @ #include <QtGui> class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow() { setFocusPolicy(Qt::StrongFocus); QWidget *wid = new QWidget(this); box1 = new QComboBox(wid); box2 = new QComboBox(wid); setCentralWidget(wid); box1->addItem("First"); box1->addItem("Second"); box2->addItem("Third"); box2->addItem("Fourth"); QVBoxLayout *layout = new QVBoxLayout(wid); layout->addWidget(box1); layout->addWidget(box2); } protected: void keyPressEvent(QKeyEvent *e) { qDebug() << "In keypress event"; switch(e->key()) { case Qt::Key_Enter: case Qt::Key_Return: qDebug() << "Its enter"; break; case Qt::Key_Shift: qDebug() << "Shift key \n"; break; case Qt::Key_A: qDebug() << "A"; break; default: qDebug() << "Not a valid key press\n"; } QMainWindow::keyPressEvent(e); } private: QComboBox *box1; QComboBox *box2; }; #include "main.moc" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.setFocus(); w.show(); return a.exec(); } @
  • Understanding QTouchEvent

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • MdiArea

    3
    0 Votes
    3 Posts
    3k Views
    A
    MDI windows are almost always meant to be resized. So like Franzk says: best is to make sure you handle that case. Anyway, what happens if you modify your code like this: @ MyWidget * w=new MyWidget(this); QMdiSubWindow* subwindow = ui->mdiArea->addSubWindow(w); w->show(); subwindow->setGeometry(subwindow->geometry().x(),subwindow->geometry().y(),348,500); @ Note that you will probably need to adjust the size a bit, because the style adds borders. This size will be different per style, so you will have to figure out the adjustment in some dynamic way.
  • [Solved] Changing rootpath of directory model in combo box.

    6
    0 Votes
    6 Posts
    6k Views
    T
    Awesome! Thanks!
  • Set QWidget to be "unmovable"

    4
    0 Votes
    4 Posts
    4k Views
    ?
    I'd take a look into the Widgets > Window Flags Qt example. Or try the cheap solution: when the user orders moving the window, move it back to the original position XD. Anyway, good luck! PS: also, I think it's possible to avoid movement via OS -Linux, that is-... --
  • Mac, running Qt in debug mode always drops me into assembler code?

    5
    0 Votes
    5 Posts
    3k Views
    M
    I got this problem few days ago What I did is just choose the Debug version and clean the project then build it again. Without cleaning the project I got what you said assembly code. I hope you can try it and notify us
  • Cut ,paste options for graphics rectitems

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • I can't find the Example Demos

    27
    0 Votes
    27 Posts
    24k Views
    E
    Hi, I have the all examples, demos and qtdemo compiled successfully (with some tricks) in ubuntu. When I lunch the the qtdemo binary in "QtSdk\Demo\bin" directory I see the list of programs available but I cannot lunch them. I get the error "Could not lunch the example, ensure that it is built". I am sure that they are compiled, I can lunch them manually from their source directories. Also the descriptions are missing. I see the warning "Could not load description. Ensure that documentation for Qt is built". I have this problem both in the versions 4.7.3 and 4.7.4. I have this problem also in the windows environment. Any ideas about this?
  • How to insert 1 000 000 rows in MySQL Server 5.5 quickly with Qt

    2
    0 Votes
    2 Posts
    6k Views
    L
    You do not execute your query one million times, you bind the values one million times and execute your query just once. Besides that your example works fine for me. Be aware that you will have to prepare your database before inserting such a large amount of data (setting up apropriate caching, disable indexing and so on).
  • How to call a slot of button class when a window is closed ?

    5
    0 Votes
    5 Posts
    3k Views
    P
    ok i will try that
  • Regarding reading CSV file

    7
    0 Votes
    7 Posts
    9k Views
    P
    Maybe this will help: http://libqxt.bitbucket.org/doc/tip/qxtcsvmodel.html
  • Regarding accessing command line arguments

    2
    0 Votes
    2 Posts
    2k Views
    ZlatomirZ
    Create a public function (member of the "widget" class that contains the ui) that takes a QString and set it as the QLabel text and call the widget's member function from main.