Ticket #343: MainAppFrameWindow3.cpp.patch

File MainAppFrameWindow3.cpp.patch, 2.4 KB (added by alx, 8 years ago)
  • MainAppFrameWindow3.cpp

     
    1212#include <QtWidgets/QHeaderView>
    1313#include <QtWidgets/QMessageBox>
    1414#include <QtNetwork/QNetworkInterface>
     15#include <QToolTip>
    1516#include <libssh/sftp.h>
    1617#include <iostream>
    1718#include <sstream>
     
    6364static bool bExitSignal = false;//Êîãäà true, íî ïîñëàííî ñîîáùåíèå î çàêðûòèå ãëàâíîãî îêíà ïðèëîæåíèÿ, âñå ïîòîêè ñâÿçàííûå ñ ãëàâíûì îêíîì äîëæíû íåìåäëåííî ïðåêðàòèòü ðàáîòó
    6465static bool bAudioFilterProcessed = false;//Êîãäà true, ïðîèñõîäèò ñ÷èòûâàíèå ñïèñêà àóäèîçàïèñåé
    6566
     67class SoundRecordsWidget : public QTableWidget {
     68public:
     69    virtual bool viewportEvent(QEvent *event);
     70};
     71
     72bool SoundRecordsWidget::viewportEvent(QEvent *event)
     73{
     74    if (event->type() == QEvent::ToolTip) {
     75        QHelpEvent *helpEvent = static_cast<QHelpEvent*>(event);
     76        QModelIndex index = indexAt(helpEvent->pos());
     77        if (index.isValid()) {
     78            QSize sizeHint = itemDelegate(index)->sizeHint(viewOptions(), index);
     79            if (sizeHint.width() <= visualRect(index).width()) {
     80                QToolTip::hideText();
     81                return true;
     82            }
     83        }
     84    }
     85    return QTableView::viewportEvent(event);
     86}
     87
    6688MainAppFrameWindow3::MainAppFrameWindow3() :QMainWindow(NULL), pLefttoolbar(NULL), pHomeAction(NULL), pSoundAction(NULL), pConfSetupAction(NULL), pPreferencesAction(NULL), pCentralWidget(NULL), pErrorMessageWidget(NULL), iWarningSeconds(0), pMainWindowStackFrame(NULL), pSplitter(NULL),
    6789pGroupUsersTreeWidget(NULL), iPrevEnteredCellx(-1), iPrevEnteredCelly(-1), pConferenceWidget(NULL), bConferenceListRefreshing(false), pUsersWidget(NULL), pConferenceStartEndButton(NULL), iPrevSelectedParticipanty(-1), bParticipantListRefreshing(false), ptelephonedlg(NULL), pUserInfodlg(NULL), pUserEditdlg(NULL), pLogView(NULL),
    6890pSplitterSoundPlay(NULL), bSplitterWasAdjusted(false),
     
    676698 pSoundRecordConferenceLabelFrame->setAutoFillBackground(true);
    677699 pSoundRecordConferenceLabelFrame->setPalette(SoundRecordConferencewidgetPalette);
    678700 pSoundRecordConferenceWidget->setLayout(pSoundRecordConferenceLayout);
    679  pSoundRecords = new QTableWidget();
     701 pSoundRecords = new SoundRecordsWidget();
    680702 pSoundRecords->setColumnCount(4);
    681703 pSoundRecords->horizontalHeader()->hide();
    682704 pSoundRecords->verticalHeader()->hide();