Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Can I pass signals and slots as arguments?

    5
    0 Votes
    5 Posts
    9k Views
    B
    i my own program, i need to do a similar thing, but i instead pass the name of the slot function as the parameter in the form of QString. and i get the method's id with QMetaObject()->methodId("function name"); and call the function with QMetaMethod()->invoke(...)
  • QTreeView with multiple Widgets in columns?

    8
    0 Votes
    8 Posts
    13k Views
    G
    You can find good examples "in the docs":http://doc.qt.nokia.com/4.7/model-view-programming.html#delegate-classes
  • Problem in client - server model of tcp in qt

    4
    0 Votes
    4 Posts
    3k Views
    M
    In your code the connection state is queried immediately after the call to connectToHost() is made, which more than likely doesn't give the connection time to complete. (It's not a blocking call.) You probably either want to call "waitForConnected()":http://doc.qt.nokia.com/4.7/qabstractsocket.html#waitForConnected or connect to the connected()/error() signals.
  • QDial - loops

    3
    0 Votes
    3 Posts
    2k Views
    M
    What exactly are you wanting to do in the loop?
  • [solved] QGraphicsView in a QTabWidget

    4
    0 Votes
    4 Posts
    4k Views
    J
    Ok, I've found a solution. What I do is whenever the tab is changed, I force a resize event at that time to the plot. @ QSize tempSize=tab1->plot->size(); tab1->plot->resizeEvent(new QResizeEvent(tempSize,tempSize)); @ Not exactly how I was hoping to do it, but it solves the problem.
  • Dynamic forms

    4
    0 Votes
    4 Posts
    4k Views
    EddyE
    Have a look in the offical Qt book." You can download it here":http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip In one of the first chapters they explain how to do something like what you want with example code..
  • 0 Votes
    9 Posts
    4k Views
    M
    [quote author="Andre" date="1311687993"]You simply can not make the connects to custom slots from Designer. You can only connect signals and slots that are known to Designer. That is: the standard ones provided by the widgets you are using. Any signals or slots that you declare and implement yourself on the form, can not be used from designer but must be connected manually from code. [/quote] Fair enough... ..but I think that the apparently 'broken' feature which tempts newcomers like me should not be included into a stable version.
  • Qt + MySql plugin, license

    12
    0 Votes
    12 Posts
    9k Views
    L
    [quote author="alexisdm" date="1311687510"]Let's say: A = Your proprietary application B = The Qt MySQL plug-in C = The Qt Sqlite or ODBC plug-in You want your users to be able to use A + B. But if A can't work at all or as usefully without B, A is legally a derivative work of B and must be GPL compatible. So you have to do a little extra work to ensure that A can also use C instead of only B and still work correctly. Since QtSQL is an abstraction layer for the database connection, if your application can connect to a MySQL database, it can already connect with minimal work to any other Qt-supported database. If it wasn't the application role to create and populate the database tables, you may need to provide a way to create the tables with the other sql plug-in too, so that the application would be truly usable with that other plug-in. So, now, A can work with either B or C, but if you distribute A + B + C in a single package, B becomes an integral part of A + B + C and the GPL doesn't allow GPL software to be distributed as part of a larger non-free program. Because of that you can't put B in the same package as A, but your users can still get A+C and B from you as 2 different packages and combine them themselves to use A+B because: B is effectively independent GPL package available elsewhere, and not written by you to work only with A, and as such can be freely distributed by anyone (as long as you can provide the source code for B), The GPL doesn't restrict the usage, but rather the distribution of GPL covered software. You might use an automated installer to combine A + B for your users from the two packages, but you'll still need to get some legal advice to be sure.[/quote] Thanks, this is a very interesting point of view.
  • Custom Branch in QTreeView/QFileSystemModel

    5
    0 Votes
    5 Posts
    5k Views
    A
    What might work for you too, is to use two models, and use a proxy to merge them. I think that in the KDE source code, there is already a proxy model that can merge two item models. If you use a QStandardItemModel for your libs tree, then you should be able to use QFileSystemModel for your file system view. It is not a trivial class to re-create yourself, especially because it uses threading and watches the file system for changes in the visible parts of the model.
  • [SOLVED]Behaviour of QMultiMap

    13
    0 Votes
    13 Posts
    9k Views
    A
    Ah! Great that you managed to solve it. It seemed an unlikely bug to be in QMap or QDateTime (something that would have been caught by a unit test), but you never know... Qt is not perfect. But, in this case, it was pilot error after all :-) An easy mistake to make, and a hard to spot one. I am glad you managed to fix it!
  • Problem with QTabWidget resizing @ runtime

    2
    0 Votes
    2 Posts
    3k Views
    M
    Now i have designed the TabWidget control from Qt designer instead of embedding into the dialog & then into the DockWidget. Now i am able to set the properties of each tab expand to fit into the size of the TabWidget.. But i want to know ...how to expand the size of the TabWidget area at runtime from the mainWindow ..like what we do in Qt Designer..
  • [solved]qmap::contains fails with segmentation fault

    3
    0 Votes
    3 Posts
    6k Views
    P
    yes. in fact I really think this is a qt bug, because the segfault signal comes during execution of qmap.h code. rows is not a null pointer, however. (it's not a pointer :D) edit: it seems I'm the only person that can solve a segfault problem sobstituting an object with a pointer to it. I modified rows into a QMap * and in constructor I wrote rows= new QMap<...>(); and now it works properly. really a strange thing. Thanks for making me have this idea, and thanks if someone has an hypothesis about this issue.
  • [solved] Trouble with Q_OBJECT Signals & Slots

    13
    0 Votes
    13 Posts
    13k Views
    H
    No I have generated the project with cmake for Visual Studio 2008. Then I opened it to develop further functions. The Qt-addon for VS is installed, BUT grey. I only can choose Launch Linguis and Creator, Open *.pro and Qt Options. All others were greyed, thus not choosable.
  • [SOLVED] problem with QDockWidget position

    7
    0 Votes
    7 Posts
    8k Views
    M
    i updated...Thank you so much..
  • QListView- edite mode validation?

    3
    0 Votes
    3 Posts
    3k Views
    R
    Maybe this will help you "setItemDelegate":http://doc.qt.nokia.com/latest/qabstractitemview.html#setItemDelegate "setItemDelegateForColumn":http://doc.qt.nokia.com/latest/qabstractitemview.html#setItemDelegateForColumn "setItemDelegateForRow":http://doc.qt.nokia.com/latest/qabstractitemview.html#setItemDelegateForRow
  • QT 4 on Code::Blocks 10.5 with QGLWidget Not Solved yet

    7
    0 Votes
    7 Posts
    6k Views
    R
    If you have yourProjectName.pro file so you shold add: @contains(QT_CONFIG, opengl): QT += opengl@ in .h or .cpp add this: @ #ifndef QT_NO_OPENGL #include <QGLWidget> //and so on #endif @ if you use cmake so add this: @ ############################################################# search for Qt4 SET(QT_MIN_VERSION 4.4.0) FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED) SET(QT_USE_QTOPENGL 1) INCLUDE( ${QT_USE_FILE} ) TARGET_LINK_LIBRARIES(yourAppName ${QT_LIBRARIES} ) @ Some thing like this :-)
  • [SOLVED]QSharedMemory: unable to lock on Windows 7 under debug mode

    4
    0 Votes
    4 Posts
    3k Views
    P
    EDIT: My fault. It was missing one line...
  • QRegExp - how to parse (G)UID?

    8
    0 Votes
    8 Posts
    3k Views
    D
    I think that you need to read something like "this":http://www.regular-expressions.info/
  • [SOLVED]Qt - check module availability in code

    4
    0 Votes
    4 Posts
    6k Views
    P
    But, there is else way (I found it through IntelliSense): QT_MODULE_GUI? QT_MODULE_CORE?
  • QFileDialog hides the extension ,creates problem.

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