Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • Configuring QtSDk on Windows 7

    4
    0 Votes
    4 Posts
    3k Views
    K
    If you have installed qt sdk as default configuration it has typically not an integration of msvc.net . Please provide name and/or link of what you have installed. If you like to have only an IDE this is "Qt Creator" than.
  • How to add check box inside qtree widget?

    3
    0 Votes
    3 Posts
    19k Views
    A
    Thank u so much Andre...:)
  • A question on what Widget to use.

    4
    0 Votes
    4 Posts
    2k Views
    A
    I think a QListView in combination with a [[doc:QStandardItemModel]] or even a [[QStringListModel]] is just as simple, and way more flexible.
  • [Moved] Show data in lineEdit

    2
    0 Votes
    2 Posts
    1k Views
    A
    One way is to use a [[doc:QSqlTableModel]] and a [[doc:QDataWidgetMapper]].
  • 0 Votes
    2 Posts
    2k Views
    J
    It seesm to be a Qt bug. There is a open isssue "QTBUG-10706":https://bugreports.qt.nokia.com/browse/QTBUG-10706. It wold be great if someone can provide me any workaround. [EDIT: added link to bug, Volker]
  • QRegisterMetaType for vectors of custom Datatype

    2
    0 Votes
    2 Posts
    2k Views
    C
    At what point are you getting an error? When you compile, or during the run? And is that actually the full error text? Your example compiles and runs fine for me (though I haven't tried actually using the type).
  • QTextDocument::print ignores # of copies from QPrintDialog

    11
    0 Votes
    11 Posts
    5k Views
    C
    Well, I wouldn't say "no" closer: you know where the problem isn't now, that's a start. I'd start putting in some more breakpoints in between the call to print() and the call to setProperty(), in places where you expect the code to go, and try to figure out at what point it's deciding not to pass the copy count onto the printer driver.
  • QTcpServer with QThreadPool, for long term connections.

    4
    1 Votes
    4 Posts
    9k Views
    D
    I also would like to see some example of this, please.
  • [solved]#include <QScriptEngine> error

    6
    0 Votes
    6 Posts
    7k Views
    A
    nooo :D:D thnQQQ =) I don't know how did I lose smthin like this :$
  • 0 Votes
    6 Posts
    9k Views
    R
    Thanks to Volker as well for the reply.
  • Elegent data transmission and GUI construction

    8
    0 Votes
    8 Posts
    3k Views
    C
    Well, presumably you need to actually use this data at the other end of the communication, so at some point you have a requirement that you can access a particular variable in a particular name: that's got to be coded in one way or another. The fact is that you either have to maintain two independent descriptions of this data structure (one for constructing the GUI and one for actually using within the code), or you need to generate the GUI dynamically from the one in the code (which typically doesn't contain enough information to do a proper job). The way my software works is that every time I change my data input requirements (say by adding a new user input), I also modify an XML file that completely documents that variable's requirements, as well as some niceties like a bit of documentation. A simplistic column-of-widgets user interface can then be generated from that XML file. This has the added advantage of providing an automated way of generating simple documentation or the inputs, etc.
  • Computer Unique ID

    10
    0 Votes
    10 Posts
    10k Views
    C
    Interesting, broadpeak. Do you know how it works? On systems with that command installed it works well, but not all of my systems have it. Presumably, however, the data is accessible programmatically somehow.
  • Qt and layout problems

    8
    0 Votes
    8 Posts
    2k Views
    B
    [quote author="Andre" date="1325084252"]There is no layout for the top level dialog, I think. [/quote] I see the same!
  • How to apply WindowFlags to MdiSubWindow correctly?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    7 Posts
    27k Views
    S
    Hi Andre, I tried @QPalette p = (ui->progressBar->palette()); p.setColor(QPalette::Foreground, Qt::red); p.setColor(QPalette::Background, Qt::green); p.setColor(QPalette::Highlight, Qt::yellow); ui->progressBar->setPalette(p);@ It did not work. Now I use the original geometry of the bar to keep the original looking except the color. The result is close to what I wanted. @ QRect r = ui->progressBar->geometry(); QString st = QString ( "QProgressBar::chunk {" "background-color: #ff0000;" "}"); st.append("QProgressBar {" "border: 1px solid grey;" "border-radius: 2px;" "text-align: center;" "background: #eeeeee;" "}"); ui->progressBar->setStyleSheet(st); ui->progressBar->setGeometry(r.x(), r.y()+3, r.width(), r.height()-6 ); @ I develop this application on Mac and Linux. Do you have better method for this matter?
  • Architecture of server

    3
    0 Votes
    3 Posts
    2k Views
    V
    Another nice but tough way: create a grammar (e.g. using Extended Backus–Naur Form), embed code into that grammar and feed a parser generator (e.g ANTLR) with your stuff. Should work, good luck. ;-D
  • Fonts on Mac vs Windows

    4
    0 Votes
    4 Posts
    3k Views
    V
    You could embed a font in your application's resource (if you got the font license to do that) and dynamically add the font ressource to the font database of the application. Maybe that helps to have the same look on windows and mac. ( see "http://developer.qt.nokia.com/doc/qt-4.8/qfontdatabase.html#addApplicationFontFromData":http://developer.qt.nokia.com/doc/qt-4.8/qfontdatabase.html#addApplicationFontFromData )
  • QTreeWidget item and colored text

    6
    0 Votes
    6 Posts
    18k Views
    S
    I found a solution, but there were problems. When I don't redirect to parent painter i have not stylesheet. But when I redirect I have two text: text by control(rich text) and text by qtreewidgetitem. What I should do? @ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyleOptionViewItemV4 newOption(option); initStyleOption(&newOption, index); painter->save(); QTextDocument doc; doc.setHtml(newOption.text); newOption.text = ""; newOption.state &= ~QStyle::State_Selected; newOption.state &= ~QStyle::State_HasFocus; newOption.state &= ~QStyle::State_MouseOver; newOption.widget->style()->drawControl(QStyle::CE_ItemViewItem, &newOption, painter); painter->translate(newOption.rect.left() + 20, newOption.rect.top()); QRect clip(0, 0, newOption.rect.width(), newOption.rect.height()); doc.drawContents(painter, clip); painter->restore(); // QStyledItemDelegate::paint(painter, newOption, index); }@
  • Compute-intensive paintEvent

    6
    0 Votes
    6 Posts
    3k Views
    G
    [quote author="Andre" date="1325074863"]There is an example for drawing using threads, from the top of my head it is some fractal drawing thing. That might give you some clues on how to implement it.[/quote] It's in examples/threads/mandelbrot and creates a Mandelbrot set.
  • Facing problem to arrange UI items.

    4
    0 Votes
    4 Posts
    2k Views
    F
    Moreover, since you are learning Qt, learn it well. I don't know any windowing system that does not provide some kind of layout managers, as well as direct positioning. But in the long distance layout-ing pays much more!