Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • How to draw a movable line on Widgets

    11
    0 Votes
    11 Posts
    11k Views
    J
    I think one of the key things to understand is how high-level events work. Take a look at QGraphicsItem::itemChange(). If you are using QGraphicsView framework and your line items are QGraphicLineItem, then you can set the flags to selectable and movable, over-ride itemChange(), and then you can make all sorts of magic happen! Hope this helps a little. Jeff
  • 0 Votes
    10 Posts
    7k Views
    D
    Thanks Andre, it's a good idea :)
  • Qt Research/Academic/Journal Papers/Articles

    2
    0 Votes
    2 Posts
    2k Views
    J
    Any possible insights on this topic are greatly appreciated. Thanks again.
  • Qt on Windows - What is your experience?

    13
    0 Votes
    13 Posts
    6k Views
    L
    [quote author="DocOx" date="1333668362"]# I am wondering why the Qt guys are not supporting a more up-to-date version of MinGW. Is there any particular reason? In fact, the version they ship with the Qt SDK is patched, but maybe there would be no need to patch if they were to use a more recent version...?[/quote] Honestly, I don't know (but I heard the same rumors) - but I understand that switching the default toolset does in fact require some work (mostly testing) and that almost everyone is now primarly focusing on Qt 5, which (so I guess) will bring GCC 4.6.2 and/or GCC 4.7 (which are the recommended GCC versions for Qt5 alpha). [quote author="DocOx" date="1333668362"]# I imagine you have to build Qt from scratch and can't just use the MinGW version of the Qt SDK out of the box?[/quote] Yes. [quote author="DocOx" date="1333668362"]# Something I noticed in my very early tests with MSVC is that compilation is much faster and the size of the files much smaller. On the other hand, to set up a Qt/MSVC environment is rather time consuming compared to Qt/MinGW.[/quote] Subjectively I would say GCC (or better MinGW) might be slower, but not much slower (although I haven't verified this). The same goes for file size, which even doesn't bother in (m)any of my use cases. @ MSVC MinGW 4.4 MinGW 4.7 QtCore4.dll 2.498 KB 2.777 KB 3.035 KB QtGui4.dll 8.366 KB 9.898 KB 11.028 KB @ [quote author="DocOx" date="1333668362"]# Regarding MinGW64, what is the difference between the different builds?[/quote] The basically differ in the GCC version used, the amount of SDK headers included, the exception model, or whether they are prefixed or not (x86_64-w64-mingw32-gcc.exe vs. gcc.exe). I've found the personal build of rubenvb the most recent and feature complete so far plus it is non-prefixed (and so works as a drop-in replacement for the MinGW delivered with the SDK).
  • How QWindow introduced in Qt5 is better than QWidget

    6
    0 Votes
    6 Posts
    11k Views
    Z
    QWindow represents a top-level system window rather than a parentless QWidget. QWindow is used in conjunction with QtQuick2 or with QOpenGLContext to provide OpenGL viewports (rather than QGLWidget). QWindow is backed by QPlatformWindow which gets instantiated by the QPA plugin when the application calls QWindow::create(). If you are using QWidget-based UI's then just use parentless QWidget's as windows just as in Qt4.
  • Sample Code for the MFC to Qt Migration Guide

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • How to enable resizing of a frameless widget

    16
    0 Votes
    16 Posts
    21k Views
    A
    You could use a layout, or you reimplement the resizeEvent of your widget to manually position the size grip.
  • [Solved] how to add a handler to handle clicking cancel on QWizardPage

    3
    0 Votes
    3 Posts
    3k Views
    A
    A QWizard is a subclass of QDialog. QDialog has the rejected() signal, that is fired when the dialog (the wizard) is cancelled (or otherwise rejected). You can connect to that signal to do your cleanup.
  • 0 Votes
    6 Posts
    2k Views
    A
    No way to judge from just a screen shot. I might be done using a the GraphicsView framework, but it can also be done as a normal widget. Nowadays, you can also add QML to that.
  • Monitoring multiple QProcess

    4
    0 Votes
    4 Posts
    4k Views
    A
    Just put all files in a queue, and only allow a fixed number to run simultaniously at any point in time. It should be easy to create a simple manager class that keeps track of the number of processes you have fired off, and gets signalled when any of these finishes. You can use that finish signal to trigger the start of new processes, up to the number you allow and as long as you have unfinished tasks in your queue.
  • Writing model for QCompleater

    3
    0 Votes
    3 Posts
    2k Views
    M
    [quote author="Rahul Das" date="1334040862"]There is a "wiki":http://www.developer.nokia.com/Community/Wiki/How_to_use_QCompleter_in_Qt .[/quote] very wonderful example BUT! work only for first one word, and i need tips for all of typing words....
  • Resize a TreeWidget within a TabWidget if the MainWindow is maximized

    3
    0 Votes
    3 Posts
    2k Views
    siropS
    I meant the usual way of maximizing the main Window by clicking on the appropriate icon at the window frame. But thanks anyway. Will try out your proposal to-morrow.
  • Opening KDE Konsole from Qt and sending a command

    6
    0 Votes
    6 Posts
    6k Views
    R
    Why don't you just use something like this? konsole --nofork --hold -e 'ls'
  • Unable to use new QTranslator::load() (Qt 4.8)

    5
    0 Votes
    5 Posts
    4k Views
    D
    Indeed, I should read the doc with eyes open ;-) This raises the following question: how to set manually fr_CA as the first language in this list from the shell? E.g. for testing purpose.
  • Q_object , signals , slots problem

    6
    0 Votes
    6 Posts
    3k Views
    D
    [quote author="ahura_24" date="1333867809"]why i must seprate header files ?[/quote] Not a must, but a good practice. If you do not want to seprate and the name of this file is "main.cpp" and the build tool your chosen is "qmake" , you need to add such a line @ #include "main.moc" @ in this file.
  • Debugging paint event = segmentation fault?

    4
    0 Votes
    4 Posts
    3k Views
    M
    Still sounds strange. Setting a breakpoint in the paint event may cause the program to stop a lot and not update, but not to crash. Maybe you can post a backtrace along with some snippets of your code?
  • 0 Votes
    3 Posts
    3k Views
    N
    Yeh Andre thats what is puzzling me too. but ill debug it further if that is the way you guys would approach it too. It seems for some reason that items with multiple lines only half the lines get painted until the entire item is visible. It was not like sizeHint returned incorrect values though cos the item had the correct size. It was just blank at the bottom until i scrolled to get full item visible and it paints itself correctly. In the paintEvent i did use painter->drawText with textoption flag than use QTextDocument drawContents to not have to recreate QTextDocument inside it again but maybe thats having some strange outcomes. will check further tomorrow and update.
  • What does Qt uses to render GUI ?

    6
    0 Votes
    6 Posts
    5k Views
    D
    Old X11 backend (aka. Xlib) has been dropped in Qt5, the default backend for linux is XCB, and wayland can be selected if your OS support it. Both Qt and GTK+ are ui toolkit, they are independent. GTK is now porting to wayland too.
  • Question about cross platform programming in Qt

    7
    0 Votes
    7 Posts
    3k Views
    D
    In fact, this is a pure C++ problem. As you can't compile your C++ program into one file and have it run on windows, mac, and Linux. However, if you using pure qml, there is another problem.
  • InitializeGL doesnt clear whole background

    6
    0 Votes
    6 Posts
    2k Views
    T
    You're welcome. Although it took relatively long for the problem to get solved ^^