Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • QToolbox remove item

    4
    0 Votes
    4 Posts
    5k Views
    A
    And then just delete the item.
  • Are text descriptions posible?

    15
    0 Votes
    15 Posts
    5k Views
    R
    The spacing issue comes from HTML <p> margin style, which if not set, is defaulted to some value. However, I advice you to make all your texts as HTML templates, since they are static, they will only have color template for highlighting. I took my scale.txt file and duplicated it's text twice - no spacing issue with the same executable.
  • Show a BMP image after a video player

    2
    0 Votes
    2 Posts
    2k Views
    J
    You connect the signal finished from video player to your slot finished, load image to QPixmap and add it to you graphics view or whatever you have. "Signals and slots":http://doc.qt.nokia.com/4.7-snapshot/signalsandslots.html And take a look "here":http://qt-project.org/forums/viewthread/13613/, how to display QPixmap on QGraphicsScene Regards, Jake
  • KeyPressEvent while dragging

    8
    0 Votes
    8 Posts
    4k Views
    S
    Yes it seems that the keyPressEvent() function is blocked when dragging an item from the list/table. But, if you press "escape(Esc)" on the keyboard the dragging of item is cancelled ,still keyPressEvent is not fired.
  • Embedding Qwidget into X11 window using X11 programming

    3
    0 Votes
    3 Posts
    5k Views
    M
    @sruthihsr: Please can you tell where do you insert XMapRaised ?
  • About Qt pressure support on Pen/Mouse tablets (Wacom, Genius, etc)

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Is the QStandarditemModel - finditems() fast?

    2
    0 Votes
    2 Posts
    2k Views
    A
    well, why don't you check the source code to see how it is implemented?
  • How to create virtual SLOT for action

    4
    0 Votes
    4 Posts
    3k Views
    B
    Thanks RaubTieR. Works great.
  • Using QSqlRelationalTableModel issue

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Qtimer event Slot 1 minute before

    6
    0 Votes
    6 Posts
    4k Views
    E
    ok thanks all for your helps.
  • Adding notes to class pages?

    13
    0 Votes
    13 Posts
    5k Views
    F
    Env: Qt 4.7, OS X 10.6.8, 8 cores, 8 gb, 3 GHz, Macpro, three PCI display cards, six monitors. Behavior is the same on my laptop, though, which is pretty different other than OS. I have: @ CPlotter::CPlotter(QWidget *parent) : QFrame(parent) { setMinimumHeight(384); setMinimumWidth(1280); QSizePolicy policy( QSizePolicy::Expanding, QSizePolicy::MinimumExpanding ); setSizePolicy(policy); setMinimumHeight(384); setMinimumWidth(1280); etc... @ ...and... @ class CPlotter : public QFrame { Q_OBJECT public: explicit CPlotter(QWidget *parent = 0); ~CPlotter(); ...etc @
  • Prevent Translation of Property

    2
    0 Votes
    2 Posts
    2k Views
    M
    replace the line <string>TextLabel</string> with <cstring>TextLabel</cstring>
  • Random crash when the program starts

    19
    0 Votes
    19 Posts
    7k Views
    D
    Hi, After some years of research, i think i've found the problem. The variable that contains a crazy value is initialized in the first thread. And, this variable is used in the second thread. When the program starts, it do that : @lesLiensEtDebits.Traiter(index); lesObs.Traiter(TraitementObs::DROPSETCHARGES);@ NOTE : Traiter( ... ) is a method which start the thread with start(). I put one cout where the 1st thread begin, and another when the 2nd one begin too. When the program starts successfully, there is "one" and "two" at the output. When the program CRASHS, there is "two" and "one" !! IT'S CRAZY ! The second thread began before the first one !! So, i trying to do that correctly, so something like @lesLiensEtDebits.traiter(index); connect(&lesLiensEtDebits, SIGNAL(finished()), &lesObs, SLOT(Traiter(TraitementObs::DROPSETCHARGES)));@ But the program said me an error , it don't find this slot.. The slot is @ void Traiter(TraitementObs::type _choix );@ So i want to pass a parameter in the slot, i don't know if we can do that. Any idea for how to start the 2nd thread AFTER the 1st one finished ? Thanks for your help,
  • Search in my Model efficient way?

    1
    0 Votes
    1 Posts
    902 Views
    No one has replied
  • Qt4.8.0 QAxObject error but 4.7.4 is OK.

    3
    0 Votes
    3 Posts
    5k Views
    J
    Hi, here's what I had to do to get QAxObject back to functional after upgrading the Qt SDK suite (Qt Creator 2.0.1, Qt 4.7.0 to Qt Creator 2.4.1, Qt 4.8.0), with MinGw, without msvs. Starting from a standard Qt SDK installation (./ is the Qt SDK install directory) 1 - Changed the include paths in the following .h files, as there were "file not found" complaints when compiling: in ./Desktop/Qt/4.8.0/mingw/include/ActiveQt/qaxbase.h //#include "../../src/activeqt/container/qaxbase.h" #include "../../QtSources/4.8.0/src/activeqt/container/qaxbase.h" in ./Desktop/Qt/4.8.0/mingw/include/ActiveQt/qaxwidget.h //#include "../../src/activeqt/container/qaxwidget.h" #include "../../QtSources/4.8.0/src/activeqt/container/qaxwidget.h" in ./Desktop/Qt/4.8.0/mingw/include/ActiveQt/qaxfactory.h //#include "../../src/activeqt/control/qaxfactory.h" #include "../../QtSources/4.8.0/src/activeqt/control/qaxfactory.h" in ./Desktop/Qt/4.8.0/mingw/include/ActiveQt/qaxaggregated.h //#include "../../src/activeqt/control/qaxaggregated.h" #include "../../QtSources/4.8.0/src/activeqt/control/qaxaggregated.h" in ./Desktop/Qt/4.8.0/mingw/include/ActiveQt/qaxobject.h //#include "../../src/activeqt/container/qaxobject.h" #include "../../QtSources/4.8.0/src/activeqt/container/qaxobject.h" 2 - As suggested in http://www.qtcentre.org/archive/index.php/t-46402.html?s=113443eeba8f6e35dc6aa161ad2bdb7c , added CONFIG += create_prl CONFIG += link_prl to ./QtSources/4.8.0/src/activeqt/container/container.pro but also to ./QtSources/4.8.0/src/activeqt/control/control.pro so I could get the QAxServer.prl QAxContainer.prl QAxServerd.prl QAxContainerd.prl files 3 - Opened and compiled (for release AND debug) the projects found at: ./QtSources/4.8.0/src/activeqt/container/container.pro ./QtSources/4.8.0/src/activeqt/control/control.pro Make sure you clean them if you tried to compile before the above modifications 4 - Copy the following files (original path may change according to your config when opening the .pro projects for the first time): ./QtSources/4.8.0/src/activeqt/control-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/debug/QAxServerd.prl ./QtSources/4.8.0/src/activeqt/control-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/debug/libQAxServerd.a ./QtSources/4.8.0/src/activeqt/control-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release/release/QAxServer.prl ./QtSources/4.8.0/src/activeqt/control-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release/release/libQAxServer.a ./QtSources/4.8.0/src/activeqt/container-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release/release/QAxContainer.prl ./QtSources/4.8.0/src/activeqt/container-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release/release/libQAxContainer.a ./QtSources/4.8.0/src/activeqt/container-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/debug/QAxContainerd.prl ./QtSources/4.8.0/src/activeqt/container-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/debug/libQAxContainerd.a to ./Desktop/Qt/4.8.0/mingw/lib/ Be careful not to copy these .prl files, which I'm not sure would work: ./QtSources/4.8.0/src/activeqt/XXXXX-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/release/XXXXX.prl ./QtSources/4.8.0/src/activeqt/XXXXX-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release/debug/XXXXX.prl (they are in the "debug" directory under the "release" build and vice-versa) 5 - Reboot Yeah, weird, but after doing all that, I kept getting "undefined reference" errors when compiling my projects (some windows library caching?). After a reboot, it worked fine. BR, Joao S Veiga
  • Win32 GetClassName and Qt

    4
    0 Votes
    4 Posts
    5k Views
    M
    bq. And if I change the Qt source code to modify the className, my change doesn’t break anything, does it? I'd venture an educated guess that anytime you change the Qt source code, you run the risk of breaking something.
  • Validating lineEdit fields

    17
    0 Votes
    17 Posts
    15k Views
    F
    You guys are awesome! Thanks a lot
  • Get container index when using QtConcurrent

    8
    0 Votes
    8 Posts
    4k Views
    A
    Yes, C++11 is cool for this, but unfortunately my compiler doesn't support these expressions yet. I'd still prefer a version with iterators though, I think: @ QVector<double> vector(SIZE); double factor = 10; QVector<double>::iterator begin = vector.begin(); QtConcurrent::map(vector, [&factor, begin](QVector<double>::iterator it) { value = factor * (it - begin); }); @
  • ODBC Driver issue

    14
    0 Votes
    14 Posts
    8k Views
    S
    I have the same problem with a Visual Fox Pro database with the ISO Latin-1 character encoding. I use Qt 4.7.4.
  • QShortcut and Mouse Event

    5
    0 Votes
    5 Posts
    4k Views
    L
    [quote author="Tweety" date="1334306908"]Thanks for your reply. Could you provide me an example? [/quote] There should be some code somewhere here lying around... here you go. @ class MouseShortcut : public QObject { Q_OBJECT public: enum ClickType { SingleClick, DoubleClick }; MouseShortcut(MouseShortcut::ClickType type, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, QObject *parent = 0) : QObject(parent) { type_ = type; buttons_ = buttons; modifiers_ = modifiers; doubleClickFilter_.setSingleShot(true); doubleClickFilter_.connect(&doubleClickFilter_, SIGNAL(timeout()), this, SIGNAL(activated())); } signals: void activated(); protected: bool eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::MouseButtonPress) { if (type_ == MouseShortcut::SingleClick) { QMouseEvent mouseEvent = static_cast<QMouseEvent>(event); if ((buttons_.testFlag(mouseEvent->button())) && (modifiers_ == mouseEvent->modifiers())) { doubleClickFilter_.start(QApplication::doubleClickInterval()); } } } else if (event->type() == QEvent::MouseButtonDblClick) { if (type_ == MouseShortcut::SingleClick) { doubleClickFilter_.stop(); } else { QMouseEvent mouseEvent = static_cast<QMouseEvent>(event); if ((buttons_.testFlag(mouseEvent->button())) && (modifiers_ == mouseEvent->modifiers())) { emit activated(); } } } return QObject::eventFilter(object, event); } private: MouseShortcut::ClickType type_; Qt::MouseButtons buttons_; Qt::KeyboardModifiers modifiers_; QTimer doubleClickFilter_; }; MouseShortcut *scA = new MouseShortcut(MouseShortcut::SingleClick, Qt::LeftButton, Qt::ControlModifier); MouseShortcut *scB = new MouseShortcut(MouseShortcut::DoubleClick, Qt::LeftButton | Qt::RightButton, Qt::AltModifier | Qt::ShiftModifier); QObject::connect(scA, SIGNAL(activated()), ...); QObject::connect(scB, SIGNAL(activated()), ...); widget.installEventFilter(scA); // widget-local shortcut application.installEventFilter(scB); // application-wide shortcut @ Snippet to terminal.