Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • Problem quitting Qt-Quick application

    8
    0 Votes
    8 Posts
    5k Views
    AlicemirrorA
    Tested in this moment. Works perfectly! Without timer stopping, the application exit then wait a little before stopping and not all the times signals "exit application with 0" With the timer stopping sequence, stop the timers, exits and signal the correct program completion immediately. More robust and reliable. This night 1.0 rc is out :=)
  • [Solved] Transparent window setting

    4
    0 Votes
    4 Posts
    3k Views
    ?
    [quote author="Alicemirror" date="1300270252"]Thank you very much!!! As a matter of fact (anyway I search on the forum before post a problem) I had already tested the sample in the discussion you mentioned above, with no good results. [/quote] you are welcome :) ... been on forum sometime now so just remembered this was already discussed earlier. sometimes it happens, you don't get best results with search and i believe it is being looked into
  • Effect of QApplication for a console application.

    8
    0 Votes
    8 Posts
    5k Views
    G
    If you have a non gui app, why do you return the data as QTreeWidget? QTreeWidget is a UI class, not a data container. It makes much more sense to return a data structure, which can then be used by a model to be displayed in a tree, than returning a UI class for that.
  • Shared OpenGL context with the OpenGL context of the application UI

    7
    0 Votes
    7 Posts
    6k Views
    A
    Sounds like an excellent plan. Let us know how it works out please!
  • Writing debug information both in file and Windows debugger

    5
    0 Votes
    5 Posts
    8k Views
    A
    [quote author="chetankjain" date="1300264091"]adding CONFIG += console should enable u to output messages to your windows console directly using qDebug() .. so on[/quote] The windows console is not the same as the debugger stream.
  • New AudioEffect | processing pcm audio data

    12
    0 Votes
    12 Posts
    6k Views
    L
    That's great! Thanks! It start to sound very promising to me!
  • What does "block" mean in QTextCursor?

    4
    0 Votes
    4 Posts
    3k Views
    D
    Thank you both :)
  • QImageReader::SetClipRect limitation on size(Large Image)

    4
    0 Votes
    4 Posts
    4k Views
    N
    Thank you for the reply. Here's what I did: @ { QImageReader reader1(file); reader1.setClipRect(QRect(halfWidth, 0, halfWidth, halfHeight)); QPixmap img01 = QPixmap::fromImage(reader1.read()); QGraphicsItem* itemHolder = reinterpret_cast<QGraphicsItem*>(_scene.addPixmap(img01)); } { QImageReader reader2(file); reader2.setClipRect(QRect(0, 0, halfWidth, halfHeight)); QPixmap img02 = QPixmap::fromImage(reader2.read()); QGraphicsItem* itemHolder = reinterpret_cast<QGraphicsItem*>(_scene.addPixmap(img02)); } { QImageReader reader3(file); reader3.setClipRect(QRect(halfWidth, halfHeight, halfWidth, halfHeight)); QPixmap img03 = QPixmap::fromImage(reader3.read()); QGraphicsItem* itemHolder = reinterpret_cast<QGraphicsItem*>(_scene.addPixmap(img03)); } { QImageReader reader4(file); reader4.setClipRect(QRect(0, halfHeight, halfWidth, halfHeight)); QPixmap img04 = QPixmap::fromImage(reader4.read()); QGraphicsItem* itemHolder = reinterpret_cast<QGraphicsItem*>(_scene.addPixmap(img04)); } ui.graphicsView->show();@ Just to confirm is this the correct way to split the image in chunks. I'm still pretty new to Qt :)
  • Add two numbers

    3
    0 Votes
    3 Posts
    7k Views
    N
    Gerolf, thank you so much! It works and I understand what you explained! :-)
  • Using a QGraphicsView as the viewport for a (different) QGraphicsView?

    4
    0 Votes
    4 Posts
    4k Views
    M
    Thanks Andre, yes that is what I want to do. What I needed is exactly what QGraphicsItem::ItemIgnoresTransformations provides, namely ignoring scale. Cheers, meejah
  • QTabWidget not displayed

    10
    0 Votes
    10 Posts
    9k Views
    S
    You have to put your layout in the "ui" form. Now you have to layouts, one in the ui and the second you create in the constructor.
  • QLineEdit and changing font for the "PlaceHolder" text

    4
    0 Votes
    4 Posts
    9k Views
    R
    well, Volker is a mad scientist ;-) Thank you both.
  • Sound and the using of the Resource system

    8
    0 Votes
    8 Posts
    9k Views
    S
    OK.
  • QScriptEngine, converting JSON data to QVariants

    6
    0 Votes
    6 Posts
    10k Views
    G
    Good point Andre, thanks. Much of the data is packaged with the app, and so "safe", but some will indeed come down the wire, so your point about the extra safety provided by using the JSON.parse approach is certainly applicable!
  • WinId and WinIdChange

    13
    0 Votes
    13 Posts
    11k Views
    G
    Created a bug report: "QTBUG-18132":http://bugreports.qt.nokia.com/browse/QTBUG-18132
  • [SOLVED] program crash when restart a process

    7
    0 Votes
    7 Posts
    5k Views
    V
    Ok, thank you both very much!!
  • Model subclassing - how to signal data change

    7
    0 Votes
    7 Posts
    19k Views
    G
    Yes, it's exactly what you have to do.
  • Convert QString into QByteArray as either UTF-8 or Latin1

    9
    0 Votes
    9 Posts
    69k Views
    D
    [quote author="jsiei97" date="1300014687"]Hi I would like to covert a QString into either a utf8 or a latin1 QByteArray, but today I get everything as utf8.[/quote] There are some problems with your snippet... QString(const char *) uses whatever codec was set by QTextCodec::setCodecForCStrings(), or if no codec was set, fromLatin1() A \u escape sequence is not generated in any particular encoding, but it's up to your compiler to set the execution charset (see -fexec-charset on gcc). For instance: @ $ LC_ALL=C gcc -x c++ -o - -S - -fexec-charset=latin1 <<< 'const char *foo = "\u00fc";' | grep .string .string "\374" $ LC_ALL=C gcc -x c++ -o - -S - -fexec-charset=utf8 <<< 'const char *foo = "\u00fc";' | grep .string .string "\303\274" $ LC_ALL=C gcc -x c++ -o - -S - -fexec-charset=utf16 <<< 'const char *foo = "\u00fc";' | grep .string .string "\377\376\374" @ This means that what ends up in your char array that you pass to QString ctor is pretty much up to your compiler, may change for every translation unit and may be out of your control (load a plugin that changes the codec for the C strings => doom). Therefore, stay on the safe side: don't use \u inside strings unless you are 100% sure of the WHOLE toolchain, locale set by the user, etc; use ascii characters only in the source file; use the \x escape sequence instead. In any case, use QString::fromUtf8/Latin1/Utf16 inside your program, and if possible, shut down all unsafe conversions from/to C strings by defining QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII. QByteArray::append(QString) uses toAscii on the string, which again uses the codec for c strings, otherwise converts to latin1. If you want to convert to utf8, use toUtf8. Watch out, qDebug() may be not unicode safe. Always check with toUtf8().toHex() what's really inside your strings.
  • [Solved] QRegExpValidator: No such file or directory

    5
    0 Votes
    5 Posts
    6k Views
    L
    Yes, It solved the problem.
  • [Solved] GUI plugin problems

    9
    0 Votes
    9 Posts
    4k Views
    T
    Fixed it !!! thanks for your help