Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • [Solved] How to create a QListView with QPushButton

    2
    0 Votes
    2 Posts
    3k Views
    L
    for more infos: http://www.qtforum.org/article/24195/qpushbutton-as-delegate-in-a-qtableview.html
  • Decode special characters in Qt

    4
    0 Votes
    4 Posts
    2k Views
    L
    hmm, for example: there is a file named with “?”, maybe it's “?myfile.txt". now, i wanna open the file. of course, i get the file path of the file, and initialize a QFile with file path. the problem is that, the file path, the QString, can not be read correctly, since “?” can not be read, it will displayed as "?". i think it's cause by decoding. and this is what i mean.
  • Stylesheet for disabled QPushButton under Windows 7 Basic Theme

    4
    0 Votes
    4 Posts
    3k Views
    M
    I think this will work Fine. Try this in your Stylesheet, @pushButton->setStyleSheet("background: transparent");@
  • Problems with deploying for mac

    6
    0 Votes
    6 Posts
    7k Views
    V
    QLibraryInfo seems to be indicating that the plugins are loading from the wrong location. It isn't respecting qt.conf(even though it's embedded as a resource in the path (/qt/etc/qt.conf). It also isn't respecting the QT_PLUGIN_PATH environment variable. The library info prints that I'm using are after a QApplication is created so it isn't that. Here's a snippet: @int main(int argc, char *argv[]) { QApplication a(argc, argv); qDebug() << "CORE APPLICATION EXISTS: " << (QCoreApplication::instance() != NULL); qDebug() << "CORE APPLICATION PATH: " << QCoreApplication::applicationDirPath(); qDebug() << "qt.conf " << QFile::exists(QLatin1String(":/qt/etc/qt.conf")); qDebug() << "LIBRARIES LOADED: " << QCoreApplication::libraryPaths(); qDebug() << "PREFIX PATH" << QLibraryInfo::location(QLibraryInfo::PrefixPath); qDebug() << "PLUGINS PATH" << QLibraryInfo::location(QLibraryInfo::PluginsPath);@ Results in: CORE APPLICATION EXISTS: true CORE APPLICATION PATH: "/Users/my_user/my_app/MyApp.app/Contents/MacOS" qt.conf true LIBRARIES LOADED: ("/Users/my_user/QtSDK/Desktop/Qt/4.8.1/gcc/plugins", "/Users/my_user/my_app/MyApp.app/Contents/PlugIns", "/Users/my_user/my_app/MyApp.app/Contents/MacOS") PREFIX PATH "/Users/my_user/QtSDK/Desktop/Qt/4.8.1/gcc" PLUGINS PATH "/Users/my_user/QtSDK/Desktop/Qt/4.8.1/gcc/plugins" The middle entry on libraries loaded actually appears to be from the QT_PLUGIN_PATH export EDIT: I figured out was wrong with qt.conf. I was calling QImageReader::supportedImageFormats() in global scope. Apparently it was causing QLibraryInfo to cache a bad QSettings object.
  • 0 Votes
    2 Posts
    890 Views
    A
    Note that if you get a NetworkError, then there is no http response error code to be had. For HTTP, you need to have a working network first...
  • Mac OS X: context of shortcuts in global menu

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    5 Posts
    5k Views
    shavS
    [quote author="Lukas Geyer" date="1351670161"][quote author="shav" date="1351663862"]How I can check correction data in my QList variable if when I try to use isEmpty method application will crash?[/quote]Run your application in a debugger. It will automatically place you at the position your application crashed. If not, put a breakpoint right before the call to QList::isEmpty() and step through. I would valgrind the application as well (or any other memory corruption detection tool).[/quote] Thanks! I found the problem.
  • [Solved]Change text cursor color in QTextEdit

    14
    0 Votes
    14 Posts
    17k Views
    M
    If you are using setTextColor(), @TextEdit->setTextColor(Qt::white);@ will change the Text Color Alone. But the Text Cursor will remain the default Black in color...
  • Cannot make under Windows 7

    4
    0 Votes
    4 Posts
    2k Views
    L
    [quote author="fnoyanisi" date="1351685386"]Thanks... I excluded mingw32-make.exe from antivirus.... It worked finally![/quote] You are welcome. I am glad that I was able to help.
  • 0 Votes
    3 Posts
    3k Views
    B
    If you don't want to reordering your widget and layout you can use this: delete yourWidget->layout; But your problem basicly is the wrong layout assigning with widgets. Anyway a codesnippet would be useful...
  • Looking for thread pool simple implementation in Qt

    3
    0 Votes
    3 Posts
    2k Views
    U
    this is i also know , but how to write simple threadpool class i not sure i know .
  • New app, mid development. Switch to Qt5?

    2
    0 Votes
    2 Posts
    2k Views
    L
    Yes and no. Yes, the backend for QtQuick2 is very different. No, the QML frontend has just gone through minor changes. See "QML Applications in Qt 5":http://doc-snapshot.qt-project.org/5.0/qtquick-porting-qt5.html. There are still some issues with Qt 5 and some minor API changes going on, which might or might not affect you. We are using Qt 5 for two projects and both aren't at a relevant scale. As to the question if there will be a commercial-grade Qt 5 release by the end of the year. Well, maybe, or maybe not. It is at least planned as far as I know. The "releasing mailing list":http://lists.qt-project.org/pipermail/releasing/ is a good place to start if you want to follow the state of Qt 5. One major design goal of Qt 5 was source code compatibility with Qt 4. So you might release your application with Qt 4 and port it later on to Qt 5.
  • Creating QFont for a very specific font family/style pair

    2
    0 Votes
    2 Posts
    3k Views
    S
    I found a solution. I moved the specific .ttf I wanted to a resources directory in my app so it would be bundled with it in the future. I then used: QFontDatabase.addApplicationFont("resources/FuturaCondensedExtraBold.ttf") Once I had done so, I was actually not able to do this: QFont("FuturaCondensedExtraBold") but I could simple do QFont("Futura") and the style it would find was ExtraBold
  • Conversion of date time string to milliseconds and vice versa

    5
    0 Votes
    5 Posts
    11k Views
    B
    http://javascript.info/tutorial/datetime-functions http://www.w3schools.com/jsref/jsref_obj_date.asp and http://blog.stevenlevithan.com/archives/date-time-format
  • [SOLVED] How to install an application using SQlite under Windows?

    5
    0 Votes
    5 Posts
    8k Views
    J
    Hello, rcari, this works. Thank you so much!!! Your hint concerning QCoreApplication::libraryPath() is gold worthy! I confess, I often lose awareness on the doc, but this one should solve quite a lot of problems in the future before they arise. You made my day! Once again: Thank you! Regards Joerg
  • QTCreator Application Icon

    7
    0 Votes
    7 Posts
    13k Views
    M
    Yeah, I think Jake is Right... Try By using and write us whether it works or not. @a.setWindowIcon(QIcon("fileName.ico"));@
  • Using Freetype2 with Qt on Windows and Mac.

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Using Precompiled Libs QT 4.8.3 for VS 2012

    8
    0 Votes
    8 Posts
    6k Views
    Chris KawaC
    Using VC10 compiled libs might be ok in some cases, but it's asking for trouble when you need to interact with e.g. stl types. For example size of std::string changed between VC10 and VC11, so things like QString::fromStdString() might not exactly work (I haven't checked, just speculating), or seem to work and then explode in your face at some point. I wouldn't try that and definitely wouldn't ship product based on such hybrid. I compiled Qt from source too, but it's such a pain, especially since I needed both win32 and x64 builds with webkit and openssl. It takes ages, and if you forget something in configure step it can eat up half of your day. Also lack of VS add-in is a major inconvenience, so for now VS2012 is more of a playground than real Qt dev platform for me.
  • QFileSystemModel root path

    3
    0 Votes
    3 Posts
    2k Views
    J
    Thanks! It works :) . As you said, I was searching in the wrong place. Marked as solved. Regards, Jake
  • QMetaCallEvent in multithreading application

    3
    0 Votes
    3 Posts
    3k Views
    A
    Thank you for your response! We definitely have problem with architecture there. We are looking for appropriate solution. But as temporary hack -- it seems it's okay to destroy QMetaCallEvent in the catch block. [quote author="rcari" date="1349775603"]I think you have a design problem. You must ensure that T2 is not sending requests to T1 anymore when you destroy it. I think the simplest solution for you would be to simply use signals and slots for communication between T2 and T1 as what happens in the background is pretty much what you are doing by hand. However, the signal/slot mechanism provides extra security in the sense that when one object is destroyed (using deleteLater()) all its pending events are processed and all its signals/slots are cleanly disconnected.[/quote]