Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Selection in a QFileSystemModel and QTreeView

    2
    0 Votes
    2 Posts
    4k Views
    L
    bq. Note: If you do not have a value to return, return an invalid QVariant instead of returning 0. This note is taken from "the official documentation of QAbstractItemModel which is inherited by QFileSystemModel ":http://doc.qt.nokia.com/4.7-snapshot/qabstractitemmodel.html#data Do you get invalid QVariant in your case?
  • Odd behaviour of $$basename($$PWD)

    6
    0 Votes
    6 Posts
    4k Views
    P
    Oh, sorry, i misread your previous post.
  • Adding native OS Specific code to project

    3
    0 Votes
    3 Posts
    5k Views
    R
    Excellent. thanks for the tip. I'll adopt this approach.
  • What QReadLocker guarantee?

    6
    0 Votes
    6 Posts
    4k Views
    Z
    As Andre and Volker said, the Q{Read|Write|ReadWriter}Lock classes and their (*Locker classes which you should use) allow more fine-grained control over your locks to minimise lock contention and therefore hopefully let you application be more concurrent.
  • Problem with foreach loop

    3
    0 Votes
    3 Posts
    3k Views
    K
    @qDebug()@
  • How we can avoid erasing of previous image while repainting?

    5
    0 Votes
    5 Posts
    3k Views
    G
    Then you have to disable background erasing (see QWidget attributes) and handle all that on your own.
  • Signal emitted when the cursor comes out of QTableWidget Cell

    4
    0 Votes
    4 Posts
    4k Views
    G
    You could use the signal "cellChanged":http://doc.qt.nokia.com/4.7/qtablewidget.html#cellChanged to check the data of a changed cell. This does not imply entering and leaving a cell without editing it. You could also use "currentCellChanged":http://doc.qt.nokia.com/4.7/qtablewidget.html#currentCellChanged which is used when the focus switches from one cell to another. This does not include moving the cursor out of the table with tab or mouse.
  • ShowFullScreen() on a QWidget doesn't remove Mac OSX Menu Bar

    4
    0 Votes
    4 Posts
    3k Views
    G
    According to the sources, the unified toolbar is removed on the Mac on QMainWindow based classes only.
  • Adding console to mainwindow

    4
    0 Votes
    4 Posts
    3k Views
    G
    "qInstallMsgHandler() ":http://doc.qt.nokia.com/4.7/qtglobal.html#qInstallMsgHandler is your friend then. The "Browser for QDebug Log Output":http://developer.qt.nokia.com/wiki/Browser_for_QDebug_output has an example using a separate MainWindow, it can easily be adapted to utilize your regular MainWindow.
  • Display raw image data

    14
    0 Votes
    14 Posts
    15k Views
    V
    @TARGET = rawPlugin TEMPLATE = lib CONFIG = qt plugin VERSION = 1.0.0 HEADERS += argbhandler.h SOURCES += argbplugin.cpp argbhandler.cpp target.path += D:/Software/QT/src-4.7.1/plugins/imageformats/imageformats INSTALLS += target@ I'm using the example source provided in the link to learn. My project file is as above. I have modified the example source according to my requirement. I understand that I have to do: bq. qmake file.pro nmake nmake install I get an error saying : bq. LINK : fatal error LNK1104: cannot open file 'rawPlugin.lib' Please correct me, if I'm doing any thing wrong. Thank you very much.
  • [SOLVED] help with qcolor with textedit

    4
    0 Votes
    4 Posts
    2k Views
    K
    i just solved it with the following code :) @ QColor test = QColorDialog::getColor (Qt::white, this); message = message.insert(selectEnd, "</font>"); message = message.insert(selectStart, "<font color="" + test.name()+ "">");@
  • Cross-platform Preference Window Design

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Qt example "Font sampler" Seg fault problem.

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    4 Posts
    7k Views
    G
    QApplication::widgetAt() together with the global position of the [[Doc:QMouseEvent]] could bring you a step further.
  • Scrolling the contents of a GraphicsView

    2
    0 Votes
    2 Posts
    3k Views
    S
    I've tried a few things and I think if I get the following right, things should work as I want them to. So what I'm doing is: I draw a rubberband rectangle on my image. I calculate the center point of that rectangle and save those coordinates. Then I do a scale transform to the view to fit the rubberband rectangle I selected previously to fit in the whole viewport. then I use the function: QGraphicsView::centerON(centerPoint) // centerPoint being the coordinates I saved in #1. Now my question is, I think the coordinates I saved in #1 through the mouse events (i.e. event->pos()) in press and release events are in View coordinates. So if I map those to scene coordinates with: QGraphicsView::mapToScene(x, y); and save that point, then after the scaling transformation doing centerOn(centerPoint) should center the viewport in the exact same point of the scene, just now the scene is scaled but the center point is the same..Is this logic right? For now I don't think its centering the viewport where I want it to so I think somewhere I'm missing something. Could someone please help me get on the right track??
  • QObject::connect problem with argument list

    20
    0 Votes
    20 Posts
    9k Views
    G
    Split up the class definition into a header file, and don't put definition and implemenation together in the cpp file. then it should work. Or include main.moc at the end of the file.
  • Problem implementing back function with QfileSystemModel and QlistView

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • QtHelpEngine not working in deployed application

    5
    0 Votes
    5 Posts
    3k Views
    M
    Ah right! I remember reading that early on during this project but it seems to have slipped the way of the dodo. I'll give it a shot. Thanks!
  • [Solved] QTcpServer with console application (Event Loop)

    6
    0 Votes
    6 Posts
    6k Views
    M
    Thank you Eddy for your comment.
  • How to find intersection rectitem co ordinates

    4
    0 Votes
    4 Posts
    3k Views
    K
    It's Qt, man! Everything is done for you. Try this : @ QRect rect1(3,3,25,7); QRect rect2(5,5,8,29); QRect rect3=rect1 & rect2; @