Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QGLWidget docking/undocking problem with PowerVR OpenGL ES 2.0

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • Resizing problems with widgets

    4
    0 Votes
    4 Posts
    9k Views
    S
    Hello All, I figured this out. I need to call label->setMinimumSize and label->setMaximumSize. Thanks, -G
  • [Solved]QGraphicsScene | QGraphicsView

    11
    0 Votes
    11 Posts
    10k Views
    L
    The only thing I can think of is that the videowidget might not get its size until after you've put it in the scene. But I still cannot see why you want to use QGraphicsView for this. You can do your own painting on/in any widget. QGraphicsView is great for keeping track of large numbers of individual grahpical items, but does not really help you that much if you just want to put text on top of a video.
  • Delegate not working as expected...

    3
    0 Votes
    3 Posts
    2k Views
    G
    Did you debug it and check, whether the code was reached where you set the validators? The other thing is you have to react on the validators. So what does not work with them?
  • Style of Window

    11
    0 Votes
    11 Posts
    6k Views
    G
    This can be found in the "docs":http://doc.qt.nokia.com/4.7/index.html and "main window examples":http://doc.qt.nokia.com/4.7/examples-mainwindow.html . If you want to add a menu bar or a tool bar to a "normal" qwidget,. you have to add it amnually to a layout like all other widgets.
  • Run Qt on a thread and draw it in Glut

    2
    0 Votes
    2 Posts
    4k Views
    C
    For simple widget rendering you don't need QApplication::exec(), here is an example: @#include <QtGui> int main(int argc, char **argv) { QApplication app(argc, argv); QPushButton button("test"); button.resize(button.sizeHint()); QImage image(button.rect().size(), QImage::Format_RGB32); image.fill(0xffffffff); QPainter p(& image); button.render(&p); p.end(); image.save("image.png"); return 0; } @ If you do need input event processing etc from Qt as well, you might still be able to do it in a single thread. What you'd do is use glutIdleFunc() to register a function for GLUT to call when the GLUT event loop is idle. Then you'd call QApplication::processEvents() or potentially QApplication::processEvents(QEventLoop::WaitForMoreEvents, 10) or similar to prevent your application from using too much CPU. 10 is the timeout value in ms, which you might want to tweak a bit to keep the application responsive. Alternatively you could use glutTimerFunc() to call QApplication::processEvents() only every so often. I would avoid using threads if possible, since that is quite error-prone.
  • Shared Libraries Fail to Load in Mac OS

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Compiler flags

    7
    0 Votes
    7 Posts
    17k Views
    S
    Ok that was mistake to put rules file, I should set LEXSOURCES to lex source files. now set LEXSOURCES = lex.yy.cc and have 995 errors. I'm really confused
  • Missing some files

    5
    0 Votes
    5 Posts
    2k Views
    S
    Thank you very much :) I didn't saw the description of the network module where is written to be added to the pro file option for the network. Greetings and have nice day :)
  • ReadyRead() signal in QUdpSocket isn't being triggered.

    3
    0 Votes
    3 Posts
    3k Views
    M
    Thanks - that was a silly mistake.
  • Adding a notes to a TableView

    3
    0 Votes
    3 Posts
    2k Views
    S
    Two questions: Q1: How do I get a button to respond to the first click of the cell? Normally the first click activates the control witting the TableView. Q2: Do you know of any examples of multi-line rows which I can look at? Sam
  • [Moved] Problem using QXmlStreamReader to parse html tag

    3
    0 Votes
    3 Posts
    4k Views
    K
    Maybe instead of using TextEdit you could use "QWebView":http://developer.qt.nokia.com/doc/qt-4.7/qwebview.html instead. This way you can edit your content inside the WebView like a "WYSIWYG editor":http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/ by setting the content to editable. @htmlView->page()->setContentEditable(true);@ And as a bonus you can also parse your HTML doc using "QWebElement":http://developer.qt.nokia.com/doc/qt-4.7/qwebelement.html with Css like selectors.
  • WaitForFinished() fires early

    9
    0 Votes
    9 Posts
    17k Views
    T
    Thanks guys. Andrew you plucked the right nerve as the program itself need a lot of time to start and optimize. When setting the value to -1 it will wait till the program really exits. The final solution for everyone: @ QProcess *process; process = new QProcess( this ); process->start("myOptimizationApp"); process->waitForFinished(-1); @
  • [QtNetwork] How to identify dead connection

    9
    0 Votes
    9 Posts
    4k Views
    T
    It does work, but it waits for a usually rather long time out.
  • [Solved]How to move a widget to the center of the dialog?

    9
    0 Votes
    9 Posts
    6k Views
    T
    bq. There is one noob solution.. Setting the width of the label the same as the window and the X position to 0.. So the text will be at center and no need for the label to be at center.. But if there is another solution for this i would be glad to know :) Which is what a layout does for you...
  • Dynamically show/hide QTreeView items.

    4
    0 Votes
    4 Posts
    6k Views
    S
    Thanks a lot guys, I should have read the docs more carefully.
  • Help with what should i include for translation at my app.

    15
    0 Votes
    15 Posts
    7k Views
    L
    Using the arg function with tr() i see that at qt linquist i see the %1%2 part... Is it a problem? Is there a way not be able to see %1%2? EDIT: What about dots and "!"? EDIT2: What about unicode text? How can this be translatable? I mean something like this: @QString::fromUtf8("and it will change every ½ hour")@
  • How to use "windows-1252" charset ?

    9
    0 Votes
    9 Posts
    12k Views
    P
    I didn't even know that i must use wide chars. Thanks you, for all your help :)
  • 0 Votes
    2 Posts
    2k Views
    A
    For those curious about the above 'problem' that I reported, you can find some interesting information at Qt Centre where I also asked for some help: http://www.qtcentre.org/threads/42849-Plugin-can-load-or-not-depending-on-whether-my-app-is-launched-from-Qt-Creator-or-not.
  • Problem with arg at QString.

    19
    0 Votes
    19 Posts
    8k Views
    L
    It seems like the textbrowzer has a different type of html.. so i finally found a solution and it is: @ QString written = QString("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"><p margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%1%2").arg(tr("In random order")).arg(":</p><p margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span font-family:'Sans'; font-size:10pt;">Leon Vytanos <</span><a ><span font-family:'Sans'; font-size:10pt; text-decoration: underline; color:#ff5500;">leon.check.me@gmail.com</span></a><span font-family:'Sans'; font-size:10pt;">></span></p><p margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span font-family:'Sans'; font-size:10pt;">Alex Solanos <</span><a ><span font-family:'Sans'; font-size:10pt; text-decoration: underline; color:#ff5500;">alexsol.developer@gmail.com</span></a><span font-family:'Sans'; font-size:10pt;">></span></p></body></html>"); @ But the @ QString written = QString("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">@ part if i remove it there will be no problem, Should it be with or without this line?