Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • [SOLVED] [N00b] Memory management in Qt

    12
    0 Votes
    12 Posts
    11k Views
    M
    bq. In that case, I’ll be careful to always declare a parent. Seems like the easiest solution. And, if you do ever delete anything manually, be sure to set the pointer to 0 after the call to delete. It's a good, safe practice.
  • [solved]QRegExp

    6
    0 Votes
    6 Posts
    4k Views
    S
    While I think @"[0-9a-fA-F]{2},[0-9a-fA-F]{2},[0-9a-fA-F]{2}"@ will be a better choice, your expression works for me with Regexp and Regexp2 syntaxes. Setting greedy mode to on means set minimal to of...;) you should: @ re.setMinimal(false); @
  • 0 Votes
    3 Posts
    5k Views
    L
    You have to manually hide the tray icon (for example at the closeEvent of the main window). @ void MainWidget::closeEvent(QCloseEvent* event) { _systemTrayIcon->hide(); event->accept(); } @ ... will do the trick.
  • Qt 4.8 (origin/master) documentation for src/plugins/platforms/*

    5
    0 Votes
    5 Posts
    4k Views
    K
    uhm ok thanks :)
  • Qml, anchors and rotating

    5
    0 Votes
    5 Posts
    4k Views
    S
    no, it is not scaling, but rotating...
  • Convert from int to hex

    4
    0 Votes
    4 Posts
    28k Views
    Z
    @ lineEdit_7->setText( QString::number( c.red(), 16 ) ); @
  • QTcpServer, QAbstractSocket

    13
    0 Votes
    13 Posts
    9k Views
    G
    Both applications just open a server listening on ports 9999 and 10000. None of the applications is actually trying to connect to a server. As koahnig already pointed out, have a look at the fortune server app, it demonstrates what you want.
  • QtGUI::QApplication and QtCore::QCoreApplication::init() ?

    9
    0 Votes
    9 Posts
    7k Views
    G
    No. All QApplication constructors call a QCoreApplication constructor which in trun calls init(). qt_startup_hook is implemented in qcoreapplication.cpp - I don't know how one is supposed to replace the object code for that with one's own version. It does not help to make a [[Doc:QApplication]] or [[Doc:QCoreApplication]] subclass, as qt_startup_hook is an extern "C" function and therefore is not subject to method polymorphism!
  • 64bit osx (part II) linking

    6
    0 Votes
    6 Posts
    4k Views
    G
    If you do not setup anything, then the default name mangling is used. If you have a C library that is usesful from C++ as well, it is good practice to put that extern stuff into the header of your libraray. The usual pattern is: @ #ifdef __cplusplus extern "C" { #endif // your actual header files goes here #ifdef __cplusplus } #endif @ See the "C++ FAQ on 'How to mix C and C++'":http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html for some more details. Unfortunately there is no easy way to tell if the header has the "extern" other than actually looking into it.
  • QFutureWatcher, signal paused()

    3
    0 Votes
    3 Posts
    3k Views
    M
    UUps, I wrote some slots not correct, so they didn't exist of course. Now I fixed it, and I get the paused signal. But now I'm totally confused, because it is very late. My output is now: Action: Click Start and wait some seconds. Output: Item 0 ready. (ok), Item 1 ready. (ok) Action: pushbutton_2(Pause) clicked first time Output: no output???? Action: wait some secs. Output: no output, calculation seems to be stopped (ok) Action: pushbutton_2(Pause) clicked second time Output: resumed (ok), paused (why now?) Action: wait some secs. Output: Item 2 ready, Item 3 ready (ok, calculation is running)
  • Changing the height of the tabbar in a qtabwidget

    3
    0 Votes
    3 Posts
    5k Views
    S
    You can also try using "QApplication::setGlobalStrut()":http://doc.qt.nokia.com/latest/qapplication.html#globalStrut-prop. This sets the minimum size a widget can be, and is helpful when making an application more touch screen friendly.
  • Jalali calender

    12
    0 Votes
    12 Posts
    7k Views
    S
    Ok. I'm going to write without QObject. thanks
  • Is it possible to delay load QtGui4.dll in Windows?

    18
    0 Votes
    18 Posts
    14k Views
    F
    Thanks guys, I would like to write a proxy to wrap my plugin. I think it would be the easiest way to solve my problem.
  • Transparent Window in kde

    3
    0 Votes
    3 Posts
    4k Views
    G
    reopened due to user request
  • [SOLVED] Eliminating main window transition (resize) "jump"

    4
    0 Votes
    4 Posts
    2k Views
    L
    Glad I could help, also could you add [Solved] in front of the title of this thread (by editing the first post)?
  • QGridLayout max column width

    3
    0 Votes
    3 Posts
    11k Views
    EddyE
    Do you want to distribute your program to others? Or are you the only one that is going to use it? I guess not. In the first case you should consider the fact that others might want to use other fonts, and even bigger fonts. If your column width is not big enough for the bigger font you won't see it all. The purpose of Qt's layout system is to adapt automatically in this case. That's the reason why QGridLayout only has setMinimumColumnWidth and no similar function for maximum width. What you can do is use a widget for which you use setminimumsizehint. That way your column will adapt to the necessary space required to show that widget.
  • Translating after QSetting is used to determine last state

    7
    0 Votes
    7 Posts
    4k Views
    S
    In the "Application Output" panel : @&"warning: GDB: Failed to set controlling terminal: Invalid argument\n"@ I don't know how to use debuggers. will take a look at documentation of gdb and come back.
  • How to know if a thread is waiting for a lock?

    5
    0 Votes
    5 Posts
    4k Views
    G
    [quote author="Denis Kormalev" date="1307282404"]Not sure "static" advice is really good. In this case you will not know which thread is in lock (and in dtor you will terminate ALL threads). If you want to do it static for locking then mutex is already here.[/quote] Sorry, that was a very silly mistake to make on my part and what you say makes perfect sense, I just never considered it that way. Thanks for the input!
  • [SOLVED] zoom to fit in QGraphicsView

    13
    0 Votes
    13 Posts
    13k Views
    G
    Thanks for the question and the input. I definitely got something from this thread :)
  • [Solved] QGraphicsView mousePressEvent and selection behavior?

    3
    0 Votes
    3 Posts
    6k Views
    M
    thank you You are right about it. I missed this this point, thank you.