Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qt4.8
    Log in to post

    • UNSOLVED Partial text selection in QTreeView
      General and Desktop • qtreeview qt4.8 selection • • Giert  

      7
      0
      Votes
      7
      Posts
      54
      Views

      @SGaist of course! This OP gave up, as I'm about to do while this discussion gave me hope of handling mouse events in the view myself This discussion didn't really go anywhere at all
    • SOLVED Using old QGLwidget from Qt 4.8.2
      General and Desktop • qt4.8 qglwidget qtopengl • • QttCoreTester  

      11
      0
      Votes
      11
      Posts
      93
      Views

      The issue is no longer observed with the latest Intel graphics driver beta version(27.20.100.8581). Fixed in latest release version 27.20.100.8587
    • SOLVED Cross Swipe Screens
      QML and Qt Quick • qml qt4.8 gestures • • Matheus da Silva Ribeiro  

      4
      0
      Votes
      4
      Posts
      64
      Views

      @Matheus-da-Silva-Ribeiro Please mark your answer as "Correct Answer" to change title to "Solved".
    • SOLVED can't find linker symbol for virtual table for 'QAbstractItemViewPrivate' value
      Mobile and Embedded • qt4.8 • • Andrea  

      5
      0
      Votes
      5
      Posts
      1943
      Views

      After some other tests, I think I've found which is the issue and how to solve it. Here a simplified snippet of my code, where there is a class Button used by a class Parent. When button is clicked, it could cause a panel change, or raise a message, or do some other actions (not detailed beause not relevant to the question). What I found is in slot onClicked of class Button: entering the first if, the program emits the signal request_GoToPrev, which cause the class Panel to delete current panel (and its childs, even compirsed the Button!) and raise a new one. But after emitting the signal and do all actions required, the program "comes back" to the point when it has emitted the signal and continue the instruction execution: when it reaches the second if it creashes because this is no more consistent. That's what it seems to be after my tests. Putting a return call just after the signal emission in the first if problem is solved. // HEADER: Button.h class Button : public QPushButton { Q_OBJECT public: Button( QWidget *parent = 0 ); ~Button(); signals: void request_GoToPrev(); //!< Go to previous panel void request_GoToNext( QString ); //!< Go to next panel void signal_Error( int ); //!< Error code private slots: void onClicked(); private: typ_Button_tags *widgetTags; //!< Pointer to the tags structure that defines the \ref Button widget typ_Shared *privateCtx; //!< Reference to runtime application structure }; // C: Button.cpp Button::Button( QWidget *parent ) : QPushButton(parent) { // Do some settings, like: font, stylesheet, focus, size.. } Button::~Button() { } void Button::onClicked() { // Callback to be called when button clicked if( !this->widgetTags->callbackClick.isEmpty() ) { emit this->request_GoToPrev(); /* !!! ATTENTION !!! * * Here the instruction return HAS to be written, otherwise the application crashes. * In fact, when running, the signal 'request_GoToPrev' is sent, but the flow of the * process should exit the call of this slot. * Doing that, 'this' is no more consistent after having emitted the signal, so the * application face a segmentation fault. */ return; } // Message box if( !this->widgetTags->msgText.isEmpty() ) { // Do some other actions on 'this'... } } // HEADER: Panel.h class Panel : public QMainWindow { Q_OBJECT public: Panel( QWidget *parent = 0 ); private slots: void on_GoToNext(int index); void on_GoToPrevious(); void on_Error(int errId); private: Button *Btn; }; // C: Panel.h Panel::Panel( QWidget *parent ) : QMainWindow(parent) { // Do some settings: font, stylesheet, focus, size... this->Btn = new Button( this ); connect( this->Btn, SIGNAL(request_GoToPrev()), this, SLOT(on_GoToPrevious()), Qt::UniqueConnection ); // Do some actions to layout the button inside the panel } void Panel::on_GoToPrevious() { // Do some check... delete this->Btn; // Do some actions... }
    • UNSOLVED can hide widget emit signal
      Mobile and Embedded • qt4.8 signals emit • • Andrea  

      6
      0
      Votes
      6
      Posts
      1990
      Views

      Hi, Out of curiosity, why do you want to "simulate" a button click ?
    • UNSOLVED Terminate QThread correctly
      Mobile and Embedded • qthread qt4.8 yocto dizzy • • Andrea  

      1
      0
      Votes
      1
      Posts
      376
      Views

      No one has replied

    • UNSOLVED Terminate QThread correctly
      General and Desktop • thread qt4.8 yocto dizzy • • Andrea  

      11
      0
      Votes
      11
      Posts
      10199
      Views

      Hi @Andrea WOW! Infinite loop to just sleep and process events. Why not just start a timer of PreciseTimer and allow the events to flow freely in the thread? Since you want it to run as fast as possible you can even set the timeout to 0 to run freely when there are no events. You can then look at thread->requestInterruption () and the thread will comply! Just make sure if you are doing something in a loop in the timer callback you check thread ()->isInterruptionRequested (). And best of all... NO CHECKING THE EVENT QUEUE! There is a nice writeup about proper thread use at: https://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/ You are basically there with your code. Just the loop is wasteful.
    • UNSOLVED segmentation fault triggered in QKeyMapper::changeKeyboard()
      General and Desktop • qt4.8 segfault pyqt4 • • Marc_Van_Daele  

      3
      0
      Votes
      3
      Posts
      866
      Views

      In the PyQt 4.9.4 code downoaded from https://sourceforge.net/projects/pyqt/files/PyQt4/ I find (Note that we are using 4.9.3 but I couldn't find the sources of that version) void sipQLineEdit::changeEvent(QEvent *a0) { sip_gilstate_t sipGILState; PyObject *sipMeth; sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[14],sipPySelf,NULL,sipName_changeEvent); if (!sipMeth) { QLineEdit::changeEvent(a0); return; } typedef void (*sipVH_QtCore_17)(sip_gilstate_t,PyObject *,QEvent *); ((sipVH_QtCore_17)(sipModuleAPI_QtGui_QtCore->em_virthandlers[17]))(sipGILState,sipMeth,a0); }
    • UNSOLVED libQgpsmm no such file or directory
      General and Desktop • qt4.8 armhf gpsd • • Simplexity  

      4
      0
      Votes
      4
      Posts
      1321
      Views

      @jsulm many thanks. Yes libgpsmm.h is ok, but the man page you pointed to also references libQgpsmm.
    • SOLVED list-elemetns are not "paint"
      QML and Qt Quick • qt4.8 list • • petzold  

      7
      0
      Votes
      7
      Posts
      1028
      Views

      Hi Ray, thanks for that tip. Now i understood the way how it works. i already tried and it works. thanks both of you -> solved
    • UNSOLVED Strategies for dealing with focus in qwidget project with custom input device
      Mobile and Embedded • focus qt4.8 qkeyevent • • dannas  

      4
      0
      Votes
      4
      Posts
      1777
      Views

      The Keyboard Focus in Widgets chapter from Qt's documentation already give some hints on how to handle that. If you build your focus chain properly you can then use nextInFocusChain and previousInFocusChain to avoid hardcoding stuff.
    • UNSOLVED Problem with pressing TAB key during QTableView cell edit
      General and Desktop • qtableview qt4.8 qitemdelegate editor tab • • Ben35  

      4
      0
      Votes
      4
      Posts
      3567
      Views

      I think i've found a solution. First, i install an eventFilter in my custom editor widget B on the internal spinbox : internalSpinbox->installEventFilter(this); Then, i implement eventFilter to treat the events on the spinbox and duplicate them to the parent: bool AbstractRatioQuantitySpinbox::eventFilter(QObject *object, QEvent *event) { // cf http://stackoverflow.com/questions/12145522/why-pressing-of-tab-key-emits-only-qeventshortcutoverride-event if (event->type() == QEvent::KeyPress) { auto keyEvent = static_cast<QKeyEvent *>(event); if (keyEvent->key() == Qt::Key_Tab || keyEvent->key() == Qt::Key_Backtab) { QApplication::postEvent( this, new QKeyEvent(keyEvent->type(), keyEvent->key(), keyEvent->modifiers())); return true; } } else if (event->type() == QEvent::FocusOut) { auto focusEvent = static_cast<QFocusEvent *>(event); QApplication::postEvent(this, new QFocusEvent(focusEvent->type(), focusEvent->reason())); return false; } return QWidget::eventFilter(object, event); }
    • UNSOLVED QT 4.8 and network SSIDs
      Mobile and Embedded • qt4.8 networking wifi connection • • timroberts  

      4
      0
      Votes
      4
      Posts
      1515
      Views

      Maybe QNetworkConfigurationManager and friend classes might be of help here.
    • UNSOLVED Linux (Ubuntu, Ubuntu Mate, Raspbian, ..) doesn't recognize enter-Event for On-Screen-Keyboard
      General and Desktop • linux qt4.8 qt5.5.1 touch universal acces • • Pixtar  

      1
      0
      Votes
      1
      Posts
      707
      Views

      No one has replied

    • UNSOLVED Adding signal on table items
      General and Desktop • qtablewidget qt4.8 pyqt4 • • yvesm  

      3
      0
      Votes
      3
      Posts
      1532
      Views

      Thanx bsomervi. Good point. I could go with an even more general signal (like itemClicked) but finding the signal that will more rightly pick only a checkbox checked/unchecked action would be optimal.
    • UNSOLVED Import from Odt
      General and Desktop • qt5 qt4.8 qtextdocument • • alan73  

      3
      0
      Votes
      3
      Posts
      1178
      Views

      Odt import file is very easy... OOReader.h is my work, is a subset from Okular KDE ... https://github.com/pehohlva/fop-miniscribus/blob/master/OO_Widged/oasis/OOReader.h 2017 the best way is now textutil from mac it convert doc rtf docx odt and many other format to txt or html to play in QTextedit ... void ZipDoc::handler_txtutils( const QString file ) { qDebug() << "### handler use-> " << __FUNCTION__; //// converter = /usr/bin/textutil if (converter.size() < 4) { text_s = QString("textutil -convert .. unable to read! or not mac osx."); } //// ram->LoadFile(file); //// const QByteArray base = ram->stream(); QTime myTimer; myTimer.start(); QProcess *process = new QProcess(NULL); process->setReadChannelMode(QProcess::MergedChannels); process->start(converter, QStringList() << "-convert" << "txt" << file << "-stdout", QIODevice::ReadOnly ); if (!process->waitForFinished()) { text_s = QString("Unable to read!."); } else { text_s = strip_tag(process->readAll()); } qDebug() << "### handler_txtutils time-> " << myTimer.elapsed(); }
    • UNSOLVED error while loading shared libraries: libQtWebview.so.1: cannot open shared object file: No such file or directory
      General and Desktop • qserialport qt4.8 binary • • Narthan  

      3
      0
      Votes
      3
      Posts
      2059
      Views

      Ok, even i tried copying by libraries to the deploying system, and exported it , then binary will execute, but serial port will not work as in the code.,
    • unable to get colored image using v4l2 and qt+qml onClicked
      Mobile and Embedded • qt4.8 v4l2 colored image • • Anas_Deshmukh  

      4
      0
      Votes
      4
      Posts
      1912
      Views

      There already a camera application(qtcam) integrated qtquick and v4l2, please try clone the source from the below link, https://github.com/econsysqtcam/qtcam.git Application available in launchpad also for ubuntu 12.04 & 14.04
    • How to let the QGraphicsView centered on the QWidget?
      General and Desktop • qt4.8 • • Vincent_Xu  

      5
      0
      Votes
      5
      Posts
      1451
      Views

      @Jeroentjehome Thank you, I'll try it
    • [SOLVED]Using mobility multimedia in Qt 4.8 msvc2010 projects. (QCamera)
      General and Desktop • qtmultimedia qcamera qt4.8 • • musimbate  

      4
      0
      Votes
      4
      Posts
      1371
      Views

      You're welcome ! Happy coding !
    • Utf-8 coding problem
      General and Desktop • qt4.8 utf-8 • • mkolenda  

      4
      0
      Votes
      4
      Posts
      1444
      Views

      If I'm not completely mistaken Qt 4.8 does not assume c-strings to be in UTF-8 by default, but instead assumes they are in the systems default encoding. Have you tried with: QString::fromUtf8("mystring");?
    • Display BMP image from raw bitmap file
      Mobile and Embedded • qlabel qt4.8 pixmap am335x raw images bitmap • • vk41286  

      6
      0
      Votes
      6
      Posts
      4430
      Views

      Do you have Qt configured to use that display ?
    • SOLVED App is not a valid Win32 application
      General and Desktop • qt5.4 qt4.8 mingw64 windows xp • • yeckel  

      4
      0
      Votes
      4
      Posts
      4844
      Views

      Good to know that you have found your problem and solved it. Please mark thread as solved. This makes it easier for others.
    • Qt creator 3.4.0 with Qt 4.8 c++ Moving to Symbol Definition or Declaration doesn't work
      Tools • c++ windows 7 qt4.8 qtcreator 3.4.0 • • umen242  

      1
      0
      Votes
      1
      Posts
      568
      Views

      No one has replied

    • Widget/Window multiple screens
      General and Desktop • qt4.8 • • kmlnvm  

      4
      0
      Votes
      4
      Posts
      877
      Views

      AFAIK, there's no pre-built widget for that. You should take a look at e.g. KDE's screen savers implementation to see how they do it.
    • (SOLVED) Read everything after an specific keyword
      General and Desktop • qt4 qstring qfile file qt4.8 read • • jjan  

      16
      0
      Votes
      16
      Posts
      8622
      Views

      @jjan Just for an iteration the code reads line by line. As long as the search text is found, it will provide the remainder of the line. There is real dependency to the content as long as it is displayble (probably also some non-displayable characters). There are some special characters marking the end of lines (line feed (LF) and carriage return (CR) are those at least).
    • 如何把Qt4.8 addin到VS2013中
      Chinese • qt4.8 vs2013 addin visual st • • QuLei  

      2
      0
      Votes
      2
      Posts
      3025
      Views

      你解决了吗 可以联系我吗qq86252715,我现在也在搞这个
    • is there addin for Qt 4.8.6 with vs2013
      General and Desktop • qt4.8 vs2013 addin visual st • • QuLei  

      1
      0
      Votes
      1
      Posts
      943
      Views

      No one has replied

    • Dialog is visible only above parent widget
      General and Desktop • qwidget qdialog qt4.8 • • Ruslan F.  

      2
      0
      Votes
      2
      Posts
      850
      Views

      My comment might not be a reason it does not work for you, but every QObject derived class require Q_OBJECT macro at least if you have any signal/slot defined in it. I never tried to write template with such macro and believe it is not supported and will be not handled properly by mocing. It might be possible manually create required code instead, but I doubt this solution will be portable. In other words my impression is templates are no-no with QObject derived classes.
    • Cellchanged in a TableWidget
      General and Desktop • c++ qtablewidget qt4.8 cellchanged editing • • Adrianos  

      2
      0
      Votes
      2
      Posts
      1348
      Views

      @Adrianos the Cellchanged signal is emitted after the content change so you can't prevent modefication of a cell by this signal
    • How can i update View with Wheelevent, when QDoubleSpinBox value changed in a table?
      General and Desktop • qt4.8 qspinbox mousescroll valuechanged • • Adrianos  

      3
      0
      Votes
      3
      Posts
      757
      Views

      @SGaist Hi thank you, I have call a class to update it: MainWidget::getInstance()->AllViewsUpdate(true);
    • SOLVED [QTableView remove selected rows?
      General and Desktop • qt4.8 • • Peppy  

      27
      0
      Votes
      27
      Posts
      24142
      Views

      with this model only i am inserting and updating data into qtableview but delete is not happening ?,if u want i can share the code insert and updating data .......