跳到內容

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k 主題 456.4k 貼文
  • [SOLVED] PaintEvent, drawing many dots/points using Array.

    8
    0 評價
    8 貼文
    6k 瀏覽
    G
    Hi MrNoway, You should have a look at the docs for these classes :-) QPoint is just what the name says, a point. x and y. A QVector<QPoint> is a dynamic array of QPoint objects foreach is a for each loop (shortcut for for(i = 0; i < vec.count(), ++i) {pt = vec[i]; ...) These are helpers that Qt provides the users :-)
  • Transparent QWebView over Phonon VideoWidget

    8
    0 評價
    8 貼文
    7k 瀏覽
    V
    bq. the solution works, but do you think there would be probably a better and cleaner solution ? (referring to http://stackoverflow.com/questions/4473709/play-a-video-with-custom-overlay-graphics/13120078#13120078) I am not sure if this solution is better or cleaner but it worked for me. Here is a complete code example, which finally worked after one day of trying... http://www.qtcentre.org/archive/index.php/t-39496.html Good Luck!
  • [SOLVED] QTextEdit: deleting text to document start disable fontSize

    6
    0 評價
    6 貼文
    3k 瀏覽
    _
    method QTextEdit::setFontPointSize(qreal) is not useless at all. This method sets current font size. Check difference: mainwindow.h @ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QtGui/QMainWindow> #include <QtGui/QTextEdit> #include <QtGui/QPushButton> class MainWindow : public QMainWindow { Q_OBJECT private: QTextEdit *m_TextEdit; QPushButton *m_IncFontBtn; int m_FontSize; public slots: void increaseFontSizeBySettingNewFont(); void increaseFontSizeByTextEditMethod(); public: MainWindow(QWidget *parent = 0); }; #endif // MAINWINDOW_H @ mainwindow.cpp @ #include "MainWindow.h" #include <QFont> #include <QHBoxLayout> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { m_TextEdit = new QTextEdit; m_IncFontBtn = new QPushButton("increase font size"); m_FontSize = 9; setCentralWidget(new QWidget(this)); QHBoxLayout* lay = new QHBoxLayout(this->centralWidget()); lay->addWidget(m_TextEdit); lay->addWidget(m_IncFontBtn); // change value of this param for connect to different slots bool checkincreaseFontSizeBySettingNewFont = true; if (checkincreaseFontSizeBySettingNewFont) connect(m_IncFontBtn, SIGNAL(clicked()), SLOT(increaseFontSizeBySettingNewFont())); else connect(m_IncFontBtn, SIGNAL(clicked()), SLOT(increaseFontSizeByTextEditMethod())); } void MainWindow::increaseFontSizeBySettingNewFont() { QFont font = m_TextEdit->font(); font.setPointSize(++m_FontSize); m_TextEdit->setFont(font); } void MainWindow::increaseFontSizeByTextEditMethod() { m_TextEdit->setFontPointSize(++m_FontSize); } @
  • [SOLVED] Call of a subclassed QWidget method crashes the program

    7
    0 評價
    7 貼文
    3k 瀏覽
    G
    Hi NeedDeen, fine that I could help. By the way: Windows compilers also know debug options. MSVC, Creator, whatever.. :-)
  • QXmlQuery and XPath expression

    1
    0 評價
    1 貼文
    3k 瀏覽
    尚無回覆
  • Getting a table cell content through a proxy from a model

    3
    0 評價
    3 貼文
    1k 瀏覽
    B
    Thanks! I will see these examples.
  • Custom QGraphicsItem mousePressEvent for single click works only when double click [Solved]

    2
    0 評價
    2 貼文
    7k 瀏覽
    M
    Hi, Every time that you override those virtual methods (mouseDoubleClickEvent, mouseMoveEvent, mousePressEvent...) you need to call base class metod too. @ QGraphicsScene::mousePressEvent(event); @ And you don't need to call: @ QGraphicsItem::mousePressEvent(event); @ So, works with: @ QGraphicsView::mousePressEvent(event); @ because bq. The view receives input events from the keyboard and mouse, and translates these to scene events (converting the coordinates used to scene coordinates where appropriate), before sending the events to the visualized scene. —http://doc.qt.digia.com/qt/graphicsview.html
  • QODBC driver not loaded

    2
    0 評價
    2 貼文
    1k 瀏覽
    C
    Simply, you don't have the QODBC driver. It is a plugin. You only have QSQLITE on your "arsenal". You have to build the QODBC driver from source.
  • Reading xml through Qt

    7
    0 評價
    7 貼文
    5k 瀏覽
    B
    Thanks Andre ..Your answer always helps me a lot ...
  • Remove Header from QTreeView

    1
    0 評價
    1 貼文
    3k 瀏覽
    尚無回覆
  • Sort System Drives via QSortFilterProxyModel

    1
    0 評價
    1 貼文
    678 瀏覽
    尚無回覆
  • Help using QCompleter with QFileSystemModel

    2
    0 評價
    2 貼文
    2k 瀏覽
    E
    Oh, I guess I should say that I'm using Qt 4.8.1 on Linux.
  • Is there a tool to convert translations in an Excel spreadsheet to QT Phrase Book format?

    2
    0 評價
    2 貼文
    3k 瀏覽
    T
    Ok, I figured this out, and it was easier than I thought. In Excel, just add columns with the xml tags before and after the columns with the English and translated strings, add a few other tags to make it recognizable as a .qph file, get it into text format, delete tabs and paragraph marks, then open in QT Linguist as a Phrase Book. No problem!
  • SDK used inconsistently on the Devnet

    6
    0 評價
    6 貼文
    2k 瀏覽
    M
    Thank you for clearifying this issue ;)
  • QTexttable wont align

    2
    0 評價
    2 貼文
    902 瀏覽
    A
    found the solution
  • QTextTable draw table lines

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • Immediate Validation and editingFinished signal

    5
    0 評價
    5 貼文
    3k 瀏覽
    T
    Hi! Have you considered "QLineEdit::setValidator":http://doc-snapshot.qt-project.org/4.8/qlineedit.html#setValidator ?
  • [SOLVED] Weird Crash on Run

    5
    0 評價
    5 貼文
    3k 瀏覽
    JKSHJ
    You're welcome. :) By the way, I'm sure the author of that DLL would appreciate a bug report too.
  • How to change the time delay before a QToolTip shows?

    1
    0 評價
    1 貼文
    3k 瀏覽
    尚無回覆
  • Sort the System Drives in QTreeView using QSortFilterProxyModel

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆