Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • QFile exist int system32 dir

    3
    0 Votes
    3 Posts
    2k Views
    S
    I resolve my problem. @QString getWindowsDir() { WCHAR dir[MAX_PATH]; SHGetFolderPath(0, CSIDL_WINDOWS, NULL, 0, dir); return QString::fromUtf16(reinterpret_cast<ushort*>(dir)); } QString path = getWindowsDir() + "\SysNative\" + file;@
  • OpenGL ES2 on the desktop

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [solved] Filtering model in a locale-aware way

    7
    0 Votes
    7 Posts
    5k Views
    M
    This would be an awesome feature if provided by Qt itself. It seems it is coming up again and again and again.
  • Plastique Style color depends on color scheme (WinXP)

    3
    0 Votes
    3 Posts
    2k Views
    W
    Ok one way I found is to serialize qApplication.palette() to a file one time, then load it on every startup and qApplication.setPalette(pal). Is this the way to go? Seems to work...
  • Load font from .ttf file

    5
    0 Votes
    5 Posts
    12k Views
    P
    Hm I guess it won't be bug, it seems that there might be something wrong with my Qt4.8 installation. If I create new empty project with "Hello world!" its fonts are messed up. I'v tried to run some demos from qt and fonts are messed up too. I'v checked dir where Qt was installed (/usr/local/Trolltech/Qt-4.8.0) and in lib/ folder there wasn't fonts/ folder. I copied fonts folder there but fonts still look bad.
  • How to increase the size of the dialog box at run time?

    8
    0 Votes
    8 Posts
    5k Views
    A
    This is the code i wrote.....here contents adding properly....but dialog size not incrementing accordingly...please tell me what i'm missing here.... @void Dialog::Display_header(QStringList headerList) { for(int i=0;i&lt;headerList.count();i++) { QRadioButton *Rbutton= new QRadioButton(); Rbutton-&gt;setText(headerList.at(i)); ui->verticalLayout->addWidget(Rbutton); ui->verticalLayout->setAlignment(Qt::AlignTop); ui->verticalLayout->setSpacing(1); ui->verticalLayout->setStretch(1,1); } } @
  • How to place a GraphicsView in a layout object

    7
    0 Votes
    7 Posts
    3k Views
    C
    Assuming this is in a function, the QGraphicsView is a local variable: when it goes out of scope it's gone. You should dynamically allocate it (this seems to be "the Qt way") or make it a member variable of your class.
  • 0 Votes
    3 Posts
    5k Views
    G
    Class name and object name can be the same, it does not matter. You can see, whether the streamList is in the child list at all: @ foreach(const QObject *obj, this->children()) { qDebug() << obj; } @ Check if the streamList is in the debug output.
  • QSqlDatabase Transactions and QSqlQuery Creation

    4
    0 Votes
    4 Posts
    10k Views
    G
    The query may not be executed in the transaction, I would suppose, probably depending on the driver.
  • QTableView - Not Getting Selection Changed Signal

    11
    0 Votes
    11 Posts
    16k Views
    G
    The table implicitly has a selction model, get with <code>tableView->selectionModel()</code>, you don't need to create a new one.
  • [Solved] Can anyone help-i miss something! filedownloader example

    4
    0 Votes
    4 Posts
    3k Views
    K
    Tank you for a quick answer peppe. @m_lblImage = new QLabel(centralWidget);@ @ m_lblImage->setObjectName(QString::fromUtf8("m_lblImage"));@ i forgot to declare something thats right, i looked and looked, but i think it was to late, and after some sleep i found it. i have written @m_ilblImage = new QLabel(centralWidget);@ and that dons't work out ;)
  • Dependent Parallel states in Qt Statemachine

    8
    0 Votes
    8 Posts
    4k Views
    S
    Actually I was looking at possible structure as mentioned here "Parallel structure":http://easycsm.sourceforge.net/SM_5.png .
  • QGraphicsScene + drawing a point

    2
    0 Votes
    2 Posts
    3k Views
    C
    If you want to "connect the dots", so to speak, why did you decide to use an ellipse, rather than a line segment?
  • Does Qt guarantee the order of focus (out and in) signals ?

    5
    0 Votes
    5 Posts
    4k Views
    D
    Thank you for all the feedback: Some more information: Clarification: I understand that the signals from one widget come in the order of the connect statements but as Andre correctly stated, my problem relates to single signals from multiple widgets. Motivation: the problem typically appears when a edit control needs to do some computations when the focus is lost and the results are shown in another field. In this case "our" program logic expects that those computations are already done (during focus lost) before we process the push button (click). [quote author="Andre" date="1324461511"]Perhaps you can avoid any depence on this order, if you use QApplication::focusChanged instead of relying on the order. However, this signal (this is a signal) is send only after both widgets have already been send the FocusEvent. [/quote] I absolutely agree that this should be the way to go and this is also what we generally try to do but especially when there are complex relationships between the edit fields (stuff like default values that need to calculated from others fields but can later be changed by the user) this gets really complicated. Some questions that might help to better understand: 2.1) What should setting the focus policy of a QWidget as a main window for other controls do ? 2.2) When and why should the focus policy been changed in general ? 2.3) Is there any sequence of signals/events that we can rely on in Qt or is it just "random" ?
  • Is there a way to query if the text in a QLineEdit is truncated?

    3
    0 Votes
    3 Posts
    2k Views
    M
    Hm, this hack is exactly what I was trying not to do. It might work, though. Thanks, Andre!
  • QT supports OpenGL 5.0, 6.0 and 10.0

    4
    0 Votes
    4 Posts
    3k Views
    M
    it's about setVersion: [quote author="http://developer.qt.nokia.com/doc/qt-4.8/QGLFormat.html" date="0"] Set the OpenGL version to the major and minor numbers. If a context compatible with the requested OpenGL version cannot be created, a context compatible with version 1.x is created instead. [/quote]
  • Q_OBJECT in template class and order of slots

    2
    0 Votes
    2 Posts
    3k Views
    D
    If you put together a minimal testcase you could submit a bug report, although I'm not sure you're in a supported case there (cf. [[doc:moc]] limitations).
  • 0 Votes
    2 Posts
    2k Views
    EddyE
    Please don't double post. This is the same as "this thread":http://developer.qt.nokia.com/forums/viewthread/12711/. I'm closing this one.
  • Progressbar with two different colors

    5
    0 Votes
    5 Posts
    8k Views
    V
    hello Andre thanks a lot... now i am able to display progress bar with two different colors at a time using style sheets. @ progress->setStyleSheet(QString("QProgressBar::chunk:horizontal {background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 grey, stop: 1 grey);}")+QString("QProgressBar::horizontal {border: 1px solid gray; border-radius: 3px; background: yellow; padding: 0px; text-align: left; margin-right: 4ex;}")); @
  • How to get the first letter of the string?

    5
    0 Votes
    5 Posts
    5k Views
    A
    Thanks a lot for all of u...:) i did like this @ std::cout<<"the first word of the line :"<<line.at(0).toAscii()<<endl; @