Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • [Solved] QFileSystemModel root path

    5
    0 Votes
    5 Posts
    10k Views
    A
    As stated above and in the docs: [quote]QFileSystemModel will not fetch any files or directories until setRootPath is called. This will prevent any unnecessary querying on the file system until that point such as listing the drives on Windows.[/quote] As for starting off at a certain node, would setRootIndex do the trick? You can retreive the index to use as root by using QFileSystemModels methods to get a QModelIndex for a path.
  • QFont - retrieve font's file name

    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • [Solved] QWidget assumes allocation on heap, not stack?

    11
    0 Votes
    11 Posts
    11k Views
    G
    [quote author="RickH" date="1313418131"] The way C++ is set up, the destructor for the object-as-a-whole is called before the destructors for the objects-who-are-members. So I have to not set the parent of the member to be the object-as-a-whole. If I do, the object-as-a-whole will call delete on the member. [/quote] Yes, that's correct. And the destructor fthe object-as-a-whole will be ran before the destructors of the members. If you need parent-child relationship in this use case, use a pointer and new instead of an object variable.
  • [SOLVED] Adding horizontal scroll bar to a QSplitter

    3
    0 Votes
    3 Posts
    4k Views
    M
    Thanks Volker... Its working now , After using the setMinimumSize(hint) function . But not with the QSplitter::setChildrenCollapsible(false) Thanks for your valuable inputs..
  • Can I create a translucent window

    4
    0 Votes
    4 Posts
    3k Views
    M
    mouse and keyboard events pass through my window Qt::WA_TransparentForMouseEvents or QWidget::setMask() -> you need to calculate region of MyWindow which can be painted and pass that to setMask function.
  • Avi into a stage.

    4
    0 Votes
    4 Posts
    2k Views
    G
    If you look at the Qt docs, you find many examples, e.g. the "Multimedia examples.":http://doc.qt.nokia.com/4.7/examples-multimedia.html have a look there.
  • Getting an excel file

    8
    0 Votes
    8 Posts
    7k Views
    K
    thanks alot
  • [SOLVED] convert a string to a variable and visa versa

    7
    0 Votes
    7 Posts
    3k Views
    K
    thank you.
  • Minimum size of static-linked Qt GUI app?

    8
    0 Votes
    8 Posts
    9k Views
    L
    I "think" they are release libs because I configured with release option on. And I'm talking about static lib, 2MB QtCore and 8MB QtGUI seems unbelievable to me... Anyway, what I'm caring about is the size of the final static-linked app.
  • Minimizing Application to Tray

    25
    0 Votes
    25 Posts
    40k Views
    R
    Yep, that's why I gave the second block of code (which I've just realised had the processEvents() call still in it - it wasn't meant to be there)
  • MIDI callbackhook implementation

    2
    0 Votes
    2 Posts
    2k Views
    F
    Depends on the work done in the callback. Usually the callback function is executed in the library's thread, which may be your main thread. If you need to feed back information into your application, it's probably a good idea to read "Threads, Events & QOjects":https://developer.qt.nokia.com/wiki/Threads_Events_QObjects for more information on how to pass event callbacks into the event loop.
  • Draw a Line in a Text Label

    5
    0 Votes
    5 Posts
    4k Views
    G
    You could use the "text frame feature of a QTextDocument":http://doc.qt.nokia.com/4.7/richtext-cursor.html#frames which can have a border and check, how it looks like in the RTF format.
  • [SOLVED] Problem compiling with Qt Creator

    4
    0 Votes
    4 Posts
    6k Views
    Z
    Ah okay, I see my mistake, @ //Wrong QFuture<void> future = QtConcurrent::run(concurrentFunction(&timer)); //Right QFuture<void> future = QtConcurrent::run(concurrentFunction, &timer); @ Thanks for your help!
  • Problems while using QPushButton

    10
    0 Votes
    10 Posts
    4k Views
    R
    [quote author="loladiro" date="1313320494"]"This is currently being discussed to be merged into Qt5":http://developer.qt.nokia.com/wiki/New_Signal_Slot_Syntax There's a link to the repository with the code in that article and there's also a merge request for it with qtbase. And then stuff like this will be possible: @ connect(sender, &Sender::valueChanged, [=](const QString &newValue) { receiver->updateValue("senderValue", newValue); } ); @ Or as is our example @ QObject::connect(play, SIGNAL(clicked()), ={sli->setValue(150);}); @ THIS CODE IS NOT WORKING IN QT4, AND MIGHT NOT EVEN WORK IN QT5 AS THE SYNTAX IS SUBJECT TO CHANGE[/quote] Thanks, really impressive.
  • How to change style of window?

    9
    0 Votes
    9 Posts
    15k Views
    G
    [quote author="soroush" date="1313309286"]bq. Changing this must be done in an OS dependant way by overwriting some messages… So, how should I do that?[/quote] As I told you, it's OS dependant. I don't know how to do it on Linux / mac, but on windows, you have to overwrite winEvent and handle WM_NCXXX messages. there are couple of descriptions around on the internet about that, so I suggest you search with google. It's not trivial, and it's on my list to write a wiki for windows on that, but that's currently far away, it's much code you need for that currently...
  • 0 Votes
    7 Posts
    15k Views
    U
    Thanks , working great
  • [SOLVED] help with signal and slot

    5
    0 Votes
    5 Posts
    2k Views
    K
    i got it working. i solved it with the first reply advice plus i did not have a click event. thank you for your help.
  • [Solved] How to detect QMainWindow destroy signal?

    7
    0 Votes
    7 Posts
    11k Views
    EddyE
    try @myWin *dialog = new myWin(this); dialog->setAttribute(Qt::WA_DeleteOnClose, true); dialog->show(); @ Edit : Gerolf is faster ;)
  • Qt Listview

    2
    0 Votes
    2 Posts
    2k Views
    G
    That's by design. A Listview is a plain list, not a tree. And a list has noch child elements. It's a table with only one column. If you want to exapnd collaps child elements, you need a treeview.
  • [SOLVED] help getting signal and slot to work

    10
    0 Votes
    10 Posts
    3k Views
    K
    thanks for the code alexisdm.